@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,101 @@
1
+ // TODO: move to utils or somewhere else
2
+ import React from "react";
3
+ import {parse} from "codehike";
4
+ import {visit} from "unist-util-visit";
5
+ import {recmaCodeHike, remarkCodeHike} from "codehike/mdx";
6
+ import {compile as mdxCompile} from "@mdx-js/mdx";
7
+
8
+ import {Reference} from "@xyd-js/uniform";
9
+ import {
10
+ compile as compileMarkdown,
11
+ referenceAST
12
+ } from "@xyd-js/uniform/markdown";
13
+
14
+ import todoAppUniform from "./todo-app.uniform.json";
15
+ import {MDXReference} from "../../utils/mdx.ts";
16
+
17
+ // since unist does not support heading level > 6, we need to normalize them
18
+ function normalizeCustomHeadings() {
19
+ return (tree: any) => {
20
+ visit(tree, 'paragraph', (node, index, parent) => {
21
+ const match = node.children[0] && node.children[0].value.match(/^(#+)\s+(.*)/);
22
+ if (match) {
23
+ const level = match[1].length;
24
+ const text = match[2];
25
+ if (level > 6) {
26
+ // Create a new heading node with depth 6
27
+ const headingNode = {
28
+ type: 'heading',
29
+ depth: level,
30
+ children: [{type: 'text', value: text}]
31
+ };
32
+ // Replace the paragraph node with the new heading node
33
+ //@ts-ignore
34
+ parent.children[index] = headingNode;
35
+ }
36
+ }
37
+ });
38
+ };
39
+ }
40
+
41
+ const codeHikeOptions = {
42
+ lineNumbers: true,
43
+ showCopyButton: true,
44
+ autoImport: true,
45
+ components: {code: "Code"},
46
+ // syntaxHighlighting: { // TODO: !!! FROM SETTINGS !!! wait for rr7 rsc ??
47
+ // theme: "github-dark",
48
+ // },
49
+ };
50
+
51
+ async function compile(content: string): Promise<string> {
52
+ const compiled = await mdxCompile(content, {
53
+ remarkPlugins: [normalizeCustomHeadings, [remarkCodeHike, codeHikeOptions]],
54
+ recmaPlugins: [
55
+ [recmaCodeHike, codeHikeOptions]
56
+ ],
57
+ outputFormat: 'function-body',
58
+ development: false,
59
+ });
60
+
61
+ return String(compiled)
62
+ }
63
+
64
+ // TODO: move below to content?
65
+ function getMDXComponent(code: string) {
66
+ const mdxExport = getMDXExport(code)
67
+ return mdxExport.default
68
+ }
69
+
70
+ function getMDXExport(code: string) {
71
+ const scope = {
72
+ Fragment: React.Fragment,
73
+ jsxs: React.createElement,
74
+ jsx: React.createElement,
75
+ jsxDEV: React.createElement,
76
+ }
77
+ const fn = new Function(...Object.keys(scope), code)
78
+ return fn(scope)
79
+ }
80
+
81
+ export async function uniformToReferences(): Promise<MDXReference<Reference[]> | []> {
82
+ let content: string = ""
83
+
84
+ for (const ref of todoAppUniform as Reference[]) {
85
+ const ast = referenceAST(ref)
86
+ const md = compileMarkdown(ast)
87
+
88
+ content += md + "\n"
89
+ }
90
+
91
+ const compiled = await compile(content)
92
+ const contentCode = getMDXComponent(compiled)
93
+
94
+ const parsedContent = contentCode ? parse(contentCode) : null
95
+
96
+ if (parsedContent) {
97
+ return parsedContent.references
98
+ }
99
+
100
+ return []
101
+ }
@@ -0,0 +1,29 @@
1
+ import React, {} from 'react';
2
+ import type {Meta} from '@storybook/react';
3
+ import {MemoryRouter} from "react-router";
4
+
5
+ import {ReactContent} from "@xyd-js/components/content";
6
+
7
+ import Content from "../../../__fixtures__/code-sample.mdx";
8
+
9
+ const reactContent = new ReactContent()
10
+ const contentComponents = reactContent.components()
11
+
12
+ export default {
13
+ title: 'Components/Coder/CodeSample',
14
+ decorators: [
15
+ (Story) => <MemoryRouter>
16
+ <Story/>
17
+ </MemoryRouter>
18
+ ]
19
+ } as Meta;
20
+
21
+ export const Default = async () => {
22
+ return <div style={{
23
+ padding: "100px",
24
+ paddingTop: "0px",
25
+ margin: "0 auto",
26
+ }}>
27
+ <Content components={contentComponents}/>
28
+ </div>
29
+ }
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+
4
+ import { PageBlogHome } from '@xyd-js/components/pages';
5
+
6
+ import { DocsTemplateDecorator } from '../../../decorators/DocsTemplate';
7
+
8
+ // storybook-root
9
+ const meta: Meta<typeof PageBlogHome> = {
10
+ title: 'Components/Pages/PageBlogHome',
11
+ component: PageBlogHome,
12
+ decorators: [
13
+ DocsTemplateDecorator({
14
+ toc: false
15
+ }),
16
+ (Story) => <>
17
+ <style dangerouslySetInnerHTML={{
18
+ __html: `
19
+ #storybook-root {
20
+ height: 100%;
21
+ }
22
+ `
23
+ }} />
24
+ <Story />
25
+ </>,
26
+ ],
27
+ parameters: {
28
+ docs: {
29
+ description: {
30
+ component: 'PageBlogHome component creates a blog home page with a list of blog posts.',
31
+ },
32
+ },
33
+ },
34
+ argTypes: {},
35
+ };
36
+
37
+ export default meta;
38
+ type Story = StoryObj<typeof PageBlogHome>;
39
+
40
+ export const Default: Story = {
41
+ render: () => (
42
+ <PageBlogHome
43
+ />
44
+ ),
45
+ parameters: {
46
+ docs: {
47
+ description: {
48
+ story: 'PageBlogHome component creates a blog home page with a list of blog posts.',
49
+ },
50
+ },
51
+ },
52
+ };
@@ -0,0 +1,124 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+
4
+ import { PageFirstSlide } from '@xyd-js/components/pages';
5
+ import { CodeSample } from '@xyd-js/components/coder';
6
+
7
+ import syntaxHighlight from '@xyd-js/components/coder/themes/classic';
8
+ import '@xyd-js/components/coder/themes/classic.css'
9
+
10
+ import { DocsTemplateDecorator } from '../../../decorators/DocsTemplate';
11
+
12
+ // storybook-root
13
+ const meta: Meta<typeof PageFirstSlide> = {
14
+ title: 'Components/Pages/PageFirstSlide',
15
+ component: PageFirstSlide,
16
+ decorators: [
17
+ DocsTemplateDecorator({
18
+ toc: false
19
+ }),
20
+ (Story) => <>
21
+ <style dangerouslySetInnerHTML={{
22
+ __html: `
23
+ #storybook-root {
24
+ height: 100%;
25
+ }
26
+ `
27
+ }} />
28
+ <Story />
29
+ </>,
30
+ ],
31
+ parameters: {
32
+ docs: {
33
+ description: {
34
+ component: 'PageFirstSlide component creates a two-column layout with headings and buttons on the left, and image/logo/codeblocks on the right. Perfect for landing pages, product introductions, and feature showcases.',
35
+ },
36
+ },
37
+ },
38
+ argTypes: {
39
+ content: {
40
+ description: 'Content configuration with title, description, and buttons',
41
+ control: 'object',
42
+ },
43
+ rightContent: {
44
+ description: 'Content for the right side (image, logo, code block, etc.)',
45
+ control: false,
46
+ },
47
+ },
48
+ };
49
+
50
+ export default meta;
51
+ type Story = StoryObj<typeof PageFirstSlide>;
52
+
53
+
54
+ const CODE_EXAMPLE = `
55
+ # Python SDK
56
+
57
+ @let(snippet = await snippets.py.getSettings())
58
+
59
+ Python \`Get Settings\` SDK snippet:
60
+
61
+ \`\`\`python [=mySnippet]
62
+ {snippet}
63
+ \`\`\`
64
+ @let(
65
+ .mySnippet.descHead="TIP"
66
+ .mySnippet.desc = (
67
+ Use our [Python SDK](https://sdk.example.com/py)
68
+ to **integrate** your API settings.
69
+
70
+ * Configure authentication and endpoints
71
+ * Handle responses and error cases
72
+ )
73
+ )
74
+
75
+ Get Settings reference:
76
+ @uniform({snippet})
77
+
78
+ `.trim()
79
+
80
+ // Basic PageFirstSlide with image
81
+ export const Default: Story = {
82
+ render: () => (
83
+ <PageFirstSlide
84
+ content={{
85
+ title: 'Xwrite - content framework designed for docs',
86
+ description: 'Xwrite is a modern content framework that helps you build beautiful, fast, and accessible documentation sites. Create stunning docs with ease using our comprehensive component library.',
87
+ primaryButton: {
88
+ title: 'Get Xwrite',
89
+ href: '/download',
90
+ kind: 'primary',
91
+ },
92
+ secondaryButton: {
93
+ title: 'View documentation',
94
+ href: '/docs',
95
+ kind: 'secondary',
96
+ },
97
+ }}
98
+ rightContent={
99
+ <CodeSample
100
+ lineNumbers={true}
101
+ size="full"
102
+ description="docs/python-sdk.md"
103
+ theme={syntaxHighlight || undefined}
104
+ descriptionHead='Code Example'
105
+ descriptionContent='This is a code example'
106
+ codeblocks={[
107
+ {
108
+ lang: "mdx",
109
+ meta: "md",
110
+ value: CODE_EXAMPLE
111
+ }
112
+ ]}
113
+ />
114
+ }
115
+ />
116
+ ),
117
+ parameters: {
118
+ docs: {
119
+ description: {
120
+ story: 'PageFirstSlide with Xwrite content, Python SDK code example, and matching footer.',
121
+ },
122
+ },
123
+ },
124
+ };
@@ -0,0 +1,127 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+ import { Rocket, Palette, Code, Zap, Star, HeartHandshake, GanttChart, Github, MessageCircle } from 'lucide-react';
4
+
5
+ import { PageHome } from '@xyd-js/components/pages';
6
+
7
+ const meta: Meta<typeof PageHome> = {
8
+ title: 'Components/Pages/PageHome',
9
+ component: PageHome,
10
+ parameters: {
11
+ docs: {
12
+ description: {
13
+ component: 'PageHome component creates a complete homepage layout with hero section, multiple content sections, and guide cards. Perfect for documentation sites, landing pages, and resource directories.',
14
+ },
15
+ },
16
+ },
17
+ argTypes: {
18
+ hero: {
19
+ description: 'Hero section configuration with title, description, image, and button',
20
+ control: 'object',
21
+ },
22
+ sections: {
23
+ description: 'Array of content sections with titles and guide cards',
24
+ control: 'object',
25
+ },
26
+ },
27
+ };
28
+
29
+ export default meta;
30
+ type Story = StoryObj<typeof PageHome>;
31
+
32
+ // Complete PageHome example
33
+ export const Default: Story = {
34
+ args: {
35
+ hero: {
36
+ title: 'Welcome to xyd by LiveSession',
37
+ description: 'The docs framework for future dev.',
38
+ image: '/logo.svg',
39
+ button: {
40
+ title: 'Get Started',
41
+ href: '/docs/guides/introduction',
42
+ },
43
+ },
44
+ sections: [
45
+ {
46
+ title: 'Explore the docs',
47
+ cards: [
48
+ {
49
+ title: 'Quickstart',
50
+ children: 'Start using xyd in minutes.',
51
+ kind: 'secondary',
52
+ icon: <Rocket size={24} />,
53
+ href: '/docs/guides/quickstart',
54
+ },
55
+ {
56
+ title: 'Theming',
57
+ children: 'Customize the appearance of your documentation.',
58
+ kind: 'secondary',
59
+ icon: <Palette size={24} />,
60
+ href: '/docs/guides/customization-quickstart',
61
+ },
62
+ {
63
+ title: 'API Reference',
64
+ children: 'Explore the complete API documentation and component library.',
65
+ kind: 'secondary',
66
+ icon: <Code size={24} />,
67
+ href: '/docs/reference',
68
+ },
69
+ ],
70
+ },
71
+ {
72
+ title: 'Resources',
73
+ cards: [
74
+ {
75
+ title: 'Examples',
76
+ children: 'Browse real-world examples and templates to kickstart your docs.',
77
+ kind: 'secondary',
78
+ icon: <Zap size={24} />,
79
+ href: 'https://github.com/xyd-js/examples',
80
+ },
81
+ {
82
+ title: 'Source Code',
83
+ children: 'View the open source codebase and contribute to the project.',
84
+ kind: 'secondary',
85
+ icon: <Github size={24} />,
86
+ href: 'https://github.com/livesession/xyd',
87
+ },
88
+ {
89
+ title: 'Awesome Docs',
90
+ children: 'Discover curated collection of documentation built with xyd.',
91
+ kind: 'secondary',
92
+ icon: <Star size={24} />,
93
+ href: 'https://github.com/livesession/awesomedocs',
94
+ },
95
+ {
96
+ title: 'Feedback',
97
+ children: 'Share your thoughts, report issues, and suggest improvements.',
98
+ kind: 'secondary',
99
+ icon: <HeartHandshake size={24} />,
100
+ href: 'https://github.com/livesession/xyd/discussions',
101
+ },
102
+ {
103
+ title: 'Slack',
104
+ children: 'Join our community and get help from other developers.',
105
+ kind: 'secondary',
106
+ icon: <MessageCircle size={24} />,
107
+ href: 'https://xyd-docs.slack.com',
108
+ },
109
+ {
110
+ title: 'Roadmap',
111
+ children: 'Track upcoming features and development progress.',
112
+ kind: 'secondary',
113
+ icon: <GanttChart size={24} />,
114
+ href: 'https://github.com/orgs/livesession/projects/4',
115
+ },
116
+ ],
117
+ },
118
+ ],
119
+ },
120
+ parameters: {
121
+ docs: {
122
+ description: {
123
+ story: 'Complete PageHome example with hero section and multiple content sections. This demonstrates all the key features including hero with image and button, organized sections with guide cards, and various link types.',
124
+ },
125
+ },
126
+ },
127
+ };
@@ -0,0 +1,126 @@
1
+ import React, { useRef } from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+
4
+ import * as htmlToImage from 'html-to-image';
5
+ import download from 'downloadjs';
6
+
7
+ import { Baseline } from '@xyd-js/components/system';
8
+
9
+ function ExportableWrapper({ children }: { children: React.ReactNode }) {
10
+ const containerRef = React.useRef<HTMLDivElement>(null);
11
+
12
+ const exportAsSvg = () => {
13
+ if (!containerRef.current) return;
14
+ htmlToImage
15
+ .toSvg(containerRef.current)
16
+ .then((dataUrl) => {
17
+ download(dataUrl, 'exported-component.svg', 'image/svg+xml');
18
+ })
19
+ .catch((err) => {
20
+ console.error('Failed to export as SVG:', err);
21
+ });
22
+ };
23
+
24
+ return (
25
+ <div>
26
+ <div ref={containerRef}>{children}</div>
27
+ <button onClick={exportAsSvg}>Download as SVG</button>
28
+ </div>
29
+ );
30
+ }
31
+
32
+ const meta: Meta<typeof Baseline> = {
33
+ title: 'Components/System/Baseline',
34
+ component: Baseline,
35
+ parameters: {
36
+ docs: {
37
+ description: {
38
+ component: 'Baseline component is used to display a baseline for the design system.',
39
+ },
40
+ },
41
+ },
42
+ argTypes: {},
43
+ };
44
+
45
+ export default meta;
46
+ type Story = StoryObj<typeof Baseline>;
47
+
48
+ export const Default: Story = {
49
+ args: {
50
+ title: 'Node.js Support',
51
+ toolGroups: [
52
+ [
53
+ { tool: 'bun', supported: true },
54
+ { tool: 'node', supported: true, label: '22' },
55
+ { tool: 'node', supported: true, label: '23' },
56
+ { tool: 'node', supported: true, label: '24' },
57
+ ],
58
+ [
59
+ { tool: 'npm', supported: true },
60
+ { tool: 'node', supported: true, label: '22' },
61
+ ],
62
+ [
63
+ { tool: 'pnpm', supported: false },
64
+ ],
65
+ ],
66
+ },
67
+ };
68
+
69
+ export const WithRefAndClick: Story = {
70
+ render: (args) => {
71
+ const ref = useRef<HTMLDetailsElement>(null);
72
+ return (
73
+ <Baseline
74
+ {...args}
75
+ ref={ref}
76
+ onClick={() => {
77
+ console.log('Baseline clicked!', ref.current);
78
+ }}
79
+ />
80
+ );
81
+ },
82
+ args: {
83
+ title: 'Node.js Support',
84
+ toolGroups: [
85
+ [
86
+ { tool: 'bun', supported: true },
87
+ { tool: 'node', supported: true, label: '22' },
88
+ { tool: 'node', supported: true, label: '23' },
89
+ { tool: 'node', supported: true, label: '24' },
90
+ ],
91
+ [
92
+ { tool: 'npm', supported: true },
93
+ { tool: 'node', supported: true, label: '22' },
94
+ ],
95
+ [
96
+ { tool: 'pnpm', supported: false },
97
+ ],
98
+ ],
99
+ },
100
+ };
101
+
102
+ export const ExportableBaseline: Story = {
103
+ render: (args) => (
104
+ <ExportableWrapper>
105
+ <Baseline {...args} />
106
+ </ExportableWrapper>
107
+ ),
108
+ args: {
109
+ title: 'Node.js Support',
110
+ toolGroups: [
111
+ [
112
+ { tool: 'bun', supported: true },
113
+ { tool: 'node', supported: true, label: '22' },
114
+ { tool: 'node', supported: true, label: '23' },
115
+ { tool: 'node', supported: true, label: '24' },
116
+ ],
117
+ [
118
+ { tool: 'npm', supported: true },
119
+ { tool: 'node', supported: true, label: '22' },
120
+ ],
121
+ [
122
+ { tool: 'pnpm', supported: false },
123
+ ],
124
+ ],
125
+ },
126
+ };
@@ -0,0 +1,132 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+ import { Badge } from '@xyd-js/components/writer';
4
+
5
+ const meta: Meta<typeof Badge> = {
6
+ title: 'Components/Writer/Badge',
7
+ component: Badge,
8
+ parameters: {
9
+ docs: {
10
+ description: {
11
+ component: 'Badge component is used to display small status indicators, labels, or tags.',
12
+ },
13
+ },
14
+ },
15
+ argTypes: {
16
+ children: {
17
+ description: 'The content to display inside the badge',
18
+ control: 'text',
19
+ },
20
+ size: {
21
+ description: 'The size of the badge',
22
+ control: { type: 'select' },
23
+ options: ['xs', 'sm'],
24
+ },
25
+ kind: {
26
+ description: 'The visual style variant of the badge',
27
+ control: { type: 'select' },
28
+ options: ['default', 'warning', 'info'],
29
+ },
30
+ className: {
31
+ description: 'Additional CSS classes to apply',
32
+ control: 'text',
33
+ },
34
+ },
35
+ };
36
+
37
+ export default meta;
38
+ type Story = StoryObj<typeof Badge>;
39
+
40
+ // Basic usage
41
+ export const Default: Story = {
42
+ args: {
43
+ children: 'Default Badge',
44
+ kind: 'default',
45
+ size: 'sm',
46
+ },
47
+ };
48
+
49
+ // Size variants
50
+ export const Small: Story = {
51
+ args: {
52
+ children: 'Small Badge',
53
+ size: 'sm',
54
+ kind: 'default',
55
+ },
56
+ };
57
+
58
+ export const ExtraSmall: Story = {
59
+ args: {
60
+ children: 'XS Badge',
61
+ size: 'xs',
62
+ kind: 'default',
63
+ },
64
+ };
65
+
66
+ // Kind variants
67
+ export const Warning: Story = {
68
+ args: {
69
+ children: 'Warning Badge',
70
+ kind: 'warning',
71
+ size: 'sm',
72
+ },
73
+ };
74
+
75
+ export const Info: Story = {
76
+ args: {
77
+ children: 'Info Badge',
78
+ kind: 'info',
79
+ size: 'sm',
80
+ },
81
+ };
82
+
83
+ // All variants showcase
84
+ export const AllVariants: Story = {
85
+ render: () => (
86
+ <div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}>
87
+ <Badge kind="default" size="sm">Default</Badge>
88
+ <Badge kind="warning" size="sm">Warning</Badge>
89
+ <Badge kind="info" size="sm">Info</Badge>
90
+ <Badge kind="default" size="xs">XS Default</Badge>
91
+ <Badge kind="warning" size="xs">XS Warning</Badge>
92
+ <Badge kind="info" size="xs">XS Info</Badge>
93
+ </div>
94
+ ),
95
+ };
96
+
97
+ // With custom content
98
+ export const WithIcons: Story = {
99
+ render: () => (
100
+ <div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center' }}>
101
+ <Badge kind="info" size="sm">
102
+ <span style={{ marginRight: '4px' }}>ℹ️</span>
103
+ Information
104
+ </Badge>
105
+ <Badge kind="warning" size="sm">
106
+ <span style={{ marginRight: '4px' }}>⚠️</span>
107
+ Warning
108
+ </Badge>
109
+ <Badge kind="default" size="sm">
110
+ <span style={{ marginRight: '4px' }}>🏷️</span>
111
+ Label
112
+ </Badge>
113
+ </div>
114
+ ),
115
+ };
116
+
117
+ // Interactive example
118
+ export const Interactive: Story = {
119
+ args: {
120
+ children: 'Click me!',
121
+ kind: 'default',
122
+ size: 'sm',
123
+ },
124
+ parameters: {
125
+ docs: {
126
+ description: {
127
+ story: 'This badge can be used in interactive contexts. You can add onClick handlers or other event listeners.',
128
+ },
129
+ },
130
+ },
131
+ };
132
+