@pure-ds/storybook 0.1.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 (129) hide show
  1. package/.storybook/addons/description/preview.js +15 -0
  2. package/.storybook/addons/description/register.js +60 -0
  3. package/.storybook/addons/html-preview/Panel.jsx +327 -0
  4. package/.storybook/addons/html-preview/constants.js +6 -0
  5. package/.storybook/addons/html-preview/preview.js +178 -0
  6. package/.storybook/addons/html-preview/register.js +16 -0
  7. package/.storybook/addons/pds-configurator/SearchTool.js +44 -0
  8. package/.storybook/addons/pds-configurator/Tool.js +30 -0
  9. package/.storybook/addons/pds-configurator/constants.js +9 -0
  10. package/.storybook/addons/pds-configurator/preview.js +159 -0
  11. package/.storybook/addons/pds-configurator/register.js +24 -0
  12. package/.storybook/docs.css +35 -0
  13. package/.storybook/htmlPreview.css +103 -0
  14. package/.storybook/htmlPreview.js +271 -0
  15. package/.storybook/main.js +160 -0
  16. package/.storybook/preview-body.html +48 -0
  17. package/.storybook/preview-head.html +11 -0
  18. package/.storybook/preview.js +1563 -0
  19. package/README.md +266 -0
  20. package/bin/index.js +40 -0
  21. package/dist/pds-reference.json +2101 -0
  22. package/package.json +45 -0
  23. package/pds.config.js +6 -0
  24. package/public/assets/css/app.css +1216 -0
  25. package/public/assets/data/auto-design-advanced.json +704 -0
  26. package/public/assets/data/auto-design-simple.json +123 -0
  27. package/public/assets/img/icon-512x512.png +0 -0
  28. package/public/assets/img/logo-trans.png +0 -0
  29. package/public/assets/img/logo.png +0 -0
  30. package/public/assets/js/app.js +15088 -0
  31. package/public/assets/js/app.js.map +7 -0
  32. package/public/assets/js/lit.js +1176 -0
  33. package/public/assets/js/lit.js.map +7 -0
  34. package/public/assets/js/pds.js +9801 -0
  35. package/public/assets/js/pds.js.map +7 -0
  36. package/public/assets/pds/components/pds-calendar.js +837 -0
  37. package/public/assets/pds/components/pds-drawer.js +857 -0
  38. package/public/assets/pds/components/pds-icon.js +338 -0
  39. package/public/assets/pds/components/pds-jsonform.js +1775 -0
  40. package/public/assets/pds/components/pds-richtext.js +1035 -0
  41. package/public/assets/pds/components/pds-scrollrow.js +331 -0
  42. package/public/assets/pds/components/pds-splitpanel.js +401 -0
  43. package/public/assets/pds/components/pds-tabstrip.js +251 -0
  44. package/public/assets/pds/components/pds-toaster.js +446 -0
  45. package/public/assets/pds/components/pds-upload.js +657 -0
  46. package/public/assets/pds/custom-elements.json +2003 -0
  47. package/public/assets/pds/icons/pds-icons.svg +498 -0
  48. package/public/assets/pds/pds-css-complete.json +1861 -0
  49. package/public/assets/pds/pds-runtime-config.json +11 -0
  50. package/public/assets/pds/pds.css-data.json +2152 -0
  51. package/public/assets/pds/styles/pds-components.css +1944 -0
  52. package/public/assets/pds/styles/pds-components.css.js +3895 -0
  53. package/public/assets/pds/styles/pds-primitives.css +352 -0
  54. package/public/assets/pds/styles/pds-primitives.css.js +711 -0
  55. package/public/assets/pds/styles/pds-styles.css +3761 -0
  56. package/public/assets/pds/styles/pds-styles.css.js +7529 -0
  57. package/public/assets/pds/styles/pds-tokens.css +699 -0
  58. package/public/assets/pds/styles/pds-tokens.css.js +1405 -0
  59. package/public/assets/pds/styles/pds-utilities.css +763 -0
  60. package/public/assets/pds/styles/pds-utilities.css.js +1533 -0
  61. package/public/assets/pds/vscode-custom-data.json +824 -0
  62. package/scripts/build-pds-reference.mjs +807 -0
  63. package/scripts/generate-stories.js +542 -0
  64. package/scripts/package-build.js +86 -0
  65. package/src/js/app.js +17 -0
  66. package/src/js/common/ask.js +208 -0
  67. package/src/js/common/common.js +20 -0
  68. package/src/js/common/font-loader.js +200 -0
  69. package/src/js/common/msg.js +90 -0
  70. package/src/js/lit.js +40 -0
  71. package/src/js/pds-core/pds-config.js +1162 -0
  72. package/src/js/pds-core/pds-enhancer-metadata.js +75 -0
  73. package/src/js/pds-core/pds-enhancers.js +357 -0
  74. package/src/js/pds-core/pds-enums.js +86 -0
  75. package/src/js/pds-core/pds-generator.js +5317 -0
  76. package/src/js/pds-core/pds-ontology.js +256 -0
  77. package/src/js/pds-core/pds-paths.js +109 -0
  78. package/src/js/pds-core/pds-query.js +571 -0
  79. package/src/js/pds-core/pds-registry.js +129 -0
  80. package/src/js/pds-core/pds.d.ts +129 -0
  81. package/src/js/pds.d.ts +408 -0
  82. package/src/js/pds.js +1579 -0
  83. package/src/pds-core/pds-api.js +105 -0
  84. package/stories/GettingStarted.md +96 -0
  85. package/stories/GettingStarted.stories.js +144 -0
  86. package/stories/WhatIsPDS.md +194 -0
  87. package/stories/WhatIsPDS.stories.js +144 -0
  88. package/stories/components/PdsCalendar.stories.js +263 -0
  89. package/stories/components/PdsDrawer.stories.js +623 -0
  90. package/stories/components/PdsIcon.stories.js +78 -0
  91. package/stories/components/PdsJsonform.stories.js +1444 -0
  92. package/stories/components/PdsRichtext.stories.js +367 -0
  93. package/stories/components/PdsScrollrow.stories.js +140 -0
  94. package/stories/components/PdsSplitpanel.stories.js +502 -0
  95. package/stories/components/PdsTabstrip.stories.js +442 -0
  96. package/stories/components/PdsToaster.stories.js +186 -0
  97. package/stories/components/PdsUpload.stories.js +66 -0
  98. package/stories/enhancements/Dropdowns.stories.js +185 -0
  99. package/stories/enhancements/InteractiveStates.stories.js +625 -0
  100. package/stories/enhancements/MeshGradients.stories.js +320 -0
  101. package/stories/enhancements/OpenGroups.stories.js +227 -0
  102. package/stories/enhancements/RangeSliders.stories.js +232 -0
  103. package/stories/enhancements/RequiredFields.stories.js +189 -0
  104. package/stories/enhancements/Toggles.stories.js +167 -0
  105. package/stories/foundations/Colors.stories.js +283 -0
  106. package/stories/foundations/Icons.stories.js +305 -0
  107. package/stories/foundations/SmartSurfaces.stories.js +367 -0
  108. package/stories/foundations/Spacing.stories.js +175 -0
  109. package/stories/foundations/Typography.stories.js +960 -0
  110. package/stories/foundations/ZIndex.stories.js +325 -0
  111. package/stories/patterns/BorderEffects.stories.js +72 -0
  112. package/stories/patterns/Layout.stories.js +99 -0
  113. package/stories/patterns/Utilities.stories.js +107 -0
  114. package/stories/primitives/Accordion.stories.js +359 -0
  115. package/stories/primitives/Alerts.stories.js +64 -0
  116. package/stories/primitives/Badges.stories.js +183 -0
  117. package/stories/primitives/Buttons.stories.js +229 -0
  118. package/stories/primitives/Cards.stories.js +353 -0
  119. package/stories/primitives/FormGroups.stories.js +569 -0
  120. package/stories/primitives/Forms.stories.js +131 -0
  121. package/stories/primitives/Media.stories.js +203 -0
  122. package/stories/primitives/Tables.stories.js +232 -0
  123. package/stories/reference/ReferenceCatalog.stories.js +28 -0
  124. package/stories/reference/reference-catalog.js +413 -0
  125. package/stories/reference/reference-docs.js +302 -0
  126. package/stories/reference/reference-helpers.js +310 -0
  127. package/stories/utilities/GridSystem.stories.js +208 -0
  128. package/stories/utils/PdsAsk.stories.js +420 -0
  129. package/stories/utils/toast-utils.js +148 -0
@@ -0,0 +1,203 @@
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';
@@ -0,0 +1,232 @@
1
+ import { html } from 'lit';
2
+
3
+ const tablesStoryStyles = html`
4
+ <style>
5
+ .table-story-section {
6
+ padding: var(--spacing-4);
7
+ }
8
+
9
+ .table-story-description {
10
+ margin: 0 0 var(--spacing-4);
11
+ font-style: italic;
12
+ }
13
+
14
+ .table-story-scroll {
15
+ overflow-x: auto;
16
+ }
17
+ </style>
18
+ `;
19
+
20
+ export default {
21
+ title: 'Primitives/Tables',
22
+ parameters: {
23
+ docs: {
24
+ description: {
25
+ component: 'Responsive tables with various styling options including striped, bordered, and compact variants.'
26
+ }
27
+ }
28
+ }
29
+ };
30
+
31
+ export const DefaultTable = () => html`
32
+ ${tablesStoryStyles}
33
+ <section class="table-story-section">
34
+ <table>
35
+ <thead>
36
+ <tr>
37
+ <th>Name</th>
38
+ <th>Role</th>
39
+ <th>Department</th>
40
+ <th>Status</th>
41
+ </tr>
42
+ </thead>
43
+ <tbody>
44
+ <tr>
45
+ <td>Alice Johnson</td>
46
+ <td>Senior Developer</td>
47
+ <td>Engineering</td>
48
+ <td><span class="badge badge-success">Active</span></td>
49
+ </tr>
50
+ <tr>
51
+ <td>Bob Smith</td>
52
+ <td>Product Manager</td>
53
+ <td>Product</td>
54
+ <td><span class="badge badge-success">Active</span></td>
55
+ </tr>
56
+ <tr>
57
+ <td>Carol Williams</td>
58
+ <td>UX Designer</td>
59
+ <td>Design</td>
60
+ <td><span class="badge badge-warning">Away</span></td>
61
+ </tr>
62
+ <tr>
63
+ <td>David Brown</td>
64
+ <td>DevOps Engineer</td>
65
+ <td>Engineering</td>
66
+ <td><span class="badge badge-danger">Offline</span></td>
67
+ </tr>
68
+ </tbody>
69
+ </table>
70
+ </section>
71
+ `;
72
+
73
+ DefaultTable.storyName = 'Default Table';
74
+
75
+ export const StripedTable = () => html`
76
+ ${tablesStoryStyles}
77
+ <section class="table-story-section">
78
+ <table class="table-striped">
79
+ <thead>
80
+ <tr>
81
+ <th>Product</th>
82
+ <th>Price</th>
83
+ <th>Stock</th>
84
+ <th>Category</th>
85
+ </tr>
86
+ </thead>
87
+ <tbody>
88
+ <tr>
89
+ <td>Laptop Pro</td>
90
+ <td>$1,299</td>
91
+ <td>45</td>
92
+ <td>Electronics</td>
93
+ </tr>
94
+ <tr>
95
+ <td>Wireless Mouse</td>
96
+ <td>$29</td>
97
+ <td>128</td>
98
+ <td>Accessories</td>
99
+ </tr>
100
+ <tr>
101
+ <td>USB-C Hub</td>
102
+ <td>$59</td>
103
+ <td>76</td>
104
+ <td>Accessories</td>
105
+ </tr>
106
+ <tr>
107
+ <td>Monitor 27"</td>
108
+ <td>$449</td>
109
+ <td>23</td>
110
+ <td>Electronics</td>
111
+ </tr>
112
+ <tr>
113
+ <td>Mechanical Keyboard</td>
114
+ <td>$149</td>
115
+ <td>92</td>
116
+ <td>Accessories</td>
117
+ </tr>
118
+ </tbody>
119
+ </table>
120
+ </section>
121
+ `;
122
+
123
+ StripedTable.storyName = 'Striped Table';
124
+
125
+ export const BorderedCompactTable = () => html`
126
+ ${tablesStoryStyles}
127
+ <section class="table-story-section">
128
+ <table class="table-bordered table-compact">
129
+ <thead>
130
+ <tr>
131
+ <th>ID</th>
132
+ <th>Task</th>
133
+ <th>Priority</th>
134
+ <th>Due Date</th>
135
+ </tr>
136
+ </thead>
137
+ <tbody>
138
+ <tr>
139
+ <td>#101</td>
140
+ <td>Fix navigation bug</td>
141
+ <td><span class="badge badge-danger">High</span></td>
142
+ <td>Nov 15, 2025</td>
143
+ </tr>
144
+ <tr>
145
+ <td>#102</td>
146
+ <td>Update documentation</td>
147
+ <td><span class="badge badge-warning">Medium</span></td>
148
+ <td>Nov 18, 2025</td>
149
+ </tr>
150
+ <tr>
151
+ <td>#103</td>
152
+ <td>Refactor CSS</td>
153
+ <td><span class="badge badge-info">Low</span></td>
154
+ <td>Nov 25, 2025</td>
155
+ </tr>
156
+ <tr>
157
+ <td>#104</td>
158
+ <td>Add unit tests</td>
159
+ <td><span class="badge badge-warning">Medium</span></td>
160
+ <td>Nov 20, 2025</td>
161
+ </tr>
162
+ <tr>
163
+ <td>#105</td>
164
+ <td>Performance audit</td>
165
+ <td><span class="badge badge-danger">High</span></td>
166
+ <td>Nov 17, 2025</td>
167
+ </tr>
168
+ </tbody>
169
+ </table>
170
+ </section>
171
+ `;
172
+
173
+ BorderedCompactTable.storyName = 'Bordered Compact Table';
174
+
175
+ export const ResponsiveTable = () => html`
176
+ ${tablesStoryStyles}
177
+ <section class="table-story-section">
178
+ <p class="table-story-description">
179
+ Resize the window to see horizontal scrolling on small screens
180
+ </p>
181
+ <div class="table-story-scroll">
182
+ <table class="table-striped">
183
+ <thead>
184
+ <tr>
185
+ <th>Order ID</th>
186
+ <th>Customer</th>
187
+ <th>Product</th>
188
+ <th>Quantity</th>
189
+ <th>Price</th>
190
+ <th>Total</th>
191
+ <th>Date</th>
192
+ <th>Status</th>
193
+ </tr>
194
+ </thead>
195
+ <tbody>
196
+ <tr>
197
+ <td>#ORD-001</td>
198
+ <td>John Doe</td>
199
+ <td>Premium Widget</td>
200
+ <td>3</td>
201
+ <td>$49.99</td>
202
+ <td>$149.97</td>
203
+ <td>Nov 15, 2025</td>
204
+ <td><span class="badge badge-success">Shipped</span></td>
205
+ </tr>
206
+ <tr>
207
+ <td>#ORD-002</td>
208
+ <td>Jane Smith</td>
209
+ <td>Standard Gadget</td>
210
+ <td>1</td>
211
+ <td>$29.99</td>
212
+ <td>$29.99</td>
213
+ <td>Nov 14, 2025</td>
214
+ <td><span class="badge badge-warning">Processing</span></td>
215
+ </tr>
216
+ <tr>
217
+ <td>#ORD-003</td>
218
+ <td>Bob Johnson</td>
219
+ <td>Deluxe Device</td>
220
+ <td>2</td>
221
+ <td>$99.99</td>
222
+ <td>$199.98</td>
223
+ <td>Nov 13, 2025</td>
224
+ <td><span class="badge badge-success">Delivered</span></td>
225
+ </tr>
226
+ </tbody>
227
+ </table>
228
+ </div>
229
+ </section>
230
+ `;
231
+
232
+ ResponsiveTable.storyName = 'Responsive Table';
@@ -0,0 +1,28 @@
1
+ import { html } from 'lit';
2
+ import referenceData from '../../dist/pds-reference.json';
3
+ import './reference-catalog.js';
4
+
5
+ export default {
6
+ title: 'Reference/Developer Catalog',
7
+ tags: ['reference', 'docs', 'internal'],
8
+ parameters: {
9
+ layout: 'fullscreen',
10
+ pds: {
11
+ tags: ['reference', 'catalog', 'developer']
12
+ },
13
+ docs: {
14
+ description: {
15
+ component: `Auto-generated reference that merges:
16
+ - <code>custom-elements.json</code> manifest data
17
+ - <code>src/js/pds-core/pds-ontology.js</code>
18
+ - Storybook metadata (pds tags + docs)
19
+
20
+ Run <code>npm run build-reference</code> to refresh the JSON pipeline before launching Storybook.`
21
+ }
22
+ }
23
+ }
24
+ };
25
+
26
+ export const Catalog = {
27
+ render: () => html`<pds-reference-catalog .data=${referenceData}></pds-reference-catalog>`
28
+ };