Draw the page steps' state layer from the paginator stylesheet

Plan step 36. The paginators put md-state-layer, md-focus-ring and
md-touch-target on their live steps, where the rest of the actions and
communication group (button, FAB, menu item, snackbar, alert) writes no
class list and carries those declarations keyed on its own hooks, as
the plan's data-md-* rule and the brief's "text classes, nothing else"
ask. pagination.css now draws them on a link or button step, the layer
hidden while Livewire disables previous and next; the views render no
class at all, which the render tests pin.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
Andreas Reinhold / reini
2026-09-14 17:08:54 +02:00
co-authored by Claude Opus 5
parent f53c559c40
commit 32313e0fd9
4 changed files with 84 additions and 18 deletions
+17 -3
View File
@@ -5,6 +5,7 @@ use Illuminate\Pagination\Paginator;
use Livewire\Component;
use Livewire\Livewire;
use Livewire\WithPagination;
use NoNameWeb\LivewireMaterial\Tests\Support\ComponentStylesheet;
it('marks a table for its styles and takes a size', function () {
expect((string) $this->blade('<x-table class="min-w-160"><tbody><tr><td>a</td></tr></tbody></x-table>'))
@@ -50,7 +51,19 @@ it('gives the sort button and every page control a 48px target', function () {
->toContain('--md-icon-size: 16px')
->not->toContain('data-md-active')
->and((string) $pages->links())
->toContain('data-md-pagination-step class="md-state-layer md-focus-ring md-touch-target"');
->toContain('<a href="/shares?page=4" data-md-pagination-step data-md-pagination-page aria-label="Go to page 4">')
->and(ComponentStylesheet::read('pagination')->declarations('[data-md-pagination-step]'))->toMatchArray([
'width' => 'var(--md-sys-measurement-space500)',
'height' => 'var(--md-sys-measurement-space500)',
])
->and(ComponentStylesheet::read('pagination')->declarations(':is(a, button)[data-md-pagination-step]::after'))->toMatchArray([
'min-width' => 'var(--md-sys-measurement-space600)',
'min-height' => 'var(--md-sys-measurement-space600)',
])
->and(ComponentStylesheet::read('pagination')->declarations(':is(a, button)[data-md-pagination-step]:focus-visible'))->toBe([
'outline' => '3px solid var(--md-sys-color-secondary)',
'outline-offset' => '2px',
]);
});
it('draws Laravel\'s paginators in M3', function () {
@@ -65,7 +78,7 @@ it('draws Laravel\'s paginators in M3', function () {
->toContain('aria-label="Go to page 4"')
->toContain('data-md-mirror-rtl')
->not->toContain('text-gray')
->not->toMatch('/class="(?!md-)[^"]*"/');
->not->toContain('class="');
expect((string) (new Paginator(range(1, 11), 10, 2, ['path' => '/shares']))->links())
->toContain('data-md-pagination')
@@ -94,7 +107,8 @@ it('draws Livewire\'s paginators in M3, wired to its page actions', function ()
->toContain('data-md-pagination-page')
->toContain('wire:click="gotoPage(2, \'page\')"')
->toContain('wire:click="nextPage(\'page\')"')
->not->toContain('text-gray');
->not->toContain('text-gray')
->not->toContain('class="');
});
it('draws the sort header from its stylesheet, its arrow hidden until the column sorts or is hovered', function () {