Plan step 38 review: the frame's structural rule that kept a section's own <h2> for screen readers (Tailwind's [&>section>h2]:sr-only before, a showcase.css rule during the rewrite) was removed as dead weight once every section had a real heading, so each page drew its title twice, the <h1> and an identical headline under it. The <h2>s are md-visually-hidden again, the frame's comment says why, and the section page test asserts it. The Layout section's description said "window size classes"; M3's term is breakpoints. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
120 lines
8.3 KiB
PHP
120 lines
8.3 KiB
PHP
@php
|
|
$examples = [
|
|
'Badges' => <<<'BLADE'
|
|
<span style="position: relative; display: inline-flex"><x-icon name="notifications" /><x-badge floating /></span>
|
|
<span style="position: relative; display: inline-flex"><x-icon name="mail" /><x-badge value="4" floating /></span>
|
|
<span style="position: relative; display: inline-flex"><x-icon name="inbox" /><x-badge value="1204" max="999" floating /></span>
|
|
<x-badge value="Expired" tonal />
|
|
<x-badge value="Active" color="success" tonal />
|
|
<x-badge value="Password" color="info" tonal />
|
|
<x-badge value="Built in" color="primary" solid />
|
|
<x-badge value="Pro" outline />
|
|
<x-badge value="Draft" color="neutral" tonal />
|
|
<x-badge value="Archived" color="neutral" outline />
|
|
<span style="position: relative; display: inline-flex"><x-icon name="chat" /><x-badge value="2" color="neutral" floating /></span>
|
|
<x-badge tonal color="tertiary"><x-icon name="bolt" filled optical="20" size="12" /> Pro</x-badge>
|
|
<x-badge value="Beta" tonal color="plain" data-md-showcase-badge-plain />
|
|
BLADE,
|
|
'Snackbars' => <<<'BLADE'
|
|
<x-livewire-material::row gap="space200" wrap align="center" x-data>
|
|
<x-button label="Saved" variant="tonal" x-on:click="materialToast('Settings saved', { type: 'success' })" />
|
|
<x-button label="With a description" variant="tonal" x-on:click="materialToast('Upload failed', { type: 'error', description: 'The file is larger than 4 GB.' })" />
|
|
<x-button label="With an action" variant="tonal" x-on:click="materialToast('Share deleted', { action: { label: 'Undo', handler: () => materialToast('Share restored', { type: 'info' }) } })" />
|
|
<x-button label="Until dismissed" variant="tonal" x-on:click="materialToast('Your storage is almost full', { type: 'warning', timeout: 0 })" />
|
|
<x-button label="Sticky, with an event" variant="tonal" x-on:click="materialToast('A new version is ready', { type: 'info', sticky: true, action: { label: 'Reload', event: 'showcase:reload' } })" x-on:showcase:reload.window="materialToast('Reloading…')" />
|
|
</x-livewire-material::row>
|
|
BLADE,
|
|
'Two lines, and the keyboard shortcut that reaches them' => <<<'BLADE'
|
|
<x-livewire-material::stack gap="space200" x-data>
|
|
<x-livewire-material::row gap="space200" wrap align="center">
|
|
<x-button label="Two lines" variant="tonal" x-on:click="materialToast('Upload paused', { description: 'The connection dropped at 64%. It carries on when you are back.' })" />
|
|
<x-button label="Two lines, with an action" variant="tonal" x-on:click="materialToast('Upload paused', { description: 'The connection dropped at 64%. It carries on when you are back.', action: { label: 'Retry now', handler: () => materialToast('Retrying…') } })" />
|
|
</x-livewire-material::row>
|
|
|
|
<p class="md-type-body-md md-ink-variant">
|
|
A description makes the snackbar 68px, M3's two-line height; below <code>medium</code> the action wraps under the text.
|
|
Press <kbd class="md-type-label-md" data-md-showcase-kbd>Alt</kbd> + <kbd class="md-type-label-md" data-md-showcase-kbd>G</kbd> to move the focus to a snackbar that has an action.
|
|
</p>
|
|
</x-livewire-material::stack>
|
|
BLADE,
|
|
'Plain tooltips' => <<<'BLADE'
|
|
<x-button icon="content_copy" tooltip="Copy link" />
|
|
<x-button icon="qr_code_2" tooltip-bottom="Show QR code" />
|
|
<x-tooltip text="Expires in 3 days" side="right">
|
|
<span tabindex="0" class="md-type-body-md md-ink-variant md-focus-ring" data-md-showcase-focus-demo>holiday-photos.zip</span>
|
|
</x-tooltip>
|
|
BLADE,
|
|
'Rich tooltips' => <<<'BLADE'
|
|
<x-rich-tooltip title="Expiry" text="Recipients lose access after this time. Admins can change the longest time allowed.">
|
|
<x-button icon="help" aria-label="About expiry" />
|
|
</x-rich-tooltip>
|
|
|
|
<x-rich-tooltip title="Password protection" text="Recipients need the password before they can see the files." persistent>
|
|
<x-button label="Press for details" icon="lock" variant="outlined" />
|
|
<x-slot:actions>
|
|
<x-button label="Learn more" />
|
|
</x-slot:actions>
|
|
</x-rich-tooltip>
|
|
BLADE,
|
|
'Alerts' => <<<'BLADE'
|
|
<x-livewire-material::stack gap="space200">
|
|
<x-alert title="Storage almost full" description="3.8 GB of 4 GB used. Old shares are deleted when they expire." color="warning" />
|
|
<x-alert description="Links are shown only once. Copy yours before you leave the page." dismissible />
|
|
<x-alert title="Upload failed" color="error">
|
|
The connection dropped at 64%.
|
|
<x-slot:actions><x-button label="Try again" /></x-slot:actions>
|
|
</x-alert>
|
|
<x-alert description="Settings saved." color="success" />
|
|
</x-livewire-material::stack>
|
|
BLADE,
|
|
'Stats' => <<<'BLADE'
|
|
<x-livewire-material::grid :columns="['compact' => 1, 'medium' => 2, 'expanded' => 4]" gap="space200">
|
|
<x-stat title="Shares" value="1,204" icon="link" description="12 this week" />
|
|
<x-stat title="Files" value="8,317" icon="description" />
|
|
<x-stat title="Stored" value="3.2 GB" icon="hard_drive" description="of 4 GB" />
|
|
<x-stat title="Downloads" value="42,019" icon="download" />
|
|
</x-livewire-material::grid>
|
|
BLADE,
|
|
'Empty state' => <<<'BLADE'
|
|
<x-livewire-material::stack gap="space200">
|
|
<x-empty-state icon="upload_file" title="No shares yet" description="Files you share appear here, with their links and when they expire.">
|
|
<x-slot:actions>
|
|
<x-button label="Upload files" icon="upload" variant="filled" />
|
|
</x-slot:actions>
|
|
</x-empty-state>
|
|
</x-livewire-material::stack>
|
|
BLADE,
|
|
'Empty state with an illustration' => <<<'BLADE'
|
|
<x-livewire-material::stack gap="space200">
|
|
<x-empty-state title="No routes yet" description="Draw a route on the map, or import one from a GPX file.">
|
|
<x-slot:illustration style="color: var(--md-sys-color-primary)">
|
|
<svg style="width: 128px; height: 128px" viewBox="0 0 120 120" fill="none" aria-hidden="true">
|
|
<circle cx="60" cy="60" r="56" data-md-showcase-illustration="container" />
|
|
<path d="M28 86C40 62 56 92 68 64S86 42 90 46" stroke="currentColor" stroke-width="5" stroke-linecap="round" stroke-dasharray="1 10" />
|
|
<circle cx="28" cy="86" r="7" fill="currentColor" />
|
|
<path d="M90 18a12 12 0 0 1 12 12c0 10-12 22-12 22S78 40 78 30a12 12 0 0 1 12-12Z" data-md-showcase-illustration="accent" />
|
|
<circle cx="90" cy="30" r="4" data-md-showcase-illustration="on-accent" />
|
|
</svg>
|
|
</x-slot:illustration>
|
|
<x-slot:actions>
|
|
<x-button label="Draw a route" icon="route" variant="filled" />
|
|
</x-slot:actions>
|
|
</x-empty-state>
|
|
</x-livewire-material::stack>
|
|
BLADE,
|
|
];
|
|
@endphp
|
|
|
|
<x-livewire-material::stack as="section" id="communication" gap="space300">
|
|
<h2 class="md-visually-hidden">Communication</h2>
|
|
|
|
<p class="md-type-body-md md-ink-variant">
|
|
<code><x-badge></code>, <code><x-toast></code> (the snackbar host, fed by the <code>Toasts</code> concern or <code>materialToast()</code>),
|
|
<code><x-tooltip></code>, <code><x-rich-tooltip></code>, <code><x-alert></code>, <code><x-stat></code> and <code><x-empty-state></code>.
|
|
</p>
|
|
|
|
@foreach ($examples as $title => $code)
|
|
<x-showcase::example :$title :$code />
|
|
@endforeach
|
|
</x-livewire-material::stack>
|