@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,479 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+
4
+ import { List, ListOl } from '@xyd-js/components/writer';
5
+
6
+ const meta: Meta<typeof List> = {
7
+ title: 'Components/Writer/List',
8
+ component: List,
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component: 'List components provide styled unordered and ordered lists with consistent spacing and typography. Includes List (unordered) and ListOl (ordered) variants.',
13
+ },
14
+ },
15
+ },
16
+ argTypes: {
17
+ children: {
18
+ description: 'The list items to display',
19
+ control: false,
20
+ },
21
+ },
22
+ };
23
+
24
+ export default meta;
25
+ type Story = StoryObj<typeof List>;
26
+
27
+ // Basic unordered list
28
+ export const Default: Story = {
29
+ render: () => (
30
+ <div style={{ padding: '20px' }}>
31
+ <List>
32
+ <List.Item>First item in the list</List.Item>
33
+ <List.Item>Second item with more content</List.Item>
34
+ <List.Item>Third item that demonstrates longer text</List.Item>
35
+ <List.Item>Fourth and final item</List.Item>
36
+ </List>
37
+ </div>
38
+ ),
39
+ };
40
+
41
+ // Basic ordered list
42
+ export const OrderedList: Story = {
43
+ render: () => (
44
+ <div style={{ padding: '20px' }}>
45
+ <ListOl>
46
+ <List.Item>First step in the process</List.Item>
47
+ <List.Item>Second step with additional details</List.Item>
48
+ <List.Item>Third step with important notes</List.Item>
49
+ <List.Item>Fourth and final step</List.Item>
50
+ </ListOl>
51
+ </div>
52
+ ),
53
+ };
54
+
55
+ // Long content lists
56
+ export const LongContent: Story = {
57
+ render: () => (
58
+ <div style={{ padding: '20px' }}>
59
+ <div style={{ marginBottom: '30px' }}>
60
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Unordered List with Long Content</h3>
61
+ <List>
62
+ <List.Item>
63
+ This is a list item with substantial content that demonstrates how the List component
64
+ handles longer text and multiple sentences. The component should maintain proper
65
+ spacing and readability.
66
+ </List.Item>
67
+ <List.Item>
68
+ Another item with detailed information that spans multiple lines. This helps
69
+ test the component's ability to handle complex content while maintaining
70
+ consistent styling and proper indentation.
71
+ </List.Item>
72
+ <List.Item>
73
+ A third item that continues the pattern of longer content to ensure the List
74
+ component works well with various content lengths and types.
75
+ </List.Item>
76
+ </List>
77
+ </div>
78
+
79
+ <div style={{ marginBottom: '30px' }}>
80
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Ordered List with Long Content</h3>
81
+ <ListOl>
82
+ <List.Item>
83
+ First step in a detailed process that requires careful attention to each
84
+ individual step. This demonstrates how ordered lists handle longer content.
85
+ </List.Item>
86
+ <List.Item>
87
+ Second step that builds upon the first step with additional complexity and
88
+ detailed instructions that may span multiple lines.
89
+ </List.Item>
90
+ <List.Item>
91
+ Third step that includes important considerations and notes that help users
92
+ understand the process better.
93
+ </List.Item>
94
+ </ListOl>
95
+ </div>
96
+ </div>
97
+ ),
98
+ };
99
+
100
+ // Nested lists
101
+ export const NestedLists: Story = {
102
+ render: () => (
103
+ <div style={{ padding: '20px' }}>
104
+ <div style={{ marginBottom: '30px' }}>
105
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Nested Unordered Lists</h3>
106
+ <List>
107
+ <List.Item>Main item one</List.Item>
108
+ <List.Item>
109
+ Main item two with sub-items
110
+ <List>
111
+ <List.Item>Sub-item 2.1</List.Item>
112
+ <List.Item>Sub-item 2.2</List.Item>
113
+ <List.Item>
114
+ Sub-item 2.3 with deeper nesting
115
+ <List>
116
+ <List.Item>Sub-sub-item 2.3.1</List.Item>
117
+ <List.Item>Sub-sub-item 2.3.2</List.Item>
118
+ </List>
119
+ </List.Item>
120
+ </List>
121
+ </List.Item>
122
+ <List.Item>Main item three</List.Item>
123
+ </List>
124
+ </div>
125
+
126
+ <div style={{ marginBottom: '30px' }}>
127
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Nested Ordered Lists</h3>
128
+ <ListOl>
129
+ <List.Item>First main step</List.Item>
130
+ <List.Item>
131
+ Second main step with sub-steps
132
+ <ListOl>
133
+ <List.Item>Sub-step 2.1</List.Item>
134
+ <List.Item>Sub-step 2.2</List.Item>
135
+ <List.Item>
136
+ Sub-step 2.3 with deeper nesting
137
+ <ListOl>
138
+ <List.Item>Sub-sub-step 2.3.1</List.Item>
139
+ <List.Item>Sub-sub-step 2.3.2</List.Item>
140
+ </ListOl>
141
+ </List.Item>
142
+ </ListOl>
143
+ </List.Item>
144
+ <List.Item>Third main step</List.Item>
145
+ </ListOl>
146
+ </div>
147
+ </div>
148
+ ),
149
+ };
150
+
151
+ // Mixed content lists
152
+ export const MixedContent: Story = {
153
+ render: () => (
154
+ <div style={{ padding: '20px' }}>
155
+ <div style={{ marginBottom: '30px' }}>
156
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>List with Mixed Content</h3>
157
+ <List>
158
+ <List.Item>Simple text item</List.Item>
159
+ <List.Item>
160
+ Item with <strong>bold text</strong> and <em>italic text</em>
161
+ </List.Item>
162
+ <List.Item>
163
+ Item with a <a href="#" style={{ color: 'var(--xyd-text-color)' }}>link</a>
164
+ and <code>code snippet</code>
165
+ </List.Item>
166
+ <List.Item>
167
+ Item with multiple elements: <strong>bold</strong>, <em>italic</em>,
168
+ <code>code</code>, and <a href="#" style={{ color: 'var(--xyd-text-color)' }}>links</a>
169
+ </List.Item>
170
+ </List>
171
+ </div>
172
+
173
+ <div style={{ marginBottom: '30px' }}>
174
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Ordered List with Mixed Content</h3>
175
+ <ListOl>
176
+ <List.Item>Basic numbered item</List.Item>
177
+ <List.Item>
178
+ Step with <strong>important information</strong> highlighted
179
+ </List.Item>
180
+ <List.Item>
181
+ Step containing <code>code examples</code> and <em>explanatory text</em>
182
+ </List.Item>
183
+ <List.Item>
184
+ Final step with <a href="#" style={{ color: 'var(--xyd-text-color)' }}>reference links</a>
185
+ </List.Item>
186
+ </ListOl>
187
+ </div>
188
+ </div>
189
+ ),
190
+ };
191
+
192
+ // Multiple lists
193
+ export const MultipleLists: Story = {
194
+ render: () => (
195
+ <div style={{ padding: '20px' }}>
196
+ <div style={{ marginBottom: '30px' }}>
197
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Installation Steps</h3>
198
+ <ListOl>
199
+ <List.Item>Download the package</List.Item>
200
+ <List.Item>Extract the files</List.Item>
201
+ <List.Item>Run the installer</List.Item>
202
+ <List.Item>Configure settings</List.Item>
203
+ </ListOl>
204
+ </div>
205
+
206
+ <div style={{ marginBottom: '30px' }}>
207
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Features</h3>
208
+ <List>
209
+ <List.Item>Easy to use interface</List.Item>
210
+ <List.Item>Comprehensive documentation</List.Item>
211
+ <List.Item>Active community support</List.Item>
212
+ <List.Item>Regular updates</List.Item>
213
+ </List>
214
+ </div>
215
+
216
+ <div style={{ marginBottom: '30px' }}>
217
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Troubleshooting</h3>
218
+ <ListOl>
219
+ <List.Item>Check system requirements</List.Item>
220
+ <List.Item>Verify installation</List.Item>
221
+ <List.Item>Review error logs</List.Item>
222
+ <List.Item>Contact support if needed</List.Item>
223
+ </ListOl>
224
+ </div>
225
+ </div>
226
+ ),
227
+ };
228
+
229
+ // Real-world examples
230
+ export const RealWorldExamples: Story = {
231
+ render: () => (
232
+ <div style={{ padding: '20px', maxWidth: '800px' }}>
233
+ <div style={{ marginBottom: '40px' }}>
234
+ <h2>Documentation Examples</h2>
235
+ <p>Lists are commonly used in documentation for organizing information.</p>
236
+ <div style={{
237
+ background: 'var(--xyd-bgcolor)',
238
+ border: '1px solid var(--xyd-border-color)',
239
+ borderRadius: '8px',
240
+ padding: '20px'
241
+ }}>
242
+ <h3>Getting Started</h3>
243
+ <p>Follow these steps to get up and running:</p>
244
+ <ListOl>
245
+ <List.Item>Install the required dependencies</List.Item>
246
+ <List.Item>Configure your environment variables</List.Item>
247
+ <List.Item>Run the setup script</List.Item>
248
+ <List.Item>Test your installation</List.Item>
249
+ </ListOl>
250
+
251
+ <h3>Key Features</h3>
252
+ <List>
253
+ <List.Item>Intuitive user interface</List.Item>
254
+ <List.Item>Comprehensive API documentation</List.Item>
255
+ <List.Item>Active community support</List.Item>
256
+ <List.Item>Regular security updates</List.Item>
257
+ </List>
258
+ </div>
259
+ </div>
260
+
261
+ <div style={{ marginBottom: '40px' }}>
262
+ <h2>Configuration Guide</h2>
263
+ <p>Lists help organize configuration options and settings.</p>
264
+ <div style={{
265
+ background: 'var(--xyd-bgcolor)',
266
+ border: '1px solid var(--xyd-border-color)',
267
+ borderRadius: '8px',
268
+ padding: '20px'
269
+ }}>
270
+ <h3>Required Settings</h3>
271
+ <ListOl>
272
+ <List.Item>Database connection string</List.Item>
273
+ <List.Item>API authentication keys</List.Item>
274
+ <List.Item>Server port configuration</List.Item>
275
+ <List.Item>Logging level settings</List.Item>
276
+ </ListOl>
277
+
278
+ <h3>Optional Settings</h3>
279
+ <List>
280
+ <List.Item>Custom theme configuration</List.Item>
281
+ <List.Item>Advanced caching options</List.Item>
282
+ <List.Item>Performance tuning parameters</List.Item>
283
+ <List.Item>Third-party integrations</List.Item>
284
+ </List>
285
+ </div>
286
+ </div>
287
+
288
+ <div style={{ marginBottom: '40px' }}>
289
+ <h2>API Reference</h2>
290
+ <p>Lists organize API endpoints and parameters.</p>
291
+ <div style={{
292
+ background: 'var(--xyd-bgcolor)',
293
+ border: '1px solid var(--xyd-border-color)',
294
+ borderRadius: '8px',
295
+ padding: '20px'
296
+ }}>
297
+ <h3>Authentication Endpoints</h3>
298
+ <ListOl>
299
+ <List.Item><code>POST /auth/login</code> - User authentication</List.Item>
300
+ <List.Item><code>POST /auth/logout</code> - User logout</List.Item>
301
+ <List.Item><code>POST /auth/refresh</code> - Token refresh</List.Item>
302
+ <List.Item><code>GET /auth/profile</code> - User profile</List.Item>
303
+ </ListOl>
304
+
305
+ <h3>Common Parameters</h3>
306
+ <List>
307
+ <List.Item><code>api_key</code> - Your API key for authentication</List.Item>
308
+ <List.Item><code>limit</code> - Number of results to return</List.Item>
309
+ <List.Item><code>offset</code> - Number of results to skip</List.Item>
310
+ <List.Item><code>sort</code> - Field to sort results by</List.Item>
311
+ </List>
312
+ </div>
313
+ </div>
314
+ </div>
315
+ ),
316
+ parameters: {
317
+ docs: {
318
+ description: {
319
+ story: 'This example shows how lists are typically used in real applications for organizing information.',
320
+ },
321
+ },
322
+ },
323
+ };
324
+
325
+ // Interactive example
326
+ export const Interactive: Story = {
327
+ render: () => (
328
+ <div style={{ padding: '20px' }}>
329
+ <div style={{
330
+ background: 'var(--xyd-bgcolor)',
331
+ border: '1px solid var(--xyd-border-color)',
332
+ borderRadius: '8px',
333
+ padding: '20px',
334
+ marginBottom: '20px'
335
+ }}>
336
+ <h3 style={{ marginBottom: '16px' }}>List Component Demo</h3>
337
+ <p style={{ marginBottom: '16px', color: 'var(--xyd-text-color)' }}>
338
+ This example demonstrates the List and ListOl components with various content types and nesting levels.
339
+ </p>
340
+
341
+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '20px' }}>
342
+ <div>
343
+ <h4 style={{ marginBottom: '8px' }}>Unordered List</h4>
344
+ <List>
345
+ <List.Item>Feature one</List.Item>
346
+ <List.Item>Feature two</List.Item>
347
+ <List.Item>Feature three</List.Item>
348
+ </List>
349
+ </div>
350
+
351
+ <div>
352
+ <h4 style={{ marginBottom: '8px' }}>Ordered List</h4>
353
+ <ListOl>
354
+ <List.Item>Step one</List.Item>
355
+ <List.Item>Step two</List.Item>
356
+ <List.Item>Step three</List.Item>
357
+ </ListOl>
358
+ </div>
359
+ </div>
360
+ </div>
361
+
362
+ <div style={{
363
+ background: 'var(--xyd-bgcolor)',
364
+ border: '1px solid var(--xyd-border-color)',
365
+ borderRadius: '8px',
366
+ padding: '20px'
367
+ }}>
368
+ <h4 style={{ marginBottom: '12px' }}>Features</h4>
369
+ <ul style={{ color: 'var(--xyd-text-color)' }}>
370
+ <li>Consistent styling with design system</li>
371
+ <li>Proper spacing and typography</li>
372
+ <li>Support for nested lists</li>
373
+ <li>Mixed content support</li>
374
+ <li>Accessible markup</li>
375
+ </ul>
376
+ </div>
377
+ </div>
378
+ ),
379
+ parameters: {
380
+ docs: {
381
+ description: {
382
+ story: 'This interactive example demonstrates the List component functionality and styling.',
383
+ },
384
+ },
385
+ },
386
+ };
387
+
388
+ // Complex nested lists
389
+ export const ComplexNestedLists: Story = {
390
+ render: () => (
391
+ <div style={{ padding: '20px' }}>
392
+ <div style={{ marginBottom: '30px' }}>
393
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Project Structure</h3>
394
+ <List>
395
+ <List.Item>src/
396
+ <List>
397
+ <List.Item>components/
398
+ <List>
399
+ <List.Item>Button/
400
+ <List>
401
+ <List.Item>Button.tsx</List.Item>
402
+ <List.Item>Button.styles.tsx</List.Item>
403
+ <List.Item>Button.stories.tsx</List.Item>
404
+ </List>
405
+ </List.Item>
406
+ <List.Item>Card/
407
+ <List>
408
+ <List.Item>Card.tsx</List.Item>
409
+ <List.Item>Card.styles.tsx</List.Item>
410
+ </List>
411
+ </List.Item>
412
+ </List>
413
+ </List.Item>
414
+ <List.Item>utils/
415
+ <List>
416
+ <List.Item>helpers.ts</List.Item>
417
+ <List.Item>constants.ts</List.Item>
418
+ </List>
419
+ </List.Item>
420
+ <List.Item>types/
421
+ <List>
422
+ <List.Item>index.ts</List.Item>
423
+ </List>
424
+ </List.Item>
425
+ </List>
426
+ </List.Item>
427
+ <List.Item>public/
428
+ <List>
429
+ <List.Item>images/</List.Item>
430
+ <List.Item>icons/</List.Item>
431
+ </List>
432
+ </List.Item>
433
+ <List.Item>docs/
434
+ <List>
435
+ <List.Item>README.md</List.Item>
436
+ <List.Item>CHANGELOG.md</List.Item>
437
+ </List>
438
+ </List.Item>
439
+ </List>
440
+ </div>
441
+
442
+ <div style={{ marginBottom: '30px' }}>
443
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Development Workflow</h3>
444
+ <ListOl>
445
+ <List.Item>Setup development environment
446
+ <ListOl>
447
+ <List.Item>Install Node.js and npm</List.Item>
448
+ <List.Item>Clone the repository</List.Item>
449
+ <List.Item>Install dependencies</List.Item>
450
+ </ListOl>
451
+ </List.Item>
452
+ <List.Item>Development process
453
+ <ListOl>
454
+ <List.Item>Create feature branch</List.Item>
455
+ <List.Item>Make changes and test</List.Item>
456
+ <List.Item>Write documentation</List.Item>
457
+ <List.Item>Submit pull request</List.Item>
458
+ </ListOl>
459
+ </List.Item>
460
+ <List.Item>Deployment
461
+ <ListOl>
462
+ <List.Item>Run tests</List.Item>
463
+ <List.Item>Build for production</List.Item>
464
+ <List.Item>Deploy to staging</List.Item>
465
+ <List.Item>Deploy to production</List.Item>
466
+ </ListOl>
467
+ </List.Item>
468
+ </ListOl>
469
+ </div>
470
+ </div>
471
+ ),
472
+ parameters: {
473
+ docs: {
474
+ description: {
475
+ story: 'This example shows complex nested lists with multiple levels of hierarchy.',
476
+ },
477
+ },
478
+ },
479
+ };