@pure-ds/storybook 0.3.19 → 0.4.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 (39) hide show
  1. package/.storybook/addons/pds-configurator/SearchTool.js +44 -44
  2. package/dist/pds-reference.json +65 -13
  3. package/package.json +50 -50
  4. package/stories/components/PdsCalendar.stories.js +266 -263
  5. package/stories/components/PdsDrawer.stories.js +2 -2
  6. package/stories/components/PdsIcon.stories.js +2 -2
  7. package/stories/components/PdsJsonform.stories.js +2 -2
  8. package/stories/components/PdsRichtext.stories.js +367 -367
  9. package/stories/components/PdsScrollrow.stories.js +140 -140
  10. package/stories/components/PdsSplitpanel.stories.js +502 -502
  11. package/stories/components/PdsTabstrip.stories.js +2 -2
  12. package/stories/components/PdsToaster.stories.js +186 -186
  13. package/stories/components/PdsUpload.stories.js +66 -66
  14. package/stories/enhancements/Dropdowns.stories.js +185 -185
  15. package/stories/enhancements/InteractiveStates.stories.js +625 -625
  16. package/stories/enhancements/MeshGradients.stories.js +321 -320
  17. package/stories/enhancements/OpenGroups.stories.js +227 -227
  18. package/stories/enhancements/RangeSliders.stories.js +232 -232
  19. package/stories/enhancements/RequiredFields.stories.js +189 -189
  20. package/stories/enhancements/Toggles.stories.js +167 -167
  21. package/stories/foundations/Colors.stories.js +2 -1
  22. package/stories/foundations/Icons.stories.js +4 -0
  23. package/stories/foundations/SmartSurfaces.stories.js +485 -367
  24. package/stories/foundations/Spacing.stories.js +5 -1
  25. package/stories/foundations/Typography.stories.js +4 -0
  26. package/stories/foundations/ZIndex.stories.js +329 -325
  27. package/stories/layout/LayoutOverview.stories.js +247 -0
  28. package/stories/layout/LayoutSystem.stories.js +852 -0
  29. package/stories/patterns/BorderEffects.stories.js +74 -72
  30. package/stories/primitives/Accordion.stories.js +5 -3
  31. package/stories/primitives/Alerts.stories.js +261 -46
  32. package/stories/primitives/Badges.stories.js +4 -0
  33. package/stories/primitives/Buttons.stories.js +2 -2
  34. package/stories/primitives/Cards.stories.js +98 -170
  35. package/stories/primitives/Media.stories.js +442 -203
  36. package/stories/primitives/Tables.stories.js +358 -232
  37. package/stories/utilities/Backdrop.stories.js +197 -0
  38. package/stories/patterns/Layout.stories.js +0 -99
  39. package/stories/utilities/GridSystem.stories.js +0 -208
@@ -1,263 +1,266 @@
1
- import { html } from 'lit';
2
-
3
- const docsParameters = {
4
- description: {
5
- component: 'A fully featured calendar component with month navigation, event display, and expandable day views'
6
- }
7
- };
8
-
9
- if (typeof window !== 'undefined') {
10
- import('../reference/reference-docs.js')
11
- .then(({ createComponentDocsPage }) => {
12
- docsParameters.page = createComponentDocsPage('pds-calendar');
13
- })
14
- .catch((error) => {
15
- console.warn('storybook: docs page failed to load for pds-calendar', error);
16
- });
17
- }
18
-
19
- export default {
20
- title: 'Components/Pds Calendar',
21
- tags: ['autodocs'],
22
- parameters: {
23
- docs: docsParameters
24
- },
25
- argTypes: {
26
- date: {
27
- control: 'text',
28
- description: 'The date to display (defaults to current date). Accepts any valid date string'
29
- }
30
- }
31
- };
32
-
33
- // Sample event data generator
34
- const getEventData = () => ({
35
- 5: [
36
- { title: 'Team Standup', type: 'primary' },
37
- { title: 'Code Review Session', type: 'info' }
38
- ],
39
- 12: [
40
- { title: 'Sprint Planning', type: 'primary' }
41
- ],
42
- 15: [
43
- { title: 'Client Meeting', type: 'warning' },
44
- { title: 'Design Review', type: 'info' }
45
- ],
46
- 18: [
47
- { title: 'Deployment Window', type: 'danger' }
48
- ],
49
- 20: [
50
- { title: 'Team Retrospective', type: 'primary' },
51
- { title: 'Documentation Review', type: 'info' }
52
- ],
53
- 25: [
54
- { title: 'Holiday Event', type: 'warning' }
55
- ],
56
- 28: [
57
- { title: 'Release Candidate Review', type: 'danger' },
58
- { title: 'Performance Testing', type: 'info' }
59
- ]
60
- });
61
-
62
- export const Default = {
63
- render: (args) => {
64
- setTimeout(() => {
65
- const calendar = document.querySelector('#default-calendar');
66
- if (calendar) {
67
- calendar.addEventListener('month-rendered', (e) => {
68
- e.detail.fill(getEventData());
69
- });
70
- }
71
- }, 0);
72
-
73
- return html`
74
- <pds-calendar id="default-calendar"></pds-calendar>
75
- `;
76
- },
77
- args: {
78
- date: ''
79
- }
80
- };
81
-
82
- export const WithSpecificDate = {
83
- render: () => {
84
- setTimeout(() => {
85
- const calendar = document.querySelector('#specific-date-calendar');
86
- if (calendar) {
87
- calendar.addEventListener('month-rendered', (e) => {
88
- e.detail.fill({
89
- 10: [
90
- { title: 'Important Meeting', type: 'danger' }
91
- ],
92
- 15: [
93
- { title: 'Project Kickoff', type: 'primary' }
94
- ],
95
- 25: [
96
- { title: 'Holiday', type: 'warning' }
97
- ]
98
- });
99
- });
100
- }
101
- }, 0);
102
-
103
- return html`
104
- <pds-calendar id="specific-date-calendar" date="2024-12-01"></pds-calendar>
105
- `;
106
- }
107
- };
108
-
109
- export const WithManyEvents = {
110
- render: () => {
111
- setTimeout(() => {
112
- const calendar = document.querySelector('#many-events-calendar');
113
- if (calendar) {
114
- calendar.addEventListener('month-rendered', (e) => {
115
- const events = {};
116
-
117
- // Generate events for every other day
118
- for (let i = 1; i <= 30; i += 2) {
119
- const types = ['primary', 'info', 'warning', 'danger'];
120
- const eventCount = Math.floor(Math.random() * 3) + 1;
121
- events[i] = [];
122
-
123
- for (let j = 0; j < eventCount; j++) {
124
- events[i].push({
125
- title: `Event ${j + 1} on Day ${i}`,
126
- type: types[Math.floor(Math.random() * types.length)]
127
- });
128
- }
129
- }
130
-
131
- e.detail.fill(events);
132
- });
133
- }
134
- }, 0);
135
-
136
- return html`
137
- <pds-calendar id="many-events-calendar"></pds-calendar>
138
- `;
139
- }
140
- };
141
-
142
- export const EventTypes = {
143
- render: () => {
144
- setTimeout(() => {
145
- const calendar = document.querySelector('#event-types-calendar');
146
- if (calendar) {
147
- calendar.addEventListener('month-rendered', (e) => {
148
- e.detail.fill({
149
- 5: [
150
- { title: 'Primary Event', type: 'primary' }
151
- ],
152
- 10: [
153
- { title: 'Info Event', type: 'info' }
154
- ],
155
- 15: [
156
- { title: 'Warning Event', type: 'warning' }
157
- ],
158
- 20: [
159
- { title: 'Danger Event', type: 'danger' }
160
- ],
161
- 25: [
162
- { title: 'Primary Event', type: 'primary' },
163
- { title: 'Info Event', type: 'info' },
164
- { title: 'Warning Event', type: 'warning' },
165
- { title: 'Danger Event', type: 'danger' }
166
- ]
167
- });
168
- });
169
- }
170
- }, 0);
171
-
172
- return html`
173
- <div class="flex flex-col gap-lg">
174
- <pds-calendar id="event-types-calendar"></pds-calendar>
175
-
176
- <div class="card">
177
- <h3>Event Types</h3>
178
- <ul>
179
- <li><strong>Primary:</strong> Blue - Main events and important tasks</li>
180
- <li><strong>Info:</strong> Light blue - Informational items and notes</li>
181
- <li><strong>Warning:</strong> Yellow - Attention required items</li>
182
- <li><strong>Danger:</strong> Red - Critical deadlines and alerts</li>
183
- </ul>
184
- </div>
185
- </div>
186
- `;
187
- }
188
- };
189
-
190
- export const DynamicEvents = {
191
- render: () => {
192
- setTimeout(() => {
193
- const calendar = document.querySelector('#dynamic-calendar');
194
- const addButton = document.querySelector('#add-event-btn');
195
- const dayInput = document.querySelector('#event-day-input');
196
- const titleInput = document.querySelector('#event-title-input');
197
- const typeSelect = document.querySelector('#event-type-select');
198
-
199
- let currentEvents = {
200
- 10: [{ title: 'Existing Event', type: 'primary' }]
201
- };
202
-
203
- // Setup persistent event listener
204
- if (calendar) {
205
- calendar.addEventListener('month-rendered', (e) => {
206
- e.detail.fill(currentEvents);
207
- });
208
- }
209
-
210
- if (addButton && calendar) {
211
- addButton.onclick = () => {
212
- const day = parseInt(dayInput.value);
213
- const title = titleInput.value;
214
- const type = typeSelect.value;
215
-
216
- if (day && title) {
217
- if (!currentEvents[day]) {
218
- currentEvents[day] = [];
219
- }
220
- currentEvents[day].push({ title, type });
221
-
222
- // Trigger re-render
223
- calendar.refresh();
224
-
225
- // Clear inputs
226
- titleInput.value = '';
227
- dayInput.value = '';
228
- }
229
- };
230
- }
231
- }, 0);
232
-
233
- return html`
234
- <div class="flex flex-col gap-lg">
235
- <div class="card">
236
- <h3>Add Events Dynamically</h3>
237
- <div class="flex gap-md items-end">
238
- <div class="form-group">
239
- <label for="event-day-input">Day</label>
240
- <input id="event-day-input" type="number" min="1" max="31" placeholder="Day" class="input" />
241
- </div>
242
- <div class="form-group flex-1">
243
- <label for="event-title-input">Title</label>
244
- <input id="event-title-input" type="text" placeholder="Event title" class="input" />
245
- </div>
246
- <div class="form-group">
247
- <label for="event-type-select">Type</label>
248
- <select id="event-type-select" class="input">
249
- <option value="primary">Primary</option>
250
- <option value="info">Info</option>
251
- <option value="warning">Warning</option>
252
- <option value="danger">Danger</option>
253
- </select>
254
- </div>
255
- <button id="add-event-btn" class="btn-primary">Add Event</button>
256
- </div>
257
- </div>
258
-
259
- <pds-calendar id="dynamic-calendar"></pds-calendar>
260
- </div>
261
- `;
262
- }
263
- };
1
+ import { html } from 'lit';
2
+
3
+ const docsParameters = {
4
+ description: {
5
+ component: 'A fully featured calendar component with month navigation, event display, and expandable day views'
6
+ }
7
+ };
8
+
9
+ if (typeof window !== 'undefined') {
10
+ import('../reference/reference-docs.js')
11
+ .then(({ createComponentDocsPage }) => {
12
+ docsParameters.page = createComponentDocsPage('pds-calendar');
13
+ })
14
+ .catch((error) => {
15
+ console.warn('storybook: docs page failed to load for pds-calendar', error);
16
+ });
17
+ }
18
+
19
+ export default {
20
+ title: 'Components/Pds Calendar',
21
+ tags: ['autodocs', 'calendar', 'date', 'datepicker', 'event', 'schedule'],
22
+ parameters: {
23
+ pds: {
24
+ tags: ['calendar', 'date', 'datepicker', 'event', 'schedule', 'pds-calendar']
25
+ },
26
+ docs: docsParameters
27
+ },
28
+ argTypes: {
29
+ date: {
30
+ control: 'text',
31
+ description: 'The date to display (defaults to current date). Accepts any valid date string'
32
+ }
33
+ }
34
+ };
35
+
36
+ // Sample event data generator
37
+ const getEventData = () => ({
38
+ 5: [
39
+ { title: 'Team Standup', type: 'primary' },
40
+ { title: 'Code Review Session', type: 'info' }
41
+ ],
42
+ 12: [
43
+ { title: 'Sprint Planning', type: 'primary' }
44
+ ],
45
+ 15: [
46
+ { title: 'Client Meeting', type: 'warning' },
47
+ { title: 'Design Review', type: 'info' }
48
+ ],
49
+ 18: [
50
+ { title: 'Deployment Window', type: 'danger' }
51
+ ],
52
+ 20: [
53
+ { title: 'Team Retrospective', type: 'primary' },
54
+ { title: 'Documentation Review', type: 'info' }
55
+ ],
56
+ 25: [
57
+ { title: 'Holiday Event', type: 'warning' }
58
+ ],
59
+ 28: [
60
+ { title: 'Release Candidate Review', type: 'danger' },
61
+ { title: 'Performance Testing', type: 'info' }
62
+ ]
63
+ });
64
+
65
+ export const Default = {
66
+ render: (args) => {
67
+ setTimeout(() => {
68
+ const calendar = document.querySelector('#default-calendar');
69
+ if (calendar) {
70
+ calendar.addEventListener('month-rendered', (e) => {
71
+ e.detail.fill(getEventData());
72
+ });
73
+ }
74
+ }, 0);
75
+
76
+ return html`
77
+ <pds-calendar id="default-calendar"></pds-calendar>
78
+ `;
79
+ },
80
+ args: {
81
+ date: ''
82
+ }
83
+ };
84
+
85
+ export const WithSpecificDate = {
86
+ render: () => {
87
+ setTimeout(() => {
88
+ const calendar = document.querySelector('#specific-date-calendar');
89
+ if (calendar) {
90
+ calendar.addEventListener('month-rendered', (e) => {
91
+ e.detail.fill({
92
+ 10: [
93
+ { title: 'Important Meeting', type: 'danger' }
94
+ ],
95
+ 15: [
96
+ { title: 'Project Kickoff', type: 'primary' }
97
+ ],
98
+ 25: [
99
+ { title: 'Holiday', type: 'warning' }
100
+ ]
101
+ });
102
+ });
103
+ }
104
+ }, 0);
105
+
106
+ return html`
107
+ <pds-calendar id="specific-date-calendar" date="2024-12-01"></pds-calendar>
108
+ `;
109
+ }
110
+ };
111
+
112
+ export const WithManyEvents = {
113
+ render: () => {
114
+ setTimeout(() => {
115
+ const calendar = document.querySelector('#many-events-calendar');
116
+ if (calendar) {
117
+ calendar.addEventListener('month-rendered', (e) => {
118
+ const events = {};
119
+
120
+ // Generate events for every other day
121
+ for (let i = 1; i <= 30; i += 2) {
122
+ const types = ['primary', 'info', 'warning', 'danger'];
123
+ const eventCount = Math.floor(Math.random() * 3) + 1;
124
+ events[i] = [];
125
+
126
+ for (let j = 0; j < eventCount; j++) {
127
+ events[i].push({
128
+ title: `Event ${j + 1} on Day ${i}`,
129
+ type: types[Math.floor(Math.random() * types.length)]
130
+ });
131
+ }
132
+ }
133
+
134
+ e.detail.fill(events);
135
+ });
136
+ }
137
+ }, 0);
138
+
139
+ return html`
140
+ <pds-calendar id="many-events-calendar"></pds-calendar>
141
+ `;
142
+ }
143
+ };
144
+
145
+ export const EventTypes = {
146
+ render: () => {
147
+ setTimeout(() => {
148
+ const calendar = document.querySelector('#event-types-calendar');
149
+ if (calendar) {
150
+ calendar.addEventListener('month-rendered', (e) => {
151
+ e.detail.fill({
152
+ 5: [
153
+ { title: 'Primary Event', type: 'primary' }
154
+ ],
155
+ 10: [
156
+ { title: 'Info Event', type: 'info' }
157
+ ],
158
+ 15: [
159
+ { title: 'Warning Event', type: 'warning' }
160
+ ],
161
+ 20: [
162
+ { title: 'Danger Event', type: 'danger' }
163
+ ],
164
+ 25: [
165
+ { title: 'Primary Event', type: 'primary' },
166
+ { title: 'Info Event', type: 'info' },
167
+ { title: 'Warning Event', type: 'warning' },
168
+ { title: 'Danger Event', type: 'danger' }
169
+ ]
170
+ });
171
+ });
172
+ }
173
+ }, 0);
174
+
175
+ return html`
176
+ <div class="flex flex-col gap-lg">
177
+ <pds-calendar id="event-types-calendar"></pds-calendar>
178
+
179
+ <div class="card">
180
+ <h3>Event Types</h3>
181
+ <ul>
182
+ <li><strong>Primary:</strong> Blue - Main events and important tasks</li>
183
+ <li><strong>Info:</strong> Light blue - Informational items and notes</li>
184
+ <li><strong>Warning:</strong> Yellow - Attention required items</li>
185
+ <li><strong>Danger:</strong> Red - Critical deadlines and alerts</li>
186
+ </ul>
187
+ </div>
188
+ </div>
189
+ `;
190
+ }
191
+ };
192
+
193
+ export const DynamicEvents = {
194
+ render: () => {
195
+ setTimeout(() => {
196
+ const calendar = document.querySelector('#dynamic-calendar');
197
+ const addButton = document.querySelector('#add-event-btn');
198
+ const dayInput = document.querySelector('#event-day-input');
199
+ const titleInput = document.querySelector('#event-title-input');
200
+ const typeSelect = document.querySelector('#event-type-select');
201
+
202
+ let currentEvents = {
203
+ 10: [{ title: 'Existing Event', type: 'primary' }]
204
+ };
205
+
206
+ // Setup persistent event listener
207
+ if (calendar) {
208
+ calendar.addEventListener('month-rendered', (e) => {
209
+ e.detail.fill(currentEvents);
210
+ });
211
+ }
212
+
213
+ if (addButton && calendar) {
214
+ addButton.onclick = () => {
215
+ const day = parseInt(dayInput.value);
216
+ const title = titleInput.value;
217
+ const type = typeSelect.value;
218
+
219
+ if (day && title) {
220
+ if (!currentEvents[day]) {
221
+ currentEvents[day] = [];
222
+ }
223
+ currentEvents[day].push({ title, type });
224
+
225
+ // Trigger re-render
226
+ calendar.refresh();
227
+
228
+ // Clear inputs
229
+ titleInput.value = '';
230
+ dayInput.value = '';
231
+ }
232
+ };
233
+ }
234
+ }, 0);
235
+
236
+ return html`
237
+ <div class="flex flex-col gap-lg">
238
+ <div class="card">
239
+ <h3>Add Events Dynamically</h3>
240
+ <div class="flex gap-md items-end">
241
+ <div class="form-group">
242
+ <label for="event-day-input">Day</label>
243
+ <input id="event-day-input" type="number" min="1" max="31" placeholder="Day" class="input" />
244
+ </div>
245
+ <div class="form-group flex-1">
246
+ <label for="event-title-input">Title</label>
247
+ <input id="event-title-input" type="text" placeholder="Event title" class="input" />
248
+ </div>
249
+ <div class="form-group">
250
+ <label for="event-type-select">Type</label>
251
+ <select id="event-type-select" class="input">
252
+ <option value="primary">Primary</option>
253
+ <option value="info">Info</option>
254
+ <option value="warning">Warning</option>
255
+ <option value="danger">Danger</option>
256
+ </select>
257
+ </div>
258
+ <button id="add-event-btn" class="btn-primary">Add Event</button>
259
+ </div>
260
+ </div>
261
+
262
+ <pds-calendar id="dynamic-calendar"></pds-calendar>
263
+ </div>
264
+ `;
265
+ }
266
+ };
@@ -18,10 +18,10 @@ if (typeof window !== 'undefined') {
18
18
 
19
19
  export default {
20
20
  title: 'Components/Pds Drawer',
21
- tags: ['autodocs', 'grouping'],
21
+ tags: ['autodocs', 'drawer', 'panel', 'sidebar', 'overlay', 'navigation', 'modal'],
22
22
  parameters: {
23
23
  pds: {
24
- tags: ['navigation', 'layout', 'grouping', 'interaction']
24
+ tags: ['drawer', 'panel', 'sidebar', 'overlay', 'navigation', 'modal', 'pds-drawer', 'layout', 'grouping', 'interaction']
25
25
  },
26
26
  docs: docsParameters
27
27
  },
@@ -18,10 +18,10 @@ if (typeof window !== 'undefined') {
18
18
 
19
19
  export default {
20
20
  title: 'Components/Pds Icon',
21
- tags: ['autodocs', 'icons', 'svg', 'sprite', 'buttons'],
21
+ tags: ['autodocs', 'icon', 'icons', 'svg', 'sprite', 'phosphor', 'graphic', 'symbol'],
22
22
  parameters: {
23
23
  pds: {
24
- tags: ['icons', 'svg', 'sprite']
24
+ tags: ['icon', 'icons', 'svg', 'sprite', 'phosphor', 'graphic', 'symbol', 'pds-icon']
25
25
  },
26
26
  docs: docsParameters
27
27
  },
@@ -39,10 +39,10 @@ if (typeof window !== 'undefined') {
39
39
 
40
40
  export default {
41
41
  title: 'Components/Pds Jsonform',
42
- tags: ['autodocs', 'buttons', 'forms', 'interaction'],
42
+ tags: ['autodocs', 'form', 'forms', 'jsonform', 'json-schema', 'validation', 'input'],
43
43
  parameters: {
44
44
  pds: {
45
- tags: ['buttons', 'forms', 'interaction']
45
+ tags: ['form', 'forms', 'jsonform', 'json-schema', 'validation', 'input', 'pds-jsonform', 'interaction']
46
46
  },
47
47
  docs: docsParameters
48
48
  }