@fpkit/acss 3.1.1 → 3.2.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.
- package/libs/{chunk-2NRIP6RB.cjs → chunk-2C3YLBWP.cjs} +3 -3
- package/libs/{chunk-NWJDAHP6.cjs → chunk-2GJHKWEK.cjs} +3 -3
- package/libs/{chunk-FVROL3V5.js → chunk-2JCDEC32.js} +3 -3
- package/libs/{chunk-IRLFZ3OL.js → chunk-3XJC4XUG.js} +2 -2
- package/libs/{chunk-L6PRDL6F.cjs → chunk-5CJPTDK3.cjs} +3 -3
- package/libs/{chunk-E4OSROCA.cjs → chunk-5QSNJQVH.cjs} +3 -3
- package/libs/{chunk-O3JIHC5M.cjs → chunk-6BUJZ4DJ.cjs} +3 -3
- package/libs/{chunk-WXBFBWYF.cjs → chunk-AFINOD2L.cjs} +3 -3
- package/libs/{chunk-HRRHPLER.js → chunk-AWZLSWDO.js} +2 -2
- package/libs/chunk-DDSXKOUB.js +7 -0
- package/libs/chunk-DDSXKOUB.js.map +1 -0
- package/libs/{chunk-CWRNJA4P.js → chunk-DIJBIOFE.js} +3 -3
- package/libs/chunk-EJ6KYBFE.cjs +13 -0
- package/libs/chunk-EJ6KYBFE.cjs.map +1 -0
- package/libs/{chunk-GUJSMQ3V.cjs → chunk-EKJYOCLY.cjs} +3 -3
- package/libs/{chunk-X5RKCLDC.cjs → chunk-F64GE6RG.cjs} +4 -4
- package/libs/{chunk-5RAWNUVD.js → chunk-IBUTNPTQ.js} +2 -2
- package/libs/{chunk-ZFJ4U45S.js → chunk-KDMX3FAW.js} +2 -2
- package/libs/{chunk-DYFAUAB7.cjs → chunk-LXODKKA3.cjs} +4 -4
- package/libs/{chunk-MPTMPBFT.js → chunk-M7JLT62Q.js} +2 -2
- package/libs/{chunk-IQ76HGVP.js → chunk-MBWI67UT.js} +2 -2
- package/libs/{chunk-O5XAJ7BY.cjs → chunk-NCGVF2QS.cjs} +4 -4
- package/libs/{chunk-W2UIN7EV.cjs → chunk-NPWHQVYB.cjs} +3 -3
- package/libs/chunk-OU52NIKA.js +8 -0
- package/libs/chunk-OU52NIKA.js.map +1 -0
- package/libs/{chunk-43TK2ICH.js → chunk-PMWL5XZ4.js} +3 -3
- package/libs/{chunk-KVKQLRJG.js → chunk-TF3GQKOY.js} +2 -2
- package/libs/{chunk-IEB64SWY.js → chunk-U5VA34SU.js} +2 -2
- package/libs/{chunk-EE3ZWSBY.cjs → chunk-URBGDUFN.cjs} +6 -6
- package/libs/chunk-WWPLBWCQ.cjs +18 -0
- package/libs/chunk-WWPLBWCQ.cjs.map +1 -0
- package/libs/{chunk-TPIB3RQP.js → chunk-ZF6Y7W57.js} +5 -5
- package/libs/component-props-50e69975.d.ts +66 -0
- package/libs/components/box/box.css +1 -0
- package/libs/components/box/box.css.map +1 -0
- package/libs/components/box/box.min.css +3 -0
- package/libs/components/breadcrumbs/breadcrumb.cjs +6 -6
- package/libs/components/breadcrumbs/breadcrumb.js +3 -3
- package/libs/components/button.cjs +4 -4
- package/libs/components/button.d.cts +10 -3
- package/libs/components/button.d.ts +10 -3
- package/libs/components/button.js +2 -2
- package/libs/components/card.cjs +7 -7
- package/libs/components/card.d.cts +13 -85
- package/libs/components/card.d.ts +13 -85
- package/libs/components/card.js +2 -2
- package/libs/components/cards/card.css +1 -1
- package/libs/components/cards/card.css.map +1 -1
- package/libs/components/cards/card.min.css +2 -2
- package/libs/components/cluster/cluster.css +1 -0
- package/libs/components/cluster/cluster.css.map +1 -0
- package/libs/components/cluster/cluster.min.css +3 -0
- package/libs/components/dialog/dialog.cjs +7 -7
- package/libs/components/dialog/dialog.js +5 -5
- package/libs/components/form/fields.cjs +4 -4
- package/libs/components/form/fields.js +2 -2
- package/libs/components/form/textarea.cjs +4 -4
- package/libs/components/form/textarea.js +2 -2
- package/libs/components/grid/grid.css +1 -0
- package/libs/components/grid/grid.css.map +1 -0
- package/libs/components/grid/grid.min.css +3 -0
- package/libs/components/heading/heading.cjs +3 -3
- package/libs/components/heading/heading.js +2 -2
- package/libs/components/icons/icon.cjs +4 -4
- package/libs/components/icons/icon.d.cts +2 -2
- package/libs/components/icons/icon.d.ts +2 -2
- package/libs/components/icons/icon.js +2 -2
- package/libs/components/link/link.cjs +6 -6
- package/libs/components/link/link.js +2 -2
- package/libs/components/list/list.cjs +5 -5
- package/libs/components/list/list.js +2 -2
- package/libs/components/modal.cjs +4 -4
- package/libs/components/modal.d.cts +1 -1
- package/libs/components/modal.d.ts +1 -1
- package/libs/components/modal.js +3 -3
- package/libs/components/nav/nav.cjs +7 -7
- package/libs/components/nav/nav.js +3 -3
- package/libs/components/stack/stack.css +1 -0
- package/libs/components/stack/stack.css.map +1 -0
- package/libs/components/stack/stack.min.css +3 -0
- package/libs/components/tables/table.d.cts +1 -1
- package/libs/components/tables/table.d.ts +1 -1
- package/libs/components/text/text.cjs +5 -5
- package/libs/components/text/text.js +2 -2
- package/libs/hooks.cjs +4 -4
- package/libs/hooks.js +3 -3
- package/libs/{icons-287fce3a.d.ts → icons-df8e744f.d.ts} +1 -1
- package/libs/icons.cjs +3 -3
- package/libs/icons.d.cts +2 -2
- package/libs/icons.d.ts +2 -2
- package/libs/icons.js +2 -2
- package/libs/index.cjs +64 -63
- package/libs/index.cjs.map +1 -1
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +923 -4
- package/libs/index.d.ts +923 -4
- package/libs/index.js +28 -28
- package/libs/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/alert/STYLES.mdx +790 -0
- package/src/components/badge/STYLES.mdx +610 -0
- package/src/components/box/README.mdx +401 -0
- package/src/components/box/STYLES.mdx +360 -0
- package/src/components/box/box.scss +245 -0
- package/src/components/box/box.stories.tsx +395 -0
- package/src/components/box/box.test.tsx +425 -0
- package/src/components/box/box.tsx +170 -0
- package/src/components/box/box.types.ts +166 -0
- package/src/components/breadcrumbs/STYLES.mdx +99 -0
- package/src/components/buttons/STYLES.mdx +766 -0
- package/src/components/cards/STYLES.mdx +835 -0
- package/src/components/cards/card.scss +30 -21
- package/src/components/cards/card.stories.tsx +120 -80
- package/src/components/cards/card.tsx +14 -4
- package/src/components/cards/card.types.ts +13 -0
- package/src/components/cluster/README.mdx +595 -0
- package/src/components/cluster/STYLES.mdx +626 -0
- package/src/components/cluster/cluster.scss +86 -0
- package/src/components/cluster/cluster.stories.tsx +385 -0
- package/src/components/cluster/cluster.test.tsx +655 -0
- package/src/components/cluster/cluster.tsx +94 -0
- package/src/components/cluster/cluster.types.ts +75 -0
- package/src/components/details/STYLES.mdx +445 -0
- package/src/components/dialog/STYLES.mdx +888 -0
- package/src/components/flexbox/STYLES.mdx +1 -1
- package/src/components/form/STYLES.mdx +821 -0
- package/src/components/grid/README.mdx +709 -0
- package/src/components/grid/STYLES.mdx +785 -0
- package/src/components/grid/grid.scss +287 -0
- package/src/components/grid/grid.stories.tsx +486 -0
- package/src/components/grid/grid.test.tsx +981 -0
- package/src/components/grid/grid.tsx +222 -0
- package/src/components/grid/grid.types.ts +344 -0
- package/src/components/icons/STYLES.mdx +56 -0
- package/src/components/images/STYLES.mdx +75 -0
- package/src/components/layout/STYLES.mdx +556 -0
- package/src/components/link/STYLES.mdx +75 -0
- package/src/components/list/STYLES.mdx +631 -0
- package/src/components/nav/STYLES.mdx +460 -0
- package/src/components/progress/STYLES.mdx +64 -0
- package/src/components/stack/README.mdx +400 -0
- package/src/components/stack/STYLES.mdx +414 -0
- package/src/components/stack/stack.scss +109 -0
- package/src/components/stack/stack.stories.tsx +559 -0
- package/src/components/stack/stack.test.tsx +426 -0
- package/src/components/stack/stack.tsx +141 -0
- package/src/components/stack/stack.types.ts +133 -0
- package/src/components/tag/STYLES.mdx +105 -0
- package/src/components/text-to-speech/STYLES.mdx +80 -0
- package/src/components/ui.tsx +3 -3
- package/src/index.scss +7 -2
- package/src/index.ts +305 -12
- package/src/sass/GLOBALS-STYLES.md +631 -0
- package/src/sass/_globals.scss +45 -24
- package/src/sass/_styles.scss +2 -2
- package/src/styles/box/box.css +220 -0
- package/src/styles/box/box.css.map +1 -0
- package/src/styles/cards/card.css +23 -17
- package/src/styles/cards/card.css.map +1 -1
- package/src/styles/cluster/cluster.css +71 -0
- package/src/styles/cluster/cluster.css.map +1 -0
- package/src/styles/grid/grid.css +238 -0
- package/src/styles/grid/grid.css.map +1 -0
- package/src/styles/index.css +668 -49
- package/src/styles/index.css.map +1 -1
- package/src/styles/stack/stack.css +86 -0
- package/src/styles/stack/stack.css.map +1 -0
- package/src/types/component-props.ts +42 -14
- package/src/types/layout-primitives.ts +48 -0
- package/src/types/shared.ts +10 -26
- package/libs/chunk-ENTCUJ3A.cjs +0 -13
- package/libs/chunk-ENTCUJ3A.cjs.map +0 -1
- package/libs/chunk-HHLNOC5T.js +0 -7
- package/libs/chunk-HHLNOC5T.js.map +0 -1
- package/libs/chunk-KK47SYZI.js +0 -8
- package/libs/chunk-KK47SYZI.js.map +0 -1
- package/libs/chunk-W5TKWBFC.cjs +0 -18
- package/libs/chunk-W5TKWBFC.cjs.map +0 -1
- package/libs/component-props-67d978a2.d.ts +0 -38
- /package/libs/{chunk-2NRIP6RB.cjs.map → chunk-2C3YLBWP.cjs.map} +0 -0
- /package/libs/{chunk-NWJDAHP6.cjs.map → chunk-2GJHKWEK.cjs.map} +0 -0
- /package/libs/{chunk-FVROL3V5.js.map → chunk-2JCDEC32.js.map} +0 -0
- /package/libs/{chunk-IRLFZ3OL.js.map → chunk-3XJC4XUG.js.map} +0 -0
- /package/libs/{chunk-L6PRDL6F.cjs.map → chunk-5CJPTDK3.cjs.map} +0 -0
- /package/libs/{chunk-E4OSROCA.cjs.map → chunk-5QSNJQVH.cjs.map} +0 -0
- /package/libs/{chunk-O3JIHC5M.cjs.map → chunk-6BUJZ4DJ.cjs.map} +0 -0
- /package/libs/{chunk-WXBFBWYF.cjs.map → chunk-AFINOD2L.cjs.map} +0 -0
- /package/libs/{chunk-HRRHPLER.js.map → chunk-AWZLSWDO.js.map} +0 -0
- /package/libs/{chunk-CWRNJA4P.js.map → chunk-DIJBIOFE.js.map} +0 -0
- /package/libs/{chunk-GUJSMQ3V.cjs.map → chunk-EKJYOCLY.cjs.map} +0 -0
- /package/libs/{chunk-X5RKCLDC.cjs.map → chunk-F64GE6RG.cjs.map} +0 -0
- /package/libs/{chunk-5RAWNUVD.js.map → chunk-IBUTNPTQ.js.map} +0 -0
- /package/libs/{chunk-ZFJ4U45S.js.map → chunk-KDMX3FAW.js.map} +0 -0
- /package/libs/{chunk-DYFAUAB7.cjs.map → chunk-LXODKKA3.cjs.map} +0 -0
- /package/libs/{chunk-MPTMPBFT.js.map → chunk-M7JLT62Q.js.map} +0 -0
- /package/libs/{chunk-IQ76HGVP.js.map → chunk-MBWI67UT.js.map} +0 -0
- /package/libs/{chunk-O5XAJ7BY.cjs.map → chunk-NCGVF2QS.cjs.map} +0 -0
- /package/libs/{chunk-W2UIN7EV.cjs.map → chunk-NPWHQVYB.cjs.map} +0 -0
- /package/libs/{chunk-43TK2ICH.js.map → chunk-PMWL5XZ4.js.map} +0 -0
- /package/libs/{chunk-KVKQLRJG.js.map → chunk-TF3GQKOY.js.map} +0 -0
- /package/libs/{chunk-IEB64SWY.js.map → chunk-U5VA34SU.js.map} +0 -0
- /package/libs/{chunk-EE3ZWSBY.cjs.map → chunk-URBGDUFN.cjs.map} +0 -0
- /package/libs/{chunk-TPIB3RQP.js.map → chunk-ZF6Y7W57.js.map} +0 -0
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { within, expect } from "storybook/test";
|
|
3
|
+
|
|
4
|
+
import { Stack } from "./stack";
|
|
5
|
+
import "./stack.scss";
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Stack> = {
|
|
8
|
+
title: "FP.React Components/Layout/Stack",
|
|
9
|
+
component: Stack,
|
|
10
|
+
tags: ["autodocs", "rc", "layout"],
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: `
|
|
15
|
+
# Stack - Layout Primitive
|
|
16
|
+
|
|
17
|
+
A simplified flexbox primitive for vertical or horizontal layouts with consistent gap spacing between children.
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- **Simple API**: Fewer props than Flex for common use cases
|
|
22
|
+
- **Fluid Spacing**: Responsive gap using CSS clamp()
|
|
23
|
+
- **Flexbox-Based**: Reliable cross-browser layout
|
|
24
|
+
- **Polymorphic**: Render as any semantic HTML element
|
|
25
|
+
- **Type-Safe**: Full TypeScript support
|
|
26
|
+
|
|
27
|
+
## When to Use
|
|
28
|
+
|
|
29
|
+
- **Stack**: Simple vertical/horizontal layouts with gap spacing
|
|
30
|
+
- **Flex**: Complex responsive layouts with advanced flex properties
|
|
31
|
+
- **Box**: Padding/margin on containers (no gap between children)
|
|
32
|
+
|
|
33
|
+
[View Full Documentation →](https://github.com/anthropics/fpkit/blob/main/packages/fpkit/src/components/stack/README.mdx)
|
|
34
|
+
`,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
type Story = StoryObj<typeof meta>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Default vertical Stack with medium gap.
|
|
45
|
+
* Stack defaults to vertical direction with medium gap between children.
|
|
46
|
+
*/
|
|
47
|
+
export const Default: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
gap: "md",
|
|
50
|
+
children: (
|
|
51
|
+
<>
|
|
52
|
+
<div style={{ padding: "1rem", backgroundColor: "#f0f0f0" }}>Item 1</div>
|
|
53
|
+
<div style={{ padding: "1rem", backgroundColor: "#e0e0e0" }}>Item 2</div>
|
|
54
|
+
<div style={{ padding: "1rem", backgroundColor: "#d0d0d0" }}>Item 3</div>
|
|
55
|
+
</>
|
|
56
|
+
),
|
|
57
|
+
},
|
|
58
|
+
play: async ({ canvasElement, step }) => {
|
|
59
|
+
const canvas = within(canvasElement);
|
|
60
|
+
|
|
61
|
+
await step("Stack renders correctly", async () => {
|
|
62
|
+
const item1 = canvas.getByText("Item 1");
|
|
63
|
+
expect(item1).toBeInTheDocument();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
await step("Stack has correct classes", async () => {
|
|
67
|
+
const stack = canvas.getByText("Item 1").parentElement;
|
|
68
|
+
expect(stack).toHaveClass("stack");
|
|
69
|
+
expect(stack).toHaveClass("stack-vertical");
|
|
70
|
+
expect(stack).toHaveClass("stack-gap-md");
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Different gap sizes.
|
|
77
|
+
* Demonstrates the unified spacing scale from xs to xl.
|
|
78
|
+
*/
|
|
79
|
+
export const GapSizes: Story = {
|
|
80
|
+
render: () => (
|
|
81
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "2rem" }}>
|
|
82
|
+
<div>
|
|
83
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Gap XS (4-8px)</h4>
|
|
84
|
+
<Stack gap="xs">
|
|
85
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#f0f0f0" }}>Item</div>
|
|
86
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#e0e0e0" }}>Item</div>
|
|
87
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#d0d0d0" }}>Item</div>
|
|
88
|
+
</Stack>
|
|
89
|
+
</div>
|
|
90
|
+
<div>
|
|
91
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Gap SM (8-12px)</h4>
|
|
92
|
+
<Stack gap="sm">
|
|
93
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#f0f0f0" }}>Item</div>
|
|
94
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#e0e0e0" }}>Item</div>
|
|
95
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#d0d0d0" }}>Item</div>
|
|
96
|
+
</Stack>
|
|
97
|
+
</div>
|
|
98
|
+
<div>
|
|
99
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Gap MD (12-18px)</h4>
|
|
100
|
+
<Stack gap="md">
|
|
101
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#f0f0f0" }}>Item</div>
|
|
102
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#e0e0e0" }}>Item</div>
|
|
103
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#d0d0d0" }}>Item</div>
|
|
104
|
+
</Stack>
|
|
105
|
+
</div>
|
|
106
|
+
<div>
|
|
107
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Gap LG (16-24px)</h4>
|
|
108
|
+
<Stack gap="lg">
|
|
109
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#f0f0f0" }}>Item</div>
|
|
110
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#e0e0e0" }}>Item</div>
|
|
111
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#d0d0d0" }}>Item</div>
|
|
112
|
+
</Stack>
|
|
113
|
+
</div>
|
|
114
|
+
<div>
|
|
115
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Gap XL (24-32px)</h4>
|
|
116
|
+
<Stack gap="xl">
|
|
117
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#f0f0f0" }}>Item</div>
|
|
118
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#e0e0e0" }}>Item</div>
|
|
119
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#d0d0d0" }}>Item</div>
|
|
120
|
+
</Stack>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
),
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Horizontal Stack for button groups.
|
|
128
|
+
* Use direction="horizontal" for side-by-side layouts.
|
|
129
|
+
*/
|
|
130
|
+
export const Horizontal: Story = {
|
|
131
|
+
args: {
|
|
132
|
+
direction: "horizontal",
|
|
133
|
+
gap: "sm",
|
|
134
|
+
children: (
|
|
135
|
+
<>
|
|
136
|
+
<button type="button" style={{ padding: "0.5rem 1rem" }}>Cancel</button>
|
|
137
|
+
<button
|
|
138
|
+
type="button"
|
|
139
|
+
style={{
|
|
140
|
+
padding: "0.5rem 1rem",
|
|
141
|
+
backgroundColor: "#0066cc",
|
|
142
|
+
color: "#fff",
|
|
143
|
+
border: "none",
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
Submit
|
|
147
|
+
</button>
|
|
148
|
+
</>
|
|
149
|
+
),
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Centered vertical Stack.
|
|
155
|
+
* Common pattern for hero sections or centered content.
|
|
156
|
+
*/
|
|
157
|
+
export const CenteredVertical: Story = {
|
|
158
|
+
args: {
|
|
159
|
+
gap: "lg",
|
|
160
|
+
align: "center",
|
|
161
|
+
justify: "center",
|
|
162
|
+
styles: {
|
|
163
|
+
minHeight: "400px",
|
|
164
|
+
backgroundColor: "#f8f9fa",
|
|
165
|
+
border: "2px dashed #ccc",
|
|
166
|
+
},
|
|
167
|
+
children: (
|
|
168
|
+
<>
|
|
169
|
+
<div
|
|
170
|
+
style={{
|
|
171
|
+
width: "80px",
|
|
172
|
+
height: "80px",
|
|
173
|
+
backgroundColor: "#0066cc",
|
|
174
|
+
borderRadius: "50%",
|
|
175
|
+
}}
|
|
176
|
+
/>
|
|
177
|
+
<h2 style={{ margin: 0 }}>Welcome</h2>
|
|
178
|
+
<p style={{ margin: 0 }}>Get started with our platform</p>
|
|
179
|
+
<button
|
|
180
|
+
type="button"
|
|
181
|
+
style={{
|
|
182
|
+
padding: "0.75rem 1.5rem",
|
|
183
|
+
backgroundColor: "#0066cc",
|
|
184
|
+
color: "#fff",
|
|
185
|
+
border: "none",
|
|
186
|
+
borderRadius: "0.25rem",
|
|
187
|
+
}}
|
|
188
|
+
>
|
|
189
|
+
Get Started
|
|
190
|
+
</button>
|
|
191
|
+
</>
|
|
192
|
+
),
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Horizontal navigation Stack.
|
|
198
|
+
* Demonstrates semantic nav element with horizontal layout.
|
|
199
|
+
*/
|
|
200
|
+
export const Navigation: Story = {
|
|
201
|
+
args: {
|
|
202
|
+
as: "nav",
|
|
203
|
+
direction: "horizontal",
|
|
204
|
+
gap: "md",
|
|
205
|
+
align: "center",
|
|
206
|
+
styles: {
|
|
207
|
+
padding: "1rem",
|
|
208
|
+
backgroundColor: "#f8f9fa",
|
|
209
|
+
border: "1px solid #e0e0e0",
|
|
210
|
+
},
|
|
211
|
+
children: (
|
|
212
|
+
<>
|
|
213
|
+
<div style={{ fontWeight: "bold", fontSize: "1.25rem" }}>Logo</div>
|
|
214
|
+
<Stack direction="horizontal" gap="sm" styles={{ marginLeft: "auto" }}>
|
|
215
|
+
<a href="#home" style={{ textDecoration: "none", color: "#0066cc" }}>
|
|
216
|
+
Home
|
|
217
|
+
</a>
|
|
218
|
+
<a href="#about" style={{ textDecoration: "none", color: "#0066cc" }}>
|
|
219
|
+
About
|
|
220
|
+
</a>
|
|
221
|
+
<a href="#contact" style={{ textDecoration: "none", color: "#0066cc" }}>
|
|
222
|
+
Contact
|
|
223
|
+
</a>
|
|
224
|
+
</Stack>
|
|
225
|
+
</>
|
|
226
|
+
),
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Vertical content sections.
|
|
232
|
+
* Common pattern for article or page layouts.
|
|
233
|
+
*/
|
|
234
|
+
export const ContentSections: Story = {
|
|
235
|
+
args: {
|
|
236
|
+
as: "article",
|
|
237
|
+
gap: "xl",
|
|
238
|
+
styles: {
|
|
239
|
+
maxWidth: "48rem",
|
|
240
|
+
margin: "0 auto",
|
|
241
|
+
padding: "2rem",
|
|
242
|
+
},
|
|
243
|
+
children: (
|
|
244
|
+
<>
|
|
245
|
+
<Stack gap="sm">
|
|
246
|
+
<h1 style={{ margin: 0 }}>Article Title</h1>
|
|
247
|
+
<p style={{ margin: 0, color: "#666" }}>Published on December 3, 2025</p>
|
|
248
|
+
</Stack>
|
|
249
|
+
<Stack gap="md">
|
|
250
|
+
<p style={{ margin: 0 }}>
|
|
251
|
+
This is the introduction paragraph with some meaningful content about the
|
|
252
|
+
article topic.
|
|
253
|
+
</p>
|
|
254
|
+
<p style={{ margin: 0 }}>
|
|
255
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
256
|
+
tempor incididunt ut labore et dolore magna aliqua.
|
|
257
|
+
</p>
|
|
258
|
+
</Stack>
|
|
259
|
+
<Stack gap="md">
|
|
260
|
+
<h2 style={{ margin: 0 }}>Section Heading</h2>
|
|
261
|
+
<p style={{ margin: 0 }}>
|
|
262
|
+
More content goes here with proper spacing between sections using the
|
|
263
|
+
Stack component.
|
|
264
|
+
</p>
|
|
265
|
+
</Stack>
|
|
266
|
+
</>
|
|
267
|
+
),
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Alignment variations.
|
|
273
|
+
* Demonstrates different alignment options on cross-axis.
|
|
274
|
+
*/
|
|
275
|
+
export const Alignments: Story = {
|
|
276
|
+
render: () => (
|
|
277
|
+
<Stack gap="xl">
|
|
278
|
+
<div>
|
|
279
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Align Start (default)</h4>
|
|
280
|
+
<Stack gap="sm" align="start" styles={{ border: "2px dashed #ccc", padding: "1rem" }}>
|
|
281
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#f0f0f0", width: "200px" }}>
|
|
282
|
+
Short item
|
|
283
|
+
</div>
|
|
284
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#e0e0e0", width: "300px" }}>
|
|
285
|
+
Medium item
|
|
286
|
+
</div>
|
|
287
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#d0d0d0", width: "150px" }}>
|
|
288
|
+
Small
|
|
289
|
+
</div>
|
|
290
|
+
</Stack>
|
|
291
|
+
</div>
|
|
292
|
+
<div>
|
|
293
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Align Center</h4>
|
|
294
|
+
<Stack gap="sm" align="center" styles={{ border: "2px dashed #ccc", padding: "1rem" }}>
|
|
295
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#f0f0f0", width: "200px" }}>
|
|
296
|
+
Short item
|
|
297
|
+
</div>
|
|
298
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#e0e0e0", width: "300px" }}>
|
|
299
|
+
Medium item
|
|
300
|
+
</div>
|
|
301
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#d0d0d0", width: "150px" }}>
|
|
302
|
+
Small
|
|
303
|
+
</div>
|
|
304
|
+
</Stack>
|
|
305
|
+
</div>
|
|
306
|
+
<div>
|
|
307
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Align End</h4>
|
|
308
|
+
<Stack gap="sm" align="end" styles={{ border: "2px dashed #ccc", padding: "1rem" }}>
|
|
309
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#f0f0f0", width: "200px" }}>
|
|
310
|
+
Short item
|
|
311
|
+
</div>
|
|
312
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#e0e0e0", width: "300px" }}>
|
|
313
|
+
Medium item
|
|
314
|
+
</div>
|
|
315
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#d0d0d0", width: "150px" }}>
|
|
316
|
+
Small
|
|
317
|
+
</div>
|
|
318
|
+
</Stack>
|
|
319
|
+
</div>
|
|
320
|
+
<div>
|
|
321
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Align Stretch</h4>
|
|
322
|
+
<Stack gap="sm" align="stretch" styles={{ border: "2px dashed #ccc", padding: "1rem" }}>
|
|
323
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#f0f0f0" }}>
|
|
324
|
+
Stretched item (full width)
|
|
325
|
+
</div>
|
|
326
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#e0e0e0" }}>
|
|
327
|
+
Stretched item (full width)
|
|
328
|
+
</div>
|
|
329
|
+
<div style={{ padding: "0.5rem", backgroundColor: "#d0d0d0" }}>
|
|
330
|
+
Stretched item (full width)
|
|
331
|
+
</div>
|
|
332
|
+
</Stack>
|
|
333
|
+
</div>
|
|
334
|
+
</Stack>
|
|
335
|
+
),
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Justification variations.
|
|
340
|
+
* Demonstrates different justification options on main-axis.
|
|
341
|
+
*/
|
|
342
|
+
export const Justifications: Story = {
|
|
343
|
+
render: () => (
|
|
344
|
+
<Stack gap="xl">
|
|
345
|
+
<div>
|
|
346
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Justify Start (default)</h4>
|
|
347
|
+
<Stack
|
|
348
|
+
direction="horizontal"
|
|
349
|
+
gap="sm"
|
|
350
|
+
justify="start"
|
|
351
|
+
styles={{ border: "2px dashed #ccc", padding: "1rem", minHeight: "100px" }}
|
|
352
|
+
>
|
|
353
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#f0f0f0" }}>Item 1</div>
|
|
354
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#e0e0e0" }}>Item 2</div>
|
|
355
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#d0d0d0" }}>Item 3</div>
|
|
356
|
+
</Stack>
|
|
357
|
+
</div>
|
|
358
|
+
<div>
|
|
359
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Justify Center</h4>
|
|
360
|
+
<Stack
|
|
361
|
+
direction="horizontal"
|
|
362
|
+
gap="sm"
|
|
363
|
+
justify="center"
|
|
364
|
+
styles={{ border: "2px dashed #ccc", padding: "1rem", minHeight: "100px" }}
|
|
365
|
+
>
|
|
366
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#f0f0f0" }}>Item 1</div>
|
|
367
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#e0e0e0" }}>Item 2</div>
|
|
368
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#d0d0d0" }}>Item 3</div>
|
|
369
|
+
</Stack>
|
|
370
|
+
</div>
|
|
371
|
+
<div>
|
|
372
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Justify End</h4>
|
|
373
|
+
<Stack
|
|
374
|
+
direction="horizontal"
|
|
375
|
+
gap="sm"
|
|
376
|
+
justify="end"
|
|
377
|
+
styles={{ border: "2px dashed #ccc", padding: "1rem", minHeight: "100px" }}
|
|
378
|
+
>
|
|
379
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#f0f0f0" }}>Item 1</div>
|
|
380
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#e0e0e0" }}>Item 2</div>
|
|
381
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#d0d0d0" }}>Item 3</div>
|
|
382
|
+
</Stack>
|
|
383
|
+
</div>
|
|
384
|
+
<div>
|
|
385
|
+
<h4 style={{ margin: 0, marginBottom: "0.5rem" }}>Justify Between</h4>
|
|
386
|
+
<Stack
|
|
387
|
+
direction="horizontal"
|
|
388
|
+
gap="sm"
|
|
389
|
+
justify="between"
|
|
390
|
+
styles={{ border: "2px dashed #ccc", padding: "1rem", minHeight: "100px" }}
|
|
391
|
+
>
|
|
392
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#f0f0f0" }}>Item 1</div>
|
|
393
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#e0e0e0" }}>Item 2</div>
|
|
394
|
+
<div style={{ padding: "0.5rem 1rem", backgroundColor: "#d0d0d0" }}>Item 3</div>
|
|
395
|
+
</Stack>
|
|
396
|
+
</div>
|
|
397
|
+
</Stack>
|
|
398
|
+
),
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Wrapping horizontal Stack.
|
|
403
|
+
* Items wrap to next line when exceeding container width.
|
|
404
|
+
*/
|
|
405
|
+
export const Wrapping: Story = {
|
|
406
|
+
args: {
|
|
407
|
+
direction: "horizontal",
|
|
408
|
+
gap: "sm",
|
|
409
|
+
wrap: "wrap",
|
|
410
|
+
styles: {
|
|
411
|
+
maxWidth: "400px",
|
|
412
|
+
border: "2px dashed #ccc",
|
|
413
|
+
padding: "1rem",
|
|
414
|
+
},
|
|
415
|
+
children: (
|
|
416
|
+
<>
|
|
417
|
+
{Array.from({ length: 10 }, (_, i) => (
|
|
418
|
+
<div
|
|
419
|
+
key={i}
|
|
420
|
+
style={{
|
|
421
|
+
padding: "0.5rem 1rem",
|
|
422
|
+
backgroundColor: "#f0f0f0",
|
|
423
|
+
border: "1px solid #ccc",
|
|
424
|
+
}}
|
|
425
|
+
>
|
|
426
|
+
Item {i + 1}
|
|
427
|
+
</div>
|
|
428
|
+
))}
|
|
429
|
+
</>
|
|
430
|
+
),
|
|
431
|
+
},
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Nested Stacks.
|
|
436
|
+
* Demonstrates composing Stack components for complex layouts.
|
|
437
|
+
*/
|
|
438
|
+
export const NestedStacks: Story = {
|
|
439
|
+
render: () => (
|
|
440
|
+
<Stack gap="lg" styles={{ padding: "2rem", backgroundColor: "#f8f9fa" }}>
|
|
441
|
+
<h2 style={{ margin: 0 }}>Dashboard</h2>
|
|
442
|
+
<Stack direction="horizontal" gap="lg" wrap="wrap">
|
|
443
|
+
<Stack
|
|
444
|
+
gap="md"
|
|
445
|
+
styles={{
|
|
446
|
+
flex: "1",
|
|
447
|
+
minWidth: "250px",
|
|
448
|
+
padding: "1.5rem",
|
|
449
|
+
backgroundColor: "#fff",
|
|
450
|
+
border: "1px solid #e0e0e0",
|
|
451
|
+
borderRadius: "0.5rem",
|
|
452
|
+
}}
|
|
453
|
+
>
|
|
454
|
+
<h3 style={{ margin: 0 }}>Card 1</h3>
|
|
455
|
+
<p style={{ margin: 0, color: "#666" }}>
|
|
456
|
+
Nested vertical Stack inside horizontal Stack
|
|
457
|
+
</p>
|
|
458
|
+
<button
|
|
459
|
+
type="button"
|
|
460
|
+
style={{ padding: "0.5rem 1rem", alignSelf: "flex-start" }}
|
|
461
|
+
>
|
|
462
|
+
Action
|
|
463
|
+
</button>
|
|
464
|
+
</Stack>
|
|
465
|
+
<Stack
|
|
466
|
+
gap="md"
|
|
467
|
+
styles={{
|
|
468
|
+
flex: "1",
|
|
469
|
+
minWidth: "250px",
|
|
470
|
+
padding: "1.5rem",
|
|
471
|
+
backgroundColor: "#fff",
|
|
472
|
+
border: "1px solid #e0e0e0",
|
|
473
|
+
borderRadius: "0.5rem",
|
|
474
|
+
}}
|
|
475
|
+
>
|
|
476
|
+
<h3 style={{ margin: 0 }}>Card 2</h3>
|
|
477
|
+
<p style={{ margin: 0, color: "#666" }}>Each card is an independent Stack</p>
|
|
478
|
+
<button
|
|
479
|
+
type="button"
|
|
480
|
+
style={{ padding: "0.5rem 1rem", alignSelf: "flex-start" }}
|
|
481
|
+
>
|
|
482
|
+
Action
|
|
483
|
+
</button>
|
|
484
|
+
</Stack>
|
|
485
|
+
</Stack>
|
|
486
|
+
</Stack>
|
|
487
|
+
),
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Form layout with Stack.
|
|
492
|
+
* Common pattern for form field layouts.
|
|
493
|
+
*/
|
|
494
|
+
export const FormLayout: Story = {
|
|
495
|
+
render: () => (
|
|
496
|
+
<Stack gap="lg" styles={{ maxWidth: "400px", padding: "2rem" }}>
|
|
497
|
+
<h2 style={{ margin: 0 }}>Sign Up Form</h2>
|
|
498
|
+
<Stack gap="xs">
|
|
499
|
+
<label htmlFor="name" style={{ fontWeight: "500" }}>
|
|
500
|
+
Name
|
|
501
|
+
</label>
|
|
502
|
+
<input
|
|
503
|
+
id="name"
|
|
504
|
+
type="text"
|
|
505
|
+
style={{
|
|
506
|
+
padding: "0.5rem",
|
|
507
|
+
border: "1px solid #ccc",
|
|
508
|
+
borderRadius: "0.25rem",
|
|
509
|
+
}}
|
|
510
|
+
/>
|
|
511
|
+
</Stack>
|
|
512
|
+
<Stack gap="xs">
|
|
513
|
+
<label htmlFor="email" style={{ fontWeight: "500" }}>
|
|
514
|
+
Email
|
|
515
|
+
</label>
|
|
516
|
+
<input
|
|
517
|
+
id="email"
|
|
518
|
+
type="email"
|
|
519
|
+
style={{
|
|
520
|
+
padding: "0.5rem",
|
|
521
|
+
border: "1px solid #ccc",
|
|
522
|
+
borderRadius: "0.25rem",
|
|
523
|
+
}}
|
|
524
|
+
/>
|
|
525
|
+
</Stack>
|
|
526
|
+
<Stack gap="xs">
|
|
527
|
+
<label htmlFor="password" style={{ fontWeight: "500" }}>
|
|
528
|
+
Password
|
|
529
|
+
</label>
|
|
530
|
+
<input
|
|
531
|
+
id="password"
|
|
532
|
+
type="password"
|
|
533
|
+
style={{
|
|
534
|
+
padding: "0.5rem",
|
|
535
|
+
border: "1px solid #ccc",
|
|
536
|
+
borderRadius: "0.25rem",
|
|
537
|
+
}}
|
|
538
|
+
/>
|
|
539
|
+
</Stack>
|
|
540
|
+
<Stack direction="horizontal" gap="sm" justify="end">
|
|
541
|
+
<button type="button" style={{ padding: "0.5rem 1rem" }}>
|
|
542
|
+
Cancel
|
|
543
|
+
</button>
|
|
544
|
+
<button
|
|
545
|
+
type="submit"
|
|
546
|
+
style={{
|
|
547
|
+
padding: "0.5rem 1rem",
|
|
548
|
+
backgroundColor: "#0066cc",
|
|
549
|
+
color: "#fff",
|
|
550
|
+
border: "none",
|
|
551
|
+
borderRadius: "0.25rem",
|
|
552
|
+
}}
|
|
553
|
+
>
|
|
554
|
+
Sign Up
|
|
555
|
+
</button>
|
|
556
|
+
</Stack>
|
|
557
|
+
</Stack>
|
|
558
|
+
),
|
|
559
|
+
};
|