@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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Properties of the helper text provider component. */
|
|
3
|
+
export interface HelperTextProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Component providing context necessary for form controls aware of helper
|
|
8
|
+
* texts.
|
|
9
|
+
*
|
|
10
|
+
* The `Field` component uses this component internally. As such, it is seldom
|
|
11
|
+
* necessary to use it manually.
|
|
12
|
+
*/
|
|
13
|
+
export declare function HelperTextProvider({ children }: HelperTextProviderProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IconProp } from "@fortawesome/fontawesome-svg-core";
|
|
2
2
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
3
|
-
import {
|
|
3
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
4
4
|
import type { AccentColor } from "../../utils/accent.ts";
|
|
5
5
|
export type { IconProp } from "@fortawesome/fontawesome-svg-core";
|
|
6
6
|
/** Possible sizes of an icon. */
|
|
@@ -8,7 +8,7 @@ export type IconSize = "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
|
|
|
8
8
|
/** Possible colours of an icon. */
|
|
9
9
|
export type IconColor = AccentColor;
|
|
10
10
|
/** Properties of the icon component. */
|
|
11
|
-
export interface IconProps extends Omit<
|
|
11
|
+
export interface IconProps extends Omit<ComponentProps<typeof FontAwesomeIcon>, "icon" | "size"> {
|
|
12
12
|
/** Icon to display. */
|
|
13
13
|
icon: IconProp;
|
|
14
14
|
/**
|
|
@@ -53,4 +53,4 @@ export interface IconProps extends Omit<ComponentPropsWithoutRef<typeof FontAwes
|
|
|
53
53
|
* }
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
|
-
export declare
|
|
56
|
+
export declare function Icon({ size, color, label, className, ...otherProps }: IconProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { type KeyboardShortcutKeybinds } from "../../utils/keyboardShortcut.ts";
|
|
3
|
-
import type {
|
|
3
|
+
import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
|
|
4
4
|
import type { ButtonAs, ButtonColor, ButtonSize, ButtonVariant } from "../Button";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
+
import { type VisuallyHiddenProps } from "../VisuallyHidden";
|
|
9
10
|
/** Elements an icon button can be rendered as. */
|
|
10
11
|
export type IconButtonAs = ButtonAs;
|
|
11
12
|
/** Icon button variants. */
|
|
@@ -72,8 +73,7 @@ export interface IconButtonOwnProps {
|
|
|
72
73
|
*
|
|
73
74
|
* When `true`, the button is “soft-disabled”: it looks disabled and ignores
|
|
74
75
|
* user interaction but remains focusable. By default, a spinner is shown as
|
|
75
|
-
* the button's icon (
|
|
76
|
-
* overridden).
|
|
76
|
+
* the button's icon (i.e. `showSpinner` is set to `true` unless overridden).
|
|
77
77
|
*
|
|
78
78
|
* The button's label while loading can be controlled via `loadingLabel`.
|
|
79
79
|
*
|
|
@@ -127,19 +127,19 @@ export interface IconButtonOwnProps {
|
|
|
127
127
|
*
|
|
128
128
|
* > **Note:** This property does **not** automatically register a keyboard
|
|
129
129
|
* > shortcut to run the icon button's action. This should be done manually via
|
|
130
|
-
* >
|
|
130
|
+
* > e.g. the `useKeyboardShortcut` hook.
|
|
131
131
|
*/
|
|
132
132
|
keybinds?: KeyboardShortcutKeybinds;
|
|
133
133
|
/** Properties to pass to the `Icon` component. */
|
|
134
|
-
iconProps?: Omit<
|
|
134
|
+
iconProps?: Omit<IconProps, "icon" | "label">;
|
|
135
135
|
/** Properties to pass to the `VisuallyHidden` label component. */
|
|
136
|
-
labelProps?: Omit<
|
|
136
|
+
labelProps?: Omit<VisuallyHiddenProps, "children">;
|
|
137
137
|
/** Properties to pass to the `Spinner` component. */
|
|
138
|
-
spinnerProps?:
|
|
138
|
+
spinnerProps?: SpinnerProps;
|
|
139
139
|
/** Properties to pass to the `Tooltip` component. */
|
|
140
|
-
tooltipProps?: Omit<
|
|
140
|
+
tooltipProps?: Omit<TooltipProps, "content" | "children">;
|
|
141
141
|
/** Properties to pass to the keybinds component. */
|
|
142
|
-
keybindsProps?:
|
|
142
|
+
keybindsProps?: Omit<KeybindsProps, "keybinds">;
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* The icon button component renders a button containing a single icon. Use it
|
|
@@ -151,8 +151,8 @@ export interface IconButtonOwnProps {
|
|
|
151
151
|
*
|
|
152
152
|
* Built on top of the browser's [`<button>`
|
|
153
153
|
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button),
|
|
154
|
-
* [`Icon` component](
|
|
155
|
-
*
|
|
154
|
+
* [`Icon` component](/docs/ostack-ui-data-display-icon--docs), and [`Tooltip`
|
|
155
|
+
* component](/docs/ostack-ui-overlay-tooltip--docs).
|
|
156
156
|
*
|
|
157
157
|
* Example usage:
|
|
158
158
|
*
|
|
@@ -171,4 +171,4 @@ export interface IconButtonOwnProps {
|
|
|
171
171
|
* }
|
|
172
172
|
* ```
|
|
173
173
|
*/
|
|
174
|
-
export declare
|
|
174
|
+
export declare function IconButton<TAs extends IconButtonAs = "button">({ as, asChild, variant, color, size, circle, icon, label, active, disabled, loading, loadingLabel, showSpinner, tooltipContent, keybinds, iconProps, labelProps, spinnerProps, tooltipProps, keybindsProps, type, onClick, className, children, "aria-disabled": ariaDisabled, ...otherProps }: IconButtonProps<TAs>): import("react").JSX.Element;
|
|
@@ -43,4 +43,4 @@ export type InputProps = InputSingleFileProps | InputMultipleFileProps | InputNo
|
|
|
43
43
|
* }
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
|
-
export declare
|
|
46
|
+
export declare function Input({ type, multiple, name, defaultValue, value, status, disabled, validate, validationMode, onValueChange, onBlurToOutside, ...otherProps }: InputProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
/** Properties of the keybinds component. */
|
|
3
|
+
export interface KeybindsProps extends Omit<ComponentProps<"span">, "children"> {
|
|
3
4
|
keybinds: string | string[] | null | undefined;
|
|
4
5
|
/**
|
|
5
6
|
* Limits the number of keybinds to display. Must be >= 1. By default, all
|
|
@@ -17,4 +18,8 @@ export interface KeybindsProps extends Omit<ComponentPropsWithoutRef<"span">, "c
|
|
|
17
18
|
/** Accessible key labels to use instead of the default ones. */
|
|
18
19
|
keyLabels?: Record<string, ReactNode>;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Component which visually renders
|
|
23
|
+
* [`tinykeys`](https://jamiebuilds.github.io/tinykeys) keybinds.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Keybinds({ keybinds, limit, keybindsSeparatorLabel, keyPressesSeparatorLabel, keySymbols, keyLabels, className, ...otherProps }: KeybindsProps): import("react").JSX.Element | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
/** Properties of the keyboard component. */
|
|
3
|
-
export interface KeyboardProps extends
|
|
3
|
+
export interface KeyboardProps extends ComponentProps<"kbd"> {
|
|
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
|
|
@@ -27,4 +27,4 @@ export interface KeyboardProps extends ComponentPropsWithoutRef<"kbd"> {
|
|
|
27
27
|
* }
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
export declare
|
|
30
|
+
export declare function Keyboard({ asChild, className, ...otherProps }: KeyboardProps): import("react").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Label as LabelPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import { type IconProps } from "../Icon";
|
|
4
|
+
import { type IconButtonProps } from "../IconButton";
|
|
5
|
+
import { type PopoverContentProps, type PopoverProps } from "../Popover";
|
|
6
6
|
/** Properties of the label component. */
|
|
7
|
-
export interface LabelProps extends
|
|
7
|
+
export interface LabelProps extends ComponentProps<typeof LabelPrimitive.Root> {
|
|
8
8
|
/** Shows a "required" symbol next to the label. */
|
|
9
9
|
required?: boolean;
|
|
10
10
|
/** Optional helper text displayed as a popover triggered by an icon button. */
|
|
@@ -12,24 +12,24 @@ export interface LabelProps extends ComponentPropsWithoutRef<typeof LabelPrimiti
|
|
|
12
12
|
/** Label of the helper button announced to assistive technologies. */
|
|
13
13
|
helperButtonLabel?: string;
|
|
14
14
|
/** Properties to pass to the container element. */
|
|
15
|
-
containerProps?:
|
|
15
|
+
containerProps?: ComponentProps<"div">;
|
|
16
16
|
/** Properties to pass to the required icon container element. */
|
|
17
|
-
requiredIconContainerProps?:
|
|
17
|
+
requiredIconContainerProps?: ComponentProps<"span">;
|
|
18
18
|
/** Properties to pass to the required icon component. */
|
|
19
|
-
requiredIconProps?: Omit<
|
|
19
|
+
requiredIconProps?: Omit<IconProps, "icon">;
|
|
20
20
|
/** Properties to pass to the helper button component. */
|
|
21
|
-
helperButtonProps?: Omit<
|
|
21
|
+
helperButtonProps?: Omit<IconButtonProps, "icon">;
|
|
22
22
|
/** Properties to pass to the helper popover component. */
|
|
23
|
-
helperPopoverProps?:
|
|
23
|
+
helperPopoverProps?: PopoverProps;
|
|
24
24
|
/** Properties to pass to the helper popover content component. */
|
|
25
|
-
helperPopoverContentProps?:
|
|
25
|
+
helperPopoverContentProps?: PopoverContentProps;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* The `Label` component renders an accessible label which can be associated
|
|
29
29
|
* with form controls.
|
|
30
30
|
*
|
|
31
|
-
* It should typically be used within a `Field` component together with a
|
|
32
|
-
* control (`Input`, `
|
|
31
|
+
* It should typically be used within a `Field` component together with a form
|
|
32
|
+
* control (`Input`, `TextArea`, `Select`, etc.), in which case the label will
|
|
33
33
|
* be automatically associated with its respective control.
|
|
34
34
|
*
|
|
35
35
|
* Example usage:
|
|
@@ -42,4 +42,4 @@ export interface LabelProps extends ComponentPropsWithoutRef<typeof LabelPrimiti
|
|
|
42
42
|
* }
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
export declare
|
|
45
|
+
export declare function Label({ asChild, required, helperText, helperButtonLabel, htmlFor, id, className, children, containerProps, requiredIconProps, requiredIconContainerProps, helperButtonProps, helperPopoverProps, helperPopoverContentProps, onClick, ...otherProps }: LabelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** Value of the label context. */
|
|
3
|
+
export type LabelContextValue = LabelStore;
|
|
4
|
+
/** State of the label context. */
|
|
5
|
+
export interface LabelState {
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
labelId?: string;
|
|
8
|
+
controlId?: string;
|
|
9
|
+
controlTagName?: string;
|
|
10
|
+
controlRequired: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Label store. */
|
|
13
|
+
export type LabelStore = ReturnType<typeof useCreateLabelContext>;
|
|
14
|
+
/** Label context. */
|
|
15
|
+
export declare const LabelContext: import("react").Context<(Omit<import("zustand").StoreApi<LabelState>, "subscribe"> & {
|
|
16
|
+
subscribe: {
|
|
17
|
+
(listener: (selectedState: LabelState, previousSelectedState: LabelState) => void): () => void;
|
|
18
|
+
<U>(selector: (state: LabelState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
19
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
20
|
+
fireImmediately?: boolean;
|
|
21
|
+
} | undefined): () => void;
|
|
22
|
+
};
|
|
23
|
+
}) | null>;
|
|
24
|
+
/** Hook which creates the label context value. */
|
|
25
|
+
export declare function useCreateLabelContext(): Omit<import("zustand").StoreApi<LabelState>, "subscribe"> & {
|
|
26
|
+
subscribe: {
|
|
27
|
+
(listener: (selectedState: LabelState, previousSelectedState: LabelState) => void): () => void;
|
|
28
|
+
<U>(selector: (state: LabelState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
29
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
30
|
+
fireImmediately?: boolean;
|
|
31
|
+
} | undefined): () => void;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** Hook returning the label's context value. */
|
|
35
|
+
export declare function useLabelContext(): LabelContextValue | null;
|
|
36
|
+
/** Hook that returns access to the label's store. */
|
|
37
|
+
export declare function useLabelStore<T>(selector: (state: Partial<LabelState>) => T): T;
|
|
38
|
+
/** Hook that registers a label and returns its identifier. */
|
|
39
|
+
export declare function useRegisterLabel(label: ReactNode, labelId: string | undefined): string | undefined;
|
|
40
|
+
/** Hook exposing whether the `id` of a control. */
|
|
41
|
+
export declare function useLabelControlId(): string | undefined;
|
|
42
|
+
/** Hook exposing whether the `tagName` of a control. */
|
|
43
|
+
export declare function useLabelControlTagName(): string | undefined;
|
|
44
|
+
/** Hook exposing whether a control is marked as required. */
|
|
45
|
+
export declare function useLabelControlRequired(): boolean | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Properties of the label provider component. */
|
|
3
|
+
export interface LabelProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Component providing context necessary for form controls aware of labels and
|
|
8
|
+
* vice versa.
|
|
9
|
+
*
|
|
10
|
+
* The `Field` component uses this component internally. As such, it is seldom
|
|
11
|
+
* necessary to use it manually.
|
|
12
|
+
*/
|
|
13
|
+
export declare function LabelProvider({ children }: LabelProviderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** Hook exposing whether a component is being rendered within a label provider. */
|
|
3
|
+
export declare function useIsInLabelProvider(): boolean;
|
|
4
|
+
/** Hook exposing the label's `children`. */
|
|
5
|
+
export declare function useLabel(): ReactNode;
|
|
6
|
+
/** Hook exposing the label's id. */
|
|
7
|
+
export declare function useLabelId(): string | undefined;
|
|
8
|
+
/** Options available to the {@link useOnLabelChange} hook. */
|
|
9
|
+
export interface UseOnLabelChangeOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Whether to run the callback immediately with the current label.
|
|
12
|
+
*
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
fireImmediately?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Hook which runs the provided callback whenever the label's label changes. */
|
|
18
|
+
export declare function useOnLabelChange(cb: (label: ReactNode) => (() => void) | void, { fireImmediately }?: UseOnLabelChangeOptions): void;
|
|
19
|
+
/**
|
|
20
|
+
* Hook that registers whether a control is marked as required. Returns whether
|
|
21
|
+
* there is a label provider to register in.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useRegisterControlInLabelProvider(id: string, tagName?: string, required?: boolean): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type SlotProps } from "../Slot";
|
|
3
3
|
/** Available z-index names. */
|
|
4
4
|
export type LayerZIndex = "docked" | "dropdown" | "sticky" | "banner" | "overlay" | "dialog" | "popover" | "skipLink" | "toast" | "tooltip";
|
|
5
5
|
/** Properties of the layer component. */
|
|
6
|
-
export interface LayerProps extends
|
|
6
|
+
export interface LayerProps extends SlotProps {
|
|
7
7
|
/** Z-index of the layer. */
|
|
8
8
|
zIndex?: LayerZIndex | number | (LayerZIndex | number)[];
|
|
9
9
|
/** Resets the stacking context. */
|
|
@@ -14,8 +14,8 @@ export interface LayerProps extends ComponentPropsWithoutRef<typeof Slot> {
|
|
|
14
14
|
* The layer component manages hierarchical stacking contexts by tracking and
|
|
15
15
|
* adding up z-index values.
|
|
16
16
|
*
|
|
17
|
-
* All ostack/UI overlays (dialogs, dropdown menus,
|
|
18
|
-
*
|
|
17
|
+
* All ostack/UI overlays (dialogs, dropdown menus, etc.) are rendered within a
|
|
18
|
+
* layer, allowing them to be nested.
|
|
19
19
|
*
|
|
20
20
|
* Example usage:
|
|
21
21
|
*
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type ComponentPropsWithRef } from "react";
|
|
2
1
|
import type { AccentColor } from "../../utils/accent.ts";
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
2
|
+
import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
|
|
3
|
+
import { type IconProp, type IconProps } from "../Icon";
|
|
5
4
|
/** Elements a link can be rendered as. */
|
|
6
5
|
export type LinkAs = "a" | "button";
|
|
7
6
|
/** Link variants. */
|
|
@@ -40,7 +39,7 @@ export interface LinkOwnProps {
|
|
|
40
39
|
/** Link icon. By default, only `external` links have an icon. */
|
|
41
40
|
icon?: IconProp | null;
|
|
42
41
|
/** Properties to pass to the icon component. */
|
|
43
|
-
iconProps?: Omit<
|
|
42
|
+
iconProps?: Omit<IconProps, "icon">;
|
|
44
43
|
}
|
|
45
44
|
/**
|
|
46
45
|
* The link component, with its `href` property, is used to create a hyperlink
|
|
@@ -58,4 +57,4 @@ export interface LinkOwnProps {
|
|
|
58
57
|
* }
|
|
59
58
|
* ```
|
|
60
59
|
*/
|
|
61
|
-
export declare
|
|
60
|
+
export declare function Link<TAs extends LinkAs = "a">({ as, asChild, type, color, variant, external, icon, iconProps, className, children, ...otherProps }: LinkProps<TAs>): 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
|
/** Possible mark colours. */
|
|
4
4
|
export type MarkColor = AccentColor;
|
|
5
5
|
/** Properties of the mark component. */
|
|
6
|
-
export interface MarkProps extends
|
|
6
|
+
export interface MarkProps extends ComponentProps<"mark"> {
|
|
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
|
|
@@ -38,4 +38,4 @@ export interface MarkProps extends ComponentPropsWithoutRef<"mark"> {
|
|
|
38
38
|
* }
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
|
-
export declare
|
|
41
|
+
export declare function Mark({ asChild, color, className, ...otherProps }: MarkProps): import("react").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
/** Menu list variants. */
|
|
3
3
|
export type MenuListVariant = "solid" | "subtle";
|
|
4
4
|
/** Placement of icons within menu list items. */
|
|
5
5
|
export type MenuListIconPlacement = "start" | "end";
|
|
6
6
|
/** Properties of the menu list component. */
|
|
7
|
-
export interface MenuListProps extends
|
|
7
|
+
export interface MenuListProps extends ComponentProps<"ul"> {
|
|
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
|
|
@@ -50,4 +50,4 @@ export interface MenuListProps extends ComponentPropsWithoutRef<"ul"> {
|
|
|
50
50
|
* }
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
|
-
export declare
|
|
53
|
+
export declare function MenuList({ asChild, variant, iconPlacement, className, ...otherProps }: MenuListProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentProps, type ElementType, type ReactNode } from "react";
|
|
2
2
|
/** Properties of the menu list group component. */
|
|
3
|
-
export interface MenuListGroupProps extends
|
|
3
|
+
export interface MenuListGroupProps extends ComponentProps<"ul"> {
|
|
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
|
|
@@ -16,9 +16,9 @@ export interface MenuListGroupProps extends ComponentPropsWithoutRef<"ul"> {
|
|
|
16
16
|
*/
|
|
17
17
|
itemAs?: ElementType;
|
|
18
18
|
/** Properties to pass to the item element containing the group. */
|
|
19
|
-
itemProps?:
|
|
19
|
+
itemProps?: ComponentProps<"li">;
|
|
20
20
|
/** Properties to pass to the label element. */
|
|
21
|
-
labelProps?:
|
|
21
|
+
labelProps?: ComponentProps<"div">;
|
|
22
22
|
}
|
|
23
23
|
/** Menu list group component. */
|
|
24
|
-
export declare
|
|
24
|
+
export declare function MenuListGroup({ asChild, label, itemAs, className, itemProps, labelProps, children, ...otherProps }: MenuListGroupProps): import("react").JSX.Element;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { type ComponentProps, type
|
|
1
|
+
import { type ComponentProps, type MouseEvent, 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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { type IconProp, type IconProps } from "../Icon";
|
|
5
|
+
import { type KeybindsProps } from "../Keybinds";
|
|
6
|
+
import { type SpinnerProps } from "../Spinner";
|
|
7
7
|
import type { MenuListIconPlacement } from "./MenuList.tsx";
|
|
8
8
|
/** Elements a menu list item's action can be rendered as. */
|
|
9
9
|
export type MenuListItemType = "button" | "link" | "text";
|
|
10
10
|
/** Menu list item colours. */
|
|
11
11
|
export type MenuListItemColor = AccentColor;
|
|
12
12
|
/** Properties of the menu list item component. */
|
|
13
|
-
export interface MenuListItemProps extends Omit<
|
|
13
|
+
export interface MenuListItemProps extends Omit<ComponentProps<"li">, "onSelect"> {
|
|
14
14
|
/**
|
|
15
15
|
* Change the component to the HTML tag or custom component of the only child.
|
|
16
16
|
* This will merge the original component props with the props of the supplied
|
|
@@ -44,8 +44,7 @@ export interface MenuListItemProps extends Omit<ComponentPropsWithoutRef<"li">,
|
|
|
44
44
|
*
|
|
45
45
|
* When `true`, the item is “soft-disabled”: it looks disabled and ignores
|
|
46
46
|
* user interaction but remains focusable. By default, a spinner is shown as
|
|
47
|
-
* the item's icon (
|
|
48
|
-
* overridden).
|
|
47
|
+
* the item's icon (i.e. `showSpinner` is set to `true` unless overridden).
|
|
49
48
|
*
|
|
50
49
|
* The item's content while loading can be controlled via `loadingContent`.
|
|
51
50
|
* The position of the spinner may be controlled via `iconPlacement`.
|
|
@@ -95,7 +94,7 @@ export interface MenuListItemProps extends Omit<ComponentPropsWithoutRef<"li">,
|
|
|
95
94
|
* `aria-keyshortcuts`.
|
|
96
95
|
*
|
|
97
96
|
* > **Note:** This property does **not** automatically register a keyboard
|
|
98
|
-
* > shortcut to run the item's action. This should be done manually via
|
|
97
|
+
* > shortcut to run the item's action. This should be done manually via e.g.
|
|
99
98
|
* > the `useKeyboardShortcut` hook.
|
|
100
99
|
*/
|
|
101
100
|
keybinds?: KeyboardShortcutKeybinds;
|
|
@@ -106,15 +105,15 @@ export interface MenuListItemProps extends Omit<ComponentPropsWithoutRef<"li">,
|
|
|
106
105
|
/** Rel of the link, when `type` is set to `"link"`. */
|
|
107
106
|
rel?: ComponentProps<"a">["rel"];
|
|
108
107
|
/** Properties to pass to the action element of the item. */
|
|
109
|
-
actionProps?: Omit<
|
|
108
|
+
actionProps?: Omit<ComponentProps<"button" | "a" | "div">, "disabled" | "href" | "target" | "rel">;
|
|
110
109
|
/** Properties to pass to the content element of the item. */
|
|
111
|
-
contentProps?:
|
|
110
|
+
contentProps?: ComponentProps<"div">;
|
|
112
111
|
/** Properties to pass to the icon component. */
|
|
113
|
-
iconProps?: Omit<
|
|
112
|
+
iconProps?: Omit<IconProps, "icon">;
|
|
114
113
|
/** Properties to pass to the spinner component. */
|
|
115
|
-
spinnerProps?:
|
|
114
|
+
spinnerProps?: SpinnerProps;
|
|
116
115
|
/** Properties to pass to the keybinds component. */
|
|
117
|
-
keybindsProps?:
|
|
116
|
+
keybindsProps?: Omit<KeybindsProps, "keybinds">;
|
|
118
117
|
}
|
|
119
118
|
/** Menu list item component. */
|
|
120
|
-
export declare
|
|
119
|
+
export declare function MenuListItem({ asChild, type, selected, onSelect, color, disabled, loading, loadingContent, showSpinner, icon, iconPlacement, keybinds, href, target, rel, actionProps, contentProps, iconProps, spinnerProps, keybindsProps, className, children, "aria-disabled": ariaDisabled, ...otherProps }: MenuListItemProps): import("react").JSX.Element;
|
|
@@ -24,7 +24,8 @@ export interface NumericInputProps extends NumericTransformerOptions, Omit<Contr
|
|
|
24
24
|
valueIsUnformattedString?: boolean;
|
|
25
25
|
/**
|
|
26
26
|
* Specifies the precision of a number, set to `null` to have no limit on
|
|
27
|
-
* precision.
|
|
27
|
+
* precision. When provided, a `scale` must also be set and will default to
|
|
28
|
+
* `0` otherwise.
|
|
28
29
|
*
|
|
29
30
|
* @default null
|
|
30
31
|
*/
|
|
@@ -75,9 +76,8 @@ export interface NumericValueRepresentations {
|
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
77
78
|
* The numeric input component is used to collect numeric user input. It is
|
|
78
|
-
* built on top of the [`Input`
|
|
79
|
-
*
|
|
80
|
-
* [`react-number-format`
|
|
79
|
+
* built on top of the [`Input` component](/docs/ostack-ui-forms-input--docs)
|
|
80
|
+
* and the [`react-number-format`
|
|
81
81
|
* library](https://s-yadav.github.io/react-number-format/).
|
|
82
82
|
*
|
|
83
83
|
* It supports specifying the precision, scale, separators, grouping of digits,
|
|
@@ -97,4 +97,4 @@ export interface NumericValueRepresentations {
|
|
|
97
97
|
* }
|
|
98
98
|
* ```
|
|
99
99
|
*/
|
|
100
|
-
export declare
|
|
100
|
+
export declare function NumericInput({ name, defaultValue, value: controlledValue, valueIsUnformattedString, valueIsInteger, onValueChange, onBlurToOutside, precision, scale, fixedScale, decimalSeparator, groupDigits, groupingStyle, groupSeparator, prefix, suffix, min, max, exclusiveMin, exclusiveMax, validate, validationMode, required, disabled, readOnly, status, autoComplete, form, ref, ...otherProps }: NumericInputProps): import("react").JSX.Element;
|
|
@@ -19,6 +19,6 @@ export declare function valueToStringValue(value: string | number | bigint | nul
|
|
|
19
19
|
* Converts the `react-number-format` values representation into our own
|
|
20
20
|
* representation, while handling the case of integer values with a scale.
|
|
21
21
|
*/
|
|
22
|
-
export declare function transformNumberFormatValues({ formattedValue, value, floatValue }: NumberFormatValues, valueIsInteger: boolean, scale: number | undefined): NumericValueRepresentations;
|
|
22
|
+
export declare function transformNumberFormatValues({ formattedValue, value, floatValue }: NumberFormatValues, valueIsInteger: boolean, scale: number | null | undefined): NumericValueRepresentations;
|
|
23
23
|
/** Transforms the numeric scale into a `step` value. */
|
|
24
|
-
export declare function scaleToStep(valueIsInteger: boolean, scale: number | undefined): string | undefined;
|
|
24
|
+
export declare function scaleToStep(valueIsInteger: boolean, scale: number | null | undefined): string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
import { type ControlOutputProps } from "../Control";
|
|
3
3
|
/** Properties of the output component. */
|
|
4
4
|
export interface OutputProps extends Omit<ControlOutputProps, "asChild" | "disabled" | "loading" | "loadingDescription" | "showClearButton" | "clearButtonLabel" | "onValueChange" | "onBlurToOutside" | "clearButtonProps"> {
|
|
@@ -40,4 +40,4 @@ export interface OutputProps extends Omit<ControlOutputProps, "asChild" | "disab
|
|
|
40
40
|
* }
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
export declare
|
|
43
|
+
export declare function Output({ pending, pendingContent, showSpinner, className, children, ...otherProps }: OutputProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
/** Properties of the label component. */
|
|
3
|
-
export interface OverlayProps extends
|
|
3
|
+
export interface OverlayProps extends ComponentProps<"div"> {
|
|
4
4
|
}
|
|
5
5
|
/** Internal component used by dialogs to overlay content. */
|
|
6
|
-
export declare
|
|
6
|
+
export declare function Overlay({ className, ...otherProps }: OverlayProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
/** Properties of the popover component. */
|
|
4
|
+
export interface PopoverProps extends ComponentProps<typeof PopoverPrimitive.Root> {
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* The popover component displays content in a floating pop-up, triggered by a
|
|
4
8
|
* button. Built on top of the [Radix Popover
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
/** Properties of the popover anchor component. */
|
|
4
|
+
export interface PopoverAnchorProps extends ComponentProps<typeof PopoverPrimitive.Anchor> {
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* An optional element to position the `PopoverContent` against. If this part is
|
|
4
8
|
* not used, the content will position alongside the `PopoverTrigger`.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { type CloseButtonProps } from "../CloseButton";
|
|
3
3
|
/** Properties of the popover close component. */
|
|
4
4
|
export type PopoverCloseProps = PopoverCloseChildlessProps | PopoverCloseChildrenProps;
|
|
5
5
|
/** Properties of the popover close component when rendered without children. */
|
|
6
|
-
export interface PopoverCloseChildlessProps extends Omit<
|
|
6
|
+
export interface PopoverCloseChildlessProps extends Omit<CloseButtonProps, "asChild"> {
|
|
7
7
|
children?: never;
|
|
8
8
|
}
|
|
9
9
|
/** Properties of the popover close component when rendered with children. */
|
|
10
|
-
export interface PopoverCloseChildrenProps extends
|
|
10
|
+
export interface PopoverCloseChildrenProps extends ComponentProps<"button"> {
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
}
|
|
13
13
|
/** The button that closes an open popover. */
|
|
14
|
-
export declare
|
|
14
|
+
export declare function PopoverClose({ children, ...otherProps }: PopoverCloseProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
/** Properties of the popover content component. */
|
|
4
|
-
export interface PopoverContentProps extends
|
|
4
|
+
export interface PopoverContentProps extends ComponentProps<typeof PopoverPrimitive.Content> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether to show an arrow pointing to the anchor.
|
|
7
7
|
*
|
|
@@ -9,9 +9,9 @@ export interface PopoverContentProps extends ComponentPropsWithoutRef<typeof Pop
|
|
|
9
9
|
*/
|
|
10
10
|
showArrow?: boolean;
|
|
11
11
|
/** Properties to pass to the portal component. */
|
|
12
|
-
portalProps?: Omit<
|
|
12
|
+
portalProps?: Omit<ComponentProps<typeof PopoverPrimitive.Portal>, "forceMount">;
|
|
13
13
|
/** Properties to pass to the arrow component. */
|
|
14
|
-
arrowProps?:
|
|
14
|
+
arrowProps?: ComponentProps<typeof PopoverPrimitive.Arrow>;
|
|
15
15
|
}
|
|
16
16
|
/** The component that pops out when the popover is open. */
|
|
17
|
-
export declare
|
|
17
|
+
export declare function PopoverContent({ showArrow, sideOffset, collisionPadding, forceMount, className, portalProps, arrowProps, children, ...otherProps }: PopoverContentProps): import("react").JSX.Element;
|