@pure-ds/storybook 0.3.19 → 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
@@ -1,203 +1,442 @@
1
- import { html } from 'lit';
2
-
3
- export default {
4
- title: 'Primitives/Media Elements',
5
- parameters: {
6
- docs: {
7
- description: {
8
- component: 'Responsive images, figures with captions, image galleries, and video elements with proper semantic HTML.'
9
- }
10
- }
11
- }
12
- };
13
-
14
- const mediaStoryStyles = html`
15
- <style>
16
- .media-story-section {
17
- padding: var(--spacing-4);
18
- }
19
- .media-responsive-grid {
20
- display: grid;
21
- gap: var(--spacing-6);
22
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
23
- }
24
- .media-gallery-grid {
25
- display: grid;
26
- gap: var(--spacing-3);
27
- grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
28
- }
29
- .media-scroll-image,
30
- .media-gallery-image {
31
- width: 100%;
32
- height: auto;
33
- border-radius: var(--radius-md);
34
- box-shadow: var(--shadow-sm);
35
- }
36
- .media-scroll-image {
37
- width: auto;
38
- }
39
- .media-video-shell {
40
- max-width: 56.25rem;
41
- }
42
- .media-video-figure {
43
- margin-top: var(--spacing-4);
44
- }
45
- .media-video-element {
46
- width: 100%;
47
- border-radius: var(--radius-lg);
48
- box-shadow: var(--shadow-md);
49
- }
50
- .media-mixed-layout {
51
- display: grid;
52
- grid-template-columns: 1fr 1fr;
53
- gap: var(--spacing-6);
54
- margin-top: var(--spacing-4);
55
- }
56
- .media-thumbnail-grid {
57
- display: grid;
58
- grid-template-columns: repeat(2, 1fr);
59
- gap: var(--spacing-2);
60
- }
61
- .media-thumbnail-image {
62
- width: 100%;
63
- border-radius: var(--radius-sm);
64
- box-shadow: var(--shadow-sm);
65
- }
66
- </style>
67
- `;
68
-
69
- export const ResponsiveImages = () => html`
70
- ${mediaStoryStyles}
71
- <div class="media-story-section">
72
- <div class="media-responsive-grid">
73
- <figure class="media-figure">
74
- <img
75
- class="media-image"
76
- src="https://picsum.photos/800/600?random=1"
77
- alt="Random landscape"
78
- loading="lazy"
79
- />
80
- <figcaption class="media-caption">
81
- <strong>Figure 1:</strong> A beautiful landscape demonstrating image handling in the design system.
82
- </figcaption>
83
- </figure>
84
-
85
- <figure class="media-figure">
86
- <img
87
- class="media-image"
88
- src="https://picsum.photos/800/600?random=2"
89
- alt="Random architecture"
90
- loading="lazy"
91
- />
92
- <figcaption class="media-caption">
93
- <strong>Figure 2:</strong> Architectural photography showcasing the responsive image behavior.
94
- </figcaption>
95
- </figure>
96
- </div>
97
- </div>
98
- `;
99
-
100
- ResponsiveImages.storyName = 'Responsive Images';
101
-
102
- export const ImageGallery = () => html`
103
- ${mediaStoryStyles}
104
- <div class="media-story-section">
105
- <h3>Image Gallery Grid</h3>
106
- <div class="gallery-grid media-gallery-grid">
107
- ${Array.from({ length: 8 }, (_, i) => html`
108
- <img
109
- class="gallery-image media-gallery-image"
110
- src="https://picsum.photos/400/400?random=${i + 3}"
111
- alt="Gallery image ${i + 1}"
112
- loading="lazy"
113
- />
114
- `)}
115
- </div>
116
- </div>
117
- `;
118
-
119
- ImageGallery.storyName = 'Image Gallery';
120
-
121
- export const ScrollRowGallery = () => html`
122
- ${mediaStoryStyles}
123
- <div class="media-story-section">
124
- <h3>Netflix-Style Horizontal Scroll Row</h3>
125
- <pds-scrollrow>
126
- ${Array.from({ length: 20 }, (_, i) => html`
127
- <img
128
- loading="lazy"
129
- class="gallery-image media-scroll-image"
130
- src="https://picsum.photos/200/200?random=${i + 10}"
131
- alt="Gallery image ${i + 1}"
132
- />
133
- `)}
134
- </pds-scrollrow>
135
- </div>
136
- `;
137
-
138
- ScrollRowGallery.storyName = 'Horizontal Scroll Row';
139
-
140
- export const VideoElement = () => html`
141
- ${mediaStoryStyles}
142
- <div class="media-story-section media-video-shell">
143
- <h3>Video Element with Controls</h3>
144
- <figure class="video-container media-video-figure">
145
- <video
146
- class="video-element media-video-element"
147
- controls
148
- poster="https://picsum.photos/1200/675?random=7"
149
- >
150
- <source
151
- src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
152
- type="video/mp4"
153
- />
154
- Your browser does not support the video tag.
155
- </video>
156
- <figcaption class="media-caption">
157
- <strong>Video Demo:</strong> Big Buck Bunny sample video demonstrating video element styling.
158
- </figcaption>
159
- </figure>
160
- </div>
161
- `;
162
-
163
- VideoElement.storyName = 'Video Element';
164
-
165
- export const MixedMedia = () => html`
166
- ${mediaStoryStyles}
167
- <div class="media-story-section">
168
- <h2>Mixed Media Layout</h2>
169
-
170
- <div class="media-mixed-layout">
171
- <div>
172
- <h3>Featured Image</h3>
173
- <figure class="media-figure">
174
- <img
175
- class="media-image"
176
- src="https://picsum.photos/600/400?random=20"
177
- alt="Featured content"
178
- loading="lazy"
179
- />
180
- <figcaption class="media-caption">
181
- High-resolution featured image with caption
182
- </figcaption>
183
- </figure>
184
- </div>
185
-
186
- <div>
187
- <h3>Thumbnail Grid</h3>
188
- <div class="media-thumbnail-grid">
189
- ${Array.from({ length: 4 }, (_, i) => html`
190
- <img
191
- src="https://picsum.photos/200/200?random=${i + 30}"
192
- alt="Thumbnail ${i + 1}"
193
- loading="lazy"
194
- class="media-thumbnail-image"
195
- />
196
- `)}
197
- </div>
198
- </div>
199
- </div>
200
- </div>
201
- `;
202
-
203
- MixedMedia.storyName = 'Mixed Media Layout';
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Primitives/Media Elements',
5
+ tags: ['media', 'image', 'figure', 'gallery', 'video', 'responsive'],
6
+ parameters: {
7
+ pds: {
8
+ tags: ['media', 'image', 'figure', 'gallery', 'video', 'responsive', 'caption', 'img']
9
+ },
10
+ docs: {
11
+ description: {
12
+ component: 'Responsive images, figures with captions, image galleries, and video elements with proper semantic HTML.'
13
+ }
14
+ }
15
+ }
16
+ };
17
+
18
+ const mediaStoryStyles = html`
19
+ <style>
20
+ .media-story-section {
21
+ padding: var(--spacing-4);
22
+ }
23
+ .media-responsive-grid {
24
+ display: grid;
25
+ gap: var(--spacing-6);
26
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
27
+ }
28
+ .media-gallery-grid {
29
+ display: grid;
30
+ gap: var(--spacing-3);
31
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
32
+ }
33
+ .media-scroll-image,
34
+ .media-gallery-image {
35
+ width: 100%;
36
+ height: auto;
37
+ border-radius: var(--radius-md);
38
+ box-shadow: var(--shadow-sm);
39
+ }
40
+ .media-scroll-image {
41
+ width: auto;
42
+ }
43
+ .media-video-shell {
44
+ max-width: 56.25rem;
45
+ }
46
+ .media-video-figure {
47
+ margin-top: var(--spacing-4);
48
+ }
49
+ .media-video-element {
50
+ width: 100%;
51
+ border-radius: var(--radius-lg);
52
+ box-shadow: var(--shadow-md);
53
+ }
54
+ .media-mixed-layout {
55
+ display: grid;
56
+ grid-template-columns: 1fr 1fr;
57
+ gap: var(--spacing-6);
58
+ margin-top: var(--spacing-4);
59
+ }
60
+ .media-thumbnail-grid {
61
+ display: grid;
62
+ grid-template-columns: repeat(2, 1fr);
63
+ gap: var(--spacing-2);
64
+ }
65
+ .media-thumbnail-image {
66
+ width: 100%;
67
+ border-radius: var(--radius-sm);
68
+ box-shadow: var(--shadow-sm);
69
+ }
70
+ </style>
71
+ `;
72
+
73
+ export const ResponsiveImages = () => html`
74
+ ${mediaStoryStyles}
75
+ <div class="media-story-section">
76
+ <div class="media-responsive-grid">
77
+ <figure class="media-figure">
78
+ <img
79
+ class="media-image"
80
+ src="https://picsum.photos/800/600?random=1"
81
+ alt="Random landscape"
82
+ loading="lazy"
83
+ />
84
+ <figcaption class="media-caption">
85
+ <strong>Figure 1:</strong> A beautiful landscape demonstrating image handling in the design system.
86
+ </figcaption>
87
+ </figure>
88
+
89
+ <figure class="media-figure">
90
+ <img
91
+ class="media-image"
92
+ src="https://picsum.photos/800/600?random=2"
93
+ alt="Random architecture"
94
+ loading="lazy"
95
+ />
96
+ <figcaption class="media-caption">
97
+ <strong>Figure 2:</strong> Architectural photography showcasing the responsive image behavior.
98
+ </figcaption>
99
+ </figure>
100
+ </div>
101
+ </div>
102
+ `;
103
+
104
+ ResponsiveImages.storyName = 'Responsive Images';
105
+
106
+ export const ImageGallery = () => html`
107
+ ${mediaStoryStyles}
108
+ <div class="media-story-section">
109
+ <h3>Image Gallery Grid</h3>
110
+ <div class="gallery-grid media-gallery-grid">
111
+ ${Array.from({ length: 8 }, (_, i) => html`
112
+ <img
113
+ class="gallery-image media-gallery-image"
114
+ src="https://picsum.photos/400/400?random=${i + 3}"
115
+ alt="Gallery image ${i + 1}"
116
+ loading="lazy"
117
+ />
118
+ `)}
119
+ </div>
120
+ </div>
121
+ `;
122
+
123
+ ImageGallery.storyName = 'Image Gallery';
124
+
125
+ export const ScrollRowGallery = () => html`
126
+ ${mediaStoryStyles}
127
+ <div class="media-story-section">
128
+ <h3>Netflix-Style Horizontal Scroll Row</h3>
129
+ <pds-scrollrow>
130
+ ${Array.from({ length: 20 }, (_, i) => html`
131
+ <img
132
+ loading="lazy"
133
+ class="gallery-image media-scroll-image"
134
+ src="https://picsum.photos/200/200?random=${i + 10}"
135
+ alt="Gallery image ${i + 1}"
136
+ />
137
+ `)}
138
+ </pds-scrollrow>
139
+ </div>
140
+ `;
141
+
142
+ ScrollRowGallery.storyName = 'Horizontal Scroll Row';
143
+
144
+ export const ImageRoundedUtilities = () => html`
145
+ <div class="card">
146
+ <h2>Image Rounded Utilities</h2>
147
+ <p class="text-muted">Apply consistent border-radius to images with <code>.img-rounded-*</code> classes.</p>
148
+ </div>
149
+
150
+ <div class="grid grid-auto-sm gap-lg">
151
+ <figure>
152
+ <img
153
+ src="https://picsum.photos/300/200?random=40"
154
+ alt="Small radius"
155
+ class="img-rounded-sm"
156
+ style="width: 100%;"
157
+ />
158
+ <figcaption><code>.img-rounded-sm</code></figcaption>
159
+ </figure>
160
+
161
+ <figure>
162
+ <img
163
+ src="https://picsum.photos/300/200?random=41"
164
+ alt="Medium radius"
165
+ class="img-rounded-md"
166
+ style="width: 100%;"
167
+ />
168
+ <figcaption><code>.img-rounded-md</code></figcaption>
169
+ </figure>
170
+
171
+ <figure>
172
+ <img
173
+ src="https://picsum.photos/300/200?random=42"
174
+ alt="Large radius"
175
+ class="img-rounded-lg"
176
+ style="width: 100%;"
177
+ />
178
+ <figcaption><code>.img-rounded-lg</code></figcaption>
179
+ </figure>
180
+
181
+ <figure>
182
+ <img
183
+ src="https://picsum.photos/300/200?random=43"
184
+ alt="Extra large radius"
185
+ class="img-rounded-xl"
186
+ style="width: 100%;"
187
+ />
188
+ <figcaption><code>.img-rounded-xl</code></figcaption>
189
+ </figure>
190
+
191
+ <figure>
192
+ <img
193
+ src="https://picsum.photos/200/200?random=44"
194
+ alt="Full radius (circle)"
195
+ class="img-rounded-full"
196
+ style="width: 200px; aspect-ratio: 1;"
197
+ />
198
+ <figcaption><code>.img-rounded-full</code></figcaption>
199
+ </figure>
200
+ </div>
201
+ `;
202
+
203
+ ImageRoundedUtilities.storyName = 'Rounded Utilities';
204
+
205
+ export const ImageGalleryClass = () => html`
206
+ <div class="card">
207
+ <h2>.img-gallery Utility</h2>
208
+ <p class="text-muted">
209
+ The <code>.img-gallery</code> class creates square, cropped thumbnails perfect for grid galleries.
210
+ Images are set to <code>aspect-ratio: 1</code> and <code>object-fit: cover</code>.
211
+ </p>
212
+ </div>
213
+
214
+ <div class="grid grid-auto-sm gap-md">
215
+ ${Array.from({ length: 8 }, (_, i) => html`
216
+ <img
217
+ src="https://picsum.photos/400/600?random=${i + 50}"
218
+ alt="Gallery item ${i + 1}"
219
+ class="img-gallery"
220
+ />
221
+ `)}
222
+ </div>
223
+ `;
224
+
225
+ ImageGalleryClass.storyName = '.img-gallery';
226
+
227
+ export const InlineImages = () => html`
228
+ <div class="card">
229
+ <h2>Inline Images</h2>
230
+ <p class="text-muted">
231
+ Use <code>.img-inline</code> for small images within text flow, like avatars or icons.
232
+ </p>
233
+ </div>
234
+
235
+ <div class="card">
236
+ <p>
237
+ The team includes
238
+ <img src="https://i.pravatar.cc/60?img=1" alt="Alice" class="img-inline" />
239
+ Alice,
240
+ <img src="https://i.pravatar.cc/60?img=2" alt="Bob" class="img-inline" />
241
+ Bob, and
242
+ <img src="https://i.pravatar.cc/60?img=3" alt="Carol" class="img-inline" />
243
+ Carol who have been working on this project.
244
+ </p>
245
+
246
+ <p style="margin-top: var(--spacing-4);">
247
+ Click the
248
+ <img src="https://picsum.photos/60/60?random=60" alt="Settings icon" class="img-inline" />
249
+ icon to access settings, or the
250
+ <img src="https://picsum.photos/60/60?random=61" alt="Help icon" class="img-inline" />
251
+ icon for help.
252
+ </p>
253
+ </div>
254
+
255
+ <div class="card">
256
+ <h3>CSS Properties</h3>
257
+ <pre><code>.img-inline {
258
+ display: inline;
259
+ vertical-align: middle;
260
+ border-radius: var(--radius-xs);
261
+ margin: 0 var(--spacing-1);
262
+ max-width: 60px;
263
+ height: auto;
264
+ }</code></pre>
265
+ </div>
266
+ `;
267
+
268
+ InlineImages.storyName = 'Inline Images';
269
+
270
+ export const VideoResponsive = () => html`
271
+ <div class="card">
272
+ <h2>.video-responsive Utility</h2>
273
+ <p class="text-muted">
274
+ The <code>.video-responsive</code> class constrains video width and applies consistent styling.
275
+ </p>
276
+ </div>
277
+
278
+ <video
279
+ class="video-responsive"
280
+ controls
281
+ poster="https://picsum.photos/600/338?random=70"
282
+ >
283
+ <source
284
+ src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
285
+ type="video/mp4"
286
+ />
287
+ Your browser does not support the video tag.
288
+ </video>
289
+
290
+ <div class="card">
291
+ <h3>CSS Properties</h3>
292
+ <pre><code>.video-responsive {
293
+ width: 100%;
294
+ max-width: 600px;
295
+ height: auto;
296
+ border-radius: var(--radius-md);
297
+ }</code></pre>
298
+ </div>
299
+ `;
300
+
301
+ VideoResponsive.storyName = '.video-responsive';
302
+
303
+ export const FigureResponsive = () => html`
304
+ <div class="card">
305
+ <h2>.figure-responsive Utility</h2>
306
+ <p class="text-muted">
307
+ Apply <code>.figure-responsive</code> to figures for full-width responsive images with captions.
308
+ </p>
309
+ </div>
310
+
311
+ <figure class="figure-responsive">
312
+ <img
313
+ src="https://picsum.photos/1200/600?random=80"
314
+ alt="Responsive figure example"
315
+ />
316
+ <figcaption>
317
+ <strong>Figure 1:</strong> This figure scales responsively to fill its container width while maintaining aspect ratio.
318
+ </figcaption>
319
+ </figure>
320
+ `;
321
+
322
+ FigureResponsive.storyName = '.figure-responsive';
323
+
324
+ export const VideoElement = () => html`
325
+ ${mediaStoryStyles}
326
+ <div class="media-story-section media-video-shell">
327
+ <h3>Video Element with Controls</h3>
328
+ <figure class="video-container media-video-figure">
329
+ <video
330
+ class="video-element media-video-element"
331
+ controls
332
+ poster="https://picsum.photos/1200/675?random=7"
333
+ >
334
+ <source
335
+ src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
336
+ type="video/mp4"
337
+ />
338
+ Your browser does not support the video tag.
339
+ </video>
340
+ <figcaption class="media-caption">
341
+ <strong>Video Demo:</strong> Big Buck Bunny sample video demonstrating video element styling.
342
+ </figcaption>
343
+ </figure>
344
+ </div>
345
+ `;
346
+
347
+ VideoElement.storyName = 'Video Element';
348
+
349
+ export const MixedMedia = () => html`
350
+ ${mediaStoryStyles}
351
+ <div class="media-story-section">
352
+ <h2>Mixed Media Layout</h2>
353
+
354
+ <div class="media-mixed-layout">
355
+ <div>
356
+ <h3>Featured Image</h3>
357
+ <figure class="media-figure">
358
+ <img
359
+ class="media-image"
360
+ src="https://picsum.photos/600/400?random=20"
361
+ alt="Featured content"
362
+ loading="lazy"
363
+ />
364
+ <figcaption class="media-caption">
365
+ High-resolution featured image with caption
366
+ </figcaption>
367
+ </figure>
368
+ </div>
369
+
370
+ <div>
371
+ <h3>Thumbnail Grid</h3>
372
+ <div class="media-thumbnail-grid">
373
+ ${Array.from({ length: 4 }, (_, i) => html`
374
+ <img
375
+ src="https://picsum.photos/200/200?random=${i + 30}"
376
+ alt="Thumbnail ${i + 1}"
377
+ loading="lazy"
378
+ class="media-thumbnail-image"
379
+ />
380
+ `)}
381
+ </div>
382
+ </div>
383
+ </div>
384
+ </div>
385
+ `;
386
+
387
+ MixedMedia.storyName = 'Mixed Media Layout';
388
+
389
+ export const MediaReference = () => html`
390
+ <div class="card">
391
+ <h2>Media Utilities Reference</h2>
392
+ </div>
393
+
394
+ <table class="table-bordered">
395
+ <thead>
396
+ <tr>
397
+ <th>Class</th>
398
+ <th>Description</th>
399
+ </tr>
400
+ </thead>
401
+ <tbody>
402
+ <tr>
403
+ <td><code>.img-gallery</code></td>
404
+ <td>Square aspect ratio with object-fit: cover for gallery grids</td>
405
+ </tr>
406
+ <tr>
407
+ <td><code>.img-rounded-sm</code></td>
408
+ <td>Small border radius (--radius-sm)</td>
409
+ </tr>
410
+ <tr>
411
+ <td><code>.img-rounded-md</code></td>
412
+ <td>Medium border radius (--radius-md)</td>
413
+ </tr>
414
+ <tr>
415
+ <td><code>.img-rounded-lg</code></td>
416
+ <td>Large border radius (--radius-lg)</td>
417
+ </tr>
418
+ <tr>
419
+ <td><code>.img-rounded-xl</code></td>
420
+ <td>Extra large border radius (--radius-xl)</td>
421
+ </tr>
422
+ <tr>
423
+ <td><code>.img-rounded-full</code></td>
424
+ <td>Full border radius for circles (--radius-full)</td>
425
+ </tr>
426
+ <tr>
427
+ <td><code>.img-inline</code></td>
428
+ <td>Small inline images within text (max 60px)</td>
429
+ </tr>
430
+ <tr>
431
+ <td><code>.video-responsive</code></td>
432
+ <td>Responsive video with max-width and border radius</td>
433
+ </tr>
434
+ <tr>
435
+ <td><code>.figure-responsive</code></td>
436
+ <td>Full-width responsive figure</td>
437
+ </tr>
438
+ </tbody>
439
+ </table>
440
+ `;
441
+
442
+ MediaReference.storyName = 'Reference';