@pure-ds/storybook 0.4.16 → 0.4.17

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 (51) hide show
  1. package/.storybook/addons/html-preview/Panel.jsx +71 -20
  2. package/dist/pds-reference.json +2 -7
  3. package/package.json +2 -2
  4. package/public/assets/js/app.js +617 -10565
  5. package/public/assets/js/lit.js +3 -1048
  6. package/public/assets/js/pds.js +396 -7354
  7. package/public/assets/pds/components/pds-calendar.js +1 -1
  8. package/public/assets/pds/custom-elements.json +263 -18
  9. package/public/assets/pds/pds-runtime-config.json +1 -1
  10. package/public/assets/pds/styles/pds-components.css +83 -221
  11. package/public/assets/pds/styles/pds-components.css.js +166 -442
  12. package/public/assets/pds/styles/pds-styles.css +240 -437
  13. package/public/assets/pds/styles/pds-styles.css.js +479 -881
  14. package/public/assets/pds/styles/pds-utilities.css +151 -214
  15. package/public/assets/pds/styles/pds-utilities.css.js +302 -428
  16. package/src/js/pds-core/pds-generator.js +88 -38
  17. package/src/js/pds-core/pds-ontology.js +1 -1
  18. package/stories/components/PdsCalendar.stories.js +2 -2
  19. package/stories/components/PdsDrawer.stories.js +15 -15
  20. package/stories/components/PdsJsonform.stories.js +78 -0
  21. package/stories/components/PdsRichtext.stories.js +4 -17
  22. package/stories/components/PdsScrollrow.stories.js +224 -72
  23. package/stories/components/PdsSplitpanel.stories.js +63 -28
  24. package/stories/components/PdsTabstrip.stories.js +7 -7
  25. package/stories/enhancements/Accordion.stories.js +2 -2
  26. package/stories/enhancements/Dropdowns.stories.js +13 -10
  27. package/stories/enhancements/RangeSliders.stories.js +9 -9
  28. package/stories/enhancements/RequiredFields.stories.js +8 -8
  29. package/stories/enhancements/Toggles.stories.js +45 -36
  30. package/stories/enhancements/_enhancement-header.js +2 -2
  31. package/stories/foundations/Colors.stories.js +13 -13
  32. package/stories/foundations/HTMLDefaults.stories.js +4 -4
  33. package/stories/foundations/Icons.stories.js +123 -288
  34. package/stories/foundations/MeshGradients.stories.js +161 -250
  35. package/stories/foundations/SmartSurfaces.stories.js +147 -64
  36. package/stories/foundations/Spacing.stories.js +30 -30
  37. package/stories/foundations/Typography.stories.js +352 -723
  38. package/stories/foundations/ZIndex.stories.js +124 -141
  39. package/stories/layout/LayoutOverview.stories.js +343 -250
  40. package/stories/layout/LayoutSystem.stories.js +60 -76
  41. package/stories/patterns/InteractiveStates.stories.js +29 -29
  42. package/stories/patterns/Utilities.stories.js +17 -5
  43. package/stories/primitives/Alerts.stories.js +6 -6
  44. package/stories/primitives/Cards.stories.js +22 -11
  45. package/stories/primitives/Forms.stories.js +17 -8
  46. package/stories/primitives/Media.stories.js +23 -20
  47. package/stories/utilities/Backdrop.stories.js +68 -27
  48. package/stories/utils/PdsAsk.stories.js +1 -1
  49. package/public/assets/js/app.js.map +0 -7
  50. package/public/assets/js/lit.js.map +0 -7
  51. package/public/assets/js/pds.js.map +0 -7
@@ -6,81 +6,10 @@ import { attachStoryLinkHandlers } from '../utils/navigation.js';
6
6
  // Pre-load Shiki
7
7
  preloadShiki();
8
8
 
9
+ // Story-specific styles (not PDS classes - demo only)
9
10
  const iconStoryStyles = html`
10
11
  <style>
11
- .icon-story-section {
12
- padding: var(--spacing-4);
13
- display: grid;
14
- gap: var(--spacing-4);
15
- }
16
-
17
- .icon-story-grid {
18
- display: flex;
19
- gap: var(--spacing-3);
20
- flex-wrap: wrap;
21
- align-items: center;
22
- }
23
-
24
- .icon-story-size-grid {
25
- display: grid;
26
- gap: var(--spacing-4);
27
- grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
28
- }
29
-
30
- .icon-story-size-item {
31
- display: grid;
32
- gap: var(--spacing-2);
33
- text-align: center;
34
- justify-items: center;
35
- }
36
-
37
- .icon-story-filter {
38
- display: grid;
39
- justify-items: center;
40
- gap: var(--spacing-2);
41
- margin-bottom: var(--spacing-6);
42
- }
43
-
44
- .icon-story-filter__label {
45
- font-weight: 600;
46
- }
47
-
48
- .icon-story-filter__input {
49
- width: 100%;
50
- max-width: 400px;
51
- padding: var(--spacing-3);
52
- border: 1px solid var(--color-border);
53
- border-radius: var(--radius-md);
54
- font-size: 1rem;
55
- text-align: center;
56
- background: var(--color-surface);
57
- }
58
-
59
- .icon-category {
60
- display: grid;
61
- gap: var(--spacing-4);
62
- }
63
-
64
- .icon-category__title {
65
- text-transform: capitalize;
66
- display: flex;
67
- align-items: baseline;
68
- gap: var(--spacing-2);
69
- flex-wrap: wrap;
70
- }
71
-
72
- .icon-category__count {
73
- font-size: 0.85rem;
74
- font-weight: normal;
75
- opacity: 0.6;
76
- }
77
-
78
- .icon-category__grid {
79
- display: grid;
80
- grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
81
- gap: var(--spacing-3);
82
- }
83
-
12
+ /* Icon grid for AllIcons */
84
13
  .icon-item {
85
14
  display: flex;
86
15
  flex-direction: column;
@@ -91,52 +20,38 @@ const iconStoryStyles = html`
91
20
  cursor: pointer;
92
21
  transition: background-color 0.2s ease, color 0.2s ease;
93
22
  }
94
-
95
- .icon-item:hover {
96
- background: var(--surface-elevated);
97
- }
98
-
23
+ .icon-item:hover { background: var(--surface-elevated); }
99
24
  .icon-item--copied {
100
25
  animation: iconItemCopied 0.4s ease;
101
26
  background: var(--color-primary);
102
27
  color: var(--color-surface);
103
28
  }
104
-
105
- .icon-item__label {
106
- font-size: 0.75rem;
107
- text-align: center;
108
- word-break: break-word;
109
- opacity: 0.8;
110
- }
111
-
112
- .icon-story-usage {
113
- margin-top: var(--spacing-6);
114
- display: grid;
115
- gap: var(--spacing-3);
116
- }
117
-
118
- .icon-story-usage__code {
119
- margin: 0;
120
- padding: var(--spacing-3);
121
- background: var(--surface-bg);
122
- border-radius: var(--radius-sm);
123
- overflow-x: auto;
124
- }
125
-
126
29
  @keyframes iconItemCopied {
127
- 0% {
128
- transform: scale(1);
129
- }
130
- 50% {
131
- transform: scale(0.98);
132
- }
133
- 100% {
134
- transform: scale(1);
135
- }
30
+ 0% { transform: scale(1); }
31
+ 50% { transform: scale(0.98); }
32
+ 100% { transform: scale(1); }
136
33
  }
34
+ /* Layout & sections */
35
+ .story-section { padding: var(--spacing-4); }
36
+ .story-intro { font-size: var(--font-size-lg); }
37
+ .story-desc { font-size: var(--font-size-sm); }
38
+ /* Navigation grid */
39
+ .story-nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--spacing-4); }
40
+ /* Icon preview cards */
41
+ .story-icon-card { min-width: 80px; }
42
+ .story-icon-demo { max-width: 400px; text-align: center; margin: 0 auto; }
43
+ /* Category header */
44
+ .story-cat-header { margin-top: var(--spacing-4); }
45
+ /* Icon name display */
46
+ .story-icon-name { font-size: var(--font-size-xs); word-break: break-all; text-align: center; }
47
+ /* Status display */
48
+ .story-cache-status { max-height: 200px; overflow: auto; }
137
49
  </style>
138
50
  `;
139
51
 
52
+ // Alias for backwards compatibility
53
+ const iconGridStyles = iconStoryStyles;
54
+
140
55
  export default {
141
56
  title: 'Foundations/Icons',
142
57
  tags: ['icon', 'icons', 'svg', 'phosphor', 'graphic', 'symbol'],
@@ -158,13 +73,12 @@ export default {
158
73
 
159
74
  export const Overview = () => {
160
75
  const container = document.createElement('article');
161
- container.className = 'stack gap-lg';
162
- container.style.padding = 'var(--spacing-4)';
76
+ container.className = 'stack gap-lg story-section';
163
77
 
164
78
  container.innerHTML = /*html*/`
165
79
  <header>
166
80
  <h2>PDS Icon System</h2>
167
- <p class="text-lg">PDS ships a simple, sprite-based icon solution and a lightweight <code>&lt;pds-icon&gt;</code> web component.</p>
81
+ <p class="story-intro">PDS ships a simple, sprite-based icon solution and a lightweight <code>&lt;pds-icon&gt;</code> web component.</p>
168
82
  </header>
169
83
 
170
84
  <section class="card">
@@ -289,7 +203,7 @@ export const Overview = () => {
289
203
  <h3>Customizing Icons</h3>
290
204
  <p>Extend or override the default icon categories in your <code>pds.config.js</code>:</p>
291
205
  <div class="code-customize"></div>
292
- <p class="text-muted text-sm" style="margin-top: var(--spacing-2);">
206
+ <p class="text-muted story-desc">
293
207
  The <code>include</code> object defines which icons are bundled into the sprite. Categories are:
294
208
  <code>navigation</code>, <code>actions</code>, <code>communication</code>, <code>content</code>,
295
209
  <code>status</code>, <code>time</code>, <code>commerce</code>, <code>formatting</code>, <code>system</code>.
@@ -302,12 +216,12 @@ export const Overview = () => {
302
216
  <h4><code>pds:build-icons</code></h4>
303
217
  <p>Regenerate the sprite after changing your icon selection:</p>
304
218
  <div class="code-build-icons"></div>
305
- <p class="text-muted text-sm">Reads <code>design.icons.include</code> from config and generates the sprite at <code>spritePath</code>.</p>
219
+ <p class="text-muted story-desc">Reads <code>design.icons.include</code> from config and generates the sprite at <code>spritePath</code>.</p>
306
220
 
307
221
  <h4><code>pds:export</code></h4>
308
222
  <p>Export PDS assets (including icons) to your project's static folder:</p>
309
223
  <div class="code-export"></div>
310
- <p class="text-muted text-sm">Copies the sprite to <code>[config.static.root]/icons/pds-icons.svg</code> for production use.</p>
224
+ <p class="text-muted story-desc">Copies the sprite to <code>[config.static.root]/icons/pds-icons.svg</code> for production use.</p>
311
225
  </section>
312
226
 
313
227
  <section class="card">
@@ -356,26 +270,26 @@ export const Overview = () => {
356
270
 
357
271
  <section>
358
272
  <h3>Explore</h3>
359
- <div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--spacing-md);">
273
+ <div class="grid grid-auto-sm gap-md">
360
274
  <a data-story-link="foundations-icons--common-icons" class="card card-interactive">
361
275
  <h4>Common Icons</h4>
362
- <p class="text-muted text-sm">Most frequently used icons</p>
276
+ <p class="text-muted story-desc">Most frequently used icons</p>
363
277
  </a>
364
278
  <a data-story-link="foundations-icons--icon-sizes" class="card card-interactive">
365
279
  <h4>Icon Sizes</h4>
366
- <p class="text-muted text-sm">Size scale from xs to 2xl</p>
280
+ <p class="text-muted story-desc">Size scale from xs to 2xl</p>
367
281
  </a>
368
282
  <a data-story-link="foundations-icons--colored-icons" class="card card-interactive">
369
283
  <h4>Colored Icons</h4>
370
- <p class="text-muted text-sm">Color customization options</p>
284
+ <p class="text-muted story-desc">Color customization options</p>
371
285
  </a>
372
286
  <a data-story-link="foundations-icons--all-icons" class="card card-interactive">
373
287
  <h4>All Icons</h4>
374
- <p class="text-muted text-sm">Browse full icon library</p>
288
+ <p class="text-muted story-desc">Browse full icon library</p>
375
289
  </a>
376
290
  <a data-story-link="foundations-icons--external-icons" class="card card-interactive">
377
291
  <h4>External Icons</h4>
378
- <p class="text-muted text-sm">On-demand loading demo</p>
292
+ <p class="text-muted story-desc">On-demand loading demo</p>
379
293
  </a>
380
294
  </div>
381
295
  </section>
@@ -476,15 +390,12 @@ Overview.storyName = 'Overview';
476
390
  // ============================================================================
477
391
 
478
392
  export const CommonIcons = () => html`
479
- ${iconStoryStyles}
480
- <section class="icon-story-section">
393
+ <section class="stack-lg story-section">
481
394
  <header>
482
395
  <h3>Common Icons</h3>
483
- <small class="text-muted">
484
- Frequently used icons for everyday UI needs
485
- </small>
396
+ <small class="text-muted">Frequently used icons for everyday UI needs</small>
486
397
  </header>
487
- <div class="icon-story-grid">
398
+ <div class="flex gap-md flex-wrap items-center">
488
399
  <pds-icon icon="heart" size="lg"></pds-icon>
489
400
  <pds-icon icon="star" size="lg"></pds-icon>
490
401
  <pds-icon icon="user" size="lg"></pds-icon>
@@ -502,36 +413,33 @@ export const CommonIcons = () => html`
502
413
  CommonIcons.storyName = 'Common Icons';
503
414
 
504
415
  export const IconSizes = () => html`
505
- ${iconStoryStyles}
506
- <section class="icon-story-section">
416
+ <section class="stack-lg story-section">
507
417
  <header>
508
418
  <h3>Icon Sizes</h3>
509
- <small class="text-muted">
510
- Built-in sizing scale keeps visual hierarchy consistent across the UI.
511
- </small>
419
+ <small class="text-muted">Built-in sizing scale keeps visual hierarchy consistent across the UI.</small>
512
420
  </header>
513
- <div class="icon-story-size-grid">
514
- <div class="icon-story-size-item">
421
+ <div class="grid grid-auto-sm gap-lg">
422
+ <div class="stack-sm text-center items-center">
515
423
  <pds-icon icon="heart" size="xs"></pds-icon>
516
424
  <small class="text-muted">xs (16px)</small>
517
425
  </div>
518
- <div class="icon-story-size-item">
426
+ <div class="stack-sm text-center items-center">
519
427
  <pds-icon icon="heart" size="sm"></pds-icon>
520
428
  <small class="text-muted">sm (20px)</small>
521
429
  </div>
522
- <div class="icon-story-size-item">
430
+ <div class="stack-sm text-center items-center">
523
431
  <pds-icon icon="heart" size="md"></pds-icon>
524
432
  <small class="text-muted">md (24px)</small>
525
433
  </div>
526
- <div class="icon-story-size-item">
434
+ <div class="stack-sm text-center items-center">
527
435
  <pds-icon icon="heart" size="lg"></pds-icon>
528
436
  <small class="text-muted">lg (32px)</small>
529
437
  </div>
530
- <div class="icon-story-size-item">
438
+ <div class="stack-sm text-center items-center">
531
439
  <pds-icon icon="heart" size="xl"></pds-icon>
532
440
  <small class="text-muted">xl (48px)</small>
533
441
  </div>
534
- <div class="icon-story-size-item">
442
+ <div class="stack-sm text-center items-center">
535
443
  <pds-icon icon="heart" size="2xl"></pds-icon>
536
444
  <small class="text-muted">2xl (64px)</small>
537
445
  </div>
@@ -542,18 +450,15 @@ export const IconSizes = () => html`
542
450
  IconSizes.storyName = 'Icon Sizes';
543
451
 
544
452
  export const ColoredIcons = () => html`
545
- ${iconStoryStyles}
546
- <section class="icon-story-section">
453
+ <section class="stack-lg story-section">
547
454
  <header>
548
455
  <h3>Colored Icons</h3>
549
- <small class="text-muted">
550
- Icons inherit <code>currentColor</code> by default, or can be explicitly colored using the <code>color</code> attribute.
551
- </small>
456
+ <small class="text-muted">Icons inherit <code>currentColor</code> by default, or can be explicitly colored using the <code>color</code> attribute.</small>
552
457
  </header>
553
458
 
554
- <article class="card">
459
+ <article class="card stack-md">
555
460
  <h4>Using CSS Color Values</h4>
556
- <div class="icon-story-grid">
461
+ <div class="flex gap-md flex-wrap items-center">
557
462
  <pds-icon icon="heart" size="lg" color="red"></pds-icon>
558
463
  <pds-icon icon="star" size="lg" color="gold"></pds-icon>
559
464
  <pds-icon icon="check" size="lg" color="green"></pds-icon>
@@ -562,10 +467,10 @@ export const ColoredIcons = () => html`
562
467
  </div>
563
468
  </article>
564
469
 
565
- <article class="card">
470
+ <article class="card stack-md">
566
471
  <h4>Using Design Tokens</h4>
567
- <p class="text-muted text-sm">Recommended approach for consistent theming.</p>
568
- <div class="icon-story-grid">
472
+ <p class="text-muted story-desc">Recommended approach for consistent theming.</p>
473
+ <div class="flex gap-md flex-wrap items-center">
569
474
  <pds-icon icon="heart" size="lg" color="var(--color-primary-500)"></pds-icon>
570
475
  <pds-icon icon="star" size="lg" color="var(--color-accent-500)"></pds-icon>
571
476
  <pds-icon icon="check-circle" size="lg" color="var(--color-success-500)"></pds-icon>
@@ -574,38 +479,38 @@ export const ColoredIcons = () => html`
574
479
  </div>
575
480
  </article>
576
481
 
577
- <article class="card">
482
+ <article class="card stack-md">
578
483
  <h4>Inheriting from Parent</h4>
579
- <p class="text-muted text-sm">Icons use <code>currentColor</code> by default, inheriting text color.</p>
580
- <div class="icon-story-grid">
581
- <span style="color: var(--color-primary-500);">
484
+ <p class="text-muted story-desc">Icons use <code>currentColor</code> by default, inheriting text color.</p>
485
+ <div class="flex gap-md flex-wrap items-center">
486
+ <span class="flex gap-sm items-center text-primary">
582
487
  <pds-icon icon="envelope" size="lg"></pds-icon>
583
488
  Primary text with icon
584
489
  </span>
585
- <span style="color: var(--color-success-500);">
490
+ <span class="flex gap-sm items-center text-success">
586
491
  <pds-icon icon="check" size="lg"></pds-icon>
587
492
  Success message
588
493
  </span>
589
- <span style="color: var(--color-error-500);">
494
+ <span class="flex gap-sm items-center text-danger">
590
495
  <pds-icon icon="warning" size="lg"></pds-icon>
591
496
  Error state
592
497
  </span>
593
498
  </div>
594
499
  </article>
595
500
 
596
- <div class="icon-story-usage">
501
+ <article class="card surface-elevated stack-md">
597
502
  <h4>Usage</h4>
598
- <pre class="icon-story-usage__code"><code>&lt;!-- Named CSS color --&gt;
503
+ <pre><code>&lt;!-- Named CSS color --&gt;
599
504
  &lt;pds-icon icon="heart" color="red"&gt;&lt;/pds-icon&gt;
600
505
 
601
506
  &lt;!-- Design token (recommended) --&gt;
602
507
  &lt;pds-icon icon="check" color="var(--color-success-500)"&gt;&lt;/pds-icon&gt;
603
508
 
604
509
  &lt;!-- Inherit from parent --&gt;
605
- &lt;span style="color: var(--color-primary-500);"&gt;
510
+ &lt;span class="text-primary"&gt;
606
511
  &lt;pds-icon icon="star"&gt;&lt;/pds-icon&gt; Rating
607
512
  &lt;/span&gt;</code></pre>
608
- </div>
513
+ </article>
609
514
  </section>
610
515
  `;
611
516
 
@@ -615,24 +520,22 @@ export const AllIcons = () => {
615
520
  const iconConfig = presets.default.icons.include;
616
521
 
617
522
  return html`
618
- ${iconStoryStyles}
619
- <section class="icon-story-section">
523
+ ${iconGridStyles}
524
+ <section class="stack-lg story-section">
620
525
  <header>
621
526
  <h2>All Available Icons</h2>
622
- <small class="text-muted">
623
- Complete icon set from Phosphor Icons, organized by category. Click any icon name to copy it to clipboard.
624
- </small>
527
+ <small class="text-muted">Complete icon set from Phosphor Icons, organized by category. Click any icon name to copy it to clipboard.</small>
625
528
  </header>
626
529
 
627
- <div class="icon-story-filter">
628
- <span class="icon-story-filter__label" data-label>Filter icons</span>
530
+ <label class="stack-sm text-center">
531
+ <span class="text-semibold">Filter icons</span>
629
532
  <input
630
- class="icon-story-filter__input"
631
533
  type="search"
632
534
  placeholder="Type to filter..."
535
+ class="story-icon-demo"
633
536
  @input="${(event) => {
634
537
  const searchTerm = event.target.value.toLowerCase();
635
- const storyRoot = event.target.closest('.icon-story-section');
538
+ const storyRoot = event.target.closest('section');
636
539
  const categories = storyRoot?.querySelectorAll('.icon-category');
637
540
 
638
541
  categories?.forEach((category) => {
@@ -653,17 +556,17 @@ export const AllIcons = () => {
653
556
  });
654
557
  }}"
655
558
  />
656
- </div>
559
+ </label>
657
560
 
658
561
  ${Object.entries(iconConfig).map(
659
562
  ([category, icons]) => html`
660
- <article class="card icon-category">
661
- <h3 class="icon-category__title">
563
+ <article class="card stack-lg icon-category">
564
+ <h3 class="flex items-baseline gap-sm flex-wrap story-cat-header">
662
565
  ${category.replace(/([A-Z])/g, ' $1').trim()}
663
- <span class="icon-category__count">(${icons.length} icons)</span>
566
+ <span class="text-muted story-desc">(${icons.length} icons)</span>
664
567
  </h3>
665
568
 
666
- <div class="icon-category__grid">
569
+ <div class="grid grid-auto-sm gap-md">
667
570
  ${icons.map(
668
571
  (icon) => html`
669
572
  <div
@@ -679,7 +582,7 @@ export const AllIcons = () => {
679
582
  }}"
680
583
  >
681
584
  <pds-icon icon="${icon}" size="lg"></pds-icon>
682
- <span class="icon-item__label">${icon}</span>
585
+ <small class="text-muted story-icon-name">${icon}</small>
683
586
  </div>
684
587
  `
685
588
  )}
@@ -688,9 +591,9 @@ export const AllIcons = () => {
688
591
  `
689
592
  )}
690
593
 
691
- <article class="card surface-elevated icon-story-usage">
594
+ <article class="card surface-elevated stack-md">
692
595
  <h4>Usage</h4>
693
- <pre class="icon-story-usage__code"><code>&lt;pds-icon icon="heart" size="lg"&gt;&lt;/pds-icon&gt;
596
+ <pre><code>&lt;pds-icon icon="heart" size="lg"&gt;&lt;/pds-icon&gt;
694
597
  &lt;pds-icon icon="star" size="md"&gt;&lt;/pds-icon&gt;
695
598
  &lt;pds-icon icon="user" size="sm"&gt;&lt;/pds-icon&gt;</code></pre>
696
599
  </article>
@@ -707,69 +610,7 @@ AllIcons.storyName = 'All Icons';
707
610
  * fetch individual SVG files from a configurable external path.
708
611
  */
709
612
  export const ExternalIcons = () => html`
710
- ${iconStoryStyles}
711
- <style>
712
- .external-icon-demo {
713
- display: grid;
714
- gap: var(--spacing-6);
715
- }
716
-
717
- .external-icon-showcase {
718
- display: flex;
719
- gap: var(--spacing-4);
720
- align-items: center;
721
- flex-wrap: wrap;
722
- }
723
-
724
- .external-icon-card {
725
- display: flex;
726
- flex-direction: column;
727
- align-items: center;
728
- gap: var(--spacing-2);
729
- padding: var(--spacing-4);
730
- border-radius: var(--radius-md);
731
- background: var(--surface-elevated-bg);
732
- min-width: 100px;
733
- }
734
-
735
- .external-icon-card__label {
736
- font-size: 0.75rem;
737
- text-align: center;
738
- opacity: 0.7;
739
- }
740
-
741
- .cache-status {
742
- padding: var(--spacing-4);
743
- border-radius: var(--radius-md);
744
- background: var(--surface-bg);
745
- font-family: var(--font-mono);
746
- font-size: 0.85rem;
747
- white-space: pre-wrap;
748
- max-height: 200px;
749
- overflow: auto;
750
- }
751
-
752
- .comparison-grid {
753
- display: grid;
754
- grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
755
- gap: var(--spacing-4);
756
- }
757
-
758
- .comparison-card {
759
- padding: var(--spacing-4);
760
- border-radius: var(--radius-md);
761
- background: var(--surface-elevated-bg);
762
- }
763
-
764
- .comparison-card h4 {
765
- margin: 0 0 var(--spacing-3) 0;
766
- display: flex;
767
- align-items: center;
768
- gap: var(--spacing-2);
769
- }
770
- </style>
771
-
772
- <section class="icon-story-section external-icon-demo">
613
+ <section class="stack-lg story-section">
773
614
  <header>
774
615
  <h2>External Icons (On-Demand Loading)</h2>
775
616
  <p class="text-muted">
@@ -779,121 +620,115 @@ export const ExternalIcons = () => html`
779
620
  </p>
780
621
  </header>
781
622
 
782
- <article class="card">
623
+ <article class="card stack-md">
783
624
  <h3>How It Works</h3>
784
- <div class="comparison-grid">
785
- <div class="comparison-card">
786
- <h4><pds-icon icon="lightning" size="sm"></pds-icon> Sprite Icons (Fast)</h4>
787
- <p class="text-muted" style="margin: 0;">
788
- Core icons bundled in the sprite sheet load instantly with a single HTTP request.
789
- </p>
790
- <div class="external-icon-showcase" style="margin-top: var(--spacing-3);">
625
+ <div class="grid grid-auto-md gap-lg">
626
+ <article class="card surface-elevated stack-md">
627
+ <h4 class="flex items-center gap-sm"><pds-icon icon="lightning" size="sm"></pds-icon> Sprite Icons (Fast)</h4>
628
+ <p class="text-muted">Core icons bundled in the sprite sheet load instantly with a single HTTP request.</p>
629
+ <div class="flex gap-lg flex-wrap items-center">
791
630
  <pds-icon icon="house" size="lg"></pds-icon>
792
631
  <pds-icon icon="gear" size="lg"></pds-icon>
793
632
  <pds-icon icon="heart" size="lg"></pds-icon>
794
633
  <pds-icon icon="star" size="lg"></pds-icon>
795
634
  </div>
796
- </div>
635
+ </article>
797
636
 
798
- <div class="comparison-card">
799
- <h4><pds-icon icon="cloud-arrow-down" size="sm"></pds-icon> External Icons (On-Demand)</h4>
800
- <p class="text-muted" style="margin: 0;">
801
- More 'exotic' icons are fetched individually, then cached for subsequent use.
802
- </p>
803
- <div class="external-icon-showcase" style="margin-top: var(--spacing-3);">
637
+ <article class="card surface-elevated stack-md">
638
+ <h4 class="flex items-center gap-sm"><pds-icon icon="cloud-arrow-down" size="sm"></pds-icon> External Icons (On-Demand)</h4>
639
+ <p class="text-muted">More 'exotic' icons are fetched individually, then cached for subsequent use.</p>
640
+ <div class="flex gap-lg flex-wrap items-center">
804
641
  <pds-icon icon="solid-anatomy-brain-1" size="lg" color="var(--color-primary-500)"></pds-icon>
805
642
  <pds-icon icon="solid-anatomy-hand-bones" size="lg" color="var(--color-accent-500)"></pds-icon>
806
643
  <pds-icon icon="solid-conditions-lung-condition-2" size="lg" color="var(--color-success-500)"></pds-icon>
807
644
  </div>
808
- </div>
645
+ </article>
809
646
  </div>
810
647
  </article>
811
648
 
812
- <article class="card">
649
+ <article class="card stack-md">
813
650
  <h3>External Icon Sizes</h3>
814
651
  <p class="text-muted">External icons respect all standard size tokens.</p>
815
- <div class="icon-story-size-grid">
816
- <div class="icon-story-size-item">
652
+ <div class="grid grid-auto-sm gap-lg">
653
+ <div class="stack-sm text-center items-center">
817
654
  <pds-icon icon="solid-anatomy-brain-1" size="xs"></pds-icon>
818
655
  <small class="text-muted">xs (16px)</small>
819
656
  </div>
820
- <div class="icon-story-size-item">
657
+ <div class="stack-sm text-center items-center">
821
658
  <pds-icon icon="solid-anatomy-brain-1" size="sm"></pds-icon>
822
659
  <small class="text-muted">sm (20px)</small>
823
660
  </div>
824
- <div class="icon-story-size-item">
661
+ <div class="stack-sm text-center items-center">
825
662
  <pds-icon icon="solid-anatomy-brain-1" size="md"></pds-icon>
826
663
  <small class="text-muted">md (24px)</small>
827
664
  </div>
828
- <div class="icon-story-size-item">
665
+ <div class="stack-sm text-center items-center">
829
666
  <pds-icon icon="solid-anatomy-brain-1" size="lg"></pds-icon>
830
667
  <small class="text-muted">lg (32px)</small>
831
668
  </div>
832
- <div class="icon-story-size-item">
669
+ <div class="stack-sm text-center items-center">
833
670
  <pds-icon icon="solid-anatomy-brain-1" size="xl"></pds-icon>
834
671
  <small class="text-muted">xl (48px)</small>
835
672
  </div>
836
- <div class="icon-story-size-item">
673
+ <div class="stack-sm text-center items-center">
837
674
  <pds-icon icon="solid-anatomy-brain-1" size="2xl"></pds-icon>
838
675
  <small class="text-muted">2xl (64px)</small>
839
676
  </div>
840
677
  </div>
841
678
  </article>
842
679
 
843
- <article class="card">
680
+ <article class="card stack-md">
844
681
  <h3>Color Inheritance</h3>
845
682
  <p class="text-muted">External icons support color customization just like sprite icons.</p>
846
- <div class="external-icon-showcase">
847
- <div class="external-icon-card">
683
+ <div class="flex gap-lg flex-wrap items-center">
684
+ <div class="card surface-elevated stack-sm text-center items-center story-icon-card">
848
685
  <pds-icon icon="solid-anatomy-brain-1" size="xl" color="var(--color-primary-500)"></pds-icon>
849
- <span class="external-icon-card__label">Primary</span>
686
+ <small class="text-muted">Primary</small>
850
687
  </div>
851
- <div class="external-icon-card">
688
+ <div class="card surface-elevated stack-sm text-center items-center story-icon-card">
852
689
  <pds-icon icon="solid-anatomy-hand-bones" size="xl" color="var(--color-accent-500)"></pds-icon>
853
- <span class="external-icon-card__label">Accent</span>
690
+ <small class="text-muted">Accent</small>
854
691
  </div>
855
- <div class="external-icon-card">
692
+ <div class="card surface-elevated stack-sm text-center items-center story-icon-card">
856
693
  <pds-icon icon="solid-conditions-lung-condition-2" size="xl" color="var(--color-success-500)"></pds-icon>
857
- <span class="external-icon-card__label">Success</span>
694
+ <small class="text-muted">Success</small>
858
695
  </div>
859
- <div class="external-icon-card">
696
+ <div class="card surface-elevated stack-sm text-center items-center story-icon-card">
860
697
  <pds-icon icon="solid-anatomy-brain-1" size="xl" color="var(--color-warning-500)"></pds-icon>
861
- <span class="external-icon-card__label">Warning</span>
698
+ <small class="text-muted">Warning</small>
862
699
  </div>
863
- <div class="external-icon-card">
700
+ <div class="card surface-elevated stack-sm text-center items-center story-icon-card">
864
701
  <pds-icon icon="solid-anatomy-hand-bones" size="xl" color="var(--color-error-500)"></pds-icon>
865
- <span class="external-icon-card__label">Error</span>
702
+ <small class="text-muted">Error</small>
866
703
  </div>
867
704
  </div>
868
705
  </article>
869
706
 
870
- <article class="card">
707
+ <article class="card stack-md">
871
708
  <h3>Fallback Behavior</h3>
872
709
  <p class="text-muted">
873
710
  When an icon isn't found in the sprite <em>or</em> the external path,
874
711
  a fallback "missing" icon is shown.
875
712
  </p>
876
- <div class="external-icon-showcase">
877
- <div class="external-icon-card">
713
+ <div class="flex gap-lg">
714
+ <div class="card surface-elevated stack-sm text-center items-center story-icon-card">
878
715
  <pds-icon icon="this-icon-does-not-exist" size="xl"></pds-icon>
879
- <span class="external-icon-card__label">Missing icon</span>
716
+ <small class="text-muted">Missing icon</small>
880
717
  </div>
881
718
  </div>
882
719
  </article>
883
720
 
884
- <article class="card">
721
+ <article class="card stack-md">
885
722
  <h3>Cache Inspector</h3>
886
- <p class="text-muted">
887
- Click the button to inspect the current external icon cache state.
888
- </p>
723
+ <p class="text-muted">Click the button to inspect the current external icon cache state.</p>
889
724
  <button class="btn-secondary" id="check-cache-btn">Check External Icon Cache</button>
890
- <pre class="cache-status" id="cache-status">Click the button to see cache contents...</pre>
725
+ <pre id="cache-status" class="story-cache-status">Click the button to see cache contents...</pre>
891
726
  </article>
892
727
 
893
- <article class="card surface-elevated">
728
+ <article class="card surface-elevated stack-md">
894
729
  <h4>Configuration</h4>
895
730
  <p class="text-muted">Configure the external icons path in <code>pds.config.js</code>:</p>
896
- <pre class="icon-story-usage__code"><code>export const config = {
731
+ <pre><code>export const config = {
897
732
  design: {
898
733
  icons: {
899
734
  externalPath: "/assets/img/icons/", // Path for on-demand SVG icons
@@ -902,9 +737,9 @@ export const ExternalIcons = () => html`
902
737
  };</code></pre>
903
738
  </article>
904
739
 
905
- <article class="card surface-elevated">
740
+ <article class="card surface-elevated stack-md">
906
741
  <h4>Usage</h4>
907
- <pre class="icon-story-usage__code"><code>&lt;!-- Sprite icon (instant from cache) --&gt;
742
+ <pre><code>&lt;!-- Sprite icon (instant from cache) --&gt;
908
743
  &lt;pds-icon icon="house" size="lg"&gt;&lt;/pds-icon&gt;
909
744
 
910
745
  &lt;!-- External icon (fetched from /assets/img/icons/my-custom-icon.svg) --&gt;