Merge branch 'worktree-agent-a221f2b34317526ab'

This commit is contained in:
Andreas Reinhold / reini
2026-09-14 05:33:13 +02:00
10 changed files with 442 additions and 9 deletions
@@ -839,12 +839,30 @@ use NoNameWeb\LivewireMaterial\Testing\DesignGuard;
it('uses only what compiles', function () {
expect(DesignGuard::scan([resource_path('views'), resource_path('js'), app_path()])
->forbidColours(['tertiary']) // roles this application's rules leave out
->forbidAbsolutes() // opt-in: `bg-white`, `text-black`
->forbidOpacityInk() // opt-in: `text-on-surface/60`
->violations())->toBe([]);
});
```
It fails on maryUI tags, daisyUI classes, colours the theme does not declare, unknown symbol names and Blade directives written inside a component tag (where they do not compile), with `path:line` for each.
It also fails on every value the theme cleared, and names the replacement on the same line:
| Written | Use |
| --- | --- |
| `sm:`, `md:` (and `max-sm:`, `max-md:`) | `medium:` (`max-medium:`) |
| `lg:`, `xl:`, `2xl:` | `expanded:`, `large:`, `extra-large:` |
| `rounded-lg`, `rounded-t-2xl`, `rounded-full` | `rounded-corner-lg`, `rounded-t-corner-xxl`, `rounded-corner-full` |
| `shadow-sm`, `shadow-md``shadow-2xl` | `shadow-elevation-1``shadow-elevation-5` |
| `text-sm`, `leading-6`, `tracking-wide` | a `type-*` style, which sets the three together |
| `font-medium`, `font-bold` | a `type-emphasized-*` style |
| `ease-in-out`, `ease-linear` | `ease-standard`, or an `ease-spatial-*`/`ease-effects-*` |
| `duration-300` | `duration-(--md-sys-motion-…-duration)`, paired with its easing |
| `bg-[#1d7afc]`, `text-[rgb(…)]`, `border-[color-mix(…)]` | an M3 role |
`forbidAbsolutes()` adds `white` and `black` (M3's white is `surface-container-lowest`, its ink an `on-` role) and `forbidOpacityInk()` adds opacity as emphasis (`text-on-surface/60``text-on-surface-variant` or `text-outline`). Both are off by default: M3 reserves 38 % on content and 12 % on a container for the disabled state, and the package's own components are written with those two opacities.
## Conventions
- Components are anonymous Blade components: `<x-name>` without a prefix, or `<x-{prefix}::name>` when `config('livewire-material.prefix')` is set; `<x-livewire-material::name>` always works.