boottent-design 0.1.6 → 0.1.7
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/boottent-design.main.cjs.js +1 -1
- package/dist/boottent-design.main.es.js +28 -18
- package/dist/boottent-design.provider.cjs.js +1 -51
- package/dist/boottent-design.provider.es.js +61 -2070
- package/dist/boottent-design.ui.cjs.js +1 -1
- package/dist/boottent-design.ui.es.js +17 -12
- package/dist/boottent-design.utils.cjs.js +1 -1
- package/dist/boottent-design.utils.es.js +285 -188
- package/dist/index-JOCM_DIz.cjs +1 -0
- package/dist/index-j8ablNp2.js +384 -0
- package/dist/tooltip-Dbl2Hiq4.cjs +51 -0
- package/dist/tooltip-x7XcU5XA.js +6638 -0
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/main.d.ts +172 -0
- package/dist/types/ui.d.ts +59 -0
- package/dist/types/utils.d.ts +149 -0
- package/package.json +1 -1
- package/dist/index-DKksyhqt.cjs +0 -1
- package/dist/index-DkEQQBYd.js +0 -2684
- package/dist/index-NAHSuYsJ.js +0 -2439
- package/dist/index-eD5RRver.cjs +0 -1
package/dist/types/hooks.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ declare interface ModalProps {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
declare const Toast: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React_2.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
40
|
-
variant?: "
|
|
40
|
+
variant?: "white" | "black" | null | undefined;
|
|
41
41
|
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | null | undefined;
|
|
42
42
|
size?: "sm" | "md" | "lg" | "xl" | "full" | "fit" | null | undefined;
|
|
43
43
|
} & ClassProp) | undefined) => string> & React_2.RefAttributes<HTMLLIElement>>;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
|
2
2
|
import { ClassProp } from 'class-variance-authority/types';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
import { ComponentPropsWithRef } from 'react';
|
|
5
|
+
import { default as default_2 } from 'react';
|
|
5
6
|
import { DetailedHTMLProps } from 'react';
|
|
6
7
|
import { DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES } from 'react';
|
|
7
8
|
import { FC } from 'react';
|
|
@@ -11,6 +12,7 @@ import { JSX as JSX_2 } from 'react';
|
|
|
11
12
|
import * as React_2 from 'react';
|
|
12
13
|
import { RefAttributes } from 'react';
|
|
13
14
|
import { RefObject } from 'react';
|
|
15
|
+
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
14
16
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
15
17
|
import { VariantProps } from 'class-variance-authority';
|
|
16
18
|
|
|
@@ -22,6 +24,47 @@ export declare const AccordionItem: React_2.ForwardRefExoticComponent<Omit<Accor
|
|
|
22
24
|
|
|
23
25
|
export declare const AccordionTrigger: React_2.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
24
26
|
|
|
27
|
+
declare type Action = {
|
|
28
|
+
type: ActionType["ADD_TOAST"];
|
|
29
|
+
toast: ToasterProps;
|
|
30
|
+
} | {
|
|
31
|
+
type: ActionType["UPDATE_TOAST"];
|
|
32
|
+
toast: Partial<ToasterProps>;
|
|
33
|
+
} | {
|
|
34
|
+
type: ActionType["DISMISS_TOAST"];
|
|
35
|
+
toastId?: ToasterProps["id"];
|
|
36
|
+
} | {
|
|
37
|
+
type: ActionType["REMOVE_TOAST"];
|
|
38
|
+
toastId?: ToasterProps["id"];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
declare type ActionType = typeof actionTypes;
|
|
42
|
+
|
|
43
|
+
declare const actionTypes: {
|
|
44
|
+
readonly ADD_TOAST: "ADD_TOAST";
|
|
45
|
+
readonly UPDATE_TOAST: "UPDATE_TOAST";
|
|
46
|
+
readonly DISMISS_TOAST: "DISMISS_TOAST";
|
|
47
|
+
readonly REMOVE_TOAST: "REMOVE_TOAST";
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export declare const Alert: React_2.FC<AlertProps>;
|
|
51
|
+
|
|
52
|
+
declare interface AlertPortalOptions {
|
|
53
|
+
id: string;
|
|
54
|
+
type: "alert";
|
|
55
|
+
props: AlertProps;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare interface AlertProps {
|
|
59
|
+
id?: string;
|
|
60
|
+
title?: string;
|
|
61
|
+
description: string | React.ReactNode;
|
|
62
|
+
confirmText?: string;
|
|
63
|
+
onConfirm?: () => void;
|
|
64
|
+
size?: "sm" | "md" | "lg" | "fit";
|
|
65
|
+
onClose?: () => void;
|
|
66
|
+
}
|
|
67
|
+
|
|
25
68
|
declare function ArrowDown({ size, fill, className, }: SvgIconType): JSX_2.Element;
|
|
26
69
|
|
|
27
70
|
declare function ArrowDown2({ size, fill, className, }: SvgIconType): JSX_2.Element;
|
|
@@ -85,8 +128,36 @@ declare function Control({ size, fill, className, }: SvgIconType): JSX_2.Element
|
|
|
85
128
|
|
|
86
129
|
declare function CopyLink(): JSX_2.Element;
|
|
87
130
|
|
|
131
|
+
declare interface CustomDialogProps extends Omit<DialogProps, "onConfirm" | "onCancel" | "content"> {
|
|
132
|
+
onConfirm?: () => void;
|
|
133
|
+
onCancel?: () => void;
|
|
134
|
+
confirmText?: string;
|
|
135
|
+
cancelText?: string;
|
|
136
|
+
size?: "sm" | "md" | "lg" | "fit";
|
|
137
|
+
content?: React_2.ReactNode;
|
|
138
|
+
description?: string;
|
|
139
|
+
className?: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
88
142
|
declare function DefaultProfile({ size }: SvgIconType): JSX_2.Element;
|
|
89
143
|
|
|
144
|
+
export declare const Dialog: React_2.ForwardRefExoticComponent<CustomDialogProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
145
|
+
|
|
146
|
+
declare interface DialogPortalOptions {
|
|
147
|
+
id: string;
|
|
148
|
+
type: "dialog";
|
|
149
|
+
props: DialogProps;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare interface DialogProps {
|
|
153
|
+
id?: string;
|
|
154
|
+
title: string;
|
|
155
|
+
content: string | React.ReactNode;
|
|
156
|
+
onConfirm?: () => void;
|
|
157
|
+
onCancel?: () => void;
|
|
158
|
+
onClose?: () => void;
|
|
159
|
+
}
|
|
160
|
+
|
|
90
161
|
declare function Filter({ fill, size }: SvgIconType): JSX_2.Element;
|
|
91
162
|
|
|
92
163
|
declare function Google({ size }: SvgIconType): JSX_2.Element;
|
|
@@ -156,16 +227,63 @@ export declare interface InputProps extends React_2.InputHTMLAttributes<HTMLInpu
|
|
|
156
227
|
error?: boolean;
|
|
157
228
|
}
|
|
158
229
|
|
|
230
|
+
declare type Listener = (options: PortalOptions, isOpen: boolean) => void;
|
|
231
|
+
|
|
159
232
|
declare function Location_2({ fill, size, className, }: SvgIconType): JSX_2.Element;
|
|
160
233
|
|
|
161
234
|
declare function Menu({ fill }: SvgIconType): JSX_2.Element;
|
|
162
235
|
|
|
163
236
|
declare function Message({ size, fill, className, }: SvgIconType): JSX_2.Element;
|
|
164
237
|
|
|
238
|
+
export declare const Modal: React_2.ForwardRefExoticComponent<ModalProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
239
|
+
|
|
240
|
+
declare interface ModalPortalOptions {
|
|
241
|
+
id: string;
|
|
242
|
+
type: "modal";
|
|
243
|
+
props: ModalProps;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
declare interface ModalProps {
|
|
247
|
+
id?: string;
|
|
248
|
+
title: string;
|
|
249
|
+
description?: string | React.ReactNode;
|
|
250
|
+
subDescription?: string | React.ReactNode;
|
|
251
|
+
size?: "sm" | "md" | "lg" | "fit";
|
|
252
|
+
confirmText?: string;
|
|
253
|
+
onConfirm?: () => void;
|
|
254
|
+
cancelText?: string;
|
|
255
|
+
onClose: () => void;
|
|
256
|
+
contents?: React.ReactNode;
|
|
257
|
+
className?: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
165
260
|
declare function New({ size, fill }: SvgIconType): JSX_2.Element;
|
|
166
261
|
|
|
167
262
|
declare function Play({ size, fill, className, }: SvgIconType): JSX_2.Element;
|
|
168
263
|
|
|
264
|
+
export declare const PortalContainer: ({ children }: Props_5) => default_2.ReactPortal | null;
|
|
265
|
+
|
|
266
|
+
declare class PortalManager {
|
|
267
|
+
private listeners;
|
|
268
|
+
private portals;
|
|
269
|
+
private queue;
|
|
270
|
+
private isProcessing;
|
|
271
|
+
private processQueue;
|
|
272
|
+
private isPortalOpen;
|
|
273
|
+
subscribe(listener: Listener): () => void;
|
|
274
|
+
showPortal(type: PortalType, props: any): string | null;
|
|
275
|
+
setPortalOpen(id: string, isOpen: boolean): void;
|
|
276
|
+
getIsPortalOpen(id: string): boolean | undefined;
|
|
277
|
+
getOpenPortals(): string[];
|
|
278
|
+
private generateId;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export declare const portalManager: PortalManager;
|
|
282
|
+
|
|
283
|
+
export declare type PortalOptions = ModalPortalOptions | ToastPortalOptions | AlertPortalOptions | DialogPortalOptions;
|
|
284
|
+
|
|
285
|
+
export declare type PortalType = "modal" | "toast" | "alert" | "dialog";
|
|
286
|
+
|
|
169
287
|
declare function Present({ size, fill, className, }: SvgIconType): JSX_2.Element;
|
|
170
288
|
|
|
171
289
|
declare function Profile({ fill, className, size, }: SvgIconType): JSX_2.Element;
|
|
@@ -192,6 +310,10 @@ declare type Props_4 = {
|
|
|
192
310
|
size?: string;
|
|
193
311
|
};
|
|
194
312
|
|
|
313
|
+
declare type Props_5 = {
|
|
314
|
+
children: default_2.ReactNode;
|
|
315
|
+
};
|
|
316
|
+
|
|
195
317
|
declare function Radio({ type, size }: Props_4): JSX_2.Element;
|
|
196
318
|
|
|
197
319
|
declare interface ReactIconProps {
|
|
@@ -200,6 +322,8 @@ declare interface ReactIconProps {
|
|
|
200
322
|
className?: string;
|
|
201
323
|
}
|
|
202
324
|
|
|
325
|
+
export declare const reducer: (state: State, action: Action) => State;
|
|
326
|
+
|
|
203
327
|
declare function Reset({ size, fill }: SvgIconType): JSX_2.Element;
|
|
204
328
|
|
|
205
329
|
declare function ReturnRight({ size, color, className, }: ReactIconProps): JSX_2.Element;
|
|
@@ -214,6 +338,10 @@ declare type StackProps = BoxProps & {
|
|
|
214
338
|
type?: "col" | "row";
|
|
215
339
|
};
|
|
216
340
|
|
|
341
|
+
declare interface State {
|
|
342
|
+
toasts: ToasterProps[];
|
|
343
|
+
}
|
|
344
|
+
|
|
217
345
|
declare type SvgIconType = {
|
|
218
346
|
size?: string;
|
|
219
347
|
fill?: string;
|
|
@@ -234,6 +362,50 @@ export declare const Symbols: {
|
|
|
234
362
|
Boottent: FC<SvgIconType>;
|
|
235
363
|
};
|
|
236
364
|
|
|
365
|
+
declare const Toast: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React_2.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
366
|
+
variant?: "white" | "black" | null | undefined;
|
|
367
|
+
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | null | undefined;
|
|
368
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | "fit" | null | undefined;
|
|
369
|
+
} & ClassProp) | undefined) => string> & React_2.RefAttributes<HTMLLIElement>>;
|
|
370
|
+
|
|
371
|
+
export declare function toast({ ...props }: Toast_2): {
|
|
372
|
+
id: string;
|
|
373
|
+
dismiss: () => void;
|
|
374
|
+
update: (props: ToasterProps) => void;
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
declare type Toast_2 = Omit<ToasterProps, "id">;
|
|
378
|
+
|
|
379
|
+
export declare function Toaster(): JSX_2.Element;
|
|
380
|
+
|
|
381
|
+
export declare function toaster(): {
|
|
382
|
+
toast: typeof toast;
|
|
383
|
+
dismiss: (toastId?: string) => void;
|
|
384
|
+
toasts: ToasterProps[];
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
declare type ToasterProps = ToastProps & ToastViewportProps & {
|
|
388
|
+
id: string;
|
|
389
|
+
title?: React.ReactNode;
|
|
390
|
+
description?: React.ReactNode;
|
|
391
|
+
action?: () => void;
|
|
392
|
+
actionText?: string | React.ReactNode;
|
|
393
|
+
closeButton?: boolean;
|
|
394
|
+
onClose?: () => void;
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
declare interface ToastPortalOptions {
|
|
398
|
+
id: string;
|
|
399
|
+
type: "toast";
|
|
400
|
+
props: ToastProps;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
declare type ToastProps = React_2.ComponentPropsWithoutRef<typeof Toast>;
|
|
404
|
+
|
|
405
|
+
declare const ToastViewport: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React_2.RefAttributes<HTMLOListElement>, "ref"> & React_2.RefAttributes<HTMLOListElement>>;
|
|
406
|
+
|
|
407
|
+
declare type ToastViewportProps = React_2.ComponentPropsWithoutRef<typeof ToastViewport>;
|
|
408
|
+
|
|
237
409
|
export declare const TooltipButton: React_2.FC<TooltipButtonProps>;
|
|
238
410
|
|
|
239
411
|
declare interface TooltipButtonProps extends TooltipContentProps {
|
package/dist/types/ui.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
2
|
import { ClassProp } from 'class-variance-authority/types';
|
|
3
|
+
import { default as default_2 } from 'react';
|
|
3
4
|
import { FC } from 'react';
|
|
4
5
|
import { JSX as JSX_2 } from 'react';
|
|
5
6
|
import * as React_2 from 'react';
|
|
@@ -14,6 +15,18 @@ export declare const AccordionItem: React_2.ForwardRefExoticComponent<Omit<Accor
|
|
|
14
15
|
|
|
15
16
|
export declare const AccordionTrigger: React_2.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
16
17
|
|
|
18
|
+
export declare const Alert: React_2.FC<AlertProps>;
|
|
19
|
+
|
|
20
|
+
declare interface AlertProps {
|
|
21
|
+
id?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
description: string | React.ReactNode;
|
|
24
|
+
confirmText?: string;
|
|
25
|
+
onConfirm?: () => void;
|
|
26
|
+
size?: "sm" | "md" | "lg" | "fit";
|
|
27
|
+
onClose?: () => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
declare function ArrowDown({ size, fill, className, }: SvgIconType): JSX_2.Element;
|
|
18
31
|
|
|
19
32
|
declare function ArrowDown2({ size, fill, className, }: SvgIconType): JSX_2.Element;
|
|
@@ -65,8 +78,30 @@ declare function Control({ size, fill, className, }: SvgIconType): JSX_2.Element
|
|
|
65
78
|
|
|
66
79
|
declare function CopyLink(): JSX_2.Element;
|
|
67
80
|
|
|
81
|
+
declare interface CustomDialogProps extends Omit<DialogProps, "onConfirm" | "onCancel" | "content"> {
|
|
82
|
+
onConfirm?: () => void;
|
|
83
|
+
onCancel?: () => void;
|
|
84
|
+
confirmText?: string;
|
|
85
|
+
cancelText?: string;
|
|
86
|
+
size?: "sm" | "md" | "lg" | "fit";
|
|
87
|
+
content?: React_2.ReactNode;
|
|
88
|
+
description?: string;
|
|
89
|
+
className?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
68
92
|
declare function DefaultProfile({ size }: SvgIconType): JSX_2.Element;
|
|
69
93
|
|
|
94
|
+
export declare const Dialog: React_2.ForwardRefExoticComponent<CustomDialogProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
95
|
+
|
|
96
|
+
declare interface DialogProps {
|
|
97
|
+
id?: string;
|
|
98
|
+
title: string;
|
|
99
|
+
content: string | React.ReactNode;
|
|
100
|
+
onConfirm?: () => void;
|
|
101
|
+
onCancel?: () => void;
|
|
102
|
+
onClose?: () => void;
|
|
103
|
+
}
|
|
104
|
+
|
|
70
105
|
declare function Filter({ fill, size }: SvgIconType): JSX_2.Element;
|
|
71
106
|
|
|
72
107
|
declare function Google({ size }: SvgIconType): JSX_2.Element;
|
|
@@ -142,10 +177,28 @@ declare function Menu({ fill }: SvgIconType): JSX_2.Element;
|
|
|
142
177
|
|
|
143
178
|
declare function Message({ size, fill, className, }: SvgIconType): JSX_2.Element;
|
|
144
179
|
|
|
180
|
+
export declare const Modal: React_2.ForwardRefExoticComponent<ModalProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
181
|
+
|
|
182
|
+
declare interface ModalProps {
|
|
183
|
+
id?: string;
|
|
184
|
+
title: string;
|
|
185
|
+
description?: string | React.ReactNode;
|
|
186
|
+
subDescription?: string | React.ReactNode;
|
|
187
|
+
size?: "sm" | "md" | "lg" | "fit";
|
|
188
|
+
confirmText?: string;
|
|
189
|
+
onConfirm?: () => void;
|
|
190
|
+
cancelText?: string;
|
|
191
|
+
onClose: () => void;
|
|
192
|
+
contents?: React.ReactNode;
|
|
193
|
+
className?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
145
196
|
declare function New({ size, fill }: SvgIconType): JSX_2.Element;
|
|
146
197
|
|
|
147
198
|
declare function Play({ size, fill, className, }: SvgIconType): JSX_2.Element;
|
|
148
199
|
|
|
200
|
+
export declare const PortalContainer: ({ children }: Props_5) => default_2.ReactPortal | null;
|
|
201
|
+
|
|
149
202
|
declare function Present({ size, fill, className, }: SvgIconType): JSX_2.Element;
|
|
150
203
|
|
|
151
204
|
declare function Profile({ fill, className, size, }: SvgIconType): JSX_2.Element;
|
|
@@ -172,6 +225,10 @@ declare type Props_4 = {
|
|
|
172
225
|
size?: string;
|
|
173
226
|
};
|
|
174
227
|
|
|
228
|
+
declare type Props_5 = {
|
|
229
|
+
children: default_2.ReactNode;
|
|
230
|
+
};
|
|
231
|
+
|
|
175
232
|
declare function Radio({ type, size }: Props_4): JSX_2.Element;
|
|
176
233
|
|
|
177
234
|
declare interface ReactIconProps {
|
|
@@ -208,6 +265,8 @@ export declare const Symbols: {
|
|
|
208
265
|
Boottent: FC<SvgIconType>;
|
|
209
266
|
};
|
|
210
267
|
|
|
268
|
+
export declare function Toaster(): JSX_2.Element;
|
|
269
|
+
|
|
211
270
|
export declare const TooltipButton: React_2.FC<TooltipButtonProps>;
|
|
212
271
|
|
|
213
272
|
declare interface TooltipButtonProps extends TooltipContentProps {
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,7 +1,156 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
1
2
|
import { ClassValue } from 'clsx';
|
|
3
|
+
import * as React_2 from 'react';
|
|
4
|
+
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
declare type Action = {
|
|
8
|
+
type: ActionType["ADD_TOAST"];
|
|
9
|
+
toast: ToasterProps;
|
|
10
|
+
} | {
|
|
11
|
+
type: ActionType["UPDATE_TOAST"];
|
|
12
|
+
toast: Partial<ToasterProps>;
|
|
13
|
+
} | {
|
|
14
|
+
type: ActionType["DISMISS_TOAST"];
|
|
15
|
+
toastId?: ToasterProps["id"];
|
|
16
|
+
} | {
|
|
17
|
+
type: ActionType["REMOVE_TOAST"];
|
|
18
|
+
toastId?: ToasterProps["id"];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
declare type ActionType = typeof actionTypes;
|
|
22
|
+
|
|
23
|
+
declare const actionTypes: {
|
|
24
|
+
readonly ADD_TOAST: "ADD_TOAST";
|
|
25
|
+
readonly UPDATE_TOAST: "UPDATE_TOAST";
|
|
26
|
+
readonly DISMISS_TOAST: "DISMISS_TOAST";
|
|
27
|
+
readonly REMOVE_TOAST: "REMOVE_TOAST";
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
declare interface AlertPortalOptions {
|
|
31
|
+
id: string;
|
|
32
|
+
type: "alert";
|
|
33
|
+
props: AlertProps;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare interface AlertProps {
|
|
37
|
+
id?: string;
|
|
38
|
+
title?: string;
|
|
39
|
+
description: string | React.ReactNode;
|
|
40
|
+
confirmText?: string;
|
|
41
|
+
onConfirm?: () => void;
|
|
42
|
+
size?: "sm" | "md" | "lg" | "fit";
|
|
43
|
+
onClose?: () => void;
|
|
44
|
+
}
|
|
2
45
|
|
|
3
46
|
export declare const cn: (...classes: ClassValue[]) => string;
|
|
4
47
|
|
|
48
|
+
declare interface DialogPortalOptions {
|
|
49
|
+
id: string;
|
|
50
|
+
type: "dialog";
|
|
51
|
+
props: DialogProps;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare interface DialogProps {
|
|
55
|
+
id?: string;
|
|
56
|
+
title: string;
|
|
57
|
+
content: string | React.ReactNode;
|
|
58
|
+
onConfirm?: () => void;
|
|
59
|
+
onCancel?: () => void;
|
|
60
|
+
onClose?: () => void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare type Listener = (options: PortalOptions, isOpen: boolean) => void;
|
|
64
|
+
|
|
65
|
+
declare interface ModalPortalOptions {
|
|
66
|
+
id: string;
|
|
67
|
+
type: "modal";
|
|
68
|
+
props: ModalProps;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare interface ModalProps {
|
|
72
|
+
id?: string;
|
|
73
|
+
title: string;
|
|
74
|
+
description?: string | React.ReactNode;
|
|
75
|
+
subDescription?: string | React.ReactNode;
|
|
76
|
+
size?: "sm" | "md" | "lg" | "fit";
|
|
77
|
+
confirmText?: string;
|
|
78
|
+
onConfirm?: () => void;
|
|
79
|
+
cancelText?: string;
|
|
80
|
+
onClose: () => void;
|
|
81
|
+
contents?: React.ReactNode;
|
|
82
|
+
className?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare class PortalManager {
|
|
86
|
+
private listeners;
|
|
87
|
+
private portals;
|
|
88
|
+
private queue;
|
|
89
|
+
private isProcessing;
|
|
90
|
+
private processQueue;
|
|
91
|
+
private isPortalOpen;
|
|
92
|
+
subscribe(listener: Listener): () => void;
|
|
93
|
+
showPortal(type: PortalType, props: any): string | null;
|
|
94
|
+
setPortalOpen(id: string, isOpen: boolean): void;
|
|
95
|
+
getIsPortalOpen(id: string): boolean | undefined;
|
|
96
|
+
getOpenPortals(): string[];
|
|
97
|
+
private generateId;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export declare const portalManager: PortalManager;
|
|
101
|
+
|
|
102
|
+
export declare type PortalOptions = ModalPortalOptions | ToastPortalOptions | AlertPortalOptions | DialogPortalOptions;
|
|
103
|
+
|
|
104
|
+
export declare type PortalType = "modal" | "toast" | "alert" | "dialog";
|
|
105
|
+
|
|
106
|
+
export declare const reducer: (state: State, action: Action) => State;
|
|
107
|
+
|
|
108
|
+
declare interface State {
|
|
109
|
+
toasts: ToasterProps[];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare const Toast: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React_2.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
113
|
+
variant?: "white" | "black" | null | undefined;
|
|
114
|
+
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | null | undefined;
|
|
115
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | "fit" | null | undefined;
|
|
116
|
+
} & ClassProp) | undefined) => string> & React_2.RefAttributes<HTMLLIElement>>;
|
|
117
|
+
|
|
118
|
+
export declare function toast({ ...props }: Toast_2): {
|
|
119
|
+
id: string;
|
|
120
|
+
dismiss: () => void;
|
|
121
|
+
update: (props: ToasterProps) => void;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
declare type Toast_2 = Omit<ToasterProps, "id">;
|
|
125
|
+
|
|
126
|
+
export declare function toaster(): {
|
|
127
|
+
toast: typeof toast;
|
|
128
|
+
dismiss: (toastId?: string) => void;
|
|
129
|
+
toasts: ToasterProps[];
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
declare type ToasterProps = ToastProps & ToastViewportProps & {
|
|
133
|
+
id: string;
|
|
134
|
+
title?: React.ReactNode;
|
|
135
|
+
description?: React.ReactNode;
|
|
136
|
+
action?: () => void;
|
|
137
|
+
actionText?: string | React.ReactNode;
|
|
138
|
+
closeButton?: boolean;
|
|
139
|
+
onClose?: () => void;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
declare interface ToastPortalOptions {
|
|
143
|
+
id: string;
|
|
144
|
+
type: "toast";
|
|
145
|
+
props: ToastProps;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
declare type ToastProps = React_2.ComponentPropsWithoutRef<typeof Toast>;
|
|
149
|
+
|
|
150
|
+
declare const ToastViewport: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React_2.RefAttributes<HTMLOListElement>, "ref"> & React_2.RefAttributes<HTMLOListElement>>;
|
|
151
|
+
|
|
152
|
+
declare type ToastViewportProps = React_2.ComponentPropsWithoutRef<typeof ToastViewport>;
|
|
153
|
+
|
|
5
154
|
export { }
|
|
6
155
|
|
|
7
156
|
declare namespace _default {
|