@pure-ds/storybook 0.1.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 (129) hide show
  1. package/.storybook/addons/description/preview.js +15 -0
  2. package/.storybook/addons/description/register.js +60 -0
  3. package/.storybook/addons/html-preview/Panel.jsx +327 -0
  4. package/.storybook/addons/html-preview/constants.js +6 -0
  5. package/.storybook/addons/html-preview/preview.js +178 -0
  6. package/.storybook/addons/html-preview/register.js +16 -0
  7. package/.storybook/addons/pds-configurator/SearchTool.js +44 -0
  8. package/.storybook/addons/pds-configurator/Tool.js +30 -0
  9. package/.storybook/addons/pds-configurator/constants.js +9 -0
  10. package/.storybook/addons/pds-configurator/preview.js +159 -0
  11. package/.storybook/addons/pds-configurator/register.js +24 -0
  12. package/.storybook/docs.css +35 -0
  13. package/.storybook/htmlPreview.css +103 -0
  14. package/.storybook/htmlPreview.js +271 -0
  15. package/.storybook/main.js +160 -0
  16. package/.storybook/preview-body.html +48 -0
  17. package/.storybook/preview-head.html +11 -0
  18. package/.storybook/preview.js +1563 -0
  19. package/README.md +266 -0
  20. package/bin/index.js +40 -0
  21. package/dist/pds-reference.json +2101 -0
  22. package/package.json +45 -0
  23. package/pds.config.js +6 -0
  24. package/public/assets/css/app.css +1216 -0
  25. package/public/assets/data/auto-design-advanced.json +704 -0
  26. package/public/assets/data/auto-design-simple.json +123 -0
  27. package/public/assets/img/icon-512x512.png +0 -0
  28. package/public/assets/img/logo-trans.png +0 -0
  29. package/public/assets/img/logo.png +0 -0
  30. package/public/assets/js/app.js +15088 -0
  31. package/public/assets/js/app.js.map +7 -0
  32. package/public/assets/js/lit.js +1176 -0
  33. package/public/assets/js/lit.js.map +7 -0
  34. package/public/assets/js/pds.js +9801 -0
  35. package/public/assets/js/pds.js.map +7 -0
  36. package/public/assets/pds/components/pds-calendar.js +837 -0
  37. package/public/assets/pds/components/pds-drawer.js +857 -0
  38. package/public/assets/pds/components/pds-icon.js +338 -0
  39. package/public/assets/pds/components/pds-jsonform.js +1775 -0
  40. package/public/assets/pds/components/pds-richtext.js +1035 -0
  41. package/public/assets/pds/components/pds-scrollrow.js +331 -0
  42. package/public/assets/pds/components/pds-splitpanel.js +401 -0
  43. package/public/assets/pds/components/pds-tabstrip.js +251 -0
  44. package/public/assets/pds/components/pds-toaster.js +446 -0
  45. package/public/assets/pds/components/pds-upload.js +657 -0
  46. package/public/assets/pds/custom-elements.json +2003 -0
  47. package/public/assets/pds/icons/pds-icons.svg +498 -0
  48. package/public/assets/pds/pds-css-complete.json +1861 -0
  49. package/public/assets/pds/pds-runtime-config.json +11 -0
  50. package/public/assets/pds/pds.css-data.json +2152 -0
  51. package/public/assets/pds/styles/pds-components.css +1944 -0
  52. package/public/assets/pds/styles/pds-components.css.js +3895 -0
  53. package/public/assets/pds/styles/pds-primitives.css +352 -0
  54. package/public/assets/pds/styles/pds-primitives.css.js +711 -0
  55. package/public/assets/pds/styles/pds-styles.css +3761 -0
  56. package/public/assets/pds/styles/pds-styles.css.js +7529 -0
  57. package/public/assets/pds/styles/pds-tokens.css +699 -0
  58. package/public/assets/pds/styles/pds-tokens.css.js +1405 -0
  59. package/public/assets/pds/styles/pds-utilities.css +763 -0
  60. package/public/assets/pds/styles/pds-utilities.css.js +1533 -0
  61. package/public/assets/pds/vscode-custom-data.json +824 -0
  62. package/scripts/build-pds-reference.mjs +807 -0
  63. package/scripts/generate-stories.js +542 -0
  64. package/scripts/package-build.js +86 -0
  65. package/src/js/app.js +17 -0
  66. package/src/js/common/ask.js +208 -0
  67. package/src/js/common/common.js +20 -0
  68. package/src/js/common/font-loader.js +200 -0
  69. package/src/js/common/msg.js +90 -0
  70. package/src/js/lit.js +40 -0
  71. package/src/js/pds-core/pds-config.js +1162 -0
  72. package/src/js/pds-core/pds-enhancer-metadata.js +75 -0
  73. package/src/js/pds-core/pds-enhancers.js +357 -0
  74. package/src/js/pds-core/pds-enums.js +86 -0
  75. package/src/js/pds-core/pds-generator.js +5317 -0
  76. package/src/js/pds-core/pds-ontology.js +256 -0
  77. package/src/js/pds-core/pds-paths.js +109 -0
  78. package/src/js/pds-core/pds-query.js +571 -0
  79. package/src/js/pds-core/pds-registry.js +129 -0
  80. package/src/js/pds-core/pds.d.ts +129 -0
  81. package/src/js/pds.d.ts +408 -0
  82. package/src/js/pds.js +1579 -0
  83. package/src/pds-core/pds-api.js +105 -0
  84. package/stories/GettingStarted.md +96 -0
  85. package/stories/GettingStarted.stories.js +144 -0
  86. package/stories/WhatIsPDS.md +194 -0
  87. package/stories/WhatIsPDS.stories.js +144 -0
  88. package/stories/components/PdsCalendar.stories.js +263 -0
  89. package/stories/components/PdsDrawer.stories.js +623 -0
  90. package/stories/components/PdsIcon.stories.js +78 -0
  91. package/stories/components/PdsJsonform.stories.js +1444 -0
  92. package/stories/components/PdsRichtext.stories.js +367 -0
  93. package/stories/components/PdsScrollrow.stories.js +140 -0
  94. package/stories/components/PdsSplitpanel.stories.js +502 -0
  95. package/stories/components/PdsTabstrip.stories.js +442 -0
  96. package/stories/components/PdsToaster.stories.js +186 -0
  97. package/stories/components/PdsUpload.stories.js +66 -0
  98. package/stories/enhancements/Dropdowns.stories.js +185 -0
  99. package/stories/enhancements/InteractiveStates.stories.js +625 -0
  100. package/stories/enhancements/MeshGradients.stories.js +320 -0
  101. package/stories/enhancements/OpenGroups.stories.js +227 -0
  102. package/stories/enhancements/RangeSliders.stories.js +232 -0
  103. package/stories/enhancements/RequiredFields.stories.js +189 -0
  104. package/stories/enhancements/Toggles.stories.js +167 -0
  105. package/stories/foundations/Colors.stories.js +283 -0
  106. package/stories/foundations/Icons.stories.js +305 -0
  107. package/stories/foundations/SmartSurfaces.stories.js +367 -0
  108. package/stories/foundations/Spacing.stories.js +175 -0
  109. package/stories/foundations/Typography.stories.js +960 -0
  110. package/stories/foundations/ZIndex.stories.js +325 -0
  111. package/stories/patterns/BorderEffects.stories.js +72 -0
  112. package/stories/patterns/Layout.stories.js +99 -0
  113. package/stories/patterns/Utilities.stories.js +107 -0
  114. package/stories/primitives/Accordion.stories.js +359 -0
  115. package/stories/primitives/Alerts.stories.js +64 -0
  116. package/stories/primitives/Badges.stories.js +183 -0
  117. package/stories/primitives/Buttons.stories.js +229 -0
  118. package/stories/primitives/Cards.stories.js +353 -0
  119. package/stories/primitives/FormGroups.stories.js +569 -0
  120. package/stories/primitives/Forms.stories.js +131 -0
  121. package/stories/primitives/Media.stories.js +203 -0
  122. package/stories/primitives/Tables.stories.js +232 -0
  123. package/stories/reference/ReferenceCatalog.stories.js +28 -0
  124. package/stories/reference/reference-catalog.js +413 -0
  125. package/stories/reference/reference-docs.js +302 -0
  126. package/stories/reference/reference-helpers.js +310 -0
  127. package/stories/utilities/GridSystem.stories.js +208 -0
  128. package/stories/utils/PdsAsk.stories.js +420 -0
  129. package/stories/utils/toast-utils.js +148 -0
@@ -0,0 +1,325 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Foundations/Z-Index',
5
+ parameters: {
6
+ docs: {
7
+ description: {
8
+ component: 'Z-Index tokens define the stacking order of UI elements along the z-axis. These tokens ensure consistent layering across the application, preventing z-index conflicts and establishing clear visual hierarchy for overlays, modals, dropdowns, and other elevated UI components.'
9
+ }
10
+ }
11
+ }
12
+ };
13
+
14
+ const zIndexStoryStyles = html`
15
+ <style>
16
+ .z-index-section {
17
+ padding: var(--spacing-8);
18
+ max-width: 75rem;
19
+ }
20
+ .z-index-value {
21
+ font-weight: 600;
22
+ }
23
+ .z-index-number {
24
+ font-family: var(--font-mono, monospace);
25
+ margin-left: var(--spacing-3);
26
+ }
27
+ .z-index-callout {
28
+ margin-top: var(--spacing-8);
29
+ border-left-width: 4px;
30
+ }
31
+ .z-index-callout--info {
32
+ border-left-color: var(--color-info);
33
+ }
34
+ .z-index-callout--warning {
35
+ border-left-color: var(--color-warning);
36
+ }
37
+ .z-index-demo-wrapper {
38
+ position: relative;
39
+ height: 37.5rem;
40
+ overflow: hidden;
41
+ }
42
+ .z-index-demo-base {
43
+ padding: var(--spacing-6);
44
+ }
45
+ .z-index-demo-dropdown {
46
+ position: absolute;
47
+ top: 100px;
48
+ left: 50px;
49
+ z-index: var(--z-dropdown);
50
+ min-width: 12.5rem;
51
+ }
52
+ .z-index-demo-sticky {
53
+ position: absolute;
54
+ top: 180px;
55
+ left: 100px;
56
+ z-index: var(--z-sticky);
57
+ min-width: 12.5rem;
58
+ }
59
+ .z-index-demo-fixed {
60
+ position: absolute;
61
+ top: 260px;
62
+ left: 150px;
63
+ z-index: var(--z-fixed);
64
+ min-width: 12.5rem;
65
+ }
66
+ .z-index-demo-modal-overlay {
67
+ position: absolute;
68
+ border-radius: var(--radius-md);
69
+ inset: 0;
70
+ z-index: var(--z-modal);
71
+ background: rgba(0, 0, 0, 0.1);
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: center;
75
+ }
76
+ .z-index-demo-modal-card {
77
+ max-width: 25rem;
78
+ }
79
+ .z-index-demo-tooltip {
80
+ position: absolute;
81
+ top: 50px;
82
+ right: 50px;
83
+ z-index: var(--z-tooltip);
84
+ padding: var(--spacing-2) var(--spacing-3);
85
+ }
86
+ .z-index-demo-toast {
87
+ position: absolute;
88
+ top: 20px;
89
+ right: 20px;
90
+ z-index: var(--z-notification);
91
+ background: var(--color-success);
92
+ color: var(--color-text-inverse, #ffffff);
93
+ min-width: 15.625rem;
94
+ }
95
+ .z-index-note {
96
+ margin-top: var(--spacing-6);
97
+ }
98
+ </style>
99
+ `;
100
+
101
+ export const ZIndexScale = {
102
+ name: 'Z-Index Scale',
103
+ render: () => html`
104
+ ${zIndexStoryStyles}
105
+ <div class="z-index-section">
106
+ <h2>Z-Index Token Scale</h2>
107
+ <p class="text-muted">
108
+ Tokens are organized from lowest to highest z-index values, ensuring proper stacking of UI layers.
109
+ </p>
110
+
111
+ <div class="grid grid-cols-1 gap-md">
112
+ <div class="card surface-subtle">
113
+ <code class="z-index-value">--z-dropdown</code>
114
+ <span class="z-index-number">1000</span>
115
+ <p class="text-muted">Dropdown menus and select options</p>
116
+ </div>
117
+
118
+ <div class="card surface-subtle">
119
+ <code class="z-index-value">--z-sticky</code>
120
+ <span class="z-index-number">1020</span>
121
+ <p class="text-muted">Sticky headers and navigation elements</p>
122
+ </div>
123
+
124
+ <div class="card surface-subtle">
125
+ <code class="z-index-value">--z-fixed</code>
126
+ <span class="z-index-number">1030</span>
127
+ <p class="text-muted">Fixed position elements</p>
128
+ </div>
129
+
130
+ <div class="card surface-subtle">
131
+ <code class="z-index-value">--z-modal</code>
132
+ <span class="z-index-number">1040</span>
133
+ <p class="text-muted">Modal dialogs and overlays</p>
134
+ </div>
135
+
136
+ <div class="card surface-subtle">
137
+ <code class="z-index-value">--z-drawer</code>
138
+ <span class="z-index-number">1050</span>
139
+ <p class="text-muted">Drawer panels (side sheets)</p>
140
+ </div>
141
+
142
+ <div class="card surface-subtle">
143
+ <code class="z-index-value">--z-popover</code>
144
+ <span class="z-index-number">1060</span>
145
+ <p class="text-muted">Popovers and context menus</p>
146
+ </div>
147
+
148
+ <div class="card surface-subtle">
149
+ <code class="z-index-value">--z-tooltip</code>
150
+ <span class="z-index-number">1070</span>
151
+ <p class="text-muted">Tooltips and helper text</p>
152
+ </div>
153
+
154
+ <div class="card surface-subtle">
155
+ <code class="z-index-value">--z-notification</code>
156
+ <span class="z-index-number">1080</span>
157
+ <p class="text-muted">Toast notifications and alerts</p>
158
+ </div>
159
+ </div>
160
+
161
+ <div class="card card-outlined z-index-callout z-index-callout--info">
162
+ <h3><pds-icon icon="info"></pds-icon> Best Practices</h3>
163
+ <ul>
164
+ <li>Always use these tokens instead of hard-coded z-index values</li>
165
+ <li>Tokens are spaced by 10 to allow for intermediate values if needed</li>
166
+ <li>Higher values appear above lower values in the stacking context</li>
167
+ <li>Notifications have the highest z-index to ensure visibility</li>
168
+ <li>Never exceed these values unless absolutely necessary</li>
169
+ </ul>
170
+ </div>
171
+ </div>
172
+ `
173
+ };
174
+
175
+ export const VisualDemo = {
176
+ name: 'Visual Stacking Demo',
177
+ render: () => html`
178
+ ${zIndexStoryStyles}
179
+ <div class="z-index-section">
180
+ <h2>Interactive Stacking Example</h2>
181
+ <p class="text-muted">
182
+ This demo shows how different z-index tokens create proper layering.
183
+ Lower elements appear behind higher ones.
184
+ </p>
185
+
186
+ <div class="surface z-index-demo-wrapper">
187
+
188
+ <div class="z-index-demo-base">
189
+ <h3>Base Content (z-index: auto)</h3>
190
+ <p>This is the base layer of content with no explicit z-index.</p>
191
+ </div>
192
+
193
+ <div class="card card-elevated z-index-demo-dropdown">
194
+ <strong>Dropdown Menu</strong>
195
+ <p><small>z-index: var(--z-dropdown) = 1000</small></p>
196
+ </div>
197
+
198
+ <div class="card surface-elevated z-index-demo-sticky">
199
+ <strong>Sticky Header</strong>
200
+ <p><small>z-index: var(--z-sticky) = 1020</small></p>
201
+ </div>
202
+
203
+ <div class="card surface-elevated z-index-demo-fixed">
204
+ <strong>Fixed Element</strong>
205
+ <p><small>z-index: var(--z-fixed) = 1030</small></p>
206
+ </div>
207
+
208
+ <div class="z-index-demo-modal-overlay">
209
+ <article class="card card-elevated z-index-demo-modal-card">
210
+ <h4>Modal Dialog</h4>
211
+ <p><small>z-index: var(--z-modal) = 1040</small></p>
212
+ <p class="text-muted">Modal dialogs appear above most other content.</p>
213
+ </article>
214
+ </div>
215
+
216
+ <div class="surface-inverse z-index-demo-tooltip">
217
+ <strong>Tooltip</strong>
218
+ <p><small>--z-tooltip: 1070</small></p>
219
+ </div>
220
+
221
+ <div class="card z-index-demo-toast">
222
+ <strong>🎉 Notification Toast</strong>
223
+ <p><small>z-index: var(--z-notification) = 1080</small></p>
224
+ <p><small>Highest layer</small></p>
225
+ </div>
226
+
227
+ </div>
228
+
229
+ <div class="card card-outlined z-index-note">
230
+ <p>
231
+ <strong>Note:</strong> In this demo, elements are positioned to overlap.
232
+ Notice how higher z-index values appear above lower ones, with notifications at the top.
233
+ </p>
234
+ </div>
235
+ </div>
236
+ `
237
+ };
238
+
239
+ export const UsageExamples = {
240
+ name: 'Usage Examples',
241
+ render: () => html`
242
+ ${zIndexStoryStyles}
243
+ <div class="z-index-section">
244
+ <h2>Code Examples</h2>
245
+ <p class="text-muted">
246
+ How to use z-index tokens in your components and styles.
247
+ </p>
248
+
249
+ <div class="grid grid-cols-1 gap-lg">
250
+
251
+ <article class="card surface-subtle">
252
+ <h3>Modal Dialog</h3>
253
+ <pre><code>.modal {
254
+ position: fixed;
255
+ inset: 0;
256
+ z-index: var(--z-modal);
257
+ display: flex;
258
+ align-items: center;
259
+ justify-content: center;
260
+ }</code></pre>
261
+ </article>
262
+
263
+ <article class="card surface-subtle">
264
+ <h3>Dropdown Menu</h3>
265
+ <pre><code>.dropdown-menu {
266
+ position: absolute;
267
+ z-index: var(--z-dropdown);
268
+ background: var(--color-surface-elevated);
269
+ box-shadow: var(--shadow-lg);
270
+ border-radius: var(--radius-md);
271
+ }</code></pre>
272
+ </article>
273
+
274
+ <article class="card surface-subtle">
275
+ <h3>Sticky Header</h3>
276
+ <pre><code>.sticky-header {
277
+ position: sticky;
278
+ top: 0;
279
+ z-index: var(--z-sticky);
280
+ background: var(--color-surface-base);
281
+ box-shadow: var(--shadow-sm);
282
+ }</code></pre>
283
+ </article>
284
+
285
+ <article class="card surface-subtle">
286
+ <h3>Toast Notification</h3>
287
+ <pre><code>.toast-notification {
288
+ position: fixed;
289
+ top: var(--spacing-4);
290
+ right: var(--spacing-4);
291
+ z-index: var(--z-notification);
292
+ padding: var(--spacing-4);
293
+ border-radius: var(--radius-md);
294
+ box-shadow: var(--shadow-xl);
295
+ }</code></pre>
296
+ </article>
297
+
298
+ <article class="card surface-subtle">
299
+ <h3>Tooltip</h3>
300
+ <pre><code>.tooltip {
301
+ position: absolute;
302
+ z-index: var(--z-tooltip);
303
+ padding: var(--spacing-2);
304
+ background: var(--color-surface-inverse);
305
+ color: var(--color-text-inverse);
306
+ font-size: var(--font-size-sm);
307
+ border-radius: var(--radius-sm);
308
+ }</code></pre>
309
+ </article>
310
+
311
+ </div>
312
+
313
+ <aside class="card card-outlined z-index-callout z-index-callout--warning">
314
+ <h3><pds-icon icon="warning"></pds-icon> Important Guidelines</h3>
315
+ <ul>
316
+ <li><strong>Never use magic numbers:</strong> Always reference these tokens instead of hardcoded values</li>
317
+ <li><strong>Respect the hierarchy:</strong> Don't try to make a dropdown appear above a modal</li>
318
+ <li><strong>Stacking context:</strong> Remember that z-index only works within the same stacking context</li>
319
+ <li><strong>Negative values:</strong> Avoid negative z-index values; use these tokens instead</li>
320
+ <li><strong>Component libraries:</strong> Ensure third-party components don't conflict with these ranges</li>
321
+ </ul>
322
+ </aside>
323
+ </div>
324
+ `
325
+ };
@@ -0,0 +1,72 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Patterns/Border Effects',
5
+ parameters: {
6
+ docs: {
7
+ description: {
8
+ component: 'Special border effects including gradients and glows'
9
+ }
10
+ }
11
+ }
12
+ };
13
+
14
+ const borderEffectsStoryStyles = html`
15
+ <style>
16
+ .border-effects-grid {
17
+ display: grid;
18
+ grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr));
19
+ gap: var(--spacing-4);
20
+ }
21
+ .border-effects-card {
22
+ padding: var(--spacing-4);
23
+ }
24
+ .border-effects-card-angle {
25
+ --gradient-angle: 45deg;
26
+ }
27
+ .border-effects-actions {
28
+ display: flex;
29
+ gap: var(--spacing-2);
30
+ margin-top: var(--spacing-4);
31
+ }
32
+ </style>
33
+ `;
34
+
35
+ export const BorderGradient = () => html`
36
+ ${borderEffectsStoryStyles}
37
+ <div class="border-effects-grid">
38
+ <div class="border-gradient border-effects-card">
39
+ <h3>Gradient Border</h3>
40
+ <p>Animated gradient border effect that follows the primary color scheme.</p>
41
+ </div>
42
+ <div class="border-gradient border-effects-card border-effects-card-angle">
43
+ <h3>Custom Angle</h3>
44
+ <p>Use CSS variables to customize the gradient direction.</p>
45
+ </div>
46
+ </div>
47
+ `;
48
+
49
+ export const BorderGlow = () => html`
50
+ <div class="grid gap-md" >
51
+ <div class="card border-glow" >
52
+ <h3>Glowing Border</h3>
53
+ <p>Subtle glow effect.</p>
54
+ </div>
55
+ <div class="card border-glow border-gradient" >
56
+ <h3>Glow + Gradient</h3>
57
+ <p>Combined glow and gradient border effects.</p>
58
+ </div>
59
+ </div>
60
+ `;
61
+
62
+ export const Combined = () => html`
63
+ ${borderEffectsStoryStyles}
64
+ <article class="card border-gradient">
65
+ <h2>Premium Feature Card</h2>
66
+ <p>Combining card primitive with gradient border effect.</p>
67
+ <div class="border-effects-actions">
68
+ <button class="btn-primary">Get Started</button>
69
+ <button class="btn-outline">Learn More</button>
70
+ </div>
71
+ </article>
72
+ `;
@@ -0,0 +1,99 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Patterns/Layout',
5
+ tags: ['grouping'],
6
+ parameters: {
7
+ pds: {
8
+ tags: ['layout', 'grid', 'flex', 'grouping']
9
+ },
10
+ docs: {
11
+ description: {
12
+ component: 'Layout patterns using grid, flex, and container utilities'
13
+ }
14
+ }
15
+ }
16
+ };
17
+
18
+ const layoutStoryStyles = html`
19
+ <style>
20
+ .layout-auto-grid {
21
+ grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
22
+ gap: var(--spacing-4);
23
+ }
24
+ .layout-flex-item {
25
+ flex: 1;
26
+ min-width: 12.5rem;
27
+ }
28
+ .layout-container {
29
+ max-width: 75rem;
30
+ margin: 0 auto;
31
+ padding: var(--spacing-4);
32
+ }
33
+ .layout-section-spacing {
34
+ margin-top: var(--spacing-4);
35
+ }
36
+ .layout-grid-card {
37
+ padding: var(--spacing-4);
38
+ text-align: center;
39
+ }
40
+ </style>
41
+ `;
42
+
43
+ export const GridLayout = () => html`
44
+ ${layoutStoryStyles}
45
+ <div class="grid layout-auto-grid">
46
+ ${Array.from({ length: 6 }, (_, i) => html`
47
+ <div class="card">
48
+ <h4>Grid Item ${i + 1}</h4>
49
+ <p>Content in grid cell</p>
50
+ </div>
51
+ `)}
52
+ </div>
53
+ `;
54
+
55
+ export const FlexLayout = () => html`
56
+ ${layoutStoryStyles}
57
+ <div class="flex gap-sm flex-wrap">
58
+ <div class="card layout-flex-item">
59
+ <h4>Flexible Box 1</h4>
60
+ <p>Grows to fill space</p>
61
+ </div>
62
+ <div class="card layout-flex-item">
63
+ <h4>Flexible Box 2</h4>
64
+ <p>Equal flex basis</p>
65
+ </div>
66
+ <div class="card layout-flex-item">
67
+ <h4>Flexible Box 3</h4>
68
+ <p>Responsive wrapping</p>
69
+ </div>
70
+ </div>
71
+ `;
72
+
73
+ export const ContainerLayout = () => html`
74
+ ${layoutStoryStyles}
75
+ <div class="layout-container">
76
+ <h2>Centered Container</h2>
77
+ <p>Content is constrained to a maximum width and centered.</p>
78
+ <div class="grid grid-cols-3 gap-md layout-section-spacing">
79
+ ${Array.from({ length: 3 }, (_, i) => html`
80
+ <div class="card">
81
+ <h4>Column ${i + 1}</h4>
82
+ <p>Three equal columns</p>
83
+ </div>
84
+ `)}
85
+ </div>
86
+ </div>
87
+ `;
88
+
89
+ export const ResponsiveGrid = () => html`
90
+ ${layoutStoryStyles}
91
+ <div class="grid grid-auto-md gap-md">
92
+ ${Array.from({ length: 12 }, (_, i) => html`
93
+ <div class="card layout-grid-card">
94
+ <h4>Item ${i + 1}</h4>
95
+ <p>Auto-responsive grid cell</p>
96
+ </div>
97
+ `)}
98
+ </div>
99
+ `;
@@ -0,0 +1,107 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Patterns/Utilities',
5
+ tags: ['utilities', 'spacing', 'layout', 'gap'],
6
+ parameters: {
7
+ pds: {
8
+ tags: ['utilities', 'layout', 'spacing', 'gap']
9
+ },
10
+ docs: {
11
+ description: {
12
+ component: 'Utility classes for spacing, sizing, and common patterns'
13
+ }
14
+ }
15
+ }
16
+ };
17
+
18
+ const utilitiesStoryStyles = html`
19
+ <style>
20
+ .utilities-flex-fill {
21
+ flex: 1;
22
+ }
23
+ .utilities-heading-reset {
24
+ margin: 0;
25
+ }
26
+ .utilities-helper-text {
27
+ margin: 0;
28
+ font-size: 0.875rem;
29
+ color: var(--surface-text-secondary);
30
+ }
31
+ .utilities-auto-grid {
32
+ grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
33
+ }
34
+ .utilities-radius-sm {
35
+ border-radius: var(--radius-sm);
36
+ }
37
+ .utilities-radius-md {
38
+ border-radius: var(--radius-md);
39
+ }
40
+ .utilities-radius-lg {
41
+ border-radius: var(--radius-lg);
42
+ }
43
+ .utilities-radius-full {
44
+ border-radius: var(--radius-full);
45
+ }
46
+ </style>
47
+ `;
48
+
49
+ export const SpacingUtilities = () => html`
50
+ <div class="flex flex-col gap-md">
51
+ <div class="gap-xs flex" >
52
+ <div class="badge">Gap 1</div>
53
+ <div class="badge">Between</div>
54
+ <div class="badge">Items</div>
55
+ </div>
56
+ <div class="gap-sm flex" >
57
+ <div class="badge">Gap 2</div>
58
+ <div class="badge">Between</div>
59
+ <div class="badge">Items</div>
60
+ </div>
61
+ <div class="gap-md flex" >
62
+ <div class="badge">Gap 4</div>
63
+ <div class="badge">Between</div>
64
+ <div class="badge">Items</div>
65
+ </div>
66
+ </div>
67
+ `;
68
+
69
+ export const FlexUtilities = () => html`
70
+ ${utilitiesStoryStyles}
71
+ <div class="card flex items-center gap-md" >
72
+ <pds-icon icon="star" size="lg"></pds-icon>
73
+ <div class="utilities-flex-fill">
74
+ <h4 class="utilities-heading-reset">Flex Item</h4>
75
+ <p class="utilities-helper-text">Vertically centered with gap</p>
76
+ </div>
77
+ <button class="btn-primary">Action</button>
78
+ </div>
79
+ `;
80
+
81
+ export const BorderUtilities = () => html`
82
+ ${utilitiesStoryStyles}
83
+ <div class="grid gap-md utilities-auto-grid">
84
+ <div class="card" >
85
+ <h4>Default Border</h4>
86
+ <p>No border specified</p>
87
+ </div>
88
+ <div class="card border-gradient" >
89
+ <h4>Gradient Border</h4>
90
+ <p>Using .border-gradient</p>
91
+ </div>
92
+ <div class="card border-glow" >
93
+ <h4>Glowing Border</h4>
94
+ <p>Using .border-glow</p>
95
+ </div>
96
+ </div>
97
+ `;
98
+
99
+ export const RoundedUtilities = () => html`
100
+ ${utilitiesStoryStyles}
101
+ <div class="flex gap-md flex-wrap">
102
+ <div class="card surface-inverse utilities-radius-sm">--radius-sm</div>
103
+ <div class="card surface-inverse utilities-radius-md">--radius-md</div>
104
+ <div class="card surface-inverse utilities-radius-lg">--radius-lg</div>
105
+ <div class="card surface-inverse utilities-radius-full">--radius-full</div>
106
+ </div>
107
+ `;