diff --git a/resources/views/components/datepicker.blade.php b/resources/views/components/datepicker.blade.php
index d265953f..2a20b8fe 100644
--- a/resources/views/components/datepicker.blade.php
+++ b/resources/views/components/datepicker.blade.php
@@ -28,8 +28,9 @@
`min` and `max` (`Y-m-d` or a date object) disable the days outside them and keep the
keyboard inside them. `label`, `hint`, `icon`, `variant` (`outlined`, `filled`) and `size`
are the field's; `clearable` adds a button that empties it (a date, or both ends of a range)
- once it holds one; `name` adds hidden inputs carrying `Y-m-d` for a plain form post, and every
- other attribute (`required`, `disabled`, `readonly`) reaches the text field. Errors under
+ once it holds one; `name` adds hidden inputs carrying `Y-m-d` for a plain form post. `class` and
+ `style` land on the root; every other attribute (`required`, `disabled`, `readonly`) reaches
+ the text field. Errors under
the `wire:model` name replace the hint, and so does a typed date that cannot be read.
Month and weekday names, the first day of the week and the typed format come from `Intl` for
@@ -150,7 +151,7 @@
@endphp
only(['class', 'wire:key', 'x-model']) }}
+ {{ $attributes->only(['class', 'style', 'wire:key', 'x-model']) }}
x-data="materialDatepicker({
@if ($model !== null) value: @entangle($attributes->wire('model')), @else value: @js($current), @endif
...@js($config),
@@ -172,7 +173,7 @@
x-bind:data-md-invalid="(fieldError !== '' || {{ $invalid ? 'true' : 'false' }}) ? '' : null"
>
whereDoesntStartWith('wire:model')->except(['class', 'id', 'wire:key', 'x-model', 'name', 'value', 'placeholder', 'type']) }}
+ {{ $attributes->whereDoesntStartWith('wire:model')->except(['class', 'style', 'id', 'wire:key', 'x-model', 'name', 'value', 'placeholder', 'type']) }}
x-ref="input"
id="{{ $id }}"
type="text"
diff --git a/resources/views/components/field.blade.php b/resources/views/components/field.blade.php
index c3e0c587..e8155226 100644
--- a/resources/views/components/field.blade.php
+++ b/resources/views/components/field.blade.php
@@ -27,8 +27,8 @@
span the full width of a large screen (§ Text Fields, Behaviour); a width rule from the call site
beats that, and `full` takes it off altogether.
- `class` from the call site lands on the outermost element, never the control, so a margin or
- a width is safe here; `hint-class` lands on the hint. --}}
+ `class` and `style` from the call site land on the outermost element, never the control, so a
+ margin or a width is safe here; `hint-class` lands on the hint. --}}
@props([
'id',
diff --git a/resources/views/components/file.blade.php b/resources/views/components/file.blade.php
index a930e6f2..7ce3fbe7 100644
--- a/resources/views/components/file.blade.php
+++ b/resources/views/components/file.blade.php
@@ -29,9 +29,9 @@
: [];
@endphp
-
+
except(['class', 'id', 'type']) }}
+ {{ $attributes->except(['class', 'style', 'id', 'type']) }}
type="file"
id="{{ $id }}"
@if ($messages !== []) aria-invalid="true" @endif
diff --git a/resources/views/components/group.blade.php b/resources/views/components/group.blade.php
index b302f723..622f3f3d 100644
--- a/resources/views/components/group.blade.php
+++ b/resources/views/components/group.blade.php
@@ -63,7 +63,7 @@
// Below `medium` a segment draws under 48px, so it needs the foundation's touch target too.
$segmentNeedsTouchTarget = in_array($size, ['xs', 'sm'], true);
- $root = $attributes->only(['class', 'wire:key'])->merge(array_filter([
+ $root = $attributes->only(['class', 'style', 'wire:key'])->merge(array_filter([
'data-md-group' => true,
'data-md-size' => $size,
'data-md-variant' => $variant,
diff --git a/resources/views/components/input.blade.php b/resources/views/components/input.blade.php
index f970d5d2..7fc3430c 100644
--- a/resources/views/components/input.blade.php
+++ b/resources/views/components/input.blade.php
@@ -6,8 +6,9 @@
field once it holds something; `copyable` one that copies its value and says so in a snackbar
(a share link, a token). `counter` counts the characters used against `maxlength`, at the end of
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.
+ from `medium`. `class` and `style` land on the field's root, which is what a width or a margin
+ sizes; 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
empty field from a filled one through `:placeholder-shown`. With a label, a real placeholder
@@ -45,9 +46,9 @@
$fieldIconSize = ['sm' => 20, 'xs' => 16][$size] ?? 24;
@endphp
-
+
except(['class', 'id', 'placeholder'])->merge(['type' => 'text']) }}
+ {{ $attributes->except(['class', 'style', 'id', 'placeholder'])->merge(['type' => 'text']) }}
id="{{ $id }}"
placeholder="{{ $placeholder }}"
@if ($messages !== []) aria-invalid="true" @endif
diff --git a/resources/views/components/password.blade.php b/resources/views/components/password.blade.php
index 65bf8778..bd07e82b 100644
--- a/resources/views/components/password.blade.php
+++ b/resources/views/components/password.blade.php
@@ -4,7 +4,8 @@
password manager still sees a password input on load. Its label says what pressing it will do —
M3's own pattern for an interactive trailing icon ("Show password" / "Hide password") — and it
carries no `aria-pressed`, which would say the state a second time and the other way round.
- `label`, `hint`, `icon`, `variant`, `size`; every other attribute reaches the ``
+ `label`, `hint`, `icon`, `variant`, `size`; `class` and `style` land on the field's root, every
+ other attribute reaches the ``
(`autocomplete="current-password"`, `wire:model`). The field's root carries
`data-md-password`; the chrome and the eye's icon button are the field's
(resources/css/components/field.css, brought by resources/css/components/password.css). --}}
@@ -27,9 +28,9 @@
$fieldIconSize = ['sm' => 20, 'xs' => 16][$size] ?? 24;
@endphp
-
+
except(['class', 'id', 'type', 'placeholder']) }}
+ {{ $attributes->except(['class', 'style', 'id', 'type', 'placeholder']) }}
id="{{ $id }}"
type="password"
x-bind:type="shown ? 'text' : 'password'"
diff --git a/resources/views/components/search.blade.php b/resources/views/components/search.blade.php
index 742ba8af..84d7285b 100644
--- a/resources/views/components/search.blade.php
+++ b/resources/views/components/search.blade.php
@@ -29,7 +29,7 @@
The root renders `data-md-search` with `data-md-trigger`, and `data-md-open` and
`data-md-full-screen` while they hold; the parts are `data-md-search-*`, drawn by
- resources/css/components/search.css. `class` and `wire:key` land on the root. --}}
+ resources/css/components/search.css. `class`, `style` and `wire:key` land on the root. --}}
@props([
'placeholder' => null,
@@ -103,7 +103,7 @@
x-bind:aria-expanded="open.toString()"
>
except(['class', 'wire:key', 'id', 'placeholder', 'type']) }}
+ {{ $attributes->except(['class', 'style', 'wire:key', 'id', 'placeholder', 'type']) }}
x-ref="input"
id="{{ $id }}"
type="search"
diff --git a/resources/views/components/select.blade.php b/resources/views/components/select.blade.php
index 3f56a2d1..828d9fbc 100644
--- a/resources/views/components/select.blade.php
+++ b/resources/views/components/select.blade.php
@@ -10,7 +10,8 @@
`options` as a list of `['id' => …, 'name' => …]` (`'disabled' => true` greys one out),
`option-value` and `option-label` to read other keys, and a `placeholder` that becomes the
first option, valued `placeholder-value` (empty by default). Or pass `