@appdirect/design-system 0.0.9 → 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,528 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Stack } from '@mantine/core';
3
+ import { Inline, Tabs, Title, Text, Badge } from '@appdirect/design-system';
4
+ import { useState } from 'react';
5
+
6
+ const meta: Meta<typeof Tabs> = {
7
+ title: 'Design System/Navigation/Tabs',
8
+ component: Tabs,
9
+ parameters: {
10
+ layout: 'centered',
11
+ docs: {
12
+ description: {
13
+ component: 'Tabs compound component for organizing content into sections. Thin wrapper around Mantine Tabs.',
14
+ },
15
+ },
16
+ },
17
+ tags: ['autodocs', 'code-connected'],
18
+ argTypes: {
19
+ orientation: {
20
+ control: 'select',
21
+ options: ['horizontal', 'vertical'],
22
+ description: 'Tabs orientation',
23
+ },
24
+ variant: {
25
+ control: 'select',
26
+ options: ['default', 'outline', 'pills'],
27
+ description: 'Tab variant',
28
+ },
29
+ value: {
30
+ control: 'text',
31
+ description: 'Currently active tab ID',
32
+ },
33
+ },
34
+ };
35
+
36
+ export default meta;
37
+ type Story = StoryObj<typeof meta>;
38
+
39
+ export const Default: Story = {
40
+ render: () => {
41
+ const [activeTab, setActiveTab] = useState<string | null>('tab1');
42
+
43
+ return (
44
+ <div style={{ width: 500 }}>
45
+ <Tabs value={activeTab} onChange={setActiveTab}>
46
+ <Tabs.List>
47
+ <Tabs.Tab value="tab1">Overview</Tabs.Tab>
48
+ <Tabs.Tab value="tab2">Details</Tabs.Tab>
49
+ <Tabs.Tab value="tab3">Settings</Tabs.Tab>
50
+ </Tabs.List>
51
+
52
+ <Tabs.Panel value="tab1" pt="md">
53
+ <Text>This is the overview content. It provides a general summary of the information.</Text>
54
+ </Tabs.Panel>
55
+ <Tabs.Panel value="tab2" pt="md">
56
+ <Text>This is the details content. It contains more specific information.</Text>
57
+ </Tabs.Panel>
58
+ <Tabs.Panel value="tab3" pt="md">
59
+ <Text>This is the settings content. Configure your preferences here.</Text>
60
+ </Tabs.Panel>
61
+ </Tabs>
62
+ </div>
63
+ );
64
+ },
65
+ };
66
+
67
+ export const Variants: Story = {
68
+ render: () => (
69
+ <Stack gap="xl" w={500}>
70
+ <div>
71
+ <Text size="sm" fw={500} mb="sm">Default Variant:</Text>
72
+ <Tabs defaultValue="tab1" variant="default">
73
+ <Tabs.List>
74
+ <Tabs.Tab value="tab1">First</Tabs.Tab>
75
+ <Tabs.Tab value="tab2">Second</Tabs.Tab>
76
+ <Tabs.Tab value="tab3">Third</Tabs.Tab>
77
+ </Tabs.List>
78
+ <Tabs.Panel value="tab1" pt="md"><Text>First tab content</Text></Tabs.Panel>
79
+ <Tabs.Panel value="tab2" pt="md"><Text>Second tab content</Text></Tabs.Panel>
80
+ <Tabs.Panel value="tab3" pt="md"><Text>Third tab content</Text></Tabs.Panel>
81
+ </Tabs>
82
+ </div>
83
+
84
+ <div>
85
+ <Text size="sm" fw={500} mb="sm">Outline Variant:</Text>
86
+ <Tabs defaultValue="tab1" variant="outline">
87
+ <Tabs.List>
88
+ <Tabs.Tab value="tab1">First</Tabs.Tab>
89
+ <Tabs.Tab value="tab2">Second</Tabs.Tab>
90
+ <Tabs.Tab value="tab3">Third</Tabs.Tab>
91
+ </Tabs.List>
92
+ <Tabs.Panel value="tab1" pt="md"><Text>First tab content</Text></Tabs.Panel>
93
+ <Tabs.Panel value="tab2" pt="md"><Text>Second tab content</Text></Tabs.Panel>
94
+ <Tabs.Panel value="tab3" pt="md"><Text>Third tab content</Text></Tabs.Panel>
95
+ </Tabs>
96
+ </div>
97
+
98
+ <div>
99
+ <Text size="sm" fw={500} mb="sm">Pills Variant:</Text>
100
+ <Tabs defaultValue="tab1" variant="pills">
101
+ <Tabs.List>
102
+ <Tabs.Tab value="tab1">First</Tabs.Tab>
103
+ <Tabs.Tab value="tab2">Second</Tabs.Tab>
104
+ <Tabs.Tab value="tab3">Third</Tabs.Tab>
105
+ </Tabs.List>
106
+ <Tabs.Panel value="tab1" pt="md"><Text>First tab content</Text></Tabs.Panel>
107
+ <Tabs.Panel value="tab2" pt="md"><Text>Second tab content</Text></Tabs.Panel>
108
+ <Tabs.Panel value="tab3" pt="md"><Text>Third tab content</Text></Tabs.Panel>
109
+ </Tabs>
110
+ </div>
111
+ </Stack>
112
+ ),
113
+ parameters: {
114
+ docs: {
115
+ description: {
116
+ story: 'Different visual variants of the Tabs component.',
117
+ },
118
+ },
119
+ },
120
+ };
121
+
122
+ export const WithIcons: Story = {
123
+ render: () => {
124
+ const [activeTab, setActiveTab] = useState<string | null>('dashboard');
125
+
126
+ return (
127
+ <div style={{ width: 600 }}>
128
+ <Tabs value={activeTab} onChange={setActiveTab}>
129
+ <Tabs.List>
130
+ <Tabs.Tab value="dashboard" leftSection={<span>📊</span>}>Dashboard</Tabs.Tab>
131
+ <Tabs.Tab value="users" leftSection={<span>👥</span>}>Users</Tabs.Tab>
132
+ <Tabs.Tab value="settings" leftSection={<span>⚙️</span>}>Settings</Tabs.Tab>
133
+ <Tabs.Tab value="help" leftSection={<span>❓</span>}>Help</Tabs.Tab>
134
+ </Tabs.List>
135
+
136
+ <Tabs.Panel value="dashboard" pt="md">
137
+ <Text>Dashboard overview with charts and metrics.</Text>
138
+ </Tabs.Panel>
139
+ <Tabs.Panel value="users" pt="md">
140
+ <Text>User management and profiles.</Text>
141
+ </Tabs.Panel>
142
+ <Tabs.Panel value="settings" pt="md">
143
+ <Text>Application settings and configuration.</Text>
144
+ </Tabs.Panel>
145
+ <Tabs.Panel value="help" pt="md">
146
+ <Text>Help documentation and support.</Text>
147
+ </Tabs.Panel>
148
+ </Tabs>
149
+ </div>
150
+ );
151
+ },
152
+ parameters: {
153
+ docs: {
154
+ description: {
155
+ story: 'Tabs with icons in the left section.',
156
+ },
157
+ },
158
+ },
159
+ };
160
+
161
+ export const WithBadges: Story = {
162
+ render: () => {
163
+ const [activeTab, setActiveTab] = useState<string | null>('inbox');
164
+
165
+ return (
166
+ <div style={{ width: 600 }}>
167
+ <Tabs value={activeTab} onChange={setActiveTab}>
168
+ <Tabs.List>
169
+ <Tabs.Tab value="inbox" leftSection={<span>📧</span>} rightSection={<Badge variant="filled" color="blue">12</Badge>}>
170
+ Inbox
171
+ </Tabs.Tab>
172
+ <Tabs.Tab value="sent" leftSection={<span>📤</span>}>Sent</Tabs.Tab>
173
+ <Tabs.Tab value="drafts" leftSection={<span>📝</span>} rightSection={<Badge variant="filled" color="gray">3</Badge>}>
174
+ Drafts
175
+ </Tabs.Tab>
176
+ <Tabs.Tab value="spam" leftSection={<span>🚫</span>} rightSection={<Badge variant="filled" color="red">5</Badge>}>
177
+ Spam
178
+ </Tabs.Tab>
179
+ </Tabs.List>
180
+
181
+ <Tabs.Panel value="inbox" pt="md"><Text>You have 12 unread messages in your inbox.</Text></Tabs.Panel>
182
+ <Tabs.Panel value="sent" pt="md"><Text>Your sent messages.</Text></Tabs.Panel>
183
+ <Tabs.Panel value="drafts" pt="md"><Text>You have 3 draft messages.</Text></Tabs.Panel>
184
+ <Tabs.Panel value="spam" pt="md"><Text>5 messages marked as spam.</Text></Tabs.Panel>
185
+ </Tabs>
186
+ </div>
187
+ );
188
+ },
189
+ parameters: {
190
+ docs: {
191
+ description: {
192
+ story: 'Tabs with badges showing counts or status in the right section.',
193
+ },
194
+ },
195
+ },
196
+ };
197
+
198
+ export const WithDisabledTabs: Story = {
199
+ render: () => {
200
+ const [activeTab, setActiveTab] = useState<string | null>('available');
201
+
202
+ return (
203
+ <div style={{ width: 700 }}>
204
+ <Tabs value={activeTab} onChange={setActiveTab}>
205
+ <Tabs.List>
206
+ <Tabs.Tab value="available" leftSection={<span>✅</span>}>Available</Tabs.Tab>
207
+ <Tabs.Tab value="premium" leftSection={<span>⭐</span>} rightSection={<Badge variant="outline" color="yellow">Pro</Badge>} disabled>
208
+ Premium Only
209
+ </Tabs.Tab>
210
+ <Tabs.Tab value="maintenance" leftSection={<span>🔧</span>} disabled>Under Maintenance</Tabs.Tab>
211
+ <Tabs.Tab value="coming-soon" leftSection={<span>🚀</span>} rightSection={<Badge variant="outline" color="blue">Soon</Badge>} disabled>
212
+ Coming Soon
213
+ </Tabs.Tab>
214
+ </Tabs.List>
215
+
216
+ <Tabs.Panel value="available" pt="md"><Text>This tab is available and can be accessed.</Text></Tabs.Panel>
217
+ <Tabs.Panel value="premium" pt="md"><Text>This content requires a premium subscription.</Text></Tabs.Panel>
218
+ <Tabs.Panel value="maintenance" pt="md"><Text>This section is currently under maintenance.</Text></Tabs.Panel>
219
+ <Tabs.Panel value="coming-soon" pt="md"><Text>This feature is coming soon!</Text></Tabs.Panel>
220
+ </Tabs>
221
+ </div>
222
+ );
223
+ },
224
+ parameters: {
225
+ docs: {
226
+ description: {
227
+ story: 'Tabs with some disabled states for restricted or unavailable content.',
228
+ },
229
+ },
230
+ },
231
+ };
232
+
233
+ export const VerticalTabs: Story = {
234
+ render: () => {
235
+ const [activeTab, setActiveTab] = useState<string | null>('profile');
236
+
237
+ return (
238
+ <div style={{ width: 600, height: 400 }}>
239
+ <Tabs value={activeTab} onChange={setActiveTab} orientation="vertical">
240
+ <Tabs.List>
241
+ <Tabs.Tab value="profile" leftSection={<span>👤</span>}>Profile</Tabs.Tab>
242
+ <Tabs.Tab value="account" leftSection={<span>⚙️</span>}>Account</Tabs.Tab>
243
+ <Tabs.Tab value="notifications" leftSection={<span>🔔</span>} rightSection={<Badge variant="filled" color="red">3</Badge>}>
244
+ Notifications
245
+ </Tabs.Tab>
246
+ <Tabs.Tab value="privacy" leftSection={<span>🔒</span>}>Privacy</Tabs.Tab>
247
+ <Tabs.Tab value="billing" leftSection={<span>💳</span>}>Billing</Tabs.Tab>
248
+ </Tabs.List>
249
+
250
+ <Tabs.Panel value="profile" pl="md">
251
+ <Title order={4} size="sm" fw={500} mb="sm">Profile Settings</Title>
252
+ <Text>Manage your personal information and profile details.</Text>
253
+ </Tabs.Panel>
254
+ <Tabs.Panel value="account" pl="md">
255
+ <Title order={4} size="sm" fw={500} mb="sm">Account Settings</Title>
256
+ <Text>Configure your account preferences and security settings.</Text>
257
+ </Tabs.Panel>
258
+ <Tabs.Panel value="notifications" pl="md">
259
+ <Title order={4} size="sm" fw={500} mb="sm">Notification Settings</Title>
260
+ <Text>Control how and when you receive notifications.</Text>
261
+ </Tabs.Panel>
262
+ <Tabs.Panel value="privacy" pl="md">
263
+ <Title order={4} size="sm" fw={500} mb="sm">Privacy Settings</Title>
264
+ <Text>Manage your privacy preferences and data sharing options.</Text>
265
+ </Tabs.Panel>
266
+ <Tabs.Panel value="billing" pl="md">
267
+ <Title order={4} size="sm" fw={500} mb="sm">Billing Information</Title>
268
+ <Text>View and manage your subscription and payment methods.</Text>
269
+ </Tabs.Panel>
270
+ </Tabs>
271
+ </div>
272
+ );
273
+ },
274
+ parameters: {
275
+ docs: {
276
+ description: {
277
+ story: 'Vertical tabs layout for sidebar-style navigation.',
278
+ },
279
+ },
280
+ },
281
+ };
282
+
283
+ export const TabsWithoutContent: Story = {
284
+ render: () => {
285
+ const [activeTab, setActiveTab] = useState<string | null>('tab1');
286
+
287
+ return (
288
+ <Stack gap="md" w={500}>
289
+ <Tabs value={activeTab} onChange={setActiveTab}>
290
+ <Tabs.List>
291
+ <Tabs.Tab value="tab1" leftSection={<span>1️⃣</span>}>Tab 1</Tabs.Tab>
292
+ <Tabs.Tab value="tab2" leftSection={<span>2️⃣</span>}>Tab 2</Tabs.Tab>
293
+ <Tabs.Tab value="tab3" leftSection={<span>3️⃣</span>} rightSection={<Badge variant="filled" color="green">New</Badge>}>
294
+ Tab 3
295
+ </Tabs.Tab>
296
+ <Tabs.Tab value="tab4" leftSection={<span>4️⃣</span>} disabled>Tab 4</Tabs.Tab>
297
+ </Tabs.List>
298
+ </Tabs>
299
+
300
+ <div style={{
301
+ padding: '16px',
302
+ border: '1px solid var(--mantine-color-gray-3)',
303
+ borderRadius: '8px',
304
+ backgroundColor: 'var(--mantine-color-gray-0)'
305
+ }}>
306
+ <Text size="sm" fw={500} mb="xs">External Content Area</Text>
307
+ <Text size="sm">
308
+ Active tab: <strong>{activeTab}</strong>
309
+ </Text>
310
+ <Text size="sm" c="dimmed">
311
+ This content is managed separately from the tabs component.
312
+ </Text>
313
+ </div>
314
+ </Stack>
315
+ );
316
+ },
317
+ parameters: {
318
+ docs: {
319
+ description: {
320
+ story: 'Tabs without built-in content panels, useful when content is managed externally.',
321
+ },
322
+ },
323
+ },
324
+ };
325
+
326
+ export const ControlledTabs: Story = {
327
+ render: () => {
328
+ const [activeTab, setActiveTab] = useState<string | null>('step1');
329
+
330
+ return (
331
+ <div style={{ width: 600 }}>
332
+ <Tabs value={activeTab} onChange={setActiveTab}>
333
+ <Tabs.List>
334
+ <Tabs.Tab value="step1" leftSection={<span>1️⃣</span>}>Step 1</Tabs.Tab>
335
+ <Tabs.Tab value="step2" leftSection={<span>2️⃣</span>} disabled={activeTab === 'step1'}>Step 2</Tabs.Tab>
336
+ <Tabs.Tab value="step3" leftSection={<span>3️⃣</span>} disabled={activeTab === 'step1' || activeTab === 'step2'}>
337
+ Step 3
338
+ </Tabs.Tab>
339
+ </Tabs.List>
340
+
341
+ <Tabs.Panel value="step1" pt="md">
342
+ <Title order={4} size="sm" fw={500} mb="sm">Step 1: Basic Information</Title>
343
+ <Text mb="md">Enter your basic information to get started.</Text>
344
+ <Inline gap="sm">
345
+ <button
346
+ onClick={() => setActiveTab('step2')}
347
+ style={{
348
+ padding: '8px 16px',
349
+ backgroundColor: 'var(--mantine-color-blue-6)',
350
+ color: 'white',
351
+ border: 'none',
352
+ borderRadius: '4px',
353
+ cursor: 'pointer'
354
+ }}
355
+ >
356
+ Next Step
357
+ </button>
358
+ </Inline>
359
+ </Tabs.Panel>
360
+ <Tabs.Panel value="step2" pt="md">
361
+ <Title order={4} size="sm" fw={500} mb="sm">Step 2: Preferences</Title>
362
+ <Text mb="md">Configure your preferences and settings.</Text>
363
+ <Inline gap="sm">
364
+ <button
365
+ onClick={() => setActiveTab('step1')}
366
+ style={{
367
+ padding: '8px 16px',
368
+ backgroundColor: 'var(--mantine-color-gray-6)',
369
+ color: 'white',
370
+ border: 'none',
371
+ borderRadius: '4px',
372
+ cursor: 'pointer'
373
+ }}
374
+ >
375
+ Previous
376
+ </button>
377
+ <button
378
+ onClick={() => setActiveTab('step3')}
379
+ style={{
380
+ padding: '8px 16px',
381
+ backgroundColor: 'var(--mantine-color-blue-6)',
382
+ color: 'white',
383
+ border: 'none',
384
+ borderRadius: '4px',
385
+ cursor: 'pointer'
386
+ }}
387
+ >
388
+ Next Step
389
+ </button>
390
+ </Inline>
391
+ </Tabs.Panel>
392
+ <Tabs.Panel value="step3" pt="md">
393
+ <Title order={4} size="sm" fw={500} mb="sm">Step 3: Review</Title>
394
+ <Text mb="md">Review your information and complete the process.</Text>
395
+ <Inline gap="sm">
396
+ <button
397
+ onClick={() => setActiveTab('step2')}
398
+ style={{
399
+ padding: '8px 16px',
400
+ backgroundColor: 'var(--mantine-color-gray-6)',
401
+ color: 'white',
402
+ border: 'none',
403
+ borderRadius: '4px',
404
+ cursor: 'pointer'
405
+ }}
406
+ >
407
+ Previous
408
+ </button>
409
+ <button
410
+ onClick={() => alert('Process completed!')}
411
+ style={{
412
+ padding: '8px 16px',
413
+ backgroundColor: 'var(--mantine-color-green-6)',
414
+ color: 'white',
415
+ border: 'none',
416
+ borderRadius: '4px',
417
+ cursor: 'pointer'
418
+ }}
419
+ >
420
+ Complete
421
+ </button>
422
+ </Inline>
423
+ </Tabs.Panel>
424
+ </Tabs>
425
+ </div>
426
+ );
427
+ },
428
+ parameters: {
429
+ docs: {
430
+ description: {
431
+ story: 'Controlled tabs with conditional disabled states for step-by-step workflows.',
432
+ },
433
+ },
434
+ },
435
+ };
436
+
437
+ export const UseCases: Story = {
438
+ render: () => (
439
+ <Stack gap="xl" w={700}>
440
+ <Title order={3} size="md" fw={500} mb="xs">Common Use Cases</Title>
441
+
442
+ <div>
443
+ <Text size="sm" fw={500} mb="sm">1. Dashboard Navigation:</Text>
444
+ <Tabs defaultValue="overview">
445
+ <Tabs.List>
446
+ <Tabs.Tab value="overview" leftSection={<span>📊</span>}>Overview</Tabs.Tab>
447
+ <Tabs.Tab value="analytics" leftSection={<span>📈</span>} rightSection={<Badge variant="filled" color="blue">Live</Badge>}>
448
+ Analytics
449
+ </Tabs.Tab>
450
+ <Tabs.Tab value="reports" leftSection={<span>📋</span>}>Reports</Tabs.Tab>
451
+ </Tabs.List>
452
+ <Tabs.Panel value="overview" pt="md"><Text>Dashboard overview with key metrics</Text></Tabs.Panel>
453
+ <Tabs.Panel value="analytics" pt="md"><Text>Real-time analytics and reports</Text></Tabs.Panel>
454
+ <Tabs.Panel value="reports" pt="md"><Text>Generated reports and exports</Text></Tabs.Panel>
455
+ </Tabs>
456
+ </div>
457
+
458
+ <div>
459
+ <Text size="sm" fw={500} mb="sm">2. Settings Panel:</Text>
460
+ <Tabs defaultValue="general" variant="pills">
461
+ <Tabs.List>
462
+ <Tabs.Tab value="general" leftSection={<span>⚙️</span>}>General</Tabs.Tab>
463
+ <Tabs.Tab value="security" leftSection={<span>🔒</span>}>Security</Tabs.Tab>
464
+ <Tabs.Tab value="integrations" leftSection={<span>🔗</span>} rightSection={<Badge variant="outline" color="green">3 Active</Badge>}>
465
+ Integrations
466
+ </Tabs.Tab>
467
+ </Tabs.List>
468
+ <Tabs.Panel value="general" pt="md"><Text>General application settings</Text></Tabs.Panel>
469
+ <Tabs.Panel value="security" pt="md"><Text>Security and privacy settings</Text></Tabs.Panel>
470
+ <Tabs.Panel value="integrations" pt="md"><Text>Third-party integrations</Text></Tabs.Panel>
471
+ </Tabs>
472
+ </div>
473
+
474
+ <div>
475
+ <Text size="sm" fw={500} mb="sm">3. Content Categories:</Text>
476
+ <Tabs defaultValue="all" variant="outline">
477
+ <Tabs.List>
478
+ <Tabs.Tab value="all" rightSection={<Badge variant="filled" color="gray">24</Badge>}>All Items</Tabs.Tab>
479
+ <Tabs.Tab value="published" rightSection={<Badge variant="filled" color="green">18</Badge>}>Published</Tabs.Tab>
480
+ <Tabs.Tab value="drafts" rightSection={<Badge variant="filled" color="yellow">4</Badge>}>Drafts</Tabs.Tab>
481
+ <Tabs.Tab value="archived" rightSection={<Badge variant="filled" color="gray">2</Badge>}>Archived</Tabs.Tab>
482
+ </Tabs.List>
483
+ <Tabs.Panel value="all" pt="md"><Text>All content items</Text></Tabs.Panel>
484
+ <Tabs.Panel value="published" pt="md"><Text>Published content</Text></Tabs.Panel>
485
+ <Tabs.Panel value="drafts" pt="md"><Text>Draft content</Text></Tabs.Panel>
486
+ <Tabs.Panel value="archived" pt="md"><Text>Archived content</Text></Tabs.Panel>
487
+ </Tabs>
488
+ </div>
489
+ </Stack>
490
+ ),
491
+ parameters: {
492
+ docs: {
493
+ description: {
494
+ story: 'Real-world examples of Tabs usage in different application contexts.',
495
+ },
496
+ },
497
+ },
498
+ };
499
+
500
+ export const Interactive: Story = {
501
+ render: () => {
502
+ const [activeTab, setActiveTab] = useState<string | null>('tab1');
503
+
504
+ return (
505
+ <div style={{ width: 600 }}>
506
+ <Tabs value={activeTab} onChange={setActiveTab}>
507
+ <Tabs.List>
508
+ <Tabs.Tab value="tab1" leftSection={<span>1️⃣</span>}>First Tab</Tabs.Tab>
509
+ <Tabs.Tab value="tab2" leftSection={<span>2️⃣</span>} rightSection={<Badge variant="filled" color="blue">New</Badge>}>
510
+ Second Tab
511
+ </Tabs.Tab>
512
+ <Tabs.Tab value="tab3" leftSection={<span>3️⃣</span>} disabled>Third Tab</Tabs.Tab>
513
+ </Tabs.List>
514
+ <Tabs.Panel value="tab1" pt="md"><Text>First tab content</Text></Tabs.Panel>
515
+ <Tabs.Panel value="tab2" pt="md"><Text>Second tab content</Text></Tabs.Panel>
516
+ <Tabs.Panel value="tab3" pt="md"><Text>Third tab content</Text></Tabs.Panel>
517
+ </Tabs>
518
+ </div>
519
+ );
520
+ },
521
+ parameters: {
522
+ docs: {
523
+ description: {
524
+ story: 'Interactive tabs demonstration.',
525
+ },
526
+ },
527
+ },
528
+ };