@dashforge/tw 0.1.0-beta → 0.2.0-beta
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/CHANGELOG.md +108 -0
- package/dist/index.d.ts +1 -82
- package/dist/index.esm.js +1563 -2
- package/dist/src/components/AspectRatio/AspectRatio.d.ts +36 -0
- package/dist/src/components/AspectRatio/AspectRatio.d.ts.map +1 -0
- package/dist/src/components/AspectRatio/aspectRatio.types.d.ts +50 -0
- package/dist/src/components/AspectRatio/aspectRatio.types.d.ts.map +1 -0
- package/dist/src/components/Box/Box.d.ts +36 -0
- package/dist/src/components/Box/Box.d.ts.map +1 -0
- package/dist/src/components/Box/box.types.d.ts +54 -0
- package/dist/src/components/Box/box.types.d.ts.map +1 -0
- package/dist/src/components/Box/box.variants.d.ts +402 -0
- package/dist/src/components/Box/box.variants.d.ts.map +1 -0
- package/dist/src/components/Container/Container.d.ts +35 -0
- package/dist/src/components/Container/Container.d.ts.map +1 -0
- package/dist/src/components/Container/container.types.d.ts +41 -0
- package/dist/src/components/Container/container.types.d.ts.map +1 -0
- package/dist/src/components/Container/container.variants.d.ts +93 -0
- package/dist/src/components/Container/container.variants.d.ts.map +1 -0
- package/dist/src/components/Divider/Divider.d.ts +50 -0
- package/dist/src/components/Divider/Divider.d.ts.map +1 -0
- package/dist/src/components/Divider/divider.types.d.ts +47 -0
- package/dist/src/components/Divider/divider.types.d.ts.map +1 -0
- package/dist/src/components/Divider/divider.variants.d.ts +129 -0
- package/dist/src/components/Divider/divider.variants.d.ts.map +1 -0
- package/dist/src/components/Grid/Grid.d.ts +32 -0
- package/dist/src/components/Grid/Grid.d.ts.map +1 -0
- package/dist/src/components/Grid/grid.types.d.ts +103 -0
- package/dist/src/components/Grid/grid.types.d.ts.map +1 -0
- package/dist/src/components/Grid/grid.variants.d.ts +453 -0
- package/dist/src/components/Grid/grid.variants.d.ts.map +1 -0
- package/dist/src/components/Stack/Stack.d.ts +24 -0
- package/dist/src/components/Stack/Stack.d.ts.map +1 -0
- package/dist/src/components/Stack/stack.types.d.ts +61 -0
- package/dist/src/components/Stack/stack.types.d.ts.map +1 -0
- package/dist/src/components/Stack/stack.variants.d.ts +163 -0
- package/dist/src/components/Stack/stack.variants.d.ts.map +1 -0
- package/dist/src/components/Typography/Typography.d.ts +42 -0
- package/dist/src/components/Typography/Typography.d.ts.map +1 -0
- package/dist/src/components/Typography/typography.types.d.ts +61 -0
- package/dist/src/components/Typography/typography.types.d.ts.map +1 -0
- package/dist/src/components/Typography/typography.variants.d.ts +167 -0
- package/dist/src/components/Typography/typography.variants.d.ts.map +1 -0
- package/dist/src/components/VisuallyHidden/VisuallyHidden.d.ts +42 -0
- package/dist/src/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
- package/dist/src/components/VisuallyHidden/visuallyHidden.types.d.ts +42 -0
- package/dist/src/components/VisuallyHidden/visuallyHidden.types.d.ts.map +1 -0
- package/dist/src/index.d.ts +22 -0
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/AspectRatio/AspectRatio.test.tsx +173 -0
- package/src/components/AspectRatio/AspectRatio.tsx +73 -0
- package/src/components/AspectRatio/aspectRatio.types.ts +54 -0
- package/src/components/Box/Box.test.tsx +349 -0
- package/src/components/Box/Box.tsx +83 -0
- package/src/components/Box/box.types.ts +61 -0
- package/src/components/Box/box.variants.ts +211 -0
- package/src/components/Container/Container.test.tsx +209 -0
- package/src/components/Container/Container.tsx +74 -0
- package/src/components/Container/container.types.ts +45 -0
- package/src/components/Container/container.variants.ts +81 -0
- package/src/components/Divider/Divider.test.tsx +241 -0
- package/src/components/Divider/Divider.tsx +140 -0
- package/src/components/Divider/divider.types.ts +52 -0
- package/src/components/Divider/divider.variants.ts +115 -0
- package/src/components/Grid/Grid.test.tsx +321 -0
- package/src/components/Grid/Grid.tsx +148 -0
- package/src/components/Grid/grid.types.ts +112 -0
- package/src/components/Grid/grid.variants.ts +133 -0
- package/src/components/Stack/Stack.test.tsx +309 -0
- package/src/components/Stack/Stack.tsx +115 -0
- package/src/components/Stack/stack.types.ts +68 -0
- package/src/components/Stack/stack.variants.ts +80 -0
- package/src/components/Typography/Typography.test.tsx +230 -0
- package/src/components/Typography/Typography.tsx +112 -0
- package/src/components/Typography/typography.types.ts +65 -0
- package/src/components/Typography/typography.variants.ts +113 -0
- package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +86 -0
- package/src/components/VisuallyHidden/VisuallyHidden.tsx +59 -0
- package/src/components/VisuallyHidden/visuallyHidden.types.ts +45 -0
- package/src/index.ts +49 -0
- package/dist/components/AppShell/AppShell.d.ts +0 -32
- package/dist/components/AppShell/AppShell.d.ts.map +0 -1
- package/dist/components/AppShell/appShell.types.d.ts +0 -62
- package/dist/components/AppShell/appShell.types.d.ts.map +0 -1
- package/dist/components/AppShell/appShell.variants.d.ts +0 -65
- package/dist/components/AppShell/appShell.variants.d.ts.map +0 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +0 -32
- package/dist/components/Autocomplete/Autocomplete.d.ts.map +0 -1
- package/dist/components/Autocomplete/autocomplete.types.d.ts +0 -214
- package/dist/components/Autocomplete/autocomplete.types.d.ts.map +0 -1
- package/dist/components/Autocomplete/autocomplete.variants.d.ts +0 -214
- package/dist/components/Autocomplete/autocomplete.variants.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -23
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/breadcrumbs.types.d.ts +0 -98
- package/dist/components/Breadcrumbs/breadcrumbs.types.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/breadcrumbs.variants.d.ts +0 -85
- package/dist/components/Breadcrumbs/breadcrumbs.variants.d.ts.map +0 -1
- package/dist/components/Button/Button.d.ts +0 -44
- package/dist/components/Button/Button.d.ts.map +0 -1
- package/dist/components/Button/button.types.d.ts +0 -66
- package/dist/components/Button/button.types.d.ts.map +0 -1
- package/dist/components/Button/button.variants.d.ts +0 -104
- package/dist/components/Button/button.variants.d.ts.map +0 -1
- package/dist/components/Checkbox/Checkbox.d.ts +0 -31
- package/dist/components/Checkbox/Checkbox.d.ts.map +0 -1
- package/dist/components/Checkbox/checkbox.types.d.ts +0 -86
- package/dist/components/Checkbox/checkbox.types.d.ts.map +0 -1
- package/dist/components/Checkbox/checkbox.variants.d.ts +0 -109
- package/dist/components/Checkbox/checkbox.variants.d.ts.map +0 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +0 -38
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +0 -1
- package/dist/components/ConfirmDialog/confirmDialog.types.d.ts +0 -80
- package/dist/components/ConfirmDialog/confirmDialog.types.d.ts.map +0 -1
- package/dist/components/ConfirmDialog/confirmDialog.variants.d.ts +0 -90
- package/dist/components/ConfirmDialog/confirmDialog.variants.d.ts.map +0 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +0 -49
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +0 -1
- package/dist/components/DateTimePicker/dateTimePicker.types.d.ts +0 -95
- package/dist/components/DateTimePicker/dateTimePicker.types.d.ts.map +0 -1
- package/dist/components/DateTimePicker/dateTimePicker.variants.d.ts +0 -165
- package/dist/components/DateTimePicker/dateTimePicker.variants.d.ts.map +0 -1
- package/dist/components/LeftNav/LeftNav.d.ts +0 -34
- package/dist/components/LeftNav/LeftNav.d.ts.map +0 -1
- package/dist/components/LeftNav/leftNav.types.d.ts +0 -136
- package/dist/components/LeftNav/leftNav.types.d.ts.map +0 -1
- package/dist/components/LeftNav/leftNav.variants.d.ts +0 -143
- package/dist/components/LeftNav/leftNav.variants.d.ts.map +0 -1
- package/dist/components/NumberField/NumberField.d.ts +0 -18
- package/dist/components/NumberField/NumberField.d.ts.map +0 -1
- package/dist/components/NumberField/numberField.types.d.ts +0 -79
- package/dist/components/NumberField/numberField.types.d.ts.map +0 -1
- package/dist/components/NumberField/numberField.variants.d.ts +0 -169
- package/dist/components/NumberField/numberField.variants.d.ts.map +0 -1
- package/dist/components/OTPField/OTPField.d.ts +0 -25
- package/dist/components/OTPField/OTPField.d.ts.map +0 -1
- package/dist/components/OTPField/otpField.types.d.ts +0 -74
- package/dist/components/OTPField/otpField.types.d.ts.map +0 -1
- package/dist/components/OTPField/otpField.variants.d.ts +0 -105
- package/dist/components/OTPField/otpField.variants.d.ts.map +0 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +0 -35
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +0 -1
- package/dist/components/RadioGroup/radioGroup.types.d.ts +0 -103
- package/dist/components/RadioGroup/radioGroup.types.d.ts.map +0 -1
- package/dist/components/RadioGroup/radioGroup.variants.d.ts +0 -166
- package/dist/components/RadioGroup/radioGroup.variants.d.ts.map +0 -1
- package/dist/components/Snackbar/Snackbar.d.ts +0 -37
- package/dist/components/Snackbar/Snackbar.d.ts.map +0 -1
- package/dist/components/Snackbar/snackbar.types.d.ts +0 -86
- package/dist/components/Snackbar/snackbar.types.d.ts.map +0 -1
- package/dist/components/Snackbar/snackbar.variants.d.ts +0 -153
- package/dist/components/Snackbar/snackbar.variants.d.ts.map +0 -1
- package/dist/components/Switch/Switch.d.ts +0 -15
- package/dist/components/Switch/Switch.d.ts.map +0 -1
- package/dist/components/Switch/switch.types.d.ts +0 -47
- package/dist/components/Switch/switch.types.d.ts.map +0 -1
- package/dist/components/Switch/switch.variants.d.ts +0 -105
- package/dist/components/Switch/switch.variants.d.ts.map +0 -1
- package/dist/components/TextField/TextField.d.ts +0 -25
- package/dist/components/TextField/TextField.d.ts.map +0 -1
- package/dist/components/TextField/textField.types.d.ts +0 -72
- package/dist/components/TextField/textField.types.d.ts.map +0 -1
- package/dist/components/TextField/textField.variants.d.ts +0 -160
- package/dist/components/TextField/textField.variants.d.ts.map +0 -1
- package/dist/components/Textarea/Textarea.d.ts +0 -16
- package/dist/components/Textarea/Textarea.d.ts.map +0 -1
- package/dist/components/Textarea/textarea.types.d.ts +0 -63
- package/dist/components/Textarea/textarea.types.d.ts.map +0 -1
- package/dist/components/Textarea/textarea.variants.d.ts +0 -197
- package/dist/components/Textarea/textarea.variants.d.ts.map +0 -1
- package/dist/components/TopBar/TopBar.d.ts +0 -33
- package/dist/components/TopBar/TopBar.d.ts.map +0 -1
- package/dist/components/TopBar/topBar.types.d.ts +0 -49
- package/dist/components/TopBar/topBar.types.d.ts.map +0 -1
- package/dist/components/TopBar/topBar.variants.d.ts +0 -79
- package/dist/components/TopBar/topBar.variants.d.ts.map +0 -1
- package/dist/components/_shared/resolveValidationState.d.ts +0 -42
- package/dist/components/_shared/resolveValidationState.d.ts.map +0 -1
- package/dist/hooks/useAccessState.d.ts +0 -37
- package/dist/hooks/useAccessState.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
- package/dist/utils/cn.d.ts +0 -26
- package/dist/utils/cn.d.ts.map +0 -1
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
/**
|
|
3
|
+
* `gridVariants` — CSS Grid container + item, polymorphic in role.
|
|
4
|
+
*
|
|
5
|
+
* Architectural choice (planned with the user — F9 deep dive):
|
|
6
|
+
*
|
|
7
|
+
* Pattern is MUI Grid v2 from the API side (`<Grid container>` +
|
|
8
|
+
* `<Grid xs={6}>`), but engine is REAL CSS Grid under the hood
|
|
9
|
+
* (`display: grid` + `grid-template-columns: repeat(N, 1fr)` +
|
|
10
|
+
* `col-span-*`). MUI v2 uses flexbox + basis percentages — historical
|
|
11
|
+
* IE11 reasons. In 2026, CSS Grid is universally supported AND
|
|
12
|
+
* Tailwind ships `grid-cols-*` / `col-span-*` natively, so flexbox
|
|
13
|
+
* would be a downgrade.
|
|
14
|
+
*
|
|
15
|
+
* Two distinct shapes coexist in the same TV recipe:
|
|
16
|
+
*
|
|
17
|
+
* • container=true — display:grid + cols + gap + autoFlow
|
|
18
|
+
* • container=false — col-span at each breakpoint (xs/sm/md/lg/xl)
|
|
19
|
+
*
|
|
20
|
+
* The discriminated union lives in grid.types.ts (TypeScript-level);
|
|
21
|
+
* here the TV catalogue exposes every axis so the consumer's choice
|
|
22
|
+
* triggers the right classes regardless of which role the component
|
|
23
|
+
* is playing. Unused axes produce no classes (TV silently drops
|
|
24
|
+
* undefined variants), so a container Grid never accidentally emits
|
|
25
|
+
* `col-span-6` and an item Grid never accidentally emits `grid`.
|
|
26
|
+
*
|
|
27
|
+
* Mapping table size:
|
|
28
|
+
* • cols : 6 entries (12, 6, 4, 3, 2, 1)
|
|
29
|
+
* • autoFlow : 5 entries
|
|
30
|
+
* • span axes (5×14) : 70 entries (xs/sm/md/lg/xl × {1..12, auto, full})
|
|
31
|
+
* • gap / gapX / gapY : 33 entries (11 steps × 3 axes)
|
|
32
|
+
*
|
|
33
|
+
* Total: ~115 literal class names. All explicit, all Tailwind-scannable.
|
|
34
|
+
* Bundle CSS impact when fully exercised: ~3 KB gz (mostly the
|
|
35
|
+
* responsive col-span set).
|
|
36
|
+
*/
|
|
37
|
+
export declare const gridVariants: import("tailwind-variants").TVReturnType<{
|
|
38
|
+
container: {
|
|
39
|
+
true: string;
|
|
40
|
+
};
|
|
41
|
+
cols: {
|
|
42
|
+
1: string;
|
|
43
|
+
2: string;
|
|
44
|
+
3: string;
|
|
45
|
+
4: string;
|
|
46
|
+
6: string;
|
|
47
|
+
12: string;
|
|
48
|
+
};
|
|
49
|
+
autoFlow: {
|
|
50
|
+
row: string;
|
|
51
|
+
col: string;
|
|
52
|
+
dense: string;
|
|
53
|
+
'row-dense': string;
|
|
54
|
+
'col-dense': string;
|
|
55
|
+
};
|
|
56
|
+
spacing: {
|
|
57
|
+
0: string;
|
|
58
|
+
'0.5': string;
|
|
59
|
+
1: string;
|
|
60
|
+
2: string;
|
|
61
|
+
3: string;
|
|
62
|
+
4: string;
|
|
63
|
+
6: string;
|
|
64
|
+
8: string;
|
|
65
|
+
12: string;
|
|
66
|
+
16: string;
|
|
67
|
+
24: string;
|
|
68
|
+
};
|
|
69
|
+
spacingX: {
|
|
70
|
+
0: string;
|
|
71
|
+
'0.5': string;
|
|
72
|
+
1: string;
|
|
73
|
+
2: string;
|
|
74
|
+
3: string;
|
|
75
|
+
4: string;
|
|
76
|
+
6: string;
|
|
77
|
+
8: string;
|
|
78
|
+
12: string;
|
|
79
|
+
16: string;
|
|
80
|
+
24: string;
|
|
81
|
+
};
|
|
82
|
+
spacingY: {
|
|
83
|
+
0: string;
|
|
84
|
+
'0.5': string;
|
|
85
|
+
1: string;
|
|
86
|
+
2: string;
|
|
87
|
+
3: string;
|
|
88
|
+
4: string;
|
|
89
|
+
6: string;
|
|
90
|
+
8: string;
|
|
91
|
+
12: string;
|
|
92
|
+
16: string;
|
|
93
|
+
24: string;
|
|
94
|
+
};
|
|
95
|
+
xs: {
|
|
96
|
+
1: string;
|
|
97
|
+
2: string;
|
|
98
|
+
3: string;
|
|
99
|
+
4: string;
|
|
100
|
+
5: string;
|
|
101
|
+
6: string;
|
|
102
|
+
7: string;
|
|
103
|
+
8: string;
|
|
104
|
+
9: string;
|
|
105
|
+
10: string;
|
|
106
|
+
11: string;
|
|
107
|
+
12: string;
|
|
108
|
+
auto: string;
|
|
109
|
+
full: string;
|
|
110
|
+
};
|
|
111
|
+
sm: {
|
|
112
|
+
1: string;
|
|
113
|
+
2: string;
|
|
114
|
+
3: string;
|
|
115
|
+
4: string;
|
|
116
|
+
5: string;
|
|
117
|
+
6: string;
|
|
118
|
+
7: string;
|
|
119
|
+
8: string;
|
|
120
|
+
9: string;
|
|
121
|
+
10: string;
|
|
122
|
+
11: string;
|
|
123
|
+
12: string;
|
|
124
|
+
auto: string;
|
|
125
|
+
full: string;
|
|
126
|
+
};
|
|
127
|
+
md: {
|
|
128
|
+
1: string;
|
|
129
|
+
2: string;
|
|
130
|
+
3: string;
|
|
131
|
+
4: string;
|
|
132
|
+
5: string;
|
|
133
|
+
6: string;
|
|
134
|
+
7: string;
|
|
135
|
+
8: string;
|
|
136
|
+
9: string;
|
|
137
|
+
10: string;
|
|
138
|
+
11: string;
|
|
139
|
+
12: string;
|
|
140
|
+
auto: string;
|
|
141
|
+
full: string;
|
|
142
|
+
};
|
|
143
|
+
lg: {
|
|
144
|
+
1: string;
|
|
145
|
+
2: string;
|
|
146
|
+
3: string;
|
|
147
|
+
4: string;
|
|
148
|
+
5: string;
|
|
149
|
+
6: string;
|
|
150
|
+
7: string;
|
|
151
|
+
8: string;
|
|
152
|
+
9: string;
|
|
153
|
+
10: string;
|
|
154
|
+
11: string;
|
|
155
|
+
12: string;
|
|
156
|
+
auto: string;
|
|
157
|
+
full: string;
|
|
158
|
+
};
|
|
159
|
+
xl: {
|
|
160
|
+
1: string;
|
|
161
|
+
2: string;
|
|
162
|
+
3: string;
|
|
163
|
+
4: string;
|
|
164
|
+
5: string;
|
|
165
|
+
6: string;
|
|
166
|
+
7: string;
|
|
167
|
+
8: string;
|
|
168
|
+
9: string;
|
|
169
|
+
10: string;
|
|
170
|
+
11: string;
|
|
171
|
+
12: string;
|
|
172
|
+
auto: string;
|
|
173
|
+
full: string;
|
|
174
|
+
};
|
|
175
|
+
}, undefined, "", {
|
|
176
|
+
container: {
|
|
177
|
+
true: string;
|
|
178
|
+
};
|
|
179
|
+
cols: {
|
|
180
|
+
1: string;
|
|
181
|
+
2: string;
|
|
182
|
+
3: string;
|
|
183
|
+
4: string;
|
|
184
|
+
6: string;
|
|
185
|
+
12: string;
|
|
186
|
+
};
|
|
187
|
+
autoFlow: {
|
|
188
|
+
row: string;
|
|
189
|
+
col: string;
|
|
190
|
+
dense: string;
|
|
191
|
+
'row-dense': string;
|
|
192
|
+
'col-dense': string;
|
|
193
|
+
};
|
|
194
|
+
spacing: {
|
|
195
|
+
0: string;
|
|
196
|
+
'0.5': string;
|
|
197
|
+
1: string;
|
|
198
|
+
2: string;
|
|
199
|
+
3: string;
|
|
200
|
+
4: string;
|
|
201
|
+
6: string;
|
|
202
|
+
8: string;
|
|
203
|
+
12: string;
|
|
204
|
+
16: string;
|
|
205
|
+
24: string;
|
|
206
|
+
};
|
|
207
|
+
spacingX: {
|
|
208
|
+
0: string;
|
|
209
|
+
'0.5': string;
|
|
210
|
+
1: string;
|
|
211
|
+
2: string;
|
|
212
|
+
3: string;
|
|
213
|
+
4: string;
|
|
214
|
+
6: string;
|
|
215
|
+
8: string;
|
|
216
|
+
12: string;
|
|
217
|
+
16: string;
|
|
218
|
+
24: string;
|
|
219
|
+
};
|
|
220
|
+
spacingY: {
|
|
221
|
+
0: string;
|
|
222
|
+
'0.5': string;
|
|
223
|
+
1: string;
|
|
224
|
+
2: string;
|
|
225
|
+
3: string;
|
|
226
|
+
4: string;
|
|
227
|
+
6: string;
|
|
228
|
+
8: string;
|
|
229
|
+
12: string;
|
|
230
|
+
16: string;
|
|
231
|
+
24: string;
|
|
232
|
+
};
|
|
233
|
+
xs: {
|
|
234
|
+
1: string;
|
|
235
|
+
2: string;
|
|
236
|
+
3: string;
|
|
237
|
+
4: string;
|
|
238
|
+
5: string;
|
|
239
|
+
6: string;
|
|
240
|
+
7: string;
|
|
241
|
+
8: string;
|
|
242
|
+
9: string;
|
|
243
|
+
10: string;
|
|
244
|
+
11: string;
|
|
245
|
+
12: string;
|
|
246
|
+
auto: string;
|
|
247
|
+
full: string;
|
|
248
|
+
};
|
|
249
|
+
sm: {
|
|
250
|
+
1: string;
|
|
251
|
+
2: string;
|
|
252
|
+
3: string;
|
|
253
|
+
4: string;
|
|
254
|
+
5: string;
|
|
255
|
+
6: string;
|
|
256
|
+
7: string;
|
|
257
|
+
8: string;
|
|
258
|
+
9: string;
|
|
259
|
+
10: string;
|
|
260
|
+
11: string;
|
|
261
|
+
12: string;
|
|
262
|
+
auto: string;
|
|
263
|
+
full: string;
|
|
264
|
+
};
|
|
265
|
+
md: {
|
|
266
|
+
1: string;
|
|
267
|
+
2: string;
|
|
268
|
+
3: string;
|
|
269
|
+
4: string;
|
|
270
|
+
5: string;
|
|
271
|
+
6: string;
|
|
272
|
+
7: string;
|
|
273
|
+
8: string;
|
|
274
|
+
9: string;
|
|
275
|
+
10: string;
|
|
276
|
+
11: string;
|
|
277
|
+
12: string;
|
|
278
|
+
auto: string;
|
|
279
|
+
full: string;
|
|
280
|
+
};
|
|
281
|
+
lg: {
|
|
282
|
+
1: string;
|
|
283
|
+
2: string;
|
|
284
|
+
3: string;
|
|
285
|
+
4: string;
|
|
286
|
+
5: string;
|
|
287
|
+
6: string;
|
|
288
|
+
7: string;
|
|
289
|
+
8: string;
|
|
290
|
+
9: string;
|
|
291
|
+
10: string;
|
|
292
|
+
11: string;
|
|
293
|
+
12: string;
|
|
294
|
+
auto: string;
|
|
295
|
+
full: string;
|
|
296
|
+
};
|
|
297
|
+
xl: {
|
|
298
|
+
1: string;
|
|
299
|
+
2: string;
|
|
300
|
+
3: string;
|
|
301
|
+
4: string;
|
|
302
|
+
5: string;
|
|
303
|
+
6: string;
|
|
304
|
+
7: string;
|
|
305
|
+
8: string;
|
|
306
|
+
9: string;
|
|
307
|
+
10: string;
|
|
308
|
+
11: string;
|
|
309
|
+
12: string;
|
|
310
|
+
auto: string;
|
|
311
|
+
full: string;
|
|
312
|
+
};
|
|
313
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
314
|
+
container: {
|
|
315
|
+
true: string;
|
|
316
|
+
};
|
|
317
|
+
cols: {
|
|
318
|
+
1: string;
|
|
319
|
+
2: string;
|
|
320
|
+
3: string;
|
|
321
|
+
4: string;
|
|
322
|
+
6: string;
|
|
323
|
+
12: string;
|
|
324
|
+
};
|
|
325
|
+
autoFlow: {
|
|
326
|
+
row: string;
|
|
327
|
+
col: string;
|
|
328
|
+
dense: string;
|
|
329
|
+
'row-dense': string;
|
|
330
|
+
'col-dense': string;
|
|
331
|
+
};
|
|
332
|
+
spacing: {
|
|
333
|
+
0: string;
|
|
334
|
+
'0.5': string;
|
|
335
|
+
1: string;
|
|
336
|
+
2: string;
|
|
337
|
+
3: string;
|
|
338
|
+
4: string;
|
|
339
|
+
6: string;
|
|
340
|
+
8: string;
|
|
341
|
+
12: string;
|
|
342
|
+
16: string;
|
|
343
|
+
24: string;
|
|
344
|
+
};
|
|
345
|
+
spacingX: {
|
|
346
|
+
0: string;
|
|
347
|
+
'0.5': string;
|
|
348
|
+
1: string;
|
|
349
|
+
2: string;
|
|
350
|
+
3: string;
|
|
351
|
+
4: string;
|
|
352
|
+
6: string;
|
|
353
|
+
8: string;
|
|
354
|
+
12: string;
|
|
355
|
+
16: string;
|
|
356
|
+
24: string;
|
|
357
|
+
};
|
|
358
|
+
spacingY: {
|
|
359
|
+
0: string;
|
|
360
|
+
'0.5': string;
|
|
361
|
+
1: string;
|
|
362
|
+
2: string;
|
|
363
|
+
3: string;
|
|
364
|
+
4: string;
|
|
365
|
+
6: string;
|
|
366
|
+
8: string;
|
|
367
|
+
12: string;
|
|
368
|
+
16: string;
|
|
369
|
+
24: string;
|
|
370
|
+
};
|
|
371
|
+
xs: {
|
|
372
|
+
1: string;
|
|
373
|
+
2: string;
|
|
374
|
+
3: string;
|
|
375
|
+
4: string;
|
|
376
|
+
5: string;
|
|
377
|
+
6: string;
|
|
378
|
+
7: string;
|
|
379
|
+
8: string;
|
|
380
|
+
9: string;
|
|
381
|
+
10: string;
|
|
382
|
+
11: string;
|
|
383
|
+
12: string;
|
|
384
|
+
auto: string;
|
|
385
|
+
full: string;
|
|
386
|
+
};
|
|
387
|
+
sm: {
|
|
388
|
+
1: string;
|
|
389
|
+
2: string;
|
|
390
|
+
3: string;
|
|
391
|
+
4: string;
|
|
392
|
+
5: string;
|
|
393
|
+
6: string;
|
|
394
|
+
7: string;
|
|
395
|
+
8: string;
|
|
396
|
+
9: string;
|
|
397
|
+
10: string;
|
|
398
|
+
11: string;
|
|
399
|
+
12: string;
|
|
400
|
+
auto: string;
|
|
401
|
+
full: string;
|
|
402
|
+
};
|
|
403
|
+
md: {
|
|
404
|
+
1: string;
|
|
405
|
+
2: string;
|
|
406
|
+
3: string;
|
|
407
|
+
4: string;
|
|
408
|
+
5: string;
|
|
409
|
+
6: string;
|
|
410
|
+
7: string;
|
|
411
|
+
8: string;
|
|
412
|
+
9: string;
|
|
413
|
+
10: string;
|
|
414
|
+
11: string;
|
|
415
|
+
12: string;
|
|
416
|
+
auto: string;
|
|
417
|
+
full: string;
|
|
418
|
+
};
|
|
419
|
+
lg: {
|
|
420
|
+
1: string;
|
|
421
|
+
2: string;
|
|
422
|
+
3: string;
|
|
423
|
+
4: string;
|
|
424
|
+
5: string;
|
|
425
|
+
6: string;
|
|
426
|
+
7: string;
|
|
427
|
+
8: string;
|
|
428
|
+
9: string;
|
|
429
|
+
10: string;
|
|
430
|
+
11: string;
|
|
431
|
+
12: string;
|
|
432
|
+
auto: string;
|
|
433
|
+
full: string;
|
|
434
|
+
};
|
|
435
|
+
xl: {
|
|
436
|
+
1: string;
|
|
437
|
+
2: string;
|
|
438
|
+
3: string;
|
|
439
|
+
4: string;
|
|
440
|
+
5: string;
|
|
441
|
+
6: string;
|
|
442
|
+
7: string;
|
|
443
|
+
8: string;
|
|
444
|
+
9: string;
|
|
445
|
+
10: string;
|
|
446
|
+
11: string;
|
|
447
|
+
12: string;
|
|
448
|
+
auto: string;
|
|
449
|
+
full: string;
|
|
450
|
+
};
|
|
451
|
+
}, undefined, "", unknown, unknown, undefined>>;
|
|
452
|
+
export type GridVariants = VariantProps<typeof gridVariants>;
|
|
453
|
+
//# sourceMappingURL=grid.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Grid/grid.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA6FvB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { StackProps } from './stack.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* `<Stack>` — flex container 1D, the layout primitive.
|
|
4
|
+
*
|
|
5
|
+
* This is the ONLY component in @dashforge/tw that does flex. Box
|
|
6
|
+
* doesn't, Grid does CSS Grid (not flex). The strict naming → engine
|
|
7
|
+
* mapping is the whole point: when you read `<Stack>` in a JSX tree,
|
|
8
|
+
* you instantly know it's flex. No `<Box display="flex" ...>` traps.
|
|
9
|
+
*
|
|
10
|
+
* Direction defaults to `'col'` (vertical stack) — the most common
|
|
11
|
+
* case for forms, sidebars, settings panels. Pass `direction="row"`
|
|
12
|
+
* for horizontal layouts (toolbars, button rows, breadcrumbs).
|
|
13
|
+
*
|
|
14
|
+
* The `divider` prop is the runtime-only piece: TV can't encode the
|
|
15
|
+
* "render this between each child" logic as a class, so we walk the
|
|
16
|
+
* children at render time. The walk is O(n); for n ≤ ~10 (typical
|
|
17
|
+
* Stack content) the cost is negligible. For very long Stacks (1000+
|
|
18
|
+
* items), prefer to render dividers as part of each child instead.
|
|
19
|
+
*
|
|
20
|
+
* When `asChild` is true, the divider prop is silently ignored — Slot
|
|
21
|
+
* requires a single child, and the N-1 insertion has nowhere to act.
|
|
22
|
+
*/
|
|
23
|
+
export declare const Stack: import("react").ForwardRefExoticComponent<StackProps & import("react").RefAttributes<HTMLElement>>;
|
|
24
|
+
//# sourceMappingURL=Stack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/Stack.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAqCnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,KAAK,oGAyCjB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { StackVariants } from './stack.variants.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for `<Stack>` — flex container 1D, the layout primitive.
|
|
5
|
+
*
|
|
6
|
+
* Axes:
|
|
7
|
+
* • direction — flex-direction (default 'col')
|
|
8
|
+
* • align — items-* (cross-axis)
|
|
9
|
+
* • justify — justify-* (main-axis)
|
|
10
|
+
* • gap — token-scale spacing step
|
|
11
|
+
* • wrap — flex-wrap
|
|
12
|
+
* • fullWidth/fullHeight — w-full / h-full
|
|
13
|
+
* • divider — node rendered N-1 times between children
|
|
14
|
+
*
|
|
15
|
+
* Polymorphism:
|
|
16
|
+
* • as — override the HTML tag (default 'div')
|
|
17
|
+
* • asChild — render via Radix Slot onto the single child
|
|
18
|
+
*
|
|
19
|
+
* What Stack does NOT do (route to other primitives):
|
|
20
|
+
* • Surface chrome (border, bg, shadow) → wrap in <Box>
|
|
21
|
+
* • 2D layout (rows AND columns) → use <Grid>
|
|
22
|
+
* • Text styling → <Typography>
|
|
23
|
+
*/
|
|
24
|
+
export interface StackProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'>, Pick<StackVariants, 'direction' | 'align' | 'justify' | 'gap' | 'wrap' | 'fullWidth' | 'fullHeight'> {
|
|
25
|
+
/**
|
|
26
|
+
* Node rendered N-1 times BETWEEN children — mirror of MUI Stack's
|
|
27
|
+
* divider prop. Useful for visual separators (a `<hr>`, a thin
|
|
28
|
+
* `<Box variant="outlined" sx="h-px border-0 border-t">`, an
|
|
29
|
+
* `<svg>` glyph) that need to follow the flex direction.
|
|
30
|
+
*
|
|
31
|
+
* The node is cloned for each insertion via `cloneElement`; pass a
|
|
32
|
+
* stable element (not a function) for best React reconciliation.
|
|
33
|
+
* `React.Children.toArray` flattens fragments before the walk, so
|
|
34
|
+
* `<Stack divider={...}><><...></></Stack>` works as expected.
|
|
35
|
+
*/
|
|
36
|
+
divider?: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Override the rendered HTML tag. Defaults to `'div'`. Use when the
|
|
39
|
+
* Stack also has semantic meaning — `<Stack as="nav">` for a nav
|
|
40
|
+
* bar, `<Stack as="ul">` for a list (children become `<li>` via
|
|
41
|
+
* native HTML, not by us).
|
|
42
|
+
*
|
|
43
|
+
* Ignored when `asChild` is true.
|
|
44
|
+
*/
|
|
45
|
+
as?: ElementType;
|
|
46
|
+
/**
|
|
47
|
+
* Render via Radix `Slot` — the Stack styles paint onto the single
|
|
48
|
+
* React child instead of wrapping it. Mutually exclusive with `as`
|
|
49
|
+
* (when both are passed, `asChild` wins). The `divider` prop is
|
|
50
|
+
* ignored when `asChild` is true (the Slot pattern wraps a single
|
|
51
|
+
* node, so the N-1 insertion logic has no place to act).
|
|
52
|
+
*/
|
|
53
|
+
asChild?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Utility classes appended to the variant chain. Resolved via
|
|
56
|
+
* `tailwind-merge` so the consumer's classes always win over the
|
|
57
|
+
* variant defaults.
|
|
58
|
+
*/
|
|
59
|
+
sx?: string;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=stack.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/stack.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,EACjD,IAAI,CAAC,aAAa,EAChB,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAChD,WAAW,GAAG,YAAY,CAAC;IACvC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;;;;;;OAOG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
/**
|
|
3
|
+
* `stackVariants` — flex container 1D, the layout primitive of @dashforge/tw.
|
|
4
|
+
*
|
|
5
|
+
* Architectural role (planned with the user — F9 deep dive):
|
|
6
|
+
*
|
|
7
|
+
* Stack is the ONLY way to do flex in this library. Box is the
|
|
8
|
+
* surface (border / bg / shadow); Stack is the arrangement (direction
|
|
9
|
+
* / align / justify / gap). Two primitives, two responsibilities,
|
|
10
|
+
* zero overlap.
|
|
11
|
+
*
|
|
12
|
+
* This rules out the MUI failure mode where every `<Box display="flex"
|
|
13
|
+
* gap={2}>` quietly becomes the de-facto flex container, drowning
|
|
14
|
+
* the surface vs layout distinction. Here, if you see `<Stack>` in
|
|
15
|
+
* the JSX, you KNOW it's flex; if you see `<Box>`, you KNOW it's
|
|
16
|
+
* not. The component name carries the intent.
|
|
17
|
+
*
|
|
18
|
+
* Axes:
|
|
19
|
+
* • direction — row / col (+ reverse variants)
|
|
20
|
+
* • align / justify — cross-axis / main-axis alignment
|
|
21
|
+
* • gap — token-scale step (mirror Box spacing scale)
|
|
22
|
+
* • wrap — flex-wrap
|
|
23
|
+
* • divider — runtime-only (handled in Stack.tsx, not here)
|
|
24
|
+
*
|
|
25
|
+
* Sizing (`fullWidth`, `fullHeight`) is duplicated from Box because
|
|
26
|
+
* Stack often plays the role of a full-width strip / full-height
|
|
27
|
+
* column — re-typing `sx="w-full"` every time would be friction.
|
|
28
|
+
*/
|
|
29
|
+
export declare const stackVariants: import("tailwind-variants").TVReturnType<{
|
|
30
|
+
direction: {
|
|
31
|
+
row: string;
|
|
32
|
+
col: string;
|
|
33
|
+
'row-reverse': string;
|
|
34
|
+
'col-reverse': string;
|
|
35
|
+
};
|
|
36
|
+
align: {
|
|
37
|
+
start: string;
|
|
38
|
+
center: string;
|
|
39
|
+
end: string;
|
|
40
|
+
stretch: string;
|
|
41
|
+
baseline: string;
|
|
42
|
+
};
|
|
43
|
+
justify: {
|
|
44
|
+
start: string;
|
|
45
|
+
center: string;
|
|
46
|
+
end: string;
|
|
47
|
+
between: string;
|
|
48
|
+
around: string;
|
|
49
|
+
evenly: string;
|
|
50
|
+
};
|
|
51
|
+
gap: {
|
|
52
|
+
0: string;
|
|
53
|
+
'0.5': string;
|
|
54
|
+
1: string;
|
|
55
|
+
2: string;
|
|
56
|
+
3: string;
|
|
57
|
+
4: string;
|
|
58
|
+
6: string;
|
|
59
|
+
8: string;
|
|
60
|
+
12: string;
|
|
61
|
+
16: string;
|
|
62
|
+
24: string;
|
|
63
|
+
};
|
|
64
|
+
wrap: {
|
|
65
|
+
true: string;
|
|
66
|
+
};
|
|
67
|
+
fullWidth: {
|
|
68
|
+
true: string;
|
|
69
|
+
};
|
|
70
|
+
fullHeight: {
|
|
71
|
+
true: string;
|
|
72
|
+
};
|
|
73
|
+
}, undefined, "flex", {
|
|
74
|
+
direction: {
|
|
75
|
+
row: string;
|
|
76
|
+
col: string;
|
|
77
|
+
'row-reverse': string;
|
|
78
|
+
'col-reverse': string;
|
|
79
|
+
};
|
|
80
|
+
align: {
|
|
81
|
+
start: string;
|
|
82
|
+
center: string;
|
|
83
|
+
end: string;
|
|
84
|
+
stretch: string;
|
|
85
|
+
baseline: string;
|
|
86
|
+
};
|
|
87
|
+
justify: {
|
|
88
|
+
start: string;
|
|
89
|
+
center: string;
|
|
90
|
+
end: string;
|
|
91
|
+
between: string;
|
|
92
|
+
around: string;
|
|
93
|
+
evenly: string;
|
|
94
|
+
};
|
|
95
|
+
gap: {
|
|
96
|
+
0: string;
|
|
97
|
+
'0.5': string;
|
|
98
|
+
1: string;
|
|
99
|
+
2: string;
|
|
100
|
+
3: string;
|
|
101
|
+
4: string;
|
|
102
|
+
6: string;
|
|
103
|
+
8: string;
|
|
104
|
+
12: string;
|
|
105
|
+
16: string;
|
|
106
|
+
24: string;
|
|
107
|
+
};
|
|
108
|
+
wrap: {
|
|
109
|
+
true: string;
|
|
110
|
+
};
|
|
111
|
+
fullWidth: {
|
|
112
|
+
true: string;
|
|
113
|
+
};
|
|
114
|
+
fullHeight: {
|
|
115
|
+
true: string;
|
|
116
|
+
};
|
|
117
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
118
|
+
direction: {
|
|
119
|
+
row: string;
|
|
120
|
+
col: string;
|
|
121
|
+
'row-reverse': string;
|
|
122
|
+
'col-reverse': string;
|
|
123
|
+
};
|
|
124
|
+
align: {
|
|
125
|
+
start: string;
|
|
126
|
+
center: string;
|
|
127
|
+
end: string;
|
|
128
|
+
stretch: string;
|
|
129
|
+
baseline: string;
|
|
130
|
+
};
|
|
131
|
+
justify: {
|
|
132
|
+
start: string;
|
|
133
|
+
center: string;
|
|
134
|
+
end: string;
|
|
135
|
+
between: string;
|
|
136
|
+
around: string;
|
|
137
|
+
evenly: string;
|
|
138
|
+
};
|
|
139
|
+
gap: {
|
|
140
|
+
0: string;
|
|
141
|
+
'0.5': string;
|
|
142
|
+
1: string;
|
|
143
|
+
2: string;
|
|
144
|
+
3: string;
|
|
145
|
+
4: string;
|
|
146
|
+
6: string;
|
|
147
|
+
8: string;
|
|
148
|
+
12: string;
|
|
149
|
+
16: string;
|
|
150
|
+
24: string;
|
|
151
|
+
};
|
|
152
|
+
wrap: {
|
|
153
|
+
true: string;
|
|
154
|
+
};
|
|
155
|
+
fullWidth: {
|
|
156
|
+
true: string;
|
|
157
|
+
};
|
|
158
|
+
fullHeight: {
|
|
159
|
+
true: string;
|
|
160
|
+
};
|
|
161
|
+
}, undefined, "flex", unknown, unknown, undefined>>;
|
|
162
|
+
export type StackVariants = VariantProps<typeof stackVariants>;
|
|
163
|
+
//# sourceMappingURL=stack.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/stack.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mDAgDxB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC"}
|