@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,352 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Stack } from '@mantine/core';
3
+ import { Inline, Progress, Title, Text } from '@appdirect/design-system';
4
+ import { useState, useEffect } from 'react';
5
+
6
+ const meta: Meta<typeof Progress> = {
7
+ title: 'Design System/Data Display/Progress',
8
+ component: Progress,
9
+ parameters: {
10
+ layout: 'centered',
11
+ docs: {
12
+ description: {
13
+ component: 'Progress component for displaying completion status with consistent design system styling.',
14
+ },
15
+ },
16
+ },
17
+ tags: ['autodocs', 'code-connected'],
18
+ argTypes: {
19
+ size: {
20
+ control: 'select',
21
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
22
+ description: 'Progress bar size',
23
+ },
24
+ value: {
25
+ control: { type: 'range', min: 0, max: 100, step: 1 },
26
+ description: 'Progress value (0-100)',
27
+ },
28
+ animated: {
29
+ control: 'boolean',
30
+ description: 'Whether to show animation',
31
+ },
32
+ },
33
+ };
34
+
35
+ export default meta;
36
+ type Story = StoryObj<typeof meta>;
37
+
38
+ export const Default: Story = {
39
+ args: {
40
+ value: 60,
41
+ },
42
+ render: (args) => (
43
+ <div style={{ width: 300 }}>
44
+ <Progress {...args} />
45
+ </div>
46
+ ),
47
+ };
48
+
49
+ export const Sizes: Story = {
50
+ render: () => (
51
+ <Stack gap="lg" w={300}>
52
+ <div>
53
+ <Text size="sm" fw={500} mb="xs">Extra Small (xs)</Text>
54
+ <Progress value={25} size="xs" />
55
+ </div>
56
+ <div>
57
+ <Text size="sm" fw={500} mb="xs">Small (sm)</Text>
58
+ <Progress value={40} size="sm" />
59
+ </div>
60
+ <div>
61
+ <Text size="sm" fw={500} mb="xs">Medium (md) - Default</Text>
62
+ <Progress value={60} size="md" />
63
+ </div>
64
+ <div>
65
+ <Text size="sm" fw={500} mb="xs">Large (lg)</Text>
66
+ <Progress value={75} size="lg" />
67
+ </div>
68
+ <div>
69
+ <Text size="sm" fw={500} mb="xs">Extra Large (xl)</Text>
70
+ <Progress value={90} size="xl" />
71
+ </div>
72
+ </Stack>
73
+ ),
74
+ };
75
+
76
+ export const ProgressLevels: Story = {
77
+ render: () => (
78
+ <Stack gap="lg" w={300}>
79
+ <div>
80
+ <Text size="sm" fw={500} mb="xs">Starting (10%)</Text>
81
+ <Progress value={10} />
82
+ </div>
83
+ <div>
84
+ <Text size="sm" fw={500} mb="xs">Low Progress (25%)</Text>
85
+ <Progress value={25} />
86
+ </div>
87
+ <div>
88
+ <Text size="sm" fw={500} mb="xs">Medium Progress (50%)</Text>
89
+ <Progress value={50} />
90
+ </div>
91
+ <div>
92
+ <Text size="sm" fw={500} mb="xs">High Progress (75%)</Text>
93
+ <Progress value={75} />
94
+ </div>
95
+ <div>
96
+ <Text size="sm" fw={500} mb="xs">Almost Complete (90%)</Text>
97
+ <Progress value={90} />
98
+ </div>
99
+ <div>
100
+ <Text size="sm" fw={500} mb="xs">Complete (100%)</Text>
101
+ <Progress value={100} />
102
+ </div>
103
+ </Stack>
104
+ ),
105
+ parameters: {
106
+ docs: {
107
+ description: {
108
+ story: 'Progress bars showing different completion levels from 0% to 100%.',
109
+ },
110
+ },
111
+ },
112
+ };
113
+
114
+ export const WithAnimation: Story = {
115
+ render: () => (
116
+ <Stack gap="lg" w={300}>
117
+ <div>
118
+ <Text size="sm" fw={500} mb="xs">Static Progress</Text>
119
+ <Progress value={65} animated={false} />
120
+ </div>
121
+ <div>
122
+ <Text size="sm" fw={500} mb="xs">Animated Progress</Text>
123
+ <Progress value={65} animated={true} />
124
+ </div>
125
+ </Stack>
126
+ ),
127
+ parameters: {
128
+ docs: {
129
+ description: {
130
+ story: 'Comparison between static and animated progress bars.',
131
+ },
132
+ },
133
+ },
134
+ };
135
+
136
+ export const AnimatedExample: Story = {
137
+ render: () => {
138
+ const [progress, setProgress] = useState(0);
139
+
140
+ useEffect(() => {
141
+ const interval = setInterval(() => {
142
+ setProgress((prev) => {
143
+ if (prev >= 100) {
144
+ return 0; // Reset to 0 when complete
145
+ }
146
+ return prev + 2;
147
+ });
148
+ }, 100);
149
+
150
+ return () => clearInterval(interval);
151
+ }, []);
152
+
153
+ return (
154
+ <Stack gap="lg" w={300}>
155
+ <div>
156
+ <Text size="sm" fw={500} mb="xs">Auto-incrementing Progress ({progress}%)</Text>
157
+ <Progress value={progress} animated />
158
+ </div>
159
+ </Stack>
160
+ );
161
+ },
162
+ parameters: {
163
+ docs: {
164
+ description: {
165
+ story: 'Example of an animated progress bar that automatically increments.',
166
+ },
167
+ },
168
+ },
169
+ };
170
+
171
+ export const UseCases: Story = {
172
+ render: () => (
173
+ <Stack gap="lg" w={400}>
174
+ <Title order={3} size="md" fw={500} mb="xs">Common Use Cases</Title>
175
+
176
+ <Stack gap="md">
177
+ <div>
178
+ <Text size="sm" fw={500} mb="xs">File Upload Progress</Text>
179
+ <Progress value={73} size="sm" />
180
+ <Text size="xs" c="dimmed" mt="xs">Uploading document.pdf... 73% complete</Text>
181
+ </div>
182
+
183
+ <div>
184
+ <Text size="sm" fw={500} mb="xs">Profile Completion</Text>
185
+ <Progress value={60} />
186
+ <Text size="xs" c="dimmed" mt="xs">Complete your profile to unlock all features</Text>
187
+ </div>
188
+
189
+ <div>
190
+ <Text size="sm" fw={500} mb="xs">Course Progress</Text>
191
+ <Progress value={45} size="lg" />
192
+ <Text size="xs" c="dimmed" mt="xs">9 of 20 lessons completed</Text>
193
+ </div>
194
+
195
+ <div>
196
+ <Text size="sm" fw={500} mb="xs">Loading Data</Text>
197
+ <Progress value={85} animated />
198
+ <Text size="xs" c="dimmed" mt="xs">Loading dashboard data...</Text>
199
+ </div>
200
+
201
+ <div>
202
+ <Text size="sm" fw={500} mb="xs">Storage Usage</Text>
203
+ <Progress value={78} size="sm" />
204
+ <Text size="xs" c="dimmed" mt="xs">7.8 GB of 10 GB used</Text>
205
+ </div>
206
+ </Stack>
207
+ </Stack>
208
+ ),
209
+ parameters: {
210
+ docs: {
211
+ description: {
212
+ story: 'Real-world examples of Progress usage in different application contexts.',
213
+ },
214
+ },
215
+ },
216
+ };
217
+
218
+ export const MultipleProgress: Story = {
219
+ render: () => {
220
+ const [downloads, setDownloads] = useState([
221
+ { name: 'Project Files.zip', progress: 45 },
222
+ { name: 'Images.tar.gz', progress: 78 },
223
+ { name: 'Documents.pdf', progress: 92 },
224
+ { name: 'Backup.sql', progress: 23 }
225
+ ]);
226
+
227
+ useEffect(() => {
228
+ const interval = setInterval(() => {
229
+ setDownloads(prev => prev.map(download => ({
230
+ ...download,
231
+ progress: Math.min(100, download.progress + Math.random() * 3)
232
+ })));
233
+ }, 500);
234
+
235
+ return () => clearInterval(interval);
236
+ }, []);
237
+
238
+ return (
239
+ <Stack gap="md" w={400}>
240
+ <Title order={4} size="sm" fw={500} mb="xs">Download Manager</Title>
241
+
242
+ {downloads.map((download, index) => (
243
+ <div key={index}>
244
+ <Inline justify="space-between" mb="xs">
245
+ <Text size="sm" fw={500}>{download.name}</Text>
246
+ <Text size="sm" c="dimmed">{Math.round(download.progress)}%</Text>
247
+ </Inline>
248
+ <Progress
249
+ value={download.progress}
250
+ size="sm"
251
+ animated={download.progress < 100}
252
+ />
253
+ </div>
254
+ ))}
255
+ </Stack>
256
+ );
257
+ },
258
+ parameters: {
259
+ docs: {
260
+ description: {
261
+ story: 'Example of multiple progress bars for tracking different tasks simultaneously.',
262
+ },
263
+ },
264
+ },
265
+ };
266
+
267
+ export const ProgressWithSteps: Story = {
268
+ render: () => {
269
+ const [currentStep, setCurrentStep] = useState(2);
270
+ const totalSteps = 5;
271
+ const progressValue = (currentStep / totalSteps) * 100;
272
+
273
+ const steps = [
274
+ 'Account Setup',
275
+ 'Personal Information',
276
+ 'Preferences',
277
+ 'Verification',
278
+ 'Complete'
279
+ ];
280
+
281
+ return (
282
+ <Stack gap="lg" w={400}>
283
+ <div>
284
+ <Inline justify="space-between" mb="xs">
285
+ <Text size="sm" fw={500}>Setup Progress</Text>
286
+ <Text size="sm" c="dimmed">Step {currentStep} of {totalSteps}</Text>
287
+ </Inline>
288
+ <Progress value={progressValue} size="lg" />
289
+ <Text size="xs" c="dimmed" mt="xs">
290
+ Current: {steps[currentStep - 1]}
291
+ </Text>
292
+ </div>
293
+
294
+ <Inline gap="xs">
295
+ <button
296
+ onClick={() => setCurrentStep(Math.max(1, currentStep - 1))}
297
+ disabled={currentStep === 1}
298
+ style={{
299
+ padding: '8px 16px',
300
+ border: '1px solid #ccc',
301
+ borderRadius: '4px',
302
+ background: currentStep === 1 ? '#f5f5f5' : 'white',
303
+ cursor: currentStep === 1 ? 'not-allowed' : 'pointer'
304
+ }}
305
+ >
306
+ Previous
307
+ </button>
308
+ <button
309
+ onClick={() => setCurrentStep(Math.min(totalSteps, currentStep + 1))}
310
+ disabled={currentStep === totalSteps}
311
+ style={{
312
+ padding: '8px 16px',
313
+ border: '1px solid #ccc',
314
+ borderRadius: '4px',
315
+ background: currentStep === totalSteps ? '#f5f5f5' : 'white',
316
+ cursor: currentStep === totalSteps ? 'not-allowed' : 'pointer'
317
+ }}
318
+ >
319
+ Next
320
+ </button>
321
+ </Inline>
322
+ </Stack>
323
+ );
324
+ },
325
+ parameters: {
326
+ docs: {
327
+ description: {
328
+ story: 'Example of progress bar used for step-by-step processes with navigation controls.',
329
+ },
330
+ },
331
+ },
332
+ };
333
+
334
+ export const Interactive: Story = {
335
+ args: {
336
+ value: 50,
337
+ size: 'md',
338
+ animated: false,
339
+ },
340
+ render: (args) => (
341
+ <div style={{ width: 300 }}>
342
+ <Progress {...args} />
343
+ </div>
344
+ ),
345
+ parameters: {
346
+ docs: {
347
+ description: {
348
+ story: 'Use the controls below to interact with the Progress component and see different combinations.',
349
+ },
350
+ },
351
+ },
352
+ };
@@ -0,0 +1,346 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Table, Pill } from '@appdirect/design-system';
3
+
4
+ // ========================== META ==========================
5
+
6
+ const meta: Meta<typeof Table> = {
7
+ title: 'Design System/Data Display/Table',
8
+ component: Table,
9
+ parameters: {
10
+ layout: 'padded',
11
+ docs: {
12
+ description: {
13
+ component: `
14
+ A simple table component for displaying tabular data with consistent styling.
15
+
16
+ **Features:**
17
+ - Built on Mantine's Table component
18
+ - Compound components for table structure
19
+ - Support for data prop for simple tables
20
+ - Consistent spacing and styling
21
+ - Striped rows and hover effects
22
+ - Borders and scroll containers
23
+
24
+ **When to use:**
25
+ - Simple data display
26
+ - Static tabular content
27
+ - Basic table layouts
28
+
29
+ **When not to use:**
30
+ - Complex data tables with sorting/filtering (use ComplexComponents/DataTable instead)
31
+ - Large datasets requiring pagination
32
+ - Interactive data manipulation
33
+ `,
34
+ },
35
+ },
36
+ },
37
+ tags: ['autodocs', 'code-connected'],
38
+ argTypes: {
39
+ striped: {
40
+ control: 'boolean',
41
+ description: 'Whether to show striped rows',
42
+ },
43
+ highlightOnHover: {
44
+ control: 'boolean',
45
+ description: 'Whether to highlight rows on hover',
46
+ },
47
+ withTableBorder: {
48
+ control: 'boolean',
49
+ description: 'Whether to show table border',
50
+ },
51
+ withColumnBorders: {
52
+ control: 'boolean',
53
+ description: 'Whether to show column borders',
54
+ },
55
+ horizontalSpacing: {
56
+ control: 'select',
57
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
58
+ description: 'Horizontal cell spacing',
59
+ },
60
+ verticalSpacing: {
61
+ control: 'select',
62
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
63
+ description: 'Vertical cell spacing',
64
+ },
65
+ },
66
+ };
67
+
68
+ export default meta;
69
+ type Story = StoryObj<typeof Table>;
70
+
71
+ // ========================== SAMPLE DATA ==========================
72
+
73
+ const sampleData = [
74
+ { id: '#1234', amount: '$125.00', status: 'Completed', date: '2024-01-15' },
75
+ { id: '#1235', amount: '$89.50', status: 'Pending', date: '2024-01-15' },
76
+ { id: '#1236', amount: '$234.75', status: 'Completed', date: '2024-01-14' },
77
+ { id: '#1237', amount: '$156.25', status: 'Failed', date: '2024-01-14' },
78
+ { id: '#1238', amount: '$67.80', status: 'Pending', date: '2024-01-13' },
79
+ ];
80
+
81
+ // ========================== STORIES ==========================
82
+
83
+ export const Default: Story = {
84
+ args: {
85
+ children: (
86
+ <>
87
+ <Table.Thead>
88
+ <Table.Tr>
89
+ <Table.Th>Transaction ID</Table.Th>
90
+ <Table.Th>Amount</Table.Th>
91
+ <Table.Th>Status</Table.Th>
92
+ <Table.Th>Date</Table.Th>
93
+ </Table.Tr>
94
+ </Table.Thead>
95
+ <Table.Tbody>
96
+ {sampleData.map((row, index) => (
97
+ <Table.Tr key={index}>
98
+ <Table.Td>{row.id}</Table.Td>
99
+ <Table.Td>{row.amount}</Table.Td>
100
+ <Table.Td>
101
+ <Pill
102
+ color={
103
+ row.status === 'Completed' ? 'green' :
104
+ row.status === 'Pending' ? 'yellow' : 'red'
105
+ }
106
+ size="sm"
107
+ >
108
+ {row.status}
109
+ </Pill>
110
+ </Table.Td>
111
+ <Table.Td style={{ color: 'var(--mantine-color-gray-6)' }}>
112
+ {row.date}
113
+ </Table.Td>
114
+ </Table.Tr>
115
+ ))}
116
+ </Table.Tbody>
117
+ </>
118
+ ),
119
+ },
120
+ };
121
+
122
+ export const WithDataProp: Story = {
123
+ args: {
124
+ data: {
125
+ head: ['Product', 'Price', 'Stock', 'Category'],
126
+ body: [
127
+ ['MacBook Pro', '$2,399', '12', 'Laptops'],
128
+ ['iPhone 15', '$999', '45', 'Phones'],
129
+ ['iPad Air', '$599', '23', 'Tablets'],
130
+ ['Apple Watch', '$399', '67', 'Wearables'],
131
+ ['AirPods Pro', '$249', '89', 'Audio'],
132
+ ],
133
+ },
134
+ },
135
+ };
136
+
137
+ export const Styled: Story = {
138
+ args: {
139
+ striped: true,
140
+ highlightOnHover: true,
141
+ withTableBorder: true,
142
+ withColumnBorders: true,
143
+ children: (
144
+ <>
145
+ <Table.Thead>
146
+ <Table.Tr>
147
+ <Table.Th>Name</Table.Th>
148
+ <Table.Th>Email</Table.Th>
149
+ <Table.Th>Role</Table.Th>
150
+ <Table.Th>Status</Table.Th>
151
+ </Table.Tr>
152
+ </Table.Thead>
153
+ <Table.Tbody>
154
+ <Table.Tr>
155
+ <Table.Td>John Doe</Table.Td>
156
+ <Table.Td>john@example.com</Table.Td>
157
+ <Table.Td>Admin</Table.Td>
158
+ <Table.Td>
159
+ <Pill color="green" size="sm">Active</Pill>
160
+ </Table.Td>
161
+ </Table.Tr>
162
+ <Table.Tr>
163
+ <Table.Td>Jane Smith</Table.Td>
164
+ <Table.Td>jane@example.com</Table.Td>
165
+ <Table.Td>User</Table.Td>
166
+ <Table.Td>
167
+ <Pill color="yellow" size="sm">Pending</Pill>
168
+ </Table.Td>
169
+ </Table.Tr>
170
+ <Table.Tr>
171
+ <Table.Td>Bob Johnson</Table.Td>
172
+ <Table.Td>bob@example.com</Table.Td>
173
+ <Table.Td>User</Table.Td>
174
+ <Table.Td>
175
+ <Pill color="red" size="sm">Inactive</Pill>
176
+ </Table.Td>
177
+ </Table.Tr>
178
+ </Table.Tbody>
179
+ </>
180
+ ),
181
+ },
182
+ };
183
+
184
+ export const WithCaption: Story = {
185
+ args: {
186
+ children: (
187
+ <>
188
+ <Table.Caption>Recent sales transactions</Table.Caption>
189
+ <Table.Thead>
190
+ <Table.Tr>
191
+ <Table.Th>Product</Table.Th>
192
+ <Table.Th>Quantity</Table.Th>
193
+ <Table.Th>Revenue</Table.Th>
194
+ </Table.Tr>
195
+ </Table.Thead>
196
+ <Table.Tbody>
197
+ <Table.Tr>
198
+ <Table.Td>Enterprise License</Table.Td>
199
+ <Table.Td>247</Table.Td>
200
+ <Table.Td>$284,392</Table.Td>
201
+ </Table.Tr>
202
+ <Table.Tr>
203
+ <Table.Td>Pro Subscription</Table.Td>
204
+ <Table.Td>1,456</Table.Td>
205
+ <Table.Td>$145,600</Table.Td>
206
+ </Table.Tr>
207
+ <Table.Tr>
208
+ <Table.Td>Basic Plan</Table.Td>
209
+ <Table.Td>3,247</Table.Td>
210
+ <Table.Td>$97,410</Table.Td>
211
+ </Table.Tr>
212
+ </Table.Tbody>
213
+ </>
214
+ ),
215
+ },
216
+ };
217
+
218
+ export const Scrollable: Story = {
219
+ args: {
220
+ children: (
221
+ <Table.ScrollContainer minWidth={800}>
222
+ <Table>
223
+ <Table.Thead>
224
+ <Table.Tr>
225
+ <Table.Th>Very Long Column Header Name</Table.Th>
226
+ <Table.Th>Another Long Column Header</Table.Th>
227
+ <Table.Th>Third Column Header</Table.Th>
228
+ <Table.Th>Fourth Column Header</Table.Th>
229
+ <Table.Th>Fifth Column Header</Table.Th>
230
+ <Table.Th>Sixth Column Header</Table.Th>
231
+ </Table.Tr>
232
+ </Table.Thead>
233
+ <Table.Tbody>
234
+ {Array.from({ length: 5 }).map((_, index) => (
235
+ <Table.Tr key={index}>
236
+ <Table.Td>Very long content that might overflow</Table.Td>
237
+ <Table.Td>More long content here</Table.Td>
238
+ <Table.Td>Additional content</Table.Td>
239
+ <Table.Td>Even more content</Table.Td>
240
+ <Table.Td>Content continues</Table.Td>
241
+ <Table.Td>Final column content</Table.Td>
242
+ </Table.Tr>
243
+ ))}
244
+ </Table.Tbody>
245
+ </Table>
246
+ </Table.ScrollContainer>
247
+ ),
248
+ },
249
+ parameters: {
250
+ docs: {
251
+ description: {
252
+ story: 'Table with horizontal scroll when content exceeds container width.',
253
+ },
254
+ },
255
+ },
256
+ };
257
+
258
+ export const CompactSpacing: Story = {
259
+ args: {
260
+ horizontalSpacing: 'xs',
261
+ verticalSpacing: 'xs',
262
+ children: (
263
+ <>
264
+ <Table.Thead>
265
+ <Table.Tr>
266
+ <Table.Th>Metric</Table.Th>
267
+ <Table.Th>Value</Table.Th>
268
+ <Table.Th>Change</Table.Th>
269
+ </Table.Tr>
270
+ </Table.Thead>
271
+ <Table.Tbody>
272
+ <Table.Tr>
273
+ <Table.Td>Revenue</Table.Td>
274
+ <Table.Td>$45,231</Table.Td>
275
+ <Table.Td style={{ color: 'var(--mantine-color-green-6)' }}>+12.5%</Table.Td>
276
+ </Table.Tr>
277
+ <Table.Tr>
278
+ <Table.Td>Users</Table.Td>
279
+ <Table.Td>2,847</Table.Td>
280
+ <Table.Td style={{ color: 'var(--mantine-color-green-6)' }}>+8.2%</Table.Td>
281
+ </Table.Tr>
282
+ <Table.Tr>
283
+ <Table.Td>Conversion</Table.Td>
284
+ <Table.Td>3.4%</Table.Td>
285
+ <Table.Td style={{ color: 'var(--mantine-color-red-6)' }}>-0.3%</Table.Td>
286
+ </Table.Tr>
287
+ </Table.Tbody>
288
+ </>
289
+ ),
290
+ },
291
+ parameters: {
292
+ docs: {
293
+ description: {
294
+ story: 'Table with compact spacing for dense data display.',
295
+ },
296
+ },
297
+ },
298
+ };
299
+
300
+ export const GenerousSpacing: Story = {
301
+ args: {
302
+ horizontalSpacing: 'xl',
303
+ verticalSpacing: 'lg',
304
+ children: (
305
+ <>
306
+ <Table.Thead>
307
+ <Table.Tr>
308
+ <Table.Th>Feature</Table.Th>
309
+ <Table.Th>Description</Table.Th>
310
+ <Table.Th>Available</Table.Th>
311
+ </Table.Tr>
312
+ </Table.Thead>
313
+ <Table.Tbody>
314
+ <Table.Tr>
315
+ <Table.Td>Advanced Analytics</Table.Td>
316
+ <Table.Td>Detailed insights and reporting</Table.Td>
317
+ <Table.Td>
318
+ <Pill color="green" size="sm">Yes</Pill>
319
+ </Table.Td>
320
+ </Table.Tr>
321
+ <Table.Tr>
322
+ <Table.Td>API Access</Table.Td>
323
+ <Table.Td>RESTful API for integrations</Table.Td>
324
+ <Table.Td>
325
+ <Pill color="green" size="sm">Yes</Pill>
326
+ </Table.Td>
327
+ </Table.Tr>
328
+ <Table.Tr>
329
+ <Table.Td>White Label</Table.Td>
330
+ <Table.Td>Custom branding options</Table.Td>
331
+ <Table.Td>
332
+ <Pill color="gray" size="sm">Enterprise</Pill>
333
+ </Table.Td>
334
+ </Table.Tr>
335
+ </Table.Tbody>
336
+ </>
337
+ ),
338
+ },
339
+ parameters: {
340
+ docs: {
341
+ description: {
342
+ story: 'Table with generous spacing for a more relaxed layout.',
343
+ },
344
+ },
345
+ },
346
+ };