@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
@@ -1,298 +1,194 @@
1
- import { html } from 'lit';
1
+ import { html } from "lit";
2
+ import { highlight, getCurrentTheme, preloadShiki } from "../utils/shiki.js";
2
3
 
3
- const meshGradientStoryStyles = html`
4
- <style>
5
- .mesh-story {
6
- padding: var(--spacing-4);
7
- display: grid;
8
- gap: var(--spacing-6);
9
- }
10
-
11
- .mesh-story__intro {
12
- margin: 0 0 var(--spacing-6);
13
- }
14
-
15
- .mesh-story__grid {
16
- display: grid;
17
- gap: var(--spacing-6);
18
- }
19
-
20
- .mesh-story__grid--featured {
21
- grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr));
22
- }
23
-
24
- .mesh-story__grid--tiles {
25
- grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
26
- gap: var(--spacing-4);
27
- }
28
-
29
- .mesh-story__panel,
30
- .mesh-story__surface {
31
- border-radius: var(--radius-lg);
32
- border: 1px solid var(--color-border);
33
- }
34
-
35
- .mesh-story__panel {
36
- position: relative;
37
- padding: var(--spacing-6);
38
- min-height: 12.5rem;
39
- display: flex;
40
- align-items: center;
41
- justify-content: center;
42
- }
43
-
44
- .mesh-story__panel--mesh-01 {
45
- background: var(--background-mesh-01);
46
- }
4
+ // Pre-load Shiki
5
+ preloadShiki();
47
6
 
48
- .mesh-story__panel--mesh-02 {
49
- background: var(--background-mesh-02);
50
- }
51
-
52
- .mesh-story__inner {
53
- background: var(--color-surface-base);
54
- padding: var(--spacing-4);
55
- border-radius: var(--radius-md);
56
- box-shadow: var(--shadow-md);
57
- text-align: center;
58
- display: grid;
59
- gap: var(--spacing-2);
60
- }
61
-
62
- .mesh-story__inner-heading {
63
- margin: 0;
64
- }
65
-
66
- .mesh-story__inner-subtitle {
67
- margin: 0;
68
- opacity: 0.7;
69
- }
70
-
71
- .mesh-story__tile {
72
- position: relative;
73
- padding: var(--spacing-5);
74
- border-radius: var(--radius-md);
75
- min-height: 9.375rem;
76
- display: flex;
77
- flex-direction: column;
78
- align-items: center;
79
- justify-content: center;
80
- text-align: center;
7
+ // Minimal story-specific styles - most layout handled by PDS classes
8
+ const meshGradientsStoryStyles = html`
9
+ <style>
10
+ .story-mesh-demo {
81
11
  border: 1px solid var(--color-border);
82
- }
83
-
84
- .mesh-story__tile--mesh-03 {
85
- background: var(--background-mesh-03);
86
- }
87
-
88
- .mesh-story__tile--mesh-04 {
89
- background: var(--background-mesh-04);
90
- }
91
-
92
- .mesh-story__tile--mesh-05 {
93
- background: var(--background-mesh-05);
94
- }
95
-
96
- .mesh-story__tile-icon {
97
- opacity: 0.9;
98
- margin-bottom: var(--spacing-2);
99
- }
100
-
101
- .mesh-story__tile-code {
102
- font-size: 0.75rem;
103
- }
104
-
105
- .mesh-story__subheading {
106
- margin: var(--spacing-6) 0 var(--spacing-2);
107
- }
108
-
109
- .mesh-story__hero {
110
- background: var(--background-mesh-01);
111
- padding: var(--spacing-8);
112
- text-align: center;
113
- }
114
12
 
115
- .mesh-story__hero-text {
116
- font-size: 1.25rem;
117
- margin-top: var(--spacing-3);
13
+ &.card { min-height: 12.5rem; }
118
14
  }
119
-
120
- .mesh-story__hero-actions {
121
- display: flex;
122
- justify-content: center;
123
- gap: var(--spacing-3);
124
- margin-top: var(--spacing-4);
125
- }
126
-
127
- .mesh-story__card-surface {
128
- background: var(--background-mesh-03);
129
- padding: var(--spacing-6);
130
- }
131
-
132
- .mesh-story__card-overlay {
133
- padding: var(--spacing-6);
134
- max-width: 31.25rem;
135
- }
136
-
137
- .mesh-story__action-button {
138
- margin-top: var(--spacing-3);
139
- }
140
-
141
- .mesh-story__grid-surface {
142
- background: var(--background-mesh-05);
143
- padding: var(--spacing-6);
144
- }
145
-
146
- .mesh-story__feature-card {
147
- padding: var(--spacing-5);
148
- text-align: center;
149
- }
150
-
151
- .mesh-story__feature-heading {
152
- margin-top: var(--spacing-2);
153
- }
154
-
155
- .mesh-story__code-block {
156
- background: var(--color-surface-subtle);
157
- padding: var(--spacing-4);
158
- border-radius: var(--radius-md);
159
- overflow-x: auto;
160
- }
161
-
162
- .mesh-story__list {
15
+ .story-variable-list {
163
16
  list-style: none;
164
17
  margin: 0;
165
18
  padding: 0;
166
- }
167
-
168
- .mesh-story__list-item {
169
- padding: var(--spacing-2);
170
- border-bottom: 1px solid var(--color-border);
171
- }
172
19
 
173
- .mesh-story__list-item:last-child {
174
- border-bottom: 0;
20
+ li {
21
+ padding: var(--spacing-2) 0;
22
+ border-bottom: 1px solid var(--color-border);
23
+ &:last-child { border-bottom: 0; }
24
+ }
175
25
  }
176
26
  </style>
177
27
  `;
178
28
 
179
29
  const featuredMeshCards = [
180
30
  {
181
- key: 'mesh-01',
182
- title: 'Mesh 01',
183
- description: 'Subtle radial blend'
31
+ key: "mesh-01",
32
+ title: "Mesh 01",
33
+ description: "Subtle radial blend",
184
34
  },
185
35
  {
186
- key: 'mesh-02',
187
- title: 'Mesh 02',
188
- description: 'Corner accents'
189
- }
36
+ key: "mesh-02",
37
+ title: "Mesh 02",
38
+ description: "Corner accents",
39
+ },
190
40
  ];
191
41
 
192
- const meshTileBackgrounds = ['mesh-03', 'mesh-04', 'mesh-05'];
42
+ const meshTileBackgrounds = ["mesh-03", "mesh-04", "mesh-05"];
193
43
 
194
- const meshVariableList = ['mesh-01', 'mesh-02', 'mesh-03', 'mesh-04', 'mesh-05'];
44
+ const meshVariableList = [
45
+ "mesh-01",
46
+ "mesh-02",
47
+ "mesh-03",
48
+ "mesh-04",
49
+ "mesh-05",
50
+ ];
195
51
 
196
52
  export default {
197
- title: 'Foundations/Mesh Gradients',
198
- tags: ['mesh', 'gradient', 'background', 'effect', 'decoration'],
53
+ title: "Foundations/Mesh Gradients",
54
+ tags: ["mesh", "gradient", "background", "effect", "decoration"],
199
55
  parameters: {
200
56
  pds: {
201
- tags: ['mesh', 'gradient', 'background', 'effect', 'decoration', 'colors', 'theming']
57
+ tags: [
58
+ "mesh",
59
+ "gradient",
60
+ "background",
61
+ "effect",
62
+ "decoration",
63
+ "colors",
64
+ "theming",
65
+ ],
202
66
  },
203
67
  docs: {
204
68
  description: {
205
- component: 'Beautiful mesh gradient backgrounds generated from your color palette. Automatically adapts to light and dark modes with 5 different variations.'
206
- }
207
- }
208
- }
69
+ component:
70
+ "Beautiful mesh gradient backgrounds generated from your color palette. Automatically adapts to light and dark modes with 5 different variations.",
71
+ },
72
+ },
73
+ },
209
74
  };
210
75
 
211
76
  export const AllMeshGradients = () => html`
212
- ${meshGradientStoryStyles}
213
- <section class="mesh-story">
77
+ ${meshGradientsStoryStyles}
78
+ <section class="stack gap-lg">
214
79
  <header>
215
- <h2>Mesh Gradient Backgrounds</h2>
216
- <small class="text-muted">
217
- Subtle, beautiful mesh gradient backgrounds using <code>--background-mesh-01</code> through <code>--background-mesh-05</code>. Toggle dark mode to see automatic adaptation.
218
- </small>
80
+ <h2>Mesh Gradient Backgrounds</h2>
81
+ <small class="text-muted">
82
+ Subtle, beautiful mesh gradient backgrounds using
83
+ <code>--background-mesh-01</code> through
84
+ <code>--background-mesh-05</code>. Toggle dark mode to see automatic
85
+ adaptation.
86
+ </small>
219
87
  </header>
220
- <div class="mesh-story__grid mesh-story__grid--featured">
221
- ${featuredMeshCards.map(({ key, title, description }) => html`
222
- <div class="mesh-story__panel mesh-story__panel--${key}">
223
- <div class="mesh-story__inner">
224
- <h4 class="mesh-story__inner-heading">${title}</h4>
225
- <p class="mesh-story__inner-subtitle">${description}</p>
226
- </div>
227
- </div>
228
- `)}
229
- </div>
230
- <div class="mesh-story__grid mesh-story__grid--tiles">
231
- ${meshTileBackgrounds.map((meshKey) => html`
232
- <div class="mesh-story__tile mesh-story__tile--${meshKey}">
233
- <pds-icon icon="sparkle" size="xl" class="mesh-story__tile-icon"></pds-icon>
234
- <code class="mesh-story__tile-code">${meshKey}</code>
235
- </div>
236
- `)}
88
+ <div class="stack-lg">
89
+ <div class="grid grid-auto-md gap-lg">
90
+ ${featuredMeshCards.map(
91
+ ({ key, title, description }) => html`
92
+ <div
93
+ class="card radius-lg flex items-center justify-center story-mesh-demo"
94
+ style="background: var(--background-${key});"
95
+ >
96
+ <div class="card surface-base shadow-md stack gap-xs text-center">
97
+ <h4>${title}</h4>
98
+ <p class="text-muted">${description}</p>
99
+ </div>
100
+ </div>
101
+ `
102
+ )}
103
+ </div>
104
+ <div class="flex gap-md">
105
+ ${meshTileBackgrounds.map(
106
+ (meshKey) => html`
107
+ <div
108
+ class="card stack-sm text-center"
109
+ style="background: var(--background-${meshKey});"
110
+ >
111
+ <pds-icon icon="sparkle" size="xl"></pds-icon>
112
+ <code>${meshKey}</code>
113
+ </div>
114
+ `
115
+ )}
116
+ </div>
237
117
  </div>
238
118
  </section>
239
119
  `;
240
120
 
241
- AllMeshGradients.storyName = 'All Mesh Gradients';
121
+ AllMeshGradients.storyName = "All Mesh Gradients";
242
122
 
243
123
  export const MeshUsageExamples = () => html`
244
- ${meshGradientStoryStyles}
245
- <section class="mesh-story">
124
+ ${meshGradientsStoryStyles}
125
+ <section class="stack gap-lg">
246
126
  <h2>Usage Examples</h2>
247
127
 
248
- <h3 class="mesh-story__subheading">Hero Section</h3>
249
- <div class="mesh-story__surface mesh-story__hero">
128
+ <h3>Hero Section</h3>
129
+ <div
130
+ class="card radius-lg text-center story-mesh-demo"
131
+ style="background: var(--background-mesh-01);"
132
+ >
250
133
  <h1>Welcome to Pure Design System</h1>
251
- <p class="mesh-story__hero-text">
252
- Beautiful backgrounds generated from your color palette
253
- </p>
254
- <div class="mesh-story__hero-actions">
134
+ <p>Beautiful backgrounds generated from your color palette</p>
135
+ <nav class="flex justify-center gap-sm">
255
136
  <button class="btn-primary btn-lg">Get Started</button>
256
137
  <button class="btn-secondary btn-lg">Learn More</button>
257
- </div>
138
+ </nav>
258
139
  </div>
259
140
 
260
- <h3 class="mesh-story__subheading">Card with Mesh Background</h3>
261
- <div class="mesh-story__surface mesh-story__card-surface">
262
- <div class="card surface-elevated mesh-story__card-overlay">
141
+ <h3>Card with Mesh Background</h3>
142
+ <div
143
+ class="card radius-lg story-mesh-demo"
144
+ style="background: var(--background-mesh-03);"
145
+ >
146
+ <article class="card surface-elevated stack-sm max-w-md">
263
147
  <h4>Layered Design</h4>
264
- <p>Mesh gradients work beautifully as backgrounds with overlaid content using surface tokens.</p>
265
- <button class="btn-primary mesh-story__action-button">
266
- <pds-icon icon="rocket"></pds-icon>
267
- Take Action
268
- </button>
269
- </div>
148
+ <p>
149
+ Mesh gradients work beautifully as backgrounds with overlaid content
150
+ using surface tokens.
151
+ </p>
152
+ <nav>
153
+ <a href="#" class="btn btn-primary">
154
+ <pds-icon icon="rocket"></pds-icon>
155
+ Take Action
156
+ </a>
157
+ </nav>
158
+ </article>
270
159
  </div>
271
160
 
272
- <h3 class="mesh-story__subheading">Grid Layout with Mesh</h3>
273
- <div class="mesh-story__surface mesh-story__grid-surface">
161
+ <h3>Grid Layout with Mesh</h3>
162
+ <div
163
+ class="card radius-lg story-mesh-demo"
164
+ style="background: var(--background-mesh-05);"
165
+ >
274
166
  <div class="grid grid-cols-3 gap-md">
275
- ${Array.from({ length: 3 }, (_, index) => html`
276
- <div class="card surface-base mesh-story__feature-card">
277
- <pds-icon icon="star" size="xl" class="icon-accent"></pds-icon>
278
- <h5 class="mesh-story__feature-heading">Feature ${index + 1}</h5>
279
- <p>Mesh backgrounds create visual interest without overwhelming content</p>
280
- </div>
281
- `)}
167
+ ${Array.from(
168
+ { length: 3 },
169
+ (_, index) => html`
170
+ <div class="card surface-translucent-75 stack-sm text-center">
171
+ <pds-icon icon="star" size="xl" class="icon-accent"></pds-icon>
172
+ <h5>Feature ${index + 1}</h5>
173
+ <p>
174
+ Mesh backgrounds create visual interest without overwhelming
175
+ content
176
+ </p>
177
+ </div>
178
+ `
179
+ )}
282
180
  </div>
283
181
  </div>
284
182
  </section>
285
183
  `;
286
184
 
287
- MeshUsageExamples.storyName = 'Usage Examples';
185
+ MeshUsageExamples.storyName = "Usage Examples";
288
186
 
289
- export const CodeSamples = () => html`
290
- ${meshGradientStoryStyles}
291
- <section class="mesh-story">
292
- <h2>Code Samples</h2>
187
+ export const CodeSamples = () => {
188
+ const container = document.createElement("section");
189
+ container.className = "stack gap-lg";
293
190
 
294
- <h3 class="mesh-story__subheading">Apply as Background</h3>
295
- <pre class="mesh-story__code-block shiki github-dark"><code>/* Use CSS custom properties */
191
+ const cssCode = `/* Use CSS custom properties */
296
192
  .hero-section {
297
193
  background: var(--background-mesh-01);
298
194
  }
@@ -307,17 +203,32 @@ export const CodeSamples = () => html`
307
203
  .container {
308
204
  background-color: var(--color-surface-base);
309
205
  background-image: var(--background-mesh-02);
310
- }</code></pre>
206
+ }`;
311
207
 
312
- <h3 class="mesh-story__subheading">Available Variables</h3>
313
- <ul class="mesh-story__list">
314
- ${meshVariableList.map((meshKey) => html`
315
- <li class="mesh-story__list-item">
316
- <code>--background-${meshKey}</code>
317
- </li>
318
- `)}
208
+ const variablesList = meshVariableList
209
+ .map((key) => `<li><code>--background-${key}</code></li>`)
210
+ .join("\n ");
211
+
212
+ container.innerHTML = /*html*/ `
213
+ ${meshGradientsStoryStyles.strings[0]}
214
+ <h2>Code Samples</h2>
215
+
216
+ <h3>Apply as Background</h3>
217
+ <div class="code-css"></div>
218
+
219
+ <h3>Available Variables</h3>
220
+ <ul class="story-variable-list">
221
+ ${variablesList}
319
222
  </ul>
320
- </section>
321
- `;
223
+ `;
224
+
225
+ const theme = getCurrentTheme();
226
+
227
+ highlight(cssCode, "css", theme).then((h) => {
228
+ container.querySelector(".code-css").innerHTML = h;
229
+ });
230
+
231
+ return container;
232
+ };
322
233
 
323
- CodeSamples.storyName = 'Code Samples';
234
+ CodeSamples.storyName = "Code Samples";