@appdirect/design-system 0.0.10 → 0.0.11

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 (64) hide show
  1. package/README.md +2 -0
  2. package/dist/ComplexComponents/PageContentHeader/PageContentHeader.tsx +24 -34
  3. package/dist/ComplexComponents/PageContentHeader/index.ts +0 -2
  4. package/dist/contracts/PageContentHeader.json +10 -5
  5. package/dist/contracts/index.json +1 -1
  6. package/dist/index.ts +3 -4
  7. package/dist/stories/Buttons/ActionIcon.stories.tsx +159 -0
  8. package/dist/stories/Buttons/Button.stories.tsx +145 -0
  9. package/dist/stories/Buttons/CloseButton.stories.tsx +121 -0
  10. package/dist/stories/Combobox/AutocompleteClearable.stories.tsx +554 -0
  11. package/dist/stories/Combobox/Combobox.stories.tsx +106 -0
  12. package/dist/stories/Combobox/Multiselect.stories.tsx +664 -0
  13. package/dist/stories/Combobox/SearchableSelect.stories.tsx +640 -0
  14. package/dist/stories/Combobox/Select.stories.tsx +311 -0
  15. package/dist/stories/ComplexComponents/DashboardWidget/DashboardWidget.stories.tsx +822 -0
  16. package/dist/stories/ComplexComponents/DataTable/DataTable.stories.tsx +502 -0
  17. package/dist/stories/ComplexComponents/KeyInsight/KeyInsights.stories.tsx +386 -0
  18. package/dist/stories/ComplexComponents/NameValue/NameValue.stories.tsx +405 -0
  19. package/dist/stories/ComplexComponents/PageContentHeader/PageContentHeader.stories.tsx +527 -0
  20. package/dist/stories/ComplexComponents/Placeholder/Placeholder.stories.tsx +76 -0
  21. package/dist/stories/ComplexComponents/Slat/Slat.stories.tsx +79 -0
  22. package/dist/stories/ComplexComponents/Utilities/CopyButton.stories.tsx +479 -0
  23. package/dist/stories/DataDisplay/Alert.stories.tsx +296 -0
  24. package/dist/stories/DataDisplay/Avatar.stories.tsx +251 -0
  25. package/dist/stories/DataDisplay/Badge.stories.tsx +176 -0
  26. package/dist/stories/DataDisplay/Card.stories.tsx +406 -0
  27. package/dist/stories/DataDisplay/Chip.stories.tsx +495 -0
  28. package/dist/stories/DataDisplay/Indicator.stories.tsx +571 -0
  29. package/dist/stories/DataDisplay/List.stories.tsx +376 -0
  30. package/dist/stories/DataDisplay/Pill.stories.tsx +506 -0
  31. package/dist/stories/DataDisplay/Progress.stories.tsx +352 -0
  32. package/dist/stories/DataDisplay/Table.stories.tsx +346 -0
  33. package/dist/stories/DataDisplay/ThemeIcon.stories.tsx +125 -0
  34. package/dist/stories/Inputs/Checkbox.stories.tsx +263 -0
  35. package/dist/stories/Inputs/ColorInput.stories.tsx +434 -0
  36. package/dist/stories/Inputs/DropZone.stories.tsx +401 -0
  37. package/dist/stories/Inputs/FileInput.stories.tsx +383 -0
  38. package/dist/stories/Inputs/NumberInput.stories.tsx +342 -0
  39. package/dist/stories/Inputs/Radio.stories.tsx +437 -0
  40. package/dist/stories/Inputs/RadioGroup.stories.tsx +526 -0
  41. package/dist/stories/Inputs/SegmentedControl.stories.tsx +60 -0
  42. package/dist/stories/Inputs/Slider.stories.tsx +22 -0
  43. package/dist/stories/Inputs/SliderWithLabel.stories.tsx +37 -0
  44. package/dist/stories/Inputs/Switch.stories.tsx +361 -0
  45. package/dist/stories/Inputs/TextArea.stories.tsx +355 -0
  46. package/dist/stories/Inputs/TextInput.stories.tsx +266 -0
  47. package/dist/stories/Misc/Divider.stories.tsx +581 -0
  48. package/dist/stories/Misc/Paper.stories.tsx +557 -0
  49. package/dist/stories/Navigation/Breadcrumb.stories.tsx +489 -0
  50. package/dist/stories/Navigation/NavLink.stories.tsx +601 -0
  51. package/dist/stories/Navigation/Stepper.stories.tsx +413 -0
  52. package/dist/stories/Navigation/Tabs.stories.tsx +528 -0
  53. package/dist/stories/Overlays/Drawer.stories.tsx +802 -0
  54. package/dist/stories/Overlays/Menu.stories.tsx +941 -0
  55. package/dist/stories/Overlays/Modal.stories.tsx +249 -0
  56. package/dist/stories/Overlays/Popover.stories.tsx +780 -0
  57. package/dist/stories/Overlays/Tooltip.stories.tsx +52 -0
  58. package/dist/stories/Typography/Code.stories.tsx +368 -0
  59. package/dist/stories/Typography/Kbd.stories.tsx +514 -0
  60. package/dist/stories/Typography/Text.stories.tsx +117 -0
  61. package/dist/stories/Typography/Title.stories.tsx +112 -0
  62. package/dist/stories/index.json +1435 -0
  63. package/package.json +5 -3
  64. package/dist/ComplexComponents/PageContentHeader/DescriptionBlock.tsx +0 -65
@@ -0,0 +1,506 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Stack, Box } from '@mantine/core';
3
+ import { Inline, Pill, Title, Text, Button, Paper } from '@appdirect/design-system';
4
+ import { useState } from 'react';
5
+
6
+ const meta: Meta<typeof Pill> = {
7
+ title: 'Design System/Data Display/Pill',
8
+ component: Pill,
9
+ parameters: {
10
+ layout: 'centered',
11
+ docs: {
12
+ description: {
13
+ component: 'Pill component for displaying tags, labels, or removable items with consistent gray styling. Disabled state is not supported.',
14
+ },
15
+ },
16
+ },
17
+ tags: ['autodocs', 'code-connected'],
18
+ argTypes: {
19
+ size: {
20
+ control: 'select',
21
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
22
+ description: 'Pill size',
23
+ },
24
+ withRemoveButton: {
25
+ control: 'boolean',
26
+ description: 'Whether the pill can be removed',
27
+ },
28
+ children: {
29
+ control: 'text',
30
+ description: 'Pill content',
31
+ },
32
+ },
33
+ };
34
+
35
+ export default meta;
36
+ type Story = StoryObj<typeof meta>;
37
+
38
+ export const Default: Story = {
39
+ args: {
40
+ children: 'Default Pill',
41
+ },
42
+ };
43
+
44
+ export const Sizes: Story = {
45
+ render: () => (
46
+ <Stack gap="md">
47
+ <Inline gap="sm">
48
+ <Pill size="xs">Extra Small</Pill>
49
+ <Pill size="sm">Small</Pill>
50
+ <Pill size="md">Medium</Pill>
51
+ <Pill size="lg">Large</Pill>
52
+ <Pill size="xl">Extra Large</Pill>
53
+ </Inline>
54
+ <Inline gap="sm">
55
+ <Pill size="xs">XS</Pill>
56
+ <Pill size="sm">SM</Pill>
57
+ <Pill size="md">MD</Pill>
58
+ <Pill size="lg">LG</Pill>
59
+ <Pill size="xl">XL</Pill>
60
+ </Inline>
61
+ </Stack>
62
+ ),
63
+ parameters: {
64
+ docs: {
65
+ description: {
66
+ story: 'Pill component in different sizes.',
67
+ },
68
+ },
69
+ },
70
+ };
71
+
72
+ export const WithRemoveButton: Story = {
73
+ render: () => (
74
+ <Inline gap="sm">
75
+ <Pill size="xs" withRemoveButton onRemove={() => console.log('Remove XS')}>
76
+ Extra Small
77
+ </Pill>
78
+ <Pill size="sm" withRemoveButton onRemove={() => console.log('Remove SM')}>
79
+ Small
80
+ </Pill>
81
+ <Pill size="md" withRemoveButton onRemove={() => console.log('Remove MD')}>
82
+ Medium
83
+ </Pill>
84
+ <Pill size="lg" withRemoveButton onRemove={() => console.log('Remove LG')}>
85
+ Large
86
+ </Pill>
87
+ <Pill size="xl" withRemoveButton onRemove={() => console.log('Remove XL')}>
88
+ Extra Large
89
+ </Pill>
90
+ </Inline>
91
+ ),
92
+ parameters: {
93
+ docs: {
94
+ description: {
95
+ story: 'Pills with remove buttons in different sizes.',
96
+ },
97
+ },
98
+ },
99
+ };
100
+
101
+ export const States: Story = {
102
+ render: () => (
103
+ <Stack gap="md">
104
+ <Inline gap="sm">
105
+ <Text size="sm" fw={500}>Normal:</Text>
106
+ <Pill>Normal Pill</Pill>
107
+ <Pill withRemoveButton onRemove={() => console.log('Remove')}>
108
+ With Remove
109
+ </Pill>
110
+ </Inline>
111
+ </Stack>
112
+ ),
113
+ parameters: {
114
+ docs: {
115
+ description: {
116
+ story: 'Different states of the Pill component.',
117
+ },
118
+ },
119
+ },
120
+ };
121
+
122
+ export const RemovablePills: Story = {
123
+ render: () => {
124
+ const [pills, setPills] = useState([
125
+ { id: 1, label: 'React' },
126
+ { id: 2, label: 'TypeScript' },
127
+ { id: 3, label: 'JavaScript' },
128
+ { id: 4, label: 'Node.js' },
129
+ { id: 5, label: 'Next.js' },
130
+ ]);
131
+
132
+ const removePill = (id: number) => {
133
+ setPills(prev => prev.filter(pill => pill.id !== id));
134
+ };
135
+
136
+ const resetPills = () => {
137
+ setPills([
138
+ { id: 1, label: 'React' },
139
+ { id: 2, label: 'TypeScript' },
140
+ { id: 3, label: 'JavaScript' },
141
+ { id: 4, label: 'Node.js' },
142
+ { id: 5, label: 'Next.js' },
143
+ ]);
144
+ };
145
+
146
+ return (
147
+ <Stack gap="md" w={400}>
148
+ <Text size="sm" fw={500}>Technologies (Click × to remove):</Text>
149
+ <Inline gap="xs">
150
+ {pills.map(pill => (
151
+ <Pill
152
+ key={pill.id}
153
+ withRemoveButton
154
+ onRemove={() => removePill(pill.id)}
155
+ >
156
+ {pill.label}
157
+ </Pill>
158
+ ))}
159
+ {pills.length === 0 && (
160
+ <Text size="sm" c="dimmed">No pills remaining</Text>
161
+ )}
162
+ </Inline>
163
+ {pills.length < 5 && (
164
+ <Button
165
+ variant="outline"
166
+ size="xs"
167
+ onClick={resetPills}
168
+ >
169
+ Reset Pills
170
+ </Button>
171
+ )}
172
+ </Stack>
173
+ );
174
+ },
175
+ parameters: {
176
+ docs: {
177
+ description: {
178
+ story: 'Interactive example of removable pills with state management.',
179
+ },
180
+ },
181
+ },
182
+ };
183
+
184
+ export const TagExamples: Story = {
185
+ render: () => (
186
+ <Stack gap="lg" w={500}>
187
+ <Box>
188
+ <Text size="sm" fw={500} mb="xs">Article Tags:</Text>
189
+ <Inline gap="xs">
190
+ <Pill size="sm">JavaScript</Pill>
191
+ <Pill size="sm">React</Pill>
192
+ <Pill size="sm">Tutorial</Pill>
193
+ <Pill size="sm">Beginner</Pill>
194
+ <Pill size="sm">Frontend</Pill>
195
+ </Inline>
196
+ </Box>
197
+
198
+ <Box>
199
+ <Text size="sm" fw={500} mb="xs">Skills:</Text>
200
+ <Inline gap="xs">
201
+ <Pill>TypeScript</Pill>
202
+ <Pill>Node.js</Pill>
203
+ <Pill>Python</Pill>
204
+ <Pill>GraphQL</Pill>
205
+ <Pill>Docker</Pill>
206
+ <Pill>AWS</Pill>
207
+ </Inline>
208
+ </Box>
209
+
210
+ <Box>
211
+ <Text size="sm" fw={500} mb="xs">Categories:</Text>
212
+ <Inline gap="xs">
213
+ <Pill size="lg">Web Development</Pill>
214
+ <Pill size="lg">Mobile Apps</Pill>
215
+ <Pill size="lg">DevOps</Pill>
216
+ <Pill size="lg">Design</Pill>
217
+ </Inline>
218
+ </Box>
219
+
220
+ <Box>
221
+ <Text size="sm" fw={500} mb="xs">Project Labels:</Text>
222
+ <Inline gap="xs">
223
+ <Pill size="xs">v1.0</Pill>
224
+ <Pill size="xs">beta</Pill>
225
+ <Pill size="xs">stable</Pill>
226
+ <Pill size="xs">deprecated</Pill>
227
+ <Pill size="xs">experimental</Pill>
228
+ </Inline>
229
+ </Box>
230
+ </Stack>
231
+ ),
232
+ parameters: {
233
+ docs: {
234
+ description: {
235
+ story: 'Examples of using pills as non-removable tags and labels.',
236
+ },
237
+ },
238
+ },
239
+ };
240
+
241
+ export const FilterPills: Story = {
242
+ render: () => {
243
+ const [selectedFilters, setSelectedFilters] = useState<string[]>(['react', 'typescript']);
244
+
245
+ const filters = [
246
+ 'React', 'Vue', 'Angular', 'Svelte',
247
+ 'TypeScript', 'JavaScript', 'Python', 'Java',
248
+ 'Frontend', 'Backend', 'Full Stack', 'Mobile'
249
+ ];
250
+
251
+ const toggleFilter = (filter: string) => {
252
+ const filterKey = filter.toLowerCase().replace(' ', '');
253
+ setSelectedFilters(prev =>
254
+ prev.includes(filterKey)
255
+ ? prev.filter(f => f !== filterKey)
256
+ : [...prev, filterKey]
257
+ );
258
+ };
259
+
260
+ return (
261
+ <Stack gap="md" w={500}>
262
+ <Text size="sm" fw={500}>Active Filters (Click to remove):</Text>
263
+ <Inline gap="xs">
264
+ {filters
265
+ .filter(filter => selectedFilters.includes(filter.toLowerCase().replace(' ', '')))
266
+ .map(filter => (
267
+ <Pill
268
+ key={filter}
269
+ withRemoveButton
270
+ onRemove={() => toggleFilter(filter)}
271
+ >
272
+ {filter}
273
+ </Pill>
274
+ ))}
275
+ {selectedFilters.length === 0 && (
276
+ <Text size="sm" c="dimmed">No active filters</Text>
277
+ )}
278
+ </Inline>
279
+
280
+ <Text size="sm" fw={500}>Available Filters (Click to add):</Text>
281
+ <Inline gap="xs">
282
+ {filters
283
+ .filter(filter => !selectedFilters.includes(filter.toLowerCase().replace(' ', '')))
284
+ .map(filter => (
285
+ <Button
286
+ key={filter}
287
+ variant="outline"
288
+ size="xs"
289
+ onClick={() => toggleFilter(filter)}
290
+ >
291
+ + {filter}
292
+ </Button>
293
+ ))}
294
+ </Inline>
295
+ </Stack>
296
+ );
297
+ },
298
+ parameters: {
299
+ docs: {
300
+ description: {
301
+ story: 'Interactive example using pills for filter management.',
302
+ },
303
+ },
304
+ },
305
+ };
306
+
307
+ export const ControlledExample: Story = {
308
+ render: () => {
309
+ const [selectedTags, setSelectedTags] = useState<string[]>(['javascript', 'react']);
310
+ const [selectedCategories, setSelectedCategories] = useState<string[]>(['frontend']);
311
+ const [selectedSkills, setSelectedSkills] = useState<string[]>(['typescript', 'nodejs']);
312
+
313
+ const removeTag = (category: 'tags' | 'categories' | 'skills', value: string) => {
314
+ switch (category) {
315
+ case 'tags':
316
+ setSelectedTags(prev => prev.filter(tag => tag !== value));
317
+ break;
318
+ case 'categories':
319
+ setSelectedCategories(prev => prev.filter(cat => cat !== value));
320
+ break;
321
+ case 'skills':
322
+ setSelectedSkills(prev => prev.filter(skill => skill !== value));
323
+ break;
324
+ }
325
+ };
326
+
327
+ const tagLabels: Record<string, string> = {
328
+ javascript: 'JavaScript',
329
+ react: 'React',
330
+ vue: 'Vue.js',
331
+ angular: 'Angular',
332
+ frontend: 'Frontend',
333
+ backend: 'Backend',
334
+ fullstack: 'Full Stack',
335
+ typescript: 'TypeScript',
336
+ nodejs: 'Node.js',
337
+ python: 'Python',
338
+ };
339
+
340
+ return (
341
+ <Stack gap="lg" w={500}>
342
+ <Box>
343
+ <Text size="sm" fw={500} mb="sm">Technology Tags:</Text>
344
+ <Inline gap="xs">
345
+ {selectedTags.map(tag => (
346
+ <Pill
347
+ key={tag}
348
+ size="sm"
349
+ withRemoveButton
350
+ onRemove={() => removeTag('tags', tag)}
351
+ >
352
+ {tagLabels[tag]}
353
+ </Pill>
354
+ ))}
355
+ {selectedTags.length === 0 && (
356
+ <Text size="sm" c="dimmed">No tags selected</Text>
357
+ )}
358
+ </Inline>
359
+ </Box>
360
+
361
+ <Box>
362
+ <Text size="sm" fw={500} mb="sm">Categories:</Text>
363
+ <Inline gap="xs">
364
+ {selectedCategories.map(category => (
365
+ <Pill
366
+ key={category}
367
+ withRemoveButton
368
+ onRemove={() => removeTag('categories', category)}
369
+ >
370
+ {tagLabels[category]}
371
+ </Pill>
372
+ ))}
373
+ {selectedCategories.length === 0 && (
374
+ <Text size="sm" c="dimmed">No categories selected</Text>
375
+ )}
376
+ </Inline>
377
+ </Box>
378
+
379
+ <Box>
380
+ <Text size="sm" fw={500} mb="sm">Skills:</Text>
381
+ <Inline gap="xs">
382
+ {selectedSkills.map(skill => (
383
+ <Pill
384
+ key={skill}
385
+ size="lg"
386
+ withRemoveButton
387
+ onRemove={() => removeTag('skills', skill)}
388
+ >
389
+ {tagLabels[skill]}
390
+ </Pill>
391
+ ))}
392
+ {selectedSkills.length === 0 && (
393
+ <Text size="sm" c="dimmed">No skills selected</Text>
394
+ )}
395
+ </Inline>
396
+ </Box>
397
+
398
+ <Paper variant="border">
399
+ <Text size="sm" fw={500} mb="xs">Summary:</Text>
400
+ <Text size="sm">
401
+ Tags: {selectedTags.length} |
402
+ Categories: {selectedCategories.length} |
403
+ Skills: {selectedSkills.length}
404
+ </Text>
405
+ </Paper>
406
+ </Stack>
407
+ );
408
+ },
409
+ parameters: {
410
+ docs: {
411
+ description: {
412
+ story: 'Complex example with multiple controlled pill groups.',
413
+ },
414
+ },
415
+ },
416
+ };
417
+
418
+ export const UseCases: Story = {
419
+ render: () => (
420
+ <Stack gap="lg" w={600}>
421
+ <Title order={3} size="md" fw={500} mb="xs">Common Use Cases</Title>
422
+
423
+ <Box>
424
+ <Text size="sm" fw={500} mb="sm">1. Content Tags (Non-removable):</Text>
425
+ <Inline gap="xs">
426
+ <Pill size="sm">React</Pill>
427
+ <Pill size="sm">TypeScript</Pill>
428
+ <Pill size="sm">Tutorial</Pill>
429
+ <Pill size="sm">Beginner</Pill>
430
+ </Inline>
431
+ </Box>
432
+
433
+ <Box>
434
+ <Text size="sm" fw={500} mb="sm">2. Selected Items (Removable):</Text>
435
+ <Inline gap="xs">
436
+ <Pill withRemoveButton onRemove={() => console.log('Remove JavaScript')}>
437
+ JavaScript
438
+ </Pill>
439
+ <Pill withRemoveButton onRemove={() => console.log('Remove Python')}>
440
+ Python
441
+ </Pill>
442
+ <Pill withRemoveButton onRemove={() => console.log('Remove Java')}>
443
+ Java
444
+ </Pill>
445
+ </Inline>
446
+ </Box>
447
+
448
+ <Box>
449
+ <Text size="sm" fw={500} mb="sm">3. User Skills:</Text>
450
+ <Inline gap="xs">
451
+ <Pill>Frontend Development</Pill>
452
+ <Pill>UI/UX Design</Pill>
453
+ <Pill>Project Management</Pill>
454
+ <Pill>Team Leadership</Pill>
455
+ </Inline>
456
+ </Box>
457
+
458
+ <Box>
459
+ <Text size="sm" fw={500} mb="sm">4. Version Labels:</Text>
460
+ <Inline gap="xs">
461
+ <Pill size="xs">v2.1.0</Pill>
462
+ <Pill size="xs">stable</Pill>
463
+ <Pill size="xs">LTS</Pill>
464
+ <Pill size="xs">production</Pill>
465
+ </Inline>
466
+ </Box>
467
+
468
+ <Box>
469
+ <Text size="sm" fw={500} mb="sm">5. Filter Chips:</Text>
470
+ <Inline gap="xs">
471
+ <Pill size="lg" withRemoveButton onRemove={() => console.log('Remove Web Dev')}>
472
+ Web Development
473
+ </Pill>
474
+ <Pill size="lg" withRemoveButton onRemove={() => console.log('Remove Mobile')}>
475
+ Mobile Apps
476
+ </Pill>
477
+ <Pill size="lg" withRemoveButton onRemove={() => console.log('Remove DevOps')}>
478
+ DevOps
479
+ </Pill>
480
+ </Inline>
481
+ </Box>
482
+ </Stack>
483
+ ),
484
+ parameters: {
485
+ docs: {
486
+ description: {
487
+ story: 'Real-world examples of Pill usage in different application contexts.',
488
+ },
489
+ },
490
+ },
491
+ };
492
+
493
+ export const Interactive: Story = {
494
+ args: {
495
+ children: 'Interactive Pill',
496
+ size: 'md',
497
+ withRemoveButton: false,
498
+ },
499
+ parameters: {
500
+ docs: {
501
+ description: {
502
+ story: 'Use the controls below to interact with the Pill and see different combinations.',
503
+ },
504
+ },
505
+ },
506
+ };