@ostack.tech/ui 0.15.5 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{en-Buw2XVWt.js → en-DT1KWQei.js} +2 -2
- package/dist/chunks/{en-Buw2XVWt.js.map → en-DT1KWQei.js.map} +1 -1
- package/dist/locales/en-GB.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/fr-FR.js +1 -1
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/pt-PT.js +1 -1
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui.css +134 -85
- package/dist/ostack-ui.js +2155 -1784
- package/dist/ostack-ui.js.map +1 -1
- package/package.json +5 -4
- package/scss/_utils.scss +0 -2
- package/scss/components/Checkbox/_Checkbox-variables.scss +7 -4
- package/scss/components/Checkbox/_Checkbox.scss +34 -9
- package/scss/components/CheckboxGroup/_CheckboxGroup.scss +9 -0
- package/scss/components/Code/_Code-variables.scss +8 -4
- package/scss/components/DateRangeInput/_DateRangeInput.scss +1 -1
- package/scss/components/Feedback/_Feedback-variables.scss +28 -1
- package/scss/components/Feedback/_Feedback.scss +99 -2
- package/scss/components/Field/_Field-variables.scss +0 -1
- package/scss/components/Field/_Field.scss +4 -40
- package/scss/components/HelperText/_HelperText-variables.scss +8 -0
- package/scss/components/HelperText/_HelperText.scss +15 -0
- package/scss/components/RadioGroup/_Radio.scss +13 -0
- package/scss/components/RadioGroup/_RadioGroup.scss +9 -0
- package/scss/components/Select/_Select.scss +2 -2
- package/scss/index.scss +0 -2
- package/scss/scss/placeholders/button/_button.scss +10 -6
- package/scss/scss/placeholders/checkable/_checkable-variables.scss +3 -2
- package/scss/scss/placeholders/checkable/_checkable.scss +25 -7
- package/scss/scss/placeholders/checkable-group/_checkable-group-variables.scss +1 -0
- package/scss/scss/placeholders/checkable-group/_checkable-group.scss +15 -3
- package/scss/scss/placeholders/popover/_popover.scss +3 -0
- package/scss/scss/utils/_breakpoints.scss +1 -1
- package/scss/scss/utils/_declare-var.scss +1 -1
- package/types/components/Alert/Alert.d.ts +12 -15
- package/types/components/Alert/AlertTitle.d.ts +2 -2
- package/types/components/AlertDialog/AlertDialog.d.ts +6 -2
- package/types/components/AlertDialog/AlertDialogAction.d.ts +3 -3
- package/types/components/AlertDialog/AlertDialogBody.d.ts +3 -5
- package/types/components/AlertDialog/AlertDialogCancel.d.ts +3 -3
- package/types/components/AlertDialog/AlertDialogContent.d.ts +6 -6
- package/types/components/AlertDialog/AlertDialogDescription.d.ts +3 -3
- package/types/components/AlertDialog/AlertDialogFooter.d.ts +3 -5
- package/types/components/AlertDialog/AlertDialogHeader.d.ts +3 -4
- package/types/components/AlertDialog/AlertDialogTitle.d.ts +4 -4
- package/types/components/AlertDialog/AlertDialogTrigger.d.ts +3 -3
- package/types/components/Button/Button.d.ts +14 -15
- package/types/components/ButtonGroup/ButtonGroup.d.ts +3 -3
- package/types/components/Calendar/Calendar.d.ts +6 -6
- package/types/components/Calendar/CalendarDay.d.ts +1 -1
- package/types/components/Calendar/CalendarHeader.d.ts +1 -1
- package/types/components/Calendar/CalendarMonthGrid.d.ts +1 -1
- package/types/components/Card/Card.d.ts +3 -3
- package/types/components/Card/CardBody.d.ts +3 -3
- package/types/components/Card/CardFooter.d.ts +3 -3
- package/types/components/Card/CardHeader.d.ts +3 -3
- package/types/components/Card/CardTitle.d.ts +3 -3
- package/types/components/Checkbox/Checkbox.d.ts +22 -14
- package/types/components/CheckboxGroup/CheckboxGroup.d.ts +22 -12
- package/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +15 -9
- package/types/components/CheckboxGroup/checkboxGroupUtils.d.ts +3 -0
- package/types/components/ClearContexts/ClearContexts.d.ts +19 -1
- package/types/components/CloseButton/CloseButton.d.ts +3 -4
- package/types/components/Code/Code.d.ts +3 -3
- package/types/components/Collapsible/Collapsible.d.ts +5 -3
- package/types/components/Collapsible/CollapsibleContent.d.ts +3 -3
- package/types/components/Collapsible/CollapsibleTrigger.d.ts +5 -5
- package/types/components/CommandMenu/CommandMenu.d.ts +18 -20
- package/types/components/CommandMenu/CommandMenuDialog.d.ts +6 -6
- package/types/components/CommandMenu/CommandMenuGroup.d.ts +3 -3
- package/types/components/CommandMenu/CommandMenuItem.d.ts +5 -3
- package/types/components/Container/Container.d.ts +3 -3
- package/types/components/Control/Control.d.ts +13 -13
- package/types/components/Control/ControlWithContainerRef.d.ts +12 -5
- package/types/components/Control/controlUtils.d.ts +24 -0
- package/types/components/ControlAddon/ControlAddon.d.ts +9 -3
- package/types/components/ControlCode/ControlCode.d.ts +3 -3
- package/types/components/DataTable/DataTable.d.ts +32 -21
- package/types/components/DataTable/DataTableBody.d.ts +4 -4
- package/types/components/DataTable/DataTableCell.d.ts +6 -4
- package/types/components/DataTable/DataTableColumn.d.ts +32 -11
- package/types/components/DataTable/DataTableColumnGroup.d.ts +31 -0
- package/types/components/DataTable/DataTableColumns.d.ts +14 -0
- package/types/components/DataTable/DataTableContent.d.ts +8 -8
- package/types/components/DataTable/DataTableContext.d.ts +7 -6
- package/types/components/DataTable/DataTableFilter.d.ts +1 -1
- package/types/components/DataTable/DataTableFoot.d.ts +6 -4
- package/types/components/DataTable/DataTableHead.d.ts +3 -4
- package/types/components/DataTable/DataTablePagination.d.ts +6 -6
- package/types/components/DataTable/DataTableRow.d.ts +3 -4
- package/types/components/DataTable/DataTableRowsPerPage.d.ts +3 -3
- package/types/components/DataTable/DataTableSelectionTrigger.d.ts +4 -4
- package/types/components/DataTable/PagedDataTablePagination.d.ts +3 -3
- package/types/components/DataTable/ScrolledDataTablePagination.d.ts +3 -3
- package/types/components/DataTable/__tests__/spliceWindow.test.d.ts +1 -0
- package/types/components/DataTable/columnUtils.d.ts +4 -3
- package/types/components/DataTable/index.d.ts +2 -0
- package/types/components/DataTable/processRows.d.ts +7 -7
- package/types/components/DataTable/sanitizeProps.d.ts +2 -2
- package/types/components/DataTable/useDataTableSelectionColumn.d.ts +2 -2
- package/types/components/DateInput/DateInput.d.ts +27 -18
- package/types/components/DateRangeInput/DateRangeInput.d.ts +37 -24
- package/types/components/DescriptionList/DescriptionList.d.ts +4 -4
- package/types/components/DescriptionList/DescriptionListItem.d.ts +4 -4
- package/types/components/Dialog/Dialog.d.ts +5 -1
- package/types/components/Dialog/DialogBody.d.ts +3 -4
- package/types/components/Dialog/DialogClose.d.ts +3 -3
- package/types/components/Dialog/DialogContent.d.ts +6 -6
- package/types/components/Dialog/DialogDescription.d.ts +3 -3
- package/types/components/Dialog/DialogFooter.d.ts +3 -4
- package/types/components/Dialog/DialogHeader.d.ts +5 -6
- package/types/components/Dialog/DialogTitle.d.ts +4 -4
- package/types/components/Dialog/DialogTrigger.d.ts +3 -3
- package/types/components/DropdownMenu/DropdownMenu.d.ts +4 -4
- package/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +5 -5
- package/types/components/DropdownMenu/DropdownMenuContent.d.ts +7 -7
- package/types/components/DropdownMenu/DropdownMenuGroup.d.ts +3 -3
- package/types/components/DropdownMenu/DropdownMenuItem.d.ts +4 -4
- package/types/components/DropdownMenu/DropdownMenuRadioGroup.d.ts +3 -3
- package/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -4
- package/types/components/DropdownMenu/DropdownMenuSub.d.ts +4 -0
- package/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +5 -5
- package/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +3 -3
- package/types/components/DropdownMenu/DropdownMenuTrigger.d.ts +3 -3
- package/types/components/ErrorBoundary/ErrorBoundary.d.ts +9 -9
- package/types/components/Feedback/Feedback.d.ts +3 -3
- package/types/components/Feedback/FeedbackContext.d.ts +46 -0
- package/types/components/Feedback/FeedbackList.d.ts +6 -0
- package/types/components/Feedback/FeedbackListContext.d.ts +2 -0
- package/types/components/{FeedbackPopover → Feedback}/FeedbackPopover.d.ts +7 -7
- package/types/components/Feedback/FeedbackProvider.d.ts +13 -0
- package/types/components/Feedback/feedbackUtils.d.ts +19 -0
- package/types/components/Feedback/index.d.ts +4 -0
- package/types/components/Field/Field.d.ts +3 -3
- package/types/components/Field/FieldContext.d.ts +2 -70
- package/types/components/Field/fieldUtils.d.ts +7 -0
- package/types/components/Field/index.d.ts +1 -2
- package/types/components/FieldGroup/FieldGroup.d.ts +3 -3
- package/types/components/FieldGroup/FieldGroupBody.d.ts +3 -3
- package/types/components/FieldGroup/FieldGroupHeader.d.ts +4 -4
- package/types/components/FieldGroup/FieldGroupTitle.d.ts +2 -2
- package/types/components/Form/Form.d.ts +6 -6
- package/types/components/Form/FormContext.d.ts +1 -1
- package/types/components/Form/FormReset.d.ts +2 -2
- package/types/components/Form/FormSubmit.d.ts +2 -2
- package/types/components/Form/HiddenFormControl.d.ts +2 -2
- package/types/components/Form/useRegisterFormControl.d.ts +1 -1
- package/types/components/Grid/Grid.d.ts +4 -4
- package/types/components/Grid/GridContext.d.ts +10 -0
- package/types/components/Heading/Heading.d.ts +2 -2
- package/types/components/HelperText/HelperText.d.ts +3 -3
- package/types/components/HelperText/HelperTextContext.d.ts +38 -0
- package/types/components/HelperText/HelperTextProvider.d.ts +13 -0
- package/types/components/HelperText/helperTextUtils.d.ts +2 -0
- package/types/components/HelperText/index.d.ts +2 -0
- package/types/components/Icon/Icon.d.ts +3 -3
- package/types/components/IconButton/IconButton.d.ts +17 -17
- package/types/components/Input/Input.d.ts +1 -1
- package/types/components/Keybinds/Keybinds.d.ts +8 -3
- package/types/components/Keyboard/Keyboard.d.ts +3 -3
- package/types/components/Label/Label.d.ts +14 -14
- package/types/components/Label/LabelContext.d.ts +45 -0
- package/types/components/Label/LabelProvider.d.ts +13 -0
- package/types/components/Label/index.d.ts +2 -0
- package/types/components/Label/labelUtils.d.ts +23 -0
- package/types/components/Layer/Layer.d.ts +5 -5
- package/types/components/Link/Link.d.ts +4 -5
- package/types/components/Mark/Mark.d.ts +3 -3
- package/types/components/MenuList/MenuList.d.ts +3 -3
- package/types/components/MenuList/MenuListGroup.d.ts +5 -5
- package/types/components/MenuList/MenuListItem.d.ts +13 -14
- package/types/components/NumericInput/NumericInput.d.ts +5 -5
- package/types/components/NumericInput/numericInputUtils.d.ts +2 -2
- package/types/components/Output/Output.d.ts +2 -2
- package/types/components/Overlay/Overlay.d.ts +3 -3
- package/types/components/Popover/Popover.d.ts +4 -0
- package/types/components/Popover/PopoverAnchor.d.ts +4 -0
- package/types/components/Popover/PopoverClose.d.ts +5 -5
- package/types/components/Popover/PopoverContent.d.ts +5 -5
- package/types/components/Popover/PopoverTrigger.d.ts +3 -3
- package/types/components/Portal/Portal.d.ts +3 -3
- package/types/components/Printer/Printer.d.ts +1 -1
- package/types/components/Printer/PrinterContent.d.ts +5 -5
- package/types/components/Printer/PrinterTrigger.d.ts +4 -4
- package/types/components/RadioGroup/Radio.d.ts +23 -13
- package/types/components/RadioGroup/RadioGroup.d.ts +19 -16
- package/types/components/Root/Root.d.ts +9 -9
- package/types/components/Root/RootElement.d.ts +3 -3
- package/types/components/Select/Option.d.ts +3 -4
- package/types/components/Select/OptionsGroup.d.ts +3 -4
- package/types/components/Select/Select.d.ts +17 -13
- package/types/components/Select/SelectContext.d.ts +6 -12
- package/types/components/Select/SelectNative.d.ts +3 -3
- package/types/components/Select/selectUtils.d.ts +3 -0
- package/types/components/Separator/Separator.d.ts +3 -3
- package/types/components/Slot/Slot.d.ts +5 -0
- package/types/components/Slot/Slottable.d.ts +2 -2
- package/types/components/Spinner/Spinner.d.ts +3 -3
- package/types/components/Stack/Stack.d.ts +4 -4
- package/types/components/Stack/StackContext.d.ts +9 -0
- package/types/components/Stepper/Step.d.ts +6 -6
- package/types/components/Stepper/StepContent.d.ts +5 -5
- package/types/components/Stepper/StepList.d.ts +3 -3
- package/types/components/Stepper/Stepper.d.ts +6 -6
- package/types/components/Stepper/StepperFinishTrigger.d.ts +5 -5
- package/types/components/Stepper/StepperNextTrigger.d.ts +5 -5
- package/types/components/Stepper/StepperPreviousTrigger.d.ts +5 -5
- package/types/components/Table/Table.d.ts +15 -10
- package/types/components/Table/TableBody.d.ts +3 -3
- package/types/components/Table/TableCell.d.ts +3 -3
- package/types/components/Table/TableColumn.d.ts +29 -21
- package/types/components/Table/TableColumnGroup.d.ts +38 -0
- package/types/components/Table/TableContext.d.ts +1 -1
- package/types/components/Table/TableFoot.d.ts +3 -3
- package/types/components/Table/TableHead.d.ts +15 -7
- package/types/components/Table/TableRow.d.ts +3 -3
- package/types/components/Table/columnUtils.d.ts +11 -17
- package/types/components/Table/index.d.ts +1 -0
- package/types/components/Tabs/Tab.d.ts +7 -7
- package/types/components/Tabs/TabContent.d.ts +4 -4
- package/types/components/Tabs/TabList.d.ts +8 -8
- package/types/components/Tabs/Tabs.d.ts +8 -6
- package/types/components/Tag/Badge.d.ts +2 -2
- package/types/components/Tag/Tag.d.ts +10 -10
- package/types/components/TextArea/TextArea.d.ts +2 -2
- package/types/components/Toast/Toast.d.ts +13 -13
- package/types/components/Toast/ToastDescription.d.ts +4 -0
- package/types/components/Toast/ToastProvider.d.ts +2 -2
- package/types/components/Toast/ToastTitle.d.ts +3 -3
- package/types/components/Toast/ToastViewport.d.ts +3 -3
- package/types/components/Tooltip/Tooltip.d.ts +5 -5
- package/types/components/Tooltip/TooltipProvider.d.ts +4 -0
- package/types/components/VisuallyHidden/VisuallyHidden.d.ts +2 -2
- package/types/index.d.ts +1 -2
- package/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +12 -12
- package/types/providers/ErrorReportingProvider/ErrorReportingProvider.d.ts +1 -1
- package/types/providers/LocalizationProvider/LocalizationObject.d.ts +2 -3
- package/types/providers/ToastManagerProvider/ToastManagerContext.d.ts +6 -6
- package/types/utils/__tests__/combineEventHandlers.test.d.ts +1 -0
- package/types/utils/__tests__/cx.test.d.ts +1 -0
- package/types/utils/__tests__/numericStringUtils.test.d.ts +1 -0
- package/types/utils/__tests__/useNumericTrasformer.test.d.ts +1 -0
- package/types/utils/documentTitleUtils.d.ts +4 -0
- package/types/utils/parseChildren.d.ts +64 -0
- package/types/utils/polymorphicTypes.d.ts +2 -13
- package/types/utils/useLocation.d.ts +3 -3
- package/types/utils/useNumericTransformer.d.ts +9 -6
- package/scss/components/FeedbackList/_FeedbackList-variables.scss +0 -6
- package/scss/components/FeedbackList/_FeedbackList.scss +0 -32
- package/scss/components/FeedbackPopover/_FeedbackPopover-variables.scss +0 -26
- package/scss/components/FeedbackPopover/_FeedbackPopover.scss +0 -66
- package/types/components/FeedbackList/FeedbackList.d.ts +0 -6
- package/types/components/FeedbackList/FeedbackListContext.d.ts +0 -4
- package/types/components/FeedbackList/index.d.ts +0 -2
- package/types/components/FeedbackPopover/index.d.ts +0 -2
- package/types/components/Field/FieldProvider.d.ts +0 -13
- /package/types/components/{FeedbackPopover → Feedback}/FeedbackPopoverContext.d.ts +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ComponentProps, type FocusEvent, type ReactNode } from "react";
|
|
3
3
|
import { type ControlStatus, type ControlVariant } from "../Control";
|
|
4
|
-
import {
|
|
4
|
+
import { type ControlCodeProps } from "../ControlCode";
|
|
5
5
|
import type { FormValidationMode } from "../Form";
|
|
6
6
|
import { type FormControlValidateFn } from "../Form/useRegisterFormControl.ts";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { type IconProps } from "../Icon";
|
|
8
|
+
import { type LabelProps } from "../Label";
|
|
9
|
+
import { type SpinnerProps } from "../Spinner";
|
|
10
10
|
/** `checked` state of a checkbox. */
|
|
11
11
|
export type CheckboxChecked = CheckboxPrimitive.CheckedState;
|
|
12
12
|
/** Properties of the checkbox component. */
|
|
13
|
-
export interface CheckboxProps extends Omit<
|
|
13
|
+
export interface CheckboxProps extends Omit<ComponentProps<typeof CheckboxPrimitive.Root>, "asChild"> {
|
|
14
14
|
/**
|
|
15
15
|
* Checkbox style variant. Defaults to the default variant unless when
|
|
16
16
|
* rendering inside a table cell (in which case it defaults to `"cell"`).
|
|
@@ -22,12 +22,16 @@ export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof Chec
|
|
|
22
22
|
code?: ReactNode;
|
|
23
23
|
/** Sets the checkbox as read-only. */
|
|
24
24
|
readOnly?: boolean;
|
|
25
|
+
/** Checkbox start adornment. */
|
|
26
|
+
startAdornment?: ReactNode;
|
|
27
|
+
/** Checkbox end adornment. */
|
|
28
|
+
endAdornment?: ReactNode;
|
|
25
29
|
/**
|
|
26
30
|
* Renders the checkbox in a **loading** state.
|
|
27
31
|
*
|
|
28
32
|
* When `true`, the checkbox is “soft-disabled”: it looks disabled and ignores
|
|
29
33
|
* user interaction but remains focusable. By default, a spinner is shown
|
|
30
|
-
* (
|
|
34
|
+
* (i.e. `showSpinner` is set to `true` unless overridden).
|
|
31
35
|
*
|
|
32
36
|
* The checkbox's accessible description while loading can be controlled via
|
|
33
37
|
* `loadingDescription`.
|
|
@@ -71,17 +75,21 @@ export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof Chec
|
|
|
71
75
|
*/
|
|
72
76
|
validationMode?: FormValidationMode;
|
|
73
77
|
/** Properties to pass to the root component. */
|
|
74
|
-
rootProps?:
|
|
78
|
+
rootProps?: ComponentProps<"div">;
|
|
75
79
|
/** Properties to pass to the container component. */
|
|
76
|
-
containerProps?:
|
|
80
|
+
containerProps?: ComponentProps<"div">;
|
|
81
|
+
/** Properties to pass to the start container element. */
|
|
82
|
+
startContainerProps?: ComponentProps<"div">;
|
|
83
|
+
/** Properties to pass to the end container element. */
|
|
84
|
+
endContainerProps?: ComponentProps<"div">;
|
|
77
85
|
/** Properties to pass to the code component. */
|
|
78
|
-
codeProps?:
|
|
86
|
+
codeProps?: ControlCodeProps;
|
|
79
87
|
/** Properties to pass to the indicator component. */
|
|
80
|
-
indicatorProps?:
|
|
88
|
+
indicatorProps?: IconProps;
|
|
81
89
|
/** Properties to pass to the label component. */
|
|
82
|
-
labelProps?: Omit<
|
|
90
|
+
labelProps?: Omit<LabelProps, "required">;
|
|
83
91
|
/** Properties to pass to the spinner component. */
|
|
84
|
-
spinnerProps?: Omit<
|
|
92
|
+
spinnerProps?: Omit<SpinnerProps, "size">;
|
|
85
93
|
}
|
|
86
94
|
/**
|
|
87
95
|
* The `Checkbox` component allows a user to toggle a “button” between checked
|
|
@@ -100,4 +108,4 @@ export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof Chec
|
|
|
100
108
|
* }
|
|
101
109
|
* ```
|
|
102
110
|
*/
|
|
103
|
-
export declare
|
|
111
|
+
export declare function Checkbox({ variant, status, code, loading, loadingDescription, showSpinner, onBlurToOutside, validate, validationMode, children, rootProps, containerProps, codeProps, indicatorProps, labelProps, spinnerProps, value, defaultChecked, checked: controlledChecked, onCheckedChange, onFocus, onBlur, id, name, className, required, disabled, readOnly, startAdornment, endAdornment, "aria-disabled": ariaDisabled, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, startContainerProps, endContainerProps, ref, ...otherProps }: CheckboxProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentProps, type FocusEvent, type ReactNode } from "react";
|
|
2
2
|
import { type ControlStatus, type ControlVariant } from "../Control";
|
|
3
|
-
import {
|
|
3
|
+
import { type ControlCodeProps } from "../ControlCode";
|
|
4
4
|
import type { FormValidationMode } from "../Form";
|
|
5
5
|
import { type FormControlValidateFn } from "../Form/useRegisterFormControl.ts";
|
|
6
|
-
import {
|
|
6
|
+
import { type SpinnerProps } from "../Spinner";
|
|
7
7
|
/** Properties of the checkbox group component. */
|
|
8
|
-
export interface CheckboxGroupProps extends
|
|
8
|
+
export interface CheckboxGroupProps extends ComponentProps<"div"> {
|
|
9
9
|
/**
|
|
10
10
|
* Whether to display the checkbox group inline. Defaults to `false` unless
|
|
11
11
|
* when rending inside a table cell.
|
|
@@ -27,7 +27,7 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
27
27
|
*
|
|
28
28
|
* When `true`, the checkbox group is “soft-disabled”: it looks disabled and
|
|
29
29
|
* ignores user interaction but remains focusable. By default, a spinner is
|
|
30
|
-
* shown (
|
|
30
|
+
* shown (i.e. `showSpinner` is set to `true` unless overridden).
|
|
31
31
|
*
|
|
32
32
|
* The checkbox group's accessible description while loading can be controlled
|
|
33
33
|
* via `loadingDescription`.
|
|
@@ -56,8 +56,12 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
56
56
|
* @default loading
|
|
57
57
|
*/
|
|
58
58
|
showSpinner?: boolean;
|
|
59
|
-
/** Whether the
|
|
59
|
+
/** Whether the checkbox group is required. */
|
|
60
60
|
required?: boolean;
|
|
61
|
+
/** Minimum number of checkboxes that must be checked. */
|
|
62
|
+
minChecked?: number;
|
|
63
|
+
/** Maximum number of checkboxes that can be checked. */
|
|
64
|
+
maxChecked?: number;
|
|
61
65
|
/** Whether to disable the checkbox group. */
|
|
62
66
|
disabled?: boolean;
|
|
63
67
|
/** Sets the checkbox group as read-only. */
|
|
@@ -68,6 +72,10 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
68
72
|
value?: string[];
|
|
69
73
|
/** Action to run whenever the checkbox group's value changes. */
|
|
70
74
|
onValueChange?: (value: string[]) => void;
|
|
75
|
+
/** Checkbox group's start adornment. */
|
|
76
|
+
startAdornment?: ReactNode;
|
|
77
|
+
/** Checkbox group's end adornment. */
|
|
78
|
+
endAdornment?: ReactNode;
|
|
71
79
|
/**
|
|
72
80
|
* Function called when the focus moves out of the control as a whole.
|
|
73
81
|
*
|
|
@@ -86,13 +94,15 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
86
94
|
*/
|
|
87
95
|
validationMode?: FormValidationMode;
|
|
88
96
|
/** Properties to pass to the code component. */
|
|
89
|
-
codeProps?:
|
|
97
|
+
codeProps?: ControlCodeProps;
|
|
90
98
|
/** Properties to pass to the container component. */
|
|
91
|
-
containerProps?:
|
|
92
|
-
/** Properties to pass to the
|
|
93
|
-
|
|
99
|
+
containerProps?: ComponentProps<"div">;
|
|
100
|
+
/** Properties to pass to the start container element. */
|
|
101
|
+
startContainerProps?: ComponentProps<"div">;
|
|
102
|
+
/** Properties to pass to the end container element. */
|
|
103
|
+
endContainerProps?: ComponentProps<"div">;
|
|
94
104
|
/** Properties to pass to the spinner component. */
|
|
95
|
-
spinnerProps?: Omit<
|
|
105
|
+
spinnerProps?: Omit<SpinnerProps, "size">;
|
|
96
106
|
}
|
|
97
107
|
/**
|
|
98
108
|
* The `CheckboxGroup` component displays a set of `Checkbox` components,
|
|
@@ -121,4 +131,4 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
121
131
|
* }
|
|
122
132
|
* ```
|
|
123
133
|
*/
|
|
124
|
-
export declare
|
|
134
|
+
export declare function CheckboxGroup({ inline, variant, status, code, name, loading, loadingDescription, showSpinner, required, minChecked, maxChecked, disabled, readOnly, defaultValue, value, onValueChange, onBlurToOutside, validate, validationMode, codeProps, containerProps, startContainerProps, endContainerProps, spinnerProps, id, className, startAdornment, endAdornment, onMouseDown, onFocus, tabIndex: controlledTabIndex, children, "aria-disabled": ariaDisabled, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...otherProps }: CheckboxGroupProps): import("react").JSX.Element;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
2
|
import type { CheckboxGroupProps } from "./CheckboxGroup.tsx";
|
|
3
3
|
/** Value of the checkbox group's context. */
|
|
4
|
-
export interface CheckboxGroupContextValue {
|
|
5
|
-
name?: string;
|
|
6
|
-
required?: boolean;
|
|
4
|
+
export interface CheckboxGroupContextValue extends Pick<CheckboxGroupProps, "name" | "minChecked" | "maxChecked"> {
|
|
7
5
|
loadingDescriptionId?: string;
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
feedbackIds?: string[];
|
|
7
|
+
helperTextIds?: string[];
|
|
10
8
|
store: CheckboxGroupStore;
|
|
11
9
|
}
|
|
12
10
|
/** State of the checkbox group. */
|
|
@@ -29,12 +27,13 @@ export interface UseCreateCheckboxGroupContextOptions extends Omit<CheckboxGroup
|
|
|
29
27
|
formOnChange: (value: string[]) => void;
|
|
30
28
|
}
|
|
31
29
|
/** Hook which creates the checkbox group's store. */
|
|
32
|
-
export declare function useCreateCheckboxGroupContext({ defaultValue, value, onValueChange, formOnChange, name,
|
|
30
|
+
export declare function useCreateCheckboxGroupContext({ defaultValue, value, onValueChange, formOnChange, name, minChecked, maxChecked, loadingDescriptionId, feedbackIds, helperTextIds, checkboxGroupRef, }: UseCreateCheckboxGroupContextOptions): {
|
|
33
31
|
name: string | undefined;
|
|
34
|
-
|
|
32
|
+
minChecked: number | undefined;
|
|
33
|
+
maxChecked: number | undefined;
|
|
35
34
|
loadingDescriptionId: string | undefined;
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
feedbackIds: string[] | undefined;
|
|
36
|
+
helperTextIds: string[] | undefined;
|
|
38
37
|
store: Omit<import("zustand").StoreApi<CheckboxGroupState>, "subscribe"> & {
|
|
39
38
|
subscribe: {
|
|
40
39
|
(listener: (selectedState: CheckboxGroupState, previousSelectedState: CheckboxGroupState) => void): () => void;
|
|
@@ -59,6 +58,13 @@ export declare function useIsCheckedInGroup(checkboxValue: string): [boolean | u
|
|
|
59
58
|
* required and no checkboxes have been checked.
|
|
60
59
|
*/
|
|
61
60
|
export declare function useIsRequiredInGroup(): boolean | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Returns whether a checkbox within a group should be soft-disabled.
|
|
63
|
+
*
|
|
64
|
+
* Non-checked checkboxes within a group that has reached its `maxChecked` will
|
|
65
|
+
* be soft-disabled.
|
|
66
|
+
*/
|
|
67
|
+
export declare function useIsSoftDisabledInGroup(isChecked?: boolean): boolean | undefined;
|
|
62
68
|
/**
|
|
63
69
|
* Returns the description ids to set on a checkbox of a checkbox group.
|
|
64
70
|
*
|
|
@@ -13,6 +13,24 @@ export interface ClearContextsProps {
|
|
|
13
13
|
* @default true
|
|
14
14
|
*/
|
|
15
15
|
field?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Clear the label context.
|
|
18
|
+
*
|
|
19
|
+
* @default field
|
|
20
|
+
*/
|
|
21
|
+
label?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Clear the feedback context.
|
|
24
|
+
*
|
|
25
|
+
* @default field
|
|
26
|
+
*/
|
|
27
|
+
feedback?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Clear the helper text context.
|
|
30
|
+
*
|
|
31
|
+
* @default field
|
|
32
|
+
*/
|
|
33
|
+
helperText?: boolean;
|
|
16
34
|
/**
|
|
17
35
|
* Clear the link context.
|
|
18
36
|
*
|
|
@@ -28,4 +46,4 @@ export interface ClearContextsProps {
|
|
|
28
46
|
children?: ReactNode;
|
|
29
47
|
}
|
|
30
48
|
/** Component used to clear component contexts. */
|
|
31
|
-
export declare function ClearContexts({ dataTableCell, field, link, tableCell, children, }: ClearContextsProps): ReactNode;
|
|
49
|
+
export declare function ClearContexts({ dataTableCell, field, label, feedback, helperText, link, tableCell, children, }: ClearContextsProps): ReactNode;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { IconButton } from "../IconButton";
|
|
1
|
+
import { type IconButtonProps } from "../IconButton";
|
|
3
2
|
/** Properties of the close button component. */
|
|
4
|
-
export interface CloseButtonProps extends Partial<
|
|
3
|
+
export interface CloseButtonProps extends Partial<IconButtonProps> {
|
|
5
4
|
}
|
|
6
5
|
/** Component rendering a “close” button. */
|
|
7
|
-
export declare
|
|
6
|
+
export declare function CloseButton({ icon, label, className, ...otherProps }: CloseButtonProps): import("react").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { AccentColor } from "../../utils/accent.ts";
|
|
3
3
|
/** Code colours. */
|
|
4
4
|
export type CodeColor = AccentColor;
|
|
5
5
|
/** Properties of the code component. */
|
|
6
|
-
export interface CodeProps extends
|
|
6
|
+
export interface CodeProps extends ComponentProps<"code"> {
|
|
7
7
|
/**
|
|
8
8
|
* Change the component to the HTML tag or custom component of the only child.
|
|
9
9
|
* This will merge the original component props with the props of the supplied
|
|
@@ -32,4 +32,4 @@ export interface CodeProps extends ComponentPropsWithoutRef<"code"> {
|
|
|
32
32
|
* }
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export declare
|
|
35
|
+
export declare function Code({ asChild, color, className, ...otherProps }: CodeProps): import("react").JSX.Element;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Collapsible as CollapsiblePrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
/** Orientation in which to collapse/expand content. */
|
|
4
4
|
export type CollapsibleOrientation = "horizontal" | "vertical";
|
|
5
5
|
/** Properties of the collapsible component. */
|
|
6
|
-
export interface CollapsibleProps extends
|
|
6
|
+
export interface CollapsibleProps extends Omit<ComponentProps<typeof CollapsiblePrimitive.Root>, "onOpenChange"> {
|
|
7
|
+
/** Function called when the collapsible's open state changes. */
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
9
|
/**
|
|
8
10
|
* Orientation in which to collapse/expand content.
|
|
9
11
|
*
|
|
@@ -40,4 +42,4 @@ export interface CollapsibleProps extends ComponentPropsWithoutRef<typeof Collap
|
|
|
40
42
|
* }
|
|
41
43
|
* ```
|
|
42
44
|
*/
|
|
43
|
-
export declare
|
|
45
|
+
export declare function Collapsible({ defaultOpen, open: controlledOpen, onOpenChange, orientation, className, ...otherProps }: CollapsibleProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Collapsible as CollapsiblePrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
/** Properties of the collapsible content component. */
|
|
4
|
-
export interface CollapsibleContentProps extends
|
|
4
|
+
export interface CollapsibleContentProps extends ComponentProps<typeof CollapsiblePrimitive.Content> {
|
|
5
5
|
}
|
|
6
6
|
/** Component containing the collapsible content. */
|
|
7
|
-
export declare
|
|
7
|
+
export declare function CollapsibleContent({ className, ...otherProps }: CollapsibleContentProps): import("react").JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
2
|
import type { IconProp } from "../Icon/Icon.tsx";
|
|
3
|
-
import {
|
|
3
|
+
import { type IconButtonProps } from "../IconButton";
|
|
4
4
|
/** Properties of the collapsible trigger component. */
|
|
5
5
|
export type CollapsibleTriggerProps = CollapsibleTriggerChildlessProps | CollapsibleTriggerChildrenProps;
|
|
6
6
|
/**
|
|
7
7
|
* Properties of the collapsible trigger component when rendered without
|
|
8
8
|
* children.
|
|
9
9
|
*/
|
|
10
|
-
export interface CollapsibleTriggerChildlessProps extends Omit<Partial<
|
|
10
|
+
export interface CollapsibleTriggerChildlessProps extends Omit<Partial<IconButtonProps>, "asChild" | "children"> {
|
|
11
11
|
/** Icon used for the trigger icon button when the collapsible is collapsed. */
|
|
12
12
|
expandIcon?: IconProp | ReactElement;
|
|
13
13
|
/** Icon used for the trigger icon button when the collapsible is expanded. */
|
|
@@ -19,8 +19,8 @@ export interface CollapsibleTriggerChildlessProps extends Omit<Partial<Component
|
|
|
19
19
|
children?: never;
|
|
20
20
|
}
|
|
21
21
|
/** Properties of the collapsible trigger component when rendered with children. */
|
|
22
|
-
export interface CollapsibleTriggerChildrenProps extends Omit<
|
|
22
|
+
export interface CollapsibleTriggerChildrenProps extends Omit<ComponentProps<"button">, "children"> {
|
|
23
23
|
children: ReactNode | ((open: boolean) => ReactNode);
|
|
24
24
|
}
|
|
25
25
|
/** Trigger that toggles the expansion of the collapsible content. */
|
|
26
|
-
export declare
|
|
26
|
+
export declare function CollapsibleTrigger({ children, ...otherProps }: CollapsibleTriggerProps): import("react").JSX.Element;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { type ControlAddonProps } from "../ControlAddon";
|
|
3
|
+
import { type IconProps } from "../Icon";
|
|
4
4
|
import { type InputNonFileProps } from "../Input";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { type MenuListIconPlacement, type MenuListProps, type MenuListVariant } from "../MenuList";
|
|
6
|
+
import { type SpinnerProps } from "../Spinner";
|
|
7
7
|
import { Command as CommandPrimitive } from "./cmdk";
|
|
8
8
|
/** Command menu variants. */
|
|
9
9
|
export type CommandMenuVariant = MenuListVariant;
|
|
10
10
|
/** Placement of icons within command menu items. */
|
|
11
11
|
export type CommandMenuIconPlacement = MenuListIconPlacement;
|
|
12
12
|
/** Properties of the command menu component. */
|
|
13
|
-
export interface CommandMenuProps extends
|
|
13
|
+
export interface CommandMenuProps extends ComponentProps<typeof CommandPrimitive> {
|
|
14
14
|
/**
|
|
15
15
|
* Style variant of the command menu list.
|
|
16
16
|
*
|
|
@@ -45,21 +45,19 @@ export interface CommandMenuProps extends ComponentPropsWithoutRef<typeof Comman
|
|
|
45
45
|
/** Message to display when no items were found. */
|
|
46
46
|
emptyMessage?: ReactNode;
|
|
47
47
|
/** Properties to pass to the search `Input` component. */
|
|
48
|
-
searchProps?: Omit<InputNonFileProps, "asChild" | "variant" | "status" | "code" | "defaultValue" | "value" | "onValueChange" | "startAdornment" | "endAdornment" | "showClearButton"
|
|
49
|
-
ref?: Ref<HTMLInputElement>;
|
|
50
|
-
};
|
|
48
|
+
searchProps?: Omit<InputNonFileProps, "asChild" | "variant" | "status" | "code" | "defaultValue" | "value" | "onValueChange" | "startAdornment" | "endAdornment" | "showClearButton">;
|
|
51
49
|
/** Properties to pass to the search adornment `ControlAddon` component. */
|
|
52
|
-
searchAdornmentProps?:
|
|
50
|
+
searchAdornmentProps?: ControlAddonProps;
|
|
53
51
|
/** Properties to pass to the search `Icon` component. */
|
|
54
|
-
searchIconProps?:
|
|
55
|
-
/** Properties to pass to the
|
|
56
|
-
listProps?: Omit<
|
|
52
|
+
searchIconProps?: IconProps;
|
|
53
|
+
/** Properties to pass to the `MenuList` component. */
|
|
54
|
+
listProps?: Omit<MenuListProps, "asChild" | "variant" | "iconPlacement">;
|
|
57
55
|
/** Properties to pass to the loading element. */
|
|
58
|
-
loadingProps?:
|
|
59
|
-
/** Properties to pass to the
|
|
60
|
-
spinnerProps?:
|
|
61
|
-
/** Properties to pass to the
|
|
62
|
-
emptyMessageProps?:
|
|
56
|
+
loadingProps?: ComponentProps<"div">;
|
|
57
|
+
/** Properties to pass to the `Spinner` component. */
|
|
58
|
+
spinnerProps?: SpinnerProps;
|
|
59
|
+
/** Properties to pass to the element containing the empty message. */
|
|
60
|
+
emptyMessageProps?: ComponentProps<"div">;
|
|
63
61
|
}
|
|
64
62
|
/**
|
|
65
63
|
* The command menu renders a menu of selectable items which can be filtered and
|
|
@@ -67,7 +65,7 @@ export interface CommandMenuProps extends ComponentPropsWithoutRef<typeof Comman
|
|
|
67
65
|
*
|
|
68
66
|
* Built on top of the [cmdk Command primitive](https://github.com/dip/cmdk/)
|
|
69
67
|
* and the [`MenuList`
|
|
70
|
-
* component](
|
|
68
|
+
* component](/docs/ostack-ui-data-display-menu-list--docs).
|
|
71
69
|
*
|
|
72
70
|
* It composes the following subcomponents:
|
|
73
71
|
*
|
|
@@ -91,4 +89,4 @@ export interface CommandMenuProps extends ComponentPropsWithoutRef<typeof Comman
|
|
|
91
89
|
* }
|
|
92
90
|
* ```
|
|
93
91
|
*/
|
|
94
|
-
export declare
|
|
92
|
+
export declare function CommandMenu({ variant, iconPlacement, label, searchPlaceholder, searchValue, onSearchValueChange, listLabel, loading, loadingLabel, loadingProgress, emptyMessage, className, searchProps, searchAdornmentProps, searchIconProps, listProps, loadingProps, spinnerProps, emptyMessageProps, children, ...otherProps }: CommandMenuProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
3
|
import type { DialogContentSize } from "../Dialog";
|
|
4
|
-
import {
|
|
4
|
+
import { type OverlayProps } from "../Overlay";
|
|
5
5
|
/** Possible command menu dialog sizes. */
|
|
6
6
|
export type CommandMenuDialogSize = DialogContentSize;
|
|
7
7
|
/** Properties of the command menu dialog. */
|
|
8
|
-
export interface CommandMenuDialogProps extends Omit<
|
|
8
|
+
export interface CommandMenuDialogProps extends Omit<ComponentProps<typeof DialogPrimitive.Content>, "asChild" | "title"> {
|
|
9
9
|
/** Accessible dialog title. Not shown visibly. */
|
|
10
10
|
title?: ReactNode;
|
|
11
11
|
/** Accessible dialog description. Not shown visibly. */
|
|
@@ -37,9 +37,9 @@ export interface CommandMenuDialogProps extends Omit<ComponentPropsWithoutRef<ty
|
|
|
37
37
|
*/
|
|
38
38
|
modal?: boolean;
|
|
39
39
|
/** Properties to pass to the portal component. */
|
|
40
|
-
portalProps?: Omit<
|
|
40
|
+
portalProps?: Omit<ComponentProps<typeof DialogPrimitive.Portal>, "forceMount">;
|
|
41
41
|
/** Properties to pass to the `Overlay` component. */
|
|
42
|
-
overlayProps?:
|
|
42
|
+
overlayProps?: OverlayProps;
|
|
43
43
|
}
|
|
44
44
|
/** Component used to display the command menu within a dialog. */
|
|
45
|
-
export declare
|
|
45
|
+
export declare function CommandMenuDialog({ title, description, size, open, defaultOpen, onOpenChange, modal, forceMount, portalProps, overlayProps, className, children, ...otherProps }: CommandMenuDialogProps): import("react").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
2
|
import { Command as CommandPrimitive } from "./cmdk";
|
|
3
3
|
/** Properties of the command menu group. */
|
|
4
|
-
export interface CommandMenuGroupProps extends Omit<
|
|
4
|
+
export interface CommandMenuGroupProps extends Omit<ComponentProps<typeof CommandPrimitive.Group>, "asChild" | "heading"> {
|
|
5
5
|
/** Optional label of the command menu group. */
|
|
6
6
|
label?: ReactNode;
|
|
7
7
|
}
|
|
8
8
|
/** Component used to group multiple command items. */
|
|
9
|
-
export declare
|
|
9
|
+
export declare function CommandMenuGroup({ label, className, ...otherProps }: CommandMenuGroupProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
2
|
import { type MenuListItemProps } from "../MenuList";
|
|
3
3
|
import { Command as CommandPrimitive } from "./cmdk";
|
|
4
|
-
|
|
4
|
+
/** Properties of the command menu item component. */
|
|
5
|
+
export interface CommandMenuItemProps extends Omit<ComponentProps<typeof CommandPrimitive.Item>, "asChild" | "color">, Pick<MenuListItemProps, "selected" | "color" | "loading" | "loadingContent" | "showSpinner" | "icon" | "iconPlacement" | "keybinds" | "href" | "target" | "rel" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps" | "keybindsProps"> {
|
|
5
6
|
/**
|
|
6
7
|
* Render the item as a link. When set, you can pass `href`, `target`, and
|
|
7
8
|
* `rel` properties to the item.
|
|
@@ -10,4 +11,5 @@ export interface CommandMenuItemProps extends Omit<ComponentPropsWithoutRef<type
|
|
|
10
11
|
*/
|
|
11
12
|
asLink?: boolean;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
/** Item of the command menu. */
|
|
15
|
+
export declare function CommandMenuItem({ onSelect, selected, asLink, color, disabled, loading, loadingContent, showSpinner, icon, iconPlacement, keybinds, href, target, rel, keywords, actionProps, contentProps, iconProps, spinnerProps, keybindsProps, className, children, "aria-disabled": ariaDisabled, ...otherProps }: CommandMenuItemProps): import("react").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import { type Breakpoint } from "../../utils/breakpoints.ts";
|
|
3
3
|
import { type Responsive } from "../../utils/useResponsiveValues.ts";
|
|
4
4
|
/** Breakpoints accepted by the container. */
|
|
5
5
|
export type ContainerSize = Exclude<Breakpoint, "xs">;
|
|
6
6
|
/** Properties of the container component. */
|
|
7
|
-
export interface ContainerProps extends
|
|
7
|
+
export interface ContainerProps extends ComponentProps<"div"> {
|
|
8
8
|
/**
|
|
9
9
|
* Change the component to the HTML tag or custom component of the only child.
|
|
10
10
|
* This will merge the original component props with the props of the supplied
|
|
@@ -74,4 +74,4 @@ export interface ContainerProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
74
74
|
* }
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
77
|
-
export declare
|
|
77
|
+
export declare function Container({ asChild, fluid, maxWidth, gutter, leftGutter, rightGutter, className, style, ...otherProps }: ContainerProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentProps, type CSSProperties, type ElementType, type FocusEvent, type ReactNode } from "react";
|
|
2
2
|
import { type Responsive } from "../../utils/useResponsiveValues.ts";
|
|
3
|
-
import {
|
|
4
|
-
import type
|
|
5
|
-
import {
|
|
3
|
+
import { type CloseButtonProps } from "../CloseButton";
|
|
4
|
+
import { type ControlCodeProps } from "../ControlCode";
|
|
5
|
+
import { type SpinnerProps } from "../Spinner";
|
|
6
6
|
/** Accepted control types. */
|
|
7
7
|
export type ControlType = "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week";
|
|
8
8
|
/** Possible status of a control. */
|
|
@@ -16,7 +16,7 @@ export type ControlVariant = "default" | "cell";
|
|
|
16
16
|
/** Accepted values for "show clear button". */
|
|
17
17
|
export type ControlShowClearButton = boolean | "auto";
|
|
18
18
|
/** Base properties of the control component. */
|
|
19
|
-
type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue> = Omit<
|
|
19
|
+
type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue> = Omit<ComponentProps<TElem>, "children" | "type" | "multiple" | "defaultValue" | "value"> & {
|
|
20
20
|
/**
|
|
21
21
|
* Change the component to the HTML tag or custom component of the only child.
|
|
22
22
|
* This will merge the original component props with the props of the supplied
|
|
@@ -54,7 +54,7 @@ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue
|
|
|
54
54
|
*
|
|
55
55
|
* When `true`, the control is “soft-disabled”: it looks disabled and ignores
|
|
56
56
|
* user interaction but remains focusable. By default, a spinner is shown
|
|
57
|
-
* (
|
|
57
|
+
* (i.e. `showSpinner` is set to `true` unless overridden).
|
|
58
58
|
*
|
|
59
59
|
* The control's accessible description while loading can be controlled via
|
|
60
60
|
* `loadingDescription`.
|
|
@@ -98,7 +98,7 @@ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue
|
|
|
98
98
|
* is visible.
|
|
99
99
|
*
|
|
100
100
|
* This field should be provided when adding extra keybinds to clear the
|
|
101
|
-
* control (
|
|
101
|
+
* control (e.g. the control is a file input and pressing Backspace/Delete
|
|
102
102
|
* clears it).
|
|
103
103
|
*/
|
|
104
104
|
clearDescription?: ReactNode;
|
|
@@ -110,15 +110,15 @@ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue
|
|
|
110
110
|
*/
|
|
111
111
|
onBlurToOutside?: (event: FocusEvent) => void;
|
|
112
112
|
/** Properties to pass to the root component. */
|
|
113
|
-
rootProps?:
|
|
113
|
+
rootProps?: ComponentProps<"div">;
|
|
114
114
|
/** Properties to pass to the code component. */
|
|
115
|
-
codeProps?: Omit<
|
|
115
|
+
codeProps?: Omit<ControlCodeProps, "status">;
|
|
116
116
|
/** Properties to pass to the container component. */
|
|
117
|
-
containerProps?:
|
|
117
|
+
containerProps?: ComponentProps<"div">;
|
|
118
118
|
/** Properties to pass to the clear button component. */
|
|
119
|
-
clearButtonProps?:
|
|
119
|
+
clearButtonProps?: CloseButtonProps;
|
|
120
120
|
/** Properties to pass to the spinner component. */
|
|
121
|
-
spinnerProps?: Omit<
|
|
121
|
+
spinnerProps?: Omit<SpinnerProps, "size">;
|
|
122
122
|
};
|
|
123
123
|
/** Base properties of a single file input control. */
|
|
124
124
|
export interface ControlFileInputSingleProps extends ControlPropsBase<"input", File | null, never> {
|
|
@@ -158,5 +158,5 @@ export interface ControlOutputProps extends ControlPropsBase<"output", never> {
|
|
|
158
158
|
/** Properties of the control component. */
|
|
159
159
|
export type ControlProps = ControlFileInputSingleProps | ControlFileInputMultipleProps | ControlNonFileInputProps | ControlSelectSingleProps | ControlSelectMultipleProps | ControlTextAreaProps | ControlOutputProps;
|
|
160
160
|
/** Form control. */
|
|
161
|
-
export declare
|
|
161
|
+
export declare function Control({ asChild, type, defaultValue, value, variant, status, code, loading, loadingDescription, showSpinner, align, startAdornment, endAdornment, showClearButton, clearDescription, clearButtonLabel, onValueChange, onBlurToOutside, rootProps, codeProps, containerProps, clearButtonProps, spinnerProps, name, id, className, required, disabled, readOnly, style, onChange, onFocus, onBlur, onClick, "aria-disabled": ariaDisabled, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ref, ...otherProps }: ControlProps): import("react").JSX.Element;
|
|
162
162
|
export {};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Control
|
|
1
|
+
import type { ComponentPropsWithoutRef, ComponentRef, Ref } from "react";
|
|
2
|
+
import { Control } from "./Control.tsx";
|
|
3
|
+
/** Properties of the control with container ref component. */
|
|
4
|
+
export type ControlWithContainerRefProps = ComponentPropsWithoutRef<typeof Control> & ControlWithContainerRefOwnProps;
|
|
5
|
+
/** Own properties of the control with container ref component. */
|
|
6
|
+
export interface ControlWithContainerRefOwnProps {
|
|
7
|
+
/** Reference to the control element. */
|
|
8
|
+
controlRef?: Ref<ComponentRef<typeof Control>>;
|
|
9
|
+
/** Reference to the container element. */
|
|
10
|
+
ref?: Ref<HTMLDivElement>;
|
|
11
|
+
}
|
|
3
12
|
/**
|
|
4
13
|
* Utility control component whose `ref` is passed to the control's container.
|
|
5
14
|
* Use `controlRef` to provide the control's ref instead.
|
|
@@ -9,6 +18,4 @@ import { Control, type ControlProps } from "./Control.tsx";
|
|
|
9
18
|
* container (since popovers/menus align themselves based on the element
|
|
10
19
|
* referenced by their trigger).
|
|
11
20
|
*/
|
|
12
|
-
export declare
|
|
13
|
-
controlRef?: Ref<ComponentRef<typeof Control>>;
|
|
14
|
-
}) & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export declare function ControlWithContainerRef({ containerProps, controlRef, ref, ...otherProps }: ControlWithContainerRefProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
import type { AccentColor } from "../../utils/accent.ts";
|
|
3
|
+
import type { ControlCodeProps } from "../ControlCode";
|
|
2
4
|
import type { ControlStatus } from "./Control.tsx";
|
|
5
|
+
/** Options of the {@link useRegisterControl} hook. */
|
|
6
|
+
export interface UseRegisterControlOptions {
|
|
7
|
+
id: string | undefined;
|
|
8
|
+
name?: string;
|
|
9
|
+
tagName: string | undefined;
|
|
10
|
+
required: boolean | undefined;
|
|
11
|
+
status: ControlStatus | undefined;
|
|
12
|
+
code?: ReactNode;
|
|
13
|
+
codeProps?: ControlCodeProps;
|
|
14
|
+
}
|
|
15
|
+
/** Result of the {@link useRegisterControl} hook. */
|
|
16
|
+
export interface UseRegisterControlResult {
|
|
17
|
+
generatedId: string;
|
|
18
|
+
controlId: string | undefined;
|
|
19
|
+
codeId: string | undefined;
|
|
20
|
+
labelId: string | undefined;
|
|
21
|
+
dataTableColumnLabelId: string | null;
|
|
22
|
+
feedbackIds: string[] | undefined;
|
|
23
|
+
helperTextIds: string[] | undefined;
|
|
24
|
+
}
|
|
25
|
+
/** Hook used to register a control where necessary. */
|
|
26
|
+
export declare function useRegisterControl({ id, name, tagName, required, status, code, codeProps, }: UseRegisterControlOptions): UseRegisterControlResult;
|
|
3
27
|
/** Transforms a control status into a colour accent. */
|
|
4
28
|
export declare function controlStatusToAccent(status?: ControlStatus, defaultAccent?: AccentColor): AccentColor | undefined;
|