@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
@@ -19,31 +19,42 @@ export default {
19
19
  const cardsStoryStyles = html`
20
20
  <style>
21
21
  /* Demo-specific gradient backgrounds */
22
- .cards-gradient-one {
22
+ .story-cards-gradient-one {
23
23
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-secondary-500));
24
24
  }
25
- .cards-gradient-two {
25
+ .story-cards-gradient-two {
26
26
  background: linear-gradient(135deg, var(--color-secondary-500), var(--color-primary-500));
27
27
  }
28
- .cards-gradient-three {
28
+ .story-cards-gradient-three {
29
29
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-accent-500));
30
30
  }
31
31
  /* Demo placeholder dimensions */
32
- .cards-placeholder {
32
+ .story-cards-placeholder {
33
33
  height: 100px;
34
34
  border-radius: var(--radius-sm);
35
35
  }
36
- .cards-avatar-placeholder {
36
+ .story-cards-avatar-placeholder {
37
37
  width: 48px;
38
38
  height: 48px;
39
39
  border-radius: var(--radius-full);
40
40
  }
41
- .cards-media-placeholder {
41
+ .story-cards-media-placeholder {
42
42
  flex-shrink: 0;
43
43
  width: 7.5rem;
44
44
  height: 7.5rem;
45
45
  border-radius: var(--radius-md);
46
46
  }
47
+ /* Stats card */
48
+ .story-stat-number {
49
+ font-size: var(--font-size-2xl);
50
+ font-weight: var(--font-weight-bold);
51
+ }
52
+ .story-stat-primary {
53
+ color: var(--color-primary-600);
54
+ }
55
+ .story-stat-secondary {
56
+ color: var(--color-secondary-600);
57
+ }
47
58
  </style>
48
59
  `;
49
60
 
@@ -167,17 +178,17 @@ export const CardLayouts = () => html`
167
178
  <h3>Card Grid</h3>
168
179
  <div class="grid grid-auto-sm gap-sm">
169
180
  <article class="card stack-md">
170
- <div class="cards-gradient-one cards-placeholder"></div>
181
+ <div class="story-cards-gradient-one cards-placeholder"></div>
171
182
  <h4>Card 1</h4>
172
183
  <small>Grid layout with cards.</small>
173
184
  </article>
174
185
  <article class="card stack-md">
175
- <div class="cards-gradient-two cards-placeholder"></div>
186
+ <div class="story-cards-gradient-two cards-placeholder"></div>
176
187
  <h4>Card 2</h4>
177
188
  <small>Responsive and flexible.</small>
178
189
  </article>
179
190
  <article class="card stack-md">
180
- <div class="cards-gradient-three cards-placeholder"></div>
191
+ <div class="story-cards-gradient-three cards-placeholder"></div>
181
192
  <h4>Card 3</h4>
182
193
  <small>Auto-fits to space.</small>
183
194
  </article>
@@ -232,11 +243,11 @@ export const ComplexCards = () => html`
232
243
  <h4>Stats Card</h4>
233
244
  <div class="grid grid-cols-2 gap-md">
234
245
  <div>
235
- <div class="text-2xl font-bold text-primary">1.2K</div>
246
+ <div class="story-stat-number story-stat-primary">1.2K</div>
236
247
  <small class="text-muted">Followers</small>
237
248
  </div>
238
249
  <div>
239
- <div class="text-2xl font-bold text-secondary">847</div>
250
+ <div class="story-stat-number story-stat-secondary">847</div>
240
251
  <small class="text-muted">Following</small>
241
252
  </div>
242
253
  </div>
@@ -1,6 +1,13 @@
1
1
  import { html } from 'lit';
2
2
  import { toastFormData } from '../utils/toast-utils.js';
3
3
 
4
+ // Story-specific styles (not PDS classes - demo only)
5
+ const formsStoryStyles = html`
6
+ <style>
7
+ .story-form-max { max-width: 24rem; }
8
+ </style>
9
+ `;
10
+
4
11
  export default {
5
12
  title: 'Primitives/Forms',
6
13
  tags: ['buttons', 'forms'],
@@ -44,21 +51,22 @@ export const Default = {
44
51
  };
45
52
 
46
53
  return html`
54
+ ${formsStoryStyles}
47
55
  <div class="card">
48
- <form class="max-w-sm" @submit=${handleSubmit}>
56
+ <form class="story-form-max" @submit=${handleSubmit}>
49
57
  <label>
50
- <span>Text Input</span>
58
+ <span data-label>Text Input</span>
51
59
  <input type="text" name="text" placeholder="Enter text...">
52
60
  </label>
53
61
  <label>
54
- <span>Email</span>
62
+ <span data-label>Email</span>
55
63
  <div class="input-icon">
56
64
  <pds-icon icon="envelope"></pds-icon>
57
65
  <input type="email" name="email" required placeholder="email@example.com">
58
66
  </div>
59
67
  </label>
60
68
  <label>
61
- <span>Select</span>
69
+ <span data-label>Select</span>
62
70
  <select name="select">
63
71
  <option>Option 1</option>
64
72
  <option>Option 2</option>
@@ -66,7 +74,7 @@ export const Default = {
66
74
  </select>
67
75
  </label>
68
76
  <label>
69
- <span>Textarea</span>
77
+ <span data-label>Textarea</span>
70
78
  <textarea name="textarea" rows="4" placeholder="Enter longer text..."></textarea>
71
79
  </label>
72
80
  <button type="submit" class="btn-primary">Submit</button>
@@ -82,13 +90,14 @@ export const Default = {
82
90
  export const InputsWithIcons = {
83
91
  render: (args) => {
84
92
  return html`
93
+ ${formsStoryStyles}
85
94
  <div class="card stack-md">
86
95
  <h3>Inputs with Icons</h3>
87
96
  <p>Enhance inputs with icons for better UX. Icons can be positioned at the start or end of the input.</p>
88
97
 
89
- <div class="flex flex-col gap-lg max-w-sm">
98
+ <div class="stack-lg story-form-max">
90
99
  <label>
91
- <span>Search (Icon Start)</span>
100
+ <span data-label>Search (Icon Start)</span>
92
101
  <div class="input-icon">
93
102
  <pds-icon icon="magnifying-glass"></pds-icon>
94
103
  <input type="search" placeholder="Search..." />
@@ -96,7 +105,7 @@ export const InputsWithIcons = {
96
105
  </label>
97
106
 
98
107
  <label>
99
- <span>Username (Icon End)</span>
108
+ <span data-label>Username (Icon End)</span>
100
109
  <div class="input-icon input-icon-end">
101
110
  <input type="text" placeholder="Username" />
102
111
  <pds-icon icon="user"></pds-icon>
@@ -15,13 +15,21 @@ export default {
15
15
  }
16
16
  };
17
17
 
18
- // Minimal story-specific styles - only for demo-specific visuals not covered by PDS
18
+ // Story-specific styles - only for demo-specific visuals not covered by PDS
19
19
  const mediaStoryStyles = html`
20
20
  <style>
21
21
  /* Video shell max-width constraint */
22
- .media-video-shell {
22
+ .story-media-video-shell {
23
23
  max-width: 56.25rem;
24
24
  }
25
+ /* Violations fixed */
26
+ .story-img-full-width {
27
+ width: 100%;
28
+ }
29
+ .story-img-circle {
30
+ width: 200px;
31
+ aspect-ratio: 1;
32
+ }
25
33
  </style>
26
34
  `;
27
35
 
@@ -112,8 +120,7 @@ export const ImageRoundedUtilities = () => html`
112
120
  <img
113
121
  src="https://picsum.photos/300/200?random=40"
114
122
  alt="Small radius"
115
- class="img-rounded-sm"
116
- style="width: 100%;"
123
+ class="img-rounded-sm story-img-full-width"
117
124
  />
118
125
  <figcaption><code>.img-rounded-sm</code></figcaption>
119
126
  </figure>
@@ -122,8 +129,7 @@ export const ImageRoundedUtilities = () => html`
122
129
  <img
123
130
  src="https://picsum.photos/300/200?random=41"
124
131
  alt="Medium radius"
125
- class="img-rounded-md"
126
- style="width: 100%;"
132
+ class="img-rounded-md story-img-full-width"
127
133
  />
128
134
  <figcaption><code>.img-rounded-md</code></figcaption>
129
135
  </figure>
@@ -132,8 +138,7 @@ export const ImageRoundedUtilities = () => html`
132
138
  <img
133
139
  src="https://picsum.photos/300/200?random=42"
134
140
  alt="Large radius"
135
- class="img-rounded-lg"
136
- style="width: 100%;"
141
+ class="img-rounded-lg story-img-full-width"
137
142
  />
138
143
  <figcaption><code>.img-rounded-lg</code></figcaption>
139
144
  </figure>
@@ -142,8 +147,7 @@ export const ImageRoundedUtilities = () => html`
142
147
  <img
143
148
  src="https://picsum.photos/300/200?random=43"
144
149
  alt="Extra large radius"
145
- class="img-rounded-xl"
146
- style="width: 100%;"
150
+ class="img-rounded-xl story-img-full-width"
147
151
  />
148
152
  <figcaption><code>.img-rounded-xl</code></figcaption>
149
153
  </figure>
@@ -152,8 +156,7 @@ export const ImageRoundedUtilities = () => html`
152
156
  <img
153
157
  src="https://picsum.photos/200/200?random=44"
154
158
  alt="Full radius (circle)"
155
- class="img-rounded-full"
156
- style="width: 200px; aspect-ratio: 1;"
159
+ class="img-rounded-full story-img-circle"
157
160
  />
158
161
  <figcaption><code>.img-rounded-full</code></figcaption>
159
162
  </figure>
@@ -195,26 +198,26 @@ export const InlineImages = () => html`
195
198
  <div class="card stack-md">
196
199
  <p>
197
200
  The team includes
198
- <img src="https://i.pravatar.cc/60?img=1" alt="Alice" class="img-inline" />
201
+ <img src="https://i.pravatar.cc/60?img=1" alt="Alice" class="story-img-inline" />
199
202
  Alice,
200
- <img src="https://i.pravatar.cc/60?img=2" alt="Bob" class="img-inline" />
203
+ <img src="https://i.pravatar.cc/60?img=2" alt="Bob" class="story-img-inline" />
201
204
  Bob, and
202
- <img src="https://i.pravatar.cc/60?img=3" alt="Carol" class="img-inline" />
205
+ <img src="https://i.pravatar.cc/60?img=3" alt="Carol" class="story-img-inline" />
203
206
  Carol who have been working on this project.
204
207
  </p>
205
208
 
206
209
  <p>
207
210
  Click the
208
- <img src="https://picsum.photos/60/60?random=60" alt="Settings icon" class="img-inline" />
211
+ <img src="https://picsum.photos/60/60?random=60" alt="Settings icon" class="story-img-inline" />
209
212
  icon to access settings, or the
210
- <img src="https://picsum.photos/60/60?random=61" alt="Help icon" class="img-inline" />
213
+ <img src="https://picsum.photos/60/60?random=61" alt="Help icon" class="story-img-inline" />
211
214
  icon for help.
212
215
  </p>
213
216
  </div>
214
217
 
215
218
  <div class="card">
216
219
  <h3>CSS Properties</h3>
217
- <pre><code>.img-inline {
220
+ <pre><code>.story-img-inline {
218
221
  display: inline;
219
222
  vertical-align: middle;
220
223
  border-radius: var(--radius-xs);
@@ -236,7 +239,7 @@ export const VideoResponsive = () => html`
236
239
  </div>
237
240
 
238
241
  <video
239
- class="video-responsive"
242
+ class="story-video-responsive"
240
243
  controls
241
244
  poster="https://picsum.photos/600/338?random=70"
242
245
  >
@@ -249,7 +252,7 @@ export const VideoResponsive = () => html`
249
252
 
250
253
  <div class="card">
251
254
  <h3>CSS Properties</h3>
252
- <pre><code>.video-responsive {
255
+ <pre><code>.story-video-responsive {
253
256
  width: 100%;
254
257
  max-width: 600px;
255
258
  height: auto;
@@ -1,5 +1,44 @@
1
1
  import { html } from 'lit';
2
2
 
3
+ // Story-specific styles for backdrop demos
4
+ const backdropStoryStyles = html`
5
+ <style>
6
+ .story-demo-container {
7
+ position: relative;
8
+ height: 200px;
9
+ margin-top: var(--spacing-4);
10
+ border-radius: var(--radius-md);
11
+ overflow: hidden;
12
+ }
13
+ .story-demo-container-sm {
14
+ position: relative;
15
+ height: 150px;
16
+ margin-top: var(--spacing-3);
17
+ border-radius: var(--radius-md);
18
+ overflow: hidden;
19
+ }
20
+ .story-demo-bg {
21
+ width: 100%;
22
+ height: 100%;
23
+ object-fit: cover;
24
+ }
25
+ .story-backdrop-positioned {
26
+ position: absolute;
27
+ }
28
+ .story-content-overlay {
29
+ position: absolute;
30
+ inset: 0;
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ z-index: 1;
35
+ }
36
+ .story-text-center {
37
+ text-align: center;
38
+ }
39
+ </style>
40
+ `;
41
+
3
42
  export default {
4
43
  title: 'Utilities/Backdrop',
5
44
  tags: ['layout', 'backdrop', 'modal', 'overlay', 'utilities'],
@@ -16,6 +55,7 @@ export default {
16
55
  };
17
56
 
18
57
  export const BackdropVariants = () => html`
58
+ ${backdropStoryStyles}
19
59
  <header class="card">
20
60
  <h2>Backdrop Utilities</h2>
21
61
  <p class="text-muted">
@@ -29,11 +69,11 @@ export const BackdropVariants = () => html`
29
69
  <h3>Default Backdrop</h3>
30
70
  <p>Uses theme backdrop variables with subtle blur and gradient.</p>
31
71
  <code>.backdrop.active</code>
32
- <div style="position: relative; height: 200px; margin-top: var(--spacing-4); border-radius: var(--radius-md); overflow: hidden;">
33
- <img src="https://picsum.photos/400/200?random=1" alt="Background" style="width: 100%; height: 100%; object-fit: cover;" />
34
- <div class="backdrop active" style="position: absolute;"></div>
35
- <div style="position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1;">
36
- <div class="card surface-overlay" style="text-align: center;">
72
+ <div class="story-demo-container">
73
+ <img src="https://picsum.photos/400/200?random=1" alt="Background" class="story-demo-bg" />
74
+ <div class="backdrop active story-backdrop-positioned"></div>
75
+ <div class="story-content-overlay">
76
+ <div class="card surface-overlay story-text-center">
37
77
  <p>Modal content</p>
38
78
  </div>
39
79
  </div>
@@ -44,11 +84,11 @@ export const BackdropVariants = () => html`
44
84
  <h3>Light Backdrop</h3>
45
85
  <p>For light-themed overlays or subtle dimming.</p>
46
86
  <code>.backdrop.backdrop-light.active</code>
47
- <div style="position: relative; height: 200px; margin-top: var(--spacing-4); border-radius: var(--radius-md); overflow: hidden;">
48
- <img src="https://picsum.photos/400/200?random=2" alt="Background" style="width: 100%; height: 100%; object-fit: cover;" />
49
- <div class="backdrop backdrop-light active" style="position: absolute;"></div>
50
- <div style="position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1;">
51
- <div class="card" style="text-align: center;">
87
+ <div class="story-demo-container">
88
+ <img src="https://picsum.photos/400/200?random=2" alt="Background" class="story-demo-bg" />
89
+ <div class="backdrop backdrop-light active story-backdrop-positioned"></div>
90
+ <div class="story-content-overlay">
91
+ <div class="card story-text-center">
52
92
  <p>Light overlay</p>
53
93
  </div>
54
94
  </div>
@@ -59,11 +99,11 @@ export const BackdropVariants = () => html`
59
99
  <h3>Dark Backdrop</h3>
60
100
  <p>For dramatic dimming and focus on content.</p>
61
101
  <code>.backdrop.backdrop-dark.active</code>
62
- <div style="position: relative; height: 200px; margin-top: var(--spacing-4); border-radius: var(--radius-md); overflow: hidden;">
63
- <img src="https://picsum.photos/400/200?random=3" alt="Background" style="width: 100%; height: 100%; object-fit: cover;" />
64
- <div class="backdrop backdrop-dark active" style="position: absolute;"></div>
65
- <div style="position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1;">
66
- <div class="card surface-overlay" style="text-align: center; color: white;">
102
+ <div class="story-demo-container">
103
+ <img src="https://picsum.photos/400/200?random=3" alt="Background" class="story-demo-bg" />
104
+ <div class="backdrop backdrop-dark active story-backdrop-positioned"></div>
105
+ <div class="story-content-overlay">
106
+ <div class="card surface-overlay story-text-center text-inverse">
67
107
  <p>Dark overlay</p>
68
108
  </div>
69
109
  </div>
@@ -75,6 +115,7 @@ export const BackdropVariants = () => html`
75
115
  BackdropVariants.storyName = 'Backdrop Variants';
76
116
 
77
117
  export const BlurLevels = () => html`
118
+ ${backdropStoryStyles}
78
119
  <header class="card">
79
120
  <h2>Backdrop Blur Levels</h2>
80
121
  <p class="text-muted">
@@ -87,10 +128,10 @@ export const BlurLevels = () => html`
87
128
  <article class="card">
88
129
  <h4>Small Blur</h4>
89
130
  <code>.backdrop-blur-sm</code>
90
- <div style="position: relative; height: 150px; margin-top: var(--spacing-3); border-radius: var(--radius-md); overflow: hidden;">
91
- <img src="https://picsum.photos/300/150?random=4" alt="Background" style="width: 100%; height: 100%; object-fit: cover;" />
92
- <div class="backdrop backdrop-blur-sm active" style="position: absolute;"></div>
93
- <div style="position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1;">
131
+ <div class="story-demo-container-sm">
132
+ <img src="https://picsum.photos/300/150?random=4" alt="Background" class="story-demo-bg" />
133
+ <div class="backdrop backdrop-blur-sm active story-backdrop-positioned"></div>
134
+ <div class="story-content-overlay">
94
135
  <span class="badge badge-primary">5px blur</span>
95
136
  </div>
96
137
  </div>
@@ -99,10 +140,10 @@ export const BlurLevels = () => html`
99
140
  <article class="card">
100
141
  <h4>Medium Blur</h4>
101
142
  <code>.backdrop-blur-md</code>
102
- <div style="position: relative; height: 150px; margin-top: var(--spacing-3); border-radius: var(--radius-md); overflow: hidden;">
103
- <img src="https://picsum.photos/300/150?random=5" alt="Background" style="width: 100%; height: 100%; object-fit: cover;" />
104
- <div class="backdrop backdrop-blur-md active" style="position: absolute;"></div>
105
- <div style="position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1;">
143
+ <div class="story-demo-container-sm">
144
+ <img src="https://picsum.photos/300/150?random=5" alt="Background" class="story-demo-bg" />
145
+ <div class="backdrop backdrop-blur-md active story-backdrop-positioned"></div>
146
+ <div class="story-content-overlay">
106
147
  <span class="badge badge-secondary">10px blur</span>
107
148
  </div>
108
149
  </div>
@@ -111,10 +152,10 @@ export const BlurLevels = () => html`
111
152
  <article class="card">
112
153
  <h4>Large Blur</h4>
113
154
  <code>.backdrop-blur-lg</code>
114
- <div style="position: relative; height: 150px; margin-top: var(--spacing-3); border-radius: var(--radius-md); overflow: hidden;">
115
- <img src="https://picsum.photos/300/150?random=6" alt="Background" style="width: 100%; height: 100%; object-fit: cover;" />
116
- <div class="backdrop backdrop-blur-lg active" style="position: absolute;"></div>
117
- <div style="position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1;">
155
+ <div class="story-demo-container-sm">
156
+ <img src="https://picsum.photos/300/150?random=6" alt="Background" class="story-demo-bg" />
157
+ <div class="backdrop backdrop-blur-lg active story-backdrop-positioned"></div>
158
+ <div class="story-content-overlay">
118
159
  <span class="badge badge-info">20px blur</span>
119
160
  </div>
120
161
  </div>
@@ -215,7 +215,7 @@ export const QuickConfirm = {
215
215
 
216
216
  const decision = await ask(
217
217
  html`
218
- <div class="flex flex-col gap-sm">
218
+ <div class="stack-sm">
219
219
  <p>This dialog comes from <code>PDS.ask()</code> and resolves with a simple boolean.</p>
220
220
  <ul class="ask-card-list list-disc">
221
221
  <li>Handles focus trapping and ESC cancel automatically.</li>