From 72a3e22fbc8e81e6c29c81ac8184d3a0ed3abee4 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Mon, 14 Sep 2026 06:23:08 +0200 Subject: [PATCH] Bound a text field's width from medium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit M3 § Text Fields, Behaviour: compact may let a field span full width, but medium and expanded must bound it — "never let it span the full width of a large screen". Nothing in the package capped a field (plan step 24, audit docs/audits/m3-alignment/inputs.md § Missing). From `medium` a field now stops at 40rem — the site names no number, so the header says where this one comes from — which a `max-w-*` class beats and `full` takes off. The search bar already carries M3's own 720px. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9 --- .../skills/livewire-material-development/SKILL.md | 1 + resources/css/components/field.css | 14 ++++++++++++++ resources/views/components/field.blade.php | 6 ++++++ resources/views/components/input.blade.php | 6 ++++-- resources/views/components/textarea.blade.php | 8 +++++--- resources/views/showcase/sections/fields.blade.php | 8 ++++++++ tests/Feature/Components/FieldTest.php | 10 ++++++++++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/resources/boost/skills/livewire-material-development/SKILL.md b/resources/boost/skills/livewire-material-development/SKILL.md index c9c00ee7..74511648 100644 --- a/resources/boost/skills/livewire-material-development/SKILL.md +++ b/resources/boost/skills/livewire-material-development/SKILL.md @@ -555,6 +555,7 @@ M3 text fields. `variant`: `outlined` or `filled`; without it, `config('livewire - ``: `icon`, `icon-right`, `prefix`, `suffix`, `clearable`, `copyable` (copies the value, confirms with a snackbar), `counter`, `size` (`sm` 40px, `xs` 32px — for unlabelled toolbar controls; give them `aria-label`), `mono`. - ``: a reveal button; `icon`, `size`. - ``: grows from `rows` (3) to `max-rows`, then scrolls; `:autogrow="false"` for a fixed, hand-resizable one; `counter`. +- Width: M3 asks that a text field never span the full width of a large screen, so from `medium` (600px) every field stops at **40rem**; below that it fills its pane. A `max-w-*` class on the component narrows or widens it, and `full` (on ``, ``, ``) takes the bound off for a field that really is the width of its pane — a search row, an editor. ``'s bar carries M3's own bound, 720px. - `counter` (on `` and ``) puts M3's character counter at the end of the supporting-text row, beside the hint or the error: `n/max`, counted on every keystroke against the field's own `maxlength`, and in the error colour once the value is past it. It needs `maxlength` — without one there is nothing to count against and nothing is drawn. It is said as "Character count, 5/20" from a polite region a second after typing stops. - ``: native ``: `type`, `min`, `step`, + the supporting-text row; `full` lets the field span its pane past the 40rem M3 bounds it to + from `medium`. Every other attribute reaches the ``: `type`, `min`, `step`, `readonly`, `wire:model` and the rest. Errors are read from the bag under the `wire:model` name. The placeholder is a single space when none is given, because the label can only tell an @@ -23,6 +24,7 @@ 'clearable' => false, 'copyable' => false, 'counter' => false, + 'full' => false, 'size' => 'md', 'variant' => null, 'mono' => false, @@ -39,7 +41,7 @@ $max = $counter ? $attributes->get('maxlength') : null; @endphp - + except(['class', 'id', 'placeholder'])->merge(['type' => 'text']) }} id="{{ $id }}" diff --git a/resources/views/components/textarea.blade.php b/resources/views/components/textarea.blade.php index 84f5e5a9..29e3c4d1 100644 --- a/resources/views/components/textarea.blade.php +++ b/resources/views/components/textarea.blade.php @@ -3,8 +3,9 @@ It starts at `rows` lines (3) and grows with what is typed up to `max-rows`, then scrolls; `:autogrow="false"` keeps it at `rows` and lets it be resized by hand, vertically only, so a form's column never moves. The label rests on the first line rather than in the middle of the - box. `label`, `hint`, `variant`, and `counter` for M3's character counter against `maxlength`; - every other attribute reaches the `