@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,430 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+
4
+ import { Image } from '@xyd-js/components/writer';
5
+
6
+ const meta: Meta<typeof Image> = {
7
+ title: 'Components/Writer/Image',
8
+ component: Image,
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component: 'Image component provides a styled image element with consistent styling and accessibility features.',
13
+ },
14
+ },
15
+ },
16
+ argTypes: {
17
+ src: {
18
+ description: 'URL of the image to display',
19
+ control: 'text',
20
+ },
21
+ alt: {
22
+ description: 'Alt text for accessibility',
23
+ control: 'text',
24
+ },
25
+ width: {
26
+ description: 'Width of the image',
27
+ control: 'number',
28
+ },
29
+ height: {
30
+ description: 'Height of the image',
31
+ control: 'number',
32
+ },
33
+ style: {
34
+ description: 'Additional CSS styles',
35
+ control: 'object',
36
+ },
37
+ },
38
+ };
39
+
40
+ export default meta;
41
+ type Story = StoryObj<typeof Image>;
42
+
43
+ // Basic usage
44
+ export const Default: Story = {
45
+ args: {
46
+ src: 'https://images.unsplash.com/photo-1518709268805-4e9042af2176?w=400&h=300&fit=crop',
47
+ alt: 'A beautiful landscape image',
48
+ },
49
+ render: (args) => (
50
+ <div style={{ padding: '20px' }}>
51
+ <Image {...args} />
52
+ </div>
53
+ ),
54
+ };
55
+
56
+ // With custom dimensions
57
+ export const WithDimensions: Story = {
58
+ args: {
59
+ src: 'https://images.unsplash.com/photo-1555949963-ff9fe0c870eb?w=400&h=300&fit=crop',
60
+ alt: 'Image with custom dimensions',
61
+ width: 300,
62
+ height: 200,
63
+ },
64
+ render: (args) => (
65
+ <div style={{ padding: '20px' }}>
66
+ <Image {...args} />
67
+ </div>
68
+ ),
69
+ };
70
+
71
+ // Different image types
72
+ export const DifferentImageTypes: Story = {
73
+ render: () => (
74
+ <div style={{ padding: '20px' }}>
75
+ <div style={{ marginBottom: '30px' }}>
76
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Landscape Image</h3>
77
+ <Image
78
+ src="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&h=200&fit=crop"
79
+ alt="Mountain landscape"
80
+ width={400}
81
+ height={200}
82
+ />
83
+ </div>
84
+
85
+ <div style={{ marginBottom: '30px' }}>
86
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Portrait Image</h3>
87
+ <Image
88
+ src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=200&h=400&fit=crop"
89
+ alt="Portrait photo"
90
+ width={200}
91
+ height={400}
92
+ />
93
+ </div>
94
+
95
+ <div style={{ marginBottom: '30px' }}>
96
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Square Image</h3>
97
+ <Image
98
+ src="https://images.unsplash.com/photo-1557683316-973673baf926?w=300&h=300&fit=crop"
99
+ alt="Abstract pattern"
100
+ width={300}
101
+ height={300}
102
+ />
103
+ </div>
104
+ </div>
105
+ ),
106
+ };
107
+
108
+ // With custom styling
109
+ export const WithCustomStyling: Story = {
110
+ args: {
111
+ src: 'https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=400&h=300&fit=crop',
112
+ alt: 'Image with custom styling',
113
+ style: {
114
+ borderRadius: '12px',
115
+ boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1)',
116
+ border: '2px solid #e0e0e0',
117
+ },
118
+ },
119
+ render: (args) => (
120
+ <div style={{ padding: '20px' }}>
121
+ <Image {...args} />
122
+ </div>
123
+ ),
124
+ };
125
+
126
+ // Multiple images
127
+ export const MultipleImages: Story = {
128
+ render: () => (
129
+ <div style={{ padding: '20px' }}>
130
+ <div style={{
131
+ display: 'grid',
132
+ gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
133
+ gap: '20px',
134
+ maxWidth: '800px'
135
+ }}>
136
+ <Image
137
+ src="https://images.unsplash.com/photo-1518709268805-4e9042af2176?w=200&h=150&fit=crop"
138
+ alt="First image"
139
+ width={200}
140
+ height={150}
141
+ />
142
+ <Image
143
+ src="https://images.unsplash.com/photo-1555949963-ff9fe0c870eb?w=200&h=150&fit=crop"
144
+ alt="Second image"
145
+ width={200}
146
+ height={150}
147
+ />
148
+ <Image
149
+ src="https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=200&h=150&fit=crop"
150
+ alt="Third image"
151
+ width={200}
152
+ height={150}
153
+ />
154
+ <Image
155
+ src="https://images.unsplash.com/photo-1557683316-973673baf926?w=200&h=150&fit=crop"
156
+ alt="Fourth image"
157
+ width={200}
158
+ height={150}
159
+ />
160
+ </div>
161
+ </div>
162
+ ),
163
+ };
164
+
165
+ // In content context
166
+ export const InContentContext: Story = {
167
+ render: () => (
168
+ <div style={{ padding: '20px', maxWidth: '600px' }}>
169
+ <h2>Article with Images</h2>
170
+ <p>
171
+ This is an example of how images can be used within content. The Image component
172
+ provides consistent styling and proper accessibility features.
173
+ </p>
174
+
175
+ <Image
176
+ src="https://images.unsplash.com/photo-1518709268805-4e9042af2176?w=500&h=300&fit=crop"
177
+ alt="Beautiful landscape to illustrate the article"
178
+ width={500}
179
+ height={300}
180
+ style={{ margin: '20px 0' }}
181
+ />
182
+
183
+ <p>
184
+ The image above demonstrates how the Image component integrates seamlessly with
185
+ surrounding content. It maintains proper spacing and responsive behavior.
186
+ </p>
187
+
188
+ <h3>Another Section</h3>
189
+ <p>
190
+ Here's another image that shows different styling options and how they work
191
+ within the content flow.
192
+ </p>
193
+
194
+ <Image
195
+ src="https://images.unsplash.com/photo-1555949963-ff9fe0c870eb?w=400&h=250&fit=crop"
196
+ alt="Another example image"
197
+ width={400}
198
+ height={250}
199
+ style={{
200
+ margin: '20px 0',
201
+ borderRadius: '8px',
202
+ boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)'
203
+ }}
204
+ />
205
+ </div>
206
+ ),
207
+ };
208
+
209
+ // Responsive images
210
+ export const ResponsiveImages: Story = {
211
+ render: () => (
212
+ <div style={{ padding: '20px' }}>
213
+ <div style={{ marginBottom: '30px' }}>
214
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Responsive Grid</h3>
215
+ <div style={{
216
+ display: 'grid',
217
+ gridTemplateColumns: 'repeat(auto-fit, minmax(250px, 1fr))',
218
+ gap: '16px'
219
+ }}>
220
+ <Image
221
+ src="https://images.unsplash.com/photo-1518709268805-4e9042af2176?w=300&h=200&fit=crop"
222
+ alt="Responsive image 1"
223
+ style={{ width: '100%', height: 'auto' }}
224
+ />
225
+ <Image
226
+ src="https://images.unsplash.com/photo-1555949963-ff9fe0c870eb?w=300&h=200&fit=crop"
227
+ alt="Responsive image 2"
228
+ style={{ width: '100%', height: 'auto' }}
229
+ />
230
+ <Image
231
+ src="https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=300&h=200&fit=crop"
232
+ alt="Responsive image 3"
233
+ style={{ width: '100%', height: 'auto' }}
234
+ />
235
+ </div>
236
+ </div>
237
+
238
+ <div style={{ marginBottom: '30px' }}>
239
+ <h3 style={{ marginBottom: '10px', color: '#666' }}>Flexible Layout</h3>
240
+ <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap' }}>
241
+ <Image
242
+ src="https://images.unsplash.com/photo-1557683316-973673baf926?w=200&h=150&fit=crop"
243
+ alt="Flexible image 1"
244
+ style={{ flex: '1', minWidth: '200px', maxWidth: '300px' }}
245
+ />
246
+ <Image
247
+ src="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=200&h=150&fit=crop"
248
+ alt="Flexible image 2"
249
+ style={{ flex: '1', minWidth: '200px', maxWidth: '300px' }}
250
+ />
251
+ <Image
252
+ src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=200&h=150&fit=crop"
253
+ alt="Flexible image 3"
254
+ style={{ flex: '1', minWidth: '200px', maxWidth: '300px' }}
255
+ />
256
+ </div>
257
+ </div>
258
+ </div>
259
+ ),
260
+ };
261
+
262
+ // Real-world examples
263
+ export const RealWorldExamples: Story = {
264
+ render: () => (
265
+ <div style={{ padding: '20px', maxWidth: '800px' }}>
266
+ <div style={{ marginBottom: '40px' }}>
267
+ <h2>Documentation Screenshots</h2>
268
+ <p>Images are commonly used in documentation to show screenshots and examples.</p>
269
+ <div style={{
270
+ background: 'var(--xyd-bgcolor)',
271
+ border: '1px solid var(--xyd-border-color)',
272
+ borderRadius: '8px',
273
+ padding: '20px'
274
+ }}>
275
+ <h3>API Dashboard</h3>
276
+ <p>Here's how the API dashboard looks in action:</p>
277
+ <Image
278
+ src="https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=600&h=300&fit=crop"
279
+ alt="API dashboard screenshot"
280
+ width={600}
281
+ height={300}
282
+ style={{
283
+ margin: '16px 0',
284
+ borderRadius: '4px',
285
+ border: '1px solid var(--xyd-border-color)'
286
+ }}
287
+ />
288
+ <p style={{ fontSize: '14px', color: 'var(--xyd-text-color-secondary)' }}>
289
+ The dashboard provides real-time metrics and analytics for your API usage.
290
+ </p>
291
+ </div>
292
+ </div>
293
+
294
+ <div style={{ marginBottom: '40px' }}>
295
+ <h2>Product Gallery</h2>
296
+ <p>Images can be used to showcase products or features.</p>
297
+ <div style={{
298
+ background: 'var(--xyd-bgcolor)',
299
+ border: '1px solid var(--xyd-border-color)',
300
+ borderRadius: '8px',
301
+ padding: '20px'
302
+ }}>
303
+ <div style={{
304
+ display: 'grid',
305
+ gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
306
+ gap: '16px'
307
+ }}>
308
+ <div>
309
+ <Image
310
+ src="https://images.unsplash.com/photo-1518709268805-4e9042af2176?w=200&h=150&fit=crop"
311
+ alt="Feature 1"
312
+ width={200}
313
+ height={150}
314
+ style={{ borderRadius: '4px' }}
315
+ />
316
+ <p style={{ marginTop: '8px', fontSize: '14px' }}>Feature One</p>
317
+ </div>
318
+ <div>
319
+ <Image
320
+ src="https://images.unsplash.com/photo-1555949963-ff9fe0c870eb?w=200&h=150&fit=crop"
321
+ alt="Feature 2"
322
+ width={200}
323
+ height={150}
324
+ style={{ borderRadius: '4px' }}
325
+ />
326
+ <p style={{ marginTop: '8px', fontSize: '14px' }}>Feature Two</p>
327
+ </div>
328
+ <div>
329
+ <Image
330
+ src="https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=200&h=150&fit=crop"
331
+ alt="Feature 3"
332
+ width={200}
333
+ height={150}
334
+ style={{ borderRadius: '4px' }}
335
+ />
336
+ <p style={{ marginTop: '8px', fontSize: '14px' }}>Feature Three</p>
337
+ </div>
338
+ </div>
339
+ </div>
340
+ </div>
341
+
342
+ <div style={{ marginBottom: '40px' }}>
343
+ <h2>Blog Post Images</h2>
344
+ <p>Images enhance blog posts and articles with visual content.</p>
345
+ <div style={{
346
+ background: 'var(--xyd-bgcolor)',
347
+ border: '1px solid var(--xyd-border-color)',
348
+ borderRadius: '8px',
349
+ padding: '20px'
350
+ }}>
351
+ <h3>Getting Started with Our Platform</h3>
352
+ <p>
353
+ Our platform provides powerful tools for developers. Here's a quick overview
354
+ of the main interface and how to get started.
355
+ </p>
356
+ <Image
357
+ src="https://images.unsplash.com/photo-1557683316-973673baf926?w=500&h=300&fit=crop"
358
+ alt="Platform interface overview"
359
+ width={500}
360
+ height={300}
361
+ style={{
362
+ margin: '20px 0',
363
+ borderRadius: '8px',
364
+ boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)'
365
+ }}
366
+ />
367
+ <p>
368
+ The interface is designed to be intuitive and user-friendly, with clear
369
+ navigation and helpful tooltips throughout.
370
+ </p>
371
+ </div>
372
+ </div>
373
+ </div>
374
+ ),
375
+ parameters: {
376
+ docs: {
377
+ description: {
378
+ story: 'This example shows how images are typically used in real applications.',
379
+ },
380
+ },
381
+ },
382
+ };
383
+
384
+ // Interactive example
385
+ export const Interactive: Story = {
386
+ args: {
387
+ src: 'https://images.unsplash.com/photo-1518709268805-4e9042af2176?w=400&h=300&fit=crop',
388
+ alt: 'Interactive image example',
389
+ },
390
+ render: (args) => (
391
+ <div style={{ padding: '20px' }}>
392
+ <div style={{
393
+ background: 'var(--xyd-bgcolor)',
394
+ border: '1px solid var(--xyd-border-color)',
395
+ borderRadius: '8px',
396
+ padding: '20px',
397
+ marginBottom: '20px'
398
+ }}>
399
+ <h3 style={{ marginBottom: '16px' }}>Image Component Demo</h3>
400
+ <p style={{ marginBottom: '16px', color: 'var(--xyd-text-color)' }}>
401
+ This example demonstrates the Image component with various styling options and responsive behavior.
402
+ </p>
403
+ <Image {...args} />
404
+ </div>
405
+
406
+ <div style={{
407
+ background: 'var(--xyd-bgcolor)',
408
+ border: '1px solid var(--xyd-border-color)',
409
+ borderRadius: '8px',
410
+ padding: '20px'
411
+ }}>
412
+ <h4 style={{ marginBottom: '12px' }}>Features</h4>
413
+ <ul style={{ color: 'var(--xyd-text-color)' }}>
414
+ <li>Consistent styling with design system</li>
415
+ <li>Responsive behavior</li>
416
+ <li>Accessibility support</li>
417
+ <li>Customizable styling</li>
418
+ <li>Theme-aware colors</li>
419
+ </ul>
420
+ </div>
421
+ </div>
422
+ ),
423
+ parameters: {
424
+ docs: {
425
+ description: {
426
+ story: 'This interactive example demonstrates the Image component functionality and styling.',
427
+ },
428
+ },
429
+ },
430
+ };