@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,384 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+ import { Play, BarChart, TrendingUp } from 'lucide-react';
4
+
5
+ import { GuideCard } from '@xyd-js/components/writer';
6
+
7
+ const meta: Meta<typeof GuideCard> = {
8
+ title: 'Components/Writer/GuideCard',
9
+ component: GuideCard,
10
+ parameters: {
11
+ docs: {
12
+ description: {
13
+ component: 'GuideCard component displays content with a title and optional icon. The entire card is clickable and links to the specified URL.',
14
+ },
15
+ },
16
+ },
17
+ argTypes: {
18
+ children: {
19
+ description: 'The content to display inside the card body',
20
+ control: 'text',
21
+ },
22
+ href: {
23
+ description: 'URL the card links to',
24
+ control: 'text',
25
+ },
26
+ title: {
27
+ description: 'Title displayed at the top of the card',
28
+ control: 'text',
29
+ },
30
+ icon: {
31
+ description: 'Optional icon displayed to the left of the content',
32
+ control: false,
33
+ },
34
+ kind: {
35
+ description: 'Visual style variant of the card',
36
+ control: { type: 'select' },
37
+ options: ['secondary'],
38
+ },
39
+ size: {
40
+ description: 'Size variant of the card',
41
+ control: { type: 'select' },
42
+ options: ['sm', 'md'],
43
+ },
44
+ className: {
45
+ description: 'Additional CSS classes to apply',
46
+ control: 'text',
47
+ },
48
+ },
49
+ };
50
+
51
+ export default meta;
52
+ type Story = StoryObj<typeof GuideCard>;
53
+
54
+ // Basic usage
55
+ export const Default: Story = {
56
+ args: {
57
+ href: '#',
58
+ title: 'Getting Started',
59
+ children: 'Start your journey with our comprehensive quickstart guide.',
60
+ },
61
+ render: (args) => (
62
+ <div style={{ padding: '20px', maxWidth: '400px' }}>
63
+ <GuideCard {...args} />
64
+ </div>
65
+ ),
66
+ };
67
+
68
+ // With icon
69
+ export const WithIcon: Story = {
70
+ args: {
71
+ href: '#',
72
+ title: 'Session Replay',
73
+ icon: <Play size={24} />,
74
+ children: 'Visualize user interactions in your product with detailed session replays.',
75
+ },
76
+ render: (args) => (
77
+ <div style={{ padding: '20px', maxWidth: '400px' }}>
78
+ <GuideCard {...args} />
79
+ </div>
80
+ ),
81
+ };
82
+
83
+ // Secondary variant
84
+ export const Secondary: Story = {
85
+ args: {
86
+ href: '#',
87
+ title: 'Metrics Analysis',
88
+ icon: <BarChart size={24} />,
89
+ kind: 'secondary',
90
+ children: 'Analyze key metrics to understand user behavior and optimize your product workflows.',
91
+ },
92
+ render: (args) => (
93
+ <div style={{ padding: '20px', maxWidth: '400px' }}>
94
+ <GuideCard {...args} />
95
+ </div>
96
+ ),
97
+ };
98
+
99
+ // Small size
100
+ export const Small: Story = {
101
+ args: {
102
+ href: '#',
103
+ title: 'Quick Tips',
104
+ icon: <TrendingUp size={24} />,
105
+ size: 'sm',
106
+ children: 'Essential tips and best practices for getting the most out of our platform.',
107
+ },
108
+ render: (args) => (
109
+ <div style={{ padding: '20px', maxWidth: '400px' }}>
110
+ <GuideCard {...args} />
111
+ </div>
112
+ ),
113
+ };
114
+
115
+ // Medium size (default)
116
+ export const Medium: Story = {
117
+ args: {
118
+ href: '#',
119
+ title: 'Advanced Configuration',
120
+ icon: <Play size={24} />,
121
+ size: 'md',
122
+ kind: 'secondary',
123
+ children: 'Learn about advanced configuration options and customization features.',
124
+ },
125
+ render: (args) => (
126
+ <div style={{ padding: '20px', maxWidth: '400px' }}>
127
+ <GuideCard {...args} />
128
+ </div>
129
+ ),
130
+ };
131
+
132
+ // Without icon
133
+ export const WithoutIcon: Story = {
134
+ args: {
135
+ href: '#',
136
+ title: 'Documentation',
137
+ children: 'Comprehensive documentation covering all features, APIs, and integration options.',
138
+ },
139
+ render: (args) => (
140
+ <div style={{ padding: '20px', maxWidth: '400px' }}>
141
+ <GuideCard {...args} />
142
+ </div>
143
+ ),
144
+ };
145
+
146
+ // Multiple cards in a row
147
+ export const MultipleCards: Story = {
148
+ render: () => (
149
+ <div style={{ padding: '20px' }}>
150
+ <div style={{
151
+ display: 'flex',
152
+ gap: '20px',
153
+ flexWrap: 'wrap',
154
+ alignItems: 'flex-start',
155
+ }}>
156
+ <GuideCard
157
+ href="#"
158
+ icon={<Play size={24} />}
159
+ title="Session Replay"
160
+ kind="secondary"
161
+ >
162
+ Visualize user interactions in your product with detailed session replays.
163
+ </GuideCard>
164
+
165
+ <GuideCard
166
+ href="#"
167
+ icon={<BarChart size={24} />}
168
+ title="Metrics Analysis"
169
+ kind="secondary"
170
+ >
171
+ Analyze key metrics to understand user behavior and optimize your product workflows.
172
+ </GuideCard>
173
+
174
+ <GuideCard
175
+ href="#"
176
+ icon={<TrendingUp size={24} />}
177
+ title="Funnel Analysis"
178
+ kind="secondary"
179
+ >
180
+ Track conversion funnels and identify drop-off points in your user journey.
181
+ </GuideCard>
182
+ </div>
183
+ </div>
184
+ ),
185
+ };
186
+
187
+ // Grid layout using GuideCard.List
188
+ export const Grid: Story = {
189
+ render: () => (
190
+ <div style={{ padding: '20px' }}>
191
+ <GuideCard.List>
192
+ <GuideCard
193
+ href="#"
194
+ icon={<svg
195
+ xmlns="http://www.w3.org/2000/svg"
196
+ width="1em"
197
+ height="1em"
198
+ viewBox="0 0 24 24"
199
+ fill="none"
200
+ >
201
+ <path
202
+ d="M22 9H2M2 7.8L2 16.2C2 17.8802 2 18.7202 2.32698 19.362C2.6146 19.9265 3.07354 20.3854 3.63803 20.673C4.27976 21 5.11984 21 6.8 21H17.2C18.8802 21 19.7202 21 20.362 20.673C20.9265 20.3854 21.3854 19.9265 21.673 19.362C22 18.7202 22 17.8802 22 16.2V7.8C22 6.11984 22 5.27977 21.673 4.63803C21.3854 4.07354 20.9265 3.6146 20.362 3.32698C19.7202 3 18.8802 3 17.2 3L6.8 3C5.11984 3 4.27976 3 3.63803 3.32698C3.07354 3.6146 2.6146 4.07354 2.32698 4.63803C2 5.27976 2 6.11984 2 7.8Z"
203
+ stroke="#000000"
204
+ strokeWidth={2}
205
+ strokeLinecap="round"
206
+ strokeLinejoin="round"
207
+ />
208
+ </svg>}
209
+ title="Browser API"
210
+ kind="secondary"
211
+ >
212
+ Capture user interactions like clicks, page views, and events directly from your app with minimal impact
213
+ on performance.
214
+ </GuideCard>
215
+
216
+ <GuideCard
217
+ href="#"
218
+ icon={<svg
219
+ xmlns="http://www.w3.org/2000/svg"
220
+ width="1em"
221
+ height="1em"
222
+ viewBox="0 0 16 16"
223
+ fill="none"
224
+ >
225
+ <path
226
+ fill="#000000"
227
+ fillRule="evenodd"
228
+ d="M.5 2.75a2.25 2.25 0 114.28.97l1.345 1.344.284-.284a2.25 2.25 0 013.182 0l.284.284 1.344-1.344a2.25 2.25 0 111.06 1.06l-1.343 1.345.284.284a2.25 2.25 0 010 3.182l-.284.284 1.344 1.344a2.25 2.25 0 11-1.06 1.06l-1.345-1.343-.284.284a2.25 2.25 0 01-3.182 0l-.284-.284-1.344 1.344a2.25 2.25 0 11-1.06-1.06l1.343-1.345-.284-.284a2.25 2.25 0 010-3.182l.284-.284L3.72 4.781A2.25 2.25 0 01.5 2.75zM2.75 2a.75.75 0 100 1.5.75.75 0 000-1.5zm0 10.5a.75.75 0 100 1.5.75.75 0 000-1.5zm9.75.75a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM13.25 2a.75.75 0 100 1.5.75.75 0 000-1.5zM7.47 5.841a.75.75 0 011.06 0L10.16 7.47a.75.75 0 010 1.06L8.53 10.16a.75.75 0 01-1.06 0L5.84 8.53a.75.75 0 010-1.06L7.47 5.84z"
229
+ clipRule="evenodd"
230
+ />
231
+ </svg>}
232
+ title="REST API"
233
+ kind="secondary"
234
+ >
235
+ Access and manage session data, events, and user journeys programmatically. Perfect for custom
236
+ dashboards and third-party integrations.
237
+ </GuideCard>
238
+
239
+ <GuideCard
240
+ href="#"
241
+ icon={
242
+ <svg
243
+ xmlns="http://www.w3.org/2000/svg"
244
+ fill="#000"
245
+ width="1em"
246
+ height="1em"
247
+ viewBox="0 0 32 32"
248
+ >
249
+ <path
250
+ d="M18.734 3.667l6.578 3.802c1.089-1.146 2.901-1.193 4.047-0.104 0.193 0.188 0.365 0.401 0.5 0.635 0.786 1.37 0.313 3.12-1.063 3.906-0.229 0.13-0.479 0.234-0.745 0.297v7.599c1.531 0.365 2.474 1.896 2.109 3.427-0.063 0.271-0.172 0.531-0.307 0.771-0.792 1.365-2.536 1.833-3.906 1.042-0.26-0.146-0.5-0.344-0.698-0.568l-6.542 3.776c0.495 1.495-0.318 3.109-1.813 3.604-0.292 0.099-0.594 0.146-0.896 0.146-1.573 0-2.854-1.271-2.854-2.849 0-0.271 0.042-0.547 0.12-0.813l-6.583-3.797c-1.089 1.141-2.896 1.188-4.036 0.094-1.135-1.089-1.177-2.891-0.094-4.031 0.38-0.396 0.865-0.677 1.396-0.807v-7.599c-1.531-0.365-2.479-1.906-2.109-3.443 0.063-0.266 0.167-0.521 0.302-0.755 0.786-1.365 2.536-1.833 3.901-1.042 0.234 0.135 0.453 0.302 0.641 0.5l6.583-3.797c-0.448-1.51 0.417-3.099 1.922-3.542 0.26-0.083 0.536-0.12 0.813-0.12 1.573 0 2.854 1.271 2.854 2.844 0 0.281-0.042 0.557-0.12 0.823zM18.047 4.839c-0.026 0.026-0.047 0.052-0.078 0.078l8.615 14.917c0.036-0.010 0.078-0.021 0.109-0.031v-7.609c-1.526-0.375-2.453-1.922-2.073-3.448 0.005-0.031 0.016-0.068 0.021-0.099zM14.026 4.917l-0.078-0.078-6.594 3.802c0.438 1.51-0.438 3.089-1.948 3.526-0.036 0.010-0.068 0.016-0.104 0.026v7.609l0.115 0.031 8.615-14.917zM16.797 5.594c-0.521 0.146-1.073 0.146-1.589 0l-8.615 14.917c0.391 0.375 0.667 0.859 0.802 1.391h17.214c0.13-0.531 0.406-1.016 0.802-1.396zM18.109 27.229l6.552-3.786c-0.021-0.063-0.036-0.125-0.052-0.188h-17.219l-0.031 0.109 6.589 3.802c0.516-0.536 1.245-0.87 2.052-0.87 0.839 0 1.589 0.359 2.109 0.932z" />
251
+ </svg>
252
+ }
253
+ title="GraphQL API"
254
+ kind="secondary"
255
+ >
256
+ Query session data, user interactions, and event tracking with precision. Build custom integrations to
257
+ enhance your product analytics.
258
+ </GuideCard>
259
+
260
+ <GuideCard
261
+ href="#"
262
+ icon={<svg
263
+ xmlns="http://www.w3.org/2000/svg"
264
+ xmlnsXlink="http://www.w3.org/1999/xlink"
265
+ width="1em"
266
+ height="1em"
267
+ viewBox="-10 -5 1034 1034"
268
+ >
269
+ <path
270
+ fill="#000000"
271
+ d="M482 226h-1l-10 2q-33 4 -64.5 18.5t-55.5 38.5q-41 37 -57 91q-9 30 -8 63t12 63q17 45 52 78l13 12l-83 135q-26 -1 -45 7q-30 13 -45 40q-7 15 -9 31t2 32q8 30 33 48q15 10 33 14.5t36 2t34.5 -12.5t27.5 -25q12 -17 14.5 -39t-5.5 -41q-1 -5 -7 -14l-3 -6l118 -192 q6 -9 8 -14l-10 -3q-9 -2 -13 -4q-23 -10 -41.5 -27.5t-28.5 -39.5q-17 -36 -9 -75q4 -23 17 -43t31 -34q37 -27 82 -27q27 -1 52.5 9.5t44.5 30.5q17 16 26.5 38.5t10.5 45.5q0 17 -6 42l70 19l8 1q14 -43 7 -86q-4 -33 -19.5 -63.5t-39.5 -53.5q-42 -42 -103 -56 q-6 -2 -18 -4l-14 -2h-37zM500 350q-17 0 -34 7t-30.5 20.5t-19.5 31.5q-8 20 -4 44q3 18 14 34t28 25q24 15 56 13q3 4 5 8l112 191q3 6 6 9q27 -26 58.5 -35.5t65 -3.5t58.5 26q32 25 43.5 61.5t0.5 73.5q-8 28 -28.5 50t-48.5 33q-31 13 -66.5 8.5t-63.5 -24.5 q-4 -3 -13 -10l-5 -6q-4 3 -11 10l-47 46q23 23 52 38.5t61 21.5l22 4h39l28 -5q64 -13 110 -60q22 -22 36.5 -50.5t19.5 -59.5q5 -36 -2 -71.5t-25 -64.5t-44 -51t-57 -35q-34 -14 -70.5 -16t-71.5 7l-17 5l-81 -137q13 -19 16 -37q5 -32 -13 -60q-16 -25 -44 -35 q-17 -6 -35 -6zM218 614q-58 13 -100 53q-47 44 -61 105l-4 24v37l2 11q2 13 4 20q7 31 24.5 59t42.5 49q50 41 115 49q38 4 76 -4.5t70 -28.5q53 -34 78 -91q7 -17 14 -45q6 -1 18 0l125 2q14 0 20 1q11 20 25 31t31.5 16t35.5 4q28 -3 50 -20q27 -21 32 -54 q2 -17 -1.5 -33t-13.5 -30q-16 -22 -41 -32q-17 -7 -35.5 -6.5t-35.5 7.5q-28 12 -43 37l-3 6q-14 0 -42 -1l-113 -1q-15 -1 -43 -1l-50 -1l3 17q8 43 -13 81q-14 27 -40 45t-57 22q-35 6 -70 -7.5t-57 -42.5q-28 -35 -27 -79q1 -37 23 -69q13 -19 32 -32t41 -19l9 -3z"
272
+ />
273
+ </svg>}
274
+ title="Webhooks"
275
+ kind="secondary"
276
+ >
277
+ Trigger actions or sync apps in real-time based on user behaviors or product events. Webhooks provide a
278
+ faster, more efficient alternative to API polling.
279
+ </GuideCard>
280
+ </GuideCard.List>
281
+ </div>
282
+ ),
283
+ };
284
+
285
+ // All variants showcase
286
+ export const AllVariants: Story = {
287
+ render: () => (
288
+ <div style={{ padding: '20px' }}>
289
+ <div style={{ marginBottom: '20px' }}>
290
+ <h3 style={{ marginBottom: '10px' }}>Default (Primary)</h3>
291
+ <div style={{ maxWidth: '400px' }}>
292
+ <GuideCard
293
+ href="#"
294
+ title="Primary Card"
295
+ icon={<Play size={24} />}
296
+ >
297
+ This is a primary guide card with default styling.
298
+ </GuideCard>
299
+ </div>
300
+ </div>
301
+
302
+ <div style={{ marginBottom: '20px' }}>
303
+ <h3 style={{ marginBottom: '10px' }}>Secondary</h3>
304
+ <div style={{ maxWidth: '400px' }}>
305
+ <GuideCard
306
+ href="#"
307
+ title="Secondary Card"
308
+ icon={<BarChart size={24} />}
309
+ kind="secondary"
310
+ >
311
+ This is a secondary guide card with different styling.
312
+ </GuideCard>
313
+ </div>
314
+ </div>
315
+
316
+ <div style={{ marginBottom: '20px' }}>
317
+ <h3 style={{ marginBottom: '10px' }}>Small Size</h3>
318
+ <div style={{ maxWidth: '400px' }}>
319
+ <GuideCard
320
+ href="#"
321
+ title="Small Card"
322
+ icon={<TrendingUp size={24} />}
323
+ size="sm"
324
+ kind="secondary"
325
+ >
326
+ This is a small guide card with compact styling.
327
+ </GuideCard>
328
+ </div>
329
+ </div>
330
+
331
+ <div style={{ marginBottom: '20px' }}>
332
+ <h3 style={{ marginBottom: '10px' }}>Medium Size</h3>
333
+ <div style={{ maxWidth: '400px' }}>
334
+ <GuideCard
335
+ href="#"
336
+ title="Medium Card"
337
+ icon={<Play size={24} />}
338
+ size="md"
339
+ kind="secondary"
340
+ >
341
+ This is a medium guide card with standard styling.
342
+ </GuideCard>
343
+ </div>
344
+ </div>
345
+
346
+ <div style={{ marginBottom: '20px' }}>
347
+ <h3 style={{ marginBottom: '10px' }}>Without Icon</h3>
348
+ <div style={{ maxWidth: '400px' }}>
349
+ <GuideCard
350
+ href="#"
351
+ title="No Icon Card"
352
+ kind="secondary"
353
+ >
354
+ This guide card doesn't have an icon.
355
+ </GuideCard>
356
+ </div>
357
+ </div>
358
+ </div>
359
+ ),
360
+ };
361
+
362
+ // Interactive example
363
+ export const Interactive: Story = {
364
+ args: {
365
+ href: '#',
366
+ title: 'Interactive Card',
367
+ icon: <Play size={24} />,
368
+ kind: 'secondary',
369
+ children: 'This card demonstrates interactive behavior. Try hovering over it to see the pointer animation.',
370
+ },
371
+ render: (args) => (
372
+ <div style={{ padding: '20px', maxWidth: '400px' }}>
373
+ <GuideCard {...args} />
374
+ </div>
375
+ ),
376
+ parameters: {
377
+ docs: {
378
+ description: {
379
+ story: 'This card demonstrates the interactive hover effects. Notice how the pointer icon appears on hover.',
380
+ },
381
+ },
382
+ },
383
+ };
384
+