@ostack.tech/ui 0.15.5 → 0.16.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/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 +128 -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 +95 -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 +7 -0
- package/scss/components/HelperText/_HelperText.scss +9 -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
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
%#{$prefix}popover {
|
|
8
8
|
$popover: &;
|
|
9
9
|
|
|
10
|
+
max-width: var(--radix-popover-content-available-width);
|
|
11
|
+
max-height: var(--radix-popover-content-available-height);
|
|
12
|
+
|
|
10
13
|
border: $popover-border-width solid $popover-border-color;
|
|
11
14
|
border-radius: $popover-border-radius;
|
|
12
15
|
// These `!important`s are currently needed due to conflicts with the `Root`
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// with a dash in front.
|
|
23
23
|
@function breakpoint-infix($size, $breakpoint-by-size: $breakpoint-by-size) {
|
|
24
24
|
@return if(
|
|
25
|
-
sass(breakpoint-min($size, $breakpoint-by-size) == null): ""
|
|
25
|
+
sass(breakpoint-min($size, $breakpoint-by-size) == null): "";
|
|
26
26
|
else: "-#{$size}"
|
|
27
27
|
);
|
|
28
28
|
}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
// Declares a CSS variable when the values isn't `null`.
|
|
4
4
|
@mixin declare-var($var, $value: null) {
|
|
5
5
|
@if ($value != null and $value != NULL) {
|
|
6
|
-
#{$var}: #{if(sass($value == ""): ""
|
|
6
|
+
#{$var}: #{if(sass($value == ""): ""; else: meta.inspect($value))};
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { type CloseButtonProps } from "../CloseButton";
|
|
3
|
+
import { type CollapsibleContentProps } from "../Collapsible";
|
|
4
|
+
import { type IconProp, type IconProps } from "../Icon";
|
|
5
5
|
/** Alert variants. */
|
|
6
6
|
export type AlertVariant = "solid" | "subtle" | "outlined";
|
|
7
7
|
/** Alert severities. */
|
|
@@ -9,7 +9,7 @@ export type AlertSeverity = "neutral" | "info" | "success" | "danger" | "warning
|
|
|
9
9
|
/** Alert type of announcement. */
|
|
10
10
|
export type AlertAnnounce = "off" | "polite" | "assertive";
|
|
11
11
|
/** Properties of the alert component. */
|
|
12
|
-
export interface AlertProps extends
|
|
12
|
+
export interface AlertProps extends ComponentProps<"div"> {
|
|
13
13
|
/**
|
|
14
14
|
* Alert variant.
|
|
15
15
|
*
|
|
@@ -52,10 +52,7 @@ export interface AlertProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
52
52
|
open?: boolean;
|
|
53
53
|
/** Function called when the open state changes. */
|
|
54
54
|
onOpenChange?: (open: boolean) => void;
|
|
55
|
-
/**
|
|
56
|
-
* Icon to show. The default icon is `faCircleInfo`. Each severity except
|
|
57
|
-
* `"neutral"` has its own default icon.
|
|
58
|
-
*/
|
|
55
|
+
/** Icon to show. Each severity except `"neutral"` has its own default icon. */
|
|
59
56
|
icon?: IconProp | null;
|
|
60
57
|
/**
|
|
61
58
|
* Whether to show a close button.
|
|
@@ -64,15 +61,15 @@ export interface AlertProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
64
61
|
*/
|
|
65
62
|
showCloseButton?: boolean;
|
|
66
63
|
/** Properties to pass to the container component. */
|
|
67
|
-
containerProps?:
|
|
64
|
+
containerProps?: CollapsibleContentProps;
|
|
68
65
|
/** Properties to pass to the icon component. */
|
|
69
|
-
iconProps?: Omit<
|
|
66
|
+
iconProps?: Omit<IconProps, "icon">;
|
|
70
67
|
/** Properties to pass to the content component. */
|
|
71
|
-
contentProps?:
|
|
68
|
+
contentProps?: ComponentProps<"div">;
|
|
72
69
|
/** Properties to pass to the component containing the action/close button. */
|
|
73
|
-
actionContainerProps?:
|
|
70
|
+
actionContainerProps?: ComponentProps<"div">;
|
|
74
71
|
/** Properties to pass to the close button component. */
|
|
75
|
-
closeButtonProps?:
|
|
72
|
+
closeButtonProps?: CloseButtonProps;
|
|
76
73
|
}
|
|
77
74
|
/**
|
|
78
75
|
* The alert component can be used to attract the user's attention.
|
|
@@ -96,4 +93,4 @@ export interface AlertProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
96
93
|
* }
|
|
97
94
|
* ```
|
|
98
95
|
*/
|
|
99
|
-
export declare
|
|
96
|
+
export declare function Alert({ variant, severity, announce, defaultOpen, open, onOpenChange, icon, showCloseButton, action, containerProps, iconProps, contentProps, actionContainerProps, closeButtonProps, children, className, role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...otherProps }: AlertProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
|
|
2
2
|
/** Element an alert title can be rendered as. */
|
|
3
3
|
export type AlertTitleAs = "div" | "span" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
4
4
|
/** Properties of the alert title component. */
|
|
@@ -13,4 +13,4 @@ export interface AlertTitleOwnProps {
|
|
|
13
13
|
asChild?: boolean;
|
|
14
14
|
}
|
|
15
15
|
/** Title of the alert. */
|
|
16
|
-
export declare
|
|
16
|
+
export declare function AlertTitle<TAs extends AlertTitleAs = "div">({ as, asChild, id, className, ref, ...otherProps }: AlertTitleProps<TAs>): import("react").JSX.Element;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
/** Properties of the alert dialog component. */
|
|
4
|
+
export interface AlertDialogProps extends ComponentProps<typeof AlertDialogPrimitive.Root> {
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* The alert dialog component displays an important overlaid “window” to the
|
|
4
8
|
* user and expects a response.
|
|
5
9
|
*
|
|
6
10
|
* Built on top of the [Radix Alert Dialog
|
|
7
11
|
* primitive](https://www.radix-ui.com/primitives/docs/components/alert-dialog),
|
|
8
|
-
* and the [`Card` component](
|
|
12
|
+
* and the [`Card` component](/docs/ostack-ui-data-display-card--docs).
|
|
9
13
|
*
|
|
10
14
|
* It composes the following subcomponents:
|
|
11
15
|
*
|
|
@@ -79,7 +83,7 @@ import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
|
79
83
|
* ```
|
|
80
84
|
*
|
|
81
85
|
* > **Note:** In many scenarios you might prefer to use the [`useAlertDialog`
|
|
82
|
-
* > hook](
|
|
86
|
+
* > hook](/docs/ostack-ui-overlay-alert-dialog--docs#usealertdialog-hook)
|
|
83
87
|
* > instead, which provides an imperative API for triggering “alert”, “confirm”,
|
|
84
88
|
* > or “prompt” dialogs.
|
|
85
89
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
/** Properties of the alert dialog action component. */
|
|
4
|
-
export interface AlertDialogActionProps extends Omit<
|
|
4
|
+
export interface AlertDialogActionProps extends Omit<ComponentProps<typeof AlertDialogPrimitive.Action>, "asChild"> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Button which closes the alert dialog by accepting the action. These buttons
|
|
8
8
|
* should be distinguished visually from `AlertDialogCancel` buttons.
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
10
|
+
export declare function AlertDialogAction(props: AlertDialogActionProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { DialogBody } from "../Dialog";
|
|
1
|
+
import { DialogBody, type DialogBodyProps } from "../Dialog";
|
|
3
2
|
/** Properties to the alert dialog body component. */
|
|
4
|
-
export
|
|
5
|
-
}
|
|
3
|
+
export type AlertDialogBodyProps = DialogBodyProps;
|
|
6
4
|
/** Body section of the alert dialog. */
|
|
7
|
-
export declare const AlertDialogBody:
|
|
5
|
+
export declare const AlertDialogBody: typeof DialogBody;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
/** Properties of the alert dialog cancel component. */
|
|
4
|
-
export interface AlertDialogCancelProps extends Omit<
|
|
4
|
+
export interface AlertDialogCancelProps extends Omit<ComponentProps<typeof AlertDialogPrimitive.Cancel>, "asChild"> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Button which closes the alert dialog by cancelling the action. These buttons
|
|
8
8
|
* should be distinguished visually from `AlertDialogAction` buttons.
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
10
|
+
export declare function AlertDialogCancel(props: AlertDialogCancelProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
import type { DialogContentColor, DialogContentSize, DialogContentVariant } from "../Dialog";
|
|
4
|
-
import {
|
|
4
|
+
import { type OverlayProps } from "../Overlay";
|
|
5
5
|
/** Alert dialog content variants. */
|
|
6
6
|
export type AlertDialogContentVariant = DialogContentVariant;
|
|
7
7
|
/** Possible alert dialog content colors. */
|
|
@@ -9,7 +9,7 @@ export type AlertDialogContentColor = DialogContentColor;
|
|
|
9
9
|
/** Possible alert dialog content sizes. */
|
|
10
10
|
export type AlertDialogContentSize = DialogContentSize;
|
|
11
11
|
/** Properties of the alert dialog content component. */
|
|
12
|
-
export interface AlertDialogContentProps extends
|
|
12
|
+
export interface AlertDialogContentProps extends ComponentProps<typeof AlertDialogPrimitive.Content> {
|
|
13
13
|
/**
|
|
14
14
|
* Dialog content variant.
|
|
15
15
|
*
|
|
@@ -37,9 +37,9 @@ export interface AlertDialogContentProps extends ComponentPropsWithoutRef<typeof
|
|
|
37
37
|
*/
|
|
38
38
|
size?: AlertDialogContentSize;
|
|
39
39
|
/** Properties to pass to the portal component. */
|
|
40
|
-
portalProps?: Omit<
|
|
40
|
+
portalProps?: Omit<ComponentProps<typeof AlertDialogPrimitive.Portal>, "forceMount">;
|
|
41
41
|
/** Properties to pass to the dialog's overlay component. */
|
|
42
|
-
overlayProps?:
|
|
42
|
+
overlayProps?: OverlayProps;
|
|
43
43
|
}
|
|
44
44
|
/** Content to be rendered in the open alert dialog. */
|
|
45
|
-
export declare
|
|
45
|
+
export declare function AlertDialogContent({ asChild, variant, mergeSections, color, size, forceMount, portalProps, overlayProps, className, children, ...otherProps }: AlertDialogContentProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
/** Properties of the alert dialog description component. */
|
|
4
|
-
export interface AlertDialogDescriptionProps extends
|
|
4
|
+
export interface AlertDialogDescriptionProps extends ComponentProps<typeof AlertDialogPrimitive.Description> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Optional accessible description to be announced when the alert dialog is
|
|
@@ -11,4 +11,4 @@ export interface AlertDialogDescriptionProps extends ComponentPropsWithoutRef<ty
|
|
|
11
11
|
* the description entirely, pass `aria-describedby={undefined}` to the
|
|
12
12
|
* `AlertDialogContent` and omit this component.
|
|
13
13
|
*/
|
|
14
|
-
export declare
|
|
14
|
+
export declare function AlertDialogDescription({ className, ...otherProps }: AlertDialogDescriptionProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { DialogFooter } from "../Dialog";
|
|
1
|
+
import { DialogFooter, type DialogFooterProps } from "../Dialog";
|
|
3
2
|
/** Properties to the alert dialog footer component. */
|
|
4
|
-
export
|
|
5
|
-
}
|
|
3
|
+
export type AlertDialogFooterProps = DialogFooterProps;
|
|
6
4
|
/** Footer section of the alert dialog. */
|
|
7
|
-
export declare const AlertDialogFooter:
|
|
5
|
+
export declare const AlertDialogFooter: typeof DialogFooter;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { CardHeader } from "../Card";
|
|
1
|
+
import { type CardHeaderProps } from "../Card";
|
|
3
2
|
/** Properties of the alert dialog header component. */
|
|
4
|
-
export interface AlertDialogHeaderProps extends
|
|
3
|
+
export interface AlertDialogHeaderProps extends CardHeaderProps {
|
|
5
4
|
}
|
|
6
5
|
/** Header section of the alert dialog. */
|
|
7
|
-
export declare
|
|
6
|
+
export declare function AlertDialogHeader({ className, ...otherProps }: AlertDialogHeaderProps): import("react").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
|
|
4
4
|
/** Element an alert dialog title can be rendered as. */
|
|
5
5
|
export type AlertDialogTitleAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span";
|
|
6
6
|
/** Properties of the alert dialog title component. */
|
|
7
7
|
export type AlertDialogTitleProps<TAs extends AlertDialogTitleAs = "h2"> = PolymorphicProps<AlertDialogTitleAs, TAs, "h2", AlertDialogTitleOwnProps>;
|
|
8
8
|
/** Own properties of the alert dialog title component. */
|
|
9
|
-
export interface AlertDialogTitleOwnProps extends Pick<
|
|
9
|
+
export interface AlertDialogTitleOwnProps extends Pick<ComponentProps<typeof AlertDialogPrimitive.Title>, "asChild"> {
|
|
10
10
|
}
|
|
11
11
|
/** Accessible title to be announced when the alert dialog is opened. */
|
|
12
|
-
export declare
|
|
12
|
+
export declare function AlertDialogTitle<TAs extends AlertDialogTitleAs = "h2">({ as, asChild, className, ...otherProps }: AlertDialogTitleProps<TAs>): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
/** Properties of the alert dialog trigger component. */
|
|
4
|
-
export interface AlertDialogTriggerProps extends Omit<
|
|
4
|
+
export interface AlertDialogTriggerProps extends Omit<ComponentProps<typeof AlertDialogPrimitive.Trigger>, "asChild"> {
|
|
5
5
|
}
|
|
6
6
|
/** The button which, when pressed, opens the alert dialog */
|
|
7
|
-
export declare
|
|
7
|
+
export declare function AlertDialogTrigger(props: AlertDialogTriggerProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import type { AccentColor } from "../../utils/accent.ts";
|
|
3
3
|
import { type KeyboardShortcutKeybinds } from "../../utils/keyboardShortcut.ts";
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
|
|
5
|
+
import { type IconProp, type IconProps } from "../Icon";
|
|
6
|
+
import { type KeybindsProps } from "../Keybinds";
|
|
7
|
+
import { type SpinnerProps } from "../Spinner";
|
|
8
|
+
import { type TooltipProps } from "../Tooltip";
|
|
9
9
|
/** Elements a button can be rendered as. */
|
|
10
10
|
export type ButtonAs = "button" | "a";
|
|
11
11
|
/** Button variants. */
|
|
@@ -82,8 +82,7 @@ export interface ButtonOwnProps {
|
|
|
82
82
|
*
|
|
83
83
|
* When `true`, the button is “soft-disabled”: it looks disabled and ignores
|
|
84
84
|
* user interaction but remains focusable. By default, a spinner is shown as
|
|
85
|
-
* the button's icon (
|
|
86
|
-
* overridden).
|
|
85
|
+
* the button's icon (i.e. `showSpinner` is set to `true` unless overridden).
|
|
87
86
|
*
|
|
88
87
|
* The button's content while loading can be controlled via `loadingContent`.
|
|
89
88
|
* The position of the spinner may be controlled via `iconPlacement`.
|
|
@@ -131,18 +130,18 @@ export interface ButtonOwnProps {
|
|
|
131
130
|
* readers via `aria-keyshortcuts`.
|
|
132
131
|
*
|
|
133
132
|
* > **Note:** This property does **not** automatically register a keyboard
|
|
134
|
-
* > shortcut to run the button's action. This should be done manually via
|
|
135
|
-
* >
|
|
133
|
+
* > shortcut to run the button's action. This should be done manually via e.g.
|
|
134
|
+
* > the `useKeyboardShortcut` hook.
|
|
136
135
|
*/
|
|
137
136
|
keybinds?: KeyboardShortcutKeybinds;
|
|
138
137
|
/** Properties to pass to the icon component. */
|
|
139
|
-
iconProps?: Omit<
|
|
138
|
+
iconProps?: Omit<IconProps, "icon">;
|
|
140
139
|
/** Properties to pass to the spinner component. */
|
|
141
|
-
spinnerProps?:
|
|
140
|
+
spinnerProps?: SpinnerProps;
|
|
142
141
|
/** Properties to pass to the tooltip component. */
|
|
143
|
-
tooltipProps?: Omit<
|
|
142
|
+
tooltipProps?: Omit<TooltipProps, "content" | "children">;
|
|
144
143
|
/** Properties to pass to the keybinds component. */
|
|
145
|
-
keybindsProps?:
|
|
144
|
+
keybindsProps?: KeybindsProps;
|
|
146
145
|
}
|
|
147
146
|
/**
|
|
148
147
|
* The button component is used to trigger actions or events, such as opening a
|
|
@@ -159,4 +158,4 @@ export interface ButtonOwnProps {
|
|
|
159
158
|
* }
|
|
160
159
|
* ```
|
|
161
160
|
*/
|
|
162
|
-
export declare
|
|
161
|
+
export declare function Button<TAs extends ButtonAs = "button">({ as, asChild, variant, color, size, vertical, icon, iconPlacement, active, disabled, loading, loadingContent, showSpinner, tooltipContent, keybinds, iconProps, spinnerProps, tooltipProps, keybindsProps, type, onClick, className, children, "aria-disabled": ariaDisabled, ...otherProps }: ButtonProps<TAs>): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
/** Properties of the button group component. */
|
|
3
|
-
export interface ButtonGroupProps extends
|
|
3
|
+
export interface ButtonGroupProps extends ComponentProps<"div"> {
|
|
4
4
|
/**
|
|
5
5
|
* Change the component to the HTML tag or custom component of the only child.
|
|
6
6
|
* This will merge the original component props with the props of the supplied
|
|
@@ -29,4 +29,4 @@ export interface ButtonGroupProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
29
29
|
* }
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
export declare
|
|
32
|
+
export declare function ButtonGroup({ asChild, className, ...otherProps }: ButtonGroupProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DayPickerProps } from "@daypicker/react";
|
|
2
|
-
import { type
|
|
3
|
-
import type {
|
|
2
|
+
import { type ComponentProps, type RefObject } from "react";
|
|
3
|
+
import type { IconButtonProps } from "../IconButton";
|
|
4
4
|
import type { SelectSingleProps } from "../Select";
|
|
5
5
|
/** Mode for selecting calendar dates. */
|
|
6
6
|
export type CalendarSelectionMode = "none" | "single" | "multiple" | "range" | "range-start" | "range-end";
|
|
@@ -73,13 +73,13 @@ export interface CalendarPropsBase<TValue extends Date | Date[] | DateRange | nu
|
|
|
73
73
|
/** Reference to the calendar API. */
|
|
74
74
|
apiRef?: RefObject<CalendarApi<TValue> | null>;
|
|
75
75
|
/** Properties to pass to the header element. */
|
|
76
|
-
headerProps?:
|
|
76
|
+
headerProps?: ComponentProps<"header">;
|
|
77
77
|
/** Properties to pass to the header label element. */
|
|
78
|
-
headerLabelProps?:
|
|
78
|
+
headerLabelProps?: ComponentProps<"span">;
|
|
79
79
|
/** Properties to pass to the previous button component. */
|
|
80
|
-
previousButtonProps?:
|
|
80
|
+
previousButtonProps?: IconButtonProps;
|
|
81
81
|
/** Properties to pass to the next button component. */
|
|
82
|
-
nextButtonProps?:
|
|
82
|
+
nextButtonProps?: IconButtonProps;
|
|
83
83
|
/** Properties to pass to the month select component. */
|
|
84
84
|
monthSelectProps?: Omit<SelectSingleProps, "defaultValue" | "value">;
|
|
85
85
|
/** Properties to pass to the year select component. */
|
|
@@ -5,4 +5,4 @@ import { type DayProps } from "@daypicker/react";
|
|
|
5
5
|
* wrapper over the day text which lets us style it without styling the whole
|
|
6
6
|
* button.
|
|
7
7
|
*/
|
|
8
|
-
export declare
|
|
8
|
+
export declare function CalendarDay({ day: _day, modifiers, children, ...otherProps }: DayProps): import("react").JSX.Element;
|
|
@@ -3,4 +3,4 @@ import { type MonthCaptionProps } from "@daypicker/react";
|
|
|
3
3
|
* Reimplementation of the React Day Picker's caption component to provide both
|
|
4
4
|
* navigation arrows and dropdown selections.
|
|
5
5
|
*/
|
|
6
|
-
export declare
|
|
6
|
+
export declare function CalendarHeader({ calendarMonth, displayIndex, ...otherProps }: MonthCaptionProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { MonthGridProps } from "@daypicker/react";
|
|
2
|
-
export declare
|
|
2
|
+
export declare function CalendarMonthGrid({ children, "aria-label": ariaLabel, ...otherProps }: MonthGridProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { AccentColor } from "../../utils/accent.ts";
|
|
3
3
|
/** Card variants. */
|
|
4
4
|
export type CardVariant = "solid" | "subtle" | "outlined" | "ghost";
|
|
5
5
|
/** Possible card colours. */
|
|
6
6
|
export type CardColor = AccentColor;
|
|
7
7
|
/** Properties of the card component. */
|
|
8
|
-
export interface CardProps extends
|
|
8
|
+
export interface CardProps extends ComponentProps<"div"> {
|
|
9
9
|
/**
|
|
10
10
|
* Change the component to the HTML tag or custom component of the only child.
|
|
11
11
|
* This will merge the original component props with the props of the supplied
|
|
@@ -67,4 +67,4 @@ export interface CardProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
67
67
|
* }
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
|
-
export declare
|
|
70
|
+
export declare function Card({ asChild, variant, color, mergeSections, className, ...otherProps }: CardProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
/** Properties of the card body component. */
|
|
3
|
-
export interface CardBodyProps extends
|
|
3
|
+
export interface CardBodyProps extends ComponentProps<"div"> {
|
|
4
4
|
/**
|
|
5
5
|
* Change the component to the HTML tag or custom component of the only child.
|
|
6
6
|
* This will merge the original component props with the props of the supplied
|
|
@@ -9,4 +9,4 @@ export interface CardBodyProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
}
|
|
11
11
|
/** Body section of the `Card` component. */
|
|
12
|
-
export declare
|
|
12
|
+
export declare function CardBody({ asChild, className, ...otherProps }: CardBodyProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
/** Properties of the card footer component. */
|
|
3
|
-
export interface CardFooterProps extends
|
|
3
|
+
export interface CardFooterProps extends ComponentProps<"div"> {
|
|
4
4
|
/**
|
|
5
5
|
* Change the component to the HTML tag or custom component of the only child.
|
|
6
6
|
* This will merge the original component props with the props of the supplied
|
|
@@ -9,4 +9,4 @@ export interface CardFooterProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
}
|
|
11
11
|
/** Footer section of the `Card` component. */
|
|
12
|
-
export declare
|
|
12
|
+
export declare function CardFooter({ asChild, className, ...otherProps }: CardFooterProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
/** Properties of the card header component. */
|
|
3
|
-
export interface CardHeaderProps extends
|
|
3
|
+
export interface CardHeaderProps extends ComponentProps<"div"> {
|
|
4
4
|
/**
|
|
5
5
|
* Change the component to the HTML tag or custom component of the only child.
|
|
6
6
|
* This will merge the original component props with the props of the supplied
|
|
@@ -9,4 +9,4 @@ export interface CardHeaderProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
}
|
|
11
11
|
/** Header section of the `Card` component. */
|
|
12
|
-
export declare
|
|
12
|
+
export declare function CardHeader({ asChild, className, ...otherProps }: CardHeaderProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
|
|
2
2
|
/** Elements a card title can be rendered as. */
|
|
3
3
|
export type CardTitleAs = "div" | "span" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
4
|
-
/** Properties of the
|
|
4
|
+
/** Properties of the card title component. */
|
|
5
5
|
export type CardTitleProps<TAs extends CardTitleAs = "div"> = PolymorphicProps<CardTitleAs, TAs, "div", CardTitleOwnProps>;
|
|
6
6
|
/** Own properties of the card title component. */
|
|
7
7
|
export interface CardTitleOwnProps {
|
|
@@ -13,4 +13,4 @@ export interface CardTitleOwnProps {
|
|
|
13
13
|
asChild?: boolean;
|
|
14
14
|
}
|
|
15
15
|
/** Title of the `Card` component. */
|
|
16
|
-
export declare
|
|
16
|
+
export declare function CardTitle<TAs extends CardTitleAs = "div">({ as, asChild, className, ...otherProps }: CardTitleProps<TAs>): import("react").JSX.Element;
|
|
@@ -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;
|