@roadlittledawn/docs-design-system-react 0.7.0 → 0.9.1

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.
@@ -0,0 +1,90 @@
1
+ import { ReactNode } from 'react';
2
+ /** Breakpoint at which columns stack vertically */
3
+ type StackAt = 'sm' | 'md' | 'lg' | 'never';
4
+ /** Vertical alignment of column content */
5
+ type AlignItems = 'start' | 'center' | 'end' | 'stretch';
6
+ /** Configuration for a border or divider line */
7
+ export interface BorderConfig {
8
+ /**
9
+ * Line thickness in pixels
10
+ * @default 1
11
+ */
12
+ thickness?: number;
13
+ /** Line color (defaults to the `--dds-grid-divider-color` token) */
14
+ color?: string;
15
+ }
16
+ export interface GridProps {
17
+ /**
18
+ * Number of equal columns, or an array of fractional widths
19
+ * (e.g. `[1, 2]` for a 1/3 + 2/3 split).
20
+ * @default 2
21
+ */
22
+ columns?: number | number[];
23
+ /**
24
+ * Space between columns. Use `'sm'`, `'md'`, or `'lg'` for design-token sizes,
25
+ * or any valid CSS length string (e.g. `'16px'`, `'1.5rem'`, `'2em'`).
26
+ * @default 'md'
27
+ */
28
+ gap?: string;
29
+ /**
30
+ * Viewport breakpoint at which columns collapse to a single vertical stack.
31
+ * @default 'md'
32
+ */
33
+ stackAt?: StackAt;
34
+ /**
35
+ * Vertical dividing line drawn between columns.
36
+ * Converts to a horizontal rule when the layout stacks.
37
+ */
38
+ columnDivider?: BorderConfig;
39
+ /** Horizontal rule rendered above the grid. */
40
+ topBorder?: BorderConfig;
41
+ /** Horizontal rule rendered below the grid. */
42
+ bottomBorder?: BorderConfig;
43
+ /**
44
+ * Vertical alignment of content within each column.
45
+ * @default 'stretch'
46
+ */
47
+ align?: AlignItems;
48
+ /** Background color applied to the grid container. */
49
+ backgroundColor?: string;
50
+ /** Additional CSS classes applied to the grid wrapper. */
51
+ className?: string;
52
+ children: ReactNode;
53
+ }
54
+ export interface ColumnProps {
55
+ /**
56
+ * How many grid columns this item should span.
57
+ * @default 1
58
+ */
59
+ span?: number;
60
+ /**
61
+ * Makes the column content sticky (`position: sticky; top: …`) while adjacent columns scroll.
62
+ * Useful for tutorial-style layouts with a persistent code panel.
63
+ * Automatically disabled when the grid stacks on mobile.
64
+ * @default false
65
+ */
66
+ sticky?: boolean;
67
+ /** Background color applied to the column. */
68
+ backgroundColor?: string;
69
+ /** Additional CSS classes applied to the column wrapper. */
70
+ className?: string;
71
+ children: ReactNode;
72
+ }
73
+ /**
74
+ * Multi-column layout container for documentation pages.
75
+ * Supports equal and fractional column splits, configurable responsive stacking,
76
+ * optional column dividers, top/bottom borders, and background colours.
77
+ *
78
+ * Pair with `<Column>` children to control individual column behaviour.
79
+ */
80
+ export declare function Grid({ columns, gap, stackAt, columnDivider, topBorder, bottomBorder, align, backgroundColor, className, children, }: GridProps): import("react/jsx-runtime").JSX.Element;
81
+ /**
82
+ * An individual column within a `<Grid>`.
83
+ *
84
+ * Use the `span` prop to make a column occupy more than one grid track, and
85
+ * `sticky` to keep the column content pinned while adjacent content scrolls.
86
+ * The column element itself always stretches to the full row height so that
87
+ * column dividers cover the entire row regardless of which column is taller.
88
+ */
89
+ export declare function Column({ span, sticky, backgroundColor, className, children, }: ColumnProps): import("react/jsx-runtime").JSX.Element;
90
+ export {};
@@ -0,0 +1,95 @@
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 } from "react/jsx-runtime";
13
+ var GAP_TOKEN_MAP = {
14
+ sm: 'var(--dds-grid-gap-sm)',
15
+ md: 'var(--dds-grid-gap-md)',
16
+ lg: 'var(--dds-grid-gap-lg)',
17
+ };
18
+ var ALIGN_MAP = {
19
+ start: 'start',
20
+ center: 'center',
21
+ end: 'end',
22
+ stretch: 'stretch',
23
+ };
24
+ function resolveGap(gap) {
25
+ if (gap in GAP_TOKEN_MAP)
26
+ return GAP_TOKEN_MAP[gap];
27
+ return gap; // custom CSS length string, e.g. '16px', '1.5rem', '2em'
28
+ }
29
+ /**
30
+ * Multi-column layout container for documentation pages.
31
+ * Supports equal and fractional column splits, configurable responsive stacking,
32
+ * optional column dividers, top/bottom borders, and background colours.
33
+ *
34
+ * Pair with `<Column>` children to control individual column behaviour.
35
+ */
36
+ export function Grid(_a) {
37
+ var _b, _c, _d, _e, _f, _g;
38
+ var _h = _a.columns, columns = _h === void 0 ? 2 : _h, _j = _a.gap, gap = _j === void 0 ? 'md' : _j, _k = _a.stackAt, stackAt = _k === void 0 ? 'md' : _k, columnDivider = _a.columnDivider, topBorder = _a.topBorder, bottomBorder = _a.bottomBorder, _l = _a.align, align = _l === void 0 ? 'stretch' : _l, backgroundColor = _a.backgroundColor, _m = _a.className, className = _m === void 0 ? '' : _m, children = _a.children;
39
+ var columnTemplate = Array.isArray(columns)
40
+ ? columns.map(function (n) { return "".concat(n, "fr"); }).join(' ')
41
+ : "repeat(".concat(columns, ", 1fr)");
42
+ var style = __assign(__assign(__assign(__assign({ '--dds-grid-template-columns': columnTemplate, '--dds-grid-gap': resolveGap(gap), '--dds-grid-align': ALIGN_MAP[align] }, (backgroundColor ? { backgroundColor: backgroundColor } : {})), (topBorder
43
+ ? {
44
+ '--dds-grid-top-border-thickness': "".concat((_b = topBorder.thickness) !== null && _b !== void 0 ? _b : 1, "px"),
45
+ '--dds-grid-top-border-color': (_c = topBorder.color) !== null && _c !== void 0 ? _c : 'var(--dds-grid-divider-color)',
46
+ }
47
+ : {})), (bottomBorder
48
+ ? {
49
+ '--dds-grid-bottom-border-thickness': "".concat((_d = bottomBorder.thickness) !== null && _d !== void 0 ? _d : 1, "px"),
50
+ '--dds-grid-bottom-border-color': (_e = bottomBorder.color) !== null && _e !== void 0 ? _e : 'var(--dds-grid-divider-color)',
51
+ }
52
+ : {})), (columnDivider
53
+ ? {
54
+ '--dds-grid-column-divider-thickness': "".concat((_f = columnDivider.thickness) !== null && _f !== void 0 ? _f : 1, "px"),
55
+ '--dds-grid-column-divider-color': (_g = columnDivider.color) !== null && _g !== void 0 ? _g : 'var(--dds-grid-divider-color)',
56
+ }
57
+ : {}));
58
+ var classNames = [
59
+ 'dds-grid',
60
+ "dds-grid-stack-".concat(stackAt),
61
+ topBorder ? 'dds-grid-has-top-border' : '',
62
+ bottomBorder ? 'dds-grid-has-bottom-border' : '',
63
+ columnDivider ? 'dds-grid-has-column-divider' : '',
64
+ className,
65
+ ]
66
+ .filter(Boolean)
67
+ .join(' ');
68
+ return (_jsx("div", { className: classNames, style: style, children: children }));
69
+ }
70
+ /**
71
+ * An individual column within a `<Grid>`.
72
+ *
73
+ * Use the `span` prop to make a column occupy more than one grid track, and
74
+ * `sticky` to keep the column content pinned while adjacent content scrolls.
75
+ * The column element itself always stretches to the full row height so that
76
+ * column dividers cover the entire row regardless of which column is taller.
77
+ */
78
+ export function Column(_a) {
79
+ var span = _a.span, _b = _a.sticky, sticky = _b === void 0 ? false : _b, backgroundColor = _a.backgroundColor, _c = _a.className, className = _c === void 0 ? '' : _c, children = _a.children;
80
+ var style = {};
81
+ if (span && span > 1) {
82
+ style.gridColumn = "span ".concat(span);
83
+ }
84
+ if (backgroundColor) {
85
+ style.backgroundColor = backgroundColor;
86
+ }
87
+ var classNames = [
88
+ 'dds-grid-column',
89
+ sticky ? 'dds-grid-column-sticky' : '',
90
+ className,
91
+ ]
92
+ .filter(Boolean)
93
+ .join(' ');
94
+ return (_jsx("div", { className: classNames, style: style, children: sticky ? (_jsx("div", { className: "dds-grid-column-sticky-inner", children: children })) : (children) }));
95
+ }
@@ -0,0 +1,69 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { Grid } from './Grid';
3
+ /**
4
+ * `Grid` and `Column` provide a flexible multi-column layout for documentation pages.
5
+ * Common patterns include side-by-side comparisons, image + annotation, and
6
+ * tutorial-style instruction / code pairings.
7
+ */
8
+ declare const meta: Meta<typeof Grid>;
9
+ export default meta;
10
+ type Story = StoryObj<typeof Grid>;
11
+ /**
12
+ * Fully interactive default story — all controls in the prop table affect this
13
+ * live preview. Adjust `columns`, `gap`, `stackAt`, `align`, `columnDivider`,
14
+ * `topBorder`, `bottomBorder`, and `backgroundColor` via the Controls panel.
15
+ */
16
+ export declare const Default: Story;
17
+ /**
18
+ * Two equal columns — the default layout. Columns stack vertically at the `md`
19
+ * breakpoint (768 px) by default.
20
+ */
21
+ export declare const TwoEqualColumns: Story;
22
+ /**
23
+ * Three equal columns, with a top and bottom border to create a contained
24
+ * "feature grid" panel. Useful for listing icons with short descriptions.
25
+ */
26
+ export declare const ThreeColumnFeatureGrid: Story;
27
+ /**
28
+ * Asymmetric 1/3 + 2/3 split — pass an array of fractional weights.
29
+ * A common pattern for a narrow label / sidebar alongside wide content.
30
+ */
31
+ export declare const AsymmetricSplit: Story;
32
+ /**
33
+ * Image + annotation layout. `align="center"` vertically centres the shorter
34
+ * column when image and text have different heights.
35
+ */
36
+ export declare const ImageAndText: Story;
37
+ /**
38
+ * Tutorial layout — prose instructions on the left, sticky code panel on the
39
+ * right. The code panel stays in view while the user scrolls through the steps.
40
+ * The column divider runs the full height of the row regardless of which column
41
+ * is taller. The `sticky` prop is automatically disabled when the grid stacks.
42
+ */
43
+ export declare const TutorialWithStickyCode: Story;
44
+ /**
45
+ * Column dividers — a vertical line between columns that converts to a
46
+ * horizontal rule at the stacking breakpoint.
47
+ */
48
+ export declare const WithColumnDivider: Story;
49
+ /**
50
+ * Background colors — apply a background to the entire grid and / or to
51
+ * individual columns using the `backgroundColor` prop.
52
+ */
53
+ export declare const BackgroundColors: Story;
54
+ /**
55
+ * Large gap between columns — useful when columns contain rich content
56
+ * that needs extra breathing room.
57
+ */
58
+ export declare const LargeGap: Story;
59
+ /**
60
+ * Custom gap — pass any CSS length string such as `'1.5rem'` or `'40px'`
61
+ * for fine-grained control beyond the named size tokens.
62
+ */
63
+ export declare const CustomGap: Story;
64
+ /**
65
+ * Span — a column set to `span={2}` occupies two grid tracks.
66
+ * Useful for full-width content (e.g. a summary row) inside an otherwise
67
+ * multi-column grid.
68
+ */
69
+ export declare const ColumnSpan: Story;
@@ -0,0 +1,259 @@
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 { Grid } from './Grid';
14
+ import { Column } from './Grid';
15
+ import { CodeBlock } from './CodeBlock';
16
+ /**
17
+ * `Grid` and `Column` provide a flexible multi-column layout for documentation pages.
18
+ * Common patterns include side-by-side comparisons, image + annotation, and
19
+ * tutorial-style instruction / code pairings.
20
+ */
21
+ var meta = {
22
+ title: 'Components/Grid',
23
+ component: Grid,
24
+ tags: ['autodocs'],
25
+ argTypes: {
26
+ columns: {
27
+ control: { type: 'object' },
28
+ description: 'Number of equal columns, or an array of fractional weights for asymmetric splits (e.g. `[1, 2]` → 1/3 + 2/3). Enter a number or a JSON array in the control.',
29
+ table: { defaultValue: { summary: '2' } },
30
+ },
31
+ gap: {
32
+ control: { type: 'select' },
33
+ options: ['sm', 'md', 'lg', '0.5rem', '1rem', '1.5rem', '2rem', '3rem', '8px', '16px', '24px', '32px'],
34
+ description: "Space between columns. Use `'sm'`, `'md'`, or `'lg'` for design-token sizes, or any CSS length string (e.g. `'16px'`, `'1.5rem'`).",
35
+ table: { defaultValue: { summary: "'md'" } },
36
+ },
37
+ stackAt: {
38
+ control: { type: 'select' },
39
+ options: ['sm', 'md', 'lg', 'never'],
40
+ description: 'Breakpoint at which columns collapse to a single vertical stack.',
41
+ table: { defaultValue: { summary: "'md'" } },
42
+ },
43
+ align: {
44
+ control: { type: 'select' },
45
+ options: ['start', 'center', 'end', 'stretch'],
46
+ description: 'Vertical alignment of content within each column.',
47
+ table: { defaultValue: { summary: "'stretch'" } },
48
+ },
49
+ columnDivider: {
50
+ control: { type: 'object' },
51
+ description: 'Vertical line between columns (`{ thickness?: number; color?: string }`). Converts to a horizontal rule when stacked.',
52
+ },
53
+ topBorder: {
54
+ control: { type: 'object' },
55
+ description: 'Horizontal rule above the grid (`{ thickness?: number; color?: string }`).',
56
+ },
57
+ bottomBorder: {
58
+ control: { type: 'object' },
59
+ description: 'Horizontal rule below the grid (`{ thickness?: number; color?: string }`).',
60
+ },
61
+ backgroundColor: {
62
+ control: 'color',
63
+ description: 'Background color for the entire grid container.',
64
+ },
65
+ className: {
66
+ control: 'text',
67
+ description: 'Additional CSS classes applied to the grid wrapper.',
68
+ table: { defaultValue: { summary: '""' } },
69
+ },
70
+ children: {
71
+ control: false,
72
+ description: 'Grid content — typically `Column` components.',
73
+ },
74
+ },
75
+ parameters: {
76
+ docs: {
77
+ description: {
78
+ component: "\nLayout primitive for multi-column documentation content.\n\n## When to Use\n\n- **Image + annotation** \u2014 screenshot or diagram on one side, feature callouts on the other\n- **Tutorial / live demo** \u2014 prose instructions on one side, sticky code panel on the other\n- **Side-by-side comparison** \u2014 before/after, two approaches, or option A vs option B\n- **Feature grid** \u2014 icon + short description repeated across columns\n\n## When Not to Use\n\n- For card-style repeating items of the same type \u2014 use `CardGrid` instead\n- For a single column of content \u2014 use standard block-level markup\n\n## Accessibility\n\n- Rendered as a semantic `<div>`; no implicit ARIA role (not a data table)\n- Source order should match reading order; avoid visual reordering via CSS `order`\n- Column dividers are decorative and carry no meaning for assistive technology\n ",
79
+ },
80
+ },
81
+ },
82
+ };
83
+ export default meta;
84
+ /* -------------------------------------------------------------------------- */
85
+ /* Helpers */
86
+ /* -------------------------------------------------------------------------- */
87
+ var textColor = { color: 'var(--dds-tabs-panel-text)' };
88
+ var subtle = { color: 'var(--dds-tabs-panel-text)', fontFamily: 'sans-serif', margin: 0 };
89
+ function Placeholder(_a) {
90
+ var label = _a.label, _b = _a.height, height = _b === void 0 ? 120 : _b, _c = _a.bg, bg = _c === void 0 ? 'rgba(99,102,241,0.1)' : _c;
91
+ return (_jsx("div", { style: __assign(__assign({ display: 'flex', alignItems: 'center', justifyContent: 'center', height: height, background: bg, borderRadius: 6 }, textColor), { fontFamily: 'sans-serif', fontWeight: 600, fontSize: '0.875rem' }), children: label }));
92
+ }
93
+ /* -------------------------------------------------------------------------- */
94
+ /* Stories */
95
+ /* -------------------------------------------------------------------------- */
96
+ /**
97
+ * Fully interactive default story — all controls in the prop table affect this
98
+ * live preview. Adjust `columns`, `gap`, `stackAt`, `align`, `columnDivider`,
99
+ * `topBorder`, `bottomBorder`, and `backgroundColor` via the Controls panel.
100
+ */
101
+ export var Default = {
102
+ args: {
103
+ columns: 2,
104
+ gap: 'md',
105
+ stackAt: 'md',
106
+ align: 'stretch',
107
+ },
108
+ render: function (args) { return (_jsxs(Grid, __assign({}, args, { children: [_jsx(Column, { children: _jsx(Placeholder, { label: "Column 1" }) }), _jsx(Column, { children: _jsx(Placeholder, { label: "Column 2" }) })] }))); },
109
+ parameters: {
110
+ docs: {
111
+ source: {
112
+ code: "<Grid columns={2} gap=\"md\">\n <Column>Column 1 content</Column>\n <Column>Column 2 content</Column>\n</Grid>",
113
+ },
114
+ },
115
+ },
116
+ };
117
+ /**
118
+ * Two equal columns — the default layout. Columns stack vertically at the `md`
119
+ * breakpoint (768 px) by default.
120
+ */
121
+ export var TwoEqualColumns = {
122
+ render: function () { return (_jsxs(Grid, { columns: 2, children: [_jsx(Column, { children: _jsx(Placeholder, { label: "Column 1" }) }), _jsx(Column, { children: _jsx(Placeholder, { label: "Column 2" }) })] })); },
123
+ parameters: {
124
+ docs: {
125
+ source: {
126
+ code: "<Grid columns={2}>\n <Column>Column 1 content</Column>\n <Column>Column 2 content</Column>\n</Grid>",
127
+ },
128
+ },
129
+ },
130
+ };
131
+ /**
132
+ * Three equal columns, with a top and bottom border to create a contained
133
+ * "feature grid" panel. Useful for listing icons with short descriptions.
134
+ */
135
+ export var ThreeColumnFeatureGrid = {
136
+ render: function () { return (_jsxs(Grid, { columns: 3, gap: "md", topBorder: { color: 'var(--dds-grid-divider-color)' }, bottomBorder: { color: 'var(--dds-grid-divider-color)' }, children: [_jsx(Column, { children: _jsxs("p", { style: subtle, children: [_jsx("strong", { children: "Feature A" }), _jsx("br", {}), "Short description of the feature."] }) }), _jsx(Column, { children: _jsxs("p", { style: subtle, children: [_jsx("strong", { children: "Feature B" }), _jsx("br", {}), "Short description of the feature."] }) }), _jsx(Column, { children: _jsxs("p", { style: subtle, children: [_jsx("strong", { children: "Feature C" }), _jsx("br", {}), "Short description of the feature."] }) })] })); },
137
+ parameters: {
138
+ docs: {
139
+ source: {
140
+ code: "<Grid\n columns={3}\n gap=\"md\"\n topBorder={{ color: '#ccc' }}\n bottomBorder={{ color: '#ccc' }}\n>\n <Column><strong>Feature A</strong> \u2014 Short description.</Column>\n <Column><strong>Feature B</strong> \u2014 Short description.</Column>\n <Column><strong>Feature C</strong> \u2014 Short description.</Column>\n</Grid>",
141
+ },
142
+ },
143
+ },
144
+ };
145
+ /**
146
+ * Asymmetric 1/3 + 2/3 split — pass an array of fractional weights.
147
+ * A common pattern for a narrow label / sidebar alongside wide content.
148
+ */
149
+ export var AsymmetricSplit = {
150
+ render: function () { return (_jsxs(Grid, { columns: [1, 2], children: [_jsx(Column, { children: _jsx(Placeholder, { label: "1 / 3", height: 160, bg: "rgba(16,185,129,0.1)" }) }), _jsx(Column, { children: _jsx(Placeholder, { label: "2 / 3", height: 160, bg: "rgba(99,102,241,0.1)" }) })] })); },
151
+ parameters: {
152
+ docs: {
153
+ source: {
154
+ code: "<Grid columns={[1, 2]}>\n <Column>Narrow (1/3)</Column>\n <Column>Wide (2/3)</Column>\n</Grid>",
155
+ },
156
+ },
157
+ },
158
+ };
159
+ /**
160
+ * Image + annotation layout. `align="center"` vertically centres the shorter
161
+ * column when image and text have different heights.
162
+ */
163
+ export var ImageAndText = {
164
+ render: function () { return (_jsxs(Grid, { columns: [1, 2], align: "center", columnDivider: { color: 'var(--dds-grid-divider-color)' }, children: [_jsx(Column, { children: _jsx(Placeholder, { label: "Diagram / Screenshot", height: 200, bg: "rgba(234,179,8,0.1)" }) }), _jsxs(Column, { children: [_jsx("p", { style: __assign(__assign({}, subtle), { marginBottom: '0.5rem' }), children: _jsx("strong", { children: "What you're looking at" }) }), _jsxs("p", { style: subtle, children: ["This panel describes the key elements of the diagram on the left. Use ", _jsx("code", { children: "align=\"center\"" }), " so short text stays vertically centred next to a taller image."] })] })] })); },
165
+ parameters: {
166
+ docs: {
167
+ source: {
168
+ code: "<Grid columns={[1, 2]} align=\"center\" columnDivider={{ color: '#ddd' }}>\n <Column>\n <img src=\"/diagram.png\" alt=\"Architecture diagram\" />\n </Column>\n <Column>\n <h3>What you're looking at</h3>\n <p>Description of the diagram elements...</p>\n </Column>\n</Grid>",
169
+ },
170
+ },
171
+ },
172
+ };
173
+ /**
174
+ * Tutorial layout — prose instructions on the left, sticky code panel on the
175
+ * right. The code panel stays in view while the user scrolls through the steps.
176
+ * The column divider runs the full height of the row regardless of which column
177
+ * is taller. The `sticky` prop is automatically disabled when the grid stacks.
178
+ */
179
+ export var TutorialWithStickyCode = {
180
+ render: function () { return (_jsxs(Grid, { columns: 2, stackAt: "lg", gap: "lg", columnDivider: { thickness: 2, color: 'var(--dds-grid-divider-color)' }, children: [_jsxs(Column, { children: [_jsx("p", { style: __assign(__assign({}, subtle), { marginBottom: '1rem' }), children: _jsx("strong", { children: "Step 1 \u2014 Install dependencies" }) }), _jsx("p", { style: __assign(__assign({}, subtle), { marginBottom: '1rem' }), children: "Run the installer and follow the prompts. This sets up the project scaffold and pulls in all required packages." }), _jsx("p", { style: __assign(__assign({}, subtle), { marginBottom: '1rem' }), children: _jsx("strong", { children: "Step 2 \u2014 Configure your project" }) }), _jsxs("p", { style: __assign(__assign({}, subtle), { marginBottom: '1rem' }), children: ["Open ", _jsx("code", { children: "config.ts" }), " and update the values for your environment. Refer to the code panel on the right for a complete example."] }), _jsx("p", { style: __assign(__assign({}, subtle), { marginBottom: '1rem' }), children: _jsx("strong", { children: "Step 3 \u2014 Start the dev server" }) }), _jsx("p", { style: subtle, children: "Run the dev command. The server watches for file changes and hot-reloads automatically." })] }), _jsx(Column, { sticky: true, children: _jsx(CodeBlock, { language: "bash", code: "npm install\n\nnpm run dev" }) })] })); },
181
+ parameters: {
182
+ docs: {
183
+ source: {
184
+ code: "<Grid columns={2} stackAt=\"lg\" gap=\"lg\" columnDivider={{ thickness: 2 }}>\n <Column>\n {/* Step-by-step instructions */}\n <p><strong>Step 1 \u2014 Install dependencies</strong></p>\n <p>Run the installer and follow the prompts.</p>\n {/* \u2026 more steps \u2026 */}\n </Column>\n <Column sticky>\n <CodeBlock language=\"bash\" code=\"npm install\\n\\nnpm run dev\" />\n </Column>\n</Grid>",
185
+ },
186
+ },
187
+ },
188
+ };
189
+ /**
190
+ * Column dividers — a vertical line between columns that converts to a
191
+ * horizontal rule at the stacking breakpoint.
192
+ */
193
+ export var WithColumnDivider = {
194
+ render: function () { return (_jsxs(Grid, { columns: 3, columnDivider: { thickness: 1, color: 'var(--dds-grid-divider-color)' }, children: [_jsxs(Column, { children: [_jsx("p", { style: subtle, children: _jsx("strong", { children: "Option A" }) }), _jsx("p", { style: subtle, children: "Description of the first approach." })] }), _jsxs(Column, { children: [_jsx("p", { style: subtle, children: _jsx("strong", { children: "Option B" }) }), _jsx("p", { style: subtle, children: "Description of the second approach." })] }), _jsxs(Column, { children: [_jsx("p", { style: subtle, children: _jsx("strong", { children: "Option C" }) }), _jsx("p", { style: subtle, children: "Description of the third approach." })] })] })); },
195
+ parameters: {
196
+ docs: {
197
+ source: {
198
+ code: "<Grid columns={3} columnDivider={{ thickness: 1, color: '#e0e0e0' }}>\n <Column>\n <strong>Option A</strong>\n <p>Description of the first approach.</p>\n </Column>\n <Column>\n <strong>Option B</strong>\n <p>Description of the second approach.</p>\n </Column>\n <Column>\n <strong>Option C</strong>\n <p>Description of the third approach.</p>\n </Column>\n</Grid>",
199
+ },
200
+ },
201
+ },
202
+ };
203
+ /**
204
+ * Background colors — apply a background to the entire grid and / or to
205
+ * individual columns using the `backgroundColor` prop.
206
+ */
207
+ export var BackgroundColors = {
208
+ render: function () { return (_jsxs(Grid, { columns: 2, gap: "lg", backgroundColor: "rgba(99,102,241,0.04)", children: [_jsxs(Column, { backgroundColor: "rgba(16,185,129,0.08)", children: [_jsx("p", { style: subtle, children: _jsx("strong", { children: "Column with background" }) }), _jsx("p", { style: subtle, children: "Each column can have its own background color." })] }), _jsxs(Column, { backgroundColor: "rgba(234,179,8,0.08)", children: [_jsx("p", { style: subtle, children: _jsx("strong", { children: "Another column background" }) }), _jsxs("p", { style: subtle, children: ["The grid container also has a light background applied via", ' ', _jsx("code", { children: "backgroundColor" }), " on the ", _jsx("code", { children: "Grid" }), "."] })] })] })); },
209
+ parameters: {
210
+ docs: {
211
+ source: {
212
+ code: "<Grid columns={2} gap=\"lg\" backgroundColor=\"rgba(99,102,241,0.04)\">\n <Column backgroundColor=\"rgba(16,185,129,0.08)\">\n <strong>Column with background</strong>\n <p>Each column can have its own background color.</p>\n </Column>\n <Column backgroundColor=\"rgba(234,179,8,0.08)\">\n <strong>Another column background</strong>\n <p>Set on both the Grid container and individual Columns.</p>\n </Column>\n</Grid>",
213
+ },
214
+ },
215
+ },
216
+ };
217
+ /**
218
+ * Large gap between columns — useful when columns contain rich content
219
+ * that needs extra breathing room.
220
+ */
221
+ export var LargeGap = {
222
+ render: function () { return (_jsxs(Grid, { columns: 2, gap: "lg", children: [_jsx(Column, { children: _jsx(Placeholder, { label: "Column 1", height: 140 }) }), _jsx(Column, { children: _jsx(Placeholder, { label: "Column 2", height: 140 }) })] })); },
223
+ parameters: {
224
+ docs: {
225
+ source: {
226
+ code: "<Grid columns={2} gap=\"lg\">\n <Column>Column 1 content</Column>\n <Column>Column 2 content</Column>\n</Grid>",
227
+ },
228
+ },
229
+ },
230
+ };
231
+ /**
232
+ * Custom gap — pass any CSS length string such as `'1.5rem'` or `'40px'`
233
+ * for fine-grained control beyond the named size tokens.
234
+ */
235
+ export var CustomGap = {
236
+ render: function () { return (_jsxs(Grid, { columns: 2, gap: "3rem", children: [_jsx(Column, { children: _jsx(Placeholder, { label: "Column 1", height: 140 }) }), _jsx(Column, { children: _jsx(Placeholder, { label: "Column 2", height: 140 }) })] })); },
237
+ parameters: {
238
+ docs: {
239
+ source: {
240
+ code: "<Grid columns={2} gap=\"3rem\">\n <Column>Column 1 content</Column>\n <Column>Column 2 content</Column>\n</Grid>",
241
+ },
242
+ },
243
+ },
244
+ };
245
+ /**
246
+ * Span — a column set to `span={2}` occupies two grid tracks.
247
+ * Useful for full-width content (e.g. a summary row) inside an otherwise
248
+ * multi-column grid.
249
+ */
250
+ export var ColumnSpan = {
251
+ render: function () { return (_jsxs(Grid, { columns: 3, gap: "md", children: [_jsx(Column, { children: _jsx(Placeholder, { label: "Col 1" }) }), _jsx(Column, { children: _jsx(Placeholder, { label: "Col 2" }) }), _jsx(Column, { children: _jsx(Placeholder, { label: "Col 3" }) }), _jsx(Column, { span: 3, children: _jsx(Placeholder, { label: "Spans all 3 columns", height: 60, bg: "rgba(239,68,68,0.1)" }) })] })); },
252
+ parameters: {
253
+ docs: {
254
+ source: {
255
+ code: "<Grid columns={3} gap=\"md\">\n <Column>Col 1</Column>\n <Column>Col 2</Column>\n <Column>Col 3</Column>\n <Column span={3}>Spans all 3 columns</Column>\n</Grid>",
256
+ },
257
+ },
258
+ },
259
+ };
@@ -0,0 +1,81 @@
1
+ import React from 'react';
2
+ type SortDirection = 'asc' | 'desc' | null;
3
+ export interface TableProps {
4
+ /** Children — typically TableHead and TableBody */
5
+ children: React.ReactNode;
6
+ /**
7
+ * Visual variant of the table.
8
+ * `"default"` renders all borders; `"borderless"` shows only row top/bottom borders.
9
+ */
10
+ variant?: 'default' | 'borderless';
11
+ /**
12
+ * When true the thead sticks to the top of the scroll container while scrolling.
13
+ * Pair with the `style` prop (e.g. `style={{ maxHeight: '400px' }}`) to constrain
14
+ * the table height so that the header can stick.
15
+ */
16
+ stickyHeader?: boolean;
17
+ /**
18
+ * Background color applied to the header row.
19
+ * Accepts any valid CSS color value (e.g. `"#f0f4ff"`, `"var(--my-color)"`).
20
+ * Overrides the default token value.
21
+ */
22
+ headerBg?: string;
23
+ /**
24
+ * Callback fired when a sortable column header is clicked.
25
+ * Useful for server-side sorting. Receives the column key and new direction.
26
+ */
27
+ onSort?: (key: string, direction: SortDirection) => void;
28
+ /** Additional CSS classes applied to the outer wrapper */
29
+ className?: string;
30
+ /**
31
+ * Inline styles applied to the outer wrapper.
32
+ * Use `maxHeight` here to constrain the table height when `stickyHeader` is true.
33
+ */
34
+ style?: React.CSSProperties;
35
+ }
36
+ export declare function Table({ children, variant, stickyHeader, headerBg, onSort, className, style, }: TableProps): import("react/jsx-runtime").JSX.Element;
37
+ export interface TableHeadProps {
38
+ /** Header rows — typically one TableRow containing TableHeaderCells */
39
+ children: React.ReactNode;
40
+ /** Additional CSS classes */
41
+ className?: string;
42
+ }
43
+ export declare function TableHead({ children, className }: TableHeadProps): import("react/jsx-runtime").JSX.Element;
44
+ export interface TableBodyProps {
45
+ /** Table body rows */
46
+ children: React.ReactNode;
47
+ /** Additional CSS classes */
48
+ className?: string;
49
+ }
50
+ export declare function TableBody({ children, className }: TableBodyProps): import("react/jsx-runtime").JSX.Element;
51
+ export interface TableRowProps {
52
+ /** Cells in this row */
53
+ children: React.ReactNode;
54
+ /** Additional CSS classes */
55
+ className?: string;
56
+ }
57
+ export declare function TableRow({ children, className }: TableRowProps): import("react/jsx-runtime").JSX.Element;
58
+ export interface TableHeaderCellProps {
59
+ /** Cell content / column label */
60
+ children: React.ReactNode;
61
+ /**
62
+ * Unique key used to identify this column when sorting.
63
+ * When provided the column becomes sortable.
64
+ */
65
+ sortKey?: string;
66
+ /** Text alignment of the column */
67
+ align?: 'left' | 'center' | 'right';
68
+ /** Additional CSS classes */
69
+ className?: string;
70
+ }
71
+ export declare function TableHeaderCell({ children, sortKey, align, className, }: TableHeaderCellProps): import("react/jsx-runtime").JSX.Element;
72
+ export interface TableCellProps {
73
+ /** Cell content */
74
+ children?: React.ReactNode;
75
+ /** Text alignment */
76
+ align?: 'left' | 'center' | 'right';
77
+ /** Additional CSS classes */
78
+ className?: string;
79
+ }
80
+ export declare function TableCell({ children, align, className }: TableCellProps): import("react/jsx-runtime").JSX.Element;
81
+ export {};