Rewrite the divider without Tailwind

Plan step 36 (containment group): <x-divider> moves its class lists
into resources/css/components/divider.css, keyed on data-md-divider,
data-md-orientation, data-md-inset/middle and data-md-divider-heading/
-text for the subheader form (DividerTokens.kt; docs/reference/m3
§ Divider). Imported from the Containment block of components.css.

Hooks renamed: none of divider's own (it had no data-* hooks before),
but its rendered attribute order moved data-md-* ahead of role/aria-*,
which ToolbarTest.php's regex for a toolbar's vertical divider depended
on; fixed in the same commit. form.css picks up the @import './divider.css'
its TODO(step 36) marker was waiting on, since form.blade.php renders
<x-divider> and divider.css now carries the material.components layer.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
Andreas Reinhold / reini
2026-09-14 20:25:31 +02:00
co-authored by Claude Sonnet 5
parent 72a4f477d5
commit c887bcd054
7 changed files with 116 additions and 27 deletions
@@ -16,7 +16,7 @@ use NoNameWeb\LivewireMaterial\Tests\Support\ViewClasses;
* follow. It starts empty: this file lands before any containment component is rewritten.
*/
dataset('containment components', [
//
'divider',
]);
/**
+13 -7
View File
@@ -1,9 +1,15 @@
<?php
it('separates horizontally or vertically, inset on request', function () {
expect((string) $this->blade('<x-divider />'))->toContain('role="separator"')->toContain('aria-orientation="horizontal"')->toContain('h-px')->toContain('bg-outline-variant')
->and((string) $this->blade('<x-divider vertical />'))->toContain('aria-orientation="vertical"')->toContain('w-px')
->and((string) $this->blade('<x-divider inset />'))->toContain('ms-4')
expect((string) $this->blade('<x-divider />'))
->toContain('data-md-divider')
->toContain('data-md-orientation="horizontal"')
->toContain('role="separator"')
->toContain('aria-orientation="horizontal"')
->and((string) $this->blade('<x-divider vertical />'))
->toContain('data-md-orientation="vertical"')
->toContain('aria-orientation="vertical"')
->and((string) $this->blade('<x-divider inset />'))->toContain('data-md-inset')
->and((string) $this->blade('<x-divider decorative />'))->toContain('aria-hidden="true"')->not->toContain('role="separator"');
});
@@ -11,11 +17,11 @@ it('heads a group with a subheader, the rule running on from the words', functio
$html = (string) $this->blade('<x-divider text="Recent" />');
expect($html)
->toContain('flex shrink-0 items-center gap-1 pb-2')
->toContain('<span class="shrink-0 type-title-sm text-on-surface-variant">Recent</span>')
->toMatch('/role="separator" aria-orientation="horizontal"\s+class="me-2 h-px min-w-0 flex-1 bg-outline-variant"/')
->toContain('data-md-divider-heading')
->toContain('<span data-md-divider-text>Recent</span>')
->toMatch('/data-md-divider\s+data-md-orientation="horizontal"\s+role="separator" aria-orientation="horizontal"/')
->and(strpos($html, 'Recent'))->toBeLessThan(strpos($html, 'role="separator"'))
->and((string) $this->blade('<x-divider text="Recent" inset />'))->toContain('flex shrink-0 items-center gap-1 pb-2 ms-4')
->and((string) $this->blade('<x-divider text="Recent" inset />'))->toContain('data-md-divider-heading')->toContain('data-md-inset')
->and((string) $this->blade('<x-divider text="Recent" decorative />'))
->toContain('>Recent</span>')
->toContain('aria-hidden="true"')
+1 -1
View File
@@ -14,7 +14,7 @@ it('gives a docked toolbar the rounded large-screen form on request, and only a
expect($docked)
->toMatch('/role="toolbar"[^>]*data-variant="docked"\s+data-rounded/')
// The divider between two groups is the toolbar's child, where toolbar.css stands it up.
->toMatch('/role="toolbar".*aria-label="Undo".*<div\s+role="separator" aria-orientation="vertical"[^>]*>\s*<\/div>.*aria-label="Bold"/s')
->toMatch('/role="toolbar".*aria-label="Undo".*<div\s+data-md-divider\s+data-md-orientation="vertical"\s+role="separator" aria-orientation="vertical"[^>]*>\s*<\/div>.*aria-label="Bold"/s')
->and((string) $this->blade('<x-toolbar rounded><x-button icon="undo" tooltip="Undo" /></x-toolbar>'))
->toContain('data-variant="floating"')
->not->toContain('data-rounded')