@ostack.tech/ui 0.1.2 → 0.2.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-lyNzumTm.js +105 -0
- package/dist/chunks/en-lyNzumTm.js.map +1 -0
- package/dist/locales/en-GB.js +16 -0
- package/dist/locales/en-GB.js.map +1 -0
- package/dist/locales/en-US.js +16 -0
- package/dist/locales/en-US.js.map +1 -0
- package/dist/locales/fr.js +110 -0
- package/dist/locales/fr.js.map +1 -0
- package/dist/locales/pt.js +110 -0
- package/dist/locales/pt.js.map +1 -0
- package/dist/ostack-ui.js +6151 -6401
- package/dist/ostack-ui.js.map +1 -1
- package/dist/types/components/Alert/Alert.d.ts +9 -9
- package/dist/types/components/Alert/AlertTitle.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogAction.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogBody.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogCancel.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogContent.d.ts +5 -5
- package/dist/types/components/AlertDialog/AlertDialogDescription.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogFooter.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogHeader.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogTitle.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogTrigger.d.ts +3 -3
- package/dist/types/components/Button/Button.d.ts +7 -7
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +3 -3
- package/dist/types/components/Calendar/Calendar.d.ts +6 -6
- package/dist/types/components/Calendar/CalendarContext.d.ts +1 -2
- package/dist/types/components/Calendar/CalendarDay.d.ts +2 -3
- package/dist/types/components/Calendar/CalendarMonthCaption.d.ts +2 -3
- package/dist/types/components/Card/Card.d.ts +3 -3
- package/dist/types/components/Card/CardBody.d.ts +3 -3
- package/dist/types/components/Card/CardFooter.d.ts +3 -3
- package/dist/types/components/Card/CardHeader.d.ts +3 -3
- package/dist/types/components/Card/CardTitle.d.ts +3 -3
- package/dist/types/components/Checkbox/Checkbox.d.ts +11 -11
- package/dist/types/components/CheckboxGroup/CheckboxGroup.d.ts +9 -9
- package/dist/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +1 -2
- package/dist/types/components/ClearContexts/ClearContexts.d.ts +3 -3
- package/dist/types/components/CloseButton/CloseButton.d.ts +3 -3
- package/dist/types/components/Code/Code.d.ts +3 -3
- package/dist/types/components/Collapsible/Collapsible.d.ts +3 -3
- package/dist/types/components/Collapsible/CollapsibleContent.d.ts +3 -3
- package/dist/types/components/Collapsible/CollapsibleContext.d.ts +1 -2
- package/dist/types/components/Collapsible/CollapsibleTrigger.d.ts +4 -4
- package/dist/types/components/CommandMenu/CommandMenu.d.ts +11 -11
- package/dist/types/components/CommandMenu/CommandMenuDialog.d.ts +7 -7
- package/dist/types/components/CommandMenu/CommandMenuGroup.d.ts +4 -4
- package/dist/types/components/CommandMenu/CommandMenuItem.d.ts +3 -3
- package/dist/types/components/Container/Container.d.ts +3 -3
- package/dist/types/components/ControlAddon/ControlAddon.d.ts +3 -3
- package/dist/types/components/ControlCode/ControlCode.d.ts +4 -4
- package/dist/types/components/DataTable/DataTable.d.ts +11 -11
- package/dist/types/components/DataTable/DataTableApi.d.ts +2 -2
- package/dist/types/components/DataTable/DataTableBody.d.ts +4 -4
- package/dist/types/components/DataTable/DataTableCell.d.ts +4 -4
- package/dist/types/components/DataTable/DataTableColumn.d.ts +4 -4
- package/dist/types/components/DataTable/DataTableContent.d.ts +9 -9
- package/dist/types/components/DataTable/DataTableContext.d.ts +19 -19
- package/dist/types/components/DataTable/DataTableFilter.d.ts +3 -3
- package/dist/types/components/DataTable/DataTableFoot.d.ts +3 -3
- package/dist/types/components/DataTable/DataTableHead.d.ts +3 -3
- package/dist/types/components/DataTable/DataTablePagination.d.ts +4 -4
- package/dist/types/components/DataTable/DataTableRow.d.ts +3 -3
- package/dist/types/components/DataTable/DataTableRowsPerPage.d.ts +4 -4
- package/dist/types/components/DataTable/DataTableSelectionTrigger.d.ts +5 -5
- package/dist/types/components/DataTable/PagedDataTablePagination.d.ts +3 -3
- package/dist/types/components/DataTable/ScrolledDataTablePagination.d.ts +3 -3
- package/dist/types/components/DataTable/getRowKey.d.ts +2 -2
- package/dist/types/components/DateInput/DateInput.d.ts +5 -5
- package/dist/types/components/DatePicker/DatePicker.d.ts +2 -2
- package/dist/types/components/DateRangeInput/DateRangeInput.d.ts +19 -19
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/dist/types/components/Dialog/DialogBody.d.ts +3 -3
- package/dist/types/components/Dialog/DialogClose.d.ts +3 -3
- package/dist/types/components/Dialog/DialogContent.d.ts +5 -5
- package/dist/types/components/Dialog/DialogDescription.d.ts +3 -3
- package/dist/types/components/Dialog/DialogFooter.d.ts +3 -3
- package/dist/types/components/Dialog/DialogHeader.d.ts +4 -4
- package/dist/types/components/Dialog/DialogTitle.d.ts +3 -3
- package/dist/types/components/Dialog/DialogTrigger.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +4 -4
- package/dist/types/components/DropdownMenu/DropdownMenuContent.d.ts +6 -6
- package/dist/types/components/DropdownMenu/DropdownMenuGroup.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenuItem.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenuRadioGroup.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -4
- package/dist/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +4 -4
- package/dist/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenuTrigger.d.ts +3 -3
- package/dist/types/components/ErrorBoundary/ErrorBoundary.d.ts +10 -10
- package/dist/types/components/Feedback/Feedback.d.ts +4 -4
- package/dist/types/components/FeedbackList/FeedbackList.d.ts +3 -3
- package/dist/types/components/FeedbackList/FeedbackListContext.d.ts +1 -2
- package/dist/types/components/FeedbackPopover/FeedbackPopover.d.ts +6 -6
- package/dist/types/components/FeedbackPopover/FeedbackPopoverContext.d.ts +1 -2
- package/dist/types/components/Field/Field.d.ts +3 -3
- package/dist/types/components/Field/FieldContext.d.ts +5 -5
- package/dist/types/components/FieldGroup/FieldGroup.d.ts +3 -3
- package/dist/types/components/FieldGroup/FieldGroupBody.d.ts +3 -3
- package/dist/types/components/FieldGroup/FieldGroupContext.d.ts +4 -4
- package/dist/types/components/FieldGroup/FieldGroupHeader.d.ts +6 -6
- package/dist/types/components/FieldGroup/FieldGroupTitle.d.ts +3 -3
- package/dist/types/components/Grid/Grid.d.ts +3 -3
- package/dist/types/components/Heading/Heading.d.ts +3 -3
- package/dist/types/components/HelperText/HelperText.d.ts +3 -3
- package/dist/types/components/Icon/Icon.d.ts +4 -4
- package/dist/types/components/IconButton/IconButton.d.ts +9 -9
- package/dist/types/components/Input/Input.d.ts +14 -14
- package/dist/types/components/Input/InputWithContainerRef.d.ts +4 -4
- package/dist/types/components/Keyboard/Keyboard.d.ts +3 -3
- package/dist/types/components/Label/Label.d.ts +10 -10
- package/dist/types/components/Link/Link.d.ts +4 -4
- package/dist/types/components/Link/LinkContext.d.ts +1 -2
- package/dist/types/components/Mark/Mark.d.ts +3 -3
- package/dist/types/components/MenuList/MenuList.d.ts +3 -3
- package/dist/types/components/MenuList/MenuListContext.d.ts +1 -2
- package/dist/types/components/MenuList/MenuListGroup.d.ts +7 -7
- package/dist/types/components/MenuList/MenuListItem.d.ts +13 -13
- package/dist/types/components/NumericInput/NumericInput.d.ts +3 -3
- package/dist/types/components/Output/Output.d.ts +3 -3
- package/dist/types/components/Overlay/Overlay.d.ts +3 -3
- package/dist/types/components/Popover/PopoverClose.d.ts +3 -3
- package/dist/types/components/Popover/PopoverContent.d.ts +5 -5
- package/dist/types/components/Popover/PopoverTrigger.d.ts +3 -3
- package/dist/types/components/Portal/Portal.d.ts +3 -3
- package/dist/types/components/Portal/PortalContext.d.ts +1 -2
- package/dist/types/components/RadioGroup/Radio.d.ts +10 -10
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +10 -10
- package/dist/types/components/Root/Root.d.ts +14 -10
- package/dist/types/components/Root/RootContext.d.ts +1 -2
- package/dist/types/components/Root/RootElement.d.ts +9 -0
- package/dist/types/components/Root/index.d.ts +1 -1
- package/dist/types/components/Select/Option.d.ts +3 -3
- package/dist/types/components/Select/OptionsGroup.d.ts +3 -3
- package/dist/types/components/Select/Select.d.ts +11 -11
- package/dist/types/components/Select/SelectContext.d.ts +6 -6
- package/dist/types/components/Separator/Separator.d.ts +3 -3
- package/dist/types/components/Slot/Slottable.d.ts +3 -3
- package/dist/types/components/Spinner/Spinner.d.ts +3 -3
- package/dist/types/components/Stack/Stack.d.ts +8 -8
- package/dist/types/components/Stepper/Step.d.ts +5 -5
- package/dist/types/components/Stepper/StepContent.d.ts +3 -3
- package/dist/types/components/Stepper/StepList.d.ts +3 -3
- package/dist/types/components/Stepper/Stepper.d.ts +5 -5
- package/dist/types/components/Stepper/StepperContext.d.ts +1 -2
- package/dist/types/components/Table/Table.d.ts +5 -5
- package/dist/types/components/Table/TableBody.d.ts +3 -3
- package/dist/types/components/Table/TableCell.d.ts +4 -4
- package/dist/types/components/Table/TableColumn.d.ts +14 -14
- package/dist/types/components/Table/TableContext.d.ts +4 -5
- package/dist/types/components/Table/TableFoot.d.ts +3 -3
- package/dist/types/components/Table/TableHead.d.ts +4 -4
- package/dist/types/components/Table/TableRow.d.ts +3 -3
- package/dist/types/components/Tabs/Tab.d.ts +4 -4
- package/dist/types/components/Tabs/TabContent.d.ts +3 -3
- package/dist/types/components/Tabs/TabList.d.ts +5 -5
- package/dist/types/components/Tabs/Tabs.d.ts +3 -3
- package/dist/types/components/Tabs/TabsContext.d.ts +1 -2
- package/dist/types/components/Tag/Tag.d.ts +7 -7
- package/dist/types/components/TextArea/TextArea.d.ts +3 -3
- package/dist/types/components/Toast/Toast.d.ts +11 -11
- package/dist/types/components/Toast/ToastProvider.d.ts +2 -2
- package/dist/types/components/Toast/ToastTitle.d.ts +3 -3
- package/dist/types/components/Toast/ToastViewport.d.ts +3 -3
- package/dist/types/components/Tooltip/Tooltip.d.ts +7 -7
- package/dist/types/index.d.ts +1 -1
- package/dist/types/locales/en-GB.d.ts +3 -0
- package/dist/types/locales/en-US.d.ts +3 -0
- package/dist/types/{locale → locales}/en.d.ts +1 -1
- package/dist/types/locales/fr.d.ts +3 -0
- package/dist/types/locales/index.d.ts +4 -0
- package/dist/types/locales/pt.d.ts +3 -0
- package/dist/types/providers/AlertDialogProvider/AlertDialogProvider.d.ts +2 -2
- package/dist/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +17 -17
- package/dist/types/providers/DocumentTitleProvider/DocumentTitle.d.ts +2 -2
- package/dist/types/providers/DocumentTitleProvider/DocumentTitleProvider.d.ts +2 -2
- package/dist/types/providers/DocumentTitleProvider/DocumentTitleProviderContext.d.ts +2 -3
- package/dist/types/providers/ErrorReportingProvider/ErrorReport.d.ts +2 -2
- package/dist/types/providers/ErrorReportingProvider/ErrorReportingContext.d.ts +3 -3
- package/dist/types/providers/ErrorReportingProvider/ErrorReportingProvider.d.ts +2 -2
- package/dist/types/providers/ErrorReportingProvider/useErrorReporter.d.ts +1 -2
- package/dist/types/providers/LocalizationProvider/LocalizationContext.d.ts +6 -4
- package/dist/types/{locale → providers/LocalizationProvider}/LocalizationObject.d.ts +18 -18
- package/dist/types/providers/LocalizationProvider/LocalizationProvider.d.ts +13 -5
- package/dist/types/providers/LocalizationProvider/index.d.ts +1 -0
- package/dist/types/providers/LocalizationProvider/useLocale.d.ts +6 -3
- package/dist/types/providers/PrefixProvider/PrefixContext.d.ts +1 -4
- package/dist/types/providers/PrefixProvider/PrefixProvider.d.ts +3 -3
- package/dist/types/providers/PrefixProvider/defaultPrefix.d.ts +12 -0
- package/dist/types/providers/PrefixProvider/index.d.ts +1 -0
- package/dist/types/providers/PrefixProvider/usePrefix.d.ts +1 -1
- package/dist/types/providers/ToastManagerProvider/ToastManagerContext.d.ts +7 -7
- package/dist/types/providers/ToastManagerProvider/ToastManagerProvider.d.ts +2 -2
- package/dist/types/utils/control.d.ts +1 -2
- package/dist/types/utils/useCombinedRef.d.ts +2 -2
- package/dist/types/utils/useControllableState.d.ts +2 -2
- package/dist/types/utils/useLayoutEffect.d.ts +2 -2
- package/package.json +20 -4
- package/dist/ostack-ui.cjs +0 -11095
- package/dist/ostack-ui.cjs.map +0 -1
- package/dist/types/locale/defaultLocale.d.ts +0 -3
- package/dist/types/locale/en-GB.d.ts +0 -3
- package/dist/types/locale/en-US.d.ts +0 -3
- package/dist/types/locale/fr-FR.d.ts +0 -3
- package/dist/types/locale/index.d.ts +0 -6
- package/dist/types/locale/pt-PT.d.ts +0 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactElement, type ReactNode } from "react";
|
|
3
3
|
/** Properties of the tooltip component. */
|
|
4
|
-
export interface TooltipProps extends Omit<
|
|
4
|
+
export interface TooltipProps extends Omit<ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, "asChild" | "content" | "forceMount"> {
|
|
5
5
|
/** Tooltip's content. */
|
|
6
|
-
content:
|
|
6
|
+
content: ReactNode;
|
|
7
7
|
/**
|
|
8
8
|
* Whether to show an arrow pointing to the anchor.
|
|
9
9
|
*
|
|
@@ -11,7 +11,7 @@ export interface TooltipProps extends Omit<React.ComponentPropsWithoutRef<typeof
|
|
|
11
11
|
*/
|
|
12
12
|
showArrow?: boolean;
|
|
13
13
|
/** Tooltip's trigger element. */
|
|
14
|
-
children:
|
|
14
|
+
children: ReactElement;
|
|
15
15
|
/** The open state of the tooltip when it is initially rendered. */
|
|
16
16
|
defaultOpen?: boolean;
|
|
17
17
|
/**
|
|
@@ -34,9 +34,9 @@ export interface TooltipProps extends Omit<React.ComponentPropsWithoutRef<typeof
|
|
|
34
34
|
/** Used to force mounting when more control is needed. */
|
|
35
35
|
forceMount?: true;
|
|
36
36
|
/** Properties to pass to the portal component. */
|
|
37
|
-
portalProps?: Omit<
|
|
37
|
+
portalProps?: Omit<ComponentPropsWithRef<typeof TooltipPrimitive.Portal>, "forceMount">;
|
|
38
38
|
/** Properties to pass to the arrow component. */
|
|
39
|
-
arrowProps?:
|
|
39
|
+
arrowProps?: ComponentPropsWithRef<typeof TooltipPrimitive.Arrow>;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* The `Tooltip` component renders a popup that displays information related to
|
|
@@ -52,4 +52,4 @@ export interface TooltipProps extends Omit<React.ComponentPropsWithoutRef<typeof
|
|
|
52
52
|
* please refer to the
|
|
53
53
|
* [docs](https://www.radix-ui.com/primitives/docs/components/tooltip).
|
|
54
54
|
*/
|
|
55
|
-
export declare const Tooltip:
|
|
55
|
+
export declare const Tooltip: import("react").ForwardRefExoticComponent<TooltipProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
/** Properties of the alert dialog provider. */
|
|
3
3
|
export interface AlertDialogProviderProps {
|
|
4
|
-
children:
|
|
4
|
+
children: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
/** Alert dialog provider. */
|
|
7
7
|
export declare function AlertDialogProvider({ children }: AlertDialogProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
import { type AlertDialogBody, type AlertDialogContent, type AlertDialogContentColor, type AlertDialogContentSize, type AlertDialogContentVariant, type AlertDialogDescription, type AlertDialogFooter, type AlertDialogHeader, type AlertDialogTitle } from "../../components/AlertDialog";
|
|
3
3
|
import { type Button } from "../../components/Button";
|
|
4
4
|
/** Options that can be provided to both `alert` and `confirm` alert dialogs. */
|
|
5
5
|
export interface AlertDialogOptions {
|
|
6
6
|
/** Alert dialog's title. */
|
|
7
|
-
title?:
|
|
7
|
+
title?: ReactNode;
|
|
8
8
|
/**
|
|
9
9
|
* Alert dialog content variant.
|
|
10
10
|
*
|
|
@@ -28,35 +28,35 @@ export interface AlertDialogOptions {
|
|
|
28
28
|
/** Alert dialog content size. */
|
|
29
29
|
size?: AlertDialogContentSize;
|
|
30
30
|
/** Alert dialog's extra body content, displayed after the description. */
|
|
31
|
-
extraBodyContent?:
|
|
31
|
+
extraBodyContent?: ReactNode;
|
|
32
32
|
/** Alert dialog's action text. */
|
|
33
|
-
okText?:
|
|
33
|
+
okText?: ReactNode;
|
|
34
34
|
/**
|
|
35
35
|
* Element that caused the alert dialog to be triggered. This element will be
|
|
36
36
|
* automatically focused when the dialog closes.
|
|
37
37
|
*/
|
|
38
38
|
triggerElement?: HTMLElement | null;
|
|
39
39
|
/** Properties to pass to the alert dialog's content component. */
|
|
40
|
-
contentProps?: Omit<
|
|
40
|
+
contentProps?: Omit<ComponentPropsWithoutRef<typeof AlertDialogContent>, "solid" | "color" | "size">;
|
|
41
41
|
/** Properties to pass to the alert dialog's header component. */
|
|
42
|
-
headerProps?:
|
|
42
|
+
headerProps?: ComponentPropsWithRef<typeof AlertDialogHeader>;
|
|
43
43
|
/** Properties to pass to the alert dialog's title component. */
|
|
44
|
-
titleProps?:
|
|
44
|
+
titleProps?: ComponentPropsWithRef<typeof AlertDialogTitle>;
|
|
45
45
|
/** Properties to pass to the alert dialog's body component. */
|
|
46
|
-
bodyProps?:
|
|
46
|
+
bodyProps?: ComponentPropsWithRef<typeof AlertDialogBody>;
|
|
47
47
|
/** Properties to pass to the alert dialog's description component. */
|
|
48
|
-
descriptionProps?:
|
|
48
|
+
descriptionProps?: ComponentPropsWithRef<typeof AlertDialogDescription>;
|
|
49
49
|
/** Properties to pass to the alert dialog's footer component. */
|
|
50
|
-
footerProps?:
|
|
50
|
+
footerProps?: ComponentPropsWithRef<typeof AlertDialogFooter>;
|
|
51
51
|
/** Properties to pass to the alert dialog's OK button component. */
|
|
52
|
-
okButtonProps?: Omit<
|
|
52
|
+
okButtonProps?: Omit<ComponentPropsWithRef<typeof Button>, "onClick">;
|
|
53
53
|
}
|
|
54
54
|
/** Options that can be provided to a `confirm` alert dialog. */
|
|
55
55
|
export interface ConfirmDialogOptions extends AlertDialogOptions {
|
|
56
56
|
/** Alert dialog's cancel text. */
|
|
57
|
-
cancelText?:
|
|
57
|
+
cancelText?: ReactNode;
|
|
58
58
|
/** Properties to pass to the alert dialog's cancel button component. */
|
|
59
|
-
cancelButtonProps?: Omit<
|
|
59
|
+
cancelButtonProps?: Omit<ComponentPropsWithRef<typeof Button>, "onClick">;
|
|
60
60
|
}
|
|
61
61
|
/** Value of the alert dialog context. */
|
|
62
62
|
export interface AlertDialogProviderContextValue {
|
|
@@ -72,7 +72,7 @@ export interface AlertDialogProviderContextValue {
|
|
|
72
72
|
* @returns A promise that resolves with the value called in `resolve`, or
|
|
73
73
|
* `undefined` if the dialog was closed for another reason.
|
|
74
74
|
*/
|
|
75
|
-
prompt: <T>(renderContent: (resolve: (value?: T | PromiseLike<T>) => void) =>
|
|
75
|
+
prompt: <T>(renderContent: (resolve: (value?: T | PromiseLike<T>) => void) => ReactNode) => Promise<T | undefined>;
|
|
76
76
|
/**
|
|
77
77
|
* Displays an alert (similar to the browser's `alert`, but non-blocking) via
|
|
78
78
|
* an alert dialog.
|
|
@@ -81,7 +81,7 @@ export interface AlertDialogProviderContextValue {
|
|
|
81
81
|
* @param dialogOptions Dialog options.
|
|
82
82
|
* @returns A promise that resolves once the dialog has been dismissed.
|
|
83
83
|
*/
|
|
84
|
-
alert: (description:
|
|
84
|
+
alert: (description: ReactNode, dialogOptions?: AlertDialogOptions) => Promise<void>;
|
|
85
85
|
/**
|
|
86
86
|
* Displays a confirmation dialog (similar to the browser's `confirm` but
|
|
87
87
|
* non-blocking) via an alert dialog.
|
|
@@ -91,7 +91,7 @@ export interface AlertDialogProviderContextValue {
|
|
|
91
91
|
* @returns A promise that resolves with a boolean representing whether the
|
|
92
92
|
* dialog has been confirmed or cancelled.
|
|
93
93
|
*/
|
|
94
|
-
confirm: (description:
|
|
94
|
+
confirm: (description: ReactNode, dialogOptions?: ConfirmDialogOptions) => Promise<boolean>;
|
|
95
95
|
}
|
|
96
96
|
/** Alert dialog context. */
|
|
97
|
-
export declare const AlertDialogProviderContext:
|
|
97
|
+
export declare const AlertDialogProviderContext: import("react").Context<AlertDialogProviderContextValue | undefined>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
/** Properties of the document title component. */
|
|
3
3
|
export interface DocumentTitleProps {
|
|
4
4
|
/** Title to set as a breadcrumb of the document title. */
|
|
5
5
|
title?: string;
|
|
6
|
-
children:
|
|
6
|
+
children: ReactNode;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Component used to set the provided title as a breadcrumb of the document
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
/** Properties of the document title provider. */
|
|
3
3
|
export interface DocumentTitleProviderProps {
|
|
4
4
|
/** Base document title. Defaults to the existing document title at load time. */
|
|
@@ -15,7 +15,7 @@ export interface DocumentTitleProviderProps {
|
|
|
15
15
|
* @default " ‹ "
|
|
16
16
|
*/
|
|
17
17
|
breadcrumbsSeparator?: string;
|
|
18
|
-
children:
|
|
18
|
+
children: ReactNode;
|
|
19
19
|
}
|
|
20
20
|
/** Default base separator. */
|
|
21
21
|
export declare const DEFAULT_DOCUMENT_TITLE_BASE_SEPARATOR = " | ";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
/** Value of the document title provider context. */
|
|
3
2
|
export interface DocumentTitleProviderContextValue {
|
|
4
3
|
baseDocumentTitle: string | null;
|
|
@@ -6,7 +5,7 @@ export interface DocumentTitleProviderContextValue {
|
|
|
6
5
|
breadcrumbsSeparator: string;
|
|
7
6
|
}
|
|
8
7
|
/** Document title provider context. */
|
|
9
|
-
export declare const DocumentTitleProviderContext:
|
|
8
|
+
export declare const DocumentTitleProviderContext: import("react").Context<DocumentTitleProviderContextValue | null>;
|
|
10
9
|
/** State of the document title component. */
|
|
11
10
|
export interface DocumentTitleState {
|
|
12
11
|
breadcrumbs: string[];
|
|
@@ -21,7 +20,7 @@ export interface DocumentTitleActions {
|
|
|
21
20
|
/** Document title store. */
|
|
22
21
|
export type DocumentTitleStore = ReturnType<typeof useCreateDocumentTitleStore>;
|
|
23
22
|
/** Document title context. */
|
|
24
|
-
export declare const DocumentTitleContext:
|
|
23
|
+
export declare const DocumentTitleContext: import("react").Context<(Omit<import("zustand").StoreApi<DocumentTitleState>, "subscribe"> & {
|
|
25
24
|
subscribe: {
|
|
26
25
|
(listener: (selectedState: DocumentTitleState, previousSelectedState: DocumentTitleState) => void): () => void;
|
|
27
26
|
<U>(selector: (state: DocumentTitleState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ErrorInfo } from "react";
|
|
2
2
|
/** Error report. */
|
|
3
3
|
export interface ErrorReport {
|
|
4
4
|
/** Hash of the error information, providing a unique identifier for the error. */
|
|
@@ -32,4 +32,4 @@ export interface ErrorReport {
|
|
|
32
32
|
* @param info Optional React error information.
|
|
33
33
|
* @returns Error report.
|
|
34
34
|
*/
|
|
35
|
-
export declare function buildErrorReport(error: unknown, info?:
|
|
35
|
+
export declare function buildErrorReport(error: unknown, info?: ErrorInfo): ErrorReport;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ErrorInfo } from "react";
|
|
2
2
|
/** Value of the error reporting context. */
|
|
3
3
|
export interface ErrorReportingContextValue {
|
|
4
|
-
onError: (error: Error, info?:
|
|
4
|
+
onError: (error: Error, info?: ErrorInfo) => void;
|
|
5
5
|
}
|
|
6
6
|
/** Error reporting context. */
|
|
7
|
-
export declare const ErrorReportingContext:
|
|
7
|
+
export declare const ErrorReportingContext: import("react").Context<ErrorReportingContextValue | null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import { type ErrorReport } from "./ErrorReport.ts";
|
|
3
3
|
/** Properties of the error reporting provider. */
|
|
4
4
|
export interface ErrorReportingProviderProps {
|
|
@@ -58,7 +58,7 @@ export interface ErrorReportingProviderProps {
|
|
|
58
58
|
* This property is ignored when a custom `reportError` is provided.
|
|
59
59
|
*/
|
|
60
60
|
errorReportingOptions?: Omit<RequestInit, "method" | "body">;
|
|
61
|
-
children?:
|
|
61
|
+
children?: ReactNode;
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Provider used to report errors caught in error boundaries throughout the
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type LocalizationObject } from "../../locale/LocalizationObject.ts";
|
|
1
|
+
import { type LocalizationObject } from "./LocalizationObject.ts";
|
|
3
2
|
/** Value of the localisation context. */
|
|
4
|
-
export
|
|
3
|
+
export interface LocalizationContextValue {
|
|
4
|
+
locale: LocalizationObject;
|
|
5
|
+
setLocale: (locale: LocalizationObject) => void;
|
|
6
|
+
}
|
|
5
7
|
/** Localisation context. */
|
|
6
|
-
export declare const LocalizationContext:
|
|
8
|
+
export declare const LocalizationContext: import("react").Context<LocalizationContextValue | null>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { type Locale as DateFnsLocale } from "date-fns";
|
|
2
|
-
import { type CalendarProps } from "
|
|
3
|
-
import { type CloseButtonProps } from "
|
|
4
|
-
import { type CommandMenuDialogProps, type CommandMenuProps } from "
|
|
5
|
-
import { type ControlCodeProps } from "
|
|
6
|
-
import { type DataTableContentProps, type DataTableFilterProps, type DataTablePaginationProps, type DataTableRowsPerPageProps } from "
|
|
7
|
-
import { type DateInputProps } from "
|
|
8
|
-
import { type DateRangeInputProps } from "
|
|
9
|
-
import { type ErrorBoundaryProps } from "
|
|
10
|
-
import { type FeedbackProps } from "
|
|
11
|
-
import { type FeedbackPopoverProps } from "
|
|
12
|
-
import { type FieldGroupHeaderProps } from "
|
|
13
|
-
import { type InputProps } from "
|
|
14
|
-
import { type LabelProps } from "
|
|
15
|
-
import { type NumericInputProps } from "
|
|
16
|
-
import { type SelectProps } from "
|
|
17
|
-
import { type TableColumnProps, type TableHeadProps } from "
|
|
18
|
-
import { type ToastProviderProps, type ToastViewportProps } from "
|
|
19
|
-
import { type ConfirmDialogOptions } from "../
|
|
2
|
+
import { type CalendarProps } from "../../components/Calendar";
|
|
3
|
+
import { type CloseButtonProps } from "../../components/CloseButton";
|
|
4
|
+
import { type CommandMenuDialogProps, type CommandMenuProps } from "../../components/CommandMenu";
|
|
5
|
+
import { type ControlCodeProps } from "../../components/ControlCode";
|
|
6
|
+
import { type DataTableContentProps, type DataTableFilterProps, type DataTablePaginationProps, type DataTableRowsPerPageProps } from "../../components/DataTable";
|
|
7
|
+
import { type DateInputProps } from "../../components/DateInput";
|
|
8
|
+
import { type DateRangeInputProps } from "../../components/DateRangeInput";
|
|
9
|
+
import { type ErrorBoundaryProps } from "../../components/ErrorBoundary";
|
|
10
|
+
import { type FeedbackProps } from "../../components/Feedback";
|
|
11
|
+
import { type FeedbackPopoverProps } from "../../components/FeedbackPopover";
|
|
12
|
+
import { type FieldGroupHeaderProps } from "../../components/FieldGroup";
|
|
13
|
+
import { type InputProps } from "../../components/Input";
|
|
14
|
+
import { type LabelProps } from "../../components/Label";
|
|
15
|
+
import { type NumericInputProps } from "../../components/NumericInput";
|
|
16
|
+
import { type SelectProps } from "../../components/Select";
|
|
17
|
+
import { type TableColumnProps, type TableHeadProps } from "../../components/Table";
|
|
18
|
+
import { type ToastProviderProps, type ToastViewportProps } from "../../components/Toast";
|
|
19
|
+
import { type ConfirmDialogOptions } from "../AlertDialogProvider";
|
|
20
20
|
/** Localization object representation. */
|
|
21
21
|
export interface LocalizationObject {
|
|
22
22
|
languageTag: string;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type LocalizationObject } from "
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type LocalizationObject } from "./LocalizationObject.ts";
|
|
3
3
|
/** Properties of the localisation provider. */
|
|
4
4
|
export interface LocalizationProviderProps {
|
|
5
|
-
/**
|
|
5
|
+
/** Uncontrolled locale to use. */
|
|
6
|
+
defaultLocale?: LocalizationObject;
|
|
7
|
+
/** Controlled locale to use. */
|
|
6
8
|
locale?: LocalizationObject;
|
|
7
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Function called when the locale changes.
|
|
11
|
+
*
|
|
12
|
+
* @param locale New locale.
|
|
13
|
+
*/
|
|
14
|
+
onLocaleChange?: (locale: LocalizationObject) => void;
|
|
15
|
+
children: ReactNode;
|
|
8
16
|
}
|
|
9
17
|
/** Localisation provider. */
|
|
10
|
-
export declare function LocalizationProvider({ locale, children, }: LocalizationProviderProps): string | number | bigint | boolean | Iterable<
|
|
18
|
+
export declare function LocalizationProvider({ defaultLocale, locale: controlledLocale, onLocaleChange, children, }: LocalizationProviderProps): 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-runtime").JSX.Element | null | undefined;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { type LocalizationObject } from "
|
|
2
|
-
/** Hook used to get the current locale. */
|
|
3
|
-
export declare function useLocale():
|
|
1
|
+
import { type LocalizationObject } from "./LocalizationObject.ts";
|
|
2
|
+
/** Hook used to get and set the current locale. */
|
|
3
|
+
export declare function useLocale(): [
|
|
4
|
+
LocalizationObject,
|
|
5
|
+
(locale: LocalizationObject) => void
|
|
6
|
+
];
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** Default library prefix. */
|
|
3
|
-
export declare const DEFAULT_PREFIX = "o-ui-";
|
|
4
1
|
/** Prefix context. */
|
|
5
|
-
export declare const PrefixContext:
|
|
2
|
+
export declare const PrefixContext: import("react").Context<string | null>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
/** Properties of the prefix provider. */
|
|
3
3
|
export interface PrefixProviderProps {
|
|
4
4
|
/** Prefix to use. */
|
|
5
5
|
prefix?: string;
|
|
6
|
-
children:
|
|
6
|
+
children: ReactNode;
|
|
7
7
|
}
|
|
8
8
|
/** Prefix provider. */
|
|
9
|
-
export declare function PrefixProvider({ prefix, children }: PrefixProviderProps): string | number | bigint | boolean | Iterable<
|
|
9
|
+
export declare function PrefixProvider({ prefix, children }: PrefixProviderProps): 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-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Store holding the default prefix. */
|
|
2
|
+
export declare const defaultPrefixStore: import("zustand").StoreApi<{
|
|
3
|
+
defaultPrefix: string;
|
|
4
|
+
}>;
|
|
5
|
+
/**
|
|
6
|
+
* Function used to set the default library's prefix. The default library prefix
|
|
7
|
+
* can be overridden by providing a `prefix` property to the `PrefixProvider` or
|
|
8
|
+
* `Root` components.
|
|
9
|
+
*
|
|
10
|
+
* @param defaultPrefix Prefix to set as the library's default.
|
|
11
|
+
*/
|
|
12
|
+
export declare function setDefaultPrefix(defaultPrefix: string): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Function which prefixes the provided `toPrefix` string. If no argument is
|
|
3
3
|
* provided, the prefix is returned as-is.
|
|
4
4
|
*/
|
|
5
|
-
export type PrefixFn = (toPrefix
|
|
5
|
+
export type PrefixFn = (toPrefix?: string) => string;
|
|
6
6
|
/**
|
|
7
7
|
* Hook which returns a function which can be used to prefix a string with the
|
|
8
8
|
* current prefix.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
import { type Toast, type ToastDescription, type ToastTitle } from "../../components/Toast";
|
|
3
3
|
import { type DistributedOmit } from "../../utils/typeUtils.ts";
|
|
4
4
|
/** Toast options. */
|
|
5
|
-
export type ToastOptions = DistributedOmit<
|
|
5
|
+
export type ToastOptions = DistributedOmit<ComponentPropsWithRef<typeof Toast>, "defaultOpen" | "open" | "title"> & {
|
|
6
6
|
/** Toast's title. */
|
|
7
|
-
title?:
|
|
7
|
+
title?: ReactNode;
|
|
8
8
|
/** HTML `title` prop. */
|
|
9
9
|
htmlTitle?: string;
|
|
10
10
|
/** Properties to pass to the title component. */
|
|
11
|
-
titleProps?:
|
|
11
|
+
titleProps?: ComponentPropsWithRef<typeof ToastTitle>;
|
|
12
12
|
/** Properties to pass to the description component. */
|
|
13
|
-
descriptionProps?:
|
|
13
|
+
descriptionProps?: ComponentPropsWithRef<typeof ToastDescription>;
|
|
14
14
|
};
|
|
15
15
|
/** Toast identifier. */
|
|
16
16
|
export type ToastId = number;
|
|
@@ -23,7 +23,7 @@ export interface ToastManagerContextValue {
|
|
|
23
23
|
* @param toastOptions Toast's options.
|
|
24
24
|
* @returns Toast's unique identifier.
|
|
25
25
|
*/
|
|
26
|
-
addToast: (description:
|
|
26
|
+
addToast: (description: ReactNode, toastOptions?: ToastOptions) => ToastId;
|
|
27
27
|
/**
|
|
28
28
|
* Removes an existing toast with the given identifier.
|
|
29
29
|
*
|
|
@@ -32,4 +32,4 @@ export interface ToastManagerContextValue {
|
|
|
32
32
|
removeToast: (toastId: ToastId) => void;
|
|
33
33
|
}
|
|
34
34
|
/** Toast manager context. */
|
|
35
|
-
export declare const ToastManagerContext:
|
|
35
|
+
export declare const ToastManagerContext: import("react").Context<ToastManagerContextValue | undefined>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { type AccentColor } from "./accent.ts";
|
|
3
2
|
/** Possible status of a control. */
|
|
4
3
|
export type ControlStatus = "valid" | "invalid" | "warned";
|
|
@@ -16,7 +15,7 @@ export interface ControlContextValue {
|
|
|
16
15
|
readOnly?: boolean;
|
|
17
16
|
}
|
|
18
17
|
/** Control context. */
|
|
19
|
-
export declare const ControlContext:
|
|
18
|
+
export declare const ControlContext: import("react").Context<ControlContextValue | null>;
|
|
20
19
|
/** Hook providing access to the control context. */
|
|
21
20
|
export declare function useControlContext(): ControlContextValue | null;
|
|
22
21
|
/** Transforms a control status into a colour accent. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Ref as ReactRef, type RefCallback } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Combines multiple references into a single stable callback reference while
|
|
4
4
|
* respecting React's rules for references.
|
|
@@ -6,4 +6,4 @@ import * as React from "react";
|
|
|
6
6
|
* @param refs References to combine.
|
|
7
7
|
* @returns Stable callback reference.
|
|
8
8
|
*/
|
|
9
|
-
export declare function useCombinedRef<T>(...refs: (
|
|
9
|
+
export declare function useCombinedRef<T>(...refs: (ReactRef<T> | undefined)[]): RefCallback<T>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
|
2
2
|
/** Helper hook to handle controlled or uncontrolled values. */
|
|
3
|
-
export declare function useControllableState<T>(initialValue: T | (() => T), controlledValue: T | undefined): [T,
|
|
3
|
+
export declare function useControllableState<T>(initialValue: T | (() => T), controlledValue: T | undefined): [T, Dispatch<SetStateAction<T>>];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useLayoutEffect as reactUseLayoutEffect } from "react";
|
|
2
2
|
/** `useLayoutEffect` hook which performs a noop when run on the server. */
|
|
3
|
-
export declare const useLayoutEffect: typeof
|
|
3
|
+
export declare const useLayoutEffect: typeof reactUseLayoutEffect;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ostack.tech/ui",
|
|
3
3
|
"description": "ostack/UI component library.",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"homepage": "https://ui.ostack.tech/",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Opensoft",
|
|
@@ -16,21 +16,37 @@
|
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">=10"
|
|
18
18
|
},
|
|
19
|
-
"main": "dist/ostack-ui.
|
|
19
|
+
"main": "dist/ostack-ui.js",
|
|
20
20
|
"types": "dist/types/index.d.ts",
|
|
21
21
|
"sass": "scss/index.scss",
|
|
22
22
|
"style": "dist/ostack-ui.css",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
25
|
"types": "./dist/types/index.d.ts",
|
|
26
|
-
"import": "./dist/ostack-ui.js"
|
|
27
|
-
|
|
26
|
+
"import": "./dist/ostack-ui.js"
|
|
27
|
+
},
|
|
28
|
+
"./locales/en-GB": {
|
|
29
|
+
"types": "./dist/types/locales/en-GB.d.ts",
|
|
30
|
+
"import": "./dist/locales/en-GB.js"
|
|
31
|
+
},
|
|
32
|
+
"./locales/en-US": {
|
|
33
|
+
"types": "./dist/types/locales/en-US.d.ts",
|
|
34
|
+
"import": "./dist/locales/en-US.js"
|
|
35
|
+
},
|
|
36
|
+
"./locales/fr": {
|
|
37
|
+
"types": "./dist/types/locales/fr.d.ts",
|
|
38
|
+
"import": "./dist/locales/fr.js"
|
|
39
|
+
},
|
|
40
|
+
"./locales/pt": {
|
|
41
|
+
"types": "./dist/types/locales/pt.d.ts",
|
|
42
|
+
"import": "./dist/locales/pt.js"
|
|
28
43
|
},
|
|
29
44
|
"./css": "./dist/ostack-ui.css",
|
|
30
45
|
"./scss": "./scss/index.scss",
|
|
31
46
|
"./scss/*": "./scss/*",
|
|
32
47
|
"./package.json": "./package.json"
|
|
33
48
|
},
|
|
49
|
+
"sideEffects": false,
|
|
34
50
|
"files": [
|
|
35
51
|
"dist/",
|
|
36
52
|
"scss/"
|