@ostack.tech/ui 1.1.0 → 1.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/en-DGLb7rrz.js.map +1 -1
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui.css +8 -16
- package/dist/ostack-ui.js +26831 -7981
- package/dist/ostack-ui.js.map +1 -1
- package/package.json +15 -13
- package/scss/components/Button/_Button.scss +4 -18
- package/scss/components/ButtonGroup/_ButtonGroup.scss +2 -6
- package/scss/components/Calendar/_Calendar-variables.scss +4 -12
- package/scss/components/Calendar/_Calendar.scss +19 -38
- package/scss/components/Card/_Card-variables.scss +4 -12
- package/scss/components/Card/_Card.scss +8 -28
- package/scss/components/Collapsible/_Collapsible.scss +2 -8
- package/scss/components/CommandMenu/_CommandMenu-variables.scss +2 -6
- package/scss/components/CommandMenu/_CommandMenu.scss +5 -13
- package/scss/components/ControlAddon/_ControlAddon-variables.scss +4 -12
- package/scss/components/ControlAddon/_ControlAddon.scss +16 -52
- package/scss/components/DataTable/_DataTable.scss +1 -2
- package/scss/components/DateRangeInput/_DateRangeInput-variables.scss +1 -3
- package/scss/components/DateRangeInput/_DateRangeInput.scss +7 -21
- package/scss/components/Dialog/_Dialog.scss +6 -19
- package/scss/components/DropdownMenu/_DropdownMenu.scss +1 -2
- package/scss/components/Feedback/_Feedback-variables.scss +1 -6
- package/scss/components/Feedback/_Feedback.scss +8 -33
- package/scss/components/FieldGroup/_FieldGroup.scss +1 -4
- package/scss/components/Grid/_Grid.scss +4 -12
- package/scss/components/HelperText/_HelperText.scss +1 -4
- package/scss/components/Input/_Input.scss +11 -32
- package/scss/components/Label/_Label.scss +2 -6
- package/scss/components/Link/_Link.scss +1 -2
- package/scss/components/MenuList/_MenuList.scss +2 -6
- package/scss/components/Overlay/_Overlay-variables.scss +1 -3
- package/scss/components/Overlay/_Overlay.scss +2 -4
- package/scss/components/Root/_Root.scss +4 -16
- package/scss/components/Select/_Select-variables.scss +4 -12
- package/scss/components/Select/_Select.scss +1 -2
- package/scss/components/Separator/_Separator.scss +2 -8
- package/scss/components/Spinner/_Spinner.scss +2 -8
- package/scss/components/Stepper/_Stepper-variables.scss +5 -15
- package/scss/components/Stepper/_Stepper.scss +2 -5
- package/scss/components/Table/_Table-variables.scss +16 -47
- package/scss/components/Table/_Table.scss +30 -112
- package/scss/components/Tabs/_Tabs-variables.scss +15 -43
- package/scss/components/Tabs/_Tabs.scss +13 -46
- package/scss/components/Tag/_Tag-variables.scss +1 -4
- package/scss/components/Tag/_Tag.scss +5 -14
- package/scss/components/Toast/_Toast.scss +3 -8
- package/scss/components/Tooltip/_Tooltip-variables.scss +1 -3
- package/scss/components/Tooltip/_Tooltip.scss +4 -12
- package/scss/scss/_base-variables.scss +6 -7
- package/scss/scss/placeholders/button/_button.scss +2 -8
- package/scss/scss/placeholders/checkable/_checkable.scss +15 -60
- package/scss/scss/placeholders/control/_control-variables.scss +3 -10
- package/scss/scss/placeholders/control/_control.scss +10 -38
- package/scss/scss/placeholders/menu/_menu-variables.scss +14 -42
- package/scss/scss/placeholders/menu/_menu.scss +22 -82
- package/scss/scss/placeholders/notification/_notification.scss +2 -4
- package/scss/scss/placeholders/popover/_popover-variables.scss +1 -3
- package/scss/scss/placeholders/popover/_popover.scss +4 -11
- package/scss/scss/utils/_breakpoints.scss +1 -4
- package/scss/scss/utils/_responsive-values.scss +2 -5
- package/scss/scss/utils/_spinner.scss +1 -2
- package/types/components/Actions/Action.d.ts +6 -6
- package/types/components/Actions/ActionGroup.d.ts +10 -14
- package/types/components/Actions/ActionMenu.d.ts +13 -17
- package/types/components/Actions/ActionSplit.d.ts +4 -4
- package/types/components/Actions/Actions.d.ts +20 -25
- package/types/components/Actions/ActionsSecondary.d.ts +1 -1
- package/types/components/Alert/Alert.d.ts +8 -9
- package/types/components/Alert/AlertTitle.d.ts +3 -3
- package/types/components/AlertDialog/AlertDialog.d.ts +16 -20
- package/types/components/AlertDialog/AlertDialogAction.d.ts +2 -2
- package/types/components/AlertDialog/AlertDialogCancel.d.ts +2 -2
- package/types/components/AlertDialog/AlertDialogContent.d.ts +2 -3
- package/types/components/AlertDialog/AlertDialogDescription.d.ts +4 -5
- package/types/components/Button/Button.d.ts +32 -39
- package/types/components/ButtonGroup/ButtonGroup.d.ts +3 -3
- package/types/components/Calendar/Calendar.d.ts +2 -3
- package/types/components/Calendar/CalendarDay.d.ts +3 -4
- package/types/components/Calendar/CalendarHeader.d.ts +2 -2
- package/types/components/Card/Card.d.ts +6 -13
- 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 +17 -29
- package/types/components/CheckboxGroup/CheckboxGroup.d.ts +24 -38
- package/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +5 -6
- package/types/components/CloseButton/CloseButton.d.ts +1 -1
- package/types/components/Code/Code.d.ts +4 -5
- package/types/components/Collapsible/Collapsible.d.ts +3 -9
- package/types/components/Collapsible/CollapsibleTrigger.d.ts +1 -4
- package/types/components/CommandMenu/CommandMenu.d.ts +6 -7
- package/types/components/CommandMenu/CommandMenuDialog.d.ts +6 -10
- package/types/components/CommandMenu/CommandMenuItem.d.ts +3 -3
- package/types/components/CommandMenu/cmdk/index.d.ts +73 -112
- package/types/components/Container/Container.d.ts +17 -21
- package/types/components/Control/Control.d.ts +21 -27
- package/types/components/Control/ControlWithContainerRef.d.ts +5 -6
- package/types/components/ControlAddon/ControlAddon.d.ts +9 -13
- package/types/components/ControlCode/ControlCode.d.ts +5 -8
- package/types/components/DataTable/DataTable.d.ts +59 -90
- package/types/components/DataTable/DataTableApi.d.ts +11 -12
- package/types/components/DataTable/DataTableColumn.d.ts +18 -21
- package/types/components/DataTable/DataTableColumnGroup.d.ts +3 -4
- package/types/components/DataTable/DataTableColumns.d.ts +4 -4
- package/types/components/DataTable/DataTableContent.d.ts +2 -5
- package/types/components/DataTable/DataTableEmptyOrLoadingRows.d.ts +1 -4
- package/types/components/DataTable/DataTableFilter.d.ts +3 -3
- package/types/components/DataTable/DataTablePagination.d.ts +5 -9
- package/types/components/DataTable/DataTableRowsPerPage.d.ts +4 -5
- package/types/components/DataTable/DataTableSelectionTrigger.d.ts +5 -11
- package/types/components/DataTable/PagedDataTablePagination.d.ts +1 -1
- package/types/components/DataTable/PagedDataTableRows.d.ts +1 -1
- package/types/components/DataTable/ScrolledDataTableRows.d.ts +1 -1
- package/types/components/DataTable/index.d.ts +1 -1
- package/types/components/DataTable/{getRowKey.d.ts → keyUtils.d.ts} +2 -0
- package/types/components/DataTable/spliceWindow.d.ts +3 -4
- package/types/components/DateInput/DateInput.d.ts +21 -34
- package/types/components/DateRangeInput/DateRangeInput.d.ts +41 -70
- package/types/components/DescriptionList/DescriptionList.d.ts +5 -10
- package/types/components/Dialog/Dialog.d.ts +9 -11
- package/types/components/Dialog/DialogContent.d.ts +3 -4
- package/types/components/Dialog/DialogDescription.d.ts +2 -3
- package/types/components/DropdownMenu/DropdownMenu.d.ts +10 -21
- package/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
- package/types/components/DropdownMenu/DropdownMenuItem.d.ts +3 -3
- package/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
- package/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +1 -4
- package/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +1 -4
- package/types/components/ErrorBoundary/ErrorBoundary.d.ts +21 -27
- package/types/components/Feedback/Feedback.d.ts +6 -6
- package/types/components/Feedback/FeedbackPopover.d.ts +3 -3
- package/types/components/Feedback/FeedbackProvider.d.ts +3 -4
- package/types/components/Feedback/feedbackUtils.d.ts +5 -8
- package/types/components/Field/Field.d.ts +9 -11
- package/types/components/Field/fieldUtils.d.ts +2 -2
- package/types/components/FieldGroup/FieldGroup.d.ts +4 -5
- 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 +3 -3
- package/types/components/Form/Form.d.ts +25 -40
- package/types/components/Form/FormContext.d.ts +2 -2
- package/types/components/Form/FormError.d.ts +6 -11
- package/types/components/Form/FormState.d.ts +2 -2
- package/types/components/Form/formUtils.d.ts +1 -1
- package/types/components/Form/useRegisterFormControl.d.ts +1 -1
- package/types/components/Grid/Grid.d.ts +19 -24
- package/types/components/Heading/Heading.d.ts +9 -10
- package/types/components/HelperText/HelperText.d.ts +3 -3
- package/types/components/HelperText/HelperTextProvider.d.ts +3 -4
- package/types/components/Icon/Icon.d.ts +9 -16
- package/types/components/IconButton/IconButton.d.ts +35 -53
- package/types/components/Input/Input.d.ts +5 -12
- package/types/components/Keybinds/KeyPress.d.ts +1 -1
- package/types/components/Keybinds/Keybind.d.ts +1 -1
- package/types/components/Keybinds/Keybinds.d.ts +3 -9
- package/types/components/Keyboard/Keyboard.d.ts +7 -8
- package/types/components/Label/Label.d.ts +5 -6
- package/types/components/Label/LabelProvider.d.ts +3 -4
- package/types/components/Label/labelUtils.d.ts +2 -2
- package/types/components/Layer/Layer.d.ts +4 -4
- package/types/components/Link/Link.d.ts +13 -13
- package/types/components/Mark/Mark.d.ts +6 -7
- package/types/components/MenuList/MenuList.d.ts +6 -7
- package/types/components/MenuList/MenuListGroup.d.ts +5 -6
- package/types/components/MenuList/MenuListItem.d.ts +21 -25
- package/types/components/NumericInput/NumericInput.d.ts +20 -34
- package/types/components/NumericInput/numericInputUtils.d.ts +4 -5
- package/types/components/Output/Output.d.ts +12 -13
- package/types/components/Popover/Popover.d.ts +6 -13
- package/types/components/Popover/PopoverAnchor.d.ts +2 -2
- package/types/components/Popover/PopoverTrigger.d.ts +2 -2
- package/types/components/Portal/Portal.d.ts +3 -4
- package/types/components/Printer/Printer.d.ts +40 -54
- package/types/components/Printer/PrinterContent.d.ts +6 -6
- package/types/components/Printer/PrinterContentContext.d.ts +4 -5
- package/types/components/Printer/PrinterContext.d.ts +4 -4
- package/types/components/Printer/PrinterTrigger.d.ts +5 -6
- package/types/components/Printer/index.d.ts +1 -1
- package/types/components/RadioGroup/Radio.d.ts +10 -13
- package/types/components/RadioGroup/RadioGroup.d.ts +21 -34
- package/types/components/Root/Root.d.ts +21 -27
- package/types/components/Root/RootContext.d.ts +1 -4
- package/types/components/Select/Option.d.ts +3 -3
- package/types/components/Select/Select.d.ts +14 -26
- package/types/components/Select/SelectNative.d.ts +1 -1
- package/types/components/Separator/Separator.d.ts +3 -4
- package/types/components/Slot/Slottable.d.ts +1 -4
- package/types/components/Spinner/Spinner.d.ts +5 -12
- package/types/components/Stack/Stack.d.ts +9 -13
- package/types/components/Stepper/Step.d.ts +6 -6
- package/types/components/Stepper/StepContent.d.ts +3 -3
- package/types/components/Stepper/StepList.d.ts +4 -5
- package/types/components/Stepper/Stepper.d.ts +4 -5
- package/types/components/Stepper/StepperFinishTrigger.d.ts +3 -9
- package/types/components/Stepper/StepperNextTrigger.d.ts +3 -6
- package/types/components/Stepper/StepperPreviousTrigger.d.ts +4 -10
- package/types/components/Table/Table.d.ts +42 -58
- package/types/components/Table/TableCell.d.ts +15 -19
- package/types/components/Table/TableColumn.d.ts +15 -27
- package/types/components/Table/TableColumnGroup.d.ts +2 -3
- package/types/components/Table/TableHead.d.ts +5 -5
- package/types/components/Tabs/TabContent.d.ts +2 -2
- package/types/components/Tabs/TabList.d.ts +1 -1
- package/types/components/Tabs/Tabs.d.ts +4 -8
- package/types/components/Tag/Tag.d.ts +8 -8
- package/types/components/TextArea/TextArea.d.ts +7 -13
- package/types/components/Toast/Toast.d.ts +25 -38
- package/types/components/Toast/ToastProvider.d.ts +2 -5
- package/types/components/Toast/ToastViewport.d.ts +2 -5
- package/types/components/Tooltip/Tooltip.d.ts +11 -11
- package/types/components/VisuallyHidden/VisuallyHidden.d.ts +7 -11
- package/types/index.d.ts +2 -1
- package/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +17 -19
- package/types/providers/AlertDialogProvider/useAlertDialog.d.ts +50 -58
- package/types/providers/DocumentTitleProvider/DocumentTitle.d.ts +1 -4
- package/types/providers/ErrorReportingProvider/ErrorReport.d.ts +4 -7
- package/types/providers/ErrorReportingProvider/ErrorReportingProvider.d.ts +12 -17
- package/types/providers/LocalizationProvider/useLocale.d.ts +1 -4
- package/types/providers/PrefixProvider/defaultPrefix.d.ts +2 -3
- package/types/providers/PrefixProvider/usePrefix.d.ts +3 -6
- package/types/providers/ToastManagerProvider/ToastManagerContext.d.ts +3 -3
- package/types/providers/ToastManagerProvider/useToastManager.d.ts +11 -14
- package/types/utils/__tests__/useCombinedRef.test.d.ts +1 -0
- package/types/utils/breakpoints.d.ts +5 -6
- package/types/utils/combineAriaIds.d.ts +1 -1
- package/types/utils/cx.d.ts +2 -5
- package/types/utils/filtering.d.ts +2 -2
- package/types/utils/keyboardShortcut.d.ts +18 -25
- package/types/utils/navigate.d.ts +2 -2
- package/types/utils/numericStringUtils.d.ts +6 -13
- package/types/utils/parseChildren.d.ts +5 -9
- package/types/utils/reactCompilerUtils.d.ts +7 -0
- package/types/utils/setNativeProperty.d.ts +2 -3
- package/types/utils/sorting.d.ts +2 -2
- package/types/utils/useCombinedEventHandler.d.ts +30 -0
- package/types/utils/useCombinedRef.d.ts +6 -4
- package/types/utils/useCssVars.d.ts +9 -20
- package/types/utils/useDateTransformer.d.ts +4 -8
- package/types/utils/useIntersectionObserver.d.ts +2 -5
- package/types/utils/useLatestRef.d.ts +1 -2
- package/types/utils/useLocation.d.ts +5 -8
- package/types/utils/useMeasure.d.ts +2 -5
- package/types/utils/useMediaQuery.d.ts +1 -4
- package/types/utils/useNumericTransformer.d.ts +12 -19
- package/types/utils/usePrevious.d.ts +3 -4
- package/types/utils/useResponsiveValues.d.ts +7 -10
- package/types/utils/useScrollPosition.d.ts +1 -6
- package/types/utils/useSearchParam.d.ts +2 -6
- package/types/utils/useSearchParams.d.ts +1 -4
- package/types/utils/useSpacing.d.ts +1 -4
- package/types/utils/zustandUtils.d.ts +3 -2
- package/types/utils/combineEventHandlers.d.ts +0 -24
- /package/types/utils/__tests__/{combineEventHandlers.test.d.ts → useCombinedEventHandler.test.d.ts} +0 -0
|
@@ -4,14 +4,11 @@ import { type GridContainerProps } from "../Grid";
|
|
|
4
4
|
export interface DescriptionListProps extends Pick<GridContainerProps, "asChild" | "columns" | "gap" | "rowGap" | "columnGap">, ComponentProps<"dl"> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* A list of descriptions pairing terms with their associated details. Built on
|
|
8
|
-
* top of the browser's
|
|
7
|
+
* A list of descriptions pairing terms with their associated details. Built on top of the browser's
|
|
9
8
|
* [`<dl>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dl),
|
|
10
|
-
* [`<dt>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dt),
|
|
11
|
-
*
|
|
12
|
-
* [
|
|
13
|
-
* elements, as well as the [`Grid`
|
|
14
|
-
* component](/docs/ostack-ui-layout-grid--docs) for layout.
|
|
9
|
+
* [`<dt>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dt), and
|
|
10
|
+
* [`<dd>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dd) elements, as
|
|
11
|
+
* well as the [`Grid` component](/docs/ostack-ui-layout-grid--docs) for layout.
|
|
15
12
|
*
|
|
16
13
|
* It composes the following subcomponent:
|
|
17
14
|
*
|
|
@@ -27,9 +24,7 @@ export interface DescriptionListProps extends Pick<GridContainerProps, "asChild"
|
|
|
27
24
|
* <DescriptionList>
|
|
28
25
|
* <DescriptionListItem term="Username">aacevedo</DescriptionListItem>
|
|
29
26
|
* <DescriptionListItem term="Name">Ava Acevedo</DescriptionListItem>
|
|
30
|
-
* <DescriptionListItem term="Date of birth">
|
|
31
|
-
* 1995-06-21
|
|
32
|
-
* </DescriptionListItem>
|
|
27
|
+
* <DescriptionListItem term="Date of birth">1995-06-21</DescriptionListItem>
|
|
33
28
|
* </DescriptionList>
|
|
34
29
|
* );
|
|
35
30
|
* }
|
|
@@ -4,12 +4,12 @@ import type { ComponentProps } from "react";
|
|
|
4
4
|
export interface DialogProps extends ComponentProps<typeof DialogPrimitive.Root> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* The dialog component displays a “window” overlaid on either the main screen
|
|
8
|
-
*
|
|
7
|
+
* The dialog component displays a “window” overlaid on either the main screen or another dialog
|
|
8
|
+
* window, rendering the content underneath inert.
|
|
9
9
|
*
|
|
10
10
|
* Built on top of the [Radix Dialog
|
|
11
|
-
* primitive](https://www.radix-ui.com/primitives/docs/components/dialog), and
|
|
12
|
-
*
|
|
11
|
+
* primitive](https://www.radix-ui.com/primitives/docs/components/dialog), and the [`Card`
|
|
12
|
+
* component](/docs/ostack-ui-data-display-card--docs).
|
|
13
13
|
*
|
|
14
14
|
* It composes the following subcomponents:
|
|
15
15
|
*
|
|
@@ -18,12 +18,11 @@ export interface DialogProps extends ComponentProps<typeof DialogPrimitive.Root>
|
|
|
18
18
|
* - `DialogHeader`: Header section of the dialog.
|
|
19
19
|
* - `DialogTitle`: An accessible title to be announced when the dialog is opened.
|
|
20
20
|
* - `DialogBody`: Body section of the dialog.
|
|
21
|
-
* - `DialogDescription`: An optional accessible description to be announced when
|
|
22
|
-
*
|
|
21
|
+
* - `DialogDescription`: An optional accessible description to be announced when the dialog is
|
|
22
|
+
* opened.
|
|
23
23
|
*
|
|
24
|
-
* To hide the description, wrap it within `<VisuallyHidden asChild>`. To remove
|
|
25
|
-
*
|
|
26
|
-
* `DialogContent` and omit this component.
|
|
24
|
+
* To hide the description, wrap it within `<VisuallyHidden asChild>`. To remove the description
|
|
25
|
+
* entirely, pass `aria-describedby={undefined}` to the `DialogContent` and omit this component.
|
|
27
26
|
* - `DialogFooter`: Footer section of the dialog.
|
|
28
27
|
* - `DialogClose`: A button which closes the dialog.
|
|
29
28
|
*
|
|
@@ -55,8 +54,7 @@ export interface DialogProps extends ComponentProps<typeof DialogPrimitive.Root>
|
|
|
55
54
|
* <DialogTitle>User Settings</DialogTitle>
|
|
56
55
|
* </DialogHeader>
|
|
57
56
|
* <DialogBody>
|
|
58
|
-
* <DialogDescription>Edit your user settings:</DialogDescription
|
|
59
|
-
* …
|
|
57
|
+
* <DialogDescription>Edit your user settings:</DialogDescription>…
|
|
60
58
|
* </DialogBody>
|
|
61
59
|
* <DialogFooter>
|
|
62
60
|
* <DialogClose>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
import { type CardColor, type CardVariant } from "../Card";
|
|
4
4
|
import { type OverlayProps } from "../Overlay";
|
|
5
5
|
/** Dialog content variants. */
|
|
@@ -17,9 +17,8 @@ export interface DialogContentProps extends ComponentProps<typeof DialogPrimitiv
|
|
|
17
17
|
*/
|
|
18
18
|
variant?: DialogContentVariant;
|
|
19
19
|
/**
|
|
20
|
-
* Whether sections should be merged together, as opposed to them being
|
|
21
|
-
*
|
|
22
|
-
* border or solid background colour.
|
|
20
|
+
* Whether sections should be merged together, as opposed to them being clearly delimited. By
|
|
21
|
+
* default, each section is clearly delimited via a border or solid background colour.
|
|
23
22
|
*
|
|
24
23
|
* @default false
|
|
25
24
|
*/
|
|
@@ -6,8 +6,7 @@ export interface DialogDescriptionProps extends ComponentProps<typeof DialogPrim
|
|
|
6
6
|
/**
|
|
7
7
|
* Optional accessible description to be announced when the dialog is opened.
|
|
8
8
|
*
|
|
9
|
-
* To hide the description, wrap it within `<VisuallyHidden asChild>`. To remove
|
|
10
|
-
*
|
|
11
|
-
* `DialogContent` and omit this component.
|
|
9
|
+
* To hide the description, wrap it within `<VisuallyHidden asChild>`. To remove the description
|
|
10
|
+
* entirely, pass `aria-describedby={undefined}` to the `DialogContent` and omit this component.
|
|
12
11
|
*/
|
|
13
12
|
export declare function DialogDescription({ className, ...otherProps }: DialogDescriptionProps): import("react").JSX.Element;
|
|
@@ -7,27 +7,22 @@ export interface DropdownMenuProps extends Omit<ComponentProps<typeof DropdownMe
|
|
|
7
7
|
* Menu displayed within a dropdown, containing a set of actions.
|
|
8
8
|
*
|
|
9
9
|
* Built on top of the [Radix Dropdown Menu
|
|
10
|
-
* primitive](https://www.radix-ui.com/primitives/docs/components/dropdown-menu)
|
|
11
|
-
* and the [`MenuList`
|
|
10
|
+
* primitive](https://www.radix-ui.com/primitives/docs/components/dropdown-menu) and the [`MenuList`
|
|
12
11
|
* component](/docs/ostack-ui-data-display-menu-list--docs).
|
|
13
12
|
*
|
|
14
13
|
* It composes the following subcomponents:
|
|
15
14
|
*
|
|
16
15
|
* - `DropdownMenuTrigger`: Contains the element that triggers the dropdown menu.
|
|
17
|
-
* - `DropdownMenuContent`: Represents the menu itself. It appears once the
|
|
18
|
-
* trigger is pressed.
|
|
16
|
+
* - `DropdownMenuContent`: Represents the menu itself. It appears once the trigger is pressed.
|
|
19
17
|
* - `DropdownMenuGroup`: Groups items under an optional label.
|
|
20
18
|
* - `DropdownMenuItem`: An item of the dropdown menu.
|
|
21
|
-
* - `DropdownMenuCheckboxItem`: An item that can be controlled and rendered like
|
|
22
|
-
* a checkbox.
|
|
19
|
+
* - `DropdownMenuCheckboxItem`: An item that can be controlled and rendered like a checkbox.
|
|
23
20
|
* - `DropdownMenuRadioGroup`: Used to group multiple radio items.
|
|
24
|
-
* - `DropdownMenuRadioItem`: An item that can be controlled and rendered like a
|
|
25
|
-
* radio.
|
|
21
|
+
* - `DropdownMenuRadioItem`: An item that can be controlled and rendered like a radio.
|
|
26
22
|
* - `DropdownMenuSub`: Container of a submenu.
|
|
27
|
-
* - `DropdownMenuSubTrigger`: An item that opens a submenu. Must be rendered
|
|
28
|
-
*
|
|
29
|
-
* - `DropdownMenuSubContent`: Content of a submenu. Must be rendered inside a
|
|
30
|
-
* submenu container.
|
|
23
|
+
* - `DropdownMenuSubTrigger`: An item that opens a submenu. Must be rendered inside a submenu
|
|
24
|
+
* container.
|
|
25
|
+
* - `DropdownMenuSubContent`: Content of a submenu. Must be rendered inside a submenu container.
|
|
31
26
|
*
|
|
32
27
|
* Example usage:
|
|
33
28
|
*
|
|
@@ -48,15 +43,9 @@ export interface DropdownMenuProps extends Omit<ComponentProps<typeof DropdownMe
|
|
|
48
43
|
* </DropdownMenuTrigger>
|
|
49
44
|
*
|
|
50
45
|
* <DropdownMenuContent>
|
|
51
|
-
* <DropdownMenuItem onSelect={openDocument}>
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* <DropdownMenuItem onSelect={editDocument}>
|
|
55
|
-
* Edit…
|
|
56
|
-
* </DropdownMenuItem>
|
|
57
|
-
* <DropdownMenuItem onSelect={printDocument}>
|
|
58
|
-
* Print…
|
|
59
|
-
* </DropdownMenuItem>
|
|
46
|
+
* <DropdownMenuItem onSelect={openDocument}>Open…</DropdownMenuItem>
|
|
47
|
+
* <DropdownMenuItem onSelect={editDocument}>Edit…</DropdownMenuItem>
|
|
48
|
+
* <DropdownMenuItem onSelect={printDocument}>Print…</DropdownMenuItem>
|
|
60
49
|
* </DropdownMenuContent>
|
|
61
50
|
* </DropdownMenu>
|
|
62
51
|
* );
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
import type { CheckboxChecked } from "../Checkbox";
|
|
4
4
|
import { type IconProps } from "../Icon";
|
|
5
5
|
import { type MenuListItemProps } from "../MenuList";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
import { type MenuListItemProps } from "../MenuList";
|
|
4
4
|
/** Properties of the dropdown menu item. */
|
|
5
5
|
export interface DropdownMenuItemProps extends Omit<ComponentProps<typeof DropdownMenuPrimitive.Item>, "asChild" | "color">, Pick<MenuListItemProps, "selected" | "color" | "loading" | "loadingContent" | "showSpinner" | "icon" | "iconPlacement" | "keybinds" | "href" | "target" | "rel" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps" | "keybindsProps"> {
|
|
6
6
|
/**
|
|
7
|
-
* Render the item as a link. When set, you can pass `href`, `target`, and
|
|
8
|
-
*
|
|
7
|
+
* Render the item as a link. When set, you can pass `href`, `target`, and `rel` properties to the
|
|
8
|
+
* item.
|
|
9
9
|
*
|
|
10
10
|
* @default false
|
|
11
11
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
3
|
import { type MenuListItemProps } from "../MenuList";
|
|
4
4
|
/** Properties of the dropdown menu radio item. */
|
|
5
5
|
export interface DropdownMenuRadioItemProps extends Omit<ComponentProps<typeof DropdownMenuPrimitive.RadioItem>, "asChild" | "color">, Pick<MenuListItemProps, "color" | "loading" | "loadingContent" | "showSpinner" | "iconPlacement" | "keybinds" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps" | "keybindsProps"> {
|
|
@@ -6,8 +6,5 @@ export interface DropdownMenuSubContentProps extends Omit<ComponentProps<typeof
|
|
|
6
6
|
/** Properties to pass to the menu list component. */
|
|
7
7
|
menuListProps?: Omit<MenuListProps, "variant" | "iconPlacement" | "asChild">;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* The component that pops out when a submenu is open. Must be rendered inside
|
|
11
|
-
* `DropdownMenuSub`.
|
|
12
|
-
*/
|
|
9
|
+
/** The component that pops out when a submenu is open. Must be rendered inside `DropdownMenuSub`. */
|
|
13
10
|
export declare function DropdownMenuSubContent({ variant, iconPlacement, sideOffset, alignOffset, className, children, menuListProps, ...otherProps }: DropdownMenuSubContentProps): import("react").JSX.Element;
|
|
@@ -4,8 +4,5 @@ import { type MenuListItemProps } from "../MenuList";
|
|
|
4
4
|
/** Properties of the dropdown menu submenu trigger. */
|
|
5
5
|
export interface DropdownMenuSubTriggerProps extends Omit<ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>, "asChild" | "color">, Pick<MenuListItemProps, "color" | "icon" | "disabled" | "actionProps" | "contentProps" | "iconProps"> {
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* A dropdown menu item that opens a submenu. Must be rendered within a
|
|
9
|
-
* `DropdownMenuSub`.
|
|
10
|
-
*/
|
|
7
|
+
/** A dropdown menu item that opens a submenu. Must be rendered within a `DropdownMenuSub`. */
|
|
11
8
|
export declare function DropdownMenuSubTrigger({ color, icon, disabled, actionProps, contentProps, iconProps, className, ...otherProps }: DropdownMenuSubTriggerProps): import("react").JSX.Element;
|
|
@@ -16,15 +16,14 @@ export interface ErrorBoundaryFallbackProps {
|
|
|
16
16
|
/** Properties of the error boundary component. */
|
|
17
17
|
export interface ErrorBoundaryProps extends Pick<ComponentProps<typeof ReactErrorBoundary>, "resetKeys" | "onError" | "onReset"> {
|
|
18
18
|
/**
|
|
19
|
-
* Fallback component to render in the event of an error while rendering
|
|
20
|
-
* `children`.
|
|
19
|
+
* Fallback component to render in the event of an error while rendering `children`.
|
|
21
20
|
*
|
|
22
|
-
* This component completely replaces the default fallback and, as such, when
|
|
23
|
-
*
|
|
24
|
-
* `
|
|
21
|
+
* This component completely replaces the default fallback and, as such, when provided, other
|
|
22
|
+
* properties related to the default `Alert` fallback such as `showError`, `fallbackTitle`, and
|
|
23
|
+
* `fallbackMessage` are ignored.
|
|
25
24
|
*
|
|
26
|
-
* By default, a “danger” `Alert` is displayed with a message (specified via
|
|
27
|
-
*
|
|
25
|
+
* By default, a “danger” `Alert` is displayed with a message (specified via `fallbackMessage`) or
|
|
26
|
+
* the error that occurred when `showError` is set.
|
|
28
27
|
*/
|
|
29
28
|
fallback?: ReactNode | ComponentType<ErrorBoundaryFallbackProps> | ((props: ErrorBoundaryFallbackProps) => ReactNode);
|
|
30
29
|
/**
|
|
@@ -34,24 +33,23 @@ export interface ErrorBoundaryProps extends Pick<ComponentProps<typeof ReactErro
|
|
|
34
33
|
*/
|
|
35
34
|
showError?: boolean;
|
|
36
35
|
/**
|
|
37
|
-
* Whether to show a button to reset the error boundary in the default
|
|
38
|
-
* fallback `Alert`.
|
|
36
|
+
* Whether to show a button to reset the error boundary in the default fallback `Alert`.
|
|
39
37
|
*
|
|
40
38
|
* @default true
|
|
41
39
|
*/
|
|
42
40
|
showResetButton?: boolean;
|
|
43
41
|
/**
|
|
44
|
-
* Title to display in the default fallback `Alert` component in the event of
|
|
45
|
-
*
|
|
46
|
-
* `
|
|
42
|
+
* Title to display in the default fallback `Alert` component in the event of an error occurring
|
|
43
|
+
* while rendering `children`. This property is ignored if `fallback` is provided or if
|
|
44
|
+
* `showError` is set.
|
|
47
45
|
*
|
|
48
46
|
* By default, the locale's message is used.
|
|
49
47
|
*/
|
|
50
48
|
fallbackTitle?: ReactNode | ((error?: unknown) => ReactNode);
|
|
51
49
|
/**
|
|
52
|
-
* Message to display in the default fallback `Alert` component in the event
|
|
53
|
-
*
|
|
54
|
-
*
|
|
50
|
+
* Message to display in the default fallback `Alert` component in the event of an error occurring
|
|
51
|
+
* while rendering `children`. This property is ignored if `fallback` is provided or if
|
|
52
|
+
* `showError` is set.
|
|
55
53
|
*
|
|
56
54
|
* By default, the locale's message is used.
|
|
57
55
|
*/
|
|
@@ -64,21 +62,17 @@ export interface ErrorBoundaryProps extends Pick<ComponentProps<typeof ReactErro
|
|
|
64
62
|
resetButtonLabel?: ReactNode;
|
|
65
63
|
/** Properties to pass to the default fallback `Alert` component. */
|
|
66
64
|
fallbackProps?: AlertProps;
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
* boundary.
|
|
70
|
-
*/
|
|
71
|
-
resetButtonProps?: IconButtonProps;
|
|
65
|
+
/** Properties to pass to the `IconButton` component used to reset the error boundary. */
|
|
66
|
+
resetButtonProps?: Omit<IconButtonProps, "as">;
|
|
72
67
|
children?: ReactNode;
|
|
73
68
|
}
|
|
74
69
|
/**
|
|
75
|
-
* Generic error boundary which, by default, when an error occurs while
|
|
76
|
-
*
|
|
77
|
-
*
|
|
70
|
+
* Generic error boundary which, by default, when an error occurs while rendering `children`,
|
|
71
|
+
* displays an `Alert` with a generic message, together with the error itself when in development
|
|
72
|
+
* mode.
|
|
78
73
|
*
|
|
79
|
-
* You can provide an alternative fallback component via the `fallback` property
|
|
80
|
-
*
|
|
81
|
-
* property.
|
|
74
|
+
* You can provide an alternative fallback component via the `fallback` property or simply an
|
|
75
|
+
* alternative fallback message via the `fallbackMessage` property.
|
|
82
76
|
*
|
|
83
77
|
* Example usage:
|
|
84
78
|
*
|
|
@@ -94,4 +88,4 @@ export interface ErrorBoundaryProps extends Pick<ComponentProps<typeof ReactErro
|
|
|
94
88
|
* }
|
|
95
89
|
* ```
|
|
96
90
|
*/
|
|
97
|
-
export declare function ErrorBoundary({ fallback, showError, showResetButton, fallbackTitle, fallbackMessage, onError, resetButtonLabel, fallbackProps, resetButtonProps, ...otherProps }: ErrorBoundaryProps): import("react").JSX.Element;
|
|
91
|
+
export declare function ErrorBoundary({ fallback: fallbackProp, showError, showResetButton, fallbackTitle: fallbackTitleProp, fallbackMessage: fallbackMessageProp, onError, resetButtonLabel: resetButtonLabelProp, fallbackProps, resetButtonProps, ...otherProps }: ErrorBoundaryProps): import("react").JSX.Element;
|
|
@@ -4,18 +4,18 @@ export type FeedbackType = "success" | "error" | "warning";
|
|
|
4
4
|
/** Properties of the feedback component. */
|
|
5
5
|
export type FeedbackProps = ComponentProps<"div" | "li"> & {
|
|
6
6
|
/**
|
|
7
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
8
|
+
* original component props with the props of the supplied element/component and change the
|
|
9
|
+
* underlying DOM node.
|
|
10
10
|
*/
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
/**
|
|
13
|
-
* Type of feedback. The default type defaults to the matching status of the
|
|
14
|
-
*
|
|
13
|
+
* Type of feedback. The default type defaults to the matching status of the associated field
|
|
14
|
+
* control, or to `"error"` otherwise.
|
|
15
15
|
*/
|
|
16
16
|
type?: FeedbackType;
|
|
17
17
|
/** Text prefixed to the feedback to be announced by assistive technologies. */
|
|
18
18
|
visuallyHiddenPrefix?: ReactNode | ((type: FeedbackType) => ReactNode);
|
|
19
19
|
};
|
|
20
20
|
/** Component used to provide some feedback to a form control. */
|
|
21
|
-
export declare function Feedback({ asChild, type, visuallyHiddenPrefix, id, className, children, ...otherProps }: FeedbackProps): import("react").JSX.Element;
|
|
21
|
+
export declare function Feedback({ asChild, type: typeProp, visuallyHiddenPrefix: visuallyHiddenPrefixProp, id, className, children, ...otherProps }: FeedbackProps): import("react").JSX.Element;
|
|
@@ -28,7 +28,7 @@ export interface FeedbackPopoverProps extends PopoverContentProps {
|
|
|
28
28
|
iconButtonProps?: Omit<IconButtonProps, "size" | "icon" | "label">;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* Component used to provide feedback to a form control, where the feedback is
|
|
32
|
-
*
|
|
31
|
+
* Component used to provide feedback to a form control, where the feedback is displayed within a
|
|
32
|
+
* popover.
|
|
33
33
|
*/
|
|
34
|
-
export declare function FeedbackPopover({ defaultOpen, open: controlledOpen, onOpenChange, modal, icon, size, onOpenAutoFocus, label, buttonContainerProps, iconButtonProps, className, children, ...otherProps }: FeedbackPopoverProps): import("react").JSX.Element;
|
|
34
|
+
export declare function FeedbackPopover({ defaultOpen, open: controlledOpen, onOpenChange, modal, icon: iconProp, size, onOpenAutoFocus, label: labelProp, buttonContainerProps, iconButtonProps, className, children, ...otherProps }: FeedbackPopoverProps): import("react").JSX.Element;
|
|
@@ -4,10 +4,9 @@ export interface FeedbackProviderProps {
|
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* Component providing context necessary for form controls aware of feedbacks
|
|
8
|
-
* and vice versa.
|
|
7
|
+
* Component providing context necessary for form controls aware of feedbacks and vice versa.
|
|
9
8
|
*
|
|
10
|
-
* The `Field` component uses this component internally. As such, it is seldom
|
|
11
|
-
*
|
|
9
|
+
* The `Field` component uses this component internally. As such, it is seldom necessary to use it
|
|
10
|
+
* manually.
|
|
12
11
|
*/
|
|
13
12
|
export declare function FeedbackProvider({ children }: FeedbackProviderProps): import("react").JSX.Element;
|
|
@@ -8,17 +8,14 @@ export declare function useFeedbackIds(): string[] | undefined;
|
|
|
8
8
|
/** Hook exposing whether the `name` of a control. */
|
|
9
9
|
export declare function useFeedbackControlName(): string | undefined;
|
|
10
10
|
/**
|
|
11
|
-
* Hook that registers the name of a control. Returns whether there is a
|
|
12
|
-
*
|
|
11
|
+
* Hook that registers the name of a control. Returns whether there is a feedback provider to
|
|
12
|
+
* register in.
|
|
13
13
|
*/
|
|
14
14
|
export declare function useRegisterControlNameInFeedbackProvider(name?: string): boolean;
|
|
15
15
|
/**
|
|
16
|
-
* Hook that registers the status of a control. Returns whether there is a
|
|
17
|
-
*
|
|
16
|
+
* Hook that registers the status of a control. Returns whether there is a feedback provider to
|
|
17
|
+
* register in.
|
|
18
18
|
*/
|
|
19
19
|
export declare function useRegisterControlStatusInFeedbackProvider(status?: ControlStatus): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Hook which returns a function that can be used to set the focus status of the
|
|
22
|
-
* field's control.
|
|
23
|
-
*/
|
|
20
|
+
/** Hook which returns a function that can be used to set the focus status of the field's control. */
|
|
24
21
|
export declare function useSetControlFocusedInFeedbackProvider(): (controlFocused: boolean) => void | undefined;
|
|
@@ -2,23 +2,21 @@ import { type ComponentProps } from "react";
|
|
|
2
2
|
/** Properties of the field component. */
|
|
3
3
|
export interface FieldProps extends ComponentProps<"div"> {
|
|
4
4
|
/**
|
|
5
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
6
|
+
* original component props with the props of the supplied element/component and change the
|
|
7
|
+
* underlying DOM node.
|
|
8
8
|
*/
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* The `Field` component acts as a container that associates a form control with
|
|
13
|
-
*
|
|
12
|
+
* The `Field` component acts as a container that associates a form control with a label, helper
|
|
13
|
+
* text, and/or validation feedback.
|
|
14
14
|
*
|
|
15
|
-
* Use a `Label` to identify the control, a `HelperText` to provide additional
|
|
16
|
-
*
|
|
17
|
-
* success messages.
|
|
15
|
+
* Use a `Label` to identify the control, a `HelperText` to provide additional guidance or
|
|
16
|
+
* descriptions, and `Feedback` to display error, warning, or success messages.
|
|
18
17
|
*
|
|
19
|
-
* It supports the following form controls: `Checkbox`, `CheckboxGroup`,
|
|
20
|
-
* `
|
|
21
|
-
* `RadioGroup`, `Select`, `Table`, `TextArea`.
|
|
18
|
+
* It supports the following form controls: `Checkbox`, `CheckboxGroup`, `DataTable`, `DateInput`,
|
|
19
|
+
* `DateRangeInput`, `NumericInput`, `Input`, `RadioGroup`, `Select`, `Table`, `TextArea`.
|
|
22
20
|
*
|
|
23
21
|
* Example usage:
|
|
24
22
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Hook exposing whether a component is being rendered within a field. */
|
|
2
2
|
export declare function useIsInField(): boolean;
|
|
3
3
|
/**
|
|
4
|
-
* Hook that registers whether a control is marked as required. Returns whether
|
|
5
|
-
*
|
|
4
|
+
* Hook that registers whether a control is marked as required. Returns whether there is a field to
|
|
5
|
+
* register in.
|
|
6
6
|
*/
|
|
7
7
|
export declare function useRegisterControlInField(hasCode: boolean): boolean;
|
|
@@ -2,15 +2,14 @@ import { type ComponentProps } from "react";
|
|
|
2
2
|
/** Properties of the field group component. */
|
|
3
3
|
export interface FieldGroupProps extends ComponentProps<"div"> {
|
|
4
4
|
/**
|
|
5
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
6
|
+
* original component props with the props of the supplied element/component and change the
|
|
7
|
+
* underlying DOM node.
|
|
8
8
|
*/
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* The field group component can be used to group multiple related form fields
|
|
13
|
-
* together.
|
|
12
|
+
* The field group component can be used to group multiple related form fields together.
|
|
14
13
|
*
|
|
15
14
|
* It composes the following subcomponents:
|
|
16
15
|
*
|
|
@@ -2,9 +2,9 @@ import type { ComponentProps } from "react";
|
|
|
2
2
|
/** Properties of the field group body component. */
|
|
3
3
|
export interface FieldGroupBodyProps extends ComponentProps<"div"> {
|
|
4
4
|
/**
|
|
5
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
6
|
+
* original component props with the props of the supplied element/component and change the
|
|
7
|
+
* underlying DOM node.
|
|
8
8
|
*/
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
}
|
|
@@ -2,9 +2,9 @@ import { type ComponentProps, type ReactNode } from "react";
|
|
|
2
2
|
/** Properties of the field group header component. */
|
|
3
3
|
export interface FieldGroupHeaderProps extends ComponentProps<"div"> {
|
|
4
4
|
/**
|
|
5
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
6
|
+
* original component props with the props of the supplied element/component and change the
|
|
7
|
+
* underlying DOM node.
|
|
8
8
|
*/
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
/** Code associated with the field group. */
|
|
@@ -15,4 +15,4 @@ export interface FieldGroupHeaderProps extends ComponentProps<"div"> {
|
|
|
15
15
|
codeProps?: ComponentProps<"span">;
|
|
16
16
|
}
|
|
17
17
|
/** Component used to display the header of a field group. */
|
|
18
|
-
export declare function FieldGroupHeader({ asChild, code, visuallyHiddenCodePrefix, codeProps, className, children, ...otherProps }: FieldGroupHeaderProps): import("react").JSX.Element;
|
|
18
|
+
export declare function FieldGroupHeader({ asChild, code, visuallyHiddenCodePrefix: visuallyHiddenCodePrefixProp, codeProps, className, children, ...otherProps }: FieldGroupHeaderProps): import("react").JSX.Element;
|
|
@@ -6,9 +6,9 @@ export type FieldGroupTitleProps<TAs extends FieldGroupTitleAs = "div"> = Polymo
|
|
|
6
6
|
/** Own properties of the field group title component. */
|
|
7
7
|
export interface FieldGroupTitleOwnProps {
|
|
8
8
|
/**
|
|
9
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
10
|
+
* original component props with the props of the supplied element/component and change the
|
|
11
|
+
* underlying DOM node.
|
|
12
12
|
*/
|
|
13
13
|
asChild?: boolean;
|
|
14
14
|
}
|
|
@@ -32,9 +32,9 @@ export interface FormApi<T extends FormValues = any> {
|
|
|
32
32
|
/** Properties of the form component. */
|
|
33
33
|
export interface FormProps<T extends FormValues = any> extends Omit<ComponentProps<"form">, "noValidate" | "onSubmit"> {
|
|
34
34
|
/**
|
|
35
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
36
|
+
* original component props with the props of the supplied element/component and change the
|
|
37
|
+
* underlying DOM node.
|
|
38
38
|
*/
|
|
39
39
|
asChild?: boolean;
|
|
40
40
|
/** Function used to validate the whole form. */
|
|
@@ -45,10 +45,10 @@ export interface FormProps<T extends FormValues = any> extends Omit<ComponentPro
|
|
|
45
45
|
* - `"onSubmit"`: Form is validated during submission.
|
|
46
46
|
* - `"onChange"`: Form is validated whenever controls change.
|
|
47
47
|
* - `"onBlur"`: Form is validated whenever controls lose focus.
|
|
48
|
-
* - `"onSubmitThenChange"`: Form is validated during the first submission.
|
|
49
|
-
*
|
|
50
|
-
* - `"onSubmitThenBlur"`: Form is validated during the first submission.
|
|
51
|
-
*
|
|
48
|
+
* - `"onSubmitThenChange"`: Form is validated during the first submission. Afterwards, it is
|
|
49
|
+
* validated whenever controls change.
|
|
50
|
+
* - `"onSubmitThenBlur"`: Form is validated during the first submission. Afterwards, it is
|
|
51
|
+
* validated whenever controls lose focus.
|
|
52
52
|
*
|
|
53
53
|
* @default "onSubmitThenChange"
|
|
54
54
|
*/
|
|
@@ -63,33 +63,28 @@ export interface FormProps<T extends FormValues = any> extends Omit<ComponentPro
|
|
|
63
63
|
*/
|
|
64
64
|
errorDisplayMode?: FormErrorDisplayMode;
|
|
65
65
|
/**
|
|
66
|
-
* External validation errors controlled manually. Each key of the object
|
|
67
|
-
*
|
|
68
|
-
* an empty string represents a global error.
|
|
66
|
+
* External validation errors controlled manually. Each key of the object should correspond to the
|
|
67
|
+
* `name` of the field in question. A key containing an empty string represents a global error.
|
|
69
68
|
*
|
|
70
|
-
* Note that external errors provided via this property **will** prevent form
|
|
71
|
-
*
|
|
72
|
-
*
|
|
69
|
+
* Note that external errors provided via this property **will** prevent form submission, so they
|
|
70
|
+
* should be manually cleared as necessary, either by updating the property or using the
|
|
71
|
+
* `clearExternalErrors` API function.
|
|
73
72
|
*/
|
|
74
73
|
externalErrors?: FormValidationErrors<T>;
|
|
75
74
|
/** Error messages to show for each native form error. */
|
|
76
75
|
nativeErrorMessages?: FormNativeErrorMessages;
|
|
77
76
|
/**
|
|
78
|
-
* Whether to display a confirmation when attempting to unload the page when
|
|
79
|
-
* the form is dirty.
|
|
77
|
+
* Whether to display a confirmation when attempting to unload the page when the form is dirty.
|
|
80
78
|
*
|
|
81
79
|
* @default false
|
|
82
80
|
*/
|
|
83
81
|
confirmUnloadWhenDirty?: boolean;
|
|
84
82
|
/**
|
|
85
|
-
* Disables native validations such as `required`, `minLength`, `pattern`,
|
|
86
|
-
*
|
|
83
|
+
* Disables native validations such as `required`, `minLength`, `pattern`, etc. from affecting the
|
|
84
|
+
* form.
|
|
87
85
|
*/
|
|
88
86
|
disableNativeValidations?: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Function called when the form is submitted. The default behaviour is
|
|
91
|
-
* automatically prevented.
|
|
92
|
-
*/
|
|
87
|
+
/** Function called when the form is submitted. The default behaviour is automatically prevented. */
|
|
93
88
|
onSubmit?: (formValues: T, formData: FormData, evt: SubmitEvent<HTMLFormElement>) => FormValidationErrors | void | PromiseLike<FormValidationErrors | void>;
|
|
94
89
|
/** Function called whenever a value of the form changes. */
|
|
95
90
|
onValueChange?: (formValues: T) => void;
|
|
@@ -99,34 +94,24 @@ export interface FormProps<T extends FormValues = any> extends Omit<ComponentPro
|
|
|
99
94
|
apiRef?: Ref<FormApi<T> | null>;
|
|
100
95
|
}
|
|
101
96
|
/**
|
|
102
|
-
* The `Form` provides a wrapper over the browser's native validation
|
|
103
|
-
*
|
|
97
|
+
* The `Form` provides a wrapper over the browser's native validation capabilities and can be used
|
|
98
|
+
* to declaratively build simple forms.
|
|
104
99
|
*
|
|
105
100
|
* It composes the following subcomponents:
|
|
106
101
|
*
|
|
107
|
-
* - `FormError`: used to show errors associated with the form itself or one of
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* based on the current state of the form.
|
|
102
|
+
* - `FormError`: used to show errors associated with the form itself or one of its controls.
|
|
103
|
+
* - `FormState`: generic component which can be used to conditionally render UI based on the current
|
|
104
|
+
* state of the form.
|
|
111
105
|
* - `FormSubmit`: submit button for the form.
|
|
112
106
|
* - `FormReset`: reset button for the form.
|
|
113
107
|
*
|
|
114
|
-
* The following form controls are supported: `Checkbox`, `CheckboxGroup`,
|
|
115
|
-
* `
|
|
116
|
-
* `Select`, `TextArea`.
|
|
108
|
+
* The following form controls are supported: `Checkbox`, `CheckboxGroup`, `DateInput`,
|
|
109
|
+
* `DateRangeInput`, `NumericInput`, `Input`, `RadioGroup`, `Select`, `TextArea`.
|
|
117
110
|
*
|
|
118
111
|
* Example usage:
|
|
119
112
|
*
|
|
120
113
|
* ```tsx
|
|
121
|
-
* import {
|
|
122
|
-
* Field,
|
|
123
|
-
* Form,
|
|
124
|
-
* FormError,
|
|
125
|
-
* FormSubmit,
|
|
126
|
-
* Input,
|
|
127
|
-
* Label,
|
|
128
|
-
* Stack,
|
|
129
|
-
* } from "@ostack.tech/ui";
|
|
114
|
+
* import { Field, Form, FormError, FormSubmit, Input, Label, Stack } from "@ostack.tech/ui";
|
|
130
115
|
*
|
|
131
116
|
* function SignInForm() {
|
|
132
117
|
* return (
|
|
@@ -152,4 +137,4 @@ export interface FormProps<T extends FormValues = any> extends Omit<ComponentPro
|
|
|
152
137
|
* }
|
|
153
138
|
* ```
|
|
154
139
|
*/
|
|
155
|
-
export declare function Form<T extends FormValues = any>({ asChild, validationMode, errorDisplayMode, validate, externalErrors, nativeErrorMessages, className, confirmUnloadWhenDirty, disableNativeValidations, onSubmit, onReset, onValueChange, submitErrorMessage, apiRef, ref, ...otherProps }: FormProps<T>): import("react").JSX.Element;
|
|
140
|
+
export declare function Form<T extends FormValues = any>({ asChild, validationMode, errorDisplayMode, validate, externalErrors, nativeErrorMessages, className, confirmUnloadWhenDirty, disableNativeValidations, onSubmit, onReset, onValueChange, submitErrorMessage: submitErrorMessageProp, apiRef, ref, ...otherProps }: FormProps<T>): import("react").JSX.Element;
|