@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,437 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Stack } from '@mantine/core';
3
+ import { Radio, RadioGroup, Title, Text } from '@appdirect/design-system';
4
+ import { useState } from 'react';
5
+
6
+ const meta: Meta<typeof Radio> = {
7
+ title: 'Design System/Inputs/Radio',
8
+ component: Radio,
9
+ parameters: {
10
+ layout: 'centered',
11
+ docs: {
12
+ description: {
13
+ component: 'Radio component with consistent design system styling and t-shirt sizing. Use RadioGroup for multiple options.',
14
+ },
15
+ },
16
+ },
17
+ tags: ['autodocs', 'code-connected'],
18
+ argTypes: {
19
+ size: {
20
+ control: 'select',
21
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
22
+ description: 'Radio size',
23
+ },
24
+ label: {
25
+ control: 'text',
26
+ description: 'Radio label',
27
+ },
28
+ value: {
29
+ control: 'text',
30
+ description: 'Radio value',
31
+ },
32
+ checked: {
33
+ control: 'boolean',
34
+ description: 'Checked state',
35
+ },
36
+ disabled: {
37
+ control: 'boolean',
38
+ description: 'Disabled state',
39
+ },
40
+ required: {
41
+ control: 'boolean',
42
+ description: 'Required field indicator',
43
+ },
44
+ description: {
45
+ control: 'text',
46
+ description: 'Help text below the radio',
47
+ },
48
+ },
49
+ };
50
+
51
+ export default meta;
52
+ type Story = StoryObj<typeof meta>;
53
+
54
+ export const Default: Story = {
55
+ args: {
56
+ label: 'Select this option',
57
+ value: 'option1',
58
+ },
59
+ };
60
+
61
+ export const Sizes: Story = {
62
+ render: () => (
63
+ <Stack gap="md">
64
+ <Radio size="xs" label="Extra Small" value="xs" />
65
+ <Radio size="sm" label="Small" value="sm" />
66
+ <Radio size="md" label="Medium (Default)" value="md" />
67
+ <Radio size="lg" label="Large" value="lg" />
68
+ <Radio size="xl" label="Extra Large" value="xl" />
69
+ </Stack>
70
+ ),
71
+ };
72
+
73
+ export const States: Story = {
74
+ render: () => (
75
+ <Stack gap="md">
76
+ <Radio label="Unchecked" value="unchecked" />
77
+ <Radio label="Checked" value="checked" checked />
78
+ <Radio label="Disabled" value="disabled" disabled />
79
+ <Radio label="Disabled Checked" value="disabled-checked" disabled checked />
80
+ </Stack>
81
+ ),
82
+ };
83
+
84
+ export const BasicRadioGroup: Story = {
85
+ render: () => {
86
+ const [value, setValue] = useState('option1');
87
+
88
+ return (
89
+ <RadioGroup
90
+ label="Choose an option"
91
+ value={value}
92
+ onChange={(v) => setValue(String(v))}
93
+ >
94
+ <Stack gap="xs">
95
+ <Radio value="option1" label="First option" />
96
+ <Radio value="option2" label="Second option" />
97
+ <Radio value="option3" label="Third option" />
98
+ </Stack>
99
+ </RadioGroup>
100
+ );
101
+ },
102
+ parameters: {
103
+ docs: {
104
+ description: {
105
+ story: 'Basic RadioGroup with multiple options.',
106
+ },
107
+ },
108
+ },
109
+ };
110
+
111
+ export const RadioGroupSizes: Story = {
112
+ render: () => {
113
+ const [value, setValue] = useState('medium');
114
+
115
+ return (
116
+ <Stack gap="lg">
117
+ <RadioGroup
118
+ label="Extra Small"
119
+ size="xs"
120
+ value={value}
121
+ onChange={(v) => setValue(String(v))}
122
+ >
123
+ <Stack gap="xs">
124
+ <Radio value="xs1" label="Option 1" />
125
+ <Radio value="xs2" label="Option 2" />
126
+ </Stack>
127
+ </RadioGroup>
128
+
129
+ <RadioGroup
130
+ label="Small"
131
+ size="sm"
132
+ value={value}
133
+ onChange={(v) => setValue(String(v))}
134
+ >
135
+ <Stack gap="xs">
136
+ <Radio value="sm1" label="Option 1" />
137
+ <Radio value="sm2" label="Option 2" />
138
+ </Stack>
139
+ </RadioGroup>
140
+
141
+ <RadioGroup
142
+ label="Medium (Default)"
143
+ size="md"
144
+ value={value}
145
+ onChange={(v) => setValue(String(v))}
146
+ >
147
+ <Stack gap="xs">
148
+ <Radio value="md1" label="Option 1" />
149
+ <Radio value="md2" label="Option 2" />
150
+ </Stack>
151
+ </RadioGroup>
152
+
153
+ <RadioGroup
154
+ label="Large"
155
+ size="lg"
156
+ value={value}
157
+ onChange={(v) => setValue(String(v))}
158
+ >
159
+ <Stack gap="xs">
160
+ <Radio value="lg1" label="Option 1" />
161
+ <Radio value="lg2" label="Option 2" />
162
+ </Stack>
163
+ </RadioGroup>
164
+ </Stack>
165
+ );
166
+ },
167
+ };
168
+
169
+ export const WithDescriptions: Story = {
170
+ render: () => {
171
+ const [plan, setPlan] = useState('basic');
172
+
173
+ return (
174
+ <RadioGroup
175
+ label="Subscription Plan"
176
+ description="Choose the plan that best fits your needs"
177
+ value={plan}
178
+ onChange={(v) => setPlan(String(v))}
179
+ >
180
+ <Stack gap="xs">
181
+ <Radio
182
+ value="basic"
183
+ label="Basic Plan"
184
+ description="Perfect for individuals - $9/month"
185
+ />
186
+ <Radio
187
+ value="pro"
188
+ label="Pro Plan"
189
+ description="Great for small teams - $29/month"
190
+ />
191
+ <Radio
192
+ value="enterprise"
193
+ label="Enterprise Plan"
194
+ description="For large organizations - $99/month"
195
+ />
196
+ </Stack>
197
+ </RadioGroup>
198
+ );
199
+ },
200
+ };
201
+
202
+ export const Required: Story = {
203
+ render: () => {
204
+ const [payment, setPayment] = useState('');
205
+
206
+ return (
207
+ <RadioGroup
208
+ label="Payment Method"
209
+ description="Please select your preferred payment method"
210
+ value={payment}
211
+ onChange={(v) => setPayment(String(v))}
212
+ required
213
+ >
214
+ <Stack gap="xs">
215
+ <Radio value="card" label="Credit Card" />
216
+ <Radio value="paypal" label="PayPal" />
217
+ <Radio value="bank" label="Bank Transfer" />
218
+ <Radio value="crypto" label="Cryptocurrency" />
219
+ </Stack>
220
+ </RadioGroup>
221
+ );
222
+ },
223
+ };
224
+
225
+ export const FormExample: Story = {
226
+ render: () => {
227
+ const [accountType, setAccountType] = useState('personal');
228
+ const [plan, setPlan] = useState('basic');
229
+ const [billing, setBilling] = useState('monthly');
230
+
231
+ return (
232
+ <div style={{
233
+ maxWidth: '500px',
234
+ padding: '24px',
235
+ border: '1px solid var(--mantine-color-gray-3)',
236
+ borderRadius: '12px',
237
+ backgroundColor: 'white'
238
+ }}>
239
+ <Title order={3} mb="lg">Account Setup</Title>
240
+
241
+ <Stack gap="lg">
242
+ <RadioGroup
243
+ label="Account Type"
244
+ value={accountType}
245
+ onChange={(v) => setAccountType(String(v))}
246
+ required
247
+ >
248
+ <Stack gap="xs">
249
+ <Radio
250
+ value="personal"
251
+ label="Personal Account"
252
+ description="For individual use"
253
+ />
254
+ <Radio
255
+ value="business"
256
+ label="Business Account"
257
+ description="For teams and organizations"
258
+ />
259
+ </Stack>
260
+ </RadioGroup>
261
+
262
+ <RadioGroup
263
+ label="Plan Selection"
264
+ value={plan}
265
+ onChange={(v) => setPlan(String(v))}
266
+ required
267
+ >
268
+ <Stack gap="xs">
269
+ <Radio value="basic" label="Basic - Free" />
270
+ <Radio value="pro" label="Pro - $19/month" />
271
+ <Radio value="enterprise" label="Enterprise - $49/month" />
272
+ </Stack>
273
+ </RadioGroup>
274
+
275
+ <RadioGroup
276
+ label="Billing Cycle"
277
+ value={billing}
278
+ onChange={(v) => setBilling(String(v))}
279
+ >
280
+ <Stack gap="xs">
281
+ <Radio
282
+ value="monthly"
283
+ label="Monthly"
284
+ description="Pay monthly, cancel anytime"
285
+ />
286
+ <Radio
287
+ value="yearly"
288
+ label="Yearly"
289
+ description="Save 20% with annual billing"
290
+ />
291
+ </Stack>
292
+ </RadioGroup>
293
+ </Stack>
294
+
295
+ <div style={{
296
+ marginTop: '24px',
297
+ padding: '16px',
298
+ backgroundColor: 'var(--mantine-color-gray-0)',
299
+ borderRadius: '8px'
300
+ }}>
301
+ <Text size="sm" fw={500} mb="xs">Selected Configuration:</Text>
302
+ <Text size="sm">Account: {accountType}</Text>
303
+ <Text size="sm">Plan: {plan}</Text>
304
+ <Text size="sm">Billing: {billing}</Text>
305
+ </div>
306
+ </div>
307
+ );
308
+ },
309
+ parameters: {
310
+ docs: {
311
+ description: {
312
+ story: 'Example of Radio components used in a form layout.',
313
+ },
314
+ },
315
+ },
316
+ };
317
+
318
+ export const SurveyExample: Story = {
319
+ render: () => {
320
+ const [satisfaction, setSatisfaction] = useState('');
321
+ const [recommendation, setRecommendation] = useState('');
322
+ const [frequency, setFrequency] = useState('');
323
+
324
+ return (
325
+ <div style={{
326
+ maxWidth: '600px',
327
+ padding: '24px',
328
+ border: '1px solid var(--mantine-color-gray-3)',
329
+ borderRadius: '12px',
330
+ backgroundColor: 'white'
331
+ }}>
332
+ <Title order={3} mb="lg">Customer Feedback Survey</Title>
333
+
334
+ <Stack gap="lg">
335
+ <RadioGroup
336
+ label="How satisfied are you with our service?"
337
+ value={satisfaction}
338
+ onChange={(v) => setSatisfaction(String(v))}
339
+ required
340
+ >
341
+ <Stack gap="xs">
342
+ <Radio value="very-satisfied" label="Very Satisfied" />
343
+ <Radio value="satisfied" label="Satisfied" />
344
+ <Radio value="neutral" label="Neutral" />
345
+ <Radio value="dissatisfied" label="Dissatisfied" />
346
+ <Radio value="very-dissatisfied" label="Very Dissatisfied" />
347
+ </Stack>
348
+ </RadioGroup>
349
+
350
+ <RadioGroup
351
+ label="Would you recommend us to others?"
352
+ value={recommendation}
353
+ onChange={(v) => setRecommendation(String(v))}
354
+ required
355
+ >
356
+ <Stack gap="xs">
357
+ <Radio value="definitely" label="Definitely" />
358
+ <Radio value="probably" label="Probably" />
359
+ <Radio value="maybe" label="Maybe" />
360
+ <Radio value="probably-not" label="Probably Not" />
361
+ <Radio value="definitely-not" label="Definitely Not" />
362
+ </Stack>
363
+ </RadioGroup>
364
+
365
+ <RadioGroup
366
+ label="How often do you use our service?"
367
+ value={frequency}
368
+ onChange={(v) => setFrequency(String(v))}
369
+ >
370
+ <Stack gap="xs">
371
+ <Radio value="daily" label="Daily" />
372
+ <Radio value="weekly" label="Weekly" />
373
+ <Radio value="monthly" label="Monthly" />
374
+ <Radio value="rarely" label="Rarely" />
375
+ <Radio value="first-time" label="This is my first time" />
376
+ </Stack>
377
+ </RadioGroup>
378
+ </Stack>
379
+ </div>
380
+ );
381
+ },
382
+ parameters: {
383
+ docs: {
384
+ description: {
385
+ story: 'Example of Radio components used in a survey or questionnaire.',
386
+ },
387
+ },
388
+ },
389
+ };
390
+
391
+ export const WithError: Story = {
392
+ render: () => {
393
+ const [value, setValue] = useState('');
394
+
395
+ return (
396
+ <RadioGroup
397
+ label="Required Selection"
398
+ description="You must select one option to continue"
399
+ value={value}
400
+ onChange={(v) => setValue(String(v))}
401
+ error={!value ? "Please select an option" : null}
402
+ required
403
+ >
404
+ <Stack gap="xs">
405
+ <Radio value="option1" label="Option 1" />
406
+ <Radio value="option2" label="Option 2" />
407
+ <Radio value="option3" label="Option 3" />
408
+ </Stack>
409
+ </RadioGroup>
410
+ );
411
+ },
412
+ parameters: {
413
+ docs: {
414
+ description: {
415
+ story: 'RadioGroup with error state when no option is selected.',
416
+ },
417
+ },
418
+ },
419
+ };
420
+
421
+ export const Interactive: Story = {
422
+ args: {
423
+ label: 'Interactive Radio',
424
+ value: 'interactive',
425
+ size: 'md',
426
+ checked: false,
427
+ disabled: false,
428
+ required: false,
429
+ },
430
+ parameters: {
431
+ docs: {
432
+ description: {
433
+ story: 'Use the controls below to interact with the Radio and see different combinations.',
434
+ },
435
+ },
436
+ },
437
+ };