|
3 | 3 | <div |
4 | 4 | class="actions-demo" |
5 | 5 | data-framework="blade" |
6 | | - x-data="{ state: 'loading', tall: false, visible: true }" |
| 6 | + x-data="{ |
| 7 | + state: 'loading', |
| 8 | + tall: false, |
| 9 | + visible: true, |
| 10 | + gridOffset: false, |
| 11 | + }" |
7 | 12 | > |
8 | 13 | <h2 class="fi-section-header-heading">Blade · Project overview</h2> |
9 | 14 | <p> |
10 | 15 | Load the latest community garden milestones. Finish manually to |
11 | 16 | explore success and failure. |
12 | 17 | </p> |
13 | | - <template x-if="visible && state === 'loading'"> |
14 | | - <x-filament::loading-section |
15 | | - data-testid="loading-section" |
16 | | - loading-label="Loading project overview" |
17 | | - x-bind:style="{ height: tall ? '12rem' : '8rem' }" |
18 | | - /> |
19 | | - </template> |
20 | | - <template x-if="visible && state !== 'loading'"> |
21 | | - <div class="fi-section" data-testid="content"> |
| 18 | + <div |
| 19 | + class="fi-grid" |
| 20 | + data-testid="preview-grid" |
| 21 | + style="--cols-default: repeat(4, minmax(0, 1fr))" |
| 22 | + > |
| 23 | + <template |
| 24 | + x-if="visible && state === 'loading' && !gridOffset" |
| 25 | + > |
| 26 | + <x-filament::loading-section |
| 27 | + data-testid="loading-section" |
| 28 | + loading-label="Loading project overview" |
| 29 | + :column-span="['default' => 'full']" |
| 30 | + x-bind:style="{ height: tall ? '12rem' : '8rem' }" |
| 31 | + /> |
| 32 | + </template> |
| 33 | + <template |
| 34 | + x-if="visible && state === 'loading' && gridOffset" |
| 35 | + > |
| 36 | + <x-filament::loading-section |
| 37 | + data-testid="loading-section" |
| 38 | + loading-label="Loading project overview" |
| 39 | + :column-span="['default' => 'full', 'lg' => 2]" |
| 40 | + :column-start="['lg' => 3]" |
| 41 | + x-bind:style="{ height: tall ? '12rem' : '8rem' }" |
| 42 | + /> |
| 43 | + </template> |
| 44 | + <template x-if="visible && state !== 'loading'"> |
22 | 45 | <div |
23 | | - class="fi-section-content" |
24 | | - x-text=" |
25 | | - state === 'ready' |
26 | | - ? 'Community garden · 8 of 12 milestones complete.' |
27 | | - : 'Project overview could not be loaded. Try again.' |
28 | | - " |
29 | | - ></div> |
30 | | - </div> |
31 | | - </template> |
| 46 | + class="fi-section fi-grid-col" |
| 47 | + style="--col-span-default: 1 / -1" |
| 48 | + data-testid="content" |
| 49 | + > |
| 50 | + <div |
| 51 | + class="fi-section-content" |
| 52 | + x-text=" |
| 53 | + state === 'ready' |
| 54 | + ? 'Community garden · 8 of 12 milestones complete.' |
| 55 | + : 'Project overview could not be loaded. Try again.' |
| 56 | + " |
| 57 | + ></div> |
| 58 | + </div> |
| 59 | + </template> |
| 60 | + </div> |
32 | 61 | <div class="icon-demo-controls"> |
33 | 62 | <button |
34 | 63 | type="button" |
@@ -57,7 +86,7 @@ class="fi-section-content" |
57 | 86 | <button |
58 | 87 | type="button" |
59 | 88 | data-testid="reset" |
60 | | - x-on:click="state = 'loading'; tall = false; visible = true" |
| 89 | + x-on:click="state = 'loading'; tall = false; visible = true; gridOffset = false" |
61 | 90 | > |
62 | 91 | Reset |
63 | 92 | </button> |
@@ -85,6 +114,14 @@ class="fi-section-content" |
85 | 114 | : '' |
86 | 115 | " |
87 | 116 | ></p> |
| 117 | + <label> |
| 118 | + <input |
| 119 | + type="checkbox" |
| 120 | + data-testid="grid-offset" |
| 121 | + x-model="gridOffset" |
| 122 | + /> |
| 123 | + Use columns 3–4 on wide screens (1024px+) |
| 124 | + </label> |
88 | 125 | </div> |
89 | 126 | </x-filament::section> |
90 | 127 | </x-filament-widgets::widget> |
0 commit comments