Draw the menu item's state layer and focus ring from the classes

Plan step 36 ("Interaction is the shared classes", the user, 2026-09-14).
menu-item.css hand-rolled md-state-layer and md-focus-ring, including a
separate aria-disabled rule the class already carries; the row now renders
the classes and keeps only the inward -3px ring offset a row edge to edge
in the list needs. No md-touch-target: the row is already 48px tall.

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 18:07:12 +02:00
co-authored by Claude Opus 5
parent 7803298fe7
commit 6c30f1e3ae
3 changed files with 11 additions and 38 deletions
+4 -1
View File
@@ -130,8 +130,11 @@ it('links an item, and keeps a disabled one out of reach', function () {
->assertSee('aria-disabled="true"', false)
->assertSee('data-md-menu-item', false);
// A disabled item stays focusable and keeps its ring, but the foundation's md-state-layer class
// (which the item renders, not a copy of its own) already withholds the layer on aria-disabled.
expect(ComponentStylesheet::read('menu-item')->declarations("[data-md-menu-item][aria-disabled='true']"))->toMatchArray(['pointer-events' => 'none'])
->and(ComponentStylesheet::read('menu-item')->declarations("[data-md-menu-item][aria-disabled='true']::before"))->toBe(['display' => 'none']);
->and(ComponentStylesheet::read('menu-item')->has('[data-md-menu-item]::before'))->toBeFalse()
->and((string) $this->blade('<x-menu-item label="Reset" disabled />'))->toContain('class="md-state-layer md-focus-ring"');
});
it('separates and labels groups', function () {