@xyd-js/storybook 0.0.0-build

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 (63) hide show
  1. package/.storybook/main.ts +40 -0
  2. package/.storybook/manager-head.html +6 -0
  3. package/.storybook/manager.ts +18 -0
  4. package/.storybook/preview.ts +40 -0
  5. package/.storybook/styles.css +5 -0
  6. package/.storybook/theme.ts +34 -0
  7. package/CHANGELOG.md +16 -0
  8. package/LICENSE +21 -0
  9. package/README.md +50 -0
  10. package/eslint.config.js +28 -0
  11. package/package.json +61 -0
  12. package/public/logo.svg +10 -0
  13. package/src/__fixtures__/Icons.tsx +83 -0
  14. package/src/__fixtures__/atlas-index/package-index.mdx +194 -0
  15. package/src/__fixtures__/atlas-index/wip1.mdx +131 -0
  16. package/src/__fixtures__/atlas-index.mdx +53 -0
  17. package/src/__fixtures__/code-sample.mdx +15 -0
  18. package/src/__fixtures__/example-source-uniform.ts +41 -0
  19. package/src/__fixtures__/hello-world.mdx +116 -0
  20. package/src/components/DemoDocs.tsx +235 -0
  21. package/src/components/logo.tsx +37 -0
  22. package/src/decorators/DocsTemplate.tsx +101 -0
  23. package/src/docs/atlas/Atlas.stories.tsx +51 -0
  24. package/src/docs/atlas/todo-app.uniform.json +625 -0
  25. package/src/docs/atlas/uniform-to-references.ts +101 -0
  26. package/src/docs/components/coder/CodeSample.stories.tsx +29 -0
  27. package/src/docs/components/pages/PageBlogHome.stories.tsx +52 -0
  28. package/src/docs/components/pages/PageFirstSlide.stories.tsx +124 -0
  29. package/src/docs/components/pages/PageHome.stories.tsx +127 -0
  30. package/src/docs/components/system/Baseline.stories.tsx +126 -0
  31. package/src/docs/components/writer/Badge.stories.tsx +132 -0
  32. package/src/docs/components/writer/Banner.stories.tsx +394 -0
  33. package/src/docs/components/writer/Blockquote.stories.tsx +415 -0
  34. package/src/docs/components/writer/Breadcrumbs.stories.tsx +282 -0
  35. package/src/docs/components/writer/Button.stories.tsx +405 -0
  36. package/src/docs/components/writer/Callout.stories.tsx +183 -0
  37. package/src/docs/components/writer/Card.stories.tsx +457 -0
  38. package/src/docs/components/writer/ColorSchemeButton.stories.tsx +322 -0
  39. package/src/docs/components/writer/Details.stories.tsx +333 -0
  40. package/src/docs/components/writer/GuideCard.stories.tsx +384 -0
  41. package/src/docs/components/writer/Heading.stories.tsx +379 -0
  42. package/src/docs/components/writer/Hr.stories.tsx +325 -0
  43. package/src/docs/components/writer/IconSocial.stories.tsx +591 -0
  44. package/src/docs/components/writer/Image.stories.tsx +430 -0
  45. package/src/docs/components/writer/List.stories.tsx +479 -0
  46. package/src/docs/components/writer/NavLinks.stories.tsx +380 -0
  47. package/src/docs/components/writer/Pre.stories.tsx +23 -0
  48. package/src/docs/components/writer/Steps.stories.tsx +914 -0
  49. package/src/docs/components/writer/Table.stories.tsx +608 -0
  50. package/src/docs/components/writer/Tabs.stories.tsx +760 -0
  51. package/src/docs/components/writer/TocCard.stories.tsx +407 -0
  52. package/src/docs/components/writer/Update.stories.tsx +457 -0
  53. package/src/docs/components/writer/VideoGuide.stories.tsx +17 -0
  54. package/src/docs/templates/CodeSample.stories.tsx +15 -0
  55. package/src/docs/themes/TODO.md +1 -0
  56. package/src/docs/themes/logo.tsx +37 -0
  57. package/src/docs/themes/themes.stories.tsx +269 -0
  58. package/src/docs/ui/Nav.stories.tsx +58 -0
  59. package/src/docs/ui/Sidebar.stories.tsx +167 -0
  60. package/src/docs/ui/SubNav.stories.tsx +29 -0
  61. package/src/utils/mdx.ts +31 -0
  62. package/tsconfig.json +39 -0
  63. package/vite.config.ts +8 -0
@@ -0,0 +1,760 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+
4
+ import { Tabs } from '@xyd-js/components/writer';
5
+
6
+ const meta: Meta<typeof Tabs> = {
7
+ title: 'Components/Writer/Tabs',
8
+ component: Tabs,
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component: 'Tabs component provides a tabbed interface for organizing content into multiple sections. It supports both primary and secondary variants with different styling and behavior.',
13
+ },
14
+ },
15
+ },
16
+ argTypes: {
17
+ children: {
18
+ description: 'The tab items and content sections',
19
+ control: false,
20
+ },
21
+ value: {
22
+ description: 'The currently selected tab value',
23
+ control: 'text',
24
+ },
25
+ onChange: {
26
+ description: 'Callback function triggered when a tab is selected',
27
+ control: false,
28
+ },
29
+ slide: {
30
+ description: 'Whether to enable sliding animation between tabs',
31
+ control: 'boolean',
32
+ },
33
+ className: {
34
+ description: 'Optional CSS class name for custom styling',
35
+ control: 'text',
36
+ },
37
+ kind: {
38
+ description: 'The variant of the tabs component',
39
+ control: { type: 'select' },
40
+ options: ['default', 'secondary'],
41
+ },
42
+ },
43
+ };
44
+
45
+ export default meta;
46
+ type Story = StoryObj<typeof Tabs>;
47
+
48
+ // Basic tabs
49
+ export const Default: Story = {
50
+ render: () => (
51
+ <div style={{ padding: '20px' }}>
52
+ <Tabs value="tab1">
53
+ <Tabs.Item value="tab1">
54
+ User Behavior
55
+ </Tabs.Item>
56
+ <Tabs.Item value="tab2">
57
+ Feature Adoption
58
+ </Tabs.Item>
59
+ <Tabs.Item value="tab3">
60
+ Churn Analysis
61
+ </Tabs.Item>
62
+
63
+ <Tabs.Content value="tab1">
64
+ <div style={{ padding: '20px' }}>
65
+ <h3>User Behavior Analysis</h3>
66
+ <p>
67
+ Gain insights into user behavior by replaying sessions and analyzing click patterns.
68
+ This helps uncover friction points in your app's user experience.
69
+ </p>
70
+ <ul>
71
+ <li>Session replay functionality</li>
72
+ <li>Click pattern analysis</li>
73
+ <li>User journey mapping</li>
74
+ <li>Friction point identification</li>
75
+ </ul>
76
+ </div>
77
+ </Tabs.Content>
78
+ <Tabs.Content value="tab2">
79
+ <div style={{ padding: '20px' }}>
80
+ <h3>Feature Adoption Tracking</h3>
81
+ <p>
82
+ Understand how users engage with new features. Track metrics like time to adoption
83
+ and overall usage to measure feature success.
84
+ </p>
85
+ <ul>
86
+ <li>Adoption rate tracking</li>
87
+ <li>Time-to-adoption metrics</li>
88
+ <li>Feature usage analytics</li>
89
+ <li>Success measurement</li>
90
+ </ul>
91
+ </div>
92
+ </Tabs.Content>
93
+ <Tabs.Content value="tab3">
94
+ <div style={{ padding: '20px' }}>
95
+ <h3>Churn Analysis</h3>
96
+ <p>
97
+ Use session data to identify behavioral patterns of users who are at risk of churning
98
+ and implement targeted retention strategies.
99
+ </p>
100
+ <ul>
101
+ <li>Churn prediction models</li>
102
+ <li>Behavioral pattern analysis</li>
103
+ <li>Retention strategy implementation</li>
104
+ <li>Risk assessment</li>
105
+ </ul>
106
+ </div>
107
+ </Tabs.Content>
108
+ </Tabs>
109
+ </div>
110
+ ),
111
+ };
112
+
113
+ // Secondary variant
114
+ export const Secondary: Story = {
115
+ render: () => (
116
+ <div style={{ padding: '20px' }}>
117
+ <Tabs value="overview" kind="secondary">
118
+ <Tabs.Item value="overview">
119
+ Overview
120
+ </Tabs.Item>
121
+ <Tabs.Item value="details">
122
+ Details
123
+ </Tabs.Item>
124
+ <Tabs.Item value="settings">
125
+ Settings
126
+ </Tabs.Item>
127
+
128
+ <Tabs.Content value="overview">
129
+ <div style={{ padding: '20px' }}>
130
+ <h3>System Overview</h3>
131
+ <p>This is the overview tab with general information about the system.</p>
132
+ <div style={{
133
+ background: 'var(--xyd-bgcolor-secondary)',
134
+ padding: '16px',
135
+ borderRadius: '8px',
136
+ marginTop: '16px'
137
+ }}>
138
+ <h4>Key Metrics</h4>
139
+ <p>Display important system metrics and status information.</p>
140
+ </div>
141
+ </div>
142
+ </Tabs.Content>
143
+ <Tabs.Content value="details">
144
+ <div style={{ padding: '20px' }}>
145
+ <h3>Detailed Information</h3>
146
+ <p>This tab shows detailed information about the selected item.</p>
147
+ <div style={{
148
+ background: 'var(--xyd-bgcolor-secondary)',
149
+ padding: '16px',
150
+ borderRadius: '8px',
151
+ marginTop: '16px'
152
+ }}>
153
+ <h4>Active Tab Content</h4>
154
+ <p>This content is visible because the Details tab is currently active.</p>
155
+ </div>
156
+ </div>
157
+ </Tabs.Content>
158
+ <Tabs.Content value="settings">
159
+ <div style={{ padding: '20px' }}>
160
+ <h3>Configuration Settings</h3>
161
+ <p>Configure your preferences and system settings in this tab.</p>
162
+ <ul>
163
+ <li>User preferences</li>
164
+ <li>System configuration</li>
165
+ <li>Security settings</li>
166
+ <li>Notification options</li>
167
+ </ul>
168
+ </div>
169
+ </Tabs.Content>
170
+ </Tabs>
171
+ </div>
172
+ ),
173
+ parameters: {
174
+ docs: {
175
+ description: {
176
+ story: 'Secondary Tabs variant with different styling and behavior.',
177
+ },
178
+ },
179
+ },
180
+ };
181
+
182
+ // Many tabs with scrolling
183
+ export const ManyTabs: Story = {
184
+ render: () => (
185
+ <div style={{ padding: '20px' }}>
186
+ <Tabs value="users">
187
+ <Tabs.Item value="users">User Behavior</Tabs.Item>
188
+ <Tabs.Item value="features">Feature Adoption</Tabs.Item>
189
+ <Tabs.Item value="churn">Churn Analysis</Tabs.Item>
190
+ <Tabs.Item value="revenue">Revenue Analytics</Tabs.Item>
191
+ <Tabs.Item value="performance">Performance Metrics</Tabs.Item>
192
+ <Tabs.Item value="security">Security Monitoring</Tabs.Item>
193
+ <Tabs.Item value="api">API Usage</Tabs.Item>
194
+ <Tabs.Item value="database">Database Health</Tabs.Item>
195
+
196
+ <Tabs.Content value="users">
197
+ <div style={{ padding: '20px' }}>
198
+ <h3>User Behavior Analysis</h3>
199
+ <p>Track and analyze user interactions to understand behavior patterns.</p>
200
+ </div>
201
+ </Tabs.Content>
202
+ <Tabs.Content value="features">
203
+ <div style={{ padding: '20px' }}>
204
+ <h3>Feature Adoption</h3>
205
+ <p>Monitor how users adopt and use new features in your application.</p>
206
+ </div>
207
+ </Tabs.Content>
208
+ <Tabs.Content value="churn">
209
+ <div style={{ padding: '20px' }}>
210
+ <h3>Churn Analysis</h3>
211
+ <p>Identify users at risk of leaving and implement retention strategies.</p>
212
+ </div>
213
+ </Tabs.Content>
214
+ <Tabs.Content value="revenue">
215
+ <div style={{ padding: '20px' }}>
216
+ <h3>Revenue Analytics</h3>
217
+ <p>Track revenue metrics and analyze business performance.</p>
218
+ </div>
219
+ </Tabs.Content>
220
+ <Tabs.Content value="performance">
221
+ <div style={{ padding: '20px' }}>
222
+ <h3>Performance Metrics</h3>
223
+ <p>Monitor application performance and system health.</p>
224
+ </div>
225
+ </Tabs.Content>
226
+ <Tabs.Content value="security">
227
+ <div style={{ padding: '20px' }}>
228
+ <h3>Security Monitoring</h3>
229
+ <p>Track security events and monitor for potential threats.</p>
230
+ </div>
231
+ </Tabs.Content>
232
+ <Tabs.Content value="api">
233
+ <div style={{ padding: '20px' }}>
234
+ <h3>API Usage</h3>
235
+ <p>Monitor API calls, rate limits, and usage patterns.</p>
236
+ </div>
237
+ </Tabs.Content>
238
+ <Tabs.Content value="database">
239
+ <div style={{ padding: '20px' }}>
240
+ <h3>Database Health</h3>
241
+ <p>Track database performance, connections, and query optimization.</p>
242
+ </div>
243
+ </Tabs.Content>
244
+ </Tabs>
245
+ </div>
246
+ ),
247
+ parameters: {
248
+ docs: {
249
+ description: {
250
+ story: 'This example shows how the Tabs component handles many tabs with horizontal scrolling.',
251
+ },
252
+ },
253
+ },
254
+ };
255
+
256
+ // Tabs with links
257
+ export const WithLinks: Story = {
258
+ render: () => (
259
+ <div style={{ padding: '20px' }}>
260
+ <Tabs value="tab1">
261
+ <Tabs.Item value="tab1" href="#tab1">
262
+ Documentation
263
+ </Tabs.Item>
264
+ <Tabs.Item value="tab2" href="#tab2">
265
+ Examples
266
+ </Tabs.Item>
267
+ <Tabs.Item value="tab3" href="#tab3">
268
+ API Reference
269
+ </Tabs.Item>
270
+
271
+ <Tabs.Content value="tab1">
272
+ <div style={{ padding: '20px' }}>
273
+ <h3>Component Documentation</h3>
274
+ <p>
275
+ The Tabs component provides a clean and accessible way to organize content into
276
+ multiple sections. It supports horizontal scrolling when there are many tabs and
277
+ includes arrow navigation for better user experience.
278
+ </p>
279
+
280
+ <h4>Key Features</h4>
281
+ <ul>
282
+ <li><strong>Accessible:</strong> Built with proper ARIA attributes and keyboard navigation</li>
283
+ <li><strong>Responsive:</strong> Adapts to different screen sizes</li>
284
+ <li><strong>Scrollable:</strong> Handles many tabs with horizontal scrolling</li>
285
+ <li><strong>Customizable:</strong> Supports custom styling via className prop</li>
286
+ </ul>
287
+ </div>
288
+ </Tabs.Content>
289
+ <Tabs.Content value="tab2">
290
+ <div style={{ padding: '20px' }}>
291
+ <h3>Usage Examples</h3>
292
+
293
+ <div style={{ marginBottom: '24px' }}>
294
+ <h4>Basic Tabs</h4>
295
+ <p>Simple tab interface with a few sections:</p>
296
+ <div style={{
297
+ background: 'var(--xyd-bgcolor-secondary)',
298
+ padding: '16px',
299
+ borderRadius: '8px'
300
+ }}>
301
+ <strong>Example:</strong> Settings, Profile, Notifications
302
+ </div>
303
+ </div>
304
+
305
+ <div style={{ marginBottom: '24px' }}>
306
+ <h4>Many Tabs</h4>
307
+ <p>When you have many tabs, the component automatically adds scrolling:</p>
308
+ <div style={{
309
+ background: 'var(--xyd-bgcolor-secondary)',
310
+ padding: '16px',
311
+ borderRadius: '8px'
312
+ }}>
313
+ <strong>Example:</strong> Analytics, Users, Reports, Settings, Help, etc.
314
+ </div>
315
+ </div>
316
+ </div>
317
+ </Tabs.Content>
318
+ <Tabs.Content value="tab3">
319
+ <div style={{ padding: '20px' }}>
320
+ <h3>API Reference</h3>
321
+
322
+ <h4>Props</h4>
323
+ <table style={{ width: '100%', borderCollapse: 'collapse' }}>
324
+ <thead>
325
+ <tr style={{ borderBottom: '1px solid var(--xyd-border-color)' }}>
326
+ <th style={{ textAlign: 'left', padding: '8px' }}>Prop</th>
327
+ <th style={{ textAlign: 'left', padding: '8px' }}>Type</th>
328
+ <th style={{ textAlign: 'left', padding: '8px' }}>Description</th>
329
+ </tr>
330
+ </thead>
331
+ <tbody>
332
+ <tr style={{ borderBottom: '1px solid var(--xyd-border-color)' }}>
333
+ <td style={{ padding: '8px' }}><code>children</code></td>
334
+ <td style={{ padding: '8px' }}>React.ReactNode</td>
335
+ <td style={{ padding: '8px' }}>Tab items and content sections</td>
336
+ </tr>
337
+ <tr style={{ borderBottom: '1px solid var(--xyd-border-color)' }}>
338
+ <td style={{ padding: '8px' }}><code>value</code></td>
339
+ <td style={{ padding: '8px' }}>string</td>
340
+ <td style={{ padding: '8px' }}>Currently selected tab value</td>
341
+ </tr>
342
+ <tr style={{ borderBottom: '1px solid var(--xyd-border-color)' }}>
343
+ <td style={{ padding: '8px' }}><code>onChange</code></td>
344
+ <td style={{ padding: '8px' }}>function</td>
345
+ <td style={{ padding: '8px' }}>Callback when tab is selected</td>
346
+ </tr>
347
+ <tr>
348
+ <td style={{ padding: '8px' }}><code>kind</code></td>
349
+ <td style={{ padding: '8px' }}>string</td>
350
+ <td style={{ padding: '8px' }}>Tab variant (default/secondary)</td>
351
+ </tr>
352
+ </tbody>
353
+ </table>
354
+ </div>
355
+ </Tabs.Content>
356
+ </Tabs>
357
+ </div>
358
+ ),
359
+ parameters: {
360
+ docs: {
361
+ description: {
362
+ story: 'This example shows tabs with href links for navigation.',
363
+ },
364
+ },
365
+ },
366
+ };
367
+
368
+ // Real-world examples
369
+ export const RealWorldExamples: Story = {
370
+ render: () => (
371
+ <div style={{ padding: '20px', maxWidth: '1000px' }}>
372
+ <div style={{ marginBottom: '40px' }}>
373
+ <h2>Dashboard Analytics</h2>
374
+ <p>Tabs are commonly used in dashboards to organize different types of analytics and data.</p>
375
+ <div style={{
376
+ background: 'var(--xyd-bgcolor)',
377
+ border: '1px solid var(--xyd-border-color)',
378
+ borderRadius: '8px',
379
+ padding: '20px'
380
+ }}>
381
+ <h3 style={{ marginBottom: '16px' }}>Analytics Dashboard</h3>
382
+ <Tabs value="overview">
383
+ <Tabs.Item value="overview">Overview</Tabs.Item>
384
+ <Tabs.Item value="users">Users</Tabs.Item>
385
+ <Tabs.Item value="revenue">Revenue</Tabs.Item>
386
+ <Tabs.Item value="performance">Performance</Tabs.Item>
387
+ <Tabs.Item value="settings">Settings</Tabs.Item>
388
+
389
+ <Tabs.Content value="overview">
390
+ <div style={{ padding: '20px' }}>
391
+ <h4>Dashboard Overview</h4>
392
+ <p>Key metrics and summary information for your application.</p>
393
+ <div style={{
394
+ display: 'grid',
395
+ gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
396
+ gap: '16px',
397
+ marginTop: '16px'
398
+ }}>
399
+ <div style={{
400
+ background: 'var(--xyd-bgcolor-secondary)',
401
+ padding: '16px',
402
+ borderRadius: '8px',
403
+ textAlign: 'center'
404
+ }}>
405
+ <h5>Total Users</h5>
406
+ <p style={{ fontSize: '24px', fontWeight: 'bold', margin: 0 }}>12,345</p>
407
+ </div>
408
+ <div style={{
409
+ background: 'var(--xyd-bgcolor-secondary)',
410
+ padding: '16px',
411
+ borderRadius: '8px',
412
+ textAlign: 'center'
413
+ }}>
414
+ <h5>Active Sessions</h5>
415
+ <p style={{ fontSize: '24px', fontWeight: 'bold', margin: 0 }}>1,234</p>
416
+ </div>
417
+ <div style={{
418
+ background: 'var(--xyd-bgcolor-secondary)',
419
+ padding: '16px',
420
+ borderRadius: '8px',
421
+ textAlign: 'center'
422
+ }}>
423
+ <h5>Revenue</h5>
424
+ <p style={{ fontSize: '24px', fontWeight: 'bold', margin: 0 }}>$45,678</p>
425
+ </div>
426
+ </div>
427
+ </div>
428
+ </Tabs.Content>
429
+ <Tabs.Content value="users">
430
+ <div style={{ padding: '20px' }}>
431
+ <h4>User Analytics</h4>
432
+ <p>Detailed user behavior and engagement metrics.</p>
433
+ <ul>
434
+ <li>User acquisition trends</li>
435
+ <li>Engagement metrics</li>
436
+ <li>Retention analysis</li>
437
+ <li>User segmentation</li>
438
+ </ul>
439
+ </div>
440
+ </Tabs.Content>
441
+ <Tabs.Content value="revenue">
442
+ <div style={{ padding: '20px' }}>
443
+ <h4>Revenue Analytics</h4>
444
+ <p>Financial metrics and revenue tracking.</p>
445
+ <ul>
446
+ <li>Monthly recurring revenue</li>
447
+ <li>Customer lifetime value</li>
448
+ <li>Churn rate analysis</li>
449
+ <li>Pricing optimization</li>
450
+ </ul>
451
+ </div>
452
+ </Tabs.Content>
453
+ <Tabs.Content value="performance">
454
+ <div style={{ padding: '20px' }}>
455
+ <h4>System Performance</h4>
456
+ <p>Application performance and system health metrics.</p>
457
+ <ul>
458
+ <li>Response time monitoring</li>
459
+ <li>Error rate tracking</li>
460
+ <li>Resource utilization</li>
461
+ <li>Uptime statistics</li>
462
+ </ul>
463
+ </div>
464
+ </Tabs.Content>
465
+ <Tabs.Content value="settings">
466
+ <div style={{ padding: '20px' }}>
467
+ <h4>Dashboard Settings</h4>
468
+ <p>Configure your dashboard preferences and display options.</p>
469
+ <ul>
470
+ <li>Widget customization</li>
471
+ <li>Theme selection</li>
472
+ <li>Notification preferences</li>
473
+ <li>Data refresh intervals</li>
474
+ </ul>
475
+ </div>
476
+ </Tabs.Content>
477
+ </Tabs>
478
+ </div>
479
+ </div>
480
+
481
+ <div style={{ marginBottom: '40px' }}>
482
+ <h2>Product Documentation</h2>
483
+ <p>Tabs are perfect for organizing product documentation and user guides.</p>
484
+ <div style={{
485
+ background: 'var(--xyd-bgcolor)',
486
+ border: '1px solid var(--xyd-border-color)',
487
+ borderRadius: '8px',
488
+ padding: '20px'
489
+ }}>
490
+ <h3 style={{ marginBottom: '16px' }}>API Documentation</h3>
491
+ <Tabs value="getting-started">
492
+ <Tabs.Item value="getting-started">Getting Started</Tabs.Item>
493
+ <Tabs.Item value="authentication">Authentication</Tabs.Item>
494
+ <Tabs.Item value="endpoints">Endpoints</Tabs.Item>
495
+ <Tabs.Item value="examples">Examples</Tabs.Item>
496
+ <Tabs.Item value="sdks">SDKs</Tabs.Item>
497
+
498
+ <Tabs.Content value="getting-started">
499
+ <div style={{ padding: '20px' }}>
500
+ <h4>Quick Start Guide</h4>
501
+ <p>Get up and running with our API in minutes.</p>
502
+ <ol>
503
+ <li>Sign up for an API key</li>
504
+ <li>Install the SDK</li>
505
+ <li>Make your first request</li>
506
+ <li>Explore the documentation</li>
507
+ </ol>
508
+ </div>
509
+ </Tabs.Content>
510
+ <Tabs.Content value="authentication">
511
+ <div style={{ padding: '20px' }}>
512
+ <h4>API Authentication</h4>
513
+ <p>Learn how to authenticate your API requests.</p>
514
+ <pre style={{
515
+ background: 'var(--xyd-bgcolor-secondary)',
516
+ padding: '12px',
517
+ borderRadius: '4px',
518
+ fontSize: '14px'
519
+ }}>
520
+ <code>{`curl -H "Authorization: Bearer YOUR_API_KEY" \\
521
+ https://api.example.com/v1/data`}</code>
522
+ </pre>
523
+ </div>
524
+ </Tabs.Content>
525
+ <Tabs.Content value="endpoints">
526
+ <div style={{ padding: '20px' }}>
527
+ <h4>API Endpoints</h4>
528
+ <p>Complete reference of all available API endpoints.</p>
529
+ <ul>
530
+ <li>GET /users - List users</li>
531
+ <li>POST /users - Create user</li>
532
+ <li>PUT /users/{'{id}'} - Update user</li>
533
+ <li>DELETE /users/{'{id}'} - Delete user</li>
534
+ </ul>
535
+ </div>
536
+ </Tabs.Content>
537
+ <Tabs.Content value="examples">
538
+ <div style={{ padding: '20px' }}>
539
+ <h4>Code Examples</h4>
540
+ <p>Real-world examples in multiple programming languages.</p>
541
+ <ul>
542
+ <li>JavaScript/Node.js examples</li>
543
+ <li>Python examples</li>
544
+ <li>PHP examples</li>
545
+ <li>cURL examples</li>
546
+ </ul>
547
+ </div>
548
+ </Tabs.Content>
549
+ <Tabs.Content value="sdks">
550
+ <div style={{ padding: '20px' }}>
551
+ <h4>Software Development Kits</h4>
552
+ <p>Official SDKs for popular programming languages.</p>
553
+ <ul>
554
+ <li>JavaScript SDK</li>
555
+ <li>Python SDK</li>
556
+ <li>PHP SDK</li>
557
+ <li>Ruby SDK</li>
558
+ </ul>
559
+ </div>
560
+ </Tabs.Content>
561
+ </Tabs>
562
+ </div>
563
+ </div>
564
+ </div>
565
+ ),
566
+ parameters: {
567
+ docs: {
568
+ description: {
569
+ story: 'This example shows how Tabs components are typically used in real applications.',
570
+ },
571
+ },
572
+ },
573
+ };
574
+
575
+ // Interactive example
576
+ export const Interactive: Story = {
577
+ render: () => (
578
+ <div style={{ padding: '20px' }}>
579
+ <div style={{
580
+ background: 'var(--xyd-bgcolor)',
581
+ border: '1px solid var(--xyd-border-color)',
582
+ borderRadius: '8px',
583
+ padding: '20px',
584
+ marginBottom: '20px'
585
+ }}>
586
+ <h3 style={{ marginBottom: '16px' }}>Tabs Component Demo</h3>
587
+ <p style={{ marginBottom: '16px', color: 'var(--xyd-text-color)' }}>
588
+ This example demonstrates the Tabs component with various content types and interactive features.
589
+ </p>
590
+ <Tabs value="features">
591
+ <Tabs.Item value="features">Features</Tabs.Item>
592
+ <Tabs.Item value="implementation">Implementation</Tabs.Item>
593
+ <Tabs.Item value="customization">Customization</Tabs.Item>
594
+
595
+ <Tabs.Content value="features">
596
+ <div style={{ padding: '20px' }}>
597
+ <h4>Key Features</h4>
598
+ <ul style={{ color: 'var(--xyd-text-color)' }}>
599
+ <li>Horizontal scrolling for many tabs</li>
600
+ <li>Arrow navigation when tabs overflow</li>
601
+ <li>Accessible keyboard navigation</li>
602
+ <li>Customizable styling</li>
603
+ <li>Rich content support</li>
604
+ <li>Responsive design</li>
605
+ </ul>
606
+ </div>
607
+ </Tabs.Content>
608
+ <Tabs.Content value="implementation">
609
+ <div style={{ padding: '20px' }}>
610
+ <h4>Implementation Details</h4>
611
+ <p style={{ color: 'var(--xyd-text-color)' }}>
612
+ The Tabs component is built using Radix UI primitives for accessibility and
613
+ includes custom scrolling behavior for handling many tabs efficiently.
614
+ </p>
615
+ <pre style={{
616
+ background: 'var(--xyd-bgcolor-secondary)',
617
+ padding: '12px',
618
+ borderRadius: '4px',
619
+ fontSize: '14px',
620
+ marginTop: '16px'
621
+ }}>
622
+ <code>{`// Basic usage
623
+ <Tabs value="tab1">
624
+ <Tabs.Item value="tab1">Tab 1</Tabs.Item>
625
+ <Tabs.Item value="tab2">Tab 2</Tabs.Item>
626
+ <Tabs.Content value="tab1">Content 1</Tabs.Content>
627
+ <Tabs.Content value="tab2">Content 2</Tabs.Content>
628
+ </Tabs>`}</code>
629
+ </pre>
630
+ </div>
631
+ </Tabs.Content>
632
+ <Tabs.Content value="customization">
633
+ <div style={{ padding: '20px' }}>
634
+ <h4>Customization Options</h4>
635
+ <p style={{ color: 'var(--xyd-text-color)' }}>
636
+ The component supports various customization options through props and CSS classes.
637
+ </p>
638
+ <ul style={{ color: 'var(--xyd-text-color)' }}>
639
+ <li><code>value</code> - Set active tab</li>
640
+ <li><code>onChange</code> - Handle tab changes</li>
641
+ <li><code>className</code> - Add custom CSS classes</li>
642
+ <li><code>kind</code> - Choose variant (default/secondary)</li>
643
+ <li>CSS custom properties for theming</li>
644
+ </ul>
645
+ </div>
646
+ </Tabs.Content>
647
+ </Tabs>
648
+ </div>
649
+
650
+ <div style={{
651
+ background: 'var(--xyd-bgcolor)',
652
+ border: '1px solid var(--xyd-border-color)',
653
+ borderRadius: '8px',
654
+ padding: '20px'
655
+ }}>
656
+ <h4 style={{ marginBottom: '12px' }}>Usage Guidelines</h4>
657
+ <ul style={{ color: 'var(--xyd-text-color)' }}>
658
+ <li>Use for organizing related content into sections</li>
659
+ <li>Keep tab labels short and descriptive</li>
660
+ <li>Ensure each tab has meaningful content</li>
661
+ <li>Consider mobile responsiveness</li>
662
+ <li>Test with many tabs for scrolling behavior</li>
663
+ <li>Use href prop for navigation when needed</li>
664
+ </ul>
665
+ </div>
666
+ </div>
667
+ ),
668
+ parameters: {
669
+ docs: {
670
+ description: {
671
+ story: 'This interactive example demonstrates the Tabs component functionality and customization options.',
672
+ },
673
+ },
674
+ },
675
+ };
676
+
677
+ // Comparison between variants
678
+ export const PrimaryVsSecondary: Story = {
679
+ render: () => (
680
+ <div style={{ padding: '20px' }}>
681
+ <div style={{ marginBottom: '40px' }}>
682
+ <h3 style={{ marginBottom: '16px', color: '#666' }}>Primary Tabs (Default)</h3>
683
+ <Tabs value="tab1">
684
+ <Tabs.Item value="tab1">First Tab</Tabs.Item>
685
+ <Tabs.Item value="tab2">Second Tab</Tabs.Item>
686
+ <Tabs.Item value="tab3">Third Tab</Tabs.Item>
687
+
688
+ <Tabs.Content value="tab1">
689
+ <div style={{ padding: '20px' }}>
690
+ <h4>Primary Tab Content</h4>
691
+ <p>This is the primary variant with default styling.</p>
692
+ </div>
693
+ </Tabs.Content>
694
+ <Tabs.Content value="tab2">
695
+ <div style={{ padding: '20px' }}>
696
+ <h4>Second Tab</h4>
697
+ <p>Content for the second tab.</p>
698
+ </div>
699
+ </Tabs.Content>
700
+ <Tabs.Content value="tab3">
701
+ <div style={{ padding: '20px' }}>
702
+ <h4>Third Tab</h4>
703
+ <p>Content for the third tab.</p>
704
+ </div>
705
+ </Tabs.Content>
706
+ </Tabs>
707
+ </div>
708
+
709
+ <div style={{ marginBottom: '40px' }}>
710
+ <h3 style={{ marginBottom: '16px', color: '#666' }}>Secondary Tabs</h3>
711
+ <Tabs value="tab1" kind="secondary">
712
+ <Tabs.Item value="tab1">First Tab</Tabs.Item>
713
+ <Tabs.Item value="tab2">Second Tab</Tabs.Item>
714
+ <Tabs.Item value="tab3">Third Tab</Tabs.Item>
715
+
716
+ <Tabs.Content value="tab1">
717
+ <div style={{ padding: '20px' }}>
718
+ <h4>Secondary Tab Content</h4>
719
+ <p>This is the secondary variant with different styling.</p>
720
+ </div>
721
+ </Tabs.Content>
722
+ <Tabs.Content value="tab2">
723
+ <div style={{ padding: '20px' }}>
724
+ <h4>Second Tab</h4>
725
+ <p>Content for the second tab.</p>
726
+ </div>
727
+ </Tabs.Content>
728
+ <Tabs.Content value="tab3">
729
+ <div style={{ padding: '20px' }}>
730
+ <h4>Third Tab</h4>
731
+ <p>Content for the third tab.</p>
732
+ </div>
733
+ </Tabs.Content>
734
+ </Tabs>
735
+ </div>
736
+
737
+ <div style={{
738
+ background: 'var(--xyd-bgcolor)',
739
+ border: '1px solid var(--xyd-border-color)',
740
+ borderRadius: '8px',
741
+ padding: '20px'
742
+ }}>
743
+ <h4 style={{ marginBottom: '12px' }}>Key Differences</h4>
744
+ <ul style={{ color: 'var(--xyd-text-color)' }}>
745
+ <li><strong>Primary:</strong> Default styling with underline indicator</li>
746
+ <li><strong>Secondary:</strong> Different visual styling and behavior</li>
747
+ <li><strong>Use Primary:</strong> For general content organization</li>
748
+ <li><strong>Use Secondary:</strong> For specific use cases requiring different styling</li>
749
+ </ul>
750
+ </div>
751
+ </div>
752
+ ),
753
+ parameters: {
754
+ docs: {
755
+ description: {
756
+ story: 'This example compares the primary and secondary variants of the Tabs component.',
757
+ },
758
+ },
759
+ },
760
+ };