Plan step 36 ("Interaction is the shared classes", the user, 2026-09-14).
A prior pass on this same step had hand-rolled the page step's state
layer, focus ring and touch target to keep the views free of a class
list; the user's decision reverses that: a live step (a link or button,
never the current-page or disabled span) now renders md-state-layer,
md-focus-ring and md-touch-target, and pagination.css keeps only the
step's own size, colour and shape.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
53 lines
3.0 KiB
PHP
53 lines
3.0 KiB
PHP
{{-- Laravel's paginator (`$items->links()` outside Livewire), drawn in M3 as Livewire's is
|
||
(resources/views/pagination/livewire/tailwind.blade.php): links instead of actions, the current
|
||
page in secondary-container, "Page 2 of 7" below 600px. The package puts this in front of
|
||
`pagination::tailwind` (config `livewire-material.pagination`); the name is Laravel's, the drawing
|
||
resources/css/components/pagination.css. --}}
|
||
|
||
@if ($paginator->hasPages())
|
||
<nav role="navigation" aria-label="{{ __('Pagination Navigation') }}" data-md-pagination>
|
||
<p data-md-pagination-summary>
|
||
<span data-md-pagination-compact>{{ __('Page :page of :pages', ['page' => $paginator->currentPage(), 'pages' => $paginator->lastPage()]) }}</span>
|
||
<span data-md-pagination-range>{{ __(':first–:last of :total', ['first' => $paginator->firstItem(), 'last' => $paginator->lastItem(), 'total' => $paginator->total()]) }}</span>
|
||
</p>
|
||
|
||
<div data-md-pagination-steps>
|
||
@if ($paginator->onFirstPage())
|
||
<span data-md-pagination-step aria-disabled="true" aria-label="{{ __('Previous') }}">
|
||
<x-livewire-material::icon name="chevron_left" mirror-rtl />
|
||
</span>
|
||
@else
|
||
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="md-state-layer md-focus-ring md-touch-target" data-md-pagination-step aria-label="{{ __('Previous') }}">
|
||
<x-livewire-material::icon name="chevron_left" mirror-rtl />
|
||
</a>
|
||
@endif
|
||
|
||
@foreach ($elements as $element)
|
||
@if (is_string($element))
|
||
<span data-md-pagination-step data-md-pagination-page aria-disabled="true">{{ $element }}</span>
|
||
@endif
|
||
|
||
@if (is_array($element))
|
||
@foreach ($element as $page => $url)
|
||
@if ($page == $paginator->currentPage())
|
||
<span aria-current="page" data-md-pagination-step data-md-pagination-page>{{ $page }}</span>
|
||
@else
|
||
<a href="{{ $url }}" class="md-state-layer md-focus-ring md-touch-target" data-md-pagination-step data-md-pagination-page aria-label="{{ __('Go to page :page', ['page' => $page]) }}">{{ $page }}</a>
|
||
@endif
|
||
@endforeach
|
||
@endif
|
||
@endforeach
|
||
|
||
@if ($paginator->hasMorePages())
|
||
<a href="{{ $paginator->nextPageUrl() }}" rel="next" class="md-state-layer md-focus-ring md-touch-target" data-md-pagination-step aria-label="{{ __('Next') }}">
|
||
<x-livewire-material::icon name="chevron_right" mirror-rtl />
|
||
</a>
|
||
@else
|
||
<span data-md-pagination-step aria-disabled="true" aria-label="{{ __('Next') }}">
|
||
<x-livewire-material::icon name="chevron_right" mirror-rtl />
|
||
</span>
|
||
@endif
|
||
</div>
|
||
</nav>
|
||
@endif
|