@roadlittledawn/docs-design-system-react 0.4.0 → 0.6.0

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.
@@ -25,6 +25,13 @@ export var Basic = {
25
25
  title: 'Click to expand',
26
26
  children: (_jsx("p", { children: "This content is hidden by default and can be revealed by clicking the title. It includes smooth height animations for a better user experience." })),
27
27
  },
28
+ parameters: {
29
+ docs: {
30
+ source: {
31
+ code: "<Collapser title=\"Click to expand\">\n <p>\n This content is hidden by default and can be revealed by clicking the title.\n It includes smooth height animations for a better user experience.\n </p>\n</Collapser>",
32
+ },
33
+ },
34
+ },
28
35
  };
29
36
  /**
30
37
  * Collapser that starts in the open state.
@@ -35,6 +42,13 @@ export var DefaultOpen = {
35
42
  defaultOpen: true,
36
43
  children: (_jsx("p", { children: "This collapser is open by default. Users can still click to collapse it." })),
37
44
  },
45
+ parameters: {
46
+ docs: {
47
+ source: {
48
+ code: "<Collapser title=\"This section starts open\" defaultOpen>\n <p>This collapser is open by default. Users can still click to collapse it.</p>\n</Collapser>",
49
+ },
50
+ },
51
+ },
38
52
  };
39
53
  /**
40
54
  * Collapser with an ID for the title.
@@ -45,6 +59,13 @@ export var WithID = {
45
59
  id: 'faq-question-1',
46
60
  children: (_jsx("p", { children: "This collapser has an ID on its title, which is useful for anchor links and accessibility purposes." })),
47
61
  },
62
+ parameters: {
63
+ docs: {
64
+ source: {
65
+ code: "<Collapser title=\"Section with ID\" id=\"faq-question-1\">\n <p>\n This collapser has an ID on its title, which is useful for anchor links\n and accessibility purposes.\n </p>\n</Collapser>",
66
+ },
67
+ },
68
+ },
48
69
  };
49
70
  /**
50
71
  * Collapser containing complex content.
@@ -54,10 +75,24 @@ export var ComplexContent = {
54
75
  title: 'How do I install the components?',
55
76
  children: (_jsxs("div", { children: [_jsx("p", { children: "You can install the components using npm:" }), _jsx("pre", { style: { background: '#f5f5f5', padding: '1rem', borderRadius: '4px' }, children: "npm install @docs-design-system/ui" }), _jsx("p", { children: "Then import them in your React application:" }), _jsx("pre", { style: { background: '#f5f5f5', padding: '1rem', borderRadius: '4px' }, children: "import { Button, Card } from '@docs-design-system/ui';" })] })),
56
77
  },
78
+ parameters: {
79
+ docs: {
80
+ source: {
81
+ code: "<Collapser title=\"How do I install the components?\">\n <div>\n <p>You can install the components using npm:</p>\n <pre>npm install @docs-design-system/ui</pre>\n <p>Then import them in your React application:</p>\n <pre>import {'{ Button, Card }'} from '@docs-design-system/ui';</pre>\n </div>\n</Collapser>",
82
+ },
83
+ },
84
+ },
57
85
  };
58
86
  /**
59
87
  * Multiple collapsers in a FAQ-style layout using CollapserGroup.
60
88
  */
61
89
  export var FAQExample = {
90
+ parameters: {
91
+ docs: {
92
+ source: {
93
+ code: "<CollapserGroup>\n <Collapser title=\"What is this documentation system?\">\n <p>\n This is a comprehensive documentation design system that provides\n reusable components and guidelines for creating effective technical\n documentation.\n </p>\n </Collapser>\n <Collapser title=\"How do I get started?\">\n <p>\n Start by installing the component package, then explore the components\n in Storybook to understand their usage and configuration options.\n </p>\n </Collapser>\n <Collapser title=\"Can I customize the components?\">\n <p>\n Yes! All components accept a className prop for custom styling, and you\n can override the default styles using CSS.\n </p>\n </Collapser>\n <Collapser title=\"Is this accessible?\">\n <p>\n Accessibility is a core principle. All components follow WAI-ARIA best\n practices and are keyboard navigable.\n </p>\n </Collapser>\n</CollapserGroup>",
94
+ },
95
+ },
96
+ },
62
97
  render: function () { return (_jsxs(CollapserGroup, { children: [_jsx(Collapser, { title: "What is this documentation system?", children: _jsx("p", { children: "This is a comprehensive documentation design system that provides reusable components and guidelines for creating effective technical documentation." }) }), _jsx(Collapser, { title: "How do I get started?", children: _jsx("p", { children: "Start by installing the component package, then explore the components in Storybook to understand their usage and configuration options." }) }), _jsx(Collapser, { title: "Can I customize the components?", children: _jsx("p", { children: "Yes! All components accept a className prop for custom styling, and you can override the default styles using CSS." }) }), _jsx(Collapser, { title: "Is this accessible?", children: _jsx("p", { children: "Accessibility is a core principle. All components follow WAI-ARIA best practices and are keyboard navigable." }) })] })); },
63
98
  };
@@ -37,6 +37,13 @@ export var Basic = {
37
37
  spacing: '0.5rem',
38
38
  allowMultiple: true,
39
39
  },
40
+ parameters: {
41
+ docs: {
42
+ source: {
43
+ code: "<CollapserGroup spacing=\"0.5rem\" allowMultiple>\n <Collapser title=\"What is this documentation system?\">\n <p>\n This is a comprehensive documentation design system that provides\n reusable components and guidelines for creating effective technical\n documentation.\n </p>\n </Collapser>\n <Collapser title=\"How do I get started?\">\n <p>\n Start by installing the component package, then explore the components\n in Storybook to understand their usage and configuration options.\n </p>\n </Collapser>\n <Collapser title=\"Can I customize the components?\">\n <p>\n Yes! All components accept a className prop for custom styling, and you\n can override the default styles using CSS.\n </p>\n </Collapser>\n</CollapserGroup>",
44
+ },
45
+ },
46
+ },
40
47
  render: function (args) { return (_jsxs(CollapserGroup, __assign({}, args, { children: [_jsx(Collapser, { title: "What is this documentation system?", children: _jsx("p", { children: "This is a comprehensive documentation design system that provides reusable components and guidelines for creating effective technical documentation." }) }), _jsx(Collapser, { title: "How do I get started?", children: _jsx("p", { children: "Start by installing the component package, then explore the components in Storybook to understand their usage and configuration options." }) }), _jsx(Collapser, { title: "Can I customize the components?", children: _jsx("p", { children: "Yes! All components accept a className prop for custom styling, and you can override the default styles using CSS." }) })] }))); },
41
48
  };
42
49
  /**
@@ -46,6 +53,13 @@ export var AccordionMode = {
46
53
  args: {
47
54
  allowMultiple: false,
48
55
  },
56
+ parameters: {
57
+ docs: {
58
+ source: {
59
+ code: "<CollapserGroup allowMultiple={false}>\n <Collapser title=\"Installation\">\n <p>Install the package using npm or yarn:</p>\n <pre>npm install @roadlittledawn/docs-design-system</pre>\n </Collapser>\n <Collapser title=\"Configuration\">\n <p>Import the CSS and components in your application:</p>\n <pre>import '@roadlittledawn/docs-design-system/dist/styles.css';</pre>\n </Collapser>\n <Collapser title=\"Usage\">\n <p>Use the components in your React application:</p>\n <pre>{'<Button variant=\"primary\">Click me</Button>'}</pre>\n </Collapser>\n</CollapserGroup>",
60
+ },
61
+ },
62
+ },
49
63
  render: function (args) { return (_jsxs(CollapserGroup, __assign({}, args, { children: [_jsxs(Collapser, { title: "Installation", children: [_jsx("p", { children: "Install the package using npm or yarn:" }), _jsx("pre", { children: "npm install @roadlittledawn/docs-design-system" })] }), _jsxs(Collapser, { title: "Configuration", children: [_jsx("p", { children: "Import the CSS and components in your application:" }), _jsx("pre", { children: "import '@roadlittledawn/docs-design-system/dist/styles.css';" })] }), _jsxs(Collapser, { title: "Usage", children: [_jsx("p", { children: "Use the components in your React application:" }), _jsx("pre", { children: '<Button variant="primary">Click me</Button>' })] })] }))); },
50
64
  };
51
65
  /**
@@ -55,6 +69,13 @@ export var CustomSpacing = {
55
69
  args: {
56
70
  spacing: '1.5rem',
57
71
  },
72
+ parameters: {
73
+ docs: {
74
+ source: {
75
+ code: "<CollapserGroup spacing=\"1.5rem\">\n <Collapser title=\"Section 1\">\n <p>Content with larger spacing between sections.</p>\n </Collapser>\n <Collapser title=\"Section 2\">\n <p>This makes the layout more breathable.</p>\n </Collapser>\n <Collapser title=\"Section 3\">\n <p>Useful for prominent content sections.</p>\n </Collapser>\n</CollapserGroup>",
76
+ },
77
+ },
78
+ },
58
79
  render: function (args) { return (_jsxs(CollapserGroup, __assign({}, args, { children: [_jsx(Collapser, { title: "Section 1", children: _jsx("p", { children: "Content with larger spacing between sections." }) }), _jsx(Collapser, { title: "Section 2", children: _jsx("p", { children: "This makes the layout more breathable." }) }), _jsx(Collapser, { title: "Section 3", children: _jsx("p", { children: "Useful for prominent content sections." }) })] }))); },
59
80
  };
60
81
  /**
@@ -64,6 +85,13 @@ export var DefaultOpen = {
64
85
  args: {
65
86
  defaultOpen: 0,
66
87
  },
88
+ parameters: {
89
+ docs: {
90
+ source: {
91
+ code: "<CollapserGroup defaultOpen={0}>\n <Collapser title=\"Getting Started\">\n <p>This section is open by default.</p>\n </Collapser>\n <Collapser title=\"Advanced Topics\">\n <p>This section starts closed.</p>\n </Collapser>\n <Collapser title=\"API Reference\">\n <p>This section also starts closed.</p>\n </Collapser>\n</CollapserGroup>",
92
+ },
93
+ },
94
+ },
67
95
  render: function (args) { return (_jsxs(CollapserGroup, __assign({}, args, { children: [_jsx(Collapser, { title: "Getting Started", children: _jsx("p", { children: "This section is open by default." }) }), _jsx(Collapser, { title: "Advanced Topics", children: _jsx("p", { children: "This section starts closed." }) }), _jsx(Collapser, { title: "API Reference", children: _jsx("p", { children: "This section also starts closed." }) })] }))); },
68
96
  };
69
97
  /**
@@ -73,5 +101,12 @@ export var MultipleDefaultOpen = {
73
101
  args: {
74
102
  defaultOpen: [0, 2],
75
103
  },
104
+ parameters: {
105
+ docs: {
106
+ source: {
107
+ code: "<CollapserGroup defaultOpen={[0, 2]}>\n <Collapser title=\"Introduction\">\n <p>This section is open by default.</p>\n </Collapser>\n <Collapser title=\"Installation\">\n <p>This section starts closed.</p>\n </Collapser>\n <Collapser title=\"Quick Start\">\n <p>This section is also open by default.</p>\n </Collapser>\n</CollapserGroup>",
108
+ },
109
+ },
110
+ },
76
111
  render: function (args) { return (_jsxs(CollapserGroup, __assign({}, args, { children: [_jsx(Collapser, { title: "Introduction", children: _jsx("p", { children: "This section is open by default." }) }), _jsx(Collapser, { title: "Installation", children: _jsx("p", { children: "This section starts closed." }) }), _jsx(Collapser, { title: "Quick Start", children: _jsx("p", { children: "This section is also open by default." }) })] }))); },
77
112
  };
@@ -24,6 +24,13 @@ export var Level1 = {
24
24
  level: 1,
25
25
  children: 'Page Title (H1)',
26
26
  },
27
+ parameters: {
28
+ docs: {
29
+ source: {
30
+ code: "<Heading level={1}>Page Title (H1)</Heading>",
31
+ },
32
+ },
33
+ },
27
34
  };
28
35
  /**
29
36
  * Level 2 heading (h2) - used for major sections.
@@ -33,6 +40,13 @@ export var Level2 = {
33
40
  level: 2,
34
41
  children: 'Section Title (H2)',
35
42
  },
43
+ parameters: {
44
+ docs: {
45
+ source: {
46
+ code: "<Heading level={2}>Section Title (H2)</Heading>",
47
+ },
48
+ },
49
+ },
36
50
  };
37
51
  /**
38
52
  * Level 3 heading (h3) - used for subsections.
@@ -42,6 +56,13 @@ export var Level3 = {
42
56
  level: 3,
43
57
  children: 'Subsection Title (H3)',
44
58
  },
59
+ parameters: {
60
+ docs: {
61
+ source: {
62
+ code: "<Heading level={3}>Subsection Title (H3)</Heading>",
63
+ },
64
+ },
65
+ },
45
66
  };
46
67
  /**
47
68
  * Level 4 heading (h4) - used for sub-subsections.
@@ -51,16 +72,37 @@ export var Level4 = {
51
72
  level: 4,
52
73
  children: 'Sub-subsection Title (H4)',
53
74
  },
75
+ parameters: {
76
+ docs: {
77
+ source: {
78
+ code: "<Heading level={4}>Sub-subsection Title (H4)</Heading>",
79
+ },
80
+ },
81
+ },
54
82
  };
55
83
  /**
56
84
  * All heading levels displayed together to show the hierarchy.
57
85
  */
58
86
  export var AllLevels = {
87
+ parameters: {
88
+ docs: {
89
+ source: {
90
+ code: "<div>\n <Heading level={1}>Level 1 - Main Page Title</Heading>\n <p>Use h1 for the main page title. There should only be one h1 per page.</p>\n\n <Heading level={2}>Level 2 - Major Section</Heading>\n <p>Use h2 for major sections of your page.</p>\n\n <Heading level={3}>Level 3 - Subsection</Heading>\n <p>Use h3 for subsections within major sections.</p>\n\n <Heading level={4}>Level 4 - Sub-subsection</Heading>\n <p>Use h4 for sub-subsections. If you need deeper levels, reconsider your document structure.</p>\n</div>",
91
+ },
92
+ },
93
+ },
59
94
  render: function () { return (_jsxs("div", { children: [_jsx(Heading, { level: 1, children: "Level 1 - Main Page Title" }), _jsx("p", { style: { marginBottom: '1rem', color: '#666' }, children: "Use h1 for the main page title. There should only be one h1 per page." }), _jsx(Heading, { level: 2, children: "Level 2 - Major Section" }), _jsx("p", { style: { marginBottom: '1rem', color: '#666' }, children: "Use h2 for major sections of your page." }), _jsx(Heading, { level: 3, children: "Level 3 - Subsection" }), _jsx("p", { style: { marginBottom: '1rem', color: '#666' }, children: "Use h3 for subsections within major sections." }), _jsx(Heading, { level: 4, children: "Level 4 - Sub-subsection" }), _jsx("p", { style: { color: '#666' }, children: "Use h4 for sub-subsections. If you need deeper levels, reconsider your document structure." })] })); },
60
95
  };
61
96
  /**
62
97
  * Example of a properly structured document hierarchy.
63
98
  */
64
99
  export var DocumentStructure = {
100
+ parameters: {
101
+ docs: {
102
+ source: {
103
+ code: "<div>\n <Heading level={1}>Getting Started Guide</Heading>\n <p>Introduction to the documentation system...</p>\n\n <Heading level={2}>Installation</Heading>\n <p>How to install the components...</p>\n\n <Heading level={3}>Prerequisites</Heading>\n <p>What you need before installing...</p>\n\n <Heading level={3}>Installation Steps</Heading>\n <p>Step-by-step installation instructions...</p>\n\n <Heading level={2}>Configuration</Heading>\n <p>How to configure the system...</p>\n\n <Heading level={3}>Basic Configuration</Heading>\n <p>Essential configuration options...</p>\n\n <Heading level={4}>Environment Variables</Heading>\n <p>Required environment variables...</p>\n</div>",
104
+ },
105
+ },
106
+ },
65
107
  render: function () { return (_jsxs("div", { children: [_jsx(Heading, { level: 1, children: "Getting Started Guide" }), _jsx("p", { children: "Introduction to the documentation system..." }), _jsx(Heading, { level: 2, children: "Installation" }), _jsx("p", { children: "How to install the components..." }), _jsx(Heading, { level: 3, children: "Prerequisites" }), _jsx("p", { children: "What you need before installing..." }), _jsx(Heading, { level: 3, children: "Installation Steps" }), _jsx("p", { children: "Step-by-step installation instructions..." }), _jsx(Heading, { level: 2, children: "Configuration" }), _jsx("p", { children: "How to configure the system..." }), _jsx(Heading, { level: 3, children: "Basic Configuration" }), _jsx("p", { children: "Essential configuration options..." }), _jsx(Heading, { level: 4, children: "Environment Variables" }), _jsx("p", { children: "Required environment variables..." })] })); },
66
108
  };
@@ -24,6 +24,13 @@ export var Internal = {
24
24
  href: '/docs/components',
25
25
  children: 'View Components Documentation',
26
26
  },
27
+ parameters: {
28
+ docs: {
29
+ source: {
30
+ code: "<Link href=\"/docs/components\">View Components Documentation</Link>",
31
+ },
32
+ },
33
+ },
27
34
  };
28
35
  /**
29
36
  * External link (absolute URL) - opens in new tab with icon.
@@ -33,6 +40,13 @@ export var External = {
33
40
  href: 'https://github.com/your-repo/docs-design-system',
34
41
  children: 'View on GitHub',
35
42
  },
43
+ parameters: {
44
+ docs: {
45
+ source: {
46
+ code: "<Link href=\"https://github.com/your-repo/docs-design-system\">View on GitHub</Link>",
47
+ },
48
+ },
49
+ },
36
50
  };
37
51
  /**
38
52
  * Anchor link to a section on the same page.
@@ -42,22 +56,50 @@ export var AnchorLink = {
42
56
  href: '#installation',
43
57
  children: 'Jump to Installation',
44
58
  },
59
+ parameters: {
60
+ docs: {
61
+ source: {
62
+ code: "<Link href=\"#installation\">Jump to Installation</Link>",
63
+ },
64
+ },
65
+ },
45
66
  };
46
67
  /**
47
68
  * Link within body text.
48
69
  */
49
70
  export var InlineLink = {
71
+ parameters: {
72
+ docs: {
73
+ source: {
74
+ code: "<p>\n For more information, check out the{' '}\n <Link href=\"/docs/getting-started\">Getting Started guide</Link>\n {' '}or visit our{' '}\n <Link href=\"https://github.com\">GitHub repository</Link>.\n</p>",
75
+ },
76
+ },
77
+ },
50
78
  render: function () { return (_jsxs("p", { children: ["For more information, check out the", ' ', _jsx(Link, { href: "/docs/getting-started", children: "Getting Started guide" }), ' ', "or visit our", ' ', _jsx(Link, { href: "https://github.com", children: "GitHub repository" }), "."] })); },
51
79
  };
52
80
  /**
53
81
  * Multiple links in a list.
54
82
  */
55
83
  export var LinkList = {
84
+ parameters: {
85
+ docs: {
86
+ source: {
87
+ code: "<ul style={{ listStyle: 'none', padding: 0, display: 'flex', flexDirection: 'column', gap: '0.5rem' }}>\n <li><Link href=\"/docs/introduction\">Introduction</Link></li>\n <li><Link href=\"/docs/components\">Components</Link></li>\n <li><Link href=\"/docs/best-practices\">Best Practices</Link></li>\n <li><Link href=\"https://github.com\">GitHub</Link></li>\n <li><Link href=\"https://npmjs.com\">NPM</Link></li>\n</ul>",
88
+ },
89
+ },
90
+ },
56
91
  render: function () { return (_jsxs("ul", { style: { listStyle: 'none', padding: 0, display: 'flex', flexDirection: 'column', gap: '0.5rem' }, children: [_jsx("li", { children: _jsx(Link, { href: "/docs/introduction", children: "Introduction" }) }), _jsx("li", { children: _jsx(Link, { href: "/docs/components", children: "Components" }) }), _jsx("li", { children: _jsx(Link, { href: "/docs/best-practices", children: "Best Practices" }) }), _jsx("li", { children: _jsx(Link, { href: "https://github.com", children: "GitHub" }) }), _jsx("li", { children: _jsx(Link, { href: "https://npmjs.com", children: "NPM" }) })] })); },
57
92
  };
58
93
  /**
59
94
  * Comparison of internal and external links.
60
95
  */
61
96
  export var InternalVsExternal = {
97
+ parameters: {
98
+ docs: {
99
+ source: {
100
+ code: "<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>\n <div>\n <strong>Internal Link:</strong>\n <br />\n <Link href=\"/docs/components\">Components (internal)</Link>\n <p style={{ fontSize: '0.875rem', color: '#666', marginTop: '0.5rem' }}>\n Opens in the same tab, no icon\n </p>\n </div>\n <div>\n <strong>External Link:</strong>\n <br />\n <Link href=\"https://example.com\">Example.com (external)</Link>\n <p style={{ fontSize: '0.875rem', color: '#666', marginTop: '0.5rem' }}>\n Opens in new tab, includes external link icon\n </p>\n </div>\n</div>",
101
+ },
102
+ },
103
+ },
62
104
  render: function () { return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '1rem' }, children: [_jsxs("div", { children: [_jsx("strong", { children: "Internal Link:" }), _jsx("br", {}), _jsx(Link, { href: "/docs/components", children: "Components (internal)" }), _jsx("p", { style: { fontSize: '0.875rem', color: '#666', marginTop: '0.5rem' }, children: "Opens in the same tab, no icon" })] }), _jsxs("div", { children: [_jsx("strong", { children: "External Link:" }), _jsx("br", {}), _jsx(Link, { href: "https://example.com", children: "Example.com (external)" }), _jsx("p", { style: { fontSize: '0.875rem', color: '#666', marginTop: '0.5rem' }, children: "Opens in new tab, includes external link icon" })] })] })); },
63
105
  };
@@ -0,0 +1,26 @@
1
+ import { ReactNode, FC } from "react";
2
+ export interface ListProps {
3
+ /** List items */
4
+ children: ReactNode;
5
+ /** Additional CSS classes */
6
+ className?: string;
7
+ /** Whether the list is ordered (numbered) or unordered (bullets). Default: true */
8
+ ordered?: boolean;
9
+ /** Custom bullet character for unordered lists (emoji or text). Only applies when ordered=false */
10
+ bullet?: string;
11
+ /** Custom bullet icon (React node, e.g., SVG) for unordered lists. Takes precedence over bullet prop */
12
+ bulletIcon?: ReactNode;
13
+ }
14
+ interface ListItemProps {
15
+ /** List item content */
16
+ children: ReactNode;
17
+ /** Additional CSS classes */
18
+ className?: string;
19
+ /** Internal: bullet icon injected by List parent for unordered lists */
20
+ bulletIcon?: ReactNode;
21
+ }
22
+ export declare function ListItem({ children, className, bulletIcon }: ListItemProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare const List: FC<ListProps> & {
24
+ Item: typeof ListItem;
25
+ };
26
+ export {};
@@ -0,0 +1,36 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import React from "react";
14
+ function ListImpl(_a) {
15
+ var children = _a.children, _b = _a.className, className = _b === void 0 ? "" : _b, _c = _a.ordered, ordered = _c === void 0 ? true : _c, bullet = _a.bullet, bulletIcon = _a.bulletIcon;
16
+ var listClasses = ["dds-list", className].filter(Boolean).join(" ");
17
+ var Element = ordered ? "ol" : "ul";
18
+ return (_jsx(Element, { className: listClasses, "data-ordered": ordered, "data-has-icon": !!bulletIcon && !ordered, style: bullet && !bulletIcon
19
+ ? { "--dds-list-bullet": JSON.stringify(bullet) }
20
+ : undefined, children: bulletIcon && !ordered
21
+ ? React.Children.map(children, function (child) {
22
+ if (React.isValidElement(child) && child.type === ListItem) {
23
+ return React.cloneElement(child, __assign(__assign({}, child.props), { bulletIcon: bulletIcon }));
24
+ }
25
+ return child;
26
+ })
27
+ : children }));
28
+ }
29
+ export function ListItem(_a) {
30
+ var children = _a.children, _b = _a.className, className = _b === void 0 ? "" : _b, bulletIcon = _a.bulletIcon;
31
+ var itemClasses = ["dds-list-item", className].filter(Boolean).join(" ");
32
+ return (_jsxs("li", { className: itemClasses, children: [bulletIcon && (_jsx("span", { className: "dds-list-item-icon", "aria-hidden": "true", children: bulletIcon })), children] }));
33
+ }
34
+ export var List = Object.assign(ListImpl, {
35
+ Item: ListItem,
36
+ });
@@ -0,0 +1,28 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ declare const meta: {
3
+ title: string;
4
+ component: import("react").FC<import("./List").ListProps> & {
5
+ Item: typeof import("./List").ListItem;
6
+ };
7
+ parameters: {
8
+ layout: string;
9
+ docs: {
10
+ description: {
11
+ component: string;
12
+ };
13
+ };
14
+ };
15
+ tags: string[];
16
+ };
17
+ export default meta;
18
+ type Story = StoryObj<typeof meta>;
19
+ /** Default list with multi-line content and code examples */
20
+ export declare const OrderedList: Story;
21
+ /** List with nested components like CodeBlock and Callout */
22
+ export declare const OrderedListWithNestedComponents: Story;
23
+ /** Unordered list with default bullet */
24
+ export declare const Unordered: Story;
25
+ /** Unordered list with custom emoji bullet */
26
+ export declare const UnorderedWithEmoji: Story;
27
+ /** Unordered list with custom icon bullet */
28
+ export declare const UnorderedWithIcon: Story;
@@ -0,0 +1,88 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { List } from "./List";
3
+ import { CodeBlock } from "./CodeBlock";
4
+ import { Callout } from "./Callout";
5
+ var meta = {
6
+ title: "Components/List",
7
+ component: List,
8
+ parameters: {
9
+ layout: "padded",
10
+ docs: {
11
+ description: {
12
+ component: "A visually enhanced list component with numbered badges (ordered) or custom bullets (unordered) and connector lines, designed for complex content that deserves more visual prominence.\n\n## When to Use\n- Tutorial or getting started guides with substantial steps\n- Multi-step workflows where each step contains rich content (paragraphs, code blocks, callouts)\n- Marketing or landing pages that need more visual polish\n- Complex instructions where each step is its own section of content\n- Feature lists or benefits that need custom emoji/icon bullets\n- When you want to nest other components (CodeBlock, Callout, etc.) within list items\n\n## When Not to Use\n- Simple, short lists with brief text items (use standard `<ol>` or `<ul>` instead)\n- Very long lists with many items (consider breaking into sections with Tabs or Collapsers)\n- When visual simplicity is preferred over aesthetic enhancement\n\n## Accessibility\n- Uses semantic `<ol>` or `<ul>` elements for proper screen reader support\n- CSS counters and custom bullets provide visual styling without affecting content\n- Maintains proper reading order and list semantics\n ",
13
+ },
14
+ },
15
+ },
16
+ tags: ["autodocs"],
17
+ };
18
+ export default meta;
19
+ /** Default list with multi-line content and code examples */
20
+ export var OrderedList = {
21
+ args: {
22
+ children: null,
23
+ },
24
+ render: function () { return (_jsxs(List, { children: [_jsxs(List.Item, { children: ["Run the following command in your terminal to start the install wizard:", _jsx("code", { style: { display: "block", marginTop: "0.5rem" }, children: "npm create astro@latest" })] }), _jsxs(List.Item, { children: ["Now that your project has been created, you can ", _jsx("code", { children: "cd" }), " into your new project directory to begin using Astro."] }), _jsx(List.Item, { children: "If you skipped the \"Install dependencies?\" step during the CLI wizard, then be sure to install your dependencies before continuing." }), _jsx(List.Item, { children: "You can now start the Astro dev server and see a live preview of your project while you build!" })] })); },
25
+ parameters: {
26
+ docs: {
27
+ source: {
28
+ code: "<List>\n <List.Item>\n Run the following command in your terminal to start the install wizard:\n <code style={{ display: \"block\", marginTop: \"0.5rem\" }}>\n npm create astro@latest\n </code>\n </List.Item>\n <List.Item>\n Now that your project has been created, you can <code>cd</code> into\n your new project directory to begin using Astro.\n </List.Item>\n <List.Item>\n If you skipped the \"Install dependencies?\" step during the CLI wizard,\n then be sure to install your dependencies before continuing.\n </List.Item>\n <List.Item>\n You can now start the Astro dev server and see a live preview of your\n project while you build!\n </List.Item>\n</List>",
29
+ },
30
+ },
31
+ },
32
+ };
33
+ /** List with nested components like CodeBlock and Callout */
34
+ export var OrderedListWithNestedComponents = {
35
+ args: {
36
+ children: null,
37
+ },
38
+ render: function () { return (_jsxs(List, { children: [_jsxs(List.Item, { children: [_jsx("p", { children: _jsx("b", { children: "Install dependencies" }) }), _jsx("p", { style: { color: "var(--dds-list-text)" }, children: "Run the following command to install all required packages:" }), _jsx(CodeBlock, { language: "bash", code: "npm install" })] }), _jsxs(List.Item, { children: [_jsx("strong", { children: "Configure your project" }), _jsx(Callout, { variant: "tip", title: "Pro Tip", children: "Make sure to review the configuration file before proceeding." })] }), _jsxs(List.Item, { children: [_jsx("p", { children: _jsx("b", { children: "Start development" }) }), _jsx("p", { style: { color: "var(--dds-list-text)" }, children: "Launch the dev server and begin building:" }), _jsx(CodeBlock, { language: "bash", code: "npm run dev" })] })] })); },
39
+ parameters: {
40
+ docs: {
41
+ source: {
42
+ code: "<List>\n <List.Item>\n <strong>Install dependencies</strong>\n <p>Run the following command to install all required packages:</p>\n <CodeBlock language=\"bash\" code=\"npm install\" />\n </List.Item>\n <List.Item>\n <strong>Configure your project</strong>\n <Callout variant=\"tip\" title=\"Pro Tip\">\n Make sure to review the configuration file before proceeding.\n </Callout>\n </List.Item>\n <List.Item>\n <strong>Start development</strong>\n <p>Launch the dev server and begin building:</p>\n <CodeBlock language=\"bash\" code=\"npm run dev\" />\n </List.Item>\n</List>",
43
+ },
44
+ },
45
+ },
46
+ };
47
+ /** Unordered list with default bullet */
48
+ export var Unordered = {
49
+ args: {
50
+ children: null,
51
+ },
52
+ render: function () { return (_jsxs(List, { ordered: false, children: [_jsx(List.Item, { children: "Key feature of the product" }), _jsx(List.Item, { children: "Another important capability" }), _jsx(List.Item, { children: "Additional benefit to highlight" })] })); },
53
+ parameters: {
54
+ docs: {
55
+ source: {
56
+ code: "<List ordered={false}>\n <List.Item>Key feature of the product</List.Item>\n <List.Item>Another important capability</List.Item>\n <List.Item>Additional benefit to highlight</List.Item>\n</List>",
57
+ },
58
+ },
59
+ },
60
+ };
61
+ /** Unordered list with custom emoji bullet */
62
+ export var UnorderedWithEmoji = {
63
+ args: {
64
+ children: null,
65
+ },
66
+ render: function () { return (_jsxs(List, { ordered: false, bullet: "\u2705", children: [_jsx(List.Item, { children: "Beautifully designed components" }), _jsx(List.Item, { children: "Accessible by default" }), _jsx(List.Item, { children: "Fully customizable styling" })] })); },
67
+ parameters: {
68
+ docs: {
69
+ source: {
70
+ code: "<List ordered={false} bullet=\"\u2705\">\n <List.Item>Beautifully designed components</List.Item>\n <List.Item>Accessible by default</List.Item>\n <List.Item>Fully customizable styling</List.Item>\n</List>",
71
+ },
72
+ },
73
+ },
74
+ };
75
+ /** Unordered list with custom icon bullet */
76
+ export var UnorderedWithIcon = {
77
+ args: {
78
+ children: null,
79
+ },
80
+ render: function () { return (_jsxs(List, { ordered: false, bulletIcon: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: _jsx("path", { d: "M5 12h14M12 5l7 7-7 7" }) }), children: [_jsx(List.Item, { children: "Navigate to the settings page" }), _jsx(List.Item, { children: "Select your preferences" }), _jsx(List.Item, { children: "Save your changes" })] })); },
81
+ parameters: {
82
+ docs: {
83
+ source: {
84
+ code: "<List\n ordered={false}\n bulletIcon={\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\">\n <path d=\"M5 12h14M12 5l7 7-7 7\" />\n </svg>\n }\n>\n <List.Item>Navigate to the settings page</List.Item>\n <List.Item>Select your preferences</List.Item>\n <List.Item>Save your changes</List.Item>\n</List>",
85
+ },
86
+ },
87
+ },
88
+ };
@@ -0,0 +1,64 @@
1
+ import { ReactNode } from "react";
2
+ export interface GlossaryData {
3
+ /** The canonical term (used for semantic markup) */
4
+ term: string;
5
+ /** Display title shown in the popover header */
6
+ title: string;
7
+ /**
8
+ * Definition content. Accepts ReactNode so consumers can pre-render
9
+ * markdown (e.g. via react-markdown) or pass arbitrary JSX.
10
+ */
11
+ definition: ReactNode;
12
+ }
13
+ export interface PreviewData {
14
+ /** Page or article title */
15
+ title: string;
16
+ /** Short excerpt or summary */
17
+ excerpt?: ReactNode;
18
+ /** Optional featured image URL */
19
+ imageUrl?: string;
20
+ /** Optional URL to the full content */
21
+ href?: string;
22
+ /** Link text. Default: "Read more" */
23
+ linkText?: string;
24
+ }
25
+ export type PopoverPlacement = "auto" | "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end";
26
+ export type PopoverSize = "sm" | "md" | "lg";
27
+ export interface PopoverProps {
28
+ /**
29
+ * Arbitrary React content to render inside the popover.
30
+ * Use when built-in templates don't fit your use case.
31
+ */
32
+ content?: ReactNode;
33
+ /** Render a styled glossary definition popover */
34
+ glossary?: GlossaryData;
35
+ /** Render a styled content preview popover (Wikipedia-style) */
36
+ preview?: PreviewData;
37
+ /**
38
+ * Preferred placement relative to the trigger.
39
+ * "auto" detects available viewport space.
40
+ * @default "auto"
41
+ */
42
+ placement?: PopoverPlacement;
43
+ /**
44
+ * Popover width.
45
+ * sm = 240px, md = 320px, lg = 480px
46
+ * @default "md"
47
+ */
48
+ size?: PopoverSize;
49
+ /**
50
+ * Milliseconds to wait before showing the popover on hover.
51
+ * @default 200
52
+ */
53
+ showDelay?: number;
54
+ /**
55
+ * Milliseconds to wait before hiding the popover on hover-out.
56
+ * @default 150
57
+ */
58
+ hideDelay?: number;
59
+ /** The trigger element — the text or content that reveals the popover on hover/tap */
60
+ children: ReactNode;
61
+ /** Additional CSS classes on the trigger wrapper */
62
+ className?: string;
63
+ }
64
+ export declare function Popover({ content, glossary, preview, placement, size, showDelay, hideDelay, children, className, }: PopoverProps): import("react/jsx-runtime").JSX.Element;