{{-- One M3 list item: a headline with what leads it, what supports it and what trails it. `title` (or the slot) is the body-large headline; `overline` sits above it (label-small), `description` under it (body-medium, up to two lines). The leading element is one of `icon`, `avatar` (an image URL, or initials in primary-container) or `image` (a 56px thumbnail), or a `leading` slot (a checkbox, a switch). The trailing element is `trailing` text (label-small), `icon-right`, or an `end` slot for controls (a menu, a switch). One-, two- and three-line heights (56, 72, 88px) follow from what is given (ListTokens, androidx Compose Material 3, Apache-2.0). `link` makes the whole item the link. Otherwise, to make it open something while its trailing controls keep their own presses, give it `data-list-row` and put `data-list-open` on the one control that opens — see resources/js/list-rows.js. `selected` (true) is M3's selected item, in secondary-container; `disabled` greys it. --}} @props([ 'title' => null, 'overline' => null, 'description' => null, 'icon' => null, 'avatar' => null, 'image' => null, 'trailing' => null, 'iconRight' => null, 'link' => null, 'external' => false, 'noWireNavigate' => false, 'selected' => false, 'disabled' => false, ]) @php $isLink = filled($link); $lines = (filled($overline) ? 1 : 0) + (filled($description) ? 1 : 0); $initials = filled($avatar) && ! str_contains((string) $avatar, '/') && ! str_contains((string) $avatar, '.'); @endphp
class([ 'relative flex items-center gap-3 px-4 text-on-surface', 'min-h-14 py-2' => $lines === 0, 'min-h-18 py-2.5' => $lines === 1, 'min-h-22 py-2.5' => $lines === 2, 'pointer-events-none text-on-surface/38' => $disabled, ]) }} > @isset($leading)
{{ $leading }}
@elseif ($avatar) @if ($initials) @else @endif @elseif ($image) @elseif ($icon) @endif
@if ($overline)

! $selected])>{{ $overline }}

@endif @if ($isLink) {{ $title ?? $slot }} @else

{{ $title ?? $slot }}

@endif @if ($description)

! $selected])>{{ $description }}

@endif
@isset($end)
{{ $end }}
@endisset @if ($trailing) ! $selected])>{{ $trailing }} @endif @if ($iconRight) @endif