@xyd-js/storybook 0.0.1-build.167
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 +2357 -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/storybook-static/assets/Atlas.stories-B3Ix52TV.js +153 -0
- package/storybook-static/assets/Badge.stories-D3nfVAAW.js +84 -0
- package/storybook-static/assets/Banner.stories-BHLs2WlR.js +394 -0
- package/storybook-static/assets/Baseline.stories-Bwx2zF_U.js +103 -0
- package/storybook-static/assets/Blockquote.stories-Cxf9fDVo.js +468 -0
- package/storybook-static/assets/Breadcrumbs.stories-CFjDJvdh.js +219 -0
- package/storybook-static/assets/Button-Cj99tk5U-Cn0Wrqkw.js +3 -0
- package/storybook-static/assets/Button.stories-DUfQIyn7.js +472 -0
- package/storybook-static/assets/Callout.stories-CIQWommc.js +134 -0
- package/storybook-static/assets/Card.stories-0mJDPE-f.js +278 -0
- package/storybook-static/assets/CodeSample.stories-1k1_b2U_.js +8 -0
- package/storybook-static/assets/CodeSample.stories-BEAQ3H6A.js +22 -0
- package/storybook-static/assets/Color-YHDXOIA2-BAq_yxd2.js +1 -0
- package/storybook-static/assets/ColorSchemeButton.stories-C1yuuA8O.js +384 -0
- package/storybook-static/assets/Details.stories-BacIPYUH.js +290 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-BwJiFRuq.js +575 -0
- package/storybook-static/assets/DocsTemplate-B8_ZAKIZ.js +16 -0
- package/storybook-static/assets/GuideCard.stories-IJbjW-xe.js +253 -0
- package/storybook-static/assets/Heading.stories-C9rBwnlZ.js +337 -0
- package/storybook-static/assets/Hr.stories-bgwD4mmY.js +351 -0
- package/storybook-static/assets/IconSocial.stories-Bv3u90GB.js +715 -0
- package/storybook-static/assets/Icons-CjNNbMNR.js +1 -0
- package/storybook-static/assets/Image.stories-BlrJ8Th7.js +349 -0
- package/storybook-static/assets/List.stories-mzy4ZAGg.js +513 -0
- package/storybook-static/assets/Nav.stories-CZhCHFlj.js +13 -0
- package/storybook-static/assets/NavLinks.stories-DuFRhZLh.js +359 -0
- package/storybook-static/assets/PageBlogHome.stories-BnmA2r3q.js +14 -0
- package/storybook-static/assets/PageFirstSlide-D2kcGYmB-BWfslHla.js +1 -0
- package/storybook-static/assets/PageFirstSlide-SzOOIHx0.css +1 -0
- package/storybook-static/assets/PageFirstSlide.stories-CoKlxYlH.js +55 -0
- package/storybook-static/assets/PageHome.stories-DcgUrGxe.js +121 -0
- package/storybook-static/assets/Pre.stories-CKu9R4kn.js +11 -0
- package/storybook-static/assets/Sidebar.stories-BivU6MOT.js +9 -0
- package/storybook-static/assets/Steps.stories-fSa3Sw8j.js +1146 -0
- package/storybook-static/assets/SubNav.stories-CL_Th3oO.js +19 -0
- package/storybook-static/assets/Table.stories-BdNM7k9y.js +581 -0
- package/storybook-static/assets/Tabs.stories-A3NcBab_.js +873 -0
- package/storybook-static/assets/Text-BAwif7rv-BYvLGGQV.js +31 -0
- package/storybook-static/assets/TocCard.stories-BRB1SH6U.js +299 -0
- package/storybook-static/assets/Update-DflVXGGQ-qVV03FlC.js +1 -0
- package/storybook-static/assets/Update.stories-DG383caW.js +387 -0
- package/storybook-static/assets/VideoGuide.stories-BnCDLXK7.js +3 -0
- package/storybook-static/assets/__vite-browser-external-FmFgRqLi.js +1 -0
- package/storybook-static/assets/_rollupPluginBabelHelpers-DuYa1R0C-CyXpXONY.js +4 -0
- package/storybook-static/assets/chunk-EF7DTUVF-DPkwZaUR.js +12 -0
- package/storybook-static/assets/chunk-XP5HYGXS-BpfKkqn7.js +1 -0
- package/storybook-static/assets/content-BRdfAQPf.js +27 -0
- package/storybook-static/assets/entry-preview-D5WwyKaL.js +2 -0
- package/storybook-static/assets/entry-preview-docs-DU3GzdsG.js +46 -0
- package/storybook-static/assets/entry-preview-rsc-56ExrKd2.js +1 -0
- package/storybook-static/assets/github-BKgXy13-.js +6 -0
- package/storybook-static/assets/iframe-YbiB23cy.js +211 -0
- package/storybook-static/assets/index-Cf9b6H0j.js +8 -0
- package/storybook-static/assets/index-CrSc8wm9.js +240 -0
- package/storybook-static/assets/index-CzKwSnp0.js +9 -0
- package/storybook-static/assets/index-D6tQpKjq.js +12 -0
- package/storybook-static/assets/index-DUCcPMOf.js +1 -0
- package/storybook-static/assets/index-D_kTjGoR.js +9 -0
- package/storybook-static/assets/index-DgnBCu_c.js +1 -0
- package/storybook-static/assets/index-DrFu-skq.js +6 -0
- package/storybook-static/assets/index-H0MBf5rE.js +1 -0
- package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/storybook-static/assets/layouts-DBdGRyBm.js +1 -0
- package/storybook-static/assets/preview-B5edrxhc.js +1 -0
- package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
- package/storybook-static/assets/preview-C5EOgwJ9.js +2 -0
- package/storybook-static/assets/preview-DGZ5Qq08.js +34 -0
- package/storybook-static/assets/preview-DTyQTpzx.js +1 -0
- package/storybook-static/assets/preview-TqM3Oi8H.js +1 -0
- package/storybook-static/assets/preview-WIE65ICp.js +1 -0
- package/storybook-static/assets/preview-_Oh-njOd.css +1 -0
- package/storybook-static/assets/preview-caVMbCIR.js +7 -0
- package/storybook-static/assets/react-18-Tf4JhPOR.js +25 -0
- package/storybook-static/assets/system-CcsYyfSK.js +1 -0
- package/storybook-static/assets/test-utils-BaXAOqRT.js +9 -0
- package/storybook-static/assets/themes.stories-D1474P9U.js +41 -0
- package/storybook-static/assets/writer-DkrWmB39.js +1 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +666 -0
- package/storybook-static/index.html +183 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/logo.svg +10 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/docs-9/manager-bundle.js +242 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +402 -0
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-10/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storysource-8/manager-bundle.js +3 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +1052 -0
- package/storybook-static/sb-manager/globals-runtime.js +42127 -0
- package/storybook-static/sb-manager/globals.js +48 -0
- package/storybook-static/sb-manager/runtime.js +12048 -0
- package/tsconfig.json +39 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.ts +8 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Blockquote } from '@xyd-js/components/writer';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Blockquote> = {
|
|
7
|
+
title: 'Components/Writer/Blockquote',
|
|
8
|
+
component: Blockquote,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: 'Blockquote component displays quoted text with italic styling and a subtle border. Used for highlighting important quotes, testimonials, or referenced content.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
children: {
|
|
18
|
+
description: 'The quoted content to display',
|
|
19
|
+
control: 'text',
|
|
20
|
+
},
|
|
21
|
+
className: {
|
|
22
|
+
description: 'Additional CSS classes to apply to the blockquote',
|
|
23
|
+
control: 'text',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof Blockquote>;
|
|
30
|
+
|
|
31
|
+
// Basic usage
|
|
32
|
+
export const Default: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
children: 'The best way to predict the future is to invent it.',
|
|
35
|
+
},
|
|
36
|
+
render: (args) => (
|
|
37
|
+
<div style={{ padding: '20px' }}>
|
|
38
|
+
<Blockquote {...args} />
|
|
39
|
+
</div>
|
|
40
|
+
),
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Long quote
|
|
44
|
+
export const LongQuote: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
children: 'Success is not final, failure is not fatal: it is the courage to continue that counts. The only way to do great work is to love what you do. If you haven\'t found it yet, keep looking. Don\'t settle.',
|
|
47
|
+
},
|
|
48
|
+
render: (args) => (
|
|
49
|
+
<div style={{ padding: '20px' }}>
|
|
50
|
+
<Blockquote {...args} />
|
|
51
|
+
</div>
|
|
52
|
+
),
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Short quote
|
|
56
|
+
export const ShortQuote: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
children: 'Less is more.',
|
|
59
|
+
},
|
|
60
|
+
render: (args) => (
|
|
61
|
+
<div style={{ padding: '20px' }}>
|
|
62
|
+
<Blockquote {...args} />
|
|
63
|
+
</div>
|
|
64
|
+
),
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// With attribution
|
|
68
|
+
export const WithAttribution: Story = {
|
|
69
|
+
args: {
|
|
70
|
+
children: (
|
|
71
|
+
<>
|
|
72
|
+
The future belongs to those who believe in the beauty of their dreams.
|
|
73
|
+
<footer style={{ marginTop: '10px', fontSize: '14px', color: '#666' }}>
|
|
74
|
+
— Eleanor Roosevelt
|
|
75
|
+
</footer>
|
|
76
|
+
</>
|
|
77
|
+
),
|
|
78
|
+
},
|
|
79
|
+
render: (args) => (
|
|
80
|
+
<div style={{ padding: '20px' }}>
|
|
81
|
+
<Blockquote {...args} />
|
|
82
|
+
</div>
|
|
83
|
+
),
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// Technical quote
|
|
87
|
+
export const TechnicalQuote: Story = {
|
|
88
|
+
args: {
|
|
89
|
+
children: 'Any fool can write code that a computer can understand. Good programmers write code that humans can understand.',
|
|
90
|
+
},
|
|
91
|
+
render: (args) => (
|
|
92
|
+
<div style={{ padding: '20px' }}>
|
|
93
|
+
<Blockquote {...args} />
|
|
94
|
+
</div>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// With custom className
|
|
99
|
+
export const WithCustomClass: Story = {
|
|
100
|
+
args: {
|
|
101
|
+
children: 'This blockquote has custom styling applied via className.',
|
|
102
|
+
className: 'custom-blockquote',
|
|
103
|
+
},
|
|
104
|
+
render: (args) => (
|
|
105
|
+
<div style={{ padding: '20px' }}>
|
|
106
|
+
<style>
|
|
107
|
+
{`
|
|
108
|
+
.custom-blockquote {
|
|
109
|
+
background-color: #f8f9fa;
|
|
110
|
+
padding: 20px;
|
|
111
|
+
border-radius: 8px;
|
|
112
|
+
border-left: 4px solid #007bff;
|
|
113
|
+
}
|
|
114
|
+
`}
|
|
115
|
+
</style>
|
|
116
|
+
<Blockquote {...args} />
|
|
117
|
+
</div>
|
|
118
|
+
),
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// Multiple blockquotes
|
|
122
|
+
export const MultipleBlockquotes: Story = {
|
|
123
|
+
render: () => (
|
|
124
|
+
<div style={{ padding: '20px' }}>
|
|
125
|
+
<div style={{ marginBottom: '30px' }}>
|
|
126
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Inspirational Quotes</h3>
|
|
127
|
+
<Blockquote>
|
|
128
|
+
The only way to do great work is to love what you do.
|
|
129
|
+
</Blockquote>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<div style={{ marginBottom: '30px' }}>
|
|
133
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Programming Wisdom</h3>
|
|
134
|
+
<Blockquote>
|
|
135
|
+
Code is read much more often than it is written.
|
|
136
|
+
</Blockquote>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<div style={{ marginBottom: '30px' }}>
|
|
140
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Design Philosophy</h3>
|
|
141
|
+
<Blockquote>
|
|
142
|
+
Good design is obvious. Great design is transparent.
|
|
143
|
+
</Blockquote>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div style={{ marginBottom: '30px' }}>
|
|
147
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Leadership</h3>
|
|
148
|
+
<Blockquote>
|
|
149
|
+
The greatest leader is not necessarily the one who does the greatest things. He is the one that gets the people to do the greatest things.
|
|
150
|
+
</Blockquote>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
),
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// In context
|
|
157
|
+
export const InContext: Story = {
|
|
158
|
+
render: () => (
|
|
159
|
+
<div style={{ padding: '20px', maxWidth: '800px' }}>
|
|
160
|
+
<h1>Documentation Guide</h1>
|
|
161
|
+
|
|
162
|
+
<p>
|
|
163
|
+
When writing documentation, it's important to provide clear and concise information.
|
|
164
|
+
Sometimes you need to highlight important information or reference external sources.
|
|
165
|
+
</p>
|
|
166
|
+
|
|
167
|
+
<Blockquote>
|
|
168
|
+
Documentation is a love letter to your future self.
|
|
169
|
+
</Blockquote>
|
|
170
|
+
|
|
171
|
+
<p>
|
|
172
|
+
This quote emphasizes the importance of writing good documentation.
|
|
173
|
+
When you return to your code months later, you'll thank yourself for taking the time
|
|
174
|
+
to document your work properly.
|
|
175
|
+
</p>
|
|
176
|
+
|
|
177
|
+
<h2>Best Practices</h2>
|
|
178
|
+
|
|
179
|
+
<p>
|
|
180
|
+
Here are some key principles to follow when creating documentation:
|
|
181
|
+
</p>
|
|
182
|
+
|
|
183
|
+
<ul>
|
|
184
|
+
<li>Write for your audience</li>
|
|
185
|
+
<li>Keep it simple and clear</li>
|
|
186
|
+
<li>Use examples and code snippets</li>
|
|
187
|
+
<li>Update regularly</li>
|
|
188
|
+
</ul>
|
|
189
|
+
|
|
190
|
+
<Blockquote>
|
|
191
|
+
The best documentation is the one that answers the question you have right now.
|
|
192
|
+
</Blockquote>
|
|
193
|
+
|
|
194
|
+
<p>
|
|
195
|
+
Remember that good documentation should be easily discoverable and provide
|
|
196
|
+
immediate value to the reader.
|
|
197
|
+
</p>
|
|
198
|
+
</div>
|
|
199
|
+
),
|
|
200
|
+
parameters: {
|
|
201
|
+
docs: {
|
|
202
|
+
description: {
|
|
203
|
+
story: 'This example shows how blockquotes are used in real documentation contexts, providing emphasis and highlighting important information.',
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// Different content types
|
|
210
|
+
export const DifferentContentTypes: Story = {
|
|
211
|
+
render: () => (
|
|
212
|
+
<div style={{ padding: '20px' }}>
|
|
213
|
+
<div style={{ marginBottom: '30px' }}>
|
|
214
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Single Line Quote</h3>
|
|
215
|
+
<Blockquote>
|
|
216
|
+
Simplicity is the ultimate sophistication.
|
|
217
|
+
</Blockquote>
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
<div style={{ marginBottom: '30px' }}>
|
|
221
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Multi-line Quote</h3>
|
|
222
|
+
<Blockquote>
|
|
223
|
+
The best way to predict the future is to invent it.
|
|
224
|
+
Really try to get to the future and make it happen.
|
|
225
|
+
</Blockquote>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
<div style={{ marginBottom: '30px' }}>
|
|
229
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Quote with HTML</h3>
|
|
230
|
+
<Blockquote>
|
|
231
|
+
<strong>Important:</strong> Always test your code before deploying to production.
|
|
232
|
+
<br />
|
|
233
|
+
<em>This includes both unit tests and integration tests.</em>
|
|
234
|
+
</Blockquote>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<div style={{ marginBottom: '30px' }}>
|
|
238
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Quote with List</h3>
|
|
239
|
+
<Blockquote>
|
|
240
|
+
Three things to remember:
|
|
241
|
+
<ul style={{ marginTop: '10px', marginBottom: '0' }}>
|
|
242
|
+
<li>Keep it simple</li>
|
|
243
|
+
<li>Make it work</li>
|
|
244
|
+
<li>Make it fast</li>
|
|
245
|
+
</ul>
|
|
246
|
+
</Blockquote>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<div style={{ marginBottom: '30px' }}>
|
|
250
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Quote with Code</h3>
|
|
251
|
+
<Blockquote>
|
|
252
|
+
When debugging, remember: <code>console.log()</code> is your friend,
|
|
253
|
+
but proper logging is your best friend.
|
|
254
|
+
</Blockquote>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
),
|
|
258
|
+
parameters: {
|
|
259
|
+
docs: {
|
|
260
|
+
description: {
|
|
261
|
+
story: 'This example shows how blockquotes can contain different types of content including HTML elements, lists, and code snippets.',
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// Styling variations
|
|
268
|
+
export const StylingVariations: Story = {
|
|
269
|
+
render: () => (
|
|
270
|
+
<div style={{ padding: '20px' }}>
|
|
271
|
+
<div style={{ marginBottom: '30px' }}>
|
|
272
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Default Styling</h3>
|
|
273
|
+
<Blockquote>
|
|
274
|
+
This is the default blockquote styling with italic text and subtle border.
|
|
275
|
+
</Blockquote>
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
<div style={{ marginBottom: '30px' }}>
|
|
279
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Custom Background</h3>
|
|
280
|
+
<Blockquote className="bg-light">
|
|
281
|
+
This blockquote has a light background applied via custom CSS.
|
|
282
|
+
</Blockquote>
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
<div style={{ marginBottom: '30px' }}>
|
|
286
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Highlighted Quote</h3>
|
|
287
|
+
<Blockquote className="highlighted">
|
|
288
|
+
This blockquote is highlighted with a colored border and background.
|
|
289
|
+
</Blockquote>
|
|
290
|
+
</div>
|
|
291
|
+
|
|
292
|
+
<div style={{ marginBottom: '30px' }}>
|
|
293
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Large Quote</h3>
|
|
294
|
+
<Blockquote className="large-quote">
|
|
295
|
+
This is a larger blockquote with increased font size and padding.
|
|
296
|
+
</Blockquote>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<style>
|
|
300
|
+
{`
|
|
301
|
+
.bg-light {
|
|
302
|
+
background-color: #f8f9fa;
|
|
303
|
+
padding: 15px;
|
|
304
|
+
border-radius: 4px;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.highlighted {
|
|
308
|
+
background-color: #fff3cd;
|
|
309
|
+
border-left: 4px solid #ffc107;
|
|
310
|
+
padding: 15px;
|
|
311
|
+
border-radius: 4px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.large-quote {
|
|
315
|
+
font-size: 1.2em;
|
|
316
|
+
padding: 20px;
|
|
317
|
+
background-color: #e9ecef;
|
|
318
|
+
border-radius: 8px;
|
|
319
|
+
}
|
|
320
|
+
`}
|
|
321
|
+
</style>
|
|
322
|
+
</div>
|
|
323
|
+
),
|
|
324
|
+
parameters: {
|
|
325
|
+
docs: {
|
|
326
|
+
description: {
|
|
327
|
+
story: 'This example demonstrates how blockquotes can be styled using custom CSS classes to achieve different visual effects.',
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
// Real-world examples
|
|
334
|
+
export const RealWorldExamples: Story = {
|
|
335
|
+
render: () => (
|
|
336
|
+
<div style={{ padding: '20px', maxWidth: '800px' }}>
|
|
337
|
+
<div style={{ marginBottom: '30px' }}>
|
|
338
|
+
<h2>User Testimonials</h2>
|
|
339
|
+
<p>Blockquotes are commonly used to display user testimonials and feedback.</p>
|
|
340
|
+
<Blockquote>
|
|
341
|
+
"This tool has completely transformed how we handle our documentation.
|
|
342
|
+
The interface is intuitive and the features are exactly what we needed."
|
|
343
|
+
<footer style={{ marginTop: '10px', fontSize: '14px', color: '#666' }}>
|
|
344
|
+
— Sarah Johnson, Senior Developer at TechCorp
|
|
345
|
+
</footer>
|
|
346
|
+
</Blockquote>
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
<div style={{ marginBottom: '30px' }}>
|
|
350
|
+
<h2>Code Documentation</h2>
|
|
351
|
+
<p>In technical documentation, blockquotes highlight important notes and warnings.</p>
|
|
352
|
+
<Blockquote>
|
|
353
|
+
<strong>Note:</strong> This API endpoint is deprecated and will be removed in version 2.0.
|
|
354
|
+
Please use the new endpoint instead.
|
|
355
|
+
</Blockquote>
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
<div style={{ marginBottom: '30px' }}>
|
|
359
|
+
<h2>Feature Announcements</h2>
|
|
360
|
+
<p>Blockquotes can emphasize new features and announcements.</p>
|
|
361
|
+
<Blockquote>
|
|
362
|
+
🎉 <strong>New Feature:</strong> We've added real-time collaboration to our documentation platform.
|
|
363
|
+
Multiple team members can now edit documents simultaneously.
|
|
364
|
+
</Blockquote>
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
<div style={{ marginBottom: '30px' }}>
|
|
368
|
+
<h2>Best Practices</h2>
|
|
369
|
+
<p>Blockquotes are perfect for highlighting best practices and guidelines.</p>
|
|
370
|
+
<Blockquote>
|
|
371
|
+
Always write your documentation with the assumption that someone else will read it.
|
|
372
|
+
Be clear, concise, and provide examples where possible.
|
|
373
|
+
</Blockquote>
|
|
374
|
+
</div>
|
|
375
|
+
|
|
376
|
+
<div style={{ marginBottom: '30px' }}>
|
|
377
|
+
<h2>Error Messages</h2>
|
|
378
|
+
<p>Blockquotes can be used to display important error messages or warnings.</p>
|
|
379
|
+
<Blockquote>
|
|
380
|
+
<strong>Warning:</strong> This operation cannot be undone.
|
|
381
|
+
Please make sure you have backed up your data before proceeding.
|
|
382
|
+
</Blockquote>
|
|
383
|
+
</div>
|
|
384
|
+
</div>
|
|
385
|
+
),
|
|
386
|
+
parameters: {
|
|
387
|
+
docs: {
|
|
388
|
+
description: {
|
|
389
|
+
story: 'This example shows practical use cases for blockquotes in real applications, demonstrating how they enhance content readability and emphasis.',
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
// Interactive example
|
|
396
|
+
export const Interactive: Story = {
|
|
397
|
+
args: {
|
|
398
|
+
children: 'This blockquote demonstrates the component\'s interactive behavior. Try hovering over it or clicking to see different states.',
|
|
399
|
+
},
|
|
400
|
+
render: (args) => (
|
|
401
|
+
<div style={{ padding: '20px' }}>
|
|
402
|
+
<Blockquote {...args} />
|
|
403
|
+
<p style={{ marginTop: '10px', fontSize: '14px', color: '#666' }}>
|
|
404
|
+
The blockquote component provides semantic HTML structure and consistent styling for quoted content.
|
|
405
|
+
</p>
|
|
406
|
+
</div>
|
|
407
|
+
),
|
|
408
|
+
parameters: {
|
|
409
|
+
docs: {
|
|
410
|
+
description: {
|
|
411
|
+
story: 'This blockquote demonstrates the component\'s basic functionality and styling.',
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
};
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { Breadcrumbs } from '@xyd-js/components/writer';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Breadcrumbs> = {
|
|
6
|
+
title: 'Components/Writer/Breadcrumbs',
|
|
7
|
+
component: Breadcrumbs,
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: 'Breadcrumbs component displays a navigation hierarchy showing the current page location within a site structure. It helps users understand where they are and provides quick navigation to parent pages.',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
items: {
|
|
17
|
+
description: 'Array of breadcrumb items with title and optional href',
|
|
18
|
+
control: 'object',
|
|
19
|
+
},
|
|
20
|
+
className: {
|
|
21
|
+
description: 'Additional CSS classes to apply',
|
|
22
|
+
control: 'text',
|
|
23
|
+
},
|
|
24
|
+
as: {
|
|
25
|
+
description: 'Custom component to render links (defaults to anchor tag)',
|
|
26
|
+
control: 'text',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
type Story = StoryObj<typeof Breadcrumbs>;
|
|
33
|
+
|
|
34
|
+
// Basic usage
|
|
35
|
+
export const Default: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
items: [
|
|
38
|
+
{
|
|
39
|
+
title: "Home",
|
|
40
|
+
href: "/",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: "Docs",
|
|
44
|
+
href: "/docs",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
title: "Components"
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
render: (args) => (
|
|
52
|
+
<div style={{
|
|
53
|
+
padding: "100px",
|
|
54
|
+
paddingTop: "0px",
|
|
55
|
+
margin: "0 auto",
|
|
56
|
+
}}>
|
|
57
|
+
<div style={{width: 700}}>
|
|
58
|
+
<Breadcrumbs {...args} />
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// Deep navigation example
|
|
65
|
+
export const DeepNavigation: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
items: [
|
|
68
|
+
{
|
|
69
|
+
title: "Home",
|
|
70
|
+
href: "/",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: "Documentation",
|
|
74
|
+
href: "/docs",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: "API Reference",
|
|
78
|
+
href: "/docs/api",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: "GraphQL",
|
|
82
|
+
href: "/docs/api/graphql",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
title: "Queries"
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
render: (args) => (
|
|
90
|
+
<div style={{
|
|
91
|
+
padding: "100px",
|
|
92
|
+
paddingTop: "0px",
|
|
93
|
+
margin: "0 auto",
|
|
94
|
+
}}>
|
|
95
|
+
<div style={{width: 700}}>
|
|
96
|
+
<Breadcrumbs {...args} />
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Short navigation example
|
|
103
|
+
export const ShortNavigation: Story = {
|
|
104
|
+
args: {
|
|
105
|
+
items: [
|
|
106
|
+
{
|
|
107
|
+
title: "Home",
|
|
108
|
+
href: "/",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: "About"
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
render: (args) => (
|
|
116
|
+
<div style={{
|
|
117
|
+
padding: "100px",
|
|
118
|
+
paddingTop: "0px",
|
|
119
|
+
margin: "0 auto",
|
|
120
|
+
}}>
|
|
121
|
+
<div style={{width: 700}}>
|
|
122
|
+
<Breadcrumbs {...args} />
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
),
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// All items with links (no current page)
|
|
129
|
+
export const AllLinked: Story = {
|
|
130
|
+
args: {
|
|
131
|
+
items: [
|
|
132
|
+
{
|
|
133
|
+
title: "Home",
|
|
134
|
+
href: "/",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
title: "Products",
|
|
138
|
+
href: "/products",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
title: "Electronics",
|
|
142
|
+
href: "/products/electronics",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
title: "Smartphones",
|
|
146
|
+
href: "/products/electronics/smartphones",
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
render: (args) => (
|
|
151
|
+
<div style={{
|
|
152
|
+
padding: "100px",
|
|
153
|
+
paddingTop: "0px",
|
|
154
|
+
margin: "0 auto",
|
|
155
|
+
}}>
|
|
156
|
+
<div style={{width: 700}}>
|
|
157
|
+
<Breadcrumbs {...args} />
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
),
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// Long titles that might overflow
|
|
164
|
+
export const LongTitles: Story = {
|
|
165
|
+
args: {
|
|
166
|
+
items: [
|
|
167
|
+
{
|
|
168
|
+
title: "Home",
|
|
169
|
+
href: "/",
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
title: "Very Long Section Name That Might Overflow",
|
|
173
|
+
href: "/long-section",
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
title: "Another Extremely Long Page Title That Could Cause Layout Issues"
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
render: (args) => (
|
|
181
|
+
<div style={{
|
|
182
|
+
padding: "100px",
|
|
183
|
+
paddingTop: "0px",
|
|
184
|
+
margin: "0 auto",
|
|
185
|
+
}}>
|
|
186
|
+
<div style={{width: 400}}>
|
|
187
|
+
<Breadcrumbs {...args} />
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
),
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
// Multiple breadcrumb instances
|
|
194
|
+
export const MultipleInstances: Story = {
|
|
195
|
+
render: () => (
|
|
196
|
+
<div style={{
|
|
197
|
+
padding: "100px",
|
|
198
|
+
paddingTop: "0px",
|
|
199
|
+
margin: "0 auto",
|
|
200
|
+
}}>
|
|
201
|
+
<div style={{width: 700, display: 'flex', flexDirection: 'column', gap: '20px'}}>
|
|
202
|
+
<div>
|
|
203
|
+
<h4>Documentation Navigation</h4>
|
|
204
|
+
<Breadcrumbs items={[
|
|
205
|
+
{ title: "Home", href: "/" },
|
|
206
|
+
{ title: "Docs", href: "/docs" },
|
|
207
|
+
{ title: "Getting Started" }
|
|
208
|
+
]} />
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<div>
|
|
212
|
+
<h4>Product Navigation</h4>
|
|
213
|
+
<Breadcrumbs items={[
|
|
214
|
+
{ title: "Home", href: "/" },
|
|
215
|
+
{ title: "Products", href: "/products" },
|
|
216
|
+
{ title: "Software", href: "/products/software" },
|
|
217
|
+
{ title: "Development Tools" }
|
|
218
|
+
]} />
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<div>
|
|
222
|
+
<h4>Support Navigation</h4>
|
|
223
|
+
<Breadcrumbs items={[
|
|
224
|
+
{ title: "Home", href: "/" },
|
|
225
|
+
{ title: "Support", href: "/support" },
|
|
226
|
+
{ title: "Troubleshooting" }
|
|
227
|
+
]} />
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
),
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
// Interactive example with custom link component
|
|
235
|
+
export const WithCustomLink: Story = {
|
|
236
|
+
args: {
|
|
237
|
+
items: [
|
|
238
|
+
{
|
|
239
|
+
title: "Home",
|
|
240
|
+
href: "/",
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
title: "Docs",
|
|
244
|
+
href: "/docs",
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
title: "Components"
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
as: ({ href, children, ...rest }) => (
|
|
251
|
+
<a
|
|
252
|
+
href={href}
|
|
253
|
+
style={{
|
|
254
|
+
color: '#0066cc',
|
|
255
|
+
textDecoration: 'underline',
|
|
256
|
+
fontWeight: '500'
|
|
257
|
+
}}
|
|
258
|
+
{...rest}
|
|
259
|
+
>
|
|
260
|
+
{children}
|
|
261
|
+
</a>
|
|
262
|
+
),
|
|
263
|
+
},
|
|
264
|
+
render: (args) => (
|
|
265
|
+
<div style={{
|
|
266
|
+
padding: "100px",
|
|
267
|
+
paddingTop: "0px",
|
|
268
|
+
margin: "0 auto",
|
|
269
|
+
}}>
|
|
270
|
+
<div style={{width: 700}}>
|
|
271
|
+
<Breadcrumbs {...args} />
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
),
|
|
275
|
+
parameters: {
|
|
276
|
+
docs: {
|
|
277
|
+
description: {
|
|
278
|
+
story: 'This example shows how to customize the link appearance using the `as` prop to pass a custom link component.',
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
};
|