@boxcustodia/library 2.0.0-alpha.1 → 2.0.0-alpha.3
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/index.cjs.js +82 -82
- package/dist/index.d.ts +110 -45
- package/dist/index.es.js +37653 -36305
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
|
|
1
2
|
import { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';
|
|
2
3
|
import { ButtonHTMLAttributes } from 'react';
|
|
3
4
|
import { CheckboxGroup as CheckboxGroup_2 } from '@base-ui/react/checkbox-group';
|
|
@@ -22,6 +23,7 @@ import { FieldError } from 'react-hook-form';
|
|
|
22
23
|
import { FieldPath } from 'react-hook-form';
|
|
23
24
|
import { FieldValues } from 'react-hook-form';
|
|
24
25
|
import { FormEvent } from 'react';
|
|
26
|
+
import { HTMLAttributes } from 'react';
|
|
25
27
|
import { HTMLProps } from 'react';
|
|
26
28
|
import { JSX } from 'react/jsx-runtime';
|
|
27
29
|
import { ListIterateeCustom } from 'lodash';
|
|
@@ -57,28 +59,91 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
57
59
|
import { VariantProps } from 'class-variance-authority';
|
|
58
60
|
import { z } from 'zod';
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Accessible confirmation dialog with cancel and action buttons.
|
|
64
|
+
*
|
|
65
|
+
* The `trigger` prop uses Base UI's `render` prop — no wrapper element is added —
|
|
66
|
+
* making it composable with `<Tooltip>` at the primitive level.
|
|
67
|
+
* For full structural control, use the exported primitives directly.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <AlertDialog
|
|
72
|
+
* trigger={<Button variant="error">Delete account</Button>}
|
|
73
|
+
* title="Delete account?"
|
|
74
|
+
* description="This action cannot be undone."
|
|
75
|
+
* variant="error"
|
|
76
|
+
* actionText="Delete"
|
|
77
|
+
* onAction={handleDelete}
|
|
78
|
+
* />
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare function AlertDialog({ trigger, title, description, children, onClose, onAction, variant, closeText, actionText, className, ...props }: AlertDialogProps): JSX.Element;
|
|
82
|
+
|
|
83
|
+
/** Semi-transparent overlay rendered behind the popup. */
|
|
84
|
+
export declare function AlertDialogBackdrop({ className, ...props }: AlertDialogPrimitive.Backdrop.Props): JSX.Element;
|
|
85
|
+
|
|
86
|
+
/** Closes the dialog and merges an optional `onClick` into the `render` element. */
|
|
87
|
+
export declare function AlertDialogClose({ className, ...props }: AlertDialogPrimitive.Close.Props): JSX.Element;
|
|
88
|
+
|
|
89
|
+
/** Supplementary description rendered below the title. */
|
|
90
|
+
export declare function AlertDialogDescription({ className, ...props }: AlertDialogPrimitive.Description.Props): JSX.Element;
|
|
91
|
+
|
|
92
|
+
/** Layout wrapper for action buttons. */
|
|
93
|
+
export declare function AlertDialogFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
94
|
+
|
|
95
|
+
/** Layout wrapper for title and description. */
|
|
96
|
+
export declare function AlertDialogHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Dialog content container. Includes Portal, Backdrop and Viewport internally.
|
|
100
|
+
* Pass `portalProps` to configure the portal (e.g. a custom `container`).
|
|
101
|
+
*/
|
|
102
|
+
export declare function AlertDialogPopup({ className, portalProps, ...props }: AlertDialogPrimitive.Popup.Props & {
|
|
103
|
+
portalProps?: AlertDialogPrimitive.Portal.Props;
|
|
104
|
+
}): JSX.Element;
|
|
61
105
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
106
|
+
export { AlertDialogPrimitive }
|
|
107
|
+
|
|
108
|
+
export declare type AlertDialogProps = Omit<AlertDialogPrimitive.Root.Props, "children"> & {
|
|
109
|
+
/** Element that opens the dialog on click. Passed as Base UI `render` prop — no DOM wrapper added. */
|
|
110
|
+
trigger?: ReactElement;
|
|
111
|
+
/** Dialog heading. */
|
|
112
|
+
title?: ReactNode;
|
|
113
|
+
/** Supporting text rendered below the title. */
|
|
114
|
+
description?: ReactNode;
|
|
115
|
+
/** Custom content rendered between the description and the footer buttons. */
|
|
116
|
+
children?: ReactNode;
|
|
117
|
+
/** Called when the cancel button is clicked. */
|
|
66
118
|
onClose?: () => void;
|
|
119
|
+
/** Called when the action button is clicked. */
|
|
67
120
|
onAction?: () => void;
|
|
68
|
-
variant
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
actionProps?: ComponentProps<typeof DialogClose> & VariantProps<typeof Button>;
|
|
77
|
-
closeText?: React.ReactNode;
|
|
78
|
-
actionText?: React.ReactNode;
|
|
79
|
-
asChild?: boolean;
|
|
121
|
+
/** Visual variant for the action button. @default "default" */
|
|
122
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
123
|
+
/** Label for the cancel button. @default "Cancel" */
|
|
124
|
+
closeText?: ReactNode;
|
|
125
|
+
/** Label for the action button. @default "Confirm" */
|
|
126
|
+
actionText?: ReactNode;
|
|
127
|
+
/** Additional className forwarded to the popup panel. */
|
|
128
|
+
className?: string;
|
|
80
129
|
};
|
|
81
130
|
|
|
131
|
+
/** Context root. Holds open state and wraps all dialog parts. */
|
|
132
|
+
export declare function AlertDialogRoot(props: AlertDialogPrimitive.Root.Props): JSX.Element;
|
|
133
|
+
|
|
134
|
+
/** Accessible title rendered as `<h2>`. Required for a11y. */
|
|
135
|
+
export declare function AlertDialogTitle({ className, ...props }: AlertDialogPrimitive.Title.Props): JSX.Element;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Renders as its `render` element (defaults to `<button>`).
|
|
139
|
+
* Because it uses Base UI's render prop — not Radix Slot — it composes cleanly
|
|
140
|
+
* with `<Tooltip>` and other Base UI triggers on the same DOM element.
|
|
141
|
+
*/
|
|
142
|
+
export declare function AlertDialogTrigger({ className, ...props }: AlertDialogPrimitive.Trigger.Props): JSX.Element;
|
|
143
|
+
|
|
144
|
+
/** Full-screen container that centers the popup. */
|
|
145
|
+
export declare function AlertDialogViewport({ className, ...props }: AlertDialogPrimitive.Viewport.Props): JSX.Element;
|
|
146
|
+
|
|
82
147
|
export declare type ArrayUnion<V, T extends ReadonlyArray<V>> = T[number];
|
|
83
148
|
|
|
84
149
|
declare type ArrowProps = ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>;
|
|
@@ -92,7 +157,7 @@ declare interface AsyncState<T> {
|
|
|
92
157
|
|
|
93
158
|
export declare type AtLeastOne<T> = [T, ...T[]];
|
|
94
159
|
|
|
95
|
-
export declare const AutoComplete: ({ items, placeholder, emptyMessage, onSelect, containerClassName, containerProps, inputClassName, inputProps, listClassName, listProps, itemClassName, itemProps, emptyClassName, emptyProps, }:
|
|
160
|
+
export declare const AutoComplete: ({ items, placeholder, emptyMessage, onSelect, containerClassName, containerProps, inputClassName, inputProps, listClassName, listProps, itemClassName, itemProps, emptyClassName, emptyProps, }: Props) => JSX.Element;
|
|
96
161
|
|
|
97
162
|
export declare const AutoCompleteDialog: ({ children, ...props }: AutoCompleteDialogProps) => JSX.Element;
|
|
98
163
|
|
|
@@ -141,9 +206,9 @@ declare const avatarVariants: (props?: ({
|
|
|
141
206
|
size?: "sm" | "lg" | "xs" | "md" | "xl" | null | undefined;
|
|
142
207
|
} & ClassProp) | undefined) => string;
|
|
143
208
|
|
|
144
|
-
export declare const BackgroundImage: ({ src, ...props }:
|
|
209
|
+
export declare const BackgroundImage: ({ src, ...props }: Props_2) => JSX.Element;
|
|
145
210
|
|
|
146
|
-
export declare const BaseButton: ({ asChild, onClick, loading: prop, showLoader, icon, iconPosition, loaderReplace, style, ...props }:
|
|
211
|
+
export declare const BaseButton: ({ asChild, onClick, loading: prop, showLoader, icon, iconPosition, loaderReplace, style, ...props }: Props_4) => JSX.Element;
|
|
147
212
|
|
|
148
213
|
declare type BaseButtonProps = ComponentProps<typeof BaseButton>;
|
|
149
214
|
|
|
@@ -157,14 +222,14 @@ declare type BaseProps = {
|
|
|
157
222
|
rounded?: TagVariant["rounded"];
|
|
158
223
|
} & StyleProps & React.HTMLAttributes<HTMLDivElement>;
|
|
159
224
|
|
|
160
|
-
export declare const Button: (props:
|
|
225
|
+
export declare const Button: (props: Props_3) => JSX.Element;
|
|
161
226
|
|
|
162
227
|
declare type ButtonProps = ComponentProps<typeof Button>;
|
|
163
228
|
|
|
164
229
|
declare type ButtonProps_2 = ComponentProps<typeof Button>;
|
|
165
230
|
|
|
166
|
-
declare const buttonVariants: (props?: ({
|
|
167
|
-
variant?: "default" | "
|
|
231
|
+
export declare const buttonVariants: (props?: ({
|
|
232
|
+
variant?: "default" | "success" | "error" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
168
233
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
169
234
|
shape?: "rounded" | "circle" | "square" | null | undefined;
|
|
170
235
|
} & ClassProp) | undefined) => string;
|
|
@@ -636,7 +701,7 @@ export declare function Label({ className, render, required, tooltip, children,
|
|
|
636
701
|
|
|
637
702
|
declare interface LabelProps extends useRender.ComponentProps<"label"> {
|
|
638
703
|
required?: boolean;
|
|
639
|
-
tooltip?:
|
|
704
|
+
tooltip?: ReactNode;
|
|
640
705
|
}
|
|
641
706
|
|
|
642
707
|
/**
|
|
@@ -926,7 +991,12 @@ declare const progressTrackVariants: (props?: ({
|
|
|
926
991
|
|
|
927
992
|
export declare function ProgressValue({ className, ...props }: Progress_2.Value.Props): React_2.ReactElement;
|
|
928
993
|
|
|
929
|
-
declare
|
|
994
|
+
declare interface Props extends ExtendedProps {
|
|
995
|
+
items: AutoCompleteItem[];
|
|
996
|
+
placeholder?: string;
|
|
997
|
+
emptyMessage?: string;
|
|
998
|
+
onSelect?: (value: AutoCompleteItem["value"], item: AutoCompleteItem) => any;
|
|
999
|
+
}
|
|
930
1000
|
|
|
931
1001
|
declare type Props_10 = ComponentPropsWithoutRef<"div"> & {
|
|
932
1002
|
icon?: ReactNode;
|
|
@@ -1017,13 +1087,11 @@ declare interface Props_19 {
|
|
|
1017
1087
|
offset?: ComponentPropsWithoutRef<typeof PopoverContent>["sideOffset"];
|
|
1018
1088
|
}
|
|
1019
1089
|
|
|
1020
|
-
declare interface Props_2 extends
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
iconPosition?: "start" | "end";
|
|
1026
|
-
loaderReplace?: true;
|
|
1090
|
+
declare interface Props_2 extends HTMLProps<HTMLDivElement> {
|
|
1091
|
+
/**
|
|
1092
|
+
* La URL de la imagen
|
|
1093
|
+
*/
|
|
1094
|
+
src: string;
|
|
1027
1095
|
}
|
|
1028
1096
|
|
|
1029
1097
|
declare interface Props_20 extends ComponentPropsWithoutRef<typeof Slot> {
|
|
@@ -1055,18 +1123,15 @@ declare interface Props_25<T> extends UseAsyncOptions<T> {
|
|
|
1055
1123
|
dependencies?: DependencyList;
|
|
1056
1124
|
}
|
|
1057
1125
|
|
|
1058
|
-
declare
|
|
1059
|
-
items: AutoCompleteItem[];
|
|
1060
|
-
placeholder?: string;
|
|
1061
|
-
emptyMessage?: string;
|
|
1062
|
-
onSelect?: (value: AutoCompleteItem["value"], item: AutoCompleteItem) => any;
|
|
1063
|
-
}
|
|
1126
|
+
declare type Props_3 = BaseButtonProps & VariantProps<typeof buttonVariants>;
|
|
1064
1127
|
|
|
1065
|
-
declare interface Props_4 extends
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1128
|
+
declare interface Props_4 extends ComponentProps<"button"> {
|
|
1129
|
+
asChild?: boolean;
|
|
1130
|
+
loading?: boolean;
|
|
1131
|
+
showLoader?: boolean;
|
|
1132
|
+
icon?: ReactNode;
|
|
1133
|
+
iconPosition?: "start" | "end";
|
|
1134
|
+
loaderReplace?: true;
|
|
1070
1135
|
}
|
|
1071
1136
|
|
|
1072
1137
|
declare type Props_5<TItem extends Record<string, any>> = {
|
|
@@ -1617,7 +1682,7 @@ export declare function toastVariants({ variant }?: {
|
|
|
1617
1682
|
* </Tooltip>
|
|
1618
1683
|
* ```
|
|
1619
1684
|
*/
|
|
1620
|
-
export declare function Tooltip({ content, children, open, defaultOpen, onOpenChange, side, align, offset, delay, closeDelay, className, arrowClassName, }: TooltipProps): JSX.Element;
|
|
1685
|
+
export declare function Tooltip({ content, children, open, defaultOpen, onOpenChange, side, align, offset, delay, closeDelay, className, arrowClassName, ...triggerProps }: TooltipProps): JSX.Element;
|
|
1621
1686
|
|
|
1622
1687
|
export declare function TooltipArrow({ className, ...props }: ArrowProps): JSX.Element;
|
|
1623
1688
|
|
|
@@ -1625,7 +1690,7 @@ export declare function TooltipPopup({ className, ...props }: PopupProps): JSX.E
|
|
|
1625
1690
|
|
|
1626
1691
|
export { TooltipPrimitive }
|
|
1627
1692
|
|
|
1628
|
-
export declare type TooltipProps = Omit<RootProps, "children"> & {
|
|
1693
|
+
export declare type TooltipProps = Omit<RootProps, "children"> & Omit<TriggerProps, "render" | "delay" | "closeDelay" | "className" | "content"> & {
|
|
1629
1694
|
/** The element that triggers the tooltip on hover/focus. */
|
|
1630
1695
|
children: ReactElement;
|
|
1631
1696
|
/** Content displayed inside the tooltip popup. */
|