@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,325 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Hr } from '@xyd-js/components/writer';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Hr> = {
|
|
7
|
+
title: 'Components/Writer/Hr',
|
|
8
|
+
component: Hr,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: 'Hr component provides a horizontal rule element for visual separation of content sections.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
// Hr doesn't accept props, but we can document the behavior
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof Hr>;
|
|
23
|
+
|
|
24
|
+
// Basic usage
|
|
25
|
+
export const Default: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<div style={{ padding: '20px' }}>
|
|
28
|
+
<p>Content above the horizontal rule.</p>
|
|
29
|
+
<Hr />
|
|
30
|
+
<p>Content below the horizontal rule.</p>
|
|
31
|
+
</div>
|
|
32
|
+
),
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// Multiple horizontal rules
|
|
36
|
+
export const MultipleHrs: Story = {
|
|
37
|
+
render: () => (
|
|
38
|
+
<div style={{ padding: '20px' }}>
|
|
39
|
+
<h2>Section 1</h2>
|
|
40
|
+
<p>This is the first section of content.</p>
|
|
41
|
+
<Hr />
|
|
42
|
+
|
|
43
|
+
<h2>Section 2</h2>
|
|
44
|
+
<p>This is the second section of content.</p>
|
|
45
|
+
<Hr />
|
|
46
|
+
|
|
47
|
+
<h2>Section 3</h2>
|
|
48
|
+
<p>This is the third section of content.</p>
|
|
49
|
+
</div>
|
|
50
|
+
),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// In different contexts
|
|
54
|
+
export const DifferentContexts: Story = {
|
|
55
|
+
render: () => (
|
|
56
|
+
<div style={{ padding: '20px' }}>
|
|
57
|
+
<div style={{ marginBottom: '30px' }}>
|
|
58
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Article Sections</h3>
|
|
59
|
+
<article>
|
|
60
|
+
<h2>Introduction</h2>
|
|
61
|
+
<p>This is the introduction to the article.</p>
|
|
62
|
+
<Hr />
|
|
63
|
+
<h2>Main Content</h2>
|
|
64
|
+
<p>This is the main content of the article.</p>
|
|
65
|
+
<Hr />
|
|
66
|
+
<h2>Conclusion</h2>
|
|
67
|
+
<p>This is the conclusion of the article.</p>
|
|
68
|
+
</article>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<div style={{ marginBottom: '30px' }}>
|
|
72
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Form Sections</h3>
|
|
73
|
+
<form>
|
|
74
|
+
<div>
|
|
75
|
+
<label>Personal Information</label>
|
|
76
|
+
<input type="text" placeholder="Name" />
|
|
77
|
+
<input type="email" placeholder="Email" />
|
|
78
|
+
</div>
|
|
79
|
+
<Hr />
|
|
80
|
+
<div>
|
|
81
|
+
<label>Preferences</label>
|
|
82
|
+
<input type="checkbox" /> Newsletter
|
|
83
|
+
<input type="checkbox" /> Notifications
|
|
84
|
+
</div>
|
|
85
|
+
</form>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div style={{ marginBottom: '30px' }}>
|
|
89
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>List Separation</h3>
|
|
90
|
+
<ul>
|
|
91
|
+
<li>First item in the list</li>
|
|
92
|
+
<li>Second item in the list</li>
|
|
93
|
+
</ul>
|
|
94
|
+
<Hr />
|
|
95
|
+
<ul>
|
|
96
|
+
<li>First item in the second list</li>
|
|
97
|
+
<li>Second item in the second list</li>
|
|
98
|
+
</ul>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// With different content types
|
|
105
|
+
export const WithDifferentContent: Story = {
|
|
106
|
+
render: () => (
|
|
107
|
+
<div style={{ padding: '20px' }}>
|
|
108
|
+
<div style={{ marginBottom: '20px' }}>
|
|
109
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Text Content</h3>
|
|
110
|
+
<p>This is a paragraph of text content.</p>
|
|
111
|
+
<Hr />
|
|
112
|
+
<p>This is another paragraph separated by a horizontal rule.</p>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div style={{ marginBottom: '20px' }}>
|
|
116
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Mixed Content</h3>
|
|
117
|
+
<div>
|
|
118
|
+
<h4>Section Title</h4>
|
|
119
|
+
<p>Some descriptive text about this section.</p>
|
|
120
|
+
<ul>
|
|
121
|
+
<li>List item one</li>
|
|
122
|
+
<li>List item two</li>
|
|
123
|
+
</ul>
|
|
124
|
+
</div>
|
|
125
|
+
<Hr />
|
|
126
|
+
<div>
|
|
127
|
+
<h4>Another Section</h4>
|
|
128
|
+
<p>Content for the next section.</p>
|
|
129
|
+
<blockquote>This is a blockquote in the second section.</blockquote>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
<div style={{ marginBottom: '20px' }}>
|
|
134
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Code and Text</h3>
|
|
135
|
+
<p>Here's some regular text content.</p>
|
|
136
|
+
<pre><code>console.log('Some code example');</code></pre>
|
|
137
|
+
<Hr />
|
|
138
|
+
<p>More text content after the horizontal rule.</p>
|
|
139
|
+
<pre><code>const example = 'Another code block';</code></pre>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
),
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// Real-world examples
|
|
146
|
+
export const RealWorldExamples: Story = {
|
|
147
|
+
render: () => (
|
|
148
|
+
<div style={{ padding: '20px', maxWidth: '800px' }}>
|
|
149
|
+
<div style={{ marginBottom: '40px' }}>
|
|
150
|
+
<h2>Documentation Page</h2>
|
|
151
|
+
<p>Horizontal rules are commonly used in documentation to separate different sections.</p>
|
|
152
|
+
<div style={{
|
|
153
|
+
background: 'var(--xyd-bgcolor)',
|
|
154
|
+
border: '1px solid var(--xyd-border-color)',
|
|
155
|
+
borderRadius: '8px',
|
|
156
|
+
padding: '20px'
|
|
157
|
+
}}>
|
|
158
|
+
<h3>Getting Started</h3>
|
|
159
|
+
<p>Learn the basics of our framework and get up and running quickly.</p>
|
|
160
|
+
<Hr />
|
|
161
|
+
<h3>Installation</h3>
|
|
162
|
+
<p>Follow these steps to install and configure the package.</p>
|
|
163
|
+
<Hr />
|
|
164
|
+
<h3>Configuration</h3>
|
|
165
|
+
<p>Customize the behavior and appearance of your application.</p>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<div style={{ marginBottom: '40px' }}>
|
|
170
|
+
<h2>Article Layout</h2>
|
|
171
|
+
<p>Articles often use horizontal rules to separate different topics or sections.</p>
|
|
172
|
+
<div style={{
|
|
173
|
+
background: 'var(--xyd-bgcolor)',
|
|
174
|
+
border: '1px solid var(--xyd-border-color)',
|
|
175
|
+
borderRadius: '8px',
|
|
176
|
+
padding: '20px'
|
|
177
|
+
}}>
|
|
178
|
+
<h3>Introduction</h3>
|
|
179
|
+
<p>This article explores the various ways to use horizontal rules in web design.</p>
|
|
180
|
+
<Hr />
|
|
181
|
+
<h3>Design Principles</h3>
|
|
182
|
+
<p>Understanding when and how to use visual separators effectively.</p>
|
|
183
|
+
<Hr />
|
|
184
|
+
<h3>Implementation</h3>
|
|
185
|
+
<p>Practical examples and code snippets for implementation.</p>
|
|
186
|
+
<Hr />
|
|
187
|
+
<h3>Conclusion</h3>
|
|
188
|
+
<p>Summary and best practices for using horizontal rules.</p>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<div style={{ marginBottom: '40px' }}>
|
|
193
|
+
<h2>Settings Panel</h2>
|
|
194
|
+
<p>Settings and configuration panels use horizontal rules to group related options.</p>
|
|
195
|
+
<div style={{
|
|
196
|
+
background: 'var(--xyd-bgcolor)',
|
|
197
|
+
border: '1px solid var(--xyd-border-color)',
|
|
198
|
+
borderRadius: '8px',
|
|
199
|
+
padding: '20px'
|
|
200
|
+
}}>
|
|
201
|
+
<h3>General Settings</h3>
|
|
202
|
+
<div style={{ marginBottom: '16px' }}>
|
|
203
|
+
<label>Theme: </label>
|
|
204
|
+
<select>
|
|
205
|
+
<option>Light</option>
|
|
206
|
+
<option>Dark</option>
|
|
207
|
+
</select>
|
|
208
|
+
</div>
|
|
209
|
+
<div style={{ marginBottom: '16px' }}>
|
|
210
|
+
<label>Language: </label>
|
|
211
|
+
<select>
|
|
212
|
+
<option>English</option>
|
|
213
|
+
<option>Spanish</option>
|
|
214
|
+
</select>
|
|
215
|
+
</div>
|
|
216
|
+
<Hr />
|
|
217
|
+
<h3>Privacy Settings</h3>
|
|
218
|
+
<div style={{ marginBottom: '16px' }}>
|
|
219
|
+
<input type="checkbox" /> Allow analytics
|
|
220
|
+
</div>
|
|
221
|
+
<div style={{ marginBottom: '16px' }}>
|
|
222
|
+
<input type="checkbox" /> Share usage data
|
|
223
|
+
</div>
|
|
224
|
+
<Hr />
|
|
225
|
+
<h3>Advanced Settings</h3>
|
|
226
|
+
<div style={{ marginBottom: '16px' }}>
|
|
227
|
+
<label>Cache size: </label>
|
|
228
|
+
<input type="number" defaultValue="100" /> MB
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
),
|
|
234
|
+
parameters: {
|
|
235
|
+
docs: {
|
|
236
|
+
description: {
|
|
237
|
+
story: 'This example shows how horizontal rules are typically used in real applications for content separation.',
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
// Interactive example
|
|
244
|
+
export const Interactive: Story = {
|
|
245
|
+
render: () => (
|
|
246
|
+
<div style={{ padding: '20px' }}>
|
|
247
|
+
<div style={{
|
|
248
|
+
background: 'var(--xyd-bgcolor)',
|
|
249
|
+
border: '1px solid var(--xyd-border-color)',
|
|
250
|
+
borderRadius: '8px',
|
|
251
|
+
padding: '20px',
|
|
252
|
+
marginBottom: '20px'
|
|
253
|
+
}}>
|
|
254
|
+
<h3>Content Separation Demo</h3>
|
|
255
|
+
<p>This example demonstrates how horizontal rules provide visual separation between content sections.</p>
|
|
256
|
+
<Hr />
|
|
257
|
+
<p>The horizontal rule above creates a clear visual break between these two paragraphs.</p>
|
|
258
|
+
<Hr />
|
|
259
|
+
<p>Multiple horizontal rules can be used to create a structured layout with clear section divisions.</p>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
<div style={{
|
|
263
|
+
background: 'var(--xyd-bgcolor)',
|
|
264
|
+
border: '1px solid var(--xyd-border-color)',
|
|
265
|
+
borderRadius: '8px',
|
|
266
|
+
padding: '20px'
|
|
267
|
+
}}>
|
|
268
|
+
<h4>Features</h4>
|
|
269
|
+
<ul style={{ color: 'var(--xyd-text-color)' }}>
|
|
270
|
+
<li>Semantic HTML structure</li>
|
|
271
|
+
<li>Consistent styling with design system</li>
|
|
272
|
+
<li>Accessible visual separation</li>
|
|
273
|
+
<li>Responsive design</li>
|
|
274
|
+
<li>Theme-aware styling</li>
|
|
275
|
+
</ul>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
),
|
|
279
|
+
parameters: {
|
|
280
|
+
docs: {
|
|
281
|
+
description: {
|
|
282
|
+
story: 'This interactive example demonstrates the Hr component functionality and styling.',
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
// Spacing variations
|
|
289
|
+
export const SpacingVariations: Story = {
|
|
290
|
+
render: () => (
|
|
291
|
+
<div style={{ padding: '20px' }}>
|
|
292
|
+
<div style={{ marginBottom: '30px' }}>
|
|
293
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Tight Spacing</h3>
|
|
294
|
+
<p>Content with minimal spacing around the horizontal rule.</p>
|
|
295
|
+
<Hr />
|
|
296
|
+
<p>More content with tight spacing.</p>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<div style={{ marginBottom: '30px' }}>
|
|
300
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Normal Spacing</h3>
|
|
301
|
+
<p>Content with standard spacing around the horizontal rule.</p>
|
|
302
|
+
<div style={{ margin: '20px 0' }}>
|
|
303
|
+
<Hr />
|
|
304
|
+
</div>
|
|
305
|
+
<p>More content with normal spacing.</p>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
<div style={{ marginBottom: '30px' }}>
|
|
309
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Loose Spacing</h3>
|
|
310
|
+
<p>Content with generous spacing around the horizontal rule.</p>
|
|
311
|
+
<div style={{ margin: '40px 0' }}>
|
|
312
|
+
<Hr />
|
|
313
|
+
</div>
|
|
314
|
+
<p>More content with loose spacing.</p>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
),
|
|
318
|
+
parameters: {
|
|
319
|
+
docs: {
|
|
320
|
+
description: {
|
|
321
|
+
story: 'This example shows how different spacing around horizontal rules affects the visual hierarchy.',
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
};
|