@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
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef, type CSSProperties, type ReactElement } from "react";
|
|
2
2
|
import { type Responsive } from "../../utils/useResponsiveValues.ts";
|
|
3
3
|
/** Possible stack directions. */
|
|
4
4
|
export type FlexDirection = "column" | "column-reverse" | "row" | "row-reverse";
|
|
5
5
|
/** Properties of the stack component. */
|
|
6
|
-
export interface StackProps extends
|
|
6
|
+
export interface StackProps extends ComponentPropsWithoutRef<"div"> {
|
|
7
7
|
/**
|
|
8
8
|
* Change the component to the HTML tag or custom component of the only child.
|
|
9
9
|
* This will merge the original component props with the props of the supplied
|
|
@@ -24,11 +24,11 @@ export interface StackProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
|
24
24
|
*/
|
|
25
25
|
gap?: Responsive<number | string>;
|
|
26
26
|
/** Adds a divider between elements. */
|
|
27
|
-
divider?:
|
|
28
|
-
justifyContent?: Responsive<
|
|
29
|
-
alignItems?: Responsive<
|
|
30
|
-
alignContent?: Responsive<
|
|
31
|
-
wrap?: Responsive<
|
|
27
|
+
divider?: ReactElement;
|
|
28
|
+
justifyContent?: Responsive<CSSProperties["justifyContent"]>;
|
|
29
|
+
alignItems?: Responsive<CSSProperties["alignItems"]>;
|
|
30
|
+
alignContent?: Responsive<CSSProperties["alignContent"]>;
|
|
31
|
+
wrap?: Responsive<CSSProperties["flexWrap"]>;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* The Stack component manages the layout of immediate children along the
|
|
@@ -39,4 +39,4 @@ export interface StackProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
|
39
39
|
* owl](https://css-tricks.com/lobotomized-owls/) selector (`* + *`) for
|
|
40
40
|
* spacing.
|
|
41
41
|
*/
|
|
42
|
-
export declare const Stack:
|
|
42
|
+
export declare const Stack: import("react").ForwardRefExoticComponent<StackProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef } from "react";
|
|
3
3
|
import { type ControlStatus } from "../../utils/control.ts";
|
|
4
4
|
import { Label } from "../Label";
|
|
5
5
|
/** Properties of the step component. */
|
|
6
|
-
export interface StepProps extends Omit<
|
|
6
|
+
export interface StepProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.TabsTrigger>, "asChild" | "value"> {
|
|
7
7
|
/** Index of the step. */
|
|
8
8
|
index?: number;
|
|
9
9
|
/** Status of the step. */
|
|
10
10
|
status?: ControlStatus;
|
|
11
11
|
/** Properties to pass to the container element. */
|
|
12
|
-
containerProps?:
|
|
12
|
+
containerProps?: ComponentPropsWithRef<"div">;
|
|
13
13
|
/** Properties to pass to the step's label component. */
|
|
14
|
-
labelProps?: Omit<
|
|
14
|
+
labelProps?: Omit<ComponentPropsWithRef<typeof Label>, "htmlFor">;
|
|
15
15
|
}
|
|
16
16
|
/** Step trigger component. */
|
|
17
|
-
export declare const Step:
|
|
17
|
+
export declare const Step: import("react").ForwardRefExoticComponent<StepProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
3
|
/** Properties of the step content component. */
|
|
4
|
-
export interface StepContentProps extends Omit<
|
|
4
|
+
export interface StepContentProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.TabsContent>, "value"> {
|
|
5
5
|
/** Index of the step that corresponds to this content. */
|
|
6
6
|
index: number;
|
|
7
7
|
}
|
|
8
8
|
/** Step content component. */
|
|
9
|
-
export declare const StepContent:
|
|
9
|
+
export declare const StepContent: import("react").ForwardRefExoticComponent<StepContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
3
|
/** Properties of the step list component. */
|
|
4
|
-
export interface StepListProps extends
|
|
4
|
+
export interface StepListProps extends ComponentPropsWithoutRef<typeof TabsPrimitive.List> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Component containing the list of steps.
|
|
@@ -9,4 +9,4 @@ export interface StepListProps extends React.ComponentPropsWithoutRef<typeof Tab
|
|
|
9
9
|
* The `index` of each `Step` is automatically added when `Step`s are direct
|
|
10
10
|
* children of `StepList`.
|
|
11
11
|
*/
|
|
12
|
-
export declare const StepList:
|
|
12
|
+
export declare const StepList: import("react").ForwardRefExoticComponent<StepListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from "react";
|
|
3
3
|
/** Properties of the stepper component. */
|
|
4
|
-
export interface StepperProps extends Omit<
|
|
4
|
+
export interface StepperProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Root>, "defaultValue" | "value" | "onValueChange" | "orientation" | "dir" | "children"> {
|
|
5
5
|
/**
|
|
6
6
|
* Index of the default active step.
|
|
7
7
|
*
|
|
@@ -17,8 +17,8 @@ export interface StepperProps extends Omit<React.ComponentPropsWithoutRef<typeof
|
|
|
17
17
|
*/
|
|
18
18
|
onActiveStepChange?: (newActiveStep: number) => void;
|
|
19
19
|
/** Reference to interact with the stepper's API. */
|
|
20
|
-
apiRef?:
|
|
21
|
-
children?:
|
|
20
|
+
apiRef?: Ref<StepperApi | undefined>;
|
|
21
|
+
children?: ReactNode | ((api: StepperApi) => ReactNode);
|
|
22
22
|
}
|
|
23
23
|
export interface StepperApi {
|
|
24
24
|
/** Currently active step. */
|
|
@@ -56,4 +56,4 @@ export interface StepperApi {
|
|
|
56
56
|
* - `goTo`: Provides direct access to a specific step. While not used in all
|
|
57
57
|
* implementations, it adds flexibility for custom navigation flows.
|
|
58
58
|
*/
|
|
59
|
-
export declare const Stepper:
|
|
59
|
+
export declare const Stepper: import("react").ForwardRefExoticComponent<StepperProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
/** Value of the stepper's context. */
|
|
3
2
|
export interface StepperContextValue {
|
|
4
3
|
activeStep: number;
|
|
5
4
|
}
|
|
6
5
|
/** Stepper's context. */
|
|
7
|
-
export declare const StepperContext:
|
|
6
|
+
export declare const StepperContext: import("react").Context<StepperContextValue | null>;
|
|
8
7
|
/** Hook exposing the stepper's context. */
|
|
9
8
|
export declare function useStepperContext(): StepperContextValue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type CSSProperties } from "react";
|
|
2
2
|
import { type ControlStatus } from "../../utils/control.ts";
|
|
3
3
|
/** Default column width in `"fixed"` mode. */
|
|
4
4
|
export declare const DEFAULT_TABLE_COLUMN_WIDTH = 150;
|
|
@@ -7,7 +7,7 @@ export type TableVariant = "default" | "control";
|
|
|
7
7
|
/** Possible table layouts. */
|
|
8
8
|
export type TableLayout = "auto" | "fixed";
|
|
9
9
|
/** Properties of the table component. */
|
|
10
|
-
export interface TableProps extends
|
|
10
|
+
export interface TableProps extends ComponentPropsWithoutRef<"table"> {
|
|
11
11
|
/**
|
|
12
12
|
* Marks the table as being meant for editable content (cells containing form
|
|
13
13
|
* controls).
|
|
@@ -49,9 +49,9 @@ export interface TableProps extends React.ComponentPropsWithoutRef<"table"> {
|
|
|
49
49
|
*/
|
|
50
50
|
defaultColumnWidth?: number;
|
|
51
51
|
/** Sets the maximum height of the table. */
|
|
52
|
-
maxHeight?:
|
|
52
|
+
maxHeight?: CSSProperties["maxHeight"];
|
|
53
53
|
/** Properties to pass to the container element. */
|
|
54
|
-
containerProps?:
|
|
54
|
+
containerProps?: ComponentPropsWithRef<"div">;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Use the table component to display structured data in a tabular format.
|
|
@@ -119,4 +119,4 @@ export interface TableProps extends React.ComponentPropsWithoutRef<"table"> {
|
|
|
119
119
|
* }
|
|
120
120
|
* ```
|
|
121
121
|
*/
|
|
122
|
-
export declare const Table:
|
|
122
|
+
export declare const Table: import("react").ForwardRefExoticComponent<TableProps & import("react").RefAttributes<HTMLTableElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
2
|
/** Properties of the table body component. */
|
|
3
|
-
export interface TableBodyProps extends
|
|
3
|
+
export interface TableBodyProps extends ComponentPropsWithoutRef<"tbody"> {
|
|
4
4
|
}
|
|
5
5
|
/** Table body component. */
|
|
6
|
-
export declare const TableBody:
|
|
6
|
+
export declare const TableBody: import("react").ForwardRefExoticComponent<TableBodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef, type CSSProperties } from "react";
|
|
2
2
|
import { type ControlStatus } from "../../utils/control.ts";
|
|
3
3
|
/** Type of table cell. */
|
|
4
4
|
export type TableCellVariant = "header" | "data";
|
|
5
5
|
/** Sticky position of the table cell. */
|
|
6
6
|
export type TableCellSticky = "left" | "right";
|
|
7
7
|
/** Properties of the table row component. */
|
|
8
|
-
export interface TableCellProps extends Omit<
|
|
8
|
+
export interface TableCellProps extends Omit<ComponentPropsWithoutRef<"td" | "th">, "align"> {
|
|
9
9
|
/**
|
|
10
10
|
* Whether this cell should be rendered as a table header cell (`th` element).
|
|
11
11
|
* By default, `true` within a `TableHead` component, and `false` otherwise.
|
|
@@ -15,7 +15,7 @@ export interface TableCellProps extends Omit<React.ComponentPropsWithoutRef<"td"
|
|
|
15
15
|
* Specifies how to align the cell's content. Numeric fields should typically
|
|
16
16
|
* be right aligned.
|
|
17
17
|
*/
|
|
18
|
-
align?:
|
|
18
|
+
align?: CSSProperties["textAlign"];
|
|
19
19
|
/**
|
|
20
20
|
* Style variant to use. By default, defaults to `"header"` when the cell is a
|
|
21
21
|
* `header`, and to `"data"` otherwise.
|
|
@@ -42,4 +42,4 @@ export interface TableCellProps extends Omit<React.ComponentPropsWithoutRef<"td"
|
|
|
42
42
|
sticky?: TableCellSticky;
|
|
43
43
|
}
|
|
44
44
|
/** Table row component. */
|
|
45
|
-
export declare const TableCell:
|
|
45
|
+
export declare const TableCell: import("react").ForwardRefExoticComponent<TableCellProps & import("react").RefAttributes<HTMLTableDataCellElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
import { type SortDirection } from "../../utils/sorting.ts";
|
|
3
3
|
import { type Button } from "../Button";
|
|
4
4
|
import { type Icon } from "../Icon";
|
|
@@ -7,13 +7,13 @@ import { type Popover, type PopoverContent } from "../Popover";
|
|
|
7
7
|
import { type Stack } from "../Stack";
|
|
8
8
|
import { type TableCell } from "./TableCell.tsx";
|
|
9
9
|
/** Properties of a table column. */
|
|
10
|
-
export interface TableColumnProps extends Omit<
|
|
10
|
+
export interface TableColumnProps extends Omit<ComponentPropsWithoutRef<typeof TableCell>, "rowSpan" | "scope"> {
|
|
11
11
|
/** Column's label. */
|
|
12
|
-
label?:
|
|
12
|
+
label?: ReactNode;
|
|
13
13
|
/** String representation of the label (defaults to `label`). */
|
|
14
14
|
labelText?: string;
|
|
15
15
|
/** Optional helper text displayed as a popover triggered by an icon button. */
|
|
16
|
-
helperText?:
|
|
16
|
+
helperText?: ReactNode;
|
|
17
17
|
/** Label of the helper button announced to assistive technologies. */
|
|
18
18
|
helperButtonLabel?: string;
|
|
19
19
|
/**
|
|
@@ -55,23 +55,23 @@ export interface TableColumnProps extends Omit<React.ComponentPropsWithoutRef<ty
|
|
|
55
55
|
*/
|
|
56
56
|
onSort?: (direction: SortDirection | null) => void;
|
|
57
57
|
/** Properties to pass to the container component. */
|
|
58
|
-
containerProps?:
|
|
58
|
+
containerProps?: ComponentPropsWithRef<typeof Stack>;
|
|
59
59
|
/** Properties to pass to the label component. */
|
|
60
|
-
labelProps?:
|
|
60
|
+
labelProps?: ComponentPropsWithRef<"div">;
|
|
61
61
|
/** Properties to pass to the sort button. */
|
|
62
|
-
sortButtonProps?:
|
|
62
|
+
sortButtonProps?: ComponentPropsWithRef<typeof Button>;
|
|
63
63
|
/** Properties to pass to the component containing the sort icons. */
|
|
64
|
-
sortIconContainerProps?:
|
|
64
|
+
sortIconContainerProps?: ComponentPropsWithRef<"div">;
|
|
65
65
|
/** Properties to pass to the sort ascending icon component. */
|
|
66
|
-
sortAscIconProps?:
|
|
66
|
+
sortAscIconProps?: ComponentPropsWithRef<typeof Icon>;
|
|
67
67
|
/** Properties to pass to the sort descending icon component. */
|
|
68
|
-
sortDescIconProps?:
|
|
68
|
+
sortDescIconProps?: ComponentPropsWithRef<typeof Icon>;
|
|
69
69
|
/** Properties to pass to the helper button component. */
|
|
70
|
-
helperButtonProps?: Omit<
|
|
70
|
+
helperButtonProps?: Omit<ComponentPropsWithRef<typeof IconButton>, "icon">;
|
|
71
71
|
/** Properties to pass to the helper popover component. */
|
|
72
|
-
helperPopoverProps?:
|
|
72
|
+
helperPopoverProps?: ComponentPropsWithRef<typeof Popover>;
|
|
73
73
|
/** Properties to pass to the helper popover content component. */
|
|
74
|
-
helperPopoverContentProps?:
|
|
74
|
+
helperPopoverContentProps?: ComponentPropsWithRef<typeof PopoverContent>;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* Table column component.
|
|
@@ -80,4 +80,4 @@ export interface TableColumnProps extends Omit<React.ComponentPropsWithoutRef<ty
|
|
|
80
80
|
* `TableHead` component to automatically create an appropriate header based on
|
|
81
81
|
* the columns.
|
|
82
82
|
*/
|
|
83
|
-
export declare const TableColumn:
|
|
83
|
+
export declare const TableColumn: import("react").ForwardRefExoticComponent<TableColumnProps & import("react").RefAttributes<HTMLTableDataCellElement>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { type ControlStatus } from "../../utils/control.ts";
|
|
3
2
|
import { type ScrollPosition } from "../../utils/useScrollPosition.ts";
|
|
4
3
|
import { type TableLayout } from "./Table.tsx";
|
|
@@ -25,7 +24,7 @@ export interface TableActions {
|
|
|
25
24
|
/** Table store. */
|
|
26
25
|
export type TableStore = ReturnType<typeof useCreateTableContext>["store"];
|
|
27
26
|
/** Table context. */
|
|
28
|
-
export declare const TableContext:
|
|
27
|
+
export declare const TableContext: import("react").Context<TableContextValue | null>;
|
|
29
28
|
/** Hook which creates the table store. */
|
|
30
29
|
export declare function useCreateTableContext(editable: boolean, status: ControlStatus | undefined, layout: TableLayout, defaultColumnWidth: number, onTableMinWidthChange: (minWidth: string | undefined) => void, onTableMaxWidthChange: (maxWidth: string | undefined) => void): {
|
|
31
30
|
editable: boolean;
|
|
@@ -47,14 +46,14 @@ export declare function useTableContext(): TableContextValue;
|
|
|
47
46
|
/** Hook returning the number of columns of the table. */
|
|
48
47
|
export declare function useTableNumberOfColumns(): number | undefined;
|
|
49
48
|
/** Table head context. */
|
|
50
|
-
export declare const TableHeadContext:
|
|
49
|
+
export declare const TableHeadContext: import("react").Context<boolean>;
|
|
51
50
|
/** Hook exposing whether a component is being rendered within a table head. */
|
|
52
51
|
export declare function useIsInTableHead(): boolean;
|
|
53
52
|
/** Table foot context. */
|
|
54
|
-
export declare const TableFootContext:
|
|
53
|
+
export declare const TableFootContext: import("react").Context<boolean>;
|
|
55
54
|
/** Hook exposing whether a component is being rendered within a table foot. */
|
|
56
55
|
export declare function useIsInTableFoot(): boolean;
|
|
57
56
|
/** Context present within a table cell. */
|
|
58
|
-
export declare const TableCellContext:
|
|
57
|
+
export declare const TableCellContext: import("react").Context<boolean>;
|
|
59
58
|
/** Hook exposing whether a component is being rendered within a table cell. */
|
|
60
59
|
export declare function useIsInTableCell(): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
2
|
/** Properties of the table foot component. */
|
|
3
|
-
export interface TableFootProps extends
|
|
3
|
+
export interface TableFootProps extends ComponentPropsWithoutRef<"tfoot"> {
|
|
4
4
|
/**
|
|
5
5
|
* Whether the table foot should be sticky.
|
|
6
6
|
*
|
|
@@ -9,4 +9,4 @@ export interface TableFootProps extends React.ComponentPropsWithoutRef<"tfoot">
|
|
|
9
9
|
sticky?: boolean;
|
|
10
10
|
}
|
|
11
11
|
/** Table foot component. */
|
|
12
|
-
export declare const TableFoot:
|
|
12
|
+
export declare const TableFoot: import("react").ForwardRefExoticComponent<TableFootProps & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef, type RefAttributes } from "react";
|
|
2
2
|
import { type SortDirection } from "../../utils/sorting.ts";
|
|
3
3
|
/** Properties of the table head component. */
|
|
4
|
-
export interface TableHeadProps extends
|
|
4
|
+
export interface TableHeadProps extends ComponentPropsWithoutRef<"thead"> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the table head should be sticky.
|
|
7
7
|
*
|
|
@@ -17,7 +17,7 @@ export interface TableHeadProps extends React.ComponentPropsWithoutRef<"thead">
|
|
|
17
17
|
*/
|
|
18
18
|
sortByColumnDescription?: (columnName: string, sortDirection: SortDirection | null) => string;
|
|
19
19
|
/** Properties to pass to each row component. */
|
|
20
|
-
rowProps?:
|
|
20
|
+
rowProps?: ComponentPropsWithoutRef<"tr"> | ((index: number) => ComponentPropsWithoutRef<"tr">);
|
|
21
21
|
}
|
|
22
22
|
/** Table head component. */
|
|
23
|
-
export declare const TableHead:
|
|
23
|
+
export declare const TableHead: import("react").ForwardRefExoticComponent<TableHeadProps & RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
2
|
/** Default table row height (with a single line of text or with form controls). */
|
|
3
3
|
export declare const DEFAULT_TABLE_ROW_HEIGHT = 41;
|
|
4
4
|
/** Properties of the table row component. */
|
|
5
|
-
export interface TableRowProps extends
|
|
5
|
+
export interface TableRowProps extends ComponentPropsWithoutRef<"tr"> {
|
|
6
6
|
/** Whether this row should be marked as being selected. */
|
|
7
7
|
selected?: boolean;
|
|
8
8
|
}
|
|
9
9
|
/** Table row component. */
|
|
10
|
-
export declare const TableRow:
|
|
10
|
+
export declare const TableRow: import("react").ForwardRefExoticComponent<TableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef } from "react";
|
|
3
3
|
import { type ControlStatus } from "../../utils/control.ts";
|
|
4
4
|
/** Properties of the tab component. */
|
|
5
|
-
export interface TabProps extends Omit<
|
|
5
|
+
export interface TabProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.TabsTrigger>, "asChild" | "value"> {
|
|
6
6
|
/** Value representing this tab. */
|
|
7
7
|
value: string | number;
|
|
8
8
|
/** Status of the tab. */
|
|
9
9
|
status?: ControlStatus;
|
|
10
10
|
/** Properties to pass to the inner tab element. */
|
|
11
|
-
tabInnerProps?:
|
|
11
|
+
tabInnerProps?: ComponentPropsWithRef<"div">;
|
|
12
12
|
}
|
|
13
13
|
/** Tab trigger component. */
|
|
14
|
-
export declare const Tab:
|
|
14
|
+
export declare const Tab: import("react").ForwardRefExoticComponent<TabProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
3
|
/** Properties of the tab content component. */
|
|
4
|
-
export interface TabContentProps extends Omit<
|
|
4
|
+
export interface TabContentProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.TabsContent>, "value"> {
|
|
5
5
|
/** Value of the tab that corresponds to this content. */
|
|
6
6
|
value: string | number;
|
|
7
7
|
}
|
|
8
8
|
/** Tab content component. */
|
|
9
|
-
export declare const TabContent:
|
|
9
|
+
export declare const TabContent: import("react").ForwardRefExoticComponent<TabContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef } from "react";
|
|
3
3
|
/** Properties of the tab list component. */
|
|
4
|
-
export interface TabListProps extends
|
|
4
|
+
export interface TabListProps extends ComponentPropsWithoutRef<typeof TabsPrimitive.List> {
|
|
5
5
|
/** Properties to pass to the root element. */
|
|
6
|
-
rootProps?:
|
|
6
|
+
rootProps?: ComponentPropsWithRef<"div">;
|
|
7
7
|
/** Properties to pass to the container element. */
|
|
8
|
-
containerProps?:
|
|
8
|
+
containerProps?: ComponentPropsWithRef<"div">;
|
|
9
9
|
}
|
|
10
10
|
/** Component containing all tabs. */
|
|
11
|
-
export declare const TabList:
|
|
11
|
+
export declare const TabList: import("react").ForwardRefExoticComponent<TabListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
3
|
/** Tabs variants. */
|
|
4
4
|
export type TabsVariant = "default" | "annexes";
|
|
5
5
|
/** Properties of the tabs component. */
|
|
6
|
-
export interface TabsProps extends Omit<
|
|
6
|
+
export interface TabsProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Root>, "defaultValue" | "value" | "orientation" | "dir"> {
|
|
7
7
|
/**
|
|
8
8
|
* Tabs variant.
|
|
9
9
|
*
|
|
@@ -48,4 +48,4 @@ export interface TabsProps extends Omit<React.ComponentPropsWithoutRef<typeof Ta
|
|
|
48
48
|
* }
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
export declare const Tabs:
|
|
51
|
+
export declare const Tabs: import("react").ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { type ScrollPosition } from "../../utils/useScrollPosition.ts";
|
|
3
2
|
import { type TabsVariant } from "./Tabs.tsx";
|
|
4
3
|
/** Value of the tabs' context. */
|
|
@@ -16,7 +15,7 @@ export interface TabsState {
|
|
|
16
15
|
/** Tabs' store. */
|
|
17
16
|
export type TabsStore = ReturnType<typeof useCreateTabsContext>["store"];
|
|
18
17
|
/** Tabs' context. */
|
|
19
|
-
export declare const TabsContext:
|
|
18
|
+
export declare const TabsContext: import("react").Context<TabsContextValue | null>;
|
|
20
19
|
/** Hook which creates the tabs' store. */
|
|
21
20
|
export declare function useCreateTabsContext(variant: TabsVariant, defaultValue?: string | number, value?: string | number): {
|
|
22
21
|
variant: TabsVariant;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef } from "react";
|
|
2
2
|
import { type AccentColor } from "../../utils/accent.ts";
|
|
3
3
|
import { CloseButton } from "../CloseButton";
|
|
4
4
|
import { CollapsibleContent } from "../Collapsible";
|
|
@@ -10,7 +10,7 @@ export type TagColor = AccentColor;
|
|
|
10
10
|
/** Tag's icon placement. */
|
|
11
11
|
export type TagIconPlacement = "start" | "end";
|
|
12
12
|
/** Properties of the tag component. */
|
|
13
|
-
export interface TagProps extends
|
|
13
|
+
export interface TagProps extends ComponentPropsWithoutRef<"span"> {
|
|
14
14
|
/**
|
|
15
15
|
* Change the component to the HTML tag or custom component of the only child.
|
|
16
16
|
* This will merge the original component props with the props of the supplied
|
|
@@ -68,13 +68,13 @@ export interface TagProps extends React.ComponentPropsWithoutRef<"span"> {
|
|
|
68
68
|
*/
|
|
69
69
|
showCloseButton?: boolean;
|
|
70
70
|
/** Properties to pass to the container element. */
|
|
71
|
-
containerProps?:
|
|
71
|
+
containerProps?: ComponentPropsWithRef<typeof CollapsibleContent>;
|
|
72
72
|
/** Properties to pass to the content element. */
|
|
73
|
-
contentProps?:
|
|
73
|
+
contentProps?: ComponentPropsWithRef<"span">;
|
|
74
74
|
/** Properties to pass to the icon component. */
|
|
75
|
-
iconProps?: Omit<
|
|
75
|
+
iconProps?: Omit<ComponentPropsWithRef<typeof Icon>, "icon">;
|
|
76
76
|
/** Properties to pass to the close button component. */
|
|
77
|
-
closeButtonProps?:
|
|
77
|
+
closeButtonProps?: ComponentPropsWithRef<typeof CloseButton>;
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Component displaying a stylised tag.
|
|
@@ -89,4 +89,4 @@ export interface TagProps extends React.ComponentPropsWithoutRef<"span"> {
|
|
|
89
89
|
* }
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
|
-
export declare const Tag:
|
|
92
|
+
export declare const Tag: import("react").ForwardRefExoticComponent<TagProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
2
|
import { type InputPropsBase } from "../Input";
|
|
3
3
|
/** Properties of the text area component. */
|
|
4
|
-
export interface TextAreaProps extends Omit<InputPropsBase, "asChild" | "children">,
|
|
4
|
+
export interface TextAreaProps extends Omit<InputPropsBase, "asChild" | "children">, ComponentPropsWithoutRef<"textarea"> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* The `TextArea` component is a flexible, multiline input field designed for
|
|
@@ -18,4 +18,4 @@ export interface TextAreaProps extends Omit<InputPropsBase, "asChild" | "childre
|
|
|
18
18
|
* This setup ensures that the `TextArea` can adapt to different use cases while
|
|
19
19
|
* maintaining a consistent and accessible form structure.
|
|
20
20
|
*/
|
|
21
|
-
export declare const TextArea:
|
|
21
|
+
export declare const TextArea: import("react").ForwardRefExoticComponent<TextAreaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Toast as ToastPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from "react";
|
|
3
3
|
import { CloseButton } from "../CloseButton";
|
|
4
4
|
import { Icon, type IconProp } from "../Icon";
|
|
5
5
|
/** Toast variants. */
|
|
@@ -10,7 +10,7 @@ export type ToastSeverity = "neutral" | "info" | "success" | "danger" | "warning
|
|
|
10
10
|
export type ToastProps = ToastPropsWithAction | ToastPropsWithoutAction;
|
|
11
11
|
/** Properties of the toast component when it has an action. */
|
|
12
12
|
export interface ToastPropsWithAction extends ToastPropsBase {
|
|
13
|
-
action:
|
|
13
|
+
action: ReactNode;
|
|
14
14
|
actionAltText: string;
|
|
15
15
|
}
|
|
16
16
|
/** Properties of the toast component when it does not have an action. */
|
|
@@ -19,7 +19,7 @@ export interface ToastPropsWithoutAction extends ToastPropsBase {
|
|
|
19
19
|
actionAltText?: undefined;
|
|
20
20
|
}
|
|
21
21
|
/** Base properties of the toast component. */
|
|
22
|
-
export interface ToastPropsBase extends Pick<
|
|
22
|
+
export interface ToastPropsBase extends Pick<ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, "type" | "duration" | "defaultOpen" | "open" | "onOpenChange" | "onEscapeKeyDown" | "onPause" | "onResume" | "onSwipeStart" | "onSwipeEnd" | "forceMount">, Omit<ComponentPropsWithoutRef<"div">, "onPause"> {
|
|
23
23
|
/**
|
|
24
24
|
* Toast variant.
|
|
25
25
|
*
|
|
@@ -33,7 +33,7 @@ export interface ToastPropsBase extends Pick<React.ComponentPropsWithoutRef<type
|
|
|
33
33
|
*/
|
|
34
34
|
severity?: ToastSeverity;
|
|
35
35
|
/** Alert action. */
|
|
36
|
-
action?:
|
|
36
|
+
action?: ReactNode;
|
|
37
37
|
/**
|
|
38
38
|
* Describes an alternative way to achieve the action for assistive technology
|
|
39
39
|
* users who cannot access the toast easily.
|
|
@@ -49,17 +49,17 @@ export interface ToastPropsBase extends Pick<React.ComponentPropsWithoutRef<type
|
|
|
49
49
|
*/
|
|
50
50
|
showCloseButton?: boolean;
|
|
51
51
|
/** Properties to pass to the root component. */
|
|
52
|
-
rootProps?: Omit<
|
|
52
|
+
rootProps?: Omit<ComponentPropsWithRef<"li">, "onPause">;
|
|
53
53
|
/** Properties to pass to the container component. */
|
|
54
|
-
containerProps?:
|
|
54
|
+
containerProps?: ComponentPropsWithRef<"div">;
|
|
55
55
|
/** Properties to pass to the icon component. */
|
|
56
|
-
iconProps?: Omit<
|
|
56
|
+
iconProps?: Omit<ComponentPropsWithRef<typeof Icon>, "icon">;
|
|
57
57
|
/** Properties to pass to the content component. */
|
|
58
|
-
contentProps?:
|
|
58
|
+
contentProps?: ComponentPropsWithRef<"div">;
|
|
59
59
|
/** Properties to pass to the component containing the action/close button. */
|
|
60
|
-
actionContainerProps?:
|
|
60
|
+
actionContainerProps?: ComponentPropsWithRef<"div">;
|
|
61
61
|
/** Properties to pass to the close button component. */
|
|
62
|
-
closeButtonProps?:
|
|
62
|
+
closeButtonProps?: ComponentPropsWithRef<typeof CloseButton>;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* The `Toast` component is a simple and powerful element that provides
|
|
@@ -76,4 +76,4 @@ export interface ToastPropsBase extends Pick<React.ComponentPropsWithoutRef<type
|
|
|
76
76
|
* is typically used to highlight the main subject or category of the toast
|
|
77
77
|
* notification.
|
|
78
78
|
*/
|
|
79
|
-
export declare const Toast:
|
|
79
|
+
export declare const Toast: import("react").ForwardRefExoticComponent<ToastProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Toast as ToastPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
3
|
/** Direction of pointer swipe that should close the toast */
|
|
4
4
|
export type ToastSwipeDirection = "up" | "down" | "left" | "right";
|
|
5
5
|
/** Properties of the toast provider. */
|
|
6
|
-
export interface ToastProviderProps extends
|
|
6
|
+
export interface ToastProviderProps extends ComponentPropsWithoutRef<typeof ToastPrimitive.Provider> {
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* The provider that wraps the toasts and their viewport. It usually wraps the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Toast as ToastPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
3
|
/** Properties of the toast title. */
|
|
4
|
-
export interface ToastTitleProps extends
|
|
4
|
+
export interface ToastTitleProps extends ComponentPropsWithoutRef<typeof ToastPrimitive.Title> {
|
|
5
5
|
}
|
|
6
6
|
/** An optional title for the toast. */
|
|
7
|
-
export declare const ToastTitle:
|
|
7
|
+
export declare const ToastTitle: import("react").ForwardRefExoticComponent<ToastTitleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Toast as ToastPrimitive } from "radix-ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
3
|
/** Properties of the toast viewport component. */
|
|
4
|
-
export interface ToastViewportProps extends
|
|
4
|
+
export interface ToastViewportProps extends ComponentPropsWithoutRef<typeof ToastPrimitive.Viewport> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* The fixed area where toasts appear. Users can jump to the viewport by
|
|
8
8
|
* pressing a hotkey.
|
|
9
9
|
*/
|
|
10
|
-
export declare const ToastViewport:
|
|
10
|
+
export declare const ToastViewport: import("react").ForwardRefExoticComponent<ToastViewportProps & import("react").RefAttributes<HTMLOListElement>>;
|