@pure-ds/storybook 0.4.16 → 0.4.19
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/html-preview/Panel.jsx +80 -29
- package/.storybook/addons/html-preview/preview.js +4 -5
- package/.storybook/manager.js +337 -49
- package/.storybook/preview-head.html +2 -2
- package/.storybook/preview.js +2 -2
- package/README.md +2 -2
- package/dist/pds-reference.json +1916 -267
- package/package.json +2 -2
- package/public/assets/css/app.css +2 -2
- package/public/assets/js/app.js +645 -10574
- package/public/assets/js/lit.js +3 -1048
- package/public/assets/js/pds.js +429 -7368
- package/public/assets/pds/components/pds-calendar.js +1 -1
- package/public/assets/pds/components/{pds-jsonform.js → pds-form.js} +536 -45
- package/public/assets/pds/custom-elements.json +271 -26
- package/public/assets/pds/pds-runtime-config.json +1 -1
- package/public/assets/pds/styles/pds-components.css +83 -221
- package/public/assets/pds/styles/pds-components.css.js +166 -442
- package/public/assets/pds/styles/pds-styles.css +240 -437
- package/public/assets/pds/styles/pds-styles.css.js +479 -881
- package/public/assets/pds/styles/pds-utilities.css +151 -214
- package/public/assets/pds/styles/pds-utilities.css.js +302 -428
- package/public/assets/pds/vscode-custom-data.json +63 -63
- package/scripts/build-pds-reference.mjs +112 -38
- package/scripts/generate-stories.js +2 -2
- package/src/js/common/ask.js +48 -21
- package/src/js/pds-configurator/pds-config-form.js +9 -9
- package/src/js/pds-configurator/pds-demo.js +2 -2
- package/src/js/pds-core/pds-config.js +14 -14
- package/src/js/pds-core/pds-generator.js +113 -50
- package/src/js/pds-core/pds-ontology.js +6 -6
- package/src/js/pds.d.ts +2 -2
- package/stories/GettingStarted.stories.js +3 -0
- package/stories/WhatIsPDS.stories.js +3 -0
- package/stories/components/PdsCalendar.stories.js +2 -2
- package/stories/components/PdsDrawer.stories.js +15 -15
- package/stories/components/PdsForm.stories.js +4356 -0
- package/stories/components/{PdsJsonformUiSchema.md → PdsFormUiSchema.md} +2 -2
- package/stories/components/PdsRichtext.stories.js +4 -17
- package/stories/components/PdsScrollrow.stories.js +224 -72
- package/stories/components/PdsSplitpanel.stories.js +63 -28
- package/stories/components/PdsTabstrip.stories.js +7 -7
- package/stories/enhancements/Accordion.stories.js +2 -2
- package/stories/enhancements/Dropdowns.stories.js +13 -10
- package/stories/enhancements/RangeSliders.stories.js +9 -9
- package/stories/enhancements/RequiredFields.stories.js +8 -8
- package/stories/enhancements/Toggles.stories.js +45 -36
- package/stories/enhancements/_enhancement-header.js +2 -2
- package/stories/foundations/Colors.stories.js +13 -13
- package/stories/foundations/HTMLDefaults.stories.js +4 -4
- package/stories/foundations/Icons.stories.js +123 -288
- package/stories/foundations/MeshGradients.stories.js +161 -250
- package/stories/foundations/SmartSurfaces.stories.js +147 -64
- package/stories/foundations/Spacing.stories.js +30 -30
- package/stories/foundations/Typography.stories.js +352 -723
- package/stories/foundations/ZIndex.stories.js +124 -141
- package/stories/layout/LayoutOverview.stories.js +345 -250
- package/stories/layout/LayoutSystem.stories.js +60 -76
- package/stories/patterns/InteractiveStates.stories.js +29 -29
- package/stories/patterns/Utilities.stories.js +17 -5
- package/stories/primitives/Alerts.stories.js +6 -6
- package/stories/primitives/Cards.stories.js +22 -11
- package/stories/primitives/{Forms.stories.js → FormElements.stories.js} +20 -11
- package/stories/primitives/HtmlFormElements.stories.js +128 -0
- package/stories/primitives/{FormGroups.stories.js → HtmlFormGroups.stories.js} +70 -21
- package/stories/primitives/Media.stories.js +23 -20
- package/stories/utilities/Backdrop.stories.js +68 -27
- package/stories/utils/PdsAsk.stories.js +15 -14
- package/public/assets/js/app.js.map +0 -7
- package/public/assets/js/lit.js.map +0 -7
- package/public/assets/js/pds.js.map +0 -7
- package/stories/components/PdsJsonform.stories.js +0 -1929
- /package/src/{pds-core → node-api}/pds-api.js +0 -0
|
@@ -1,4 +1,46 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
|
+
import { highlight, getCurrentTheme, preloadShiki } from "../utils/shiki.js";
|
|
3
|
+
|
|
4
|
+
// Pre-load Shiki
|
|
5
|
+
preloadShiki();
|
|
6
|
+
|
|
7
|
+
const layoutOverviewStyles = html`
|
|
8
|
+
<style>
|
|
9
|
+
.story-compare-grid { margin-block: var(--spacing-6); }
|
|
10
|
+
.story-code-block { font-size: var(--font-size-sm); overflow-x: auto; }
|
|
11
|
+
.story-note { margin-block-start: var(--spacing-3); }
|
|
12
|
+
.story-list { margin-block: var(--spacing-4); }
|
|
13
|
+
.story-checkmark { font-size: var(--font-size-xl); }
|
|
14
|
+
</style>
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
// Code samples for comparison
|
|
18
|
+
const tailwindCode = `<article class="max-w-md rounded-lg bg-white p-4 shadow-md">
|
|
19
|
+
<header class="space-y-1">
|
|
20
|
+
<h3 class="text-lg font-semibold">
|
|
21
|
+
A Nice Box With a Title
|
|
22
|
+
</h3>
|
|
23
|
+
<small class="text-sm text-slate-500">
|
|
24
|
+
The subtitle of the item
|
|
25
|
+
</small>
|
|
26
|
+
</header>
|
|
27
|
+
<p class="mt-3 text-base">
|
|
28
|
+
The body of the item with some descriptive text.
|
|
29
|
+
</p>
|
|
30
|
+
</article>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const pdsCode = `<article class="card surface-overlay">
|
|
34
|
+
<header>
|
|
35
|
+
<h3>A Nice Box With a Title</h3>
|
|
36
|
+
<small class="text-muted">
|
|
37
|
+
The subtitle of the item
|
|
38
|
+
</small>
|
|
39
|
+
</header>
|
|
40
|
+
<p>
|
|
41
|
+
The body of the item with some descriptive text.
|
|
42
|
+
</p>
|
|
43
|
+
</article>`;
|
|
2
44
|
|
|
3
45
|
export default {
|
|
4
46
|
title: "Foundations/Layout",
|
|
@@ -12,277 +54,330 @@ export default {
|
|
|
12
54
|
},
|
|
13
55
|
};
|
|
14
56
|
|
|
15
|
-
export const LayoutIntroduction = () =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
57
|
+
export const LayoutIntroduction = () => {
|
|
58
|
+
const container = document.createElement("div");
|
|
59
|
+
container.classList.add("stack-lg");
|
|
60
|
+
|
|
61
|
+
container.innerHTML = `
|
|
62
|
+
<style>
|
|
63
|
+
.story-render-result {
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
|
|
67
|
+
margin: var(--spacing-4) 0;
|
|
68
|
+
padding: var(--spacing-4);
|
|
22
69
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
style="margin: var(--spacing-6) 0;"
|
|
36
|
-
>
|
|
37
|
-
<div class="card surface-subtle">
|
|
38
|
-
<h3>❌ Tailwind Approach</h3>
|
|
39
|
-
<pre
|
|
40
|
-
style="font-size: var(--font-size-sm); overflow-x: auto;"
|
|
41
|
-
><code><div class="p-4 mt-2 rounded-lg
|
|
42
|
-
bg-white shadow-md flex
|
|
43
|
-
flex-col gap-2">
|
|
44
|
-
<div class="text-lg font-bold">
|
|
45
|
-
Title
|
|
46
|
-
</div>
|
|
47
|
-
<div class="text-sm text-gray-500">
|
|
48
|
-
Description
|
|
49
|
-
</div>
|
|
50
|
-
</div></code></pre>
|
|
51
|
-
<p class="text-muted" style="margin-top: var(--spacing-3);">
|
|
52
|
-
8 utility classes, no semantic meaning, hard to maintain.
|
|
53
|
-
</p>
|
|
54
|
-
</div>
|
|
70
|
+
> .card {
|
|
71
|
+
width: 400px
|
|
72
|
+
;}
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
75
|
+
${layoutOverviewStyles.strings[0]}
|
|
76
|
+
<header>
|
|
77
|
+
<h1>Layout in PDS</h1>
|
|
78
|
+
<h4 class="text-muted">
|
|
79
|
+
Power through composition of high-level concepts, not atomic control.
|
|
80
|
+
</h4>
|
|
81
|
+
</header>
|
|
55
82
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
</tr>
|
|
84
|
-
</thead>
|
|
85
|
-
<tbody>
|
|
86
|
-
<tr>
|
|
87
|
-
<td><strong>1. Semantic HTML</strong></td>
|
|
88
|
-
<td>Native elements with built-in styling</td>
|
|
89
|
-
<td>
|
|
90
|
-
<code><article></code>, <code><nav></code>,
|
|
91
|
-
<code><section></code>, <code><header></code>
|
|
92
|
-
</td>
|
|
93
|
-
<td>Always start here</td>
|
|
94
|
-
</tr>
|
|
95
|
-
<tr>
|
|
96
|
-
<td><strong>2. Primitives</strong></td>
|
|
97
|
-
<td>Single-class components with full styling</td>
|
|
98
|
-
<td><code>.card</code>, <code>.alert</code>, <code>.badge</code></td>
|
|
99
|
-
<td>Common UI patterns</td>
|
|
100
|
-
</tr>
|
|
101
|
-
<tr>
|
|
102
|
-
<td><strong>3. Layout Patterns</strong></td>
|
|
103
|
-
<td>High-level structural utilities</td>
|
|
104
|
-
<td>
|
|
105
|
-
<code>.container</code>, <code>.grid-auto-md</code>,
|
|
106
|
-
<code>.stack-md</code>
|
|
107
|
-
</td>
|
|
108
|
-
<td>Page structure</td>
|
|
109
|
-
</tr>
|
|
110
|
-
<tr>
|
|
111
|
-
<td><strong>4. Composable Utilities</strong></td>
|
|
112
|
-
<td>Minimal, purposeful utilities</td>
|
|
113
|
-
<td><code>.flex</code>, <code>.gap-md</code>, <code>.grow</code></td>
|
|
114
|
-
<td>Custom compositions</td>
|
|
115
|
-
</tr>
|
|
116
|
-
<tr>
|
|
117
|
-
<td><strong>5. Inline Styles</strong></td>
|
|
118
|
-
<td>One-off values using tokens</td>
|
|
119
|
-
<td><code>style="margin-top: var(--spacing-4)"</code></td>
|
|
120
|
-
<td>Rare exceptions</td>
|
|
121
|
-
</tr>
|
|
122
|
-
</tbody>
|
|
123
|
-
</table>
|
|
124
|
-
</article>
|
|
125
|
-
|
|
126
|
-
<article class="card">
|
|
127
|
-
<h2>Why PDS Has <em>Some</em> Utilities</h2>
|
|
128
|
-
|
|
129
|
-
<p>
|
|
130
|
-
PDS isn't anti-utility. It's anti-<em>atomic</em>. We include utilities
|
|
131
|
-
that:
|
|
132
|
-
</p>
|
|
133
|
-
|
|
134
|
-
<div class="stack-md" style="margin: var(--spacing-4) 0;">
|
|
135
|
-
<div class="flex gap-md items-start">
|
|
136
|
-
<span style="font-size: var(--font-size-xl);">✓</span>
|
|
137
|
-
<div>
|
|
138
|
-
<strong>Solve common layout problems</strong>
|
|
139
|
-
<p class="text-muted">
|
|
140
|
-
<code>.flex</code>, <code>.grid</code>, <code>.gap-*</code> —
|
|
141
|
-
fundamental building blocks
|
|
83
|
+
<article class="card surface-translucent-75">
|
|
84
|
+
<h2>Why PDS Avoids Low-Level Utilities</h2>
|
|
85
|
+
|
|
86
|
+
<p>
|
|
87
|
+
Frameworks like Tailwind offer atomic utilities for every CSS property:
|
|
88
|
+
<code>.p-4</code>, <code>.mt-2</code>, <code>.text-sm</code>,
|
|
89
|
+
<code>.relative</code>.
|
|
90
|
+
</p>
|
|
91
|
+
|
|
92
|
+
<p>
|
|
93
|
+
While this approach offers maximum flexibility, it comes at a steep cost:
|
|
94
|
+
bloated HTML, poor maintainability, and a lack of semantic meaning.
|
|
95
|
+
</p>
|
|
96
|
+
|
|
97
|
+
<header>
|
|
98
|
+
<h3>Let's compare Tailwind and PDS styling</h3>
|
|
99
|
+
<small>Look at the box below</small>
|
|
100
|
+
</header>
|
|
101
|
+
|
|
102
|
+
<div class="story-render-result">
|
|
103
|
+
<article class="card surface-overlay">
|
|
104
|
+
<header>
|
|
105
|
+
<h3>A Nice Box With a Title</h3>
|
|
106
|
+
<small class="text-muted">The subtitle of the item</small>
|
|
107
|
+
</header>
|
|
108
|
+
<p>
|
|
109
|
+
The body of the item with some descriptive text.
|
|
142
110
|
</p>
|
|
143
|
-
</
|
|
144
|
-
</div>
|
|
111
|
+
</article>
|
|
112
|
+
</div>
|
|
145
113
|
|
|
146
|
-
<div class="
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
114
|
+
<div class="grid grid-cols-2 gap-lg surface-translucent-50 story-compare-grid">
|
|
115
|
+
<div class="card surface-subtle">
|
|
116
|
+
<header>
|
|
117
|
+
<h3>❌ Tailwind Approach</h3>
|
|
118
|
+
<small class="text-muted">Atomic utilities for everything</small>
|
|
119
|
+
</header>
|
|
120
|
+
<div class="story-code-block code-tailwind"></div>
|
|
121
|
+
<p class="text-muted story-note">
|
|
122
|
+
13 utility classes, no semantic meaning, hard to maintain.
|
|
153
123
|
</p>
|
|
154
124
|
</div>
|
|
155
|
-
</div>
|
|
156
125
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
126
|
+
<div class="card surface-elevated">
|
|
127
|
+
<header>
|
|
128
|
+
<h3>✅ PDS Approach</h3>
|
|
129
|
+
<small class="text-muted">Semantic HTML + primitives</small>
|
|
130
|
+
</header>
|
|
131
|
+
<div class="story-code-block code-pds"></div>
|
|
132
|
+
<p class="text-muted story-note">
|
|
133
|
+
Semantic HTML + 4 primitive classes. Self-documenting.
|
|
164
134
|
</p>
|
|
165
135
|
</div>
|
|
166
136
|
</div>
|
|
167
|
-
</
|
|
137
|
+
</article>
|
|
168
138
|
|
|
169
|
-
<h3>What PDS Does NOT Include</h3>
|
|
170
139
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
140
|
+
<div class="alert alert-info">
|
|
141
|
+
<span class="alert-icon">
|
|
142
|
+
<pds-icon icon="info" size="md"></pds-icon>
|
|
143
|
+
</span>
|
|
174
144
|
<div>
|
|
175
|
-
<
|
|
176
|
-
<
|
|
177
|
-
<p
|
|
178
|
-
|
|
179
|
-
|
|
145
|
+
<h4 class="alert-title">The verdict</h4>
|
|
146
|
+
<p>Both approaches render identical output—but only one is maintainable.</p>
|
|
147
|
+
<p>
|
|
148
|
+
Don't even start thinking of dark and light modes, responsiveness, or
|
|
149
|
+
accessibility. With atomic utilities, every one of those concerns must be
|
|
150
|
+
manually addressed with more classes and more complexity.
|
|
180
151
|
</p>
|
|
181
152
|
</div>
|
|
182
153
|
</div>
|
|
183
154
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
<
|
|
192
|
-
<
|
|
193
|
-
|
|
155
|
+
<article class="card">
|
|
156
|
+
<h2>The PDS Layout Hierarchy</h2>
|
|
157
|
+
|
|
158
|
+
<table class="table-bordered">
|
|
159
|
+
<thead>
|
|
160
|
+
<tr>
|
|
161
|
+
<th>Level</th>
|
|
162
|
+
<th>What</th>
|
|
163
|
+
<th>Examples</th>
|
|
164
|
+
<th>Use When</th>
|
|
165
|
+
</tr>
|
|
166
|
+
</thead>
|
|
167
|
+
<tbody>
|
|
168
|
+
<tr>
|
|
169
|
+
<td><strong>1. Semantic HTML</strong></td>
|
|
170
|
+
<td>Native elements with built-in styling</td>
|
|
171
|
+
<td>
|
|
172
|
+
<code><article></code>, <code><nav></code>,
|
|
173
|
+
<code><section></code>, <code><header></code>
|
|
174
|
+
</td>
|
|
175
|
+
<td>Always start here</td>
|
|
176
|
+
</tr>
|
|
177
|
+
<tr>
|
|
178
|
+
<td><strong>2. Primitives</strong></td>
|
|
179
|
+
<td>Single-class components with full styling</td>
|
|
180
|
+
<td><code>.card</code>, <code>.alert</code>, <code>.badge</code></td>
|
|
181
|
+
<td>Common UI patterns</td>
|
|
182
|
+
</tr>
|
|
183
|
+
<tr>
|
|
184
|
+
<td><strong>3. Layout Patterns</strong></td>
|
|
185
|
+
<td>High-level structural utilities</td>
|
|
186
|
+
<td>
|
|
187
|
+
<code>.container</code>, <code>.grid-auto-md</code>,
|
|
188
|
+
<code>.stack-md</code>
|
|
189
|
+
</td>
|
|
190
|
+
<td>Page structure</td>
|
|
191
|
+
</tr>
|
|
192
|
+
<tr>
|
|
193
|
+
<td><strong>4. Composable Utilities</strong></td>
|
|
194
|
+
<td>Minimal, purposeful utilities</td>
|
|
195
|
+
<td><code>.flex</code>, <code>.gap-md</code>, <code>.grow</code></td>
|
|
196
|
+
<td>Custom compositions</td>
|
|
197
|
+
</tr>
|
|
198
|
+
<tr>
|
|
199
|
+
<td><strong>5. Inline Styles</strong></td>
|
|
200
|
+
<td>One-off values using tokens</td>
|
|
201
|
+
<td><code>style="margin-top: var(--spacing-4)"</code></td>
|
|
202
|
+
<td>Rare exceptions</td>
|
|
203
|
+
</tr>
|
|
204
|
+
</tbody>
|
|
205
|
+
</table>
|
|
206
|
+
</article>
|
|
207
|
+
|
|
208
|
+
<article class="card">
|
|
209
|
+
<h2>Why PDS Has <em>Some</em> Utilities</h2>
|
|
210
|
+
|
|
211
|
+
<p>
|
|
212
|
+
PDS isn't anti-utility. It's anti-<em>atomic</em>. We include utilities
|
|
213
|
+
that:
|
|
214
|
+
</p>
|
|
215
|
+
|
|
216
|
+
<div class="stack-md story-list">
|
|
217
|
+
<div class="flex gap-md items-start">
|
|
218
|
+
<span class="story-checkmark">✓</span>
|
|
219
|
+
<div>
|
|
220
|
+
<strong>Solve common layout problems</strong>
|
|
221
|
+
<p class="text-muted">
|
|
222
|
+
<code>.flex</code>, <code>.grid</code>, <code>.gap-*</code> —
|
|
223
|
+
fundamental building blocks
|
|
224
|
+
</p>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
<div class="flex gap-md items-start">
|
|
229
|
+
<span class="story-checkmark">✓</span>
|
|
230
|
+
<div>
|
|
231
|
+
<strong>Encode complete patterns</strong>
|
|
232
|
+
<p class="text-muted">
|
|
233
|
+
<code>.stack-md</code> = flex + column + gap (one class instead of
|
|
234
|
+
three)
|
|
235
|
+
</p>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<div class="flex gap-md items-start">
|
|
240
|
+
<span class="story-checkmark">✓</span>
|
|
241
|
+
<div>
|
|
242
|
+
<strong>Can't be achieved with primitives</strong>
|
|
243
|
+
<p class="text-muted">
|
|
244
|
+
<code>.truncate</code>, <code>.grow</code> — no semantic element
|
|
245
|
+
provides this
|
|
246
|
+
</p>
|
|
247
|
+
</div>
|
|
194
248
|
</div>
|
|
195
249
|
</div>
|
|
196
250
|
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
<
|
|
202
|
-
<
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
251
|
+
<h3>What PDS Does NOT Include</h3>
|
|
252
|
+
|
|
253
|
+
<div class="stack-md story-list">
|
|
254
|
+
<div class="flex gap-md items-start">
|
|
255
|
+
<span class="story-checkmark">✗</span>
|
|
256
|
+
<div>
|
|
257
|
+
<strong>Spacing utilities</strong> (<code>.p-4</code>,
|
|
258
|
+
<code>.mt-2</code>, <code>.mx-auto</code>)
|
|
259
|
+
<p class="text-muted">
|
|
260
|
+
Primitives handle padding. Use <code>.section</code> or inline
|
|
261
|
+
styles with tokens.
|
|
262
|
+
</p>
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
|
|
266
|
+
<div class="flex gap-md items-start">
|
|
267
|
+
<span class="story-checkmark">✗</span>
|
|
268
|
+
<div>
|
|
269
|
+
<strong>Typography scale</strong> (<code>.text-sm</code>,
|
|
270
|
+
<code>.text-2xl</code>)
|
|
271
|
+
<p class="text-muted">
|
|
272
|
+
Use semantic elements:
|
|
273
|
+
<code><h1></code>-<code><h6></code>,
|
|
274
|
+
<code><small></code>, <code><strong></code>
|
|
275
|
+
</p>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
|
|
279
|
+
<div class="flex gap-md items-start">
|
|
280
|
+
<span class="story-checkmark">✗</span>
|
|
281
|
+
<div>
|
|
282
|
+
<strong>Position/display</strong> (<code>.relative</code>,
|
|
283
|
+
<code>.block</code>, <code>.hidden</code>)
|
|
284
|
+
<p class="text-muted">
|
|
285
|
+
Component-internal concerns. Components handle their own
|
|
286
|
+
positioning.
|
|
287
|
+
</p>
|
|
288
|
+
</div>
|
|
206
289
|
</div>
|
|
207
290
|
</div>
|
|
208
|
-
</
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
</
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
</
|
|
283
|
-
</
|
|
284
|
-
</
|
|
285
|
-
|
|
286
|
-
|
|
291
|
+
</article>
|
|
292
|
+
|
|
293
|
+
<article class="card">
|
|
294
|
+
<h2>Quick Reference: Layout Utilities</h2>
|
|
295
|
+
|
|
296
|
+
<table class="table-bordered">
|
|
297
|
+
<thead>
|
|
298
|
+
<tr>
|
|
299
|
+
<th>Category</th>
|
|
300
|
+
<th>Classes</th>
|
|
301
|
+
<th>Purpose</th>
|
|
302
|
+
</tr>
|
|
303
|
+
</thead>
|
|
304
|
+
<tbody>
|
|
305
|
+
<tr>
|
|
306
|
+
<td><strong>Container</strong></td>
|
|
307
|
+
<td><code>.container</code></td>
|
|
308
|
+
<td>Centered max-width wrapper with padding</td>
|
|
309
|
+
</tr>
|
|
310
|
+
<tr>
|
|
311
|
+
<td><strong>Grid</strong></td>
|
|
312
|
+
<td>
|
|
313
|
+
<code>.grid</code>, <code>.grid-cols-*</code>,
|
|
314
|
+
<code>.grid-auto-*</code>
|
|
315
|
+
</td>
|
|
316
|
+
<td>CSS Grid layouts</td>
|
|
317
|
+
</tr>
|
|
318
|
+
<tr>
|
|
319
|
+
<td><strong>Flex</strong></td>
|
|
320
|
+
<td>
|
|
321
|
+
<code>.flex</code>, <code>.flex-col</code>, <code>.flex-wrap</code>,
|
|
322
|
+
<code>.grow</code>
|
|
323
|
+
</td>
|
|
324
|
+
<td>Flexbox layouts</td>
|
|
325
|
+
</tr>
|
|
326
|
+
<tr>
|
|
327
|
+
<td><strong>Stack</strong></td>
|
|
328
|
+
<td>
|
|
329
|
+
<code>.stack-sm</code>, <code>.stack-md</code>,
|
|
330
|
+
<code>.stack-lg</code>, <code>.stack-xl</code>
|
|
331
|
+
</td>
|
|
332
|
+
<td>Vertical rhythm (flex + column + gap)</td>
|
|
333
|
+
</tr>
|
|
334
|
+
<tr>
|
|
335
|
+
<td><strong>Gap</strong></td>
|
|
336
|
+
<td>
|
|
337
|
+
<code>.gap-xs</code>, <code>.gap-sm</code>, <code>.gap-md</code>,
|
|
338
|
+
<code>.gap-lg</code>, <code>.gap-xl</code>
|
|
339
|
+
</td>
|
|
340
|
+
<td>Spacing between flex/grid children</td>
|
|
341
|
+
</tr>
|
|
342
|
+
<tr>
|
|
343
|
+
<td><strong>Alignment</strong></td>
|
|
344
|
+
<td><code>.items-*</code>, <code>.justify-*</code></td>
|
|
345
|
+
<td>Cross-axis and main-axis alignment</td>
|
|
346
|
+
</tr>
|
|
347
|
+
<tr>
|
|
348
|
+
<td><strong>Width</strong></td>
|
|
349
|
+
<td>
|
|
350
|
+
<code>.max-w-sm</code>, <code>.max-w-md</code>,
|
|
351
|
+
<code>.max-w-lg</code>, <code>.max-w-xl</code>
|
|
352
|
+
</td>
|
|
353
|
+
<td>Content width constraints</td>
|
|
354
|
+
</tr>
|
|
355
|
+
<tr>
|
|
356
|
+
<td><strong>Section</strong></td>
|
|
357
|
+
<td><code>.section</code>, <code>.section-lg</code></td>
|
|
358
|
+
<td>Vertical padding for content blocks</td>
|
|
359
|
+
</tr>
|
|
360
|
+
<tr>
|
|
361
|
+
<td><strong>Responsive</strong></td>
|
|
362
|
+
<td><code>.mobile-stack</code></td>
|
|
363
|
+
<td>Stack on mobile, row on desktop</td>
|
|
364
|
+
</tr>
|
|
365
|
+
</tbody>
|
|
366
|
+
</table>
|
|
367
|
+
</article>
|
|
368
|
+
`;
|
|
369
|
+
|
|
370
|
+
const theme = getCurrentTheme();
|
|
371
|
+
|
|
372
|
+
highlight(tailwindCode, "html", theme).then((h) => {
|
|
373
|
+
container.querySelector(".code-tailwind").innerHTML = h;
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
highlight(pdsCode, "html", theme).then((h) => {
|
|
377
|
+
container.querySelector(".code-pds").innerHTML = h;
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
return container;
|
|
381
|
+
};
|
|
287
382
|
|
|
288
383
|
LayoutIntroduction.storyName = "Introduction";
|