@dashforge/tw 1.1.1 → 1.3.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 +141 -0
- package/README.md +45 -0
- package/dist/index.esm.js +4443 -667
- 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/Image/Image.d.ts +27 -0
- package/dist/src/components/Image/Image.d.ts.map +1 -0
- package/dist/src/components/Image/image.types.d.ts +126 -0
- package/dist/src/components/Image/image.types.d.ts.map +1 -0
- package/dist/src/components/Image/image.variants.d.ts +149 -0
- package/dist/src/components/Image/image.variants.d.ts.map +1 -0
- 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 +279 -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 +66 -42
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +5 -4
|
@@ -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/Select/select.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
/**
|
|
3
|
+
* Tailwind-variants recipe for `<Select>` — enum picker with slots.
|
|
4
|
+
*
|
|
5
|
+
* Slots (mirror Autocomplete where semantics overlap so Blueprint's
|
|
6
|
+
* TwSelect binding migration is a rename, not a rewrite):
|
|
7
|
+
* - `root` — outer wrapper (label + trigger + helper/error)
|
|
8
|
+
* - `label` — text label above the trigger
|
|
9
|
+
* - `requiredMark` — red `*` for required fields
|
|
10
|
+
* - `trigger` — button surface displaying the current value
|
|
11
|
+
* - `triggerText` — the selected label text (or placeholder)
|
|
12
|
+
* - `triggerPlaceholder` — muted placeholder when no value is selected
|
|
13
|
+
* - `chevron` — caret glyph on the trigger, rotates on open
|
|
14
|
+
* - `popover` — floating panel containing the option list
|
|
15
|
+
* - `listBox` — the `<ul>` wrapping the options
|
|
16
|
+
* - `listItem` — single option row
|
|
17
|
+
* - `listItemIndicator` — checkmark on the currently-selected option
|
|
18
|
+
* - `emptyState` — fallback when the options array is empty
|
|
19
|
+
* - `helperText` — descriptive line below the trigger
|
|
20
|
+
* - `errorText` — semantic counterpart for error mode
|
|
21
|
+
* - `chipsList` — wrapper around selected chips (multi-select only)
|
|
22
|
+
* - `chip` — individual selected chip
|
|
23
|
+
* - `chipRemove` — `×` button on a chip
|
|
24
|
+
*
|
|
25
|
+
* Sized / laid-out via the same axes as Autocomplete for consistency —
|
|
26
|
+
* consumers switching between the two get identical density knobs.
|
|
27
|
+
*/
|
|
28
|
+
export declare const selectVariants: import("tailwind-variants").TVReturnType<{
|
|
29
|
+
size: {
|
|
30
|
+
sm: {
|
|
31
|
+
trigger: string;
|
|
32
|
+
chevron: string;
|
|
33
|
+
};
|
|
34
|
+
md: {
|
|
35
|
+
trigger: string;
|
|
36
|
+
chevron: string;
|
|
37
|
+
};
|
|
38
|
+
lg: {
|
|
39
|
+
trigger: string;
|
|
40
|
+
chevron: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
layout: {
|
|
44
|
+
stacked: {
|
|
45
|
+
root: string;
|
|
46
|
+
};
|
|
47
|
+
inline: {
|
|
48
|
+
root: string;
|
|
49
|
+
label: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
error: {
|
|
53
|
+
true: {
|
|
54
|
+
trigger: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
fullWidth: {
|
|
58
|
+
true: {
|
|
59
|
+
root: string;
|
|
60
|
+
trigger: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
disabled: {
|
|
64
|
+
true: {
|
|
65
|
+
trigger: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}, {
|
|
69
|
+
root: string;
|
|
70
|
+
label: string;
|
|
71
|
+
requiredMark: string;
|
|
72
|
+
trigger: string[];
|
|
73
|
+
triggerText: string[];
|
|
74
|
+
triggerPlaceholder: string[];
|
|
75
|
+
chevron: string[];
|
|
76
|
+
popover: string[];
|
|
77
|
+
listBox: string;
|
|
78
|
+
listItem: string[];
|
|
79
|
+
listItemIndicator: string[];
|
|
80
|
+
emptyState: string;
|
|
81
|
+
helperText: string;
|
|
82
|
+
errorText: string;
|
|
83
|
+
chipsList: string;
|
|
84
|
+
chip: string[];
|
|
85
|
+
chipRemove: string[];
|
|
86
|
+
}, undefined, {
|
|
87
|
+
size: {
|
|
88
|
+
sm: {
|
|
89
|
+
trigger: string;
|
|
90
|
+
chevron: string;
|
|
91
|
+
};
|
|
92
|
+
md: {
|
|
93
|
+
trigger: string;
|
|
94
|
+
chevron: string;
|
|
95
|
+
};
|
|
96
|
+
lg: {
|
|
97
|
+
trigger: string;
|
|
98
|
+
chevron: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
layout: {
|
|
102
|
+
stacked: {
|
|
103
|
+
root: string;
|
|
104
|
+
};
|
|
105
|
+
inline: {
|
|
106
|
+
root: string;
|
|
107
|
+
label: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
error: {
|
|
111
|
+
true: {
|
|
112
|
+
trigger: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
fullWidth: {
|
|
116
|
+
true: {
|
|
117
|
+
root: string;
|
|
118
|
+
trigger: string;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
disabled: {
|
|
122
|
+
true: {
|
|
123
|
+
trigger: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
}, {
|
|
127
|
+
root: string;
|
|
128
|
+
label: string;
|
|
129
|
+
requiredMark: string;
|
|
130
|
+
trigger: string[];
|
|
131
|
+
triggerText: string[];
|
|
132
|
+
triggerPlaceholder: string[];
|
|
133
|
+
chevron: string[];
|
|
134
|
+
popover: string[];
|
|
135
|
+
listBox: string;
|
|
136
|
+
listItem: string[];
|
|
137
|
+
listItemIndicator: string[];
|
|
138
|
+
emptyState: string;
|
|
139
|
+
helperText: string;
|
|
140
|
+
errorText: string;
|
|
141
|
+
chipsList: string;
|
|
142
|
+
chip: string[];
|
|
143
|
+
chipRemove: string[];
|
|
144
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
145
|
+
size: {
|
|
146
|
+
sm: {
|
|
147
|
+
trigger: string;
|
|
148
|
+
chevron: string;
|
|
149
|
+
};
|
|
150
|
+
md: {
|
|
151
|
+
trigger: string;
|
|
152
|
+
chevron: string;
|
|
153
|
+
};
|
|
154
|
+
lg: {
|
|
155
|
+
trigger: string;
|
|
156
|
+
chevron: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
layout: {
|
|
160
|
+
stacked: {
|
|
161
|
+
root: string;
|
|
162
|
+
};
|
|
163
|
+
inline: {
|
|
164
|
+
root: string;
|
|
165
|
+
label: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
error: {
|
|
169
|
+
true: {
|
|
170
|
+
trigger: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
fullWidth: {
|
|
174
|
+
true: {
|
|
175
|
+
root: string;
|
|
176
|
+
trigger: string;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
disabled: {
|
|
180
|
+
true: {
|
|
181
|
+
trigger: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
}, {
|
|
185
|
+
root: string;
|
|
186
|
+
label: string;
|
|
187
|
+
requiredMark: string;
|
|
188
|
+
trigger: string[];
|
|
189
|
+
triggerText: string[];
|
|
190
|
+
triggerPlaceholder: string[];
|
|
191
|
+
chevron: string[];
|
|
192
|
+
popover: string[];
|
|
193
|
+
listBox: string;
|
|
194
|
+
listItem: string[];
|
|
195
|
+
listItemIndicator: string[];
|
|
196
|
+
emptyState: string;
|
|
197
|
+
helperText: string;
|
|
198
|
+
errorText: string;
|
|
199
|
+
chipsList: string;
|
|
200
|
+
chip: string[];
|
|
201
|
+
chipRemove: string[];
|
|
202
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
203
|
+
export type SelectVariants = VariantProps<typeof selectVariants>;
|
|
204
|
+
//# sourceMappingURL=select.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/select.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CA4GzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/Skeleton/Skeleton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/Skeleton/Skeleton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CA0B5C"}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import type { SkeletonVariants } from './skeleton.variants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Subset of `<Skeleton>` props theme-configurable via
|
|
4
|
+
* `theme.components.Skeleton.defaults` (Option C).
|
|
5
|
+
*/
|
|
6
|
+
export type SkeletonVariantProps = Pick<SkeletonVariants, 'variant' | 'animation'>;
|
|
7
|
+
declare module '@dashforge/tw-tokens' {
|
|
8
|
+
interface TWComponentDefaults {
|
|
9
|
+
Skeleton?: {
|
|
10
|
+
defaults?: Partial<SkeletonVariantProps>;
|
|
11
|
+
slotProps?: SkeletonSlotProps;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
2
15
|
export interface SkeletonSlotProps {
|
|
3
16
|
/** Root element override. */
|
|
4
17
|
root?: {
|
|
@@ -35,7 +48,18 @@ export interface SkeletonSlotProps {
|
|
|
35
48
|
* </div>
|
|
36
49
|
* ```
|
|
37
50
|
*/
|
|
38
|
-
export interface SkeletonProps
|
|
51
|
+
export interface SkeletonProps {
|
|
52
|
+
/**
|
|
53
|
+
* Shape preset — `text` (rounded rectangle sized for a line),
|
|
54
|
+
* `rectangle` (larger block), `circle` (avatar shape).
|
|
55
|
+
* @default 'text'
|
|
56
|
+
*/
|
|
57
|
+
variant?: SkeletonVariants['variant'];
|
|
58
|
+
/**
|
|
59
|
+
* Loading animation style. Always `motion-reduce` safe.
|
|
60
|
+
* @default 'pulse'
|
|
61
|
+
*/
|
|
62
|
+
animation?: SkeletonVariants['animation'];
|
|
39
63
|
/**
|
|
40
64
|
* CSS width (e.g. `"200px"`, `"100%"`, `"60%"`).
|
|
41
65
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Skeleton/skeleton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"skeleton.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Skeleton/skeleton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,WAAW,CAAC,CAAC;AAEnF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,mBAAmB;QAC3B,QAAQ,CAAC,EAAE;YACT,QAAQ,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;YACzC,SAAS,CAAC,EAAE,iBAAiB,CAAC;SAC/B,CAAC;KACH;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAEtC;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAE1C;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,gEAAgE;IAChE,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,0BAA0B;IAC1B,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SliderProps, SliderSingleProps, SliderRangeProps } from './slider.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dashforge TW `<Slider>` — token-driven numeric value picker.
|
|
4
|
+
*
|
|
5
|
+
* Single or range mode via `range?: boolean` discriminator. Bridge
|
|
6
|
+
* integration mirrors TextField / Autocomplete / Select. Commit to the
|
|
7
|
+
* form bridge on drag-end by default (`onValueCommit`); opt into
|
|
8
|
+
* per-tick commits via `commitOnChange`. Keyboard changes always
|
|
9
|
+
* commit immediately.
|
|
10
|
+
*
|
|
11
|
+
* See {@link SliderProps} for the full API surface.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Slider: import("react").ForwardRefExoticComponent<SliderProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
14
|
+
export type { SliderSingleProps, SliderRangeProps };
|
|
15
|
+
//# sourceMappingURL=Slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAEV,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAgE3B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,yGAyXjB,CAAC;AAOH,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
|