@pure-ds/storybook 0.3.18 → 0.4.0

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.
Files changed (39) hide show
  1. package/.storybook/addons/pds-configurator/SearchTool.js +44 -44
  2. package/dist/pds-reference.json +65 -13
  3. package/package.json +50 -50
  4. package/stories/components/PdsCalendar.stories.js +266 -263
  5. package/stories/components/PdsDrawer.stories.js +2 -2
  6. package/stories/components/PdsIcon.stories.js +2 -2
  7. package/stories/components/PdsJsonform.stories.js +2 -2
  8. package/stories/components/PdsRichtext.stories.js +367 -367
  9. package/stories/components/PdsScrollrow.stories.js +140 -140
  10. package/stories/components/PdsSplitpanel.stories.js +502 -502
  11. package/stories/components/PdsTabstrip.stories.js +2 -2
  12. package/stories/components/PdsToaster.stories.js +186 -186
  13. package/stories/components/PdsUpload.stories.js +66 -66
  14. package/stories/enhancements/Dropdowns.stories.js +185 -185
  15. package/stories/enhancements/InteractiveStates.stories.js +625 -625
  16. package/stories/enhancements/MeshGradients.stories.js +321 -320
  17. package/stories/enhancements/OpenGroups.stories.js +227 -227
  18. package/stories/enhancements/RangeSliders.stories.js +232 -232
  19. package/stories/enhancements/RequiredFields.stories.js +189 -189
  20. package/stories/enhancements/Toggles.stories.js +167 -167
  21. package/stories/foundations/Colors.stories.js +2 -1
  22. package/stories/foundations/Icons.stories.js +4 -0
  23. package/stories/foundations/SmartSurfaces.stories.js +485 -367
  24. package/stories/foundations/Spacing.stories.js +5 -1
  25. package/stories/foundations/Typography.stories.js +4 -0
  26. package/stories/foundations/ZIndex.stories.js +329 -325
  27. package/stories/layout/LayoutOverview.stories.js +247 -0
  28. package/stories/layout/LayoutSystem.stories.js +852 -0
  29. package/stories/patterns/BorderEffects.stories.js +74 -72
  30. package/stories/primitives/Accordion.stories.js +5 -3
  31. package/stories/primitives/Alerts.stories.js +261 -46
  32. package/stories/primitives/Badges.stories.js +4 -0
  33. package/stories/primitives/Buttons.stories.js +2 -2
  34. package/stories/primitives/Cards.stories.js +98 -170
  35. package/stories/primitives/Media.stories.js +442 -203
  36. package/stories/primitives/Tables.stories.js +358 -232
  37. package/stories/utilities/Backdrop.stories.js +197 -0
  38. package/stories/patterns/Layout.stories.js +0 -99
  39. package/stories/utilities/GridSystem.stories.js +0 -208
@@ -0,0 +1,247 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Layout/Overview',
5
+ parameters: {
6
+ docs: {
7
+ description: {
8
+ component: 'Understanding PDS layout philosophy and why semantic patterns beat atomic utilities.'
9
+ }
10
+ }
11
+ }
12
+ };
13
+
14
+ export const LayoutPhilosophy = () => html`
15
+
16
+ <h1>Layout in PDS</h1>
17
+ <h3 class="text-muted" style="font-size: var(--font-size-lg);">
18
+ Power through composition of high-level concepts, not atomic control.
19
+ </h3>
20
+
21
+
22
+ <article class="card surface-translucent-50">
23
+ <h2>Why PDS Avoids Low-Level Utilities</h2>
24
+
25
+ <p>
26
+ Frameworks like Tailwind offer atomic utilities for every CSS property:
27
+ <code>.p-4</code>, <code>.mt-2</code>, <code>.text-sm</code>, <code>.relative</code>.
28
+ This approach has a hidden cost: <strong>DIV soup</strong>.
29
+ </p>
30
+
31
+ <div class="grid grid-cols-2 gap-lg surface-translucent-50" style="margin: var(--spacing-6) 0;">
32
+ <div class="card surface-subtle">
33
+ <h3>❌ Tailwind Approach</h3>
34
+ <pre style="font-size: var(--font-size-sm); overflow-x: auto;"><code>&lt;div class="p-4 mt-2 rounded-lg
35
+ bg-white shadow-md flex
36
+ flex-col gap-2"&gt;
37
+ &lt;div class="text-lg font-bold"&gt;
38
+ Title
39
+ &lt;/div&gt;
40
+ &lt;div class="text-sm text-gray-500"&gt;
41
+ Description
42
+ &lt;/div&gt;
43
+ &lt;/div&gt;</code></pre>
44
+ <p class="text-muted" style="margin-top: var(--spacing-3);">
45
+ 8 utility classes, no semantic meaning, hard to maintain.
46
+ </p>
47
+ </div>
48
+
49
+ <div class="card surface-elevated">
50
+ <h3>✅ PDS Approach</h3>
51
+ <pre style="font-size: var(--font-size-sm); overflow-x: auto;"><code>&lt;article class="card"&gt;
52
+ &lt;h3&gt;Title&lt;/h3&gt;
53
+ &lt;p class="text-muted"&gt;
54
+ Description
55
+ &lt;/p&gt;
56
+ &lt;/article&gt;</code></pre>
57
+ <p class="text-muted" style="margin-top: var(--spacing-3);">
58
+ Semantic HTML + 1 primitive class. Self-documenting.
59
+ </p>
60
+ </div>
61
+ </div>
62
+ </article>
63
+
64
+ <article class="card">
65
+ <h2>The PDS Layout Hierarchy</h2>
66
+
67
+ <table class="table-bordered">
68
+ <thead>
69
+ <tr>
70
+ <th>Level</th>
71
+ <th>What</th>
72
+ <th>Examples</th>
73
+ <th>Use When</th>
74
+ </tr>
75
+ </thead>
76
+ <tbody>
77
+ <tr>
78
+ <td><strong>1. Semantic HTML</strong></td>
79
+ <td>Native elements with built-in styling</td>
80
+ <td><code>&lt;article&gt;</code>, <code>&lt;nav&gt;</code>, <code>&lt;section&gt;</code>, <code>&lt;header&gt;</code></td>
81
+ <td>Always start here</td>
82
+ </tr>
83
+ <tr>
84
+ <td><strong>2. Primitives</strong></td>
85
+ <td>Single-class components with full styling</td>
86
+ <td><code>.card</code>, <code>.alert</code>, <code>.badge</code></td>
87
+ <td>Common UI patterns</td>
88
+ </tr>
89
+ <tr>
90
+ <td><strong>3. Layout Patterns</strong></td>
91
+ <td>High-level structural utilities</td>
92
+ <td><code>.container</code>, <code>.grid-auto-md</code>, <code>.stack-md</code></td>
93
+ <td>Page structure</td>
94
+ </tr>
95
+ <tr>
96
+ <td><strong>4. Composable Utilities</strong></td>
97
+ <td>Minimal, purposeful utilities</td>
98
+ <td><code>.flex</code>, <code>.gap-md</code>, <code>.grow</code></td>
99
+ <td>Custom compositions</td>
100
+ </tr>
101
+ <tr>
102
+ <td><strong>5. Inline Styles</strong></td>
103
+ <td>One-off values using tokens</td>
104
+ <td><code>style="margin-top: var(--spacing-4)"</code></td>
105
+ <td>Rare exceptions</td>
106
+ </tr>
107
+ </tbody>
108
+ </table>
109
+ </article>
110
+
111
+ <article class="card">
112
+ <h2>Why PDS Has <em>Some</em> Utilities</h2>
113
+
114
+ <p>
115
+ PDS isn't anti-utility. It's anti-<em>atomic</em>. We include utilities that:
116
+ </p>
117
+
118
+ <div class="stack-md" style="margin: var(--spacing-4) 0;">
119
+ <div class="flex gap-md items-start">
120
+ <span style="font-size: var(--font-size-xl);">✓</span>
121
+ <div>
122
+ <strong>Solve common layout problems</strong>
123
+ <p class="text-muted">
124
+ <code>.flex</code>, <code>.grid</code>, <code>.gap-*</code> — fundamental building blocks
125
+ </p>
126
+ </div>
127
+ </div>
128
+
129
+ <div class="flex gap-md items-start">
130
+ <span style="font-size: var(--font-size-xl);">✓</span>
131
+ <div>
132
+ <strong>Encode complete patterns</strong>
133
+ <p class="text-muted">
134
+ <code>.stack-md</code> = flex + column + gap (one class instead of three)
135
+ </p>
136
+ </div>
137
+ </div>
138
+
139
+ <div class="flex gap-md items-start">
140
+ <span style="font-size: var(--font-size-xl);">✓</span>
141
+ <div>
142
+ <strong>Can't be achieved with primitives</strong>
143
+ <p class="text-muted">
144
+ <code>.truncate</code>, <code>.grow</code> — no semantic element provides this
145
+ </p>
146
+ </div>
147
+ </div>
148
+ </div>
149
+
150
+ <h3>What PDS Does NOT Include</h3>
151
+
152
+ <div class="stack-md" style="margin: var(--spacing-4) 0;">
153
+ <div class="flex gap-md items-start">
154
+ <span style="font-size: var(--font-size-xl);">✗</span>
155
+ <div>
156
+ <strong>Spacing utilities</strong> (<code>.p-4</code>, <code>.mt-2</code>, <code>.mx-auto</code>)
157
+ <p class="text-muted">
158
+ Primitives handle padding. Use <code>.section</code> or inline styles with tokens.
159
+ </p>
160
+ </div>
161
+ </div>
162
+
163
+ <div class="flex gap-md items-start">
164
+ <span style="font-size: var(--font-size-xl);">✗</span>
165
+ <div>
166
+ <strong>Typography scale</strong> (<code>.text-sm</code>, <code>.text-2xl</code>)
167
+ <p class="text-muted">
168
+ Use semantic elements: <code>&lt;h1&gt;</code>-<code>&lt;h6&gt;</code>, <code>&lt;small&gt;</code>, <code>&lt;strong&gt;</code>
169
+ </p>
170
+ </div>
171
+ </div>
172
+
173
+ <div class="flex gap-md items-start">
174
+ <span style="font-size: var(--font-size-xl);">✗</span>
175
+ <div>
176
+ <strong>Position/display</strong> (<code>.relative</code>, <code>.block</code>, <code>.hidden</code>)
177
+ <p class="text-muted">
178
+ Component-internal concerns. Components handle their own positioning.
179
+ </p>
180
+ </div>
181
+ </div>
182
+ </div>
183
+ </article>
184
+
185
+ <article class="card">
186
+ <h2>Quick Reference: Layout Utilities</h2>
187
+
188
+ <table class="table-bordered">
189
+ <thead>
190
+ <tr>
191
+ <th>Category</th>
192
+ <th>Classes</th>
193
+ <th>Purpose</th>
194
+ </tr>
195
+ </thead>
196
+ <tbody>
197
+ <tr>
198
+ <td><strong>Container</strong></td>
199
+ <td><code>.container</code></td>
200
+ <td>Centered max-width wrapper with padding</td>
201
+ </tr>
202
+ <tr>
203
+ <td><strong>Grid</strong></td>
204
+ <td><code>.grid</code>, <code>.grid-cols-*</code>, <code>.grid-auto-*</code></td>
205
+ <td>CSS Grid layouts</td>
206
+ </tr>
207
+ <tr>
208
+ <td><strong>Flex</strong></td>
209
+ <td><code>.flex</code>, <code>.flex-col</code>, <code>.flex-wrap</code>, <code>.grow</code></td>
210
+ <td>Flexbox layouts</td>
211
+ </tr>
212
+ <tr>
213
+ <td><strong>Stack</strong></td>
214
+ <td><code>.stack-sm</code>, <code>.stack-md</code>, <code>.stack-lg</code>, <code>.stack-xl</code></td>
215
+ <td>Vertical rhythm (flex + column + gap)</td>
216
+ </tr>
217
+ <tr>
218
+ <td><strong>Gap</strong></td>
219
+ <td><code>.gap-xs</code>, <code>.gap-sm</code>, <code>.gap-md</code>, <code>.gap-lg</code>, <code>.gap-xl</code></td>
220
+ <td>Spacing between flex/grid children</td>
221
+ </tr>
222
+ <tr>
223
+ <td><strong>Alignment</strong></td>
224
+ <td><code>.items-*</code>, <code>.justify-*</code></td>
225
+ <td>Cross-axis and main-axis alignment</td>
226
+ </tr>
227
+ <tr>
228
+ <td><strong>Width</strong></td>
229
+ <td><code>.max-w-sm</code>, <code>.max-w-md</code>, <code>.max-w-lg</code>, <code>.max-w-xl</code></td>
230
+ <td>Content width constraints</td>
231
+ </tr>
232
+ <tr>
233
+ <td><strong>Section</strong></td>
234
+ <td><code>.section</code>, <code>.section-lg</code></td>
235
+ <td>Vertical padding for content blocks</td>
236
+ </tr>
237
+ <tr>
238
+ <td><strong>Responsive</strong></td>
239
+ <td><code>.mobile-stack</code></td>
240
+ <td>Stack on mobile, row on desktop</td>
241
+ </tr>
242
+ </tbody>
243
+ </table>
244
+ </article>
245
+ `;
246
+
247
+ LayoutPhilosophy.storyName = 'Philosophy & Overview';