@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,125 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { ThemeIcon } from '@appdirect/design-system';
3
+ import { RiUserLine, RiServerLine, RiAddLine, RiEyeLine } from '@remixicon/react';
4
+
5
+ const meta: Meta<typeof ThemeIcon> = {
6
+ title: 'Design System/Data Display/ThemeIcon',
7
+ component: ThemeIcon,
8
+ parameters: {
9
+ layout: 'centered',
10
+ docs: {
11
+ description: {
12
+ component: 'ThemeIcon component with t-shirt sizing including custom xxl (58x58px) and color variants.',
13
+ },
14
+ },
15
+ },
16
+ tags: ['autodocs', 'code-connected'],
17
+ argTypes: {
18
+ size: {
19
+ control: 'select',
20
+ options: ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'],
21
+ description: 'Size of the ThemeIcon (xxl = 58x58px)',
22
+ },
23
+ color: {
24
+ control: 'select',
25
+ options: ['default', 'blue'],
26
+ description: 'Color variant - both use default styling, blue affects icon color only',
27
+ },
28
+ children: {
29
+ control: false,
30
+ description: 'Icon content (React element)',
31
+ },
32
+ },
33
+ };
34
+
35
+ export default meta;
36
+ type Story = StoryObj<typeof meta>;
37
+
38
+ export const Default: Story = {
39
+ args: {
40
+ children: <RiUserLine size={18} />,
41
+ },
42
+ };
43
+
44
+ export const Sizes: Story = {
45
+ render: () => (
46
+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px', flexWrap: 'wrap' }}>
47
+ <div style={{ textAlign: 'center' }}>
48
+ <ThemeIcon size="xs"><RiUserLine size={11} /></ThemeIcon>
49
+ <div style={{ fontSize: '12px', marginTop: '4px' }}>xs</div>
50
+ </div>
51
+ <div style={{ textAlign: 'center' }}>
52
+ <ThemeIcon size="sm"><RiUserLine size={14} /></ThemeIcon>
53
+ <div style={{ fontSize: '12px', marginTop: '4px' }}>sm</div>
54
+ </div>
55
+ <div style={{ textAlign: 'center' }}>
56
+ <ThemeIcon size="md"><RiUserLine size={18} /></ThemeIcon>
57
+ <div style={{ fontSize: '12px', marginTop: '4px' }}>md</div>
58
+ </div>
59
+ <div style={{ textAlign: 'center' }}>
60
+ <ThemeIcon size="lg"><RiUserLine size={22} /></ThemeIcon>
61
+ <div style={{ fontSize: '12px', marginTop: '4px' }}>lg</div>
62
+ </div>
63
+ <div style={{ textAlign: 'center' }}>
64
+ <ThemeIcon size="xl"><RiUserLine size={28} /></ThemeIcon>
65
+ <div style={{ fontSize: '12px', marginTop: '4px' }}>xl</div>
66
+ </div>
67
+ <div style={{ textAlign: 'center' }}>
68
+ <ThemeIcon size="xxl"><RiUserLine size={39} /></ThemeIcon>
69
+ <div style={{ fontSize: '12px', marginTop: '4px' }}>xxl (58x58px)</div>
70
+ </div>
71
+ </div>
72
+ ),
73
+ };
74
+
75
+ export const Colors: Story = {
76
+ render: () => (
77
+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
78
+ <div style={{ textAlign: 'center' }}>
79
+ <ThemeIcon color="default"><RiEyeLine size={18} /></ThemeIcon>
80
+ <div style={{ fontSize: '12px', marginTop: '4px' }}>Default</div>
81
+ </div>
82
+ <div style={{ textAlign: 'center' }}>
83
+ <ThemeIcon color="blue"><RiEyeLine size={18} /></ThemeIcon>
84
+ <div style={{ fontSize: '12px', marginTop: '4px' }}>Blue</div>
85
+ </div>
86
+ </div>
87
+ ),
88
+ };
89
+
90
+ export const XXLShowcase: Story = {
91
+ render: () => (
92
+ <div style={{ display: 'flex', alignItems: 'center', gap: '24px' }}>
93
+ <div style={{ textAlign: 'center' }}>
94
+ <ThemeIcon size="xxl" color="default"><RiAddLine size={39} /></ThemeIcon>
95
+ <div style={{ fontSize: '12px', marginTop: '8px' }}>XXL Default</div>
96
+ </div>
97
+ <div style={{ textAlign: 'center' }}>
98
+ <ThemeIcon size="xxl" color="blue"><RiAddLine size={39} /></ThemeIcon>
99
+ <div style={{ fontSize: '12px', marginTop: '8px' }}>XXL Blue</div>
100
+ </div>
101
+ </div>
102
+ ),
103
+ parameters: {
104
+ docs: {
105
+ description: {
106
+ story: 'The xxl size is exactly 58x58 pixels as specified in the design system.',
107
+ },
108
+ },
109
+ },
110
+ };
111
+
112
+ export const DifferentIcons: Story = {
113
+ args: {
114
+ color: "default"
115
+ },
116
+
117
+ render: () => (
118
+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
119
+ <ThemeIcon color="default"><RiServerLine size={18} /></ThemeIcon>
120
+ <ThemeIcon color="blue"><RiUserLine size={18} /></ThemeIcon>
121
+ <ThemeIcon color="default"><RiAddLine size={18} /></ThemeIcon>
122
+ <ThemeIcon color="blue"><RiEyeLine size={18} /></ThemeIcon>
123
+ </div>
124
+ )
125
+ };
@@ -0,0 +1,263 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Stack } from '@mantine/core';
3
+ import { Checkbox, Title, Text } from '@appdirect/design-system';
4
+ import { useState } from 'react';
5
+
6
+ const meta: Meta<typeof Checkbox> = {
7
+ title: 'Design System/Inputs/Checkbox',
8
+ component: Checkbox,
9
+ parameters: {
10
+ layout: 'centered',
11
+ docs: {
12
+ description: {
13
+ component: 'Checkbox component with consistent design system styling and t-shirt sizing.',
14
+ },
15
+ },
16
+ },
17
+ tags: ['autodocs', 'code-connected'],
18
+ argTypes: {
19
+ size: {
20
+ control: 'select',
21
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
22
+ description: 'Checkbox size',
23
+ },
24
+ label: {
25
+ control: 'text',
26
+ description: 'Checkbox label',
27
+ },
28
+ checked: {
29
+ control: 'boolean',
30
+ description: 'Checked state',
31
+ },
32
+ disabled: {
33
+ control: 'boolean',
34
+ description: 'Disabled state',
35
+ },
36
+ required: {
37
+ control: 'boolean',
38
+ description: 'Required field indicator',
39
+ },
40
+ indeterminate: {
41
+ control: 'boolean',
42
+ description: 'Indeterminate state',
43
+ },
44
+ description: {
45
+ control: 'text',
46
+ description: 'Help text below the checkbox',
47
+ },
48
+ },
49
+ };
50
+
51
+ export default meta;
52
+ type Story = StoryObj<typeof meta>;
53
+
54
+ export const Default: Story = {
55
+ args: {
56
+ label: 'Accept terms and conditions',
57
+ },
58
+ };
59
+
60
+ export const Sizes: Story = {
61
+ render: () => (
62
+ <Stack gap="md">
63
+ <Checkbox size="xs" label="Extra Small Checkbox" />
64
+ <Checkbox size="sm" label="Small Checkbox" />
65
+ <Checkbox size="md" label="Medium Checkbox (default)" />
66
+ <Checkbox size="lg" label="Large Checkbox" />
67
+ <Checkbox size="xl" label="Extra Large Checkbox" />
68
+ </Stack>
69
+ ),
70
+ };
71
+
72
+ export const States: Story = {
73
+ render: () => (
74
+ <Stack gap="md">
75
+ <Checkbox label="Default Checkbox" />
76
+ <Checkbox label="Checked Checkbox" defaultChecked />
77
+ <Checkbox label="Disabled Checkbox" disabled />
78
+ <Checkbox label="Disabled Checked" disabled defaultChecked />
79
+ </Stack>
80
+ ),
81
+ };
82
+
83
+ export const WithDescriptions: Story = {
84
+ render: () => (
85
+ <Stack gap="md" maw={400}>
86
+ <Checkbox
87
+ label="Email Notifications"
88
+ description="Receive email updates about your account activity"
89
+ />
90
+ <Checkbox
91
+ label="Marketing Communications"
92
+ description="Get promotional content and special offers"
93
+ defaultChecked
94
+ />
95
+ <Checkbox
96
+ label="Data Processing"
97
+ description="Allow us to process your data for analytics"
98
+ />
99
+ </Stack>
100
+ ),
101
+ };
102
+
103
+ export const Required: Story = {
104
+ render: () => (
105
+ <Stack gap="md">
106
+ <Checkbox
107
+ label="Terms and Conditions"
108
+ description="I agree to the terms and conditions"
109
+ required
110
+ />
111
+ <Checkbox
112
+ label="Privacy Policy"
113
+ description="I have read and accept the privacy policy"
114
+ required
115
+ />
116
+ </Stack>
117
+ ),
118
+ };
119
+
120
+ export const ControlledExample: Story = {
121
+ render: () => {
122
+ const [values, setValues] = useState({
123
+ notifications: true,
124
+ marketing: false,
125
+ analytics: false,
126
+ });
127
+
128
+ const handleChange = (key: keyof typeof values) => (event: React.ChangeEvent<HTMLInputElement>) => {
129
+ setValues(prev => ({ ...prev, [key]: event.currentTarget.checked }));
130
+ };
131
+
132
+ return (
133
+ <Stack gap="md" maw={400}>
134
+ <Checkbox
135
+ label="Email Notifications"
136
+ checked={values.notifications}
137
+ onChange={handleChange('notifications')}
138
+ description="Receive important updates"
139
+ />
140
+ <Checkbox
141
+ label="Marketing Emails"
142
+ checked={values.marketing}
143
+ onChange={handleChange('marketing')}
144
+ description="Get promotional content"
145
+ />
146
+ <Checkbox
147
+ label="Analytics"
148
+ checked={values.analytics}
149
+ onChange={handleChange('analytics')}
150
+ description="Help improve our service"
151
+ />
152
+
153
+ <div style={{
154
+ marginTop: '16px',
155
+ padding: '12px',
156
+ backgroundColor: 'var(--mantine-color-gray-0)',
157
+ borderRadius: '8px',
158
+ fontSize: '14px'
159
+ }}>
160
+ <strong>Selected Options:</strong>
161
+ <ul style={{ margin: '8px 0', paddingLeft: '20px' }}>
162
+ <li>Notifications: {values.notifications ? 'Yes' : 'No'}</li>
163
+ <li>Marketing: {values.marketing ? 'Yes' : 'No'}</li>
164
+ <li>Analytics: {values.analytics ? 'Yes' : 'No'}</li>
165
+ </ul>
166
+ </div>
167
+ </Stack>
168
+ );
169
+ },
170
+ parameters: {
171
+ docs: {
172
+ description: {
173
+ story: 'Example of controlled Checkbox components with state management.',
174
+ },
175
+ },
176
+ },
177
+ };
178
+
179
+ export const FormExample: Story = {
180
+ render: () => (
181
+ <Stack gap="md">
182
+ <Title order={3} size="md" fw={500} mb="xs">Account Preferences</Title>
183
+ <Stack gap="xs">
184
+ <Checkbox
185
+ label="Email notifications"
186
+ description="Receive updates about your account"
187
+ defaultChecked
188
+ />
189
+ <Checkbox
190
+ label="SMS notifications"
191
+ description="Get text messages for urgent updates"
192
+ />
193
+ <Checkbox
194
+ label="Push notifications"
195
+ description="Receive notifications on your device"
196
+ defaultChecked
197
+ />
198
+ </Stack>
199
+
200
+ <Title order={3} size="md" fw={500} mb="xs" mt="md">Marketing Preferences</Title>
201
+ <Stack gap="xs">
202
+ <Checkbox
203
+ label="Newsletter"
204
+ description="Weekly updates and news"
205
+ />
206
+ <Checkbox
207
+ label="Product updates"
208
+ description="Information about new features"
209
+ defaultChecked
210
+ />
211
+ <Checkbox
212
+ label="Special offers"
213
+ description="Exclusive deals and promotions"
214
+ />
215
+ </Stack>
216
+ </Stack>
217
+ ),
218
+ parameters: {
219
+ docs: {
220
+ description: {
221
+ story: 'Example of Checkbox components used in a form layout.',
222
+ },
223
+ },
224
+ },
225
+ };
226
+
227
+ export const CheckboxGroup: Story = {
228
+ render: () => (
229
+ <Stack gap="sm">
230
+ <Text size="sm" fw={500} c="dimmed" mb="xs">Select your interests:</Text>
231
+ <Checkbox label="Technology" />
232
+ <Checkbox label="Design" />
233
+ <Checkbox label="Business" />
234
+ <Checkbox label="Marketing" />
235
+ <Checkbox label="Development" />
236
+ </Stack>
237
+ ),
238
+ parameters: {
239
+ docs: {
240
+ description: {
241
+ story: 'Example of multiple checkboxes working together as a group.',
242
+ },
243
+ },
244
+ },
245
+ };
246
+
247
+ export const Interactive: Story = {
248
+ args: {
249
+ label: 'Interactive Checkbox',
250
+ size: 'md',
251
+ checked: false,
252
+ disabled: false,
253
+ required: false,
254
+ indeterminate: false,
255
+ },
256
+ parameters: {
257
+ docs: {
258
+ description: {
259
+ story: 'Use the controls below to interact with the Checkbox and see different combinations.',
260
+ },
261
+ },
262
+ },
263
+ };