@roadlittledawn/docs-design-system-react 0.6.1 → 0.7.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.
- package/dist/components/Button.stories.js +28 -0
- package/dist/components/Callout.stories.js +21 -0
- package/dist/components/Card.stories.js +31 -0
- package/dist/components/CardGrid.d.ts +7 -1
- package/dist/components/CardGrid.js +7 -2
- package/dist/components/CardGrid.stories.d.ts +11 -0
- package/dist/components/CardGrid.stories.js +59 -0
- package/dist/components/CodeBlock.stories.d.ts +2 -2
- package/dist/components/CodeBlock.stories.js +88 -57
- package/dist/components/Collapser.d.ts +20 -3
- package/dist/components/Collapser.js +10 -6
- package/dist/components/Collapser.stories.d.ts +33 -0
- package/dist/components/Collapser.stories.js +146 -2
- package/dist/components/CollapserGroup.d.ts +6 -0
- package/dist/components/CollapserGroup.js +4 -4
- package/dist/components/CollapserGroup.stories.d.ts +7 -0
- package/dist/components/CollapserGroup.stories.js +58 -0
- package/dist/components/Heading.stories.js +20 -0
- package/dist/components/Link.stories.js +15 -0
- package/dist/components/List.stories.d.ts +32 -0
- package/dist/components/List.stories.js +24 -0
- package/dist/components/Popover.stories.js +45 -0
- package/dist/components/Tabs.stories.js +23 -0
- package/dist/components/Typography.stories.js +17 -0
- package/dist/styles.css +33 -1
- package/package.json +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Collapser } from './Collapser';
|
|
3
3
|
import { CollapserGroup } from './CollapserGroup';
|
|
4
|
+
// Spoofed icon components for demonstration purposes
|
|
5
|
+
// (replace with your own Icon component when available)
|
|
6
|
+
var IconBook = function () { return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M4 19.5A2.5 2.5 0 0 1 6.5 17H20" }), _jsx("path", { d: "M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z" })] })); };
|
|
7
|
+
var IconBolt = function () { return (_jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("polyline", { points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2" }) })); };
|
|
8
|
+
var IconStar = function () { return (_jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) })); };
|
|
9
|
+
var IconSettings = function () { return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: "12", cy: "12", r: "3" }), _jsx("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" })] })); };
|
|
4
10
|
/**
|
|
5
11
|
* The Collapser component creates expandable/collapsible content sections with smooth animations.
|
|
6
12
|
*/
|
|
@@ -8,10 +14,48 @@ var meta = {
|
|
|
8
14
|
title: 'Components/Collapser',
|
|
9
15
|
component: Collapser,
|
|
10
16
|
tags: ['autodocs'],
|
|
17
|
+
argTypes: {
|
|
18
|
+
title: {
|
|
19
|
+
control: 'text',
|
|
20
|
+
description: 'Title text displayed in the collapsible header.',
|
|
21
|
+
},
|
|
22
|
+
id: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Optional ID for the title element, useful for anchor links.',
|
|
25
|
+
},
|
|
26
|
+
defaultOpen: {
|
|
27
|
+
control: 'boolean',
|
|
28
|
+
description: 'Whether the collapser should be open by default (uncontrolled mode).',
|
|
29
|
+
table: { defaultValue: { summary: 'false' } },
|
|
30
|
+
},
|
|
31
|
+
align: {
|
|
32
|
+
control: 'radio',
|
|
33
|
+
options: ['left', 'right'],
|
|
34
|
+
description: "Alignment of the title within the header. Use 'right' for right-aligned titles, typically paired with an icon on the left.",
|
|
35
|
+
table: { defaultValue: { summary: 'left' } },
|
|
36
|
+
},
|
|
37
|
+
icon: {
|
|
38
|
+
control: false,
|
|
39
|
+
description: 'Optional icon or React element rendered on the left side of the header, before the title text.',
|
|
40
|
+
},
|
|
41
|
+
stepNumber: {
|
|
42
|
+
control: 'number',
|
|
43
|
+
description: 'Numeric step label shown on the far left. Auto-injected by `CollapserGroup` when `numbered` is true. Colour controlled via `--dds-collapser-step-number-color`.',
|
|
44
|
+
},
|
|
45
|
+
children: {
|
|
46
|
+
control: false,
|
|
47
|
+
description: 'Content to show/hide when toggling.',
|
|
48
|
+
},
|
|
49
|
+
className: {
|
|
50
|
+
control: 'text',
|
|
51
|
+
description: 'Additional CSS classes.',
|
|
52
|
+
table: { defaultValue: { summary: '""' } },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
11
55
|
parameters: {
|
|
12
56
|
docs: {
|
|
13
57
|
description: {
|
|
14
|
-
component: "\nThe Collapser component allows users to show and hide content sections to reduce visual clutter.\n\n## When to Use\n\n- For FAQ sections where answers can be toggled\n- To hide advanced options or detailed information\n- For progressive disclosure of content\n- When you have lengthy content that doesn't need to be visible all the time\n\n## When Not to Use\n\n- For primary navigation (use proper navigation components)\n- For critical information that should always be visible\n- When most users will need to expand all sections (just show the content)\n\n## Accessibility\n\n- Uses proper ARIA attributes (aria-expanded)\n- Keyboard accessible with Enter and Space keys\n- Supports additional keyboard shortcuts: 's' or 'f' to show, 'h' to hide\n- Screen reader friendly\n\n## Keyboard Shortcuts\n\n- **s** or **f**: Show/expand the content\n- **h**: Hide/collapse the content\n- **Enter** or **Space**: Toggle expand/collapse\n ",
|
|
58
|
+
component: "\nThe Collapser component allows users to show and hide content sections to reduce visual clutter.\n\n## When to Use\n\n- For FAQ sections where answers can be toggled\n- To hide advanced options or detailed information\n- For progressive disclosure of content\n- When you have lengthy content that doesn't need to be visible all the time\n\n## When Not to Use\n\n- For primary navigation (use proper navigation components)\n- For critical information that should always be visible\n- When most users will need to expand all sections (just show the content)\n\n## Accessibility\n\n- Uses proper ARIA attributes (aria-expanded)\n- Keyboard accessible with Enter and Space keys\n- Supports additional keyboard shortcuts: 's' or 'f' to show, 'h' to hide\n- Screen reader friendly\n- Icons passed via the `icon` prop should be wrapped in a container with `aria-hidden=\"true\"` since the title provides the accessible label\n\n## Keyboard Shortcuts\n\n- **s** or **f**: Show/expand the content\n- **h**: Hide/collapse the content\n- **Enter** or **Space**: Toggle expand/collapse\n\n## Customising Step Numbers\n\nOverride the CSS custom property to change the step number colour:\n\n```css\n.my-steps {\n --dds-collapser-step-number-color: #7c3aed;\n}\n```\n ",
|
|
15
59
|
},
|
|
16
60
|
},
|
|
17
61
|
},
|
|
@@ -67,6 +111,63 @@ export var WithID = {
|
|
|
67
111
|
},
|
|
68
112
|
},
|
|
69
113
|
};
|
|
114
|
+
/**
|
|
115
|
+
* Collapser with an icon rendered on the left side of the header.
|
|
116
|
+
* The icon prop accepts any React element — use your own icon component or SVG.
|
|
117
|
+
*/
|
|
118
|
+
export var WithIcon = {
|
|
119
|
+
args: {
|
|
120
|
+
title: 'Documentation guides',
|
|
121
|
+
icon: _jsx(IconBook, {}),
|
|
122
|
+
children: (_jsxs("p", { style: { color: 'var(--dds-collapser-text)' }, children: ["Icons help users quickly identify sections at a glance. Pass any React element to the ", _jsx("code", { children: "icon" }), " prop to display it on the left side of the header."] })),
|
|
123
|
+
},
|
|
124
|
+
parameters: {
|
|
125
|
+
docs: {
|
|
126
|
+
source: {
|
|
127
|
+
code: "<Collapser title=\"Documentation guides\" icon={<IconBook />}>\n <p>\n Icons help users quickly identify sections at a glance. Pass any React\n element to the icon prop to display it on the left side of the header.\n </p>\n</Collapser>",
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Collapser with the title right-aligned within the header.
|
|
134
|
+
* Use this for design layouts where the title should appear on the right
|
|
135
|
+
* and content (such as a step number or icon) anchors the left.
|
|
136
|
+
*/
|
|
137
|
+
export var RightAligned = {
|
|
138
|
+
args: {
|
|
139
|
+
title: 'Right-aligned title',
|
|
140
|
+
align: 'right',
|
|
141
|
+
children: (_jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "The title is right-aligned in the header, with the chevron remaining on the far right. Long titles will wrap to a new line on small screens rather than colliding with other elements." })),
|
|
142
|
+
},
|
|
143
|
+
parameters: {
|
|
144
|
+
docs: {
|
|
145
|
+
source: {
|
|
146
|
+
code: "<Collapser title=\"Right-aligned title\" align=\"right\">\n <p>\n The title is right-aligned in the header, with the chevron remaining on\n the far right.\n </p>\n</Collapser>",
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Collapser with both an icon and right-aligned title — matching the
|
|
153
|
+
* reference screenshot layout where an icon anchors the left and the
|
|
154
|
+
* title text flows to the right before the chevron.
|
|
155
|
+
*/
|
|
156
|
+
export var WithIconRightAligned = {
|
|
157
|
+
args: {
|
|
158
|
+
title: 'Quick start guide',
|
|
159
|
+
align: 'right',
|
|
160
|
+
icon: _jsx(IconBolt, {}),
|
|
161
|
+
children: (_jsxs("p", { style: { color: 'var(--dds-collapser-text)' }, children: ["Combining ", _jsx("code", { children: "icon" }), " and ", _jsx("code", { children: "align=\"right\"" }), " produces a layout where the icon anchors the left edge, the title flows to the right, and the chevron stays at the far right."] })),
|
|
162
|
+
},
|
|
163
|
+
parameters: {
|
|
164
|
+
docs: {
|
|
165
|
+
source: {
|
|
166
|
+
code: "<Collapser title=\"Quick start guide\" align=\"right\" icon={<IconBolt />}>\n <p>\n Combining icon and align=\"right\" produces a layout where the icon anchors\n the left edge, the title flows to the right, and the chevron stays at the far right.\n </p>\n</Collapser>",
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
};
|
|
70
171
|
/**
|
|
71
172
|
* Collapser containing complex content.
|
|
72
173
|
*/
|
|
@@ -83,6 +184,20 @@ export var ComplexContent = {
|
|
|
83
184
|
},
|
|
84
185
|
},
|
|
85
186
|
};
|
|
187
|
+
/**
|
|
188
|
+
* Shows all four header layout variants side-by-side for visual comparison:
|
|
189
|
+
* default left-aligned, left-aligned with icon, right-aligned, and right-aligned with icon.
|
|
190
|
+
*/
|
|
191
|
+
export var AllVariants = {
|
|
192
|
+
parameters: {
|
|
193
|
+
docs: {
|
|
194
|
+
source: {
|
|
195
|
+
code: "{/* Left-aligned (default) */}\n<Collapser title=\"Left-aligned (default)\">\n <p>The standard layout \u2014 title on the left, chevron on the right.</p>\n</Collapser>\n\n{/* Left-aligned with icon */}\n<Collapser title=\"Left-aligned with icon\" icon={<IconBook />}>\n <p>An icon appears to the left of the title.</p>\n</Collapser>\n\n{/* Right-aligned */}\n<Collapser title=\"Right-aligned title\" align=\"right\">\n <p>Title text flows to the right. Chevron stays at the far right.</p>\n</Collapser>\n\n{/* Right-aligned with icon */}\n<Collapser title=\"Right-aligned with icon\" align=\"right\" icon={<IconBolt />}>\n <p>Icon anchors the left, title flows right, chevron at the far right.</p>\n</Collapser>",
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
render: function () { return (_jsxs("div", { children: [_jsx(Collapser, { title: "Left-aligned (default)", children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "The standard layout \u2014 title on the left, chevron on the right." }) }), _jsx(Collapser, { title: "Left-aligned with icon", icon: _jsx(IconBook, {}), children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "An icon appears to the left of the title." }) }), _jsx(Collapser, { title: "Right-aligned title", align: "right", children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "Title text flows to the right. Chevron stays at the far right." }) }), _jsx(Collapser, { title: "Right-aligned with icon", align: "right", icon: _jsx(IconBolt, {}), children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "Icon anchors the left, title flows right, chevron at the far right." }) })] })); },
|
|
200
|
+
};
|
|
86
201
|
/**
|
|
87
202
|
* Multiple collapsers in a FAQ-style layout using CollapserGroup.
|
|
88
203
|
*/
|
|
@@ -94,5 +209,34 @@ export var FAQExample = {
|
|
|
94
209
|
},
|
|
95
210
|
},
|
|
96
211
|
},
|
|
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." }) })] })); },
|
|
212
|
+
render: function () { return (_jsxs(CollapserGroup, { children: [_jsx(Collapser, { title: "What is this documentation system?", children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, 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", { style: { color: 'var(--dds-collapser-text)' }, 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", { style: { color: 'var(--dds-collapser-text)' }, 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", { style: { color: 'var(--dds-collapser-text)' }, children: "Accessibility is a core principle. All components follow WAI-ARIA best practices and are keyboard navigable." }) })] })); },
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Example matching the reference screenshot: collapsers in a group where each
|
|
216
|
+
* has a distinct icon on the left and right-aligned title text.
|
|
217
|
+
*/
|
|
218
|
+
export var IconGroupExample = {
|
|
219
|
+
parameters: {
|
|
220
|
+
docs: {
|
|
221
|
+
source: {
|
|
222
|
+
code: "<CollapserGroup>\n <Collapser title=\"Getting started\" align=\"right\" icon={<IconBook />}>\n <p>Learn the basics and set up your environment.</p>\n </Collapser>\n <Collapser title=\"Quick actions\" align=\"right\" icon={<IconBolt />}>\n <p>Discover shortcuts and power-user features.</p>\n </Collapser>\n <Collapser title=\"Highlights\" align=\"right\" icon={<IconStar />}>\n <p>See what makes this system stand out.</p>\n </Collapser>\n <Collapser title=\"Configuration\" align=\"right\" icon={<IconSettings />}>\n <p>Customise the system to fit your workflow.</p>\n </Collapser>\n</CollapserGroup>",
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
render: function () { return (_jsxs(CollapserGroup, { children: [_jsx(Collapser, { title: "Getting started", align: "right", icon: _jsx(IconBook, {}), children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "Learn the basics and set up your environment." }) }), _jsx(Collapser, { title: "Quick actions", align: "right", icon: _jsx(IconBolt, {}), children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "Discover shortcuts and power-user features." }) }), _jsx(Collapser, { title: "Highlights", align: "right", icon: _jsx(IconStar, {}), children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "See what makes this system stand out." }) }), _jsx(Collapser, { title: "Configuration", align: "right", icon: _jsx(IconSettings, {}), children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "Customise the system to fit your workflow." }) })] })); },
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* CollapserGroup with `numbered` auto-numbers each entry.
|
|
230
|
+
* Matches the reference screenshot pattern: step number + icon on the left,
|
|
231
|
+
* title right-aligned, chevron on the far right.
|
|
232
|
+
*/
|
|
233
|
+
export var NumberedGroup = {
|
|
234
|
+
parameters: {
|
|
235
|
+
docs: {
|
|
236
|
+
source: {
|
|
237
|
+
code: "{/* numbered=true on CollapserGroup auto-injects stepNumber into each child */}\n<CollapserGroup numbered>\n <Collapser title=\"Decrease pain\" align=\"right\" icon={<IconBolt />}>\n <p>Step numbers are injected automatically by CollapserGroup.</p>\n </Collapser>\n <Collapser title=\"Align your workflow\" align=\"right\" icon={<IconBook />}>\n <p>Combine numbered with icons and right-aligned titles.</p>\n </Collapser>\n <Collapser title=\"Learn to move\" align=\"right\" icon={<IconStar />}>\n <p>Each entry gets a sequential step number on the far left.</p>\n </Collapser>\n <Collapser title=\"Configuration\" align=\"right\" icon={<IconSettings />}>\n <p>Customise the system to fit your workflow.</p>\n </Collapser>\n</CollapserGroup>",
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
render: function () { return (_jsxs(CollapserGroup, { numbered: true, children: [_jsx(Collapser, { title: "Decrease pain", align: "right", icon: _jsx(IconBolt, {}), children: _jsxs("p", { style: { color: 'var(--dds-collapser-text)' }, children: ["Step numbers are injected automatically by CollapserGroup when", ' ', _jsx("code", { children: "numbered" }), " is true."] }) }), _jsx(Collapser, { title: "Align your workflow", align: "right", icon: _jsx(IconBook, {}), children: _jsxs("p", { style: { color: 'var(--dds-collapser-text)' }, children: ["Combine ", _jsx("code", { children: "numbered" }), " with icons and right-aligned titles for a clean annotated-list layout."] }) }), _jsx(Collapser, { title: "Learn to move", align: "right", icon: _jsx(IconStar, {}), children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "Each entry gets a sequential step number on the far left." }) }), _jsx(Collapser, { title: "Configuration", align: "right", icon: _jsx(IconSettings, {}), children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "Customise the system to fit your workflow." }) })] })); },
|
|
98
242
|
};
|
|
@@ -11,5 +11,11 @@ export interface CollapserGroupProps {
|
|
|
11
11
|
onChange?: (openIndexes: number[]) => void;
|
|
12
12
|
/** Additional CSS classes */
|
|
13
13
|
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Automatically prefix each collapser header with a sequential step number (1, 2, 3…).
|
|
16
|
+
* The number is injected via the `stepNumber` prop on each `Collapser` child.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
numbered?: boolean;
|
|
14
20
|
}
|
|
15
21
|
export declare const CollapserGroup: React.FC<CollapserGroupProps>;
|
|
@@ -23,12 +23,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
23
23
|
import { useState, Children, cloneElement, isValidElement } from 'react';
|
|
24
24
|
import { Collapser } from './Collapser';
|
|
25
25
|
export var CollapserGroup = function (_a) {
|
|
26
|
-
var children = _a.children, _b = _a.spacing, spacing = _b === void 0 ? '0.5rem' : _b, _c = _a.allowMultiple, allowMultiple = _c === void 0 ? true : _c, defaultOpen = _a.defaultOpen, onChange = _a.onChange, _d = _a.className, className = _d === void 0 ? '' : _d;
|
|
27
|
-
var
|
|
26
|
+
var children = _a.children, _b = _a.spacing, spacing = _b === void 0 ? '0.5rem' : _b, _c = _a.allowMultiple, allowMultiple = _c === void 0 ? true : _c, defaultOpen = _a.defaultOpen, onChange = _a.onChange, _d = _a.className, className = _d === void 0 ? '' : _d, _e = _a.numbered, numbered = _e === void 0 ? false : _e;
|
|
27
|
+
var _f = useState(function () {
|
|
28
28
|
if (defaultOpen === undefined)
|
|
29
29
|
return [];
|
|
30
30
|
return Array.isArray(defaultOpen) ? defaultOpen : [defaultOpen];
|
|
31
|
-
}), openIndexes =
|
|
31
|
+
}), openIndexes = _f[0], setOpenIndexes = _f[1];
|
|
32
32
|
var handleToggle = function (index) {
|
|
33
33
|
setOpenIndexes(function (prev) {
|
|
34
34
|
var next;
|
|
@@ -49,7 +49,7 @@ export var CollapserGroup = function (_a) {
|
|
|
49
49
|
return child;
|
|
50
50
|
// Only inject props if child is a Collapser component
|
|
51
51
|
if (child.type === Collapser) {
|
|
52
|
-
return cloneElement(child, __assign(__assign({}, child.props), { open: openIndexes.includes(index), onToggle: function () { return handleToggle(index); } }));
|
|
52
|
+
return cloneElement(child, __assign(__assign(__assign({}, child.props), { open: openIndexes.includes(index), onToggle: function () { return handleToggle(index); } }), (numbered ? { stepNumber: index + 1 } : {})));
|
|
53
53
|
}
|
|
54
54
|
return child;
|
|
55
55
|
}) }));
|
|
@@ -27,3 +27,10 @@ export declare const DefaultOpen: Story;
|
|
|
27
27
|
* Multiple collapsers open by default.
|
|
28
28
|
*/
|
|
29
29
|
export declare const MultipleDefaultOpen: Story;
|
|
30
|
+
/**
|
|
31
|
+
* Setting `numbered` on CollapserGroup automatically prefixes each collapser header
|
|
32
|
+
* with a sequential step number (1., 2., …), closely matching the reference screenshot
|
|
33
|
+
* with number + icon on the left and right-aligned title text.
|
|
34
|
+
* Customise the number colour with `--dds-collapser-step-number-color`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const NumberedGroup: Story;
|
|
@@ -12,6 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { CollapserGroup } from './CollapserGroup';
|
|
14
14
|
import { Collapser } from './Collapser';
|
|
15
|
+
// Spoofed icons for the NumberedGroup story (replace with your Icon component when available)
|
|
16
|
+
var IconBolt = function () { return (_jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("polyline", { points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2" }) })); };
|
|
17
|
+
var IconBook = function () { return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M4 19.5A2.5 2.5 0 0 1 6.5 17H20" }), _jsx("path", { d: "M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z" })] })); };
|
|
18
|
+
var IconStar = function () { return (_jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) })); };
|
|
19
|
+
var IconSettings = function () { return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: "12", cy: "12", r: "3" }), _jsx("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" })] })); };
|
|
15
20
|
/**
|
|
16
21
|
* CollapserGroup manages multiple Collapser components with consistent spacing
|
|
17
22
|
* and optional accordion behavior.
|
|
@@ -20,6 +25,40 @@ var meta = {
|
|
|
20
25
|
title: 'Components/CollapserGroup',
|
|
21
26
|
component: CollapserGroup,
|
|
22
27
|
tags: ['autodocs'],
|
|
28
|
+
argTypes: {
|
|
29
|
+
spacing: {
|
|
30
|
+
control: 'text',
|
|
31
|
+
description: 'CSS gap value between collapser items.',
|
|
32
|
+
table: { defaultValue: { summary: "'0.5rem'" } },
|
|
33
|
+
},
|
|
34
|
+
allowMultiple: {
|
|
35
|
+
control: 'boolean',
|
|
36
|
+
description: 'When true, multiple collapsers can be open simultaneously. When false, opening one closes the others (accordion mode).',
|
|
37
|
+
table: { defaultValue: { summary: 'true' } },
|
|
38
|
+
},
|
|
39
|
+
defaultOpen: {
|
|
40
|
+
control: 'text',
|
|
41
|
+
description: 'Index or array of indexes of collapsers that should be open by default. E.g. `0` or `[0, 2]`.',
|
|
42
|
+
},
|
|
43
|
+
onChange: {
|
|
44
|
+
control: false,
|
|
45
|
+
description: 'Callback fired when the open state changes. Receives an array of currently open indexes.',
|
|
46
|
+
},
|
|
47
|
+
children: {
|
|
48
|
+
control: false,
|
|
49
|
+
description: 'Collapser components to render inside the group.',
|
|
50
|
+
},
|
|
51
|
+
className: {
|
|
52
|
+
control: 'text',
|
|
53
|
+
description: 'Additional CSS classes.',
|
|
54
|
+
table: { defaultValue: { summary: '""' } },
|
|
55
|
+
},
|
|
56
|
+
numbered: {
|
|
57
|
+
control: 'boolean',
|
|
58
|
+
description: 'Automatically prefix each collapser header with a sequential step number (1, 2, 3…). Pairs well with `icon` and `align="right"` on child collapsers.',
|
|
59
|
+
table: { defaultValue: { summary: 'false' } },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
23
62
|
parameters: {
|
|
24
63
|
docs: {
|
|
25
64
|
description: {
|
|
@@ -110,3 +149,22 @@ export var MultipleDefaultOpen = {
|
|
|
110
149
|
},
|
|
111
150
|
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." }) })] }))); },
|
|
112
151
|
};
|
|
152
|
+
/**
|
|
153
|
+
* Setting `numbered` on CollapserGroup automatically prefixes each collapser header
|
|
154
|
+
* with a sequential step number (1., 2., …), closely matching the reference screenshot
|
|
155
|
+
* with number + icon on the left and right-aligned title text.
|
|
156
|
+
* Customise the number colour with `--dds-collapser-step-number-color`.
|
|
157
|
+
*/
|
|
158
|
+
export var NumberedGroup = {
|
|
159
|
+
args: {
|
|
160
|
+
numbered: true,
|
|
161
|
+
},
|
|
162
|
+
parameters: {
|
|
163
|
+
docs: {
|
|
164
|
+
source: {
|
|
165
|
+
code: "<CollapserGroup numbered>\n <Collapser title=\"Decrease pain\" align=\"right\" icon={<IconBolt />}>\n <p>Step numbers are injected automatically \u2014 no extra props needed on each item.</p>\n </Collapser>\n <Collapser title=\"Align your workflow\" align=\"right\" icon={<IconBook />}>\n <p>Combine numbered with icons and right-aligned titles.</p>\n </Collapser>\n <Collapser title=\"Learn to move\" align=\"right\" icon={<IconStar />}>\n <p>Each entry gets a sequential step number on the far left.</p>\n </Collapser>\n <Collapser title=\"Build strength\" align=\"right\" icon={<IconSettings />}>\n <p>Customise the number colour with --dds-collapser-step-number-color.</p>\n </Collapser>\n</CollapserGroup>",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
render: function (args) { return (_jsxs(CollapserGroup, __assign({}, args, { children: [_jsx(Collapser, { title: "Decrease pain", align: "right", icon: _jsx(IconBolt, {}), children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "Step numbers are injected automatically \u2014 no extra props needed on each item." }) }), _jsx(Collapser, { title: "Align your workflow", align: "right", icon: _jsx(IconBook, {}), children: _jsxs("p", { style: { color: 'var(--dds-collapser-text)' }, children: ["Combine ", _jsx("code", { children: "numbered" }), " with icons and right-aligned titles for a clean annotated-list layout."] }) }), _jsx(Collapser, { title: "Learn to move", align: "right", icon: _jsx(IconStar, {}), children: _jsx("p", { style: { color: 'var(--dds-collapser-text)' }, children: "Each entry gets a sequential step number on the far left." }) }), _jsx(Collapser, { title: "Build strength", align: "right", icon: _jsx(IconSettings, {}), children: _jsxs("p", { style: { color: 'var(--dds-collapser-text)' }, children: ["Customise the number colour with ", _jsx("code", { children: "--dds-collapser-step-number-color" }), "."] }) })] }))); },
|
|
170
|
+
};
|
|
@@ -7,6 +7,26 @@ var meta = {
|
|
|
7
7
|
title: 'Components/Heading',
|
|
8
8
|
component: Heading,
|
|
9
9
|
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
level: {
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
options: [1, 2, 3, 4],
|
|
14
|
+
description: 'Heading level — renders as `<h1>` through `<h4>`.',
|
|
15
|
+
},
|
|
16
|
+
id: {
|
|
17
|
+
control: 'text',
|
|
18
|
+
description: 'Override the auto-generated `id` attribute. By default the `id` is derived from the heading text.',
|
|
19
|
+
},
|
|
20
|
+
children: {
|
|
21
|
+
control: 'text',
|
|
22
|
+
description: 'Heading content.',
|
|
23
|
+
},
|
|
24
|
+
className: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
description: 'Additional CSS classes.',
|
|
27
|
+
table: { defaultValue: { summary: '""' } },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
10
30
|
parameters: {
|
|
11
31
|
docs: {
|
|
12
32
|
description: {
|
|
@@ -7,6 +7,21 @@ var meta = {
|
|
|
7
7
|
title: 'Components/Link',
|
|
8
8
|
component: Link,
|
|
9
9
|
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
href: {
|
|
12
|
+
control: 'text',
|
|
13
|
+
description: 'Link destination. URLs starting with `http://` or `https://` are treated as external and open in a new tab.',
|
|
14
|
+
},
|
|
15
|
+
children: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
description: 'Link content.',
|
|
18
|
+
},
|
|
19
|
+
className: {
|
|
20
|
+
control: 'text',
|
|
21
|
+
description: 'Additional CSS classes.',
|
|
22
|
+
table: { defaultValue: { summary: '""' } },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
10
25
|
parameters: {
|
|
11
26
|
docs: {
|
|
12
27
|
description: {
|
|
@@ -4,6 +4,38 @@ declare const meta: {
|
|
|
4
4
|
component: import("react").FC<import("./List").ListProps> & {
|
|
5
5
|
Item: typeof import("./List").ListItem;
|
|
6
6
|
};
|
|
7
|
+
argTypes: {
|
|
8
|
+
ordered: {
|
|
9
|
+
control: "boolean";
|
|
10
|
+
description: string;
|
|
11
|
+
table: {
|
|
12
|
+
defaultValue: {
|
|
13
|
+
summary: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
bullet: {
|
|
18
|
+
control: "text";
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
bulletIcon: {
|
|
22
|
+
control: false;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
children: {
|
|
26
|
+
control: false;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
className: {
|
|
30
|
+
control: "text";
|
|
31
|
+
description: string;
|
|
32
|
+
table: {
|
|
33
|
+
defaultValue: {
|
|
34
|
+
summary: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
7
39
|
parameters: {
|
|
8
40
|
layout: string;
|
|
9
41
|
docs: {
|
|
@@ -5,6 +5,30 @@ import { Callout } from "./Callout";
|
|
|
5
5
|
var meta = {
|
|
6
6
|
title: "Components/List",
|
|
7
7
|
component: List,
|
|
8
|
+
argTypes: {
|
|
9
|
+
ordered: {
|
|
10
|
+
control: 'boolean',
|
|
11
|
+
description: 'When true renders an ordered (numbered) list. When false renders an unordered (bullet) list.',
|
|
12
|
+
table: { defaultValue: { summary: 'true' } },
|
|
13
|
+
},
|
|
14
|
+
bullet: {
|
|
15
|
+
control: 'text',
|
|
16
|
+
description: 'Custom bullet character for unordered lists (e.g. an emoji like `"✅"`). Only applies when `ordered` is false. Ignored when `bulletIcon` is provided.',
|
|
17
|
+
},
|
|
18
|
+
bulletIcon: {
|
|
19
|
+
control: false,
|
|
20
|
+
description: 'Custom bullet icon as a React node (e.g. an SVG). Takes precedence over `bullet`. Only applies when `ordered` is false.',
|
|
21
|
+
},
|
|
22
|
+
children: {
|
|
23
|
+
control: false,
|
|
24
|
+
description: '`List.Item` components to render.',
|
|
25
|
+
},
|
|
26
|
+
className: {
|
|
27
|
+
control: 'text',
|
|
28
|
+
description: 'Additional CSS classes.',
|
|
29
|
+
table: { defaultValue: { summary: '""' } },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
8
32
|
parameters: {
|
|
9
33
|
layout: "padded",
|
|
10
34
|
docs: {
|
|
@@ -15,6 +15,51 @@ var meta = {
|
|
|
15
15
|
title: "Components/Popover",
|
|
16
16
|
component: Popover,
|
|
17
17
|
tags: ["autodocs"],
|
|
18
|
+
argTypes: {
|
|
19
|
+
content: {
|
|
20
|
+
control: false,
|
|
21
|
+
description: 'Arbitrary React content rendered inside the popover. Use when the built-in `glossary` or `preview` templates do not fit your use case.',
|
|
22
|
+
},
|
|
23
|
+
glossary: {
|
|
24
|
+
control: false,
|
|
25
|
+
description: 'Renders a styled glossary definition popover. Accepts `{ term, title, definition }` where `definition` is a `ReactNode`.',
|
|
26
|
+
},
|
|
27
|
+
preview: {
|
|
28
|
+
control: false,
|
|
29
|
+
description: 'Renders a Wikipedia-style content preview. Accepts `{ title, excerpt?, imageUrl?, href?, linkText? }`.',
|
|
30
|
+
},
|
|
31
|
+
placement: {
|
|
32
|
+
control: { type: 'select' },
|
|
33
|
+
options: ['auto', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end'],
|
|
34
|
+
description: 'Preferred placement relative to the trigger. `"auto"` detects available viewport space.',
|
|
35
|
+
table: { defaultValue: { summary: "'auto'" } },
|
|
36
|
+
},
|
|
37
|
+
size: {
|
|
38
|
+
control: { type: 'select' },
|
|
39
|
+
options: ['sm', 'md', 'lg'],
|
|
40
|
+
description: 'Popover width. `sm` = 240px, `md` = 320px, `lg` = 480px.',
|
|
41
|
+
table: { defaultValue: { summary: "'md'" } },
|
|
42
|
+
},
|
|
43
|
+
showDelay: {
|
|
44
|
+
control: 'number',
|
|
45
|
+
description: 'Milliseconds to wait before showing the popover on hover.',
|
|
46
|
+
table: { defaultValue: { summary: '200' } },
|
|
47
|
+
},
|
|
48
|
+
hideDelay: {
|
|
49
|
+
control: 'number',
|
|
50
|
+
description: 'Milliseconds to wait before hiding the popover on hover-out.',
|
|
51
|
+
table: { defaultValue: { summary: '150' } },
|
|
52
|
+
},
|
|
53
|
+
children: {
|
|
54
|
+
control: 'text',
|
|
55
|
+
description: 'The trigger element — the text or content that reveals the popover on hover or tap.',
|
|
56
|
+
},
|
|
57
|
+
className: {
|
|
58
|
+
control: 'text',
|
|
59
|
+
description: 'Additional CSS classes on the trigger wrapper.',
|
|
60
|
+
table: { defaultValue: { summary: '""' } },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
18
63
|
parameters: {
|
|
19
64
|
layout: "centered",
|
|
20
65
|
docs: {
|
|
@@ -21,6 +21,29 @@ var meta = {
|
|
|
21
21
|
title: "Components/Tabs",
|
|
22
22
|
component: Tabs,
|
|
23
23
|
tags: ["autodocs"],
|
|
24
|
+
argTypes: {
|
|
25
|
+
defaultActiveTab: {
|
|
26
|
+
control: 'text',
|
|
27
|
+
description: 'ID of the tab that is active by default (uncontrolled mode).',
|
|
28
|
+
},
|
|
29
|
+
activeTab: {
|
|
30
|
+
control: 'text',
|
|
31
|
+
description: 'Controlled active tab ID. Use together with `onTabChange` to manage state externally.',
|
|
32
|
+
},
|
|
33
|
+
onTabChange: {
|
|
34
|
+
control: false,
|
|
35
|
+
description: 'Callback fired when the active tab changes. Receives the new tab ID.',
|
|
36
|
+
},
|
|
37
|
+
children: {
|
|
38
|
+
control: false,
|
|
39
|
+
description: 'Tab content — typically `TabList` and `TabPanel` components.',
|
|
40
|
+
},
|
|
41
|
+
className: {
|
|
42
|
+
control: 'text',
|
|
43
|
+
description: 'Additional CSS classes applied to the outer container.',
|
|
44
|
+
table: { defaultValue: { summary: '""' } },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
24
47
|
parameters: {
|
|
25
48
|
docs: {
|
|
26
49
|
description: {
|
|
@@ -7,6 +7,23 @@ var meta = {
|
|
|
7
7
|
title: 'Components/Typography',
|
|
8
8
|
component: Typography,
|
|
9
9
|
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
variant: {
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
options: ['h1', 'h2', 'h3', 'h4', 'p', 'caption'],
|
|
14
|
+
description: 'Typography style variant. `h1`–`h4` render as heading elements; `p` and `caption` render as `<p>`.',
|
|
15
|
+
table: { defaultValue: { summary: "'p'" } },
|
|
16
|
+
},
|
|
17
|
+
children: {
|
|
18
|
+
control: 'text',
|
|
19
|
+
description: 'Text content.',
|
|
20
|
+
},
|
|
21
|
+
className: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
description: 'Additional CSS classes.',
|
|
24
|
+
table: { defaultValue: { summary: '""' } },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
10
27
|
parameters: {
|
|
11
28
|
docs: {
|
|
12
29
|
description: {
|
package/dist/styles.css
CHANGED
|
@@ -207,8 +207,10 @@
|
|
|
207
207
|
--dds-collapser-button-padding: 0.75rem; /* p-3 */
|
|
208
208
|
--dds-collapser-button-hover-bg: #f9fafb; /* gray-50 */
|
|
209
209
|
--dds-collapser-icon-color: #6b7280; /* gray-500 */
|
|
210
|
+
--dds-collapser-step-number-color: #6b7280; /* gray-500 — override to customise step numbers */
|
|
210
211
|
--dds-collapser-text: #374151; /* gray-700 */
|
|
211
212
|
--dds-collapser-content-padding: 1rem; /* p-4 */
|
|
213
|
+
--dds-collapser-header-gap: 0.5rem;
|
|
212
214
|
|
|
213
215
|
/* Tabs */
|
|
214
216
|
--dds-tabs-margin: 1rem 0;
|
|
@@ -342,6 +344,7 @@
|
|
|
342
344
|
--dds-collapser-border: #4b5563; /* gray-600 */
|
|
343
345
|
--dds-collapser-button-hover-bg: rgba(255, 255, 255, 0.05);
|
|
344
346
|
--dds-collapser-icon-color: #9ca3af; /* gray-400 */
|
|
347
|
+
--dds-collapser-step-number-color: #9ca3af;
|
|
345
348
|
--dds-collapser-text: #e5e7eb; /* gray-200 */
|
|
346
349
|
|
|
347
350
|
/* Tabs */
|
|
@@ -497,6 +500,7 @@
|
|
|
497
500
|
--dds-collapser-border: #4b5563;
|
|
498
501
|
--dds-collapser-button-hover-bg: rgba(255, 255, 255, 0.05);
|
|
499
502
|
--dds-collapser-icon-color: #9ca3af;
|
|
503
|
+
--dds-collapser-step-number-color: #9ca3af;
|
|
500
504
|
--dds-collapser-text: #e5e7eb;
|
|
501
505
|
|
|
502
506
|
/* Tabs */
|
|
@@ -652,6 +656,7 @@
|
|
|
652
656
|
--dds-collapser-border: #4b5563;
|
|
653
657
|
--dds-collapser-button-hover-bg: rgba(255, 255, 255, 0.05);
|
|
654
658
|
--dds-collapser-icon-color: #9ca3af;
|
|
659
|
+
--dds-collapser-step-number-color: #9ca3af;
|
|
655
660
|
--dds-collapser-text: #e5e7eb;
|
|
656
661
|
|
|
657
662
|
/* CodeBlock */
|
|
@@ -1080,6 +1085,14 @@ a.no-text-decoration {
|
|
|
1080
1085
|
grid-template-columns: repeat(4, 1fr);
|
|
1081
1086
|
}
|
|
1082
1087
|
}
|
|
1088
|
+
/* Equal height: stretch all cards to the tallest in each row */
|
|
1089
|
+
.dds-card-grid-equal-height > * {
|
|
1090
|
+
height: 100%;
|
|
1091
|
+
}
|
|
1092
|
+
.dds-card-grid-equal-height .dds-card {
|
|
1093
|
+
height: 100%;
|
|
1094
|
+
box-sizing: border-box;
|
|
1095
|
+
}
|
|
1083
1096
|
.dds-collapser {
|
|
1084
1097
|
display: flex;
|
|
1085
1098
|
flex-direction: column;
|
|
@@ -1093,6 +1106,7 @@ a.no-text-decoration {
|
|
|
1093
1106
|
padding: var(--dds-collapser-button-padding);
|
|
1094
1107
|
display: flex;
|
|
1095
1108
|
align-items: center;
|
|
1109
|
+
gap: var(--dds-collapser-header-gap);
|
|
1096
1110
|
transition: var(--dds-transition-colors);
|
|
1097
1111
|
border: none;
|
|
1098
1112
|
background: transparent;
|
|
@@ -1104,6 +1118,18 @@ a.no-text-decoration {
|
|
|
1104
1118
|
background-color: var(--dds-collapser-button-hover-bg);
|
|
1105
1119
|
outline: none;
|
|
1106
1120
|
}
|
|
1121
|
+
.dds-collapser-step-number {
|
|
1122
|
+
flex-shrink: 0;
|
|
1123
|
+
min-width: 1.5em;
|
|
1124
|
+
font-variant-numeric: tabular-nums;
|
|
1125
|
+
color: var(--dds-collapser-step-number-color);
|
|
1126
|
+
}
|
|
1127
|
+
.dds-collapser-header-icon {
|
|
1128
|
+
display: flex;
|
|
1129
|
+
align-items: center;
|
|
1130
|
+
flex-shrink: 0;
|
|
1131
|
+
color: var(--dds-collapser-icon-color);
|
|
1132
|
+
}
|
|
1107
1133
|
.dds-collapser-title {
|
|
1108
1134
|
display: flex;
|
|
1109
1135
|
align-items: center;
|
|
@@ -1112,12 +1138,18 @@ a.no-text-decoration {
|
|
|
1112
1138
|
margin: 0;
|
|
1113
1139
|
font-weight: bold;
|
|
1114
1140
|
color: var(--dds-heading-color);
|
|
1141
|
+
word-break: break-word;
|
|
1142
|
+
min-width: 0;
|
|
1143
|
+
}
|
|
1144
|
+
.dds-collapser--align-right .dds-collapser-title {
|
|
1145
|
+
justify-content: flex-end;
|
|
1146
|
+
text-align: right;
|
|
1115
1147
|
}
|
|
1116
1148
|
.dds-collapser-icon {
|
|
1117
1149
|
margin-left: auto;
|
|
1150
|
+
flex-shrink: 0;
|
|
1118
1151
|
transition: transform 0.3s ease;
|
|
1119
1152
|
color: var(--dds-collapser-icon-color);
|
|
1120
|
-
flex-shrink: 0;
|
|
1121
1153
|
}
|
|
1122
1154
|
.dds-collapser-icon-open {
|
|
1123
1155
|
transform: rotate(180deg);
|