diff --git a/resources/views/showcase/sections/buttons.blade.php b/resources/views/showcase/sections/buttons.blade.php
index caa95008..89c91b13 100644
--- a/resources/views/showcase/sections/buttons.blade.php
+++ b/resources/views/showcase/sections/buttons.blade.php
@@ -77,7 +77,7 @@
BLADE,
'A connected group that owns its selection' => <<<'BLADE'
-
+
@@ -94,7 +94,7 @@
View: · marks: .
The shape follows at once; the colours come from each button's own :selected, which a Livewire render brings back.
A description makes the snackbar 68px, M3's two-line height; below medium the action wraps under the text.
Press Alt + G to move the focus to a snackbar that has an action.
-
+
BLADE,
'Plain tooltips' => <<<'BLADE'
@@ -57,7 +57,7 @@
BLADE,
'Alerts' => <<<'BLADE'
-
+
@@ -65,27 +65,27 @@
-
+
BLADE,
'Stats' => <<<'BLADE'
-
+
-
+
BLADE,
'Empty state' => <<<'BLADE'
-
+
-
+
BLADE,
'Empty state with an illustration' => <<<'BLADE'
-
+
-
+
BLADE,
];
@endphp
diff --git a/resources/views/showcase/sections/data.blade.php b/resources/views/showcase/sections/data.blade.php
index cd4169f2..84ff292c 100644
--- a/resources/views/showcase/sections/data.blade.php
+++ b/resources/views/showcase/sections/data.blade.php
@@ -35,10 +35,10 @@
BLADE,
'Pagination' => <<<'BLADE'
-
+
{{ (new \Illuminate\Pagination\LengthAwarePaginator(range(1, 10), 95, 10, 3, ['path' => '#data']))->links() }}
{{ (new \Illuminate\Pagination\Paginator(range(1, 11), 10, 2, ['path' => '#data']))->links() }}
-
+
BLADE,
];
@endphp
diff --git a/resources/views/showcase/sections/fields.blade.php b/resources/views/showcase/sections/fields.blade.php
index 48201b3f..d60ac771 100644
--- a/resources/views/showcase/sections/fields.blade.php
+++ b/resources/views/showcase/sections/fields.blade.php
@@ -1,96 +1,96 @@
@php
$examples = [
'Outlined and filled text fields' => <<<'BLADE'
-
-
+
+
-
+
-
+
-
-
+
+
BLADE,
'Errors, required and sizes' => <<<'BLADE'
-
-
+
+
-
+
-
+
-
+
-
-
-
+
+
+
BLADE,
'Width at medium and above' => <<<'BLADE'
-
+
{{-- M3: never let a text field span the full width of a large screen. From medium it stops at 40rem. --}}
-
+
BLADE,
'Character counter' => <<<'BLADE'
-
-
+
+
-
+
-
+
BLADE,
'Textarea and select' => <<<'BLADE'
-
-
+
+
-
+
-
+
-
-
+
+
BLADE,
'Checkboxes' => <<<'BLADE'
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
BLADE,
'A checkbox group at expanded' => <<<'BLADE'
{{-- M3: from expanded (840px), gather related checkboxes into a contained region instead of one long column. --}}
@@ -98,56 +98,56 @@
BLADE,
'Radio buttons' => <<<'BLADE'
-
+
-
+
BLADE,
'Switches' => <<<'BLADE'
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
BLADE,
'Choices' => <<<'BLADE'
-
-
+
+
-
+
-
+
-
-
+
+
BLADE,
'Search' => <<<'BLADE'
-
+
@@ -167,10 +167,10 @@
Type to search your settings.
-
-
+
+
BLADE,
'Range' => <<<'BLADE'
{{-- Narrow the window below 600px: a range picker becomes M3's full-screen one, with a close button, Save, and the months scrolled through. --}}
-
-
+
+
Bound value:
-
+
-
+
Bound value:
-
-
+
+
BLADE,
'First day of the week and format' => <<<'BLADE'
-
-
+
+
Bound value:
-
+
-
+
Bound value:
-
-
+
+
BLADE,
'Limits, errors and states' => <<<'BLADE'
-
-
+
+
-
+
-
+
-
+
-
-
-
+
+
+
BLADE,
];
@endphp
diff --git a/resources/views/showcase/sections/progress.blade.php b/resources/views/showcase/sections/progress.blade.php
index 63bf42bd..2b48701d 100644
--- a/resources/views/showcase/sections/progress.blade.php
+++ b/resources/views/showcase/sections/progress.blade.php
@@ -31,15 +31,15 @@
BLADE,
'Following a value in the browser (bind)' => <<<'BLADE'
-
+
-
+
-
-
+
+
BLADE,
];
diff --git a/resources/views/showcase/sections/sliders.blade.php b/resources/views/showcase/sections/sliders.blade.php
index 96d6065f..be436c49 100644
--- a/resources/views/showcase/sections/sliders.blade.php
+++ b/resources/views/showcase/sections/sliders.blade.php
@@ -1,55 +1,55 @@
@php
$examples = [
'Standard, discrete and disabled' => <<<'BLADE'
-
+
-
+
BLADE,
'Sizes, with an inset icon from md' => <<<'BLADE'
-
+
-
+
BLADE,
'Range and centred' => <<<'BLADE'
-
+
-
+
BLADE,
'Vertical' => <<<'BLADE'
{{-- M3 Expressive's second orientation. A vertical slider needs a height: it is on the wrapper, which the label and hint share. --}}
-
+
-
+
BLADE,
'Colours and value labels' => <<<'BLADE'
-
+
-
+
BLADE,
'Bound with x-model' => <<<'BLADE'
-
-
+
+
-
-
+
+
BLADE,
];
@endphp
diff --git a/tests/Feature/ShowcaseTest.php b/tests/Feature/ShowcaseTest.php
index ef174f5e..5d70a7c8 100644
--- a/tests/Feature/ShowcaseTest.php
+++ b/tests/Feature/ShowcaseTest.php
@@ -117,6 +117,25 @@ it('indexes exactly the examples each page renders, so an example the index miss
}
});
+it('writes every example as an application writes it', function () {
+ $files = collect(File::glob(__DIR__.'/../../resources/views/showcase/sections/*.blade.php'))
+ ->merge(File::glob(__DIR__.'/../../resources/views/showcase/layout/*.blade.php'));
+
+ $examples = $files->flatMap(function (string $file): array {
+ preg_match_all("/<<<'BLADE'\n(.*?)^\s*BLADE[,;]/sm", File::get($file), $matches);
+
+ return array_map(fn (string $code): array => [basename($file), $code], $matches[1]);
+ });
+
+ expect($examples)->not->toBeEmpty();
+
+ foreach ($examples as [$file, $code]) {
+ // The example component rewrites unprefixed tags to a configured prefix; a namespaced tag
+ // would show an application a form it does not write, and escape that rewrite.
+ expect($code)->not->toContain('x-livewire-material::', "{$file} writes a namespaced tag in an example");
+ }
+});
+
it('does not mount the showcase when disabled', function () {
rebootWithShowcase(false);