@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,322 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+
4
+ import { ColorSchemeButton } from '@xyd-js/components/writer';
5
+
6
+ const meta: Meta<typeof ColorSchemeButton> = {
7
+ title: 'Components/Writer/ColorSchemeButton',
8
+ component: ColorSchemeButton,
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component: 'ColorSchemeButton component provides a toggle button for switching between light and dark color schemes. It automatically detects the current scheme and updates the UI accordingly.',
13
+ },
14
+ },
15
+ },
16
+ argTypes: {
17
+ // ColorSchemeButton doesn't accept props, but we can document the behavior
18
+ },
19
+ };
20
+
21
+ export default meta;
22
+ type Story = StoryObj<typeof ColorSchemeButton>;
23
+
24
+ // Basic usage
25
+ export const Default: Story = {
26
+ render: () => (
27
+ <div style={{ padding: '20px' }}>
28
+ <ColorSchemeButton />
29
+ </div>
30
+ ),
31
+ };
32
+
33
+ // In navigation context
34
+ export const InNavigation: Story = {
35
+ render: () => (
36
+ <div style={{
37
+ padding: '20px',
38
+ background: 'var(--xyd-bgcolor)',
39
+ border: '1px solid var(--xyd-border-color)',
40
+ borderRadius: '8px'
41
+ }}>
42
+ <div style={{
43
+ display: 'flex',
44
+ justifyContent: 'space-between',
45
+ alignItems: 'center',
46
+ padding: '16px'
47
+ }}>
48
+ <div style={{ fontWeight: 'bold' }}>Documentation</div>
49
+ <div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>
50
+ <span style={{ fontSize: '14px' }}>Theme:</span>
51
+ <ColorSchemeButton />
52
+ </div>
53
+ </div>
54
+ </div>
55
+ ),
56
+ parameters: {
57
+ docs: {
58
+ description: {
59
+ story: 'This example shows how the ColorSchemeButton is typically used in navigation bars or headers.',
60
+ },
61
+ },
62
+ },
63
+ };
64
+
65
+ // Multiple buttons
66
+ export const MultipleButtons: Story = {
67
+ render: () => (
68
+ <div style={{ padding: '20px' }}>
69
+ <div style={{ marginBottom: '20px' }}>
70
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Header Button</h3>
71
+ <div style={{
72
+ display: 'flex',
73
+ justifyContent: 'space-between',
74
+ alignItems: 'center',
75
+ padding: '12px',
76
+ background: 'var(--xyd-bgcolor)',
77
+ border: '1px solid var(--xyd-border-color)',
78
+ borderRadius: '4px'
79
+ }}>
80
+ <span>Site Header</span>
81
+ <ColorSchemeButton />
82
+ </div>
83
+ </div>
84
+
85
+ <div style={{ marginBottom: '20px' }}>
86
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Sidebar Button</h3>
87
+ <div style={{
88
+ display: 'flex',
89
+ flexDirection: 'column',
90
+ gap: '8px',
91
+ padding: '12px',
92
+ background: 'var(--xyd-bgcolor)',
93
+ border: '1px solid var(--xyd-border-color)',
94
+ borderRadius: '4px',
95
+ width: '200px'
96
+ }}>
97
+ <span>Navigation</span>
98
+ <span>Getting Started</span>
99
+ <span>API Reference</span>
100
+ <div style={{ marginTop: 'auto', display: 'flex', justifyContent: 'center' }}>
101
+ <ColorSchemeButton />
102
+ </div>
103
+ </div>
104
+ </div>
105
+
106
+ <div style={{ marginBottom: '20px' }}>
107
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Footer Button</h3>
108
+ <div style={{
109
+ display: 'flex',
110
+ justifyContent: 'space-between',
111
+ alignItems: 'center',
112
+ padding: '12px',
113
+ background: 'var(--xyd-bgcolor)',
114
+ border: '1px solid var(--xyd-border-color)',
115
+ borderRadius: '4px'
116
+ }}>
117
+ <span>© 2024 Documentation</span>
118
+ <ColorSchemeButton />
119
+ </div>
120
+ </div>
121
+ </div>
122
+ ),
123
+ parameters: {
124
+ docs: {
125
+ description: {
126
+ story: 'This example shows how ColorSchemeButton can be used in different contexts throughout an application.',
127
+ },
128
+ },
129
+ },
130
+ };
131
+
132
+ // Interactive example
133
+ export const Interactive: Story = {
134
+ render: () => (
135
+ <div style={{ padding: '20px' }}>
136
+ <div style={{
137
+ background: 'var(--xyd-bgcolor)',
138
+ border: '1px solid var(--xyd-border-color)',
139
+ borderRadius: '8px',
140
+ padding: '20px',
141
+ marginBottom: '20px'
142
+ }}>
143
+ <h3 style={{ marginBottom: '16px' }}>Theme Toggle Demo</h3>
144
+ <p style={{ marginBottom: '16px', color: 'var(--xyd-text-color)' }}>
145
+ Click the button below to toggle between light and dark themes.
146
+ The button will automatically show the appropriate icon for the current theme.
147
+ </p>
148
+ <div style={{ display: 'flex', justifyContent: 'center' }}>
149
+ <ColorSchemeButton />
150
+ </div>
151
+ </div>
152
+
153
+ <div style={{
154
+ background: 'var(--xyd-bgcolor)',
155
+ border: '1px solid var(--xyd-border-color)',
156
+ borderRadius: '8px',
157
+ padding: '20px'
158
+ }}>
159
+ <h4 style={{ marginBottom: '12px' }}>Current Theme Information</h4>
160
+ <ul style={{ color: 'var(--xyd-text-color)' }}>
161
+ <li>The button automatically detects the current color scheme</li>
162
+ <li>Shows a sun icon for light mode</li>
163
+ <li>Shows a moon icon for dark mode</li>
164
+ <li>Persists the selection in localStorage</li>
165
+ <li>Respects system preferences when set to "os"</li>
166
+ </ul>
167
+ </div>
168
+ </div>
169
+ ),
170
+ parameters: {
171
+ docs: {
172
+ description: {
173
+ story: 'This interactive example demonstrates the ColorSchemeButton functionality and behavior.',
174
+ },
175
+ },
176
+ },
177
+ };
178
+
179
+ // Real-world examples
180
+ export const RealWorldExamples: Story = {
181
+ render: () => (
182
+ <div style={{ padding: '20px', maxWidth: '800px' }}>
183
+ <div style={{ marginBottom: '40px' }}>
184
+ <h2>Documentation Site Header</h2>
185
+ <p>Typical usage in a documentation site header with navigation and theme toggle.</p>
186
+ <div style={{
187
+ background: 'var(--xyd-bgcolor)',
188
+ border: '1px solid var(--xyd-border-color)',
189
+ borderRadius: '8px',
190
+ padding: '16px'
191
+ }}>
192
+ <div style={{
193
+ display: 'flex',
194
+ justifyContent: 'space-between',
195
+ alignItems: 'center'
196
+ }}>
197
+ <div style={{ display: 'flex', alignItems: 'center', gap: '24px' }}>
198
+ <span style={{ fontWeight: 'bold', fontSize: '18px' }}>Docs</span>
199
+ <nav style={{ display: 'flex', gap: '16px' }}>
200
+ <a href="#" style={{ color: 'var(--xyd-text-color)', textDecoration: 'none' }}>Guide</a>
201
+ <a href="#" style={{ color: 'var(--xyd-text-color)', textDecoration: 'none' }}>API</a>
202
+ <a href="#" style={{ color: 'var(--xyd-text-color)', textDecoration: 'none' }}>Examples</a>
203
+ </nav>
204
+ </div>
205
+ <ColorSchemeButton />
206
+ </div>
207
+ </div>
208
+ </div>
209
+
210
+ <div style={{ marginBottom: '40px' }}>
211
+ <h2>Application Settings</h2>
212
+ <p>Theme toggle in an application settings panel.</p>
213
+ <div style={{
214
+ background: 'var(--xyd-bgcolor)',
215
+ border: '1px solid var(--xyd-border-color)',
216
+ borderRadius: '8px',
217
+ padding: '20px'
218
+ }}>
219
+ <h3 style={{ marginBottom: '16px' }}>Appearance</h3>
220
+ <div style={{
221
+ display: 'flex',
222
+ justifyContent: 'space-between',
223
+ alignItems: 'center',
224
+ padding: '12px',
225
+ background: 'var(--xyd-bgcolor-secondary)',
226
+ borderRadius: '4px',
227
+ marginBottom: '12px'
228
+ }}>
229
+ <div>
230
+ <div style={{ fontWeight: 'bold', marginBottom: '4px' }}>Theme</div>
231
+ <div style={{ fontSize: '14px', color: 'var(--xyd-text-color-secondary)' }}>
232
+ Choose your preferred color scheme
233
+ </div>
234
+ </div>
235
+ <ColorSchemeButton />
236
+ </div>
237
+ </div>
238
+ </div>
239
+
240
+ <div style={{ marginBottom: '40px' }}>
241
+ <h2>Sidebar Navigation</h2>
242
+ <p>Theme toggle in a sidebar navigation component.</p>
243
+ <div style={{
244
+ display: 'flex',
245
+ gap: '20px'
246
+ }}>
247
+ <div style={{
248
+ background: 'var(--xyd-bgcolor)',
249
+ border: '1px solid var(--xyd-border-color)',
250
+ borderRadius: '8px',
251
+ padding: '16px',
252
+ width: '250px',
253
+ display: 'flex',
254
+ flexDirection: 'column',
255
+ gap: '12px'
256
+ }}>
257
+ <div style={{ fontWeight: 'bold', marginBottom: '8px' }}>Navigation</div>
258
+ <a href="#" style={{ color: 'var(--xyd-text-color)', textDecoration: 'none' }}>Dashboard</a>
259
+ <a href="#" style={{ color: 'var(--xyd-text-color)', textDecoration: 'none' }}>Projects</a>
260
+ <a href="#" style={{ color: 'var(--xyd-text-color)', textDecoration: 'none' }}>Settings</a>
261
+ <div style={{ marginTop: 'auto', display: 'flex', justifyContent: 'center' }}>
262
+ <ColorSchemeButton />
263
+ </div>
264
+ </div>
265
+ </div>
266
+ </div>
267
+ </div>
268
+ ),
269
+ parameters: {
270
+ docs: {
271
+ description: {
272
+ story: 'This example shows practical use cases for the ColorSchemeButton in real applications.',
273
+ },
274
+ },
275
+ },
276
+ };
277
+
278
+ // Theme demonstration
279
+ export const ThemeDemonstration: Story = {
280
+ render: () => (
281
+ <div style={{ padding: '20px' }}>
282
+ <div style={{
283
+ background: 'var(--xyd-bgcolor)',
284
+ border: '1px solid var(--xyd-border-color)',
285
+ borderRadius: '8px',
286
+ padding: '20px',
287
+ marginBottom: '20px'
288
+ }}>
289
+ <h3 style={{ marginBottom: '16px', color: 'var(--xyd-text-color)' }}>Theme Toggle</h3>
290
+ <p style={{ marginBottom: '16px', color: 'var(--xyd-text-color)' }}>
291
+ This button automatically adapts to the current theme and provides a way to switch between light and dark modes.
292
+ </p>
293
+ <div style={{ display: 'flex', justifyContent: 'center' }}>
294
+ <ColorSchemeButton />
295
+ </div>
296
+ </div>
297
+
298
+ <div style={{
299
+ background: 'var(--xyd-bgcolor)',
300
+ border: '1px solid var(--xyd-border-color)',
301
+ borderRadius: '8px',
302
+ padding: '20px'
303
+ }}>
304
+ <h4 style={{ marginBottom: '12px', color: 'var(--xyd-text-color)' }}>Features</h4>
305
+ <ul style={{ color: 'var(--xyd-text-color)' }}>
306
+ <li>Automatic theme detection</li>
307
+ <li>System preference support</li>
308
+ <li>Local storage persistence</li>
309
+ <li>Accessible button design</li>
310
+ <li>Consistent with design system</li>
311
+ </ul>
312
+ </div>
313
+ </div>
314
+ ),
315
+ parameters: {
316
+ docs: {
317
+ description: {
318
+ story: 'This example demonstrates the ColorSchemeButton features and capabilities.',
319
+ },
320
+ },
321
+ },
322
+ };
@@ -0,0 +1,333 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+
4
+ import { Details } from '@xyd-js/components/writer';
5
+
6
+ const meta: Meta<typeof Details> = {
7
+ title: 'Components/Writer/Details',
8
+ component: Details,
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component: 'Details component provides collapsible content sections with three variants: primary, secondary, and tertiary. Each variant has different visual styling and structure.',
13
+ },
14
+ },
15
+ },
16
+ argTypes: {
17
+ children: {
18
+ description: 'The content to be displayed inside the details element',
19
+ control: 'text',
20
+ },
21
+ label: {
22
+ description: 'Label text displayed in the summary',
23
+ control: 'text',
24
+ },
25
+ title: {
26
+ description: 'Title text or element displayed in the summary (for secondary and tertiary variants)',
27
+ control: 'text',
28
+ },
29
+ kind: {
30
+ description: 'The variant of the details component',
31
+ control: { type: 'select' },
32
+ options: ['primary', 'secondary', 'tertiary'],
33
+ },
34
+ icon: {
35
+ description: 'Optional icon element to be displayed in the summary',
36
+ control: false,
37
+ },
38
+ className: {
39
+ description: 'Optional CSS class name for custom styling',
40
+ control: 'text',
41
+ },
42
+ },
43
+ };
44
+
45
+ export default meta;
46
+ type Story = StoryObj<typeof Details>;
47
+
48
+ // Primary variant (default)
49
+ export const Primary: Story = {
50
+ args: {
51
+ label: 'Getting Started',
52
+ children: 'This is the primary variant of the Details component. It has a simple structure with just a label and content.',
53
+ },
54
+ render: (args) => (
55
+ <div style={{ padding: '20px' }}>
56
+ <Details {...args} />
57
+ </div>
58
+ ),
59
+ };
60
+
61
+ // Secondary variant
62
+ export const Secondary: Story = {
63
+ args: {
64
+ kind: 'secondary',
65
+ title: 'API Reference',
66
+ label: 'Complete documentation for all endpoints',
67
+ children: 'This is the secondary variant with both a title and label. It provides more detailed information in the summary.',
68
+ },
69
+ render: (args) => (
70
+ <div style={{ padding: '20px' }}>
71
+ <Details {...args} />
72
+ </div>
73
+ ),
74
+ };
75
+
76
+ // Tertiary variant
77
+ export const Tertiary: Story = {
78
+ args: {
79
+ kind: 'tertiary',
80
+ title: 'Advanced Configuration',
81
+ label: 'For experienced users',
82
+ children: 'This is the tertiary variant, which also includes both title and label but with different styling.',
83
+ },
84
+ render: (args) => (
85
+ <div style={{ padding: '20px' }}>
86
+ <Details {...args} />
87
+ </div>
88
+ ),
89
+ };
90
+
91
+ // Long content
92
+ export const LongContent: Story = {
93
+ args: {
94
+ kind: 'secondary',
95
+ title: 'Comprehensive Guide',
96
+ label: 'Detailed step-by-step instructions',
97
+ children: (
98
+ <div>
99
+ <p>This details component contains a substantial amount of content to demonstrate how it handles longer text and multiple paragraphs.</p>
100
+ <p>The content can include various HTML elements like paragraphs, lists, and other components. This makes it perfect for organizing documentation and providing expandable sections.</p>
101
+ <ul>
102
+ <li>First step in the process</li>
103
+ <li>Second step with additional details</li>
104
+ <li>Third step with important notes</li>
105
+ </ul>
106
+ <p>You can include any type of content within the details component, making it very flexible for different use cases.</p>
107
+ </div>
108
+ ),
109
+ },
110
+ render: (args) => (
111
+ <div style={{ padding: '20px' }}>
112
+ <Details {...args} />
113
+ </div>
114
+ ),
115
+ };
116
+
117
+ // Multiple details
118
+ export const MultipleDetails: Story = {
119
+ render: () => (
120
+ <div style={{ padding: '20px' }}>
121
+ <div style={{ marginBottom: '20px' }}>
122
+ <Details label="Installation">
123
+ <p>Follow these steps to install the package:</p>
124
+ <ol>
125
+ <li>Run <code>npm install package-name</code></li>
126
+ <li>Import the component in your file</li>
127
+ <li>Start using it in your application</li>
128
+ </ol>
129
+ </Details>
130
+ </div>
131
+
132
+ <div style={{ marginBottom: '20px' }}>
133
+ <Details kind="secondary" title="Configuration" label="Optional settings">
134
+ <p>Configure the component with these options:</p>
135
+ <ul>
136
+ <li>Set the theme property</li>
137
+ <li>Configure the layout</li>
138
+ <li>Customize the styling</li>
139
+ </ul>
140
+ </Details>
141
+ </div>
142
+
143
+ <div style={{ marginBottom: '20px' }}>
144
+ <Details kind="tertiary" title="Advanced Usage" label="For power users">
145
+ <p>Advanced techniques and best practices:</p>
146
+ <ul>
147
+ <li>Custom styling approaches</li>
148
+ <li>Performance optimization</li>
149
+ <li>Integration patterns</li>
150
+ </ul>
151
+ </Details>
152
+ </div>
153
+ </div>
154
+ ),
155
+ };
156
+
157
+ // With custom icon
158
+ export const WithCustomIcon: Story = {
159
+ args: {
160
+ kind: 'secondary',
161
+ title: 'Custom Icon Example',
162
+ label: 'Shows custom icon usage',
163
+ icon: (
164
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
165
+ <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
166
+ </svg>
167
+ ),
168
+ children: 'This details component uses a custom star icon instead of the default icon.',
169
+ },
170
+ render: (args) => (
171
+ <div style={{ padding: '20px' }}>
172
+ <Details {...args} />
173
+ </div>
174
+ ),
175
+ };
176
+
177
+ // All variants showcase
178
+ export const AllVariants: Story = {
179
+ render: () => (
180
+ <div style={{ padding: '20px' }}>
181
+ <div style={{ marginBottom: '30px' }}>
182
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Primary Variant</h3>
183
+ <Details label="Simple collapsible content">
184
+ <p>This is the primary variant with just a label. It's the simplest form of the Details component.</p>
185
+ </Details>
186
+ </div>
187
+
188
+ <div style={{ marginBottom: '30px' }}>
189
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Secondary Variant</h3>
190
+ <Details kind="secondary" title="Enhanced Details" label="With title and label">
191
+ <p>This secondary variant includes both a title and label, providing more context in the summary.</p>
192
+ </Details>
193
+ </div>
194
+
195
+ <div style={{ marginBottom: '30px' }}>
196
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Tertiary Variant</h3>
197
+ <Details kind="tertiary" title="Advanced Details" label="For complex content">
198
+ <p>This tertiary variant also has title and label but with different visual styling.</p>
199
+ </Details>
200
+ </div>
201
+ </div>
202
+ ),
203
+ };
204
+
205
+ // Real-world examples
206
+ export const RealWorldExamples: Story = {
207
+ render: () => (
208
+ <div style={{ padding: '20px', maxWidth: '800px' }}>
209
+ <div style={{ marginBottom: '40px' }}>
210
+ <h2>FAQ Section</h2>
211
+ <p>Details components are perfect for FAQ sections and frequently asked questions.</p>
212
+ <div style={{ marginTop: '20px' }}>
213
+ <Details label="How do I get started?">
214
+ <p>Getting started is easy! Simply follow our quick start guide which will walk you through the basic setup process.</p>
215
+ </Details>
216
+
217
+ <Details kind="secondary" title="Installation" label="Step-by-step guide">
218
+ <p>Install the package using npm or yarn:</p>
219
+ <pre><code>npm install @xyd-js/components</code></pre>
220
+ <p>Then import and use the components in your project.</p>
221
+ </Details>
222
+
223
+ <Details kind="tertiary" title="Troubleshooting" label="Common issues">
224
+ <p>If you encounter any issues, check our troubleshooting guide or contact support.</p>
225
+ </Details>
226
+ </div>
227
+ </div>
228
+
229
+ <div style={{ marginBottom: '40px' }}>
230
+ <h2>Documentation Sections</h2>
231
+ <p>Organize documentation into collapsible sections for better navigation.</p>
232
+ <div style={{ marginTop: '20px' }}>
233
+ <Details label="Basic Concepts">
234
+ <p>Learn the fundamental concepts and principles that underpin our framework.</p>
235
+ </Details>
236
+
237
+ <Details kind="secondary" title="API Reference" label="Complete documentation">
238
+ <p>Comprehensive API documentation with examples and usage patterns.</p>
239
+ </Details>
240
+
241
+ <Details kind="tertiary" title="Advanced Topics" label="For experienced users">
242
+ <p>Advanced concepts and techniques for power users and complex use cases.</p>
243
+ </Details>
244
+ </div>
245
+ </div>
246
+
247
+ <div style={{ marginBottom: '40px' }}>
248
+ <h2>Feature Documentation</h2>
249
+ <p>Use details components to organize feature documentation and tutorials.</p>
250
+ <div style={{ marginTop: '20px' }}>
251
+ <Details label="Getting Started">
252
+ <p>Quick start guide to get you up and running in minutes.</p>
253
+ </Details>
254
+
255
+ <Details kind="secondary" title="Core Features" label="Essential functionality">
256
+ <p>Overview of the core features and how to use them effectively.</p>
257
+ </Details>
258
+
259
+ <Details kind="tertiary" title="Advanced Features" label="Optional capabilities">
260
+ <p>Advanced features and customization options for complex requirements.</p>
261
+ </Details>
262
+ </div>
263
+ </div>
264
+ </div>
265
+ ),
266
+ parameters: {
267
+ docs: {
268
+ description: {
269
+ story: 'This example shows how Details components are typically used in real applications for organizing content.',
270
+ },
271
+ },
272
+ },
273
+ };
274
+
275
+ // Interactive example
276
+ export const Interactive: Story = {
277
+ args: {
278
+ kind: 'secondary',
279
+ title: 'Interactive Details',
280
+ label: 'Click to expand',
281
+ children: (
282
+ <div>
283
+ <p>This details component demonstrates the interactive behavior. Click the summary to expand or collapse the content.</p>
284
+ <p>The component automatically handles the open/closed state and provides appropriate visual feedback.</p>
285
+ </div>
286
+ ),
287
+ },
288
+ render: (args) => (
289
+ <div style={{ padding: '20px' }}>
290
+ <Details {...args} />
291
+ <p style={{ marginTop: '10px', fontSize: '14px', color: '#666' }}>
292
+ The Details component provides semantic HTML structure and accessible collapsible content.
293
+ </p>
294
+ </div>
295
+ ),
296
+ parameters: {
297
+ docs: {
298
+ description: {
299
+ story: 'This details component demonstrates the interactive behavior and accessibility features.',
300
+ },
301
+ },
302
+ },
303
+ };
304
+
305
+ // Nested details
306
+ export const NestedDetails: Story = {
307
+ render: () => (
308
+ <div style={{ padding: '20px' }}>
309
+ <Details kind="secondary" title="Main Section" label="Contains subsections">
310
+ <p>This main section contains several subsections organized with nested details components.</p>
311
+
312
+ <Details label="Subsection 1">
313
+ <p>This is the first subsection with its own content.</p>
314
+ </Details>
315
+
316
+ <Details kind="secondary" title="Subsection 2" label="With title">
317
+ <p>This subsection has both a title and label.</p>
318
+ </Details>
319
+
320
+ <Details kind="tertiary" title="Subsection 3" label="Tertiary style">
321
+ <p>This subsection uses the tertiary variant styling.</p>
322
+ </Details>
323
+ </Details>
324
+ </div>
325
+ ),
326
+ parameters: {
327
+ docs: {
328
+ description: {
329
+ story: 'This example shows how Details components can be nested to create hierarchical content structures.',
330
+ },
331
+ },
332
+ },
333
+ };