@dashforge/tw 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +113 -0
- package/README.md +45 -0
- package/dist/index.esm.js +3985 -476
- package/dist/src/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/src/components/Accordion/accordion.types.d.ts +7 -0
- package/dist/src/components/Accordion/accordion.types.d.ts.map +1 -1
- package/dist/src/components/Alert/Alert.d.ts +1 -1
- package/dist/src/components/Alert/Alert.d.ts.map +1 -1
- package/dist/src/components/Alert/alert.types.d.ts +17 -0
- package/dist/src/components/Alert/alert.types.d.ts.map +1 -1
- package/dist/src/components/AppShell/AppShell.d.ts.map +1 -1
- package/dist/src/components/AppShell/appShell.types.d.ts +7 -0
- package/dist/src/components/AppShell/appShell.types.d.ts.map +1 -1
- package/dist/src/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/src/components/Autocomplete/autocomplete.types.d.ts +47 -1
- package/dist/src/components/Autocomplete/autocomplete.types.d.ts.map +1 -1
- package/dist/src/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/src/components/Avatar/avatar.types.d.ts +17 -1
- package/dist/src/components/Avatar/avatar.types.d.ts.map +1 -1
- package/dist/src/components/Badge/Badge.d.ts.map +1 -1
- package/dist/src/components/Badge/badge.types.d.ts +27 -2
- package/dist/src/components/Badge/badge.types.d.ts.map +1 -1
- package/dist/src/components/Box/Box.d.ts.map +1 -1
- package/dist/src/components/Box/box.types.d.ts +64 -1
- package/dist/src/components/Box/box.types.d.ts.map +1 -1
- package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/src/components/Breadcrumbs/breadcrumbs.types.d.ts +26 -1
- package/dist/src/components/Breadcrumbs/breadcrumbs.types.d.ts.map +1 -1
- package/dist/src/components/Button/Button.d.ts.map +1 -1
- package/dist/src/components/Button/button.types.d.ts +53 -1
- package/dist/src/components/Button/button.types.d.ts.map +1 -1
- package/dist/src/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/src/components/Calendar/calendar.types.d.ts +16 -0
- package/dist/src/components/Calendar/calendar.types.d.ts.map +1 -1
- package/dist/src/components/Card/Card.d.ts.map +1 -1
- package/dist/src/components/Card/card.types.d.ts +17 -0
- package/dist/src/components/Card/card.types.d.ts.map +1 -1
- package/dist/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/src/components/Checkbox/checkbox.types.d.ts +19 -1
- package/dist/src/components/Checkbox/checkbox.types.d.ts.map +1 -1
- package/dist/src/components/Chip/Chip.d.ts.map +1 -1
- package/dist/src/components/Chip/chip.types.d.ts +40 -1
- package/dist/src/components/Chip/chip.types.d.ts.map +1 -1
- package/dist/src/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/src/components/ConfirmDialog/confirmDialog.types.d.ts +30 -2
- package/dist/src/components/ConfirmDialog/confirmDialog.types.d.ts.map +1 -1
- package/dist/src/components/Container/Container.d.ts.map +1 -1
- package/dist/src/components/Container/container.types.d.ts +29 -1
- package/dist/src/components/Container/container.types.d.ts.map +1 -1
- package/dist/src/components/DataGrid/DataGrid.d.ts +1 -1
- package/dist/src/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/src/components/DataGrid/dataGrid.types.d.ts +124 -10
- package/dist/src/components/DataGrid/dataGrid.types.d.ts.map +1 -1
- package/dist/src/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/src/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/src/components/DatePicker/datePicker.types.d.ts +18 -0
- package/dist/src/components/DatePicker/datePicker.types.d.ts.map +1 -1
- package/dist/src/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/src/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/src/components/DateRangePicker/dateRangePicker.types.d.ts +18 -0
- package/dist/src/components/DateRangePicker/dateRangePicker.types.d.ts.map +1 -1
- package/dist/src/components/DateTimePicker/DateTimePicker.d.ts +1 -1
- package/dist/src/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/src/components/DateTimePicker/dateTimePicker.types.d.ts +20 -0
- package/dist/src/components/DateTimePicker/dateTimePicker.types.d.ts.map +1 -1
- package/dist/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/src/components/Dialog/dialog.types.d.ts +25 -1
- package/dist/src/components/Dialog/dialog.types.d.ts.map +1 -1
- package/dist/src/components/Divider/Divider.d.ts.map +1 -1
- package/dist/src/components/Divider/divider.types.d.ts +37 -1
- package/dist/src/components/Divider/divider.types.d.ts.map +1 -1
- package/dist/src/components/Drawer/Drawer.d.ts +21 -0
- package/dist/src/components/Drawer/Drawer.d.ts.map +1 -0
- package/dist/src/components/Drawer/drawer.types.d.ts +311 -0
- package/dist/src/components/Drawer/drawer.types.d.ts.map +1 -0
- package/dist/src/components/Drawer/drawer.variants.d.ts +177 -0
- package/dist/src/components/Drawer/drawer.variants.d.ts.map +1 -0
- package/dist/src/components/Grid/Grid.d.ts.map +1 -1
- package/dist/src/components/Grid/grid.types.d.ts +16 -0
- package/dist/src/components/Grid/grid.types.d.ts.map +1 -1
- package/dist/src/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/src/components/IconButton/iconButton.types.d.ts +40 -1
- package/dist/src/components/IconButton/iconButton.types.d.ts.map +1 -1
- package/dist/src/components/LeftNav/LeftNav.d.ts.map +1 -1
- package/dist/src/components/LeftNav/leftNav.types.d.ts +26 -6
- package/dist/src/components/LeftNav/leftNav.types.d.ts.map +1 -1
- package/dist/src/components/Link/Link.d.ts +15 -0
- package/dist/src/components/Link/Link.d.ts.map +1 -0
- package/dist/src/components/Link/link.types.d.ts +169 -0
- package/dist/src/components/Link/link.types.d.ts.map +1 -0
- package/dist/src/components/Link/link.variants.d.ts +107 -0
- package/dist/src/components/Link/link.variants.d.ts.map +1 -0
- package/dist/src/components/Menu/Menu.d.ts +1 -1
- package/dist/src/components/Menu/Menu.d.ts.map +1 -1
- package/dist/src/components/Menu/menu.types.d.ts +20 -0
- package/dist/src/components/Menu/menu.types.d.ts.map +1 -1
- package/dist/src/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/src/components/NumberField/numberField.types.d.ts +47 -1
- package/dist/src/components/NumberField/numberField.types.d.ts.map +1 -1
- package/dist/src/components/OTPField/OTPField.d.ts.map +1 -1
- package/dist/src/components/OTPField/otpField.types.d.ts +35 -1
- package/dist/src/components/OTPField/otpField.types.d.ts.map +1 -1
- package/dist/src/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/src/components/Pagination/pagination.types.d.ts +26 -1
- package/dist/src/components/Pagination/pagination.types.d.ts.map +1 -1
- package/dist/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/src/components/Popover/popover.types.d.ts +29 -0
- package/dist/src/components/Popover/popover.types.d.ts.map +1 -1
- package/dist/src/components/Progress/Progress.d.ts +20 -0
- package/dist/src/components/Progress/Progress.d.ts.map +1 -0
- package/dist/src/components/Progress/progress.types.d.ts +200 -0
- package/dist/src/components/Progress/progress.types.d.ts.map +1 -0
- package/dist/src/components/Progress/progress.variants.d.ts +224 -0
- package/dist/src/components/Progress/progress.variants.d.ts.map +1 -0
- package/dist/src/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/src/components/RadioGroup/radioGroup.types.d.ts +25 -1
- package/dist/src/components/RadioGroup/radioGroup.types.d.ts.map +1 -1
- package/dist/src/components/Select/Select.d.ts +14 -0
- package/dist/src/components/Select/Select.d.ts.map +1 -0
- package/dist/src/components/Select/select.types.d.ts +272 -0
- package/dist/src/components/Select/select.types.d.ts.map +1 -0
- package/dist/src/components/Select/select.variants.d.ts +204 -0
- package/dist/src/components/Select/select.variants.d.ts.map +1 -0
- package/dist/src/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/src/components/Skeleton/skeleton.types.d.ts +25 -1
- package/dist/src/components/Skeleton/skeleton.types.d.ts.map +1 -1
- package/dist/src/components/Slider/Slider.d.ts +15 -0
- package/dist/src/components/Slider/Slider.d.ts.map +1 -0
- package/dist/src/components/Slider/slider.types.d.ts +268 -0
- package/dist/src/components/Slider/slider.types.d.ts.map +1 -0
- package/dist/src/components/Slider/slider.variants.d.ts +313 -0
- package/dist/src/components/Slider/slider.variants.d.ts.map +1 -0
- package/dist/src/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/dist/src/components/Snackbar/snackbar.types.d.ts +29 -5
- package/dist/src/components/Snackbar/snackbar.types.d.ts.map +1 -1
- package/dist/src/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/src/components/Spinner/spinner.types.d.ts +22 -2
- package/dist/src/components/Spinner/spinner.types.d.ts.map +1 -1
- package/dist/src/components/Stack/Stack.d.ts.map +1 -1
- package/dist/src/components/Stack/stack.types.d.ts +53 -2
- package/dist/src/components/Stack/stack.types.d.ts.map +1 -1
- package/dist/src/components/Stack/stack.variants.d.ts +23 -0
- package/dist/src/components/Stack/stack.variants.d.ts.map +1 -1
- package/dist/src/components/Stepper/Step.d.ts +30 -0
- package/dist/src/components/Stepper/Step.d.ts.map +1 -0
- package/dist/src/components/Stepper/Stepper.d.ts +15 -0
- package/dist/src/components/Stepper/Stepper.d.ts.map +1 -0
- package/dist/src/components/Stepper/StepperContext.d.ts +8 -0
- package/dist/src/components/Stepper/StepperContext.d.ts.map +1 -0
- package/dist/src/components/Stepper/stepper.types.d.ts +358 -0
- package/dist/src/components/Stepper/stepper.types.d.ts.map +1 -0
- package/dist/src/components/Stepper/stepper.variants.d.ts +253 -0
- package/dist/src/components/Stepper/stepper.variants.d.ts.map +1 -0
- package/dist/src/components/Stepper/useStep.d.ts +53 -0
- package/dist/src/components/Stepper/useStep.d.ts.map +1 -0
- package/dist/src/components/Switch/Switch.d.ts.map +1 -1
- package/dist/src/components/Switch/switch.types.d.ts +44 -1
- package/dist/src/components/Switch/switch.types.d.ts.map +1 -1
- package/dist/src/components/Table/Table.d.ts +1 -1
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/table.types.d.ts +103 -8
- package/dist/src/components/Table/table.types.d.ts.map +1 -1
- package/dist/src/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/src/components/Tabs/tabs.types.d.ts +26 -1
- package/dist/src/components/Tabs/tabs.types.d.ts.map +1 -1
- package/dist/src/components/TextField/TextField.d.ts.map +1 -1
- package/dist/src/components/TextField/textField.types.d.ts +30 -1
- package/dist/src/components/TextField/textField.types.d.ts.map +1 -1
- package/dist/src/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/src/components/Textarea/textarea.types.d.ts +51 -1
- package/dist/src/components/Textarea/textarea.types.d.ts.map +1 -1
- package/dist/src/components/TimePicker/TimePicker.d.ts +1 -1
- package/dist/src/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/src/components/TimePicker/timePicker.types.d.ts +18 -0
- package/dist/src/components/TimePicker/timePicker.types.d.ts.map +1 -1
- package/dist/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/src/components/Tooltip/tooltip.types.d.ts +30 -0
- package/dist/src/components/Tooltip/tooltip.types.d.ts.map +1 -1
- package/dist/src/components/TopBar/TopBar.d.ts.map +1 -1
- package/dist/src/components/TopBar/topBar.types.d.ts +25 -1
- package/dist/src/components/TopBar/topBar.types.d.ts.map +1 -1
- package/dist/src/components/Typography/Typography.d.ts.map +1 -1
- package/dist/src/components/Typography/typography.types.d.ts +47 -1
- package/dist/src/components/Typography/typography.types.d.ts.map +1 -1
- package/dist/src/components/Typography/typography.variants.d.ts +2 -2
- package/dist/src/components/Typography/typography.variants.d.ts.map +1 -1
- package/dist/src/hooks/useStandaloneFieldWarning.d.ts +38 -0
- package/dist/src/hooks/useStandaloneFieldWarning.d.ts.map +1 -0
- package/dist/src/index.d.ts +61 -41
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
/**
|
|
3
|
+
* Tailwind-variants recipe for `<Progress>` — display-only determinate
|
|
4
|
+
* progress bar. Two visual flavors:
|
|
5
|
+
*
|
|
6
|
+
* - `variant='linear'` — horizontal bar with a filled `bar` slot
|
|
7
|
+
* - `variant='circular'` — SVG arc with a filled `arc` slot
|
|
8
|
+
*
|
|
9
|
+
* Slots:
|
|
10
|
+
* - `root` — outer wrapper (label + control + value label)
|
|
11
|
+
* - `label` — optional field-style label above the control
|
|
12
|
+
* - `control` — the linear track OR the SVG viewport for circular
|
|
13
|
+
* - `track` — the grey background (linear bar OR circular ring)
|
|
14
|
+
* - `bar` — the filled portion on the linear variant
|
|
15
|
+
* - `arc` — the filled arc on the circular variant
|
|
16
|
+
* - `valueLabel` — the `%` text (positioned differently per variant)
|
|
17
|
+
*
|
|
18
|
+
* Colour intents match the rest of the catalog. `neutral` skips
|
|
19
|
+
* `dark:` variants — the preset CSS-var swap handles inversion.
|
|
20
|
+
* Thickness axis controls the track height on `linear` and the arc
|
|
21
|
+
* `stroke-width` on `circular`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const progressVariants: import("tailwind-variants").TVReturnType<{
|
|
24
|
+
variant: {
|
|
25
|
+
linear: {
|
|
26
|
+
control: string;
|
|
27
|
+
track: string;
|
|
28
|
+
};
|
|
29
|
+
circular: {
|
|
30
|
+
control: string;
|
|
31
|
+
track: string;
|
|
32
|
+
valueLabel: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
color: {
|
|
36
|
+
primary: {
|
|
37
|
+
bar: string;
|
|
38
|
+
arc: string;
|
|
39
|
+
};
|
|
40
|
+
secondary: {
|
|
41
|
+
bar: string;
|
|
42
|
+
arc: string;
|
|
43
|
+
};
|
|
44
|
+
success: {
|
|
45
|
+
bar: string;
|
|
46
|
+
arc: string;
|
|
47
|
+
};
|
|
48
|
+
warning: {
|
|
49
|
+
bar: string;
|
|
50
|
+
arc: string;
|
|
51
|
+
};
|
|
52
|
+
danger: {
|
|
53
|
+
bar: string;
|
|
54
|
+
arc: string;
|
|
55
|
+
};
|
|
56
|
+
neutral: {
|
|
57
|
+
bar: string;
|
|
58
|
+
arc: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
size: {
|
|
62
|
+
sm: {
|
|
63
|
+
control: string;
|
|
64
|
+
};
|
|
65
|
+
md: {
|
|
66
|
+
control: string;
|
|
67
|
+
};
|
|
68
|
+
lg: {
|
|
69
|
+
control: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
fullWidth: {
|
|
73
|
+
true: {
|
|
74
|
+
root: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}, {
|
|
78
|
+
root: string;
|
|
79
|
+
label: string;
|
|
80
|
+
control: string;
|
|
81
|
+
track: string;
|
|
82
|
+
bar: string[];
|
|
83
|
+
arc: string[];
|
|
84
|
+
valueLabel: string;
|
|
85
|
+
}, undefined, {
|
|
86
|
+
variant: {
|
|
87
|
+
linear: {
|
|
88
|
+
control: string;
|
|
89
|
+
track: string;
|
|
90
|
+
};
|
|
91
|
+
circular: {
|
|
92
|
+
control: string;
|
|
93
|
+
track: string;
|
|
94
|
+
valueLabel: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
color: {
|
|
98
|
+
primary: {
|
|
99
|
+
bar: string;
|
|
100
|
+
arc: string;
|
|
101
|
+
};
|
|
102
|
+
secondary: {
|
|
103
|
+
bar: string;
|
|
104
|
+
arc: string;
|
|
105
|
+
};
|
|
106
|
+
success: {
|
|
107
|
+
bar: string;
|
|
108
|
+
arc: string;
|
|
109
|
+
};
|
|
110
|
+
warning: {
|
|
111
|
+
bar: string;
|
|
112
|
+
arc: string;
|
|
113
|
+
};
|
|
114
|
+
danger: {
|
|
115
|
+
bar: string;
|
|
116
|
+
arc: string;
|
|
117
|
+
};
|
|
118
|
+
neutral: {
|
|
119
|
+
bar: string;
|
|
120
|
+
arc: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
size: {
|
|
124
|
+
sm: {
|
|
125
|
+
control: string;
|
|
126
|
+
};
|
|
127
|
+
md: {
|
|
128
|
+
control: string;
|
|
129
|
+
};
|
|
130
|
+
lg: {
|
|
131
|
+
control: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
fullWidth: {
|
|
135
|
+
true: {
|
|
136
|
+
root: string;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
}, {
|
|
140
|
+
root: string;
|
|
141
|
+
label: string;
|
|
142
|
+
control: string;
|
|
143
|
+
track: string;
|
|
144
|
+
bar: string[];
|
|
145
|
+
arc: string[];
|
|
146
|
+
valueLabel: string;
|
|
147
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
148
|
+
variant: {
|
|
149
|
+
linear: {
|
|
150
|
+
control: string;
|
|
151
|
+
track: string;
|
|
152
|
+
};
|
|
153
|
+
circular: {
|
|
154
|
+
control: string;
|
|
155
|
+
track: string;
|
|
156
|
+
valueLabel: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
color: {
|
|
160
|
+
primary: {
|
|
161
|
+
bar: string;
|
|
162
|
+
arc: string;
|
|
163
|
+
};
|
|
164
|
+
secondary: {
|
|
165
|
+
bar: string;
|
|
166
|
+
arc: string;
|
|
167
|
+
};
|
|
168
|
+
success: {
|
|
169
|
+
bar: string;
|
|
170
|
+
arc: string;
|
|
171
|
+
};
|
|
172
|
+
warning: {
|
|
173
|
+
bar: string;
|
|
174
|
+
arc: string;
|
|
175
|
+
};
|
|
176
|
+
danger: {
|
|
177
|
+
bar: string;
|
|
178
|
+
arc: string;
|
|
179
|
+
};
|
|
180
|
+
neutral: {
|
|
181
|
+
bar: string;
|
|
182
|
+
arc: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
size: {
|
|
186
|
+
sm: {
|
|
187
|
+
control: string;
|
|
188
|
+
};
|
|
189
|
+
md: {
|
|
190
|
+
control: string;
|
|
191
|
+
};
|
|
192
|
+
lg: {
|
|
193
|
+
control: string;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
fullWidth: {
|
|
197
|
+
true: {
|
|
198
|
+
root: string;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
}, {
|
|
202
|
+
root: string;
|
|
203
|
+
label: string;
|
|
204
|
+
control: string;
|
|
205
|
+
track: string;
|
|
206
|
+
bar: string[];
|
|
207
|
+
arc: string[];
|
|
208
|
+
valueLabel: string;
|
|
209
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
210
|
+
export type ProgressVariants = VariantProps<typeof progressVariants>;
|
|
211
|
+
/**
|
|
212
|
+
* Linear track height (in px) per (size × thickness) pair. Derived
|
|
213
|
+
* inline in the component to avoid a compound-variant explosion.
|
|
214
|
+
*/
|
|
215
|
+
export declare const LINEAR_TRACK_HEIGHTS: Record<'sm' | 'md' | 'lg', Record<'thin' | 'md' | 'thick', number>>;
|
|
216
|
+
/**
|
|
217
|
+
* Circular geometry per size — SVG viewBox is a square. Radius +
|
|
218
|
+
* stroke-width define the visible arc. Derived inline.
|
|
219
|
+
*/
|
|
220
|
+
export declare const CIRCULAR_GEOMETRY: Record<'sm' | 'md' | 'lg', Record<'thin' | 'md' | 'thick', {
|
|
221
|
+
size: number;
|
|
222
|
+
stroke: number;
|
|
223
|
+
}>>;
|
|
224
|
+
//# sourceMappingURL=progress.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Progress/progress.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAuE3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,IAAI,GAAG,IAAI,GAAG,IAAI,EAClB,MAAM,CAAC,MAAM,GAAG,IAAI,GAAG,OAAO,EAAE,MAAM,CAAC,CAKxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,IAAI,GAAG,IAAI,GAAG,IAAI,EAClB,MAAM,CAAC,MAAM,GAAG,IAAI,GAAG,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAKlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kDA6PhD"}
|
|
@@ -2,6 +2,19 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import type { Engine } from '@dashforge/ui-core';
|
|
3
3
|
import type { AccessRequirement } from '@dashforge/rbac';
|
|
4
4
|
import type { RadioGroupVariants } from './radioGroup.variants.js';
|
|
5
|
+
/**
|
|
6
|
+
* Subset of `<RadioGroup>` props theme-configurable via
|
|
7
|
+
* `theme.components.RadioGroup.defaults` (Option C).
|
|
8
|
+
*/
|
|
9
|
+
export type RadioGroupVariantProps = Pick<RadioGroupVariants, 'size' | 'layout'>;
|
|
10
|
+
declare module '@dashforge/tw-tokens' {
|
|
11
|
+
interface TWComponentDefaults {
|
|
12
|
+
RadioGroup?: {
|
|
13
|
+
defaults?: Partial<RadioGroupVariantProps>;
|
|
14
|
+
slotProps?: RadioGroupSlotProps;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
5
18
|
/**
|
|
6
19
|
* A single selectable option in a `<RadioGroup>`.
|
|
7
20
|
*/
|
|
@@ -68,7 +81,18 @@ export interface RadioGroupSlotProps {
|
|
|
68
81
|
* same `name` / `rules` / `visibleWhen` / `access` semantics, same
|
|
69
82
|
* Form Closure v1 error gating, same option-level RBAC.
|
|
70
83
|
*/
|
|
71
|
-
export interface RadioGroupProps
|
|
84
|
+
export interface RadioGroupProps {
|
|
85
|
+
/**
|
|
86
|
+
* Density tier — drives radio dot size + label font-size.
|
|
87
|
+
* @default 'md'
|
|
88
|
+
*/
|
|
89
|
+
size?: RadioGroupVariants['size'];
|
|
90
|
+
/**
|
|
91
|
+
* Option list direction. `'stacked'` (default) is vertical;
|
|
92
|
+
* `'row'` is horizontal.
|
|
93
|
+
* @default 'stacked'
|
|
94
|
+
*/
|
|
95
|
+
layout?: RadioGroupVariants['layout'];
|
|
72
96
|
/** Field name registered with the bridge. */
|
|
73
97
|
name: string;
|
|
74
98
|
/** Array of selectable options. Order is render order. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radioGroup.types.d.ts","sourceRoot":"","sources":["../../../../src/components/RadioGroup/radioGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE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AAI,CAAC;CACzC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { SelectProps, SelectValue } from './select.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* `<Select>` — generic-friendly forwardRef wrapper.
|
|
5
|
+
*
|
|
6
|
+
* The type dance below preserves the `V` type parameter through
|
|
7
|
+
* `forwardRef`, which by default would strip it. Consumers can either
|
|
8
|
+
* let TypeScript infer `V` from `options` or pass it explicitly:
|
|
9
|
+
* `<Select<'a' | 'b'> options={…} onChange={…} />`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Select: <V extends SelectValue = string>(props: SelectProps<V> & {
|
|
12
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
13
|
+
}) => ReactElement | null;
|
|
14
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAIV,WAAW,EACX,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAqlB3B;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,EAA8B,CAAC,CAAC,SAAS,WAAW,GAAG,MAAM,EAC9E,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAC3D,YAAY,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Engine } from '@dashforge/ui-core';
|
|
3
|
+
import type { AccessRequirement } from '@dashforge/rbac';
|
|
4
|
+
import type { SelectVariants } from './select.variants.js';
|
|
5
|
+
/**
|
|
6
|
+
* The primitive types `<Select>` accepts as an option value.
|
|
7
|
+
*
|
|
8
|
+
* `string` for enum tokens (`'solid' | 'outline'`), `number` for numeric
|
|
9
|
+
* IDs (typical when the backend stores integer foreign keys). Union-of-
|
|
10
|
+
* strings is inferred from the options array so `V` narrows precisely at
|
|
11
|
+
* the consumer site — `<Select options={[{value:'a',...},{value:'b',...}]} />`
|
|
12
|
+
* gives `onChange: (value: 'a' | 'b', ...) => void`.
|
|
13
|
+
*/
|
|
14
|
+
export type SelectValue = string | number;
|
|
15
|
+
/**
|
|
16
|
+
* A single option in the picker's list.
|
|
17
|
+
*
|
|
18
|
+
* Mirrors `AutocompleteOption` on purpose — Blueprint's `TwSelect`
|
|
19
|
+
* binding (and any consumer alternating between Autocomplete and Select)
|
|
20
|
+
* pastes the same array between the two.
|
|
21
|
+
*
|
|
22
|
+
* @typeParam V — the primitive that gets committed to the form when the
|
|
23
|
+
* option is selected. Defaults to `string`; pass `number`
|
|
24
|
+
* for enums whose identity is a numeric ID.
|
|
25
|
+
*
|
|
26
|
+
* `label` is `ReactNode` (not `string`) on purpose: it lets consumers
|
|
27
|
+
* pass a `<Trans i18nKey="…" />` / `<FormattedMessage …/>` for reactive
|
|
28
|
+
* i18n without wrapping the whole options array in a `useMemo`. If the
|
|
29
|
+
* app's i18n exposes a `t()` function that returns a string, the same
|
|
30
|
+
* `useMemo` pattern applies — see the "Static enum options with i18n"
|
|
31
|
+
* section of the docs.
|
|
32
|
+
*/
|
|
33
|
+
export interface SelectOption<V extends SelectValue = string> {
|
|
34
|
+
/** The primitive persisted on the form and matched against `value`. */
|
|
35
|
+
value: V;
|
|
36
|
+
/** Display label — accepts any React node for icons / rich content / i18n. */
|
|
37
|
+
label: ReactNode;
|
|
38
|
+
/** Per-option explicit disable — grays the row and blocks selection. */
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Subset of `<Select>` props theme-configurable via
|
|
43
|
+
* `theme.components.Select.defaults` (Option C).
|
|
44
|
+
*
|
|
45
|
+
* These are the axes a design system typically pins application-wide
|
|
46
|
+
* (density, layout convention, fullWidth default in a compact panel).
|
|
47
|
+
*/
|
|
48
|
+
export type SelectVariantProps = Pick<SelectVariants, 'size' | 'layout' | 'fullWidth'>;
|
|
49
|
+
/**
|
|
50
|
+
* Per-slot override map. Each entry accepts `{ className?: string }`.
|
|
51
|
+
* See {@link selectVariants} for the full slot roster.
|
|
52
|
+
*/
|
|
53
|
+
export interface SelectSlotProps {
|
|
54
|
+
root?: {
|
|
55
|
+
className?: string;
|
|
56
|
+
};
|
|
57
|
+
label?: {
|
|
58
|
+
className?: string;
|
|
59
|
+
};
|
|
60
|
+
requiredMark?: {
|
|
61
|
+
className?: string;
|
|
62
|
+
};
|
|
63
|
+
trigger?: {
|
|
64
|
+
className?: string;
|
|
65
|
+
};
|
|
66
|
+
triggerText?: {
|
|
67
|
+
className?: string;
|
|
68
|
+
};
|
|
69
|
+
triggerPlaceholder?: {
|
|
70
|
+
className?: string;
|
|
71
|
+
};
|
|
72
|
+
chevron?: {
|
|
73
|
+
className?: string;
|
|
74
|
+
};
|
|
75
|
+
popover?: {
|
|
76
|
+
className?: string;
|
|
77
|
+
};
|
|
78
|
+
listBox?: {
|
|
79
|
+
className?: string;
|
|
80
|
+
};
|
|
81
|
+
listItem?: {
|
|
82
|
+
className?: string;
|
|
83
|
+
};
|
|
84
|
+
listItemIndicator?: {
|
|
85
|
+
className?: string;
|
|
86
|
+
};
|
|
87
|
+
emptyState?: {
|
|
88
|
+
className?: string;
|
|
89
|
+
};
|
|
90
|
+
helperText?: {
|
|
91
|
+
className?: string;
|
|
92
|
+
};
|
|
93
|
+
errorText?: {
|
|
94
|
+
className?: string;
|
|
95
|
+
};
|
|
96
|
+
chipsList?: {
|
|
97
|
+
className?: string;
|
|
98
|
+
};
|
|
99
|
+
chip?: {
|
|
100
|
+
className?: string;
|
|
101
|
+
};
|
|
102
|
+
chipRemove?: {
|
|
103
|
+
className?: string;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
declare module '@dashforge/tw-tokens' {
|
|
107
|
+
interface TWComponentDefaults {
|
|
108
|
+
Select?: {
|
|
109
|
+
defaults?: Partial<SelectVariantProps>;
|
|
110
|
+
slotProps?: SelectSlotProps;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Change handler signature.
|
|
116
|
+
*
|
|
117
|
+
* Fires with the primitive value AND the full `SelectOption` object so
|
|
118
|
+
* the consumer can:
|
|
119
|
+
* - Simple case: `onChange={setVariant}` — TS narrows `value` to the
|
|
120
|
+
* literal union inferred from options.
|
|
121
|
+
* - Rich case: destructure `(value, option) => …` to access custom
|
|
122
|
+
* fields the consumer put on the option (icon, region metadata,
|
|
123
|
+
* server-side row identifier, etc.).
|
|
124
|
+
*
|
|
125
|
+
* For `multiple: true`, the signature carries the full array of selected
|
|
126
|
+
* values and the full array of matching options — same ergonomic in
|
|
127
|
+
* both directions.
|
|
128
|
+
*/
|
|
129
|
+
export type SelectChangeHandler<V extends SelectValue = string> = (value: V, option: SelectOption<V>) => void;
|
|
130
|
+
export type SelectMultiChangeHandler<V extends SelectValue = string> = (values: V[], options: SelectOption<V>[]) => void;
|
|
131
|
+
/**
|
|
132
|
+
* Props for `<Select>`. The primitive shipped in Sprint 6 as the
|
|
133
|
+
* dedicated enum picker — chosen over extending `<Autocomplete>` with
|
|
134
|
+
* a `disableSearch` flag so the two components have clean boundaries
|
|
135
|
+
* (Autocomplete = search / async / typeahead; Select = static enum /
|
|
136
|
+
* 3–10 options / no search).
|
|
137
|
+
*
|
|
138
|
+
* Behaviour parity with the rest of the tw form catalog:
|
|
139
|
+
* - Bridge integration inside `<DashFormProvider>` (registers via
|
|
140
|
+
* `bridge.register(name, rules)`, subscribes reactively via
|
|
141
|
+
* `useDashFieldMeta(name)`, commits via `bridge.setValue`).
|
|
142
|
+
* - Standalone controlled outside a form (pass `value` + `onChange`).
|
|
143
|
+
* - RBAC (`access`) + visibility (`visibleWhen`) forwarded to the
|
|
144
|
+
* `useAccessState` / `useEngineVisibility` hooks used everywhere
|
|
145
|
+
* else in the catalog.
|
|
146
|
+
*
|
|
147
|
+
* @typeParam V — the primitive type of the option values. Inferred from
|
|
148
|
+
* the options array — `<Select options={[{value:'a'},...]}/>`
|
|
149
|
+
* narrows `value` and `onChange` to the union of the passed
|
|
150
|
+
* literals.
|
|
151
|
+
*/
|
|
152
|
+
export interface SelectProps<V extends SelectValue = string> {
|
|
153
|
+
/**
|
|
154
|
+
* Field name — required at the TypeScript level. Consistent with the
|
|
155
|
+
* rest of the tw form catalog: enforcing `name` at compile time
|
|
156
|
+
* prevents the "silent no-op" family of bugs (see #113).
|
|
157
|
+
*/
|
|
158
|
+
name: string;
|
|
159
|
+
/**
|
|
160
|
+
* React Hook Form rule set. Forwarded to `bridge.register(name, rules)`
|
|
161
|
+
* when inside a `<DashFormProvider>`. Ignored outside a form.
|
|
162
|
+
* Untyped by design here — the rules shape belongs to whatever RHF
|
|
163
|
+
* version the consumer app pins, so we pass through as-is (mirrors
|
|
164
|
+
* Autocomplete's `rules?: unknown`).
|
|
165
|
+
*/
|
|
166
|
+
rules?: unknown;
|
|
167
|
+
/**
|
|
168
|
+
* Text or node shown above (or to the left of, in `inline` layout)
|
|
169
|
+
* the trigger.
|
|
170
|
+
*/
|
|
171
|
+
label?: ReactNode;
|
|
172
|
+
/**
|
|
173
|
+
* Descriptive line under the trigger. Replaced by the bridge's
|
|
174
|
+
* validation error when the field is invalid.
|
|
175
|
+
*/
|
|
176
|
+
helperText?: ReactNode;
|
|
177
|
+
/**
|
|
178
|
+
* Force error state without consulting the bridge — useful for
|
|
179
|
+
* server-side / async validation the bridge doesn't own.
|
|
180
|
+
*/
|
|
181
|
+
error?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Renders the red `*` required marker and forwards to the native
|
|
184
|
+
* `required` attribute. Distinct from `rules.required` — this one
|
|
185
|
+
* is purely visual + native; the bridge validation runs independently.
|
|
186
|
+
*/
|
|
187
|
+
required?: boolean;
|
|
188
|
+
/** Grays out the trigger + popover, blocks keyboard interaction. */
|
|
189
|
+
disabled?: boolean;
|
|
190
|
+
/** Stretches the root + trigger to `w-full`. */
|
|
191
|
+
fullWidth?: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Layout — `stacked` (label above trigger) or `inline` (label on the
|
|
194
|
+
* left, trigger on the right). Matches Autocomplete.
|
|
195
|
+
* @default 'stacked'
|
|
196
|
+
*/
|
|
197
|
+
layout?: SelectVariants['layout'];
|
|
198
|
+
/**
|
|
199
|
+
* Density knob — matches Autocomplete + TextField / NumberField.
|
|
200
|
+
* @default 'md'
|
|
201
|
+
*/
|
|
202
|
+
size?: SelectVariants['size'];
|
|
203
|
+
/** Reactive visibility predicate. Falsy → renders null. */
|
|
204
|
+
visibleWhen?: (engine: Engine) => boolean;
|
|
205
|
+
/** RBAC gate. See `useAccessState`. */
|
|
206
|
+
access?: AccessRequirement;
|
|
207
|
+
/**
|
|
208
|
+
* The static options list. `[]` renders the empty state in the
|
|
209
|
+
* popover. Consumers typically define this at module scope for
|
|
210
|
+
* stability, or `useMemo` it if the list depends on props / i18n.
|
|
211
|
+
*/
|
|
212
|
+
options: readonly SelectOption<V>[];
|
|
213
|
+
/**
|
|
214
|
+
* Placeholder text shown in the trigger when no value is selected.
|
|
215
|
+
* @default 'Select…'
|
|
216
|
+
*/
|
|
217
|
+
placeholder?: ReactNode;
|
|
218
|
+
/**
|
|
219
|
+
* Fallback rendered inside the popover when `options` is empty.
|
|
220
|
+
* @default 'No options'
|
|
221
|
+
*/
|
|
222
|
+
emptyState?: ReactNode;
|
|
223
|
+
/**
|
|
224
|
+
* Controlled selection. For single-select, the primitive value of
|
|
225
|
+
* the currently chosen option (or `null` for nothing selected). For
|
|
226
|
+
* multi-select (`multiple: true`), the array of selected values.
|
|
227
|
+
*
|
|
228
|
+
* When omitted AND the field is not bridge-managed, the component
|
|
229
|
+
* runs uncontrolled and manages selection internally.
|
|
230
|
+
*/
|
|
231
|
+
value?: V | V[] | null;
|
|
232
|
+
/**
|
|
233
|
+
* Uncontrolled initial value. Same shape rules as `value`.
|
|
234
|
+
*/
|
|
235
|
+
defaultValue?: V | V[] | null;
|
|
236
|
+
/**
|
|
237
|
+
* Called on selection change.
|
|
238
|
+
*
|
|
239
|
+
* Two arguments — the primitive value that will be committed to the
|
|
240
|
+
* form, AND the full `SelectOption` object (for consumers who put
|
|
241
|
+
* custom fields on the option and want them at hand in the callback
|
|
242
|
+
* without an extra lookup).
|
|
243
|
+
*
|
|
244
|
+
* TypeScript picks the single- or multi-select signature based on
|
|
245
|
+
* the runtime `multiple` prop via the discriminated union at the
|
|
246
|
+
* type layer.
|
|
247
|
+
*/
|
|
248
|
+
onChange?: SelectChangeHandler<V> | SelectMultiChangeHandler<V>;
|
|
249
|
+
/** Fired on trigger blur (after the popover closes). */
|
|
250
|
+
onBlur?: () => void;
|
|
251
|
+
/**
|
|
252
|
+
* When true, allows multiple selections. `value` / `defaultValue`
|
|
253
|
+
* become arrays; `onChange` receives the array signature; the trigger
|
|
254
|
+
* renders a chip list of selected items.
|
|
255
|
+
*
|
|
256
|
+
* Additive — single-select consumers ignore this and get the classic
|
|
257
|
+
* enum picker behaviour.
|
|
258
|
+
*
|
|
259
|
+
* @default false
|
|
260
|
+
*/
|
|
261
|
+
multiple?: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* Utility-class shortcut for `slotProps.trigger.className` — mirrors
|
|
264
|
+
* the Dashforge idiom on other primitives (Button, Dialog, Link).
|
|
265
|
+
*/
|
|
266
|
+
sx?: string;
|
|
267
|
+
/** Per-slot overrides. */
|
|
268
|
+
slotProps?: SelectSlotProps;
|
|
269
|
+
/** `data-testid` forwarded to the root wrapper. */
|
|
270
|
+
testId?: string;
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=select.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.types.d.ts","sourceRoot":"","sources":["../../../../src/components/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