@ostack.tech/ui 1.2.0-beta.0 → 1.2.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-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 +26835 -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
|
@@ -35,14 +35,14 @@ export interface FormNativeError {
|
|
|
35
35
|
}
|
|
36
36
|
/** Actions of the form's store. */
|
|
37
37
|
interface FormStoreActions<T extends FormValues = FormValues> extends FormApi<T> {
|
|
38
|
-
registerControl: (name: keyof T, initialValue: unknown, validateFn: (value: any) => void |
|
|
38
|
+
registerControl: (name: keyof T, initialValue: unknown, validateFn: (value: any) => void | PromiseLike<void>) => () => void;
|
|
39
39
|
onValueChange: () => void;
|
|
40
40
|
setValue: (name: keyof T, value: unknown) => void;
|
|
41
41
|
queueValidate: () => void;
|
|
42
42
|
firstInvalid: () => keyof T | "" | null;
|
|
43
43
|
runFormValidate: (formValues: T) => void | PromiseLike<void>;
|
|
44
44
|
setNativeErrors: (name: keyof T, errors: FormNativeError[]) => void;
|
|
45
|
-
setValidateErrors: (name: keyof T | "", errors: ReactNode) => void;
|
|
45
|
+
setValidateErrors: (name: keyof T | "", errors: ReactNode | void) => void;
|
|
46
46
|
}
|
|
47
47
|
/** Form's store. */
|
|
48
48
|
export type FormStore<T extends FormValues = FormValues> = ReturnType<typeof useCreateFormContext<T>>["store"];
|
|
@@ -5,24 +5,19 @@ export interface FormErrorProps {
|
|
|
5
5
|
/**
|
|
6
6
|
* Name of the field for which to display the error.
|
|
7
7
|
*
|
|
8
|
-
* By default, the name is inherited from the parent `Field` component if one
|
|
9
|
-
*
|
|
10
|
-
* which represents a global error.
|
|
8
|
+
* By default, the name is inherited from the parent `Field` component if one exists and was
|
|
9
|
+
* provided a name. Otherwise, it defaults to the empty string, which represents a global error.
|
|
11
10
|
*/
|
|
12
11
|
name?: string;
|
|
13
|
-
/**
|
|
14
|
-
* How errors should be displayed. This property is, by default, inherited
|
|
15
|
-
* from the `Form`.
|
|
16
|
-
*/
|
|
12
|
+
/** How errors should be displayed. This property is, by default, inherited from the `Form`. */
|
|
17
13
|
errorDisplayMode?: FormErrorDisplayMode;
|
|
18
14
|
/** Error messages to show for each native form error. */
|
|
19
15
|
nativeErrorMessages?: FormNativeErrorMessages;
|
|
20
16
|
/**
|
|
21
|
-
* Function to render the error messages. By default, the messages are
|
|
22
|
-
*
|
|
23
|
-
* component otherwise.
|
|
17
|
+
* Function to render the error messages. By default, the messages are rendered as an `Alert`
|
|
18
|
+
* component for global errors and as a `FeedbackList` component otherwise.
|
|
24
19
|
*/
|
|
25
20
|
children?: (messages: ReactNode[]) => ReactNode;
|
|
26
21
|
}
|
|
27
22
|
/** Error within a `Form`. */
|
|
28
|
-
export declare function FormError({ name, errorDisplayMode, nativeErrorMessages, children, }: FormErrorProps): ReactNode;
|
|
23
|
+
export declare function FormError({ name: nameProp, errorDisplayMode: errorDisplayModeProp, nativeErrorMessages, children, }: FormErrorProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
@@ -19,8 +19,8 @@ export interface FormStateObject<T = any> {
|
|
|
19
19
|
/** Properties of the form state component. */
|
|
20
20
|
export interface FormStateProps<T = any> {
|
|
21
21
|
/**
|
|
22
|
-
* Name of the field for which to provide the state. By default, the state of
|
|
23
|
-
*
|
|
22
|
+
* Name of the field for which to provide the state. By default, the state of the whole form is
|
|
23
|
+
* provided.
|
|
24
24
|
*/
|
|
25
25
|
name?: string;
|
|
26
26
|
/** Function used to render UI based on the form state. */
|
|
@@ -7,4 +7,4 @@ export declare function isFormValidationErrors(value: unknown): value is FormVal
|
|
|
7
7
|
/** Normalises a form validation errors object. */
|
|
8
8
|
export declare function normalizeFormValidationErrors<T extends FormValues = FormValues>(errors?: FormValidationErrors): NormalizedFormValidationErrors<T>;
|
|
9
9
|
/** Transforms a node of errors into an array. */
|
|
10
|
-
export declare function arrayifyErrors(errors: ReactNode |
|
|
10
|
+
export declare function arrayifyErrors(errors: ReactNode | void): ReactNode[];
|
|
@@ -12,4 +12,4 @@ export interface UseRegisterFormControlResult<T = any> {
|
|
|
12
12
|
onBlur: () => void;
|
|
13
13
|
}
|
|
14
14
|
/** Hook used to register a form control within a `Form`. */
|
|
15
|
-
export declare function useRegisterFormControl<T = any>(name: string | undefined, initialValue: T, validate: FormControlValidateFn<T> | undefined,
|
|
15
|
+
export declare function useRegisterFormControl<T = any>(name: string | undefined, initialValue: T, validate: FormControlValidateFn<T> | undefined, validationModeProp?: FormValidationMode): UseRegisterFormControlResult<T>;
|
|
@@ -9,51 +9,46 @@ export type GridProps = GridContainerProps | GridItemProps;
|
|
|
9
9
|
/** Base properties of the grid component. */
|
|
10
10
|
export interface GridPropsBase extends ComponentProps<"div"> {
|
|
11
11
|
/**
|
|
12
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
13
|
+
* original component props with the props of the supplied element/component and change the
|
|
14
|
+
* underlying DOM node.
|
|
15
15
|
*/
|
|
16
16
|
asChild?: boolean;
|
|
17
17
|
/**
|
|
18
|
-
* Mark the component as a grid container that contains the grid items. `Grid`
|
|
19
|
-
*
|
|
18
|
+
* Mark the component as a grid container that contains the grid items. `Grid` components are
|
|
19
|
+
* otherwise always items.
|
|
20
20
|
*/
|
|
21
21
|
container?: boolean;
|
|
22
22
|
/**
|
|
23
23
|
* Number of columns of the grid.
|
|
24
24
|
*
|
|
25
|
-
* A responsive value may be provided to change the number of columns based on
|
|
26
|
-
*
|
|
25
|
+
* A responsive value may be provided to change the number of columns based on the current
|
|
26
|
+
* breakpoint.
|
|
27
27
|
*
|
|
28
28
|
* @default 12
|
|
29
29
|
*/
|
|
30
30
|
columns?: Responsive<number>;
|
|
31
31
|
/**
|
|
32
|
-
* Gap between both rows and columns. When a number is provided, each unit
|
|
33
|
-
*
|
|
32
|
+
* Gap between both rows and columns. When a number is provided, each unit corresponds to
|
|
33
|
+
* `var(--o-ui-space)`.
|
|
34
34
|
*
|
|
35
|
-
* A responsive value may be provided to change the gap based on the current
|
|
36
|
-
* breakpoint.
|
|
35
|
+
* A responsive value may be provided to change the gap based on the current breakpoint.
|
|
37
36
|
*
|
|
38
37
|
* @default 5
|
|
39
38
|
*/
|
|
40
39
|
gap?: Responsive<number | string>;
|
|
41
40
|
/**
|
|
42
|
-
* Gap between rows. When a number is provided, each unit corresponds to
|
|
43
|
-
* `var(--o-ui-space)`.
|
|
41
|
+
* Gap between rows. When a number is provided, each unit corresponds to `var(--o-ui-space)`.
|
|
44
42
|
*
|
|
45
|
-
* A responsive value may be provided to change the row gap based on the
|
|
46
|
-
* current breakpoint.
|
|
43
|
+
* A responsive value may be provided to change the row gap based on the current breakpoint.
|
|
47
44
|
*
|
|
48
45
|
* @default gap
|
|
49
46
|
*/
|
|
50
47
|
rowGap?: Responsive<number | string>;
|
|
51
48
|
/**
|
|
52
|
-
* Gap between columns. When a number is provided, each unit corresponds to
|
|
53
|
-
* `var(--o-ui-space)`.
|
|
49
|
+
* Gap between columns. When a number is provided, each unit corresponds to `var(--o-ui-space)`.
|
|
54
50
|
*
|
|
55
|
-
* A responsive value may be provided to change the column gap based on the
|
|
56
|
-
* current breakpoint.
|
|
51
|
+
* A responsive value may be provided to change the column gap based on the current breakpoint.
|
|
57
52
|
*
|
|
58
53
|
* @default gap
|
|
59
54
|
*/
|
|
@@ -108,12 +103,12 @@ export interface GridItemProps extends GridPropsBase {
|
|
|
108
103
|
columnGap?: never;
|
|
109
104
|
}
|
|
110
105
|
/**
|
|
111
|
-
* The `Grid` component is designed for creating one or two-dimensional layouts
|
|
112
|
-
*
|
|
106
|
+
* The `Grid` component is designed for creating one or two-dimensional layouts within a defined
|
|
107
|
+
* number of columns.
|
|
113
108
|
*
|
|
114
|
-
* For one-dimensional vertical layouts or one-dimensional horizontal layouts
|
|
115
|
-
*
|
|
116
|
-
*
|
|
109
|
+
* For one-dimensional vertical layouts or one-dimensional horizontal layouts without a fixed number
|
|
110
|
+
* of columns, you might prefer to use the [`Stack` component](/docs/ostack-ui-layout-stack--docs)
|
|
111
|
+
* instead.
|
|
117
112
|
*
|
|
118
113
|
* Example usage:
|
|
119
114
|
*
|
|
@@ -8,26 +8,25 @@ export type HeadingProps<TAs extends HeadingAs = "h2"> = PolymorphicProps<Headin
|
|
|
8
8
|
/** Own properties of the heading component. */
|
|
9
9
|
export interface HeadingOwnProps {
|
|
10
10
|
/**
|
|
11
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
12
|
+
* original component props with the props of the supplied element/component and change the
|
|
13
|
+
* underlying DOM node.
|
|
14
14
|
*/
|
|
15
15
|
asChild?: boolean;
|
|
16
16
|
/**
|
|
17
|
-
* Heading level, the larger the level, the smaller the font-size (level `1`
|
|
18
|
-
*
|
|
17
|
+
* Heading level, the larger the level, the smaller the font-size (level `1` is largest, `6`
|
|
18
|
+
* smallest).
|
|
19
19
|
*
|
|
20
|
-
* By default, if `as` and `asChild` are not provided, the level is used to
|
|
21
|
-
*
|
|
22
|
-
* element to be rendered.
|
|
20
|
+
* By default, if `as` and `asChild` are not provided, the level is used to determine which HTML
|
|
21
|
+
* element to render, so a level of `2` causes a `<h2>` element to be rendered.
|
|
23
22
|
*
|
|
24
23
|
* @default 2
|
|
25
24
|
*/
|
|
26
25
|
level?: HeadingLevel;
|
|
27
26
|
}
|
|
28
27
|
/**
|
|
29
|
-
* Component used to render semantic HTML headings. It is built on top of the
|
|
30
|
-
*
|
|
28
|
+
* Component used to render semantic HTML headings. It is built on top of the browser's
|
|
29
|
+
* [`<h1>`–`<h6>` heading
|
|
31
30
|
* elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements).
|
|
32
31
|
*
|
|
33
32
|
* Example usage:
|
|
@@ -2,9 +2,9 @@ import type { ComponentProps } from "react";
|
|
|
2
2
|
/** Properties of the helper text component. */
|
|
3
3
|
export interface HelperTextProps 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
|
}
|
|
@@ -4,10 +4,9 @@ export interface HelperTextProviderProps {
|
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* Component providing context necessary for form controls aware of helper
|
|
8
|
-
* texts.
|
|
7
|
+
* Component providing context necessary for form controls aware of helper texts.
|
|
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 HelperTextProvider({ children }: HelperTextProviderProps): import("react").JSX.Element;
|
|
@@ -11,36 +11,29 @@ export type IconColor = AccentColor;
|
|
|
11
11
|
export interface IconProps extends Omit<ComponentProps<typeof FontAwesomeIcon>, "icon" | "size"> {
|
|
12
12
|
/** Icon to display. */
|
|
13
13
|
icon: IconProp;
|
|
14
|
-
/**
|
|
15
|
-
* Size of the icon. By default, the icon will be sized according to the
|
|
16
|
-
* current font size.
|
|
17
|
-
*/
|
|
14
|
+
/** Size of the icon. By default, the icon will be sized according to the current font size. */
|
|
18
15
|
size?: IconSize;
|
|
19
|
-
/**
|
|
20
|
-
* Colour of the icon. By default, the icon will have the current font's
|
|
21
|
-
* colour.
|
|
22
|
-
*/
|
|
16
|
+
/** Colour of the icon. By default, the icon will have the current font's colour. */
|
|
23
17
|
color?: IconColor;
|
|
24
18
|
/**
|
|
25
19
|
* Optional accessible label for the icon.
|
|
26
20
|
*
|
|
27
|
-
* When provided, a visually hidden label is added so that assistive
|
|
28
|
-
*
|
|
21
|
+
* When provided, a visually hidden label is added so that assistive technologies correctly
|
|
22
|
+
* announce it.
|
|
29
23
|
*/
|
|
30
24
|
label?: ReactNode;
|
|
31
25
|
}
|
|
32
26
|
/**
|
|
33
27
|
* Icon component extending the FontAwesome's `FontAwesomeIcon` component.
|
|
34
28
|
*
|
|
35
|
-
* Properties supported by FontAwesome are also supported by this component. For
|
|
36
|
-
*
|
|
29
|
+
* Properties supported by FontAwesome are also supported by this component. For more information on
|
|
30
|
+
* all supported properties, see [FontAwesome's React
|
|
37
31
|
* documentation](https://docs.fontawesome.com/web/use-with/react/).
|
|
38
32
|
*
|
|
39
|
-
* For a list of existing free icons, consult:
|
|
40
|
-
* https://fontawesome.com/search?ic=free.
|
|
33
|
+
* For a list of existing free icons, consult: https://fontawesome.com/search?ic=free.
|
|
41
34
|
*
|
|
42
|
-
* For tree-shaking purposes, we recommend importing icons individually from
|
|
43
|
-
*
|
|
35
|
+
* For tree-shaking purposes, we recommend importing icons individually from their respective
|
|
36
|
+
* FontAwesome module.
|
|
44
37
|
*
|
|
45
38
|
* Example usage:
|
|
46
39
|
*
|
|
@@ -20,9 +20,9 @@ export type IconButtonProps<TAs extends IconButtonAs = "button"> = PolymorphicPr
|
|
|
20
20
|
/** Own properties of the icon button component. */
|
|
21
21
|
export interface IconButtonOwnProps {
|
|
22
22
|
/**
|
|
23
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
24
|
+
* original component props with the props of the supplied element/component and change the
|
|
25
|
+
* underlying DOM node.
|
|
26
26
|
*/
|
|
27
27
|
asChild?: boolean;
|
|
28
28
|
children?: ReactElement;
|
|
@@ -49,11 +49,11 @@ export interface IconButtonOwnProps {
|
|
|
49
49
|
/** Icon to show within the button. */
|
|
50
50
|
icon: IconProp | ReactElement;
|
|
51
51
|
/**
|
|
52
|
-
* Accessible label of the icon button. This label is rendered as a visually
|
|
53
|
-
*
|
|
52
|
+
* Accessible label of the icon button. This label is rendered as a visually hidden element inside
|
|
53
|
+
* the button.
|
|
54
54
|
*
|
|
55
|
-
* By default, and for sighted users, it is also displayed as a tooltip
|
|
56
|
-
*
|
|
55
|
+
* By default, and for sighted users, it is also displayed as a tooltip (overridable via
|
|
56
|
+
* `tooltipContent`).
|
|
57
57
|
*/
|
|
58
58
|
label: ReactNode;
|
|
59
59
|
/**
|
|
@@ -71,63 +71,51 @@ export interface IconButtonOwnProps {
|
|
|
71
71
|
/**
|
|
72
72
|
* Renders the icon button in a **loading** state.
|
|
73
73
|
*
|
|
74
|
-
* When `true`, the button is “soft-disabled”: it looks disabled and ignores
|
|
75
|
-
*
|
|
76
|
-
*
|
|
74
|
+
* When `true`, the button is “soft-disabled”: it looks disabled and ignores user interaction but
|
|
75
|
+
* remains focusable. By default, a spinner is shown as the button's icon (i.e. `showSpinner` is
|
|
76
|
+
* set to `true` unless overridden).
|
|
77
77
|
*
|
|
78
78
|
* The button's label while loading can be controlled via `loadingLabel`.
|
|
79
79
|
*
|
|
80
|
-
* To only show a spinner without “soft-disabling” the button, set
|
|
81
|
-
* `showSpinner` instead.
|
|
80
|
+
* To only show a spinner without “soft-disabling” the button, set `showSpinner` instead.
|
|
82
81
|
*
|
|
83
82
|
* @example
|
|
84
|
-
*
|
|
85
|
-
* ```tsx
|
|
86
|
-
* <IconButton
|
|
87
|
-
* icon={faFloppyDisk}
|
|
88
|
-
* label="Save"
|
|
89
|
-
* loading={saving}
|
|
90
|
-
* loadingLabel="Saving…"
|
|
91
|
-
* />;
|
|
92
|
-
* ```
|
|
83
|
+
* <IconButton icon={faFloppyDisk} label="Save" loading={saving} loadingLabel="Saving…" />;
|
|
93
84
|
*
|
|
94
85
|
* @default false
|
|
95
86
|
*/
|
|
96
87
|
loading?: boolean;
|
|
97
88
|
/**
|
|
98
|
-
* Label of the icon button when it is in "loading" state. If not provided,
|
|
99
|
-
*
|
|
89
|
+
* Label of the icon button when it is in "loading" state. If not provided, the label will remain
|
|
90
|
+
* unchanged.
|
|
100
91
|
*/
|
|
101
92
|
loadingLabel?: ReactNode;
|
|
102
93
|
/**
|
|
103
94
|
* Whether to show a spinner as the icon button's icon.
|
|
104
95
|
*
|
|
105
|
-
* Defaults to the value of the `loading` property. In most cases, prefer
|
|
106
|
-
*
|
|
96
|
+
* Defaults to the value of the `loading` property. In most cases, prefer `loading`, which also
|
|
97
|
+
* “soft-disables” the button.
|
|
107
98
|
*
|
|
108
|
-
* Use `showSpinner` when you want a spinner **without** “soft-disabling” the
|
|
109
|
-
*
|
|
110
|
-
* and `showSpinner` to `false`.
|
|
99
|
+
* Use `showSpinner` when you want a spinner **without** “soft-disabling” the button. To
|
|
100
|
+
* “soft-disable” **without** a spinner, set `loading` to `true` and `showSpinner` to `false`.
|
|
111
101
|
*
|
|
112
102
|
* @default loading
|
|
113
103
|
*/
|
|
114
104
|
showSpinner?: boolean;
|
|
115
105
|
/**
|
|
116
|
-
* Content to display in a tooltip when hovering over or focusing the icon
|
|
117
|
-
*
|
|
106
|
+
* Content to display in a tooltip when hovering over or focusing the icon button. By default, the
|
|
107
|
+
* icon button's label is displayed.
|
|
118
108
|
*
|
|
119
109
|
* Set to `null` to not render any content (other than the `keybinds`).
|
|
120
110
|
*/
|
|
121
111
|
tooltipContent?: ReactNode;
|
|
122
112
|
/**
|
|
123
|
-
* [`tinykeys`](https://jamiebuilds.github.io/tinykeys) keyboard shortcut
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* >
|
|
129
|
-
* > shortcut to run the icon button's action. This should be done manually via
|
|
130
|
-
* > e.g. the `useKeyboardShortcut` hook.
|
|
113
|
+
* [`tinykeys`](https://jamiebuilds.github.io/tinykeys) keyboard shortcut keybinds used to trigger
|
|
114
|
+
* the action performed by the icon button. Rendered at the end of the icon button's tooltip for
|
|
115
|
+
* visual users and announced to screen readers via `aria-keyshortcuts`.
|
|
116
|
+
*
|
|
117
|
+
* > **Note:** This property does **not** automatically register a keyboard shortcut to run the icon
|
|
118
|
+
* > button's action. This should be done manually via e.g. the `useKeyboardShortcut` hook.
|
|
131
119
|
*/
|
|
132
120
|
keybinds?: KeyboardShortcutKeybinds;
|
|
133
121
|
/** Properties to pass to the `Icon` component. */
|
|
@@ -142,16 +130,16 @@ export interface IconButtonOwnProps {
|
|
|
142
130
|
keybindsProps?: Omit<KeybindsProps, "keybinds">;
|
|
143
131
|
}
|
|
144
132
|
/**
|
|
145
|
-
* The icon button component renders a button containing a single icon. Use it
|
|
146
|
-
*
|
|
147
|
-
*
|
|
133
|
+
* The icon button component renders a button containing a single icon. Use it as appropriate, as an
|
|
134
|
+
* alternative to the `Button` component, to trigger actions or events, such as opening a dialog or
|
|
135
|
+
* submitting a form.
|
|
148
136
|
*
|
|
149
|
-
* A `label` property is required for screen-readers to give meaning to the
|
|
150
|
-
*
|
|
137
|
+
* A `label` property is required for screen-readers to give meaning to the button. This label is
|
|
138
|
+
* also, by default, displayed as a tooltip.
|
|
151
139
|
*
|
|
152
140
|
* Built on top of the browser's [`<button>`
|
|
153
|
-
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button),
|
|
154
|
-
*
|
|
141
|
+
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button), [`Icon`
|
|
142
|
+
* component](/docs/ostack-ui-data-display-icon--docs), and [`Tooltip`
|
|
155
143
|
* component](/docs/ostack-ui-overlay-tooltip--docs).
|
|
156
144
|
*
|
|
157
145
|
* Example usage:
|
|
@@ -161,14 +149,8 @@ export interface IconButtonOwnProps {
|
|
|
161
149
|
* import { IconButton } from "@ostack.tech/ui";
|
|
162
150
|
*
|
|
163
151
|
* function Launch() {
|
|
164
|
-
* return
|
|
165
|
-
* <IconButton
|
|
166
|
-
* icon={faRocket}
|
|
167
|
-
* label="Launch rocket"
|
|
168
|
-
* onClick={launchRocket}
|
|
169
|
-
* />
|
|
170
|
-
* );
|
|
152
|
+
* return <IconButton icon={faRocket} label="Launch rocket" onClick={launchRocket} />;
|
|
171
153
|
* }
|
|
172
154
|
* ```
|
|
173
155
|
*/
|
|
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;
|
|
156
|
+
export declare function IconButton<TAs extends IconButtonAs = "button">({ as, asChild, variant, color, size, circle, icon, label, active, disabled, loading, loadingLabel, showSpinner, tooltipContent: tooltipContentProp, keybinds, iconProps, labelProps, spinnerProps, tooltipProps, keybindsProps, type, onClick, className, children, "aria-disabled": ariaDisabled, ...otherProps }: IconButtonProps<TAs>): import("react").JSX.Element;
|
|
@@ -3,15 +3,9 @@ import type { FormValidationMode } from "../Form";
|
|
|
3
3
|
import { type FormControlValidateFn } from "../Form/useRegisterFormControl.ts";
|
|
4
4
|
/** Base properties of the input component. */
|
|
5
5
|
export interface InputOwnProps<T> {
|
|
6
|
-
/**
|
|
7
|
-
* Custom validation function meant to validate the control when it is part of
|
|
8
|
-
* a `Form`.
|
|
9
|
-
*/
|
|
6
|
+
/** Custom validation function meant to validate the control when it is part of a `Form`. */
|
|
10
7
|
validate?: FormControlValidateFn<T>;
|
|
11
|
-
/**
|
|
12
|
-
* Specifies when the control should be validated. Defaults to the value
|
|
13
|
-
* specified in the `Form`.
|
|
14
|
-
*/
|
|
8
|
+
/** Specifies when the control should be validated. Defaults to the value specified in the `Form`. */
|
|
15
9
|
validationMode?: FormValidationMode;
|
|
16
10
|
}
|
|
17
11
|
/** Base properties of a single file input. */
|
|
@@ -26,12 +20,11 @@ export interface InputNonFileProps extends ControlNonFileInputProps, InputOwnPro
|
|
|
26
20
|
/** Properties of the control component. */
|
|
27
21
|
export type InputProps = InputSingleFileProps | InputMultipleFileProps | InputNonFileProps;
|
|
28
22
|
/**
|
|
29
|
-
* The input component is used to collect user input. It is built on top of the
|
|
30
|
-
* browser's [`<input>`
|
|
23
|
+
* The input component is used to collect user input. It is built on top of the browser's [`<input>`
|
|
31
24
|
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input).
|
|
32
25
|
*
|
|
33
|
-
* For accessibility purposes, inputs are usually included within a `Field`
|
|
34
|
-
*
|
|
26
|
+
* For accessibility purposes, inputs are usually included within a `Field` together with a `Label`
|
|
27
|
+
* and optionally `HelperText` and/or `Feedback`.
|
|
35
28
|
*
|
|
36
29
|
* Example usage:
|
|
37
30
|
*
|
|
@@ -4,4 +4,4 @@ export interface KeyPressProps extends Pick<KeybindsProps, "keySymbols" | "keyLa
|
|
|
4
4
|
/** Key press. */
|
|
5
5
|
keyPress: string[];
|
|
6
6
|
}
|
|
7
|
-
export declare function KeyPress({ keyPress, keySymbols, keyLabels
|
|
7
|
+
export declare function KeyPress({ keyPress, keySymbols, keyLabels }: KeyPressProps): ReactNode;
|
|
@@ -4,4 +4,4 @@ export interface KeybindProps extends Pick<KeybindsProps, "keyPressesSeparatorLa
|
|
|
4
4
|
/** Keybind. */
|
|
5
5
|
keybind: string[][];
|
|
6
6
|
}
|
|
7
|
-
export declare function Keybind({ keybind, keyPressesSeparatorLabel, keySymbols, keyLabels, }: KeybindProps): ReactNode;
|
|
7
|
+
export declare function Keybind({ keybind, keyPressesSeparatorLabel: keyPressesSeparatorLabelProp, keySymbols, keyLabels, }: KeybindProps): ReactNode;
|
|
@@ -2,10 +2,7 @@ import { type ComponentProps, type ReactNode } from "react";
|
|
|
2
2
|
/** Properties of the keybinds component. */
|
|
3
3
|
export interface KeybindsProps extends Omit<ComponentProps<"span">, "children"> {
|
|
4
4
|
keybinds: string | string[] | null | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* Limits the number of keybinds to display. Must be >= 1. By default, all
|
|
7
|
-
* keybinds are displayed.
|
|
8
|
-
*/
|
|
5
|
+
/** Limits the number of keybinds to display. Must be >= 1. By default, all keybinds are displayed. */
|
|
9
6
|
limit?: number;
|
|
10
7
|
/** Accessible label used to separate keybinds. */
|
|
11
8
|
keybindsSeparatorLabel?: ReactNode;
|
|
@@ -18,8 +15,5 @@ export interface KeybindsProps extends Omit<ComponentProps<"span">, "children">
|
|
|
18
15
|
/** Accessible key labels to use instead of the default ones. */
|
|
19
16
|
keyLabels?: Record<string, ReactNode>;
|
|
20
17
|
}
|
|
21
|
-
/**
|
|
22
|
-
|
|
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;
|
|
18
|
+
/** Component which visually renders [`tinykeys`](https://jamiebuilds.github.io/tinykeys) keybinds. */
|
|
19
|
+
export declare function Keybinds({ keybinds: keybindsProp, limit, keybindsSeparatorLabel: keybindsSeparatorLabelProp, keyPressesSeparatorLabel, keySymbols, keyLabels, className, ...otherProps }: KeybindsProps): import("react").JSX.Element | null;
|
|
@@ -2,16 +2,16 @@ import type { ComponentProps } from "react";
|
|
|
2
2
|
/** Properties of the keyboard component. */
|
|
3
3
|
export interface KeyboardProps extends ComponentProps<"kbd"> {
|
|
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
|
-
* Component which represents a span of inline text denoting textual user input
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Component which represents a span of inline text denoting textual user input from a keyboard,
|
|
13
|
+
* voice input, or any other text entry device. It is built on top of the browser's [`<kbd>`
|
|
14
|
+
* (keyboard input)
|
|
15
15
|
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/kbd).
|
|
16
16
|
*
|
|
17
17
|
* Example usage:
|
|
@@ -20,8 +20,7 @@ export interface KeyboardProps extends ComponentProps<"kbd"> {
|
|
|
20
20
|
* function BookmarkInstructions() {
|
|
21
21
|
* return (
|
|
22
22
|
* <>
|
|
23
|
-
* Press <Keyboard>Ctrl</Keyboard> + <Keyboard>D</Keyboard> to
|
|
24
|
-
* bookmark this page.
|
|
23
|
+
* Press <Keyboard>Ctrl</Keyboard> + <Keyboard>D</Keyboard> to bookmark this page.
|
|
25
24
|
* </>
|
|
26
25
|
* );
|
|
27
26
|
* }
|
|
@@ -25,12 +25,11 @@ export interface LabelProps extends ComponentProps<typeof LabelPrimitive.Root> {
|
|
|
25
25
|
helperPopoverContentProps?: PopoverContentProps;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* The `Label` component renders an accessible label which can be associated
|
|
29
|
-
* with form controls.
|
|
28
|
+
* The `Label` component renders an accessible label which can be associated with form controls.
|
|
30
29
|
*
|
|
31
|
-
* It should typically be used within a `Field` component together with a form
|
|
32
|
-
*
|
|
33
|
-
*
|
|
30
|
+
* It should typically be used within a `Field` component together with a form control (`Input`,
|
|
31
|
+
* `TextArea`, `Select`, etc.), in which case the label will be automatically associated with its
|
|
32
|
+
* respective control.
|
|
34
33
|
*
|
|
35
34
|
* Example usage:
|
|
36
35
|
*
|
|
@@ -42,4 +41,4 @@ export interface LabelProps extends ComponentProps<typeof LabelPrimitive.Root> {
|
|
|
42
41
|
* }
|
|
43
42
|
* ```
|
|
44
43
|
*/
|
|
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;
|
|
44
|
+
export declare function Label({ asChild, required, helperText, helperButtonLabel: helperButtonLabelProp, htmlFor, id, className, children, containerProps, requiredIconProps, requiredIconContainerProps, helperButtonProps, helperPopoverProps, helperPopoverContentProps, onClick, ...otherProps }: LabelProps): import("react").JSX.Element;
|
|
@@ -4,10 +4,9 @@ export interface LabelProviderProps {
|
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* Component providing context necessary for form controls aware of labels and
|
|
8
|
-
* vice versa.
|
|
7
|
+
* Component providing context necessary for form controls aware of labels 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 LabelProvider({ children }: LabelProviderProps): import("react").JSX.Element;
|
|
@@ -17,7 +17,7 @@ export interface UseOnLabelChangeOptions {
|
|
|
17
17
|
/** Hook which runs the provided callback whenever the label's label changes. */
|
|
18
18
|
export declare function useOnLabelChange(cb: (label: ReactNode) => (() => void) | void, { fireImmediately }?: UseOnLabelChangeOptions): void;
|
|
19
19
|
/**
|
|
20
|
-
* Hook that registers whether a control is marked as required. Returns whether
|
|
21
|
-
*
|
|
20
|
+
* Hook that registers whether a control is marked as required. Returns whether there is a label
|
|
21
|
+
* provider to register in.
|
|
22
22
|
*/
|
|
23
23
|
export declare function useRegisterControlInLabelProvider(id: string, tagName?: string, required?: boolean): boolean;
|
|
@@ -11,11 +11,11 @@ export interface LayerProps extends SlotProps {
|
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* The layer component manages hierarchical stacking contexts by tracking and
|
|
15
|
-
*
|
|
14
|
+
* The layer component manages hierarchical stacking contexts by tracking and adding up z-index
|
|
15
|
+
* values.
|
|
16
16
|
*
|
|
17
|
-
* All ostack/UI overlays (dialogs, dropdown menus, etc.) are rendered within a
|
|
18
|
-
*
|
|
17
|
+
* All ostack/UI overlays (dialogs, dropdown menus, etc.) are rendered within a layer, allowing them
|
|
18
|
+
* to be nested.
|
|
19
19
|
*
|
|
20
20
|
* Example usage:
|
|
21
21
|
*
|