{{-- A tonal region: M3's surface, or a step of its surface containers. `level` is the colour role it is filled with: `surface`, `surface-dim`, `surface-bright`, `surface-container-lowest`, `surface-container-low`, `surface-container` (the default), `surface-container-high` or `surface-container-highest`; the text on it is `on-surface` (docs/reference/m3/styles.md § Color). Higher steps read as nearer, which is how M3 sets regions apart without a shadow. An unknown level is the default. `padding` is a spacing token's name, `space25` … `space900` (docs/reference/m3/styles-supplement.md § Spacing); anything else is no padding. `corner` is a corner token, `none`, `xs`, `sm`, `md`, `lg`, `lg-increased`, `xl`, `xl-increased`, `xxl` or `full` (resources/css/tokens/shape.css); anything else leaves it square. `outlined` draws the 1dp outline-variant edge. Like every layout component it takes `as` (the element, `div` by default: `section`, `article`, `aside` …) and `hide-below` / `hide-from` (`medium`, `expanded`, `large` or `extra-large`), and the caller's `class` and `style` land on it untouched. Drawn by resources/css/layout/surface.css; the props are read in src/Support/Layout.php. --}} @props([ 'as' => null, 'level' => null, 'padding' => null, 'corner' => null, 'outlined' => false, 'hideBelow' => null, 'hideFrom' => null, ]) @php $layout = \NoNameWeb\LivewireMaterial\Support\Layout::class; $element = $layout::element($as); $attributes = $attributes->merge(array_filter([ 'data-md-surface' => true, 'data-md-level' => $layout::choice($level, [ 'surface', 'surface-dim', 'surface-bright', 'surface-container-lowest', 'surface-container-low', 'surface-container', 'surface-container-high', 'surface-container-highest', ], 'surface-container'), 'data-md-padding' => $layout::spacing($padding), 'data-md-corner' => $layout::choice($corner, ['none', 'xs', 'sm', 'md', 'lg', 'lg-increased', 'xl', 'xl-increased', 'xxl', 'full']), 'data-md-outlined' => $outlined ? true : null, ] + $layout::visibility($hideBelow, $hideFrom), fn ($value): bool => $value !== null)); @endphp <{{ $element }} {{ $attributes }}>{{ $slot }}