@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.
- package/.storybook/main.ts +40 -0
- package/.storybook/manager-head.html +6 -0
- package/.storybook/manager.ts +18 -0
- package/.storybook/preview.ts +40 -0
- package/.storybook/styles.css +5 -0
- package/.storybook/theme.ts +34 -0
- package/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/README.md +50 -0
- package/eslint.config.js +28 -0
- package/package.json +61 -0
- package/public/logo.svg +10 -0
- package/src/__fixtures__/Icons.tsx +83 -0
- package/src/__fixtures__/atlas-index/package-index.mdx +194 -0
- package/src/__fixtures__/atlas-index/wip1.mdx +131 -0
- package/src/__fixtures__/atlas-index.mdx +53 -0
- package/src/__fixtures__/code-sample.mdx +15 -0
- package/src/__fixtures__/example-source-uniform.ts +41 -0
- package/src/__fixtures__/hello-world.mdx +116 -0
- package/src/components/DemoDocs.tsx +235 -0
- package/src/components/logo.tsx +37 -0
- package/src/decorators/DocsTemplate.tsx +101 -0
- package/src/docs/atlas/Atlas.stories.tsx +51 -0
- package/src/docs/atlas/todo-app.uniform.json +625 -0
- package/src/docs/atlas/uniform-to-references.ts +101 -0
- package/src/docs/components/coder/CodeSample.stories.tsx +29 -0
- package/src/docs/components/pages/PageBlogHome.stories.tsx +52 -0
- package/src/docs/components/pages/PageFirstSlide.stories.tsx +124 -0
- package/src/docs/components/pages/PageHome.stories.tsx +127 -0
- package/src/docs/components/system/Baseline.stories.tsx +126 -0
- package/src/docs/components/writer/Badge.stories.tsx +132 -0
- package/src/docs/components/writer/Banner.stories.tsx +394 -0
- package/src/docs/components/writer/Blockquote.stories.tsx +415 -0
- package/src/docs/components/writer/Breadcrumbs.stories.tsx +282 -0
- package/src/docs/components/writer/Button.stories.tsx +405 -0
- package/src/docs/components/writer/Callout.stories.tsx +183 -0
- package/src/docs/components/writer/Card.stories.tsx +457 -0
- package/src/docs/components/writer/ColorSchemeButton.stories.tsx +322 -0
- package/src/docs/components/writer/Details.stories.tsx +333 -0
- package/src/docs/components/writer/GuideCard.stories.tsx +384 -0
- package/src/docs/components/writer/Heading.stories.tsx +379 -0
- package/src/docs/components/writer/Hr.stories.tsx +325 -0
- package/src/docs/components/writer/IconSocial.stories.tsx +591 -0
- package/src/docs/components/writer/Image.stories.tsx +430 -0
- package/src/docs/components/writer/List.stories.tsx +479 -0
- package/src/docs/components/writer/NavLinks.stories.tsx +380 -0
- package/src/docs/components/writer/Pre.stories.tsx +23 -0
- package/src/docs/components/writer/Steps.stories.tsx +914 -0
- package/src/docs/components/writer/Table.stories.tsx +608 -0
- package/src/docs/components/writer/Tabs.stories.tsx +760 -0
- package/src/docs/components/writer/TocCard.stories.tsx +407 -0
- package/src/docs/components/writer/Update.stories.tsx +457 -0
- package/src/docs/components/writer/VideoGuide.stories.tsx +17 -0
- package/src/docs/templates/CodeSample.stories.tsx +15 -0
- package/src/docs/themes/TODO.md +1 -0
- package/src/docs/themes/logo.tsx +37 -0
- package/src/docs/themes/themes.stories.tsx +269 -0
- package/src/docs/ui/Nav.stories.tsx +58 -0
- package/src/docs/ui/Sidebar.stories.tsx +167 -0
- package/src/docs/ui/SubNav.stories.tsx +29 -0
- package/src/utils/mdx.ts +31 -0
- package/tsconfig.json +39 -0
- package/vite.config.ts +8 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { TocCard } from '@xyd-js/components/writer';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof TocCard> = {
|
|
7
|
+
title: 'Components/Writer/TocCard',
|
|
8
|
+
component: TocCard,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: 'A server-side rendered card component for table of contents entries. Displays a title, description, and favicon for a linked resource without client-side fetching. Perfect for documentation sites, link aggregators, and resource directories.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
title: {
|
|
18
|
+
description: 'The title of the linked resource',
|
|
19
|
+
control: 'text',
|
|
20
|
+
},
|
|
21
|
+
description: {
|
|
22
|
+
description: 'A brief description of the linked resource',
|
|
23
|
+
control: 'text',
|
|
24
|
+
},
|
|
25
|
+
href: {
|
|
26
|
+
description: 'The URL of the linked resource',
|
|
27
|
+
control: 'text',
|
|
28
|
+
},
|
|
29
|
+
className: {
|
|
30
|
+
description: 'Optional CSS class name for custom styling',
|
|
31
|
+
control: 'text',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default meta;
|
|
37
|
+
type Story = StoryObj<typeof TocCard>;
|
|
38
|
+
|
|
39
|
+
// Basic TocCard
|
|
40
|
+
export const Default: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
title: 'Example App',
|
|
43
|
+
description: 'Explore our example app to see how the TocCard component works.',
|
|
44
|
+
href: 'https://github.com/livesession/xyd',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// Documentation example
|
|
49
|
+
export const Documentation: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
title: 'API Documentation',
|
|
52
|
+
description: 'Complete reference for all available endpoints, authentication methods, and code examples.',
|
|
53
|
+
href: 'https://docs.example.com/api',
|
|
54
|
+
},
|
|
55
|
+
parameters: {
|
|
56
|
+
docs: {
|
|
57
|
+
description: {
|
|
58
|
+
story: 'Perfect for linking to documentation sections or external API docs.',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// GitHub repository
|
|
65
|
+
export const GitHubRepository: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
title: 'xyd-js/components',
|
|
68
|
+
description: 'React component library with accessible, customizable UI components for modern web applications.',
|
|
69
|
+
href: 'https://github.com/livesession/xyd',
|
|
70
|
+
},
|
|
71
|
+
parameters: {
|
|
72
|
+
docs: {
|
|
73
|
+
description: {
|
|
74
|
+
story: 'Ideal for linking to GitHub repositories with descriptive titles and summaries.',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// Blog post
|
|
81
|
+
export const BlogPost: Story = {
|
|
82
|
+
args: {
|
|
83
|
+
title: 'Building Accessible Components',
|
|
84
|
+
description: 'Learn how to create inclusive web components that work for everyone, including users with disabilities.',
|
|
85
|
+
href: 'https://blog.example.com/accessible-components',
|
|
86
|
+
},
|
|
87
|
+
parameters: {
|
|
88
|
+
docs: {
|
|
89
|
+
description: {
|
|
90
|
+
story: 'Great for linking to blog posts, articles, and educational content.',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// External tool
|
|
97
|
+
export const ExternalTool: Story = {
|
|
98
|
+
args: {
|
|
99
|
+
title: 'Storybook',
|
|
100
|
+
description: 'Build, document, and test UI components in isolation. The industry standard for component development.',
|
|
101
|
+
href: 'https://storybook.js.org',
|
|
102
|
+
},
|
|
103
|
+
parameters: {
|
|
104
|
+
docs: {
|
|
105
|
+
description: {
|
|
106
|
+
story: 'Perfect for linking to external tools, libraries, and services.',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// Long content
|
|
113
|
+
export const LongContent: Story = {
|
|
114
|
+
args: {
|
|
115
|
+
title: 'Comprehensive Guide to Modern Web Development: From Basics to Advanced Patterns',
|
|
116
|
+
description: 'An extensive resource covering everything from HTML fundamentals to advanced React patterns, state management, performance optimization, and deployment strategies. Includes practical examples, best practices, and real-world case studies.',
|
|
117
|
+
href: 'https://example.com/web-development-guide',
|
|
118
|
+
},
|
|
119
|
+
parameters: {
|
|
120
|
+
docs: {
|
|
121
|
+
description: {
|
|
122
|
+
story: 'Shows how the component handles long titles and descriptions gracefully.',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// Short content
|
|
129
|
+
export const ShortContent: Story = {
|
|
130
|
+
args: {
|
|
131
|
+
title: 'Docs',
|
|
132
|
+
description: 'Documentation',
|
|
133
|
+
href: 'https://docs.example.com',
|
|
134
|
+
},
|
|
135
|
+
parameters: {
|
|
136
|
+
docs: {
|
|
137
|
+
description: {
|
|
138
|
+
story: 'Demonstrates the component with minimal content.',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Real-world examples
|
|
145
|
+
export const RealWorldExamples: Story = {
|
|
146
|
+
render: () => (
|
|
147
|
+
<div style={{ padding: '20px', maxWidth: '800px' }}>
|
|
148
|
+
<h2 style={{ marginBottom: '24px' }}>Resource Directory</h2>
|
|
149
|
+
<p style={{ marginBottom: '24px', color: 'var(--xyd-text-color)' }}>
|
|
150
|
+
TocCard components are commonly used in resource directories, documentation sites, and link aggregators.
|
|
151
|
+
</p>
|
|
152
|
+
|
|
153
|
+
<div style={{
|
|
154
|
+
display: 'grid',
|
|
155
|
+
gap: '16px',
|
|
156
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))'
|
|
157
|
+
}}>
|
|
158
|
+
<TocCard
|
|
159
|
+
title="React Documentation"
|
|
160
|
+
description="Official React documentation with tutorials, API reference, and best practices."
|
|
161
|
+
href="https://react.dev"
|
|
162
|
+
/>
|
|
163
|
+
|
|
164
|
+
<TocCard
|
|
165
|
+
title="TypeScript Handbook"
|
|
166
|
+
description="Comprehensive guide to TypeScript with examples and advanced type patterns."
|
|
167
|
+
href="https://www.typescriptlang.org/docs"
|
|
168
|
+
/>
|
|
169
|
+
|
|
170
|
+
<TocCard
|
|
171
|
+
title="MDN Web Docs"
|
|
172
|
+
description="Complete reference for web technologies including HTML, CSS, and JavaScript."
|
|
173
|
+
href="https://developer.mozilla.org"
|
|
174
|
+
/>
|
|
175
|
+
|
|
176
|
+
<TocCard
|
|
177
|
+
title="CSS-Tricks"
|
|
178
|
+
description="Tips, tricks, and techniques for CSS, JavaScript, and web development."
|
|
179
|
+
href="https://css-tricks.com"
|
|
180
|
+
/>
|
|
181
|
+
|
|
182
|
+
<TocCard
|
|
183
|
+
title="Stack Overflow"
|
|
184
|
+
description="Community-driven Q&A platform for programmers and developers."
|
|
185
|
+
href="https://stackoverflow.com"
|
|
186
|
+
/>
|
|
187
|
+
|
|
188
|
+
<TocCard
|
|
189
|
+
title="GitHub"
|
|
190
|
+
description="Platform for version control and collaboration on software projects."
|
|
191
|
+
href="https://github.com"
|
|
192
|
+
/>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
),
|
|
196
|
+
parameters: {
|
|
197
|
+
docs: {
|
|
198
|
+
description: {
|
|
199
|
+
story: 'This example shows how TocCard components are typically used in real applications like resource directories and documentation sites.',
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// Interactive example
|
|
206
|
+
export const Interactive: Story = {
|
|
207
|
+
render: () => (
|
|
208
|
+
<div style={{ padding: '20px' }}>
|
|
209
|
+
<div style={{
|
|
210
|
+
background: 'var(--xyd-bgcolor)',
|
|
211
|
+
border: '1px solid var(--xyd-border-color)',
|
|
212
|
+
borderRadius: '8px',
|
|
213
|
+
padding: '20px',
|
|
214
|
+
marginBottom: '20px'
|
|
215
|
+
}}>
|
|
216
|
+
<h3 style={{ marginBottom: '16px' }}>TocCard Component Demo</h3>
|
|
217
|
+
<p style={{ marginBottom: '16px', color: 'var(--xyd-text-color)' }}>
|
|
218
|
+
This example demonstrates the TocCard component with various content types and use cases.
|
|
219
|
+
</p>
|
|
220
|
+
|
|
221
|
+
<div style={{
|
|
222
|
+
display: 'grid',
|
|
223
|
+
gap: '16px',
|
|
224
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(250px, 1fr))'
|
|
225
|
+
}}>
|
|
226
|
+
<TocCard
|
|
227
|
+
title="Component Library"
|
|
228
|
+
description="A collection of reusable UI components for building modern web applications."
|
|
229
|
+
href="https://example.com/components"
|
|
230
|
+
/>
|
|
231
|
+
|
|
232
|
+
<TocCard
|
|
233
|
+
title="Design System"
|
|
234
|
+
description="Comprehensive design tokens, patterns, and guidelines for consistent UI."
|
|
235
|
+
href="https://example.com/design-system"
|
|
236
|
+
/>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<div style={{
|
|
241
|
+
background: 'var(--xyd-bgcolor)',
|
|
242
|
+
border: '1px solid var(--xyd-border-color)',
|
|
243
|
+
borderRadius: '8px',
|
|
244
|
+
padding: '20px'
|
|
245
|
+
}}>
|
|
246
|
+
<h4 style={{ marginBottom: '12px' }}>Usage Guidelines</h4>
|
|
247
|
+
<ul style={{ color: 'var(--xyd-text-color)' }}>
|
|
248
|
+
<li>Use descriptive titles that clearly indicate the linked content</li>
|
|
249
|
+
<li>Provide concise but informative descriptions</li>
|
|
250
|
+
<li>Ensure URLs are valid and accessible</li>
|
|
251
|
+
<li>Consider the user's context when writing descriptions</li>
|
|
252
|
+
<li>Use consistent formatting across multiple cards</li>
|
|
253
|
+
<li>Test with various content lengths</li>
|
|
254
|
+
</ul>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
),
|
|
258
|
+
parameters: {
|
|
259
|
+
docs: {
|
|
260
|
+
description: {
|
|
261
|
+
story: 'This interactive example demonstrates the TocCard component functionality and usage guidelines.',
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// Grid layout example
|
|
268
|
+
export const GridLayout: Story = {
|
|
269
|
+
render: () => (
|
|
270
|
+
<div style={{ padding: '20px' }}>
|
|
271
|
+
<h2 style={{ marginBottom: '24px' }}>Resource Grid</h2>
|
|
272
|
+
<p style={{ marginBottom: '24px', color: 'var(--xyd-text-color)' }}>
|
|
273
|
+
TocCard components work well in responsive grid layouts for organizing multiple resources.
|
|
274
|
+
</p>
|
|
275
|
+
|
|
276
|
+
<div style={{
|
|
277
|
+
display: 'grid',
|
|
278
|
+
gap: '20px',
|
|
279
|
+
gridTemplateColumns: 'repeat(auto-fill, minmax(280px, 1fr))'
|
|
280
|
+
}}>
|
|
281
|
+
<TocCard
|
|
282
|
+
title="Getting Started"
|
|
283
|
+
description="Quick start guide for new users with setup instructions and basic examples."
|
|
284
|
+
href="https://docs.example.com/getting-started"
|
|
285
|
+
/>
|
|
286
|
+
|
|
287
|
+
<TocCard
|
|
288
|
+
title="API Reference"
|
|
289
|
+
description="Complete API documentation with all available endpoints and parameters."
|
|
290
|
+
href="https://docs.example.com/api"
|
|
291
|
+
/>
|
|
292
|
+
|
|
293
|
+
<TocCard
|
|
294
|
+
title="Examples"
|
|
295
|
+
description="Real-world examples and code samples for common use cases."
|
|
296
|
+
href="https://docs.example.com/examples"
|
|
297
|
+
/>
|
|
298
|
+
|
|
299
|
+
<TocCard
|
|
300
|
+
title="Tutorials"
|
|
301
|
+
description="Step-by-step tutorials covering various topics and skill levels."
|
|
302
|
+
href="https://docs.example.com/tutorials"
|
|
303
|
+
/>
|
|
304
|
+
|
|
305
|
+
<TocCard
|
|
306
|
+
title="Community"
|
|
307
|
+
description="Join our community forum for discussions, questions, and support."
|
|
308
|
+
href="https://community.example.com"
|
|
309
|
+
/>
|
|
310
|
+
|
|
311
|
+
<TocCard
|
|
312
|
+
title="GitHub"
|
|
313
|
+
description="Source code, issues, and contributions on GitHub."
|
|
314
|
+
href="https://github.com/example/project"
|
|
315
|
+
/>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
),
|
|
319
|
+
parameters: {
|
|
320
|
+
docs: {
|
|
321
|
+
description: {
|
|
322
|
+
story: 'This example shows how TocCard components can be arranged in responsive grid layouts.',
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
// Different content types
|
|
329
|
+
export const ContentTypes: Story = {
|
|
330
|
+
render: () => (
|
|
331
|
+
<div style={{ padding: '20px' }}>
|
|
332
|
+
<h2 style={{ marginBottom: '24px' }}>Different Content Types</h2>
|
|
333
|
+
<p style={{ marginBottom: '24px', color: 'var(--xyd-text-color)' }}>
|
|
334
|
+
TocCard components can be used for various types of content and resources.
|
|
335
|
+
</p>
|
|
336
|
+
|
|
337
|
+
<div style={{
|
|
338
|
+
display: 'grid',
|
|
339
|
+
gap: '16px',
|
|
340
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))'
|
|
341
|
+
}}>
|
|
342
|
+
<div>
|
|
343
|
+
<h3 style={{ marginBottom: '12px', fontSize: '16px' }}>Documentation</h3>
|
|
344
|
+
<TocCard
|
|
345
|
+
title="User Guide"
|
|
346
|
+
description="Comprehensive user manual with detailed instructions and troubleshooting."
|
|
347
|
+
href="https://docs.example.com/user-guide"
|
|
348
|
+
/>
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<div>
|
|
352
|
+
<h3 style={{ marginBottom: '12px', fontSize: '16px' }}>Tools & Libraries</h3>
|
|
353
|
+
<TocCard
|
|
354
|
+
title="Development Tools"
|
|
355
|
+
description="Essential tools for modern web development workflow and debugging."
|
|
356
|
+
href="https://tools.example.com"
|
|
357
|
+
/>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<div>
|
|
361
|
+
<h3 style={{ marginBottom: '12px', fontSize: '16px' }}>Community</h3>
|
|
362
|
+
<TocCard
|
|
363
|
+
title="Discord Server"
|
|
364
|
+
description="Join our Discord community for real-time discussions and support."
|
|
365
|
+
href="https://discord.gg/example"
|
|
366
|
+
/>
|
|
367
|
+
</div>
|
|
368
|
+
|
|
369
|
+
<div>
|
|
370
|
+
<h3 style={{ marginBottom: '12px', fontSize: '16px' }}>Learning</h3>
|
|
371
|
+
<TocCard
|
|
372
|
+
title="Video Course"
|
|
373
|
+
description="Comprehensive video course covering all aspects of the technology."
|
|
374
|
+
href="https://course.example.com"
|
|
375
|
+
/>
|
|
376
|
+
</div>
|
|
377
|
+
|
|
378
|
+
<div>
|
|
379
|
+
<h3 style={{ marginBottom: '12px', fontSize: '16px' }}>Resources</h3>
|
|
380
|
+
<TocCard
|
|
381
|
+
title="Cheat Sheet"
|
|
382
|
+
description="Quick reference guide with common patterns and syntax."
|
|
383
|
+
href="https://cheatsheet.example.com"
|
|
384
|
+
/>
|
|
385
|
+
</div>
|
|
386
|
+
|
|
387
|
+
<div>
|
|
388
|
+
<h3 style={{ marginBottom: '12px', fontSize: '16px' }}>Support</h3>
|
|
389
|
+
<TocCard
|
|
390
|
+
title="Help Center"
|
|
391
|
+
description="Frequently asked questions and support documentation."
|
|
392
|
+
href="https://help.example.com"
|
|
393
|
+
/>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
</div>
|
|
397
|
+
),
|
|
398
|
+
parameters: {
|
|
399
|
+
docs: {
|
|
400
|
+
description: {
|
|
401
|
+
story: 'This example demonstrates how TocCard components can be used for different types of content and resources.',
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
|