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
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:
co-authored by
Claude Opus 5
parent
9b53891a8e
commit
b48e879254
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace NoNameWeb\LivewireMaterial\Concerns;
|
||||
|
||||
/**
|
||||
* A short message after something happened — "Saved", "Link copied" — shown by the snackbar.
|
||||
*
|
||||
* The four method names and arguments are maryUI's `Toast` trait's, so moving to this is a
|
||||
* find-and-replace. The message is a `toast` browser event, dispatched rather than evaluated
|
||||
* as JavaScript, so a test can see it (`assertDispatched('toast')`). It survives
|
||||
* `redirectTo`: the redirect is a wire:navigate, and the event dispatched on the way out is
|
||||
* still on screen when the next page arrives.
|
||||
*
|
||||
* The methods are protected, where maryUI's were public: a public method on a Livewire
|
||||
* component is an action anyone can call from the browser.
|
||||
*/
|
||||
trait Toasts
|
||||
{
|
||||
protected function success(string $title, ?string $description = null, int $timeout = 4000, ?string $redirectTo = null): void
|
||||
{
|
||||
$this->toast('success', $title, $description, $timeout, $redirectTo);
|
||||
}
|
||||
|
||||
protected function warning(string $title, ?string $description = null, int $timeout = 4000, ?string $redirectTo = null): void
|
||||
{
|
||||
$this->toast('warning', $title, $description, $timeout, $redirectTo);
|
||||
}
|
||||
|
||||
protected function error(string $title, ?string $description = null, int $timeout = 4000, ?string $redirectTo = null): void
|
||||
{
|
||||
$this->toast('error', $title, $description, $timeout, $redirectTo);
|
||||
}
|
||||
|
||||
protected function info(string $title, ?string $description = null, int $timeout = 4000, ?string $redirectTo = null): void
|
||||
{
|
||||
$this->toast('info', $title, $description, $timeout, $redirectTo);
|
||||
}
|
||||
|
||||
private function toast(string $type, string $title, ?string $description, int $timeout, ?string $redirectTo): void
|
||||
{
|
||||
$this->dispatch('toast', type: $type, title: $title, description: $description, timeout: $timeout);
|
||||
|
||||
if ($redirectTo !== null) {
|
||||
$this->redirect($redirectTo, navigate: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user