Add the Material 3 Expressive foundation
tests / lint (push) Successful in 1m0s
tests / feature (8.4) (push) Successful in 1m0s
tests / feature (8.5) (push) Successful in 1m1s
tests / browser (safari, webkit) (push) Successful in 1m59s
tests / browser (chrome, chromium) (push) Successful in 1m49s
tests / browser (firefox, firefox) (push) Successful in 1m54s

Colour, shape, type, elevation and motion as tokens and Tailwind
utilities; `php artisan material:scheme`, which generates an app's colour
roles with Google's material-color-utilities (spec 2025); the theme head
script with light, dark and system and its Alpine store; Google Sans Flex;
every Material Symbol (4,135, outlined and filled) drawn by <x-icon>
without blade-icons; all 35 M3 Expressive shapes, ported from androidx, as
<x-shape>; the x-figure directive; the Toasts concern; DesignGuard for
applications' tests; and a showcase with every token, both themes side by
side and an icon search.

Colour utilities are `@theme inline`, so a section with its own
data-theme repaints; without it they resolve once on :root.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V9NnLxnPp8vaaurb3Z1MFy
This commit is contained in:
Andreas Reinhold / reini
2026-09-13 05:24:11 +02:00
co-authored by Claude Opus 5
parent 9b53891a8e
commit b48e879254
8364 changed files with 12720 additions and 28 deletions
+57
View File
@@ -0,0 +1,57 @@
<?php
use Illuminate\View\ViewException;
use NoNameWeb\LivewireMaterial\Support\SvgFile;
it('draws a symbol inline, hidden from screen readers, 24px by default', function () {
$this->blade('<x-icon name="calendar_month" />')
->assertSee('class="shrink-0 size-6"', false)
->assertSee('aria-hidden="true"', false)
->assertSee('fill="currentColor"', false)
->assertSee('viewBox="0 -960 960 960"', false);
});
it('leaves the size to a caller who gives one', function () {
$this->blade('<x-icon name="calendar_month" class="size-4 text-primary" />')
->assertSee('class="shrink-0 size-4 text-primary"', false)
->assertDontSee('size-6', false);
});
it('names the icon for a screen reader when it carries the meaning alone', function () {
$this->blade('<x-icon name="lock" label="Password protected" />')
->assertSee('aria-label="Password protected"', false)
->assertSee('role="img"', false)
->assertDontSee('aria-hidden', false);
});
it('draws the filled symbol when asked', function () {
$outlined = (string) $this->blade('<x-icon name="favorite" />');
$filled = (string) $this->blade('<x-icon name="favorite" filled />');
expect($filled)->not->toBe($outlined)
->and($filled)->toContain('<path d=');
});
it('refuses a name that is not a symbol', function () {
expect(fn () => $this->blade('<x-icon name="not_a_symbol_at_all" />'))
->toThrow(ViewException::class, 'There is no Material Symbol named [not_a_symbol_at_all].');
});
it('points a Heroicon name at the symbol catalogue', function () {
expect(fn () => $this->blade('<x-icon name="o-calendar-days" />'))
->toThrow(ViewException::class, 'is not a Material Symbol name');
});
it('ships every symbol outlined and filled, painted in the text colour', function () {
$symbols = SvgFile::symbolNames();
$filled = array_map(fn (string $file): string => basename($file, '.svg'), glob(__DIR__.'/../../../resources/svg/symbols/filled/*.svg'));
expect(count($symbols))->toBeGreaterThan(4000)
->and($filled)->toEqual($symbols);
foreach (['home', 'search', 'cloud_upload', 'content_copy', 'delete'] as $name) {
expect(file_get_contents(__DIR__."/../../../resources/svg/symbols/outlined/{$name}.svg"))
->toStartWith('<svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path')
->not->toContain('width=');
}
});