@pure-ds/storybook 0.7.25 → 0.7.26

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 (68) hide show
  1. package/.storybook/preview.js +5 -4
  2. package/dist/pds-reference.json +2266 -1017
  3. package/package.json +2 -2
  4. package/public/assets/js/app.js +1 -1
  5. package/public/assets/js/pds-ask.js +6 -6
  6. package/public/assets/js/pds-manager.js +104 -29
  7. package/public/assets/pds/components/pds-calendar.js +91 -159
  8. package/public/assets/pds/components/pds-daterange.js +683 -0
  9. package/public/assets/pds/components/pds-form.js +123 -21
  10. package/public/assets/pds/components/pds-rating.js +648 -0
  11. package/public/assets/pds/components/pds-tags.js +802 -0
  12. package/public/assets/pds/core/pds-ask.js +6 -6
  13. package/public/assets/pds/core/pds-manager.js +104 -29
  14. package/public/assets/pds/custom-elements.json +1099 -74
  15. package/public/assets/pds/pds-css-complete.json +7 -2
  16. package/public/assets/pds/pds-runtime-config.json +1 -1
  17. package/public/assets/pds/pds.css-data.json +4 -4
  18. package/public/assets/pds/styles/pds-components.css +96 -24
  19. package/public/assets/pds/styles/pds-components.css.js +192 -48
  20. package/public/assets/pds/styles/pds-primitives.css +6 -3
  21. package/public/assets/pds/styles/pds-primitives.css.js +12 -6
  22. package/public/assets/pds/styles/pds-styles.css +104 -29
  23. package/public/assets/pds/styles/pds-styles.css.js +208 -58
  24. package/public/assets/pds/styles/pds-utilities.css +2 -2
  25. package/public/assets/pds/styles/pds-utilities.css.js +4 -4
  26. package/public/assets/pds/vscode-custom-data.json +97 -0
  27. package/src/js/common/ask.js +122 -12
  28. package/src/js/pds-core/pds-generator.js +103 -28
  29. package/src/js/pds-core/pds-ontology.js +2 -2
  30. package/stories/components/PdsCalendar.stories.js +650 -168
  31. package/stories/components/PdsDaterange.stories.js +85 -0
  32. package/stories/components/PdsForm.Basics.stories.js +16 -0
  33. package/stories/components/PdsForm.ConditionalAndCalculated.stories.js +16 -0
  34. package/stories/components/PdsForm.CustomContent.stories.js +10 -0
  35. package/stories/components/PdsForm.Dialogs.stories.js +7 -0
  36. package/stories/components/PdsForm.Layout.stories.js +16 -0
  37. package/stories/components/PdsForm.SelectionAndArrays.stories.js +12 -0
  38. package/stories/components/PdsForm.stories.js +179 -219
  39. package/stories/components/PdsIcon.stories.js +17 -7
  40. package/stories/components/PdsOmnibox.stories.js +1 -60
  41. package/stories/components/PdsRating.stories.js +126 -0
  42. package/stories/components/PdsTags.stories.js +224 -0
  43. package/stories/components/PdsToaster.stories.js +1 -1
  44. package/stories/components/omnibox-countries-api-settings.js +63 -0
  45. package/stories/foundations/Colors.stories.js +6 -1
  46. package/stories/foundations/HTMLDefaults.stories.js +6 -6
  47. package/stories/foundations/Icons.stories.js +4 -4
  48. package/stories/foundations/MeshGradients.stories.js +13 -3
  49. package/stories/foundations/SmartSurfaces.stories.js +43 -31
  50. package/stories/foundations/Typography.stories.js +30 -108
  51. package/stories/foundations/ZIndex.stories.js +3 -3
  52. package/stories/layout/LayoutOverview.stories.js +3 -3
  53. package/stories/layout/LayoutSystem.stories.js +24 -18
  54. package/stories/patterns/BorderEffects.stories.js +28 -16
  55. package/stories/patterns/InteractiveStates.stories.js +39 -24
  56. package/stories/patterns/Utilities.stories.js +45 -23
  57. package/stories/primitives/ArticleLayout.stories.js +176 -0
  58. package/stories/primitives/Badges.stories.js +24 -8
  59. package/stories/primitives/Buttons.stories.js +29 -9
  60. package/stories/primitives/Callouts.stories.js +8 -7
  61. package/stories/primitives/Cards.stories.js +4 -1
  62. package/stories/primitives/FormElements.stories.js +8 -2
  63. package/stories/primitives/HtmlFormElements.stories.js +8 -2
  64. package/stories/primitives/HtmlFormGroups.stories.js +5 -2
  65. package/stories/primitives/Media.stories.js +44 -30
  66. package/stories/primitives/Tables.stories.js +25 -7
  67. package/stories/utils/PdsAsk.stories.js +17 -5
  68. package/stories/utils/PdsObjectApi.stories.js +16 -4
@@ -17,6 +17,10 @@ export default {
17
17
 
18
18
  export const DefaultTable = () => html`
19
19
  <section class="card">
20
+ <header>
21
+ <h3>Default Table</h3>
22
+ <small class="text-muted">Baseline semantic table styling for common data presentation.</small>
23
+ </header>
20
24
  <table>
21
25
  <thead>
22
26
  <tr>
@@ -60,6 +64,10 @@ DefaultTable.storyName = 'Default Table';
60
64
 
61
65
  export const StripedTable = () => html`
62
66
  <section class="card">
67
+ <header>
68
+ <h3>Striped Table</h3>
69
+ <small class="text-muted">Use <code>.table-striped</code> for alternating row backgrounds.</small>
70
+ </header>
63
71
  <table class="table-striped">
64
72
  <thead>
65
73
  <tr>
@@ -109,6 +117,10 @@ StripedTable.storyName = 'Striped Table';
109
117
 
110
118
  export const BorderedCompactTable = () => html`
111
119
  <section class="card">
120
+ <header>
121
+ <h3>Bordered Compact Table</h3>
122
+ <small class="text-muted">Dense data table using <code>.table-bordered</code> and <code>.table-compact</code>.</small>
123
+ </header>
112
124
  <table class="table-bordered table-compact">
113
125
  <thead>
114
126
  <tr>
@@ -157,13 +169,13 @@ export const BorderedCompactTable = () => html`
157
169
  BorderedCompactTable.storyName = 'Bordered Compact Table';
158
170
 
159
171
  export const TableResponsiveWrapper = () => html`
160
- <div class="card">
161
- <h2>Responsive Table Wrapper</h2>
162
- <p class="text-muted">
172
+ <header class="card">
173
+ <h3>Responsive Table Wrapper</h3>
174
+ <small class="text-muted">
163
175
  Wrap tables in <code>.table-responsive</code> for horizontal scrolling on mobile.
164
176
  This is the recommended approach for wide data tables.
165
- </p>
166
- </div>
177
+ </small>
178
+ </header>
167
179
 
168
180
  <div class="table-responsive">
169
181
  <table class="table-striped">
@@ -241,7 +253,10 @@ TableResponsiveWrapper.storyName = 'Responsive Wrapper';
241
253
 
242
254
  export const ResponsiveTable = () => html`
243
255
  <section class="card">
244
- <small class="text-muted">Resize the window to see horizontal scrolling on small screens</small>
256
+ <header>
257
+ <h3>Responsive Table</h3>
258
+ <small class="text-muted">Resize the window to see horizontal scrolling on small screens.</small>
259
+ </header>
245
260
  <div class="table-responsive">
246
261
  <table class="table-striped">
247
262
  <thead>
@@ -297,7 +312,10 @@ ResponsiveTable.storyName = 'Responsive Table';
297
312
 
298
313
  export const TablesReference = () => html`
299
314
  <div class="card">
300
- <h2>Table Classes Reference</h2>
315
+ <header>
316
+ <h3>Table Classes Reference</h3>
317
+ <small class="text-muted">Quick reference for table primitives and responsive wrappers.</small>
318
+ </header>
301
319
 
302
320
  <table class="table-bordered">
303
321
  <thead>
@@ -75,7 +75,7 @@ const formDataToObject = (formData) => {
75
75
  };
76
76
 
77
77
  export default {
78
- title: 'Utilities/PDS ask',
78
+ title: 'PDS/PDS Object',
79
79
  tags: ['interaction', 'dialogs', 'forms', 'modal', 'dialog', 'alert', 'confirm', 'prompt', 'popup', 'overlay'],
80
80
  parameters: {
81
81
  pds: {
@@ -90,7 +90,7 @@ Use it to collect quick confirmations or to stage entire forms before committing
90
90
  }
91
91
  };
92
92
 
93
- export const BareConfirm = {
93
+ const AreYouSure = {
94
94
  name: 'Are you sure?',
95
95
  render: () => {
96
96
  const handleClick = async (event) => {
@@ -129,7 +129,7 @@ export const BareConfirm = {
129
129
  }
130
130
  };
131
131
 
132
- export const MiniForm = {
132
+ const MiniFormSubmission = {
133
133
  name: 'Mini form submission',
134
134
  render: () => {
135
135
  const handleClick = async (event) => {
@@ -202,7 +202,7 @@ export const MiniForm = {
202
202
  }
203
203
  };
204
204
 
205
- export const QuickConfirm = {
205
+ const BooleanConfirmFlow = {
206
206
  name: 'Boolean confirm flow',
207
207
  render: () => {
208
208
  const handleClick = async (event) => {
@@ -264,7 +264,7 @@ export const QuickConfirm = {
264
264
  }
265
265
  };
266
266
 
267
- export const formSubdialog = {
267
+ const EmbedPdsFormSubform = {
268
268
  name: 'Embed a pds-form subform',
269
269
  render: () => {
270
270
  const handleClick = async (event) => {
@@ -377,3 +377,15 @@ export const formSubdialog = {
377
377
  `;
378
378
  }
379
379
  };
380
+
381
+ export const PDSAsk = {
382
+ name: 'PDS.ask()',
383
+ render: () => html`
384
+ <section class="stack-lg">
385
+ ${AreYouSure.render()}
386
+ ${MiniFormSubmission.render()}
387
+ ${BooleanConfirmFlow.render()}
388
+ ${EmbedPdsFormSubform.render()}
389
+ </section>
390
+ `
391
+ };
@@ -187,22 +187,33 @@ const makeCard = ({
187
187
  code,
188
188
  outputLabel = 'Runtime output',
189
189
  initialOutput,
190
+ outputVariant = 'pre',
190
191
  buttonLabel,
191
192
  onRun,
192
193
  maxWidth = 'max-w-2xl'
193
194
  }) => {
194
195
  const section = document.createElement('section');
195
196
  section.className = `card stack-md ${maxWidth}`;
197
+ const outputTemplate = outputVariant === 'callout'
198
+ ? `
199
+ <div class="callout callout-info">
200
+ <strong class="callout-title">${outputLabel}</strong>
201
+ <div class="text-sm" data-output>${initialOutput || 'Click to inspect.'}</div>
202
+ </div>
203
+ `
204
+ : `
205
+ <div class="stack-sm">
206
+ <strong>${outputLabel}</strong>
207
+ <pre class="text-sm" data-output>${initialOutput || 'Click to inspect.'}</pre>
208
+ </div>
209
+ `;
196
210
  section.innerHTML = `
197
211
  ${renderCardHeader(title, description)}
198
212
  <div>
199
213
  <strong>Example</strong>
200
214
  <div data-code-host>Loading code sample…</div>
201
215
  </div>
202
- <div class="stack-sm">
203
- <strong>${outputLabel}</strong>
204
- <pre class="text-sm" data-output>${initialOutput || 'Click to inspect.'}</pre>
205
- </div>
216
+ ${outputTemplate}
206
217
  ${buttonLabel ? `<button class="btn btn-outline" type="button" data-run>${buttonLabel}</button>` : ''}
207
218
  `;
208
219
 
@@ -536,6 +547,7 @@ export const PDSAdoptLayers = {
536
547
  description: 'Adopt selected shared PDS layers plus local constructable stylesheets in one call.',
537
548
  code: adoptLayersCode,
538
549
  outputLabel: 'Notes',
550
+ outputVariant: 'callout',
539
551
  initialOutput: 'Use this pattern in custom elements that need tokens/primitives/utilities inside Shadow DOM.',
540
552
  maxWidth: 'max-w-3xl'
541
553
  });