@pure-ds/storybook 0.3.19 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/addons/pds-configurator/SearchTool.js +44 -44
- package/.storybook/preview.js +6 -2
- package/dist/pds-reference.json +65 -13
- package/package.json +50 -50
- package/stories/components/PdsCalendar.stories.js +266 -263
- package/stories/components/PdsDrawer.stories.js +2 -2
- package/stories/components/PdsIcon.stories.js +2 -2
- package/stories/components/PdsJsonform.stories.js +2 -2
- package/stories/components/PdsRichtext.stories.js +367 -367
- package/stories/components/PdsScrollrow.stories.js +140 -140
- package/stories/components/PdsSplitpanel.stories.js +502 -502
- package/stories/components/PdsTabstrip.stories.js +2 -2
- package/stories/components/PdsToaster.stories.js +186 -186
- package/stories/components/PdsUpload.stories.js +66 -66
- package/stories/enhancements/Dropdowns.stories.js +185 -185
- package/stories/enhancements/InteractiveStates.stories.js +625 -625
- package/stories/enhancements/MeshGradients.stories.js +321 -320
- package/stories/enhancements/OpenGroups.stories.js +227 -227
- package/stories/enhancements/RangeSliders.stories.js +232 -232
- package/stories/enhancements/RequiredFields.stories.js +189 -189
- package/stories/enhancements/Toggles.stories.js +167 -167
- package/stories/foundations/Colors.stories.js +2 -1
- package/stories/foundations/Icons.stories.js +4 -0
- package/stories/foundations/SmartSurfaces.stories.js +485 -367
- package/stories/foundations/Spacing.stories.js +5 -1
- package/stories/foundations/Typography.stories.js +4 -0
- package/stories/foundations/ZIndex.stories.js +329 -325
- package/stories/layout/LayoutOverview.stories.js +247 -0
- package/stories/layout/LayoutSystem.stories.js +852 -0
- package/stories/patterns/BorderEffects.stories.js +74 -72
- package/stories/primitives/Accordion.stories.js +5 -3
- package/stories/primitives/Alerts.stories.js +261 -46
- package/stories/primitives/Badges.stories.js +4 -0
- package/stories/primitives/Buttons.stories.js +2 -2
- package/stories/primitives/Cards.stories.js +98 -170
- package/stories/primitives/Media.stories.js +442 -203
- package/stories/primitives/Tables.stories.js +358 -232
- package/stories/utilities/Backdrop.stories.js +197 -0
- package/stories/patterns/Layout.stories.js +0 -99
- package/stories/utilities/GridSystem.stories.js +0 -208
|
@@ -0,0 +1,852 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Layout/System",
|
|
5
|
+
tags: ["layout", "flex", "grid", "container", "utilities"],
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component:
|
|
10
|
+
"Complete layout system: Container, Grid, Flex, Stack, and Gap utilities.",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// ─────────────────────────────────────────────────────────────
|
|
17
|
+
// CONTAINER
|
|
18
|
+
// ─────────────────────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
export const Container = () => html`
|
|
21
|
+
<div class="card surface-subtle" style="padding: var(--spacing-2);">
|
|
22
|
+
<p class="text-muted text-center">
|
|
23
|
+
Gray background shows viewport width. Container centers content with
|
|
24
|
+
max-width.
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
class="container surface-base"
|
|
29
|
+
style="border-radius: var(--radius-md);"
|
|
30
|
+
>
|
|
31
|
+
<h2>Container</h2>
|
|
32
|
+
<p>
|
|
33
|
+
<code>.container</code> centers content with a max-width (default
|
|
34
|
+
1400px) and consistent horizontal padding. Foundation for page layouts.
|
|
35
|
+
</p>
|
|
36
|
+
<div class="flex gap-md flex-wrap">
|
|
37
|
+
<button class="btn-primary">Primary</button>
|
|
38
|
+
<button class="btn-secondary">Secondary</button>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<h3>Full-Width Section Pattern</h3>
|
|
44
|
+
<div class="card surface-subtle">
|
|
45
|
+
<div class="container">
|
|
46
|
+
<p>Content before full-width section</p>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div class="card surface-inverse">
|
|
50
|
+
<div class="container">
|
|
51
|
+
<h4>Full-Width Background, Contained Content</h4>
|
|
52
|
+
<p>Common for hero sections, CTAs, and feature highlights.</p>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div class="container">
|
|
57
|
+
<p>Content continues within container.</p>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
Container.storyName = "Container";
|
|
63
|
+
|
|
64
|
+
// ─────────────────────────────────────────────────────────────
|
|
65
|
+
// GRID SYSTEM
|
|
66
|
+
// ─────────────────────────────────────────────────────────────
|
|
67
|
+
|
|
68
|
+
export const GridFixed = () => html`
|
|
69
|
+
<h2>Fixed Column Grids</h2>
|
|
70
|
+
<p class="text-muted">Explicit column counts for predictable layouts.</p>
|
|
71
|
+
|
|
72
|
+
<div class="stack-md">
|
|
73
|
+
<div class="card">
|
|
74
|
+
<h3>.grid-cols-2</h3>
|
|
75
|
+
<div class="grid grid-cols-2 gap-md">
|
|
76
|
+
<div class="card surface-elevated text-center">Column 1</div>
|
|
77
|
+
<div class="card surface-elevated text-center">Column 2</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div class="card">
|
|
82
|
+
<h3>.grid-cols-3</h3>
|
|
83
|
+
<div class="grid grid-cols-3 gap-md">
|
|
84
|
+
<div class="card surface-elevated text-center">1</div>
|
|
85
|
+
<div class="card surface-elevated text-center">2</div>
|
|
86
|
+
<div class="card surface-elevated text-center">3</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<div class="card">
|
|
91
|
+
<h3>.grid-cols-4</h3>
|
|
92
|
+
<div class="grid grid-cols-4 gap-sm">
|
|
93
|
+
${Array.from(
|
|
94
|
+
{ length: 4 },
|
|
95
|
+
(_, i) => html`
|
|
96
|
+
<div class="card surface-elevated text-center">
|
|
97
|
+
<strong>${i + 1}</strong>
|
|
98
|
+
</div>
|
|
99
|
+
`
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div class="card">
|
|
105
|
+
<h3>.grid-cols-6</h3>
|
|
106
|
+
<div class="grid grid-cols-6 gap-xs">
|
|
107
|
+
${Array.from(
|
|
108
|
+
{ length: 6 },
|
|
109
|
+
(_, i) => html`
|
|
110
|
+
<div class="card surface-elevated text-center">
|
|
111
|
+
<strong>${i + 1}</strong>
|
|
112
|
+
</div>
|
|
113
|
+
`
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
`;
|
|
119
|
+
|
|
120
|
+
GridFixed.storyName = "Grid: Fixed Columns";
|
|
121
|
+
|
|
122
|
+
export const GridAuto = () => html`
|
|
123
|
+
<div class="card">
|
|
124
|
+
<h2>Auto-Fit Responsive Grids</h2>
|
|
125
|
+
<p class="text-muted">
|
|
126
|
+
Automatically adjust columns based on available space. Resize the browser
|
|
127
|
+
to see the effect.
|
|
128
|
+
</p>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div class="card">
|
|
132
|
+
<h3>.grid-auto-sm (min 150px)</h3>
|
|
133
|
+
<div class="grid grid-auto-sm gap-md">
|
|
134
|
+
${Array.from(
|
|
135
|
+
{ length: 6 },
|
|
136
|
+
(_, i) => html`
|
|
137
|
+
<div class="card surface-elevated text-center">
|
|
138
|
+
<pds-icon icon="square" size="md" class="icon-primary"></pds-icon>
|
|
139
|
+
<p>Item ${i + 1}</p>
|
|
140
|
+
</div>
|
|
141
|
+
`
|
|
142
|
+
)}
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div class="card">
|
|
147
|
+
<h3>.grid-auto-md (min 250px)</h3>
|
|
148
|
+
<div class="grid grid-auto-md gap-lg">
|
|
149
|
+
${Array.from(
|
|
150
|
+
{ length: 4 },
|
|
151
|
+
(_, i) => html`
|
|
152
|
+
<div class="card surface-elevated text-center">
|
|
153
|
+
<pds-icon icon="circle" size="lg" class="icon-success"></pds-icon>
|
|
154
|
+
<h4>Card ${i + 1}</h4>
|
|
155
|
+
<p>Larger min-width = fewer columns on small screens</p>
|
|
156
|
+
</div>
|
|
157
|
+
`
|
|
158
|
+
)}
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div class="card">
|
|
163
|
+
<h3>.grid-auto-lg (min 350px)</h3>
|
|
164
|
+
<div class="grid grid-auto-lg gap-lg">
|
|
165
|
+
${Array.from(
|
|
166
|
+
{ length: 3 },
|
|
167
|
+
(_, i) => html`
|
|
168
|
+
<div class="card surface-elevated text-center">
|
|
169
|
+
<pds-icon icon="diamond" size="xl" class="icon-accent"></pds-icon>
|
|
170
|
+
<h4>Feature ${i + 1}</h4>
|
|
171
|
+
<p>Wide cards for feature sections</p>
|
|
172
|
+
</div>
|
|
173
|
+
`
|
|
174
|
+
)}
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
`;
|
|
178
|
+
|
|
179
|
+
GridAuto.storyName = "Grid: Auto-Fit";
|
|
180
|
+
|
|
181
|
+
// ─────────────────────────────────────────────────────────────
|
|
182
|
+
// FLEXBOX
|
|
183
|
+
// ─────────────────────────────────────────────────────────────
|
|
184
|
+
|
|
185
|
+
export const FlexBasics = () => html`
|
|
186
|
+
<div class="card">
|
|
187
|
+
<h2>Flexbox Utilities</h2>
|
|
188
|
+
<p class="text-muted">
|
|
189
|
+
Compose layouts with <code>.flex</code> + modifiers.
|
|
190
|
+
</p>
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
<div class="card">
|
|
194
|
+
<h3>.flex (row by default)</h3>
|
|
195
|
+
<div
|
|
196
|
+
class="flex gap-md surface-subtle"
|
|
197
|
+
style="padding: var(--spacing-4); border-radius: var(--radius-md);"
|
|
198
|
+
>
|
|
199
|
+
<div class="card">Item 1</div>
|
|
200
|
+
<div class="card">Item 2</div>
|
|
201
|
+
<div class="card">Item 3</div>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<div class="card">
|
|
206
|
+
<h3>.flex .flex-col</h3>
|
|
207
|
+
<div
|
|
208
|
+
class="flex flex-col gap-sm surface-subtle"
|
|
209
|
+
style="padding: var(--spacing-4); border-radius: var(--radius-md);"
|
|
210
|
+
>
|
|
211
|
+
<div class="card">Item 1</div>
|
|
212
|
+
<div class="card">Item 2</div>
|
|
213
|
+
<div class="card">Item 3</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<div class="card">
|
|
218
|
+
<h3>.flex .flex-wrap</h3>
|
|
219
|
+
<div
|
|
220
|
+
class="flex flex-wrap gap-sm surface-subtle"
|
|
221
|
+
style="padding: var(--spacing-4); border-radius: var(--radius-md);"
|
|
222
|
+
>
|
|
223
|
+
${Array.from(
|
|
224
|
+
{ length: 8 },
|
|
225
|
+
(_, i) => html`
|
|
226
|
+
<div class="card" style="min-width: 120px;">Item ${i + 1}</div>
|
|
227
|
+
`
|
|
228
|
+
)}
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
<div class="card">
|
|
233
|
+
<h3>.grow (fill remaining space)</h3>
|
|
234
|
+
<div
|
|
235
|
+
class="flex gap-md surface-subtle"
|
|
236
|
+
style="padding: var(--spacing-4); border-radius: var(--radius-md);"
|
|
237
|
+
>
|
|
238
|
+
<div class="card" style="width: 100px;">Fixed</div>
|
|
239
|
+
<div class="card grow">This item grows to fill available space</div>
|
|
240
|
+
<div class="card" style="width: 100px;">Fixed</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
`;
|
|
244
|
+
|
|
245
|
+
FlexBasics.storyName = "Flex: Basics";
|
|
246
|
+
|
|
247
|
+
export const FlexAlignment = () => html`
|
|
248
|
+
<div class="card">
|
|
249
|
+
<h2>Alignment Utilities</h2>
|
|
250
|
+
<p class="text-muted">
|
|
251
|
+
Cross-axis: <code>.items-*</code> | Main-axis: <code>.justify-*</code>
|
|
252
|
+
</p>
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
<div class="card">
|
|
256
|
+
<h3>Items Alignment (Cross-Axis)</h3>
|
|
257
|
+
<div class="grid grid-cols-3 gap-md">
|
|
258
|
+
<div>
|
|
259
|
+
<code>.items-start</code>
|
|
260
|
+
<div
|
|
261
|
+
class="flex items-start gap-sm surface-subtle"
|
|
262
|
+
style="height: 100px; padding: var(--spacing-2); border-radius: var(--radius-md);"
|
|
263
|
+
>
|
|
264
|
+
<div class="card" style="padding: var(--spacing-2);">A</div>
|
|
265
|
+
<div class="card" style="padding: var(--spacing-4);">B</div>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
<div>
|
|
269
|
+
<code>.items-center</code>
|
|
270
|
+
<div
|
|
271
|
+
class="flex items-center gap-sm surface-subtle"
|
|
272
|
+
style="height: 100px; padding: var(--spacing-2); border-radius: var(--radius-md);"
|
|
273
|
+
>
|
|
274
|
+
<div class="card" style="padding: var(--spacing-2);">A</div>
|
|
275
|
+
<div class="card" style="padding: var(--spacing-4);">B</div>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
<div>
|
|
279
|
+
<code>.items-end</code>
|
|
280
|
+
<div
|
|
281
|
+
class="flex items-end gap-sm surface-subtle"
|
|
282
|
+
style="height: 100px; padding: var(--spacing-2); border-radius: var(--radius-md);"
|
|
283
|
+
>
|
|
284
|
+
<div class="card" style="padding: var(--spacing-2);">A</div>
|
|
285
|
+
<div class="card" style="padding: var(--spacing-4);">B</div>
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
<div class="card">
|
|
292
|
+
<h3>Justify Content (Main-Axis)</h3>
|
|
293
|
+
<div class="stack-md">
|
|
294
|
+
${["start", "center", "end", "between", "around", "evenly"].map(
|
|
295
|
+
(justify) => html`
|
|
296
|
+
<div>
|
|
297
|
+
<code>.justify-${justify}</code>
|
|
298
|
+
<div
|
|
299
|
+
class="flex justify-${justify} gap-sm surface-subtle"
|
|
300
|
+
style="padding: var(--spacing-2); border-radius: var(--radius-md);"
|
|
301
|
+
>
|
|
302
|
+
<div class="card" style="padding: var(--spacing-2);">A</div>
|
|
303
|
+
<div class="card" style="padding: var(--spacing-2);">B</div>
|
|
304
|
+
<div class="card" style="padding: var(--spacing-2);">C</div>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
`
|
|
308
|
+
)}
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
`;
|
|
312
|
+
|
|
313
|
+
FlexAlignment.storyName = "Flex: Alignment";
|
|
314
|
+
|
|
315
|
+
// ─────────────────────────────────────────────────────────────
|
|
316
|
+
// STACK
|
|
317
|
+
// ─────────────────────────────────────────────────────────────
|
|
318
|
+
|
|
319
|
+
export const Stack = () => html`
|
|
320
|
+
<h2>Stack Utilities</h2>
|
|
321
|
+
<p class="text-muted">
|
|
322
|
+
Vertical layouts with consistent spacing.
|
|
323
|
+
<code>.stack-*</code> = <code>.flex .flex-col .gap-*</code> in one class.
|
|
324
|
+
</p>
|
|
325
|
+
|
|
326
|
+
<div class="stack-md">
|
|
327
|
+
<div class="card grid grid-cols-2 gap-lg">
|
|
328
|
+
${["sm", "md", "lg", "xl"].map(
|
|
329
|
+
(size) => html`
|
|
330
|
+
<div class="card">
|
|
331
|
+
<h3>.stack-${size}</h3>
|
|
332
|
+
<div
|
|
333
|
+
class="stack-${size} surface-subtle"
|
|
334
|
+
style="padding: var(--spacing-3); border-radius: var(--radius-md);"
|
|
335
|
+
>
|
|
336
|
+
<div class="card" style="padding: var(--spacing-2);">Item 1</div>
|
|
337
|
+
<div class="card" style="padding: var(--spacing-2);">Item 2</div>
|
|
338
|
+
<div class="card" style="padding: var(--spacing-2);">Item 3</div>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
`
|
|
342
|
+
)}
|
|
343
|
+
</div>
|
|
344
|
+
|
|
345
|
+
<div class="card">
|
|
346
|
+
<h3>Practical: Form Layout</h3>
|
|
347
|
+
<form class="stack-md max-w-md">
|
|
348
|
+
<label>
|
|
349
|
+
<span>Name</span>
|
|
350
|
+
<input type="text" placeholder="John Doe" />
|
|
351
|
+
</label>
|
|
352
|
+
<label>
|
|
353
|
+
<span>Email</span>
|
|
354
|
+
<input type="email" placeholder="john@example.com" />
|
|
355
|
+
</label>
|
|
356
|
+
<label>
|
|
357
|
+
<span>Message</span>
|
|
358
|
+
<textarea rows="3" placeholder="Your message..."></textarea>
|
|
359
|
+
</label>
|
|
360
|
+
<div class="flex gap-sm justify-end">
|
|
361
|
+
<button type="button" class="btn-secondary">Cancel</button>
|
|
362
|
+
<button type="submit" class="btn-primary">Submit</button>
|
|
363
|
+
</div>
|
|
364
|
+
</form>
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
`;
|
|
368
|
+
|
|
369
|
+
Stack.storyName = "Stack";
|
|
370
|
+
|
|
371
|
+
// ─────────────────────────────────────────────────────────────
|
|
372
|
+
// GAP
|
|
373
|
+
// ─────────────────────────────────────────────────────────────
|
|
374
|
+
|
|
375
|
+
export const Gap = () => html`
|
|
376
|
+
<h2>Gap Utilities</h2>
|
|
377
|
+
<p class="text-muted">Control spacing between flex/grid children.</p>
|
|
378
|
+
|
|
379
|
+
<div class="stack-md">
|
|
380
|
+
${[
|
|
381
|
+
{ cls: "gap-0", label: "0" },
|
|
382
|
+
{ cls: "gap-xs", label: "var(--spacing-1)" },
|
|
383
|
+
{ cls: "gap-sm", label: "var(--spacing-2)" },
|
|
384
|
+
{ cls: "gap-md", label: "var(--spacing-4)" },
|
|
385
|
+
{ cls: "gap-lg", label: "var(--spacing-6)" },
|
|
386
|
+
{ cls: "gap-xl", label: "var(--spacing-8)" },
|
|
387
|
+
].map(
|
|
388
|
+
({ cls, label }) => html`
|
|
389
|
+
<div class="card">
|
|
390
|
+
<code>.${cls}</code> <span class="text-muted">(${label})</span>
|
|
391
|
+
<div
|
|
392
|
+
class="grid grid-cols-4 ${cls}"
|
|
393
|
+
style="margin-top: var(--spacing-2);"
|
|
394
|
+
>
|
|
395
|
+
${Array.from(
|
|
396
|
+
{ length: 4 },
|
|
397
|
+
(_, i) => html`
|
|
398
|
+
<div
|
|
399
|
+
class="card surface-elevated text-center"
|
|
400
|
+
style="padding: var(--spacing-2);"
|
|
401
|
+
>
|
|
402
|
+
${i + 1}
|
|
403
|
+
</div>
|
|
404
|
+
`
|
|
405
|
+
)}
|
|
406
|
+
</div>
|
|
407
|
+
</div>
|
|
408
|
+
`
|
|
409
|
+
)}
|
|
410
|
+
</div>
|
|
411
|
+
`;
|
|
412
|
+
|
|
413
|
+
Gap.storyName = "Gap";
|
|
414
|
+
|
|
415
|
+
// ─────────────────────────────────────────────────────────────
|
|
416
|
+
// MAX-WIDTH
|
|
417
|
+
// ─────────────────────────────────────────────────────────────
|
|
418
|
+
|
|
419
|
+
export const MaxWidth = () => html`
|
|
420
|
+
<div class="card">
|
|
421
|
+
<h2>Max-Width Utilities</h2>
|
|
422
|
+
<p class="text-muted">Constrain content width for readability.</p>
|
|
423
|
+
</div>
|
|
424
|
+
|
|
425
|
+
<div class="stack-lg">
|
|
426
|
+
${[
|
|
427
|
+
{ cls: "max-w-sm", px: "400px", use: "Login forms, modals" },
|
|
428
|
+
{ cls: "max-w-md", px: "600px", use: "Cards, forms, dialogs" },
|
|
429
|
+
{ cls: "max-w-lg", px: "800px", use: "Articles, documentation" },
|
|
430
|
+
{ cls: "max-w-xl", px: "1200px", use: "Dashboards, complex layouts" },
|
|
431
|
+
].map(
|
|
432
|
+
({ cls, px, use }) => html`
|
|
433
|
+
<div>
|
|
434
|
+
<code>.${cls}</code> <span class="text-muted">(${px}) — ${use}</span>
|
|
435
|
+
<div
|
|
436
|
+
class="${cls} surface-subtle"
|
|
437
|
+
style="padding: var(--spacing-4); border-radius: var(--radius-md); margin-top: var(--spacing-2);"
|
|
438
|
+
>
|
|
439
|
+
Content constrained to ${px}
|
|
440
|
+
</div>
|
|
441
|
+
</div>
|
|
442
|
+
`
|
|
443
|
+
)}
|
|
444
|
+
</div>
|
|
445
|
+
`;
|
|
446
|
+
|
|
447
|
+
MaxWidth.storyName = "Max-Width";
|
|
448
|
+
|
|
449
|
+
// ─────────────────────────────────────────────────────────────
|
|
450
|
+
// SECTION SPACING
|
|
451
|
+
// ─────────────────────────────────────────────────────────────
|
|
452
|
+
|
|
453
|
+
export const Section = () => html`
|
|
454
|
+
|
|
455
|
+
<h2>Section Spacing</h2>
|
|
456
|
+
<p class="text-muted">Vertical padding for major content blocks.</p>
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
<div
|
|
460
|
+
class="stack-lg"
|
|
461
|
+
>
|
|
462
|
+
<div class="section surface-elevated surface-translucent-50 text-center">
|
|
463
|
+
<h3>.section</h3>
|
|
464
|
+
<p>padding-block: var(--spacing-8)</p>
|
|
465
|
+
</div>
|
|
466
|
+
|
|
467
|
+
<div class="section-lg surface-overlay text-center">
|
|
468
|
+
<h3>.section-lg</h3>
|
|
469
|
+
<p>padding-block: var(--spacing-12)</p>
|
|
470
|
+
</div>
|
|
471
|
+
</div>
|
|
472
|
+
`;
|
|
473
|
+
|
|
474
|
+
Section.storyName = "Section";
|
|
475
|
+
|
|
476
|
+
// ─────────────────────────────────────────────────────────────
|
|
477
|
+
// RESPONSIVE
|
|
478
|
+
// ─────────────────────────────────────────────────────────────
|
|
479
|
+
|
|
480
|
+
export const Responsive = () => html`
|
|
481
|
+
<div class="card">
|
|
482
|
+
<h2>Responsive Utilities</h2>
|
|
483
|
+
</div>
|
|
484
|
+
|
|
485
|
+
<div class="card">
|
|
486
|
+
<h3>.mobile-stack</h3>
|
|
487
|
+
<p class="text-muted">
|
|
488
|
+
Row on desktop, column on mobile. Resize browser to see effect.
|
|
489
|
+
</p>
|
|
490
|
+
|
|
491
|
+
<div class="flex mobile-stack gap-md">
|
|
492
|
+
<article class="card surface-elevated">
|
|
493
|
+
<h4>Feature One</h4>
|
|
494
|
+
<p>Horizontal on desktop</p>
|
|
495
|
+
</article>
|
|
496
|
+
<article class="card surface-elevated">
|
|
497
|
+
<h4>Feature Two</h4>
|
|
498
|
+
<p>Stacks on mobile</p>
|
|
499
|
+
</article>
|
|
500
|
+
<article class="card surface-elevated">
|
|
501
|
+
<h4>Feature Three</h4>
|
|
502
|
+
<p>No custom CSS needed</p>
|
|
503
|
+
</article>
|
|
504
|
+
</div>
|
|
505
|
+
</div>
|
|
506
|
+
|
|
507
|
+
<div class="card">
|
|
508
|
+
<h3>Practical: Form + Button</h3>
|
|
509
|
+
<div class="flex mobile-stack gap-md items-end">
|
|
510
|
+
<label class="grow">
|
|
511
|
+
<span>Email</span>
|
|
512
|
+
<input type="email" placeholder="you@example.com" />
|
|
513
|
+
</label>
|
|
514
|
+
<button>Subscribe</button>
|
|
515
|
+
</div>
|
|
516
|
+
</div>
|
|
517
|
+
`;
|
|
518
|
+
|
|
519
|
+
Responsive.storyName = "Responsive";
|
|
520
|
+
|
|
521
|
+
// ─────────────────────────────────────────────────────────────
|
|
522
|
+
// TEXT UTILITIES
|
|
523
|
+
// ─────────────────────────────────────────────────────────────
|
|
524
|
+
|
|
525
|
+
export const TextUtilities = () => html`
|
|
526
|
+
<div class="card">
|
|
527
|
+
<h2>Text Utilities</h2>
|
|
528
|
+
</div>
|
|
529
|
+
|
|
530
|
+
<div class="card">
|
|
531
|
+
<h3>Text Alignment</h3>
|
|
532
|
+
<div class="grid grid-cols-3 gap-md">
|
|
533
|
+
<div class="card">
|
|
534
|
+
<code>.text-left</code>
|
|
535
|
+
<p class="text-left">Left-aligned (default for LTR)</p>
|
|
536
|
+
</div>
|
|
537
|
+
<div class="card">
|
|
538
|
+
<code>.text-center</code>
|
|
539
|
+
<p class="text-center">Centered text</p>
|
|
540
|
+
</div>
|
|
541
|
+
<div class="card">
|
|
542
|
+
<code>.text-right</code>
|
|
543
|
+
<p class="text-right">Right-aligned</p>
|
|
544
|
+
</div>
|
|
545
|
+
</div>
|
|
546
|
+
</div>
|
|
547
|
+
|
|
548
|
+
<div class="card">
|
|
549
|
+
<h3>.truncate</h3>
|
|
550
|
+
<p class="text-muted">Truncates text with ellipsis when overflowing.</p>
|
|
551
|
+
<div
|
|
552
|
+
class="max-w-sm surface-subtle"
|
|
553
|
+
style="padding: var(--spacing-3); border-radius: var(--radius-md);"
|
|
554
|
+
>
|
|
555
|
+
<p class="truncate">
|
|
556
|
+
This is a very long piece of text that will be truncated with an
|
|
557
|
+
ellipsis when it overflows its container because it has the .truncate
|
|
558
|
+
class applied.
|
|
559
|
+
</p>
|
|
560
|
+
</div>
|
|
561
|
+
</div>
|
|
562
|
+
`;
|
|
563
|
+
|
|
564
|
+
TextUtilities.storyName = "Text";
|
|
565
|
+
|
|
566
|
+
// ─────────────────────────────────────────────────────────────
|
|
567
|
+
// REFERENCE TABLE
|
|
568
|
+
// ─────────────────────────────────────────────────────────────
|
|
569
|
+
|
|
570
|
+
export const Reference = () => html`
|
|
571
|
+
<div class="card">
|
|
572
|
+
<h2>Complete Layout Reference</h2>
|
|
573
|
+
<p class="text-muted">All layout utilities in PDS.</p>
|
|
574
|
+
</div>
|
|
575
|
+
|
|
576
|
+
<table class="table-bordered table-compact">
|
|
577
|
+
<thead>
|
|
578
|
+
<tr>
|
|
579
|
+
<th>Category</th>
|
|
580
|
+
<th>Class</th>
|
|
581
|
+
<th>CSS</th>
|
|
582
|
+
</tr>
|
|
583
|
+
</thead>
|
|
584
|
+
<tbody>
|
|
585
|
+
<tr>
|
|
586
|
+
<td colspan="3"><strong>Container</strong></td>
|
|
587
|
+
</tr>
|
|
588
|
+
<tr>
|
|
589
|
+
<td></td>
|
|
590
|
+
<td><code>.container</code></td>
|
|
591
|
+
<td>max-width + padding + auto margins</td>
|
|
592
|
+
</tr>
|
|
593
|
+
|
|
594
|
+
<tr>
|
|
595
|
+
<td colspan="3"><strong>Grid</strong></td>
|
|
596
|
+
</tr>
|
|
597
|
+
<tr>
|
|
598
|
+
<td></td>
|
|
599
|
+
<td><code>.grid</code></td>
|
|
600
|
+
<td>display: grid</td>
|
|
601
|
+
</tr>
|
|
602
|
+
<tr>
|
|
603
|
+
<td></td>
|
|
604
|
+
<td><code>.grid-cols-1</code> to <code>.grid-cols-6</code></td>
|
|
605
|
+
<td>Fixed column counts (1, 2, 3, 4, 6)</td>
|
|
606
|
+
</tr>
|
|
607
|
+
<tr>
|
|
608
|
+
<td></td>
|
|
609
|
+
<td><code>.grid-auto-sm</code></td>
|
|
610
|
+
<td>auto-fit, min 150px</td>
|
|
611
|
+
</tr>
|
|
612
|
+
<tr>
|
|
613
|
+
<td></td>
|
|
614
|
+
<td><code>.grid-auto-md</code></td>
|
|
615
|
+
<td>auto-fit, min 250px</td>
|
|
616
|
+
</tr>
|
|
617
|
+
<tr>
|
|
618
|
+
<td></td>
|
|
619
|
+
<td><code>.grid-auto-lg</code></td>
|
|
620
|
+
<td>auto-fit, min 350px</td>
|
|
621
|
+
</tr>
|
|
622
|
+
<tr>
|
|
623
|
+
<td></td>
|
|
624
|
+
<td><code>.grid-auto-xl</code></td>
|
|
625
|
+
<td>auto-fit, min 450px</td>
|
|
626
|
+
</tr>
|
|
627
|
+
|
|
628
|
+
<tr>
|
|
629
|
+
<td colspan="3"><strong>Flexbox</strong></td>
|
|
630
|
+
</tr>
|
|
631
|
+
<tr>
|
|
632
|
+
<td></td>
|
|
633
|
+
<td><code>.flex</code></td>
|
|
634
|
+
<td>display: flex</td>
|
|
635
|
+
</tr>
|
|
636
|
+
<tr>
|
|
637
|
+
<td></td>
|
|
638
|
+
<td><code>.flex-col</code></td>
|
|
639
|
+
<td>flex-direction: column</td>
|
|
640
|
+
</tr>
|
|
641
|
+
<tr>
|
|
642
|
+
<td></td>
|
|
643
|
+
<td><code>.flex-row</code></td>
|
|
644
|
+
<td>flex-direction: row</td>
|
|
645
|
+
</tr>
|
|
646
|
+
<tr>
|
|
647
|
+
<td></td>
|
|
648
|
+
<td><code>.flex-wrap</code></td>
|
|
649
|
+
<td>flex-wrap: wrap</td>
|
|
650
|
+
</tr>
|
|
651
|
+
<tr>
|
|
652
|
+
<td></td>
|
|
653
|
+
<td><code>.grow</code></td>
|
|
654
|
+
<td>flex: 1 1 0%</td>
|
|
655
|
+
</tr>
|
|
656
|
+
|
|
657
|
+
<tr>
|
|
658
|
+
<td colspan="3"><strong>Stack (Vertical)</strong></td>
|
|
659
|
+
</tr>
|
|
660
|
+
<tr>
|
|
661
|
+
<td></td>
|
|
662
|
+
<td><code>.stack-sm</code></td>
|
|
663
|
+
<td>flex column, gap: --spacing-2</td>
|
|
664
|
+
</tr>
|
|
665
|
+
<tr>
|
|
666
|
+
<td></td>
|
|
667
|
+
<td><code>.stack-md</code></td>
|
|
668
|
+
<td>flex column, gap: --spacing-4</td>
|
|
669
|
+
</tr>
|
|
670
|
+
<tr>
|
|
671
|
+
<td></td>
|
|
672
|
+
<td><code>.stack-lg</code></td>
|
|
673
|
+
<td>flex column, gap: --spacing-6</td>
|
|
674
|
+
</tr>
|
|
675
|
+
<tr>
|
|
676
|
+
<td></td>
|
|
677
|
+
<td><code>.stack-xl</code></td>
|
|
678
|
+
<td>flex column, gap: --spacing-8</td>
|
|
679
|
+
</tr>
|
|
680
|
+
|
|
681
|
+
<tr>
|
|
682
|
+
<td colspan="3"><strong>Items Align</strong></td>
|
|
683
|
+
</tr>
|
|
684
|
+
<tr>
|
|
685
|
+
<td></td>
|
|
686
|
+
<td><code>.items-start</code></td>
|
|
687
|
+
<td>align-items: flex-start</td>
|
|
688
|
+
</tr>
|
|
689
|
+
<tr>
|
|
690
|
+
<td></td>
|
|
691
|
+
<td><code>.items-center</code></td>
|
|
692
|
+
<td>align-items: center</td>
|
|
693
|
+
</tr>
|
|
694
|
+
<tr>
|
|
695
|
+
<td></td>
|
|
696
|
+
<td><code>.items-end</code></td>
|
|
697
|
+
<td>align-items: flex-end</td>
|
|
698
|
+
</tr>
|
|
699
|
+
<tr>
|
|
700
|
+
<td></td>
|
|
701
|
+
<td><code>.items-stretch</code></td>
|
|
702
|
+
<td>align-items: stretch</td>
|
|
703
|
+
</tr>
|
|
704
|
+
<tr>
|
|
705
|
+
<td></td>
|
|
706
|
+
<td><code>.items-baseline</code></td>
|
|
707
|
+
<td>align-items: baseline</td>
|
|
708
|
+
</tr>
|
|
709
|
+
|
|
710
|
+
<tr>
|
|
711
|
+
<td colspan="3"><strong>Justify</strong></td>
|
|
712
|
+
</tr>
|
|
713
|
+
<tr>
|
|
714
|
+
<td></td>
|
|
715
|
+
<td><code>.justify-start</code></td>
|
|
716
|
+
<td>justify-content: flex-start</td>
|
|
717
|
+
</tr>
|
|
718
|
+
<tr>
|
|
719
|
+
<td></td>
|
|
720
|
+
<td><code>.justify-center</code></td>
|
|
721
|
+
<td>justify-content: center</td>
|
|
722
|
+
</tr>
|
|
723
|
+
<tr>
|
|
724
|
+
<td></td>
|
|
725
|
+
<td><code>.justify-end</code></td>
|
|
726
|
+
<td>justify-content: flex-end</td>
|
|
727
|
+
</tr>
|
|
728
|
+
<tr>
|
|
729
|
+
<td></td>
|
|
730
|
+
<td><code>.justify-between</code></td>
|
|
731
|
+
<td>justify-content: space-between</td>
|
|
732
|
+
</tr>
|
|
733
|
+
<tr>
|
|
734
|
+
<td></td>
|
|
735
|
+
<td><code>.justify-around</code></td>
|
|
736
|
+
<td>justify-content: space-around</td>
|
|
737
|
+
</tr>
|
|
738
|
+
<tr>
|
|
739
|
+
<td></td>
|
|
740
|
+
<td><code>.justify-evenly</code></td>
|
|
741
|
+
<td>justify-content: space-evenly</td>
|
|
742
|
+
</tr>
|
|
743
|
+
|
|
744
|
+
<tr>
|
|
745
|
+
<td colspan="3"><strong>Gap</strong></td>
|
|
746
|
+
</tr>
|
|
747
|
+
<tr>
|
|
748
|
+
<td></td>
|
|
749
|
+
<td><code>.gap-0</code></td>
|
|
750
|
+
<td>gap: 0</td>
|
|
751
|
+
</tr>
|
|
752
|
+
<tr>
|
|
753
|
+
<td></td>
|
|
754
|
+
<td><code>.gap-xs</code></td>
|
|
755
|
+
<td>gap: var(--spacing-1)</td>
|
|
756
|
+
</tr>
|
|
757
|
+
<tr>
|
|
758
|
+
<td></td>
|
|
759
|
+
<td><code>.gap-sm</code></td>
|
|
760
|
+
<td>gap: var(--spacing-2)</td>
|
|
761
|
+
</tr>
|
|
762
|
+
<tr>
|
|
763
|
+
<td></td>
|
|
764
|
+
<td><code>.gap-md</code></td>
|
|
765
|
+
<td>gap: var(--spacing-4)</td>
|
|
766
|
+
</tr>
|
|
767
|
+
<tr>
|
|
768
|
+
<td></td>
|
|
769
|
+
<td><code>.gap-lg</code></td>
|
|
770
|
+
<td>gap: var(--spacing-6)</td>
|
|
771
|
+
</tr>
|
|
772
|
+
<tr>
|
|
773
|
+
<td></td>
|
|
774
|
+
<td><code>.gap-xl</code></td>
|
|
775
|
+
<td>gap: var(--spacing-8)</td>
|
|
776
|
+
</tr>
|
|
777
|
+
|
|
778
|
+
<tr>
|
|
779
|
+
<td colspan="3"><strong>Max-Width</strong></td>
|
|
780
|
+
</tr>
|
|
781
|
+
<tr>
|
|
782
|
+
<td></td>
|
|
783
|
+
<td><code>.max-w-sm</code></td>
|
|
784
|
+
<td>max-width: 400px</td>
|
|
785
|
+
</tr>
|
|
786
|
+
<tr>
|
|
787
|
+
<td></td>
|
|
788
|
+
<td><code>.max-w-md</code></td>
|
|
789
|
+
<td>max-width: 600px</td>
|
|
790
|
+
</tr>
|
|
791
|
+
<tr>
|
|
792
|
+
<td></td>
|
|
793
|
+
<td><code>.max-w-lg</code></td>
|
|
794
|
+
<td>max-width: 800px</td>
|
|
795
|
+
</tr>
|
|
796
|
+
<tr>
|
|
797
|
+
<td></td>
|
|
798
|
+
<td><code>.max-w-xl</code></td>
|
|
799
|
+
<td>max-width: 1200px</td>
|
|
800
|
+
</tr>
|
|
801
|
+
|
|
802
|
+
<tr>
|
|
803
|
+
<td colspan="3"><strong>Section</strong></td>
|
|
804
|
+
</tr>
|
|
805
|
+
<tr>
|
|
806
|
+
<td></td>
|
|
807
|
+
<td><code>.section</code></td>
|
|
808
|
+
<td>padding-block: var(--spacing-8)</td>
|
|
809
|
+
</tr>
|
|
810
|
+
<tr>
|
|
811
|
+
<td></td>
|
|
812
|
+
<td><code>.section-lg</code></td>
|
|
813
|
+
<td>padding-block: var(--spacing-12)</td>
|
|
814
|
+
</tr>
|
|
815
|
+
|
|
816
|
+
<tr>
|
|
817
|
+
<td colspan="3"><strong>Text</strong></td>
|
|
818
|
+
</tr>
|
|
819
|
+
<tr>
|
|
820
|
+
<td></td>
|
|
821
|
+
<td><code>.text-left</code></td>
|
|
822
|
+
<td>text-align: left</td>
|
|
823
|
+
</tr>
|
|
824
|
+
<tr>
|
|
825
|
+
<td></td>
|
|
826
|
+
<td><code>.text-center</code></td>
|
|
827
|
+
<td>text-align: center</td>
|
|
828
|
+
</tr>
|
|
829
|
+
<tr>
|
|
830
|
+
<td></td>
|
|
831
|
+
<td><code>.text-right</code></td>
|
|
832
|
+
<td>text-align: right</td>
|
|
833
|
+
</tr>
|
|
834
|
+
<tr>
|
|
835
|
+
<td></td>
|
|
836
|
+
<td><code>.truncate</code></td>
|
|
837
|
+
<td>text-overflow: ellipsis + overflow hidden</td>
|
|
838
|
+
</tr>
|
|
839
|
+
|
|
840
|
+
<tr>
|
|
841
|
+
<td colspan="3"><strong>Responsive</strong></td>
|
|
842
|
+
</tr>
|
|
843
|
+
<tr>
|
|
844
|
+
<td></td>
|
|
845
|
+
<td><code>.mobile-stack</code></td>
|
|
846
|
+
<td>Column on mobile, row on desktop</td>
|
|
847
|
+
</tr>
|
|
848
|
+
</tbody>
|
|
849
|
+
</table>
|
|
850
|
+
`;
|
|
851
|
+
|
|
852
|
+
Reference.storyName = "Reference";
|