@fuf-stack/pixels 1.7.4 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert/index.cjs +2 -2
- package/dist/Alert/index.d.cts +2 -2
- package/dist/Alert/index.d.ts +2 -2
- package/dist/Alert/index.js +1 -1
- package/dist/{Alert-Dc0RSQaB.d.cts → Alert-BidIEsLA.d.cts} +21 -53
- package/dist/{Alert-Dc0RSQaB.d.ts → Alert-BidIEsLA.d.ts} +21 -53
- package/dist/Toast/index.cjs +3 -6
- package/dist/Toast/index.cjs.map +1 -1
- package/dist/Toast/index.d.cts +6 -5
- package/dist/Toast/index.d.ts +6 -5
- package/dist/Toast/index.js +7 -10
- package/dist/Toaster-DVX4ebm4.d.ts +75 -0
- package/dist/Toaster-M8hrHJ-J.d.cts +75 -0
- package/dist/{chunk-K25U4BJO.cjs → chunk-LUAK6GQG.cjs} +20 -42
- package/dist/chunk-LUAK6GQG.cjs.map +1 -0
- package/dist/{chunk-565TFIAK.js → chunk-PKG3L2TJ.js} +20 -42
- package/dist/chunk-PKG3L2TJ.js.map +1 -0
- package/dist/chunk-VEXCTG6K.js +103 -0
- package/dist/chunk-VEXCTG6K.js.map +1 -0
- package/dist/chunk-YNA3GBAI.cjs +103 -0
- package/dist/chunk-YNA3GBAI.cjs.map +1 -0
- package/dist/index.cjs +5 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -14
- package/package.json +4 -3
- package/dist/ToastProvider-BaynjNgq.d.cts +0 -182
- package/dist/ToastProvider-BaynjNgq.d.ts +0 -182
- package/dist/chunk-565TFIAK.js.map +0 -1
- package/dist/chunk-56CIU4EG.cjs +0 -174
- package/dist/chunk-56CIU4EG.cjs.map +0 -1
- package/dist/chunk-7IFOMPCK.js +0 -174
- package/dist/chunk-7IFOMPCK.js.map +0 -1
- package/dist/chunk-K25U4BJO.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -27,11 +27,9 @@ import {
|
|
|
27
27
|
tabsVariants
|
|
28
28
|
} from "./chunk-HMYQTHGT.js";
|
|
29
29
|
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
toastVariants
|
|
34
|
-
} from "./chunk-7IFOMPCK.js";
|
|
30
|
+
Toast_default,
|
|
31
|
+
Toaster_default
|
|
32
|
+
} from "./chunk-VEXCTG6K.js";
|
|
35
33
|
import {
|
|
36
34
|
Tooltip_default
|
|
37
35
|
} from "./chunk-MF5KUM5I.js";
|
|
@@ -75,7 +73,7 @@ import {
|
|
|
75
73
|
import {
|
|
76
74
|
Alert_default,
|
|
77
75
|
alertVariants
|
|
78
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-PKG3L2TJ.js";
|
|
79
77
|
import {
|
|
80
78
|
AvatarGroup_default
|
|
81
79
|
} from "./chunk-HSREBNZV.js";
|
|
@@ -85,14 +83,14 @@ import {
|
|
|
85
83
|
import {
|
|
86
84
|
Badge_default
|
|
87
85
|
} from "./chunk-UEQG424R.js";
|
|
88
|
-
import {
|
|
89
|
-
Breadcrumb_default,
|
|
90
|
-
breadcrumbVariants
|
|
91
|
-
} from "./chunk-TJTBJ2NT.js";
|
|
92
86
|
import {
|
|
93
87
|
Button_default,
|
|
94
88
|
buttonVariants
|
|
95
89
|
} from "./chunk-2NMIKTA5.js";
|
|
90
|
+
import {
|
|
91
|
+
Breadcrumb_default,
|
|
92
|
+
breadcrumbVariants
|
|
93
|
+
} from "./chunk-TJTBJ2NT.js";
|
|
96
94
|
import "./chunk-OAIRL2FN.js";
|
|
97
95
|
export {
|
|
98
96
|
Accordion_default as Accordion,
|
|
@@ -114,11 +112,9 @@ export {
|
|
|
114
112
|
ProgressCircular_default as ProgressCircular,
|
|
115
113
|
Table_default as Table,
|
|
116
114
|
Tabs_default as Tabs,
|
|
117
|
-
|
|
118
|
-
ToastProvider_default as ToastProvider,
|
|
115
|
+
Toaster_default as Toaster,
|
|
119
116
|
Tooltip_default as Tooltip,
|
|
120
117
|
accordionVariants,
|
|
121
|
-
addToast,
|
|
122
118
|
alertVariants,
|
|
123
119
|
breadcrumbVariants,
|
|
124
120
|
buttonVariants,
|
|
@@ -135,7 +131,7 @@ export {
|
|
|
135
131
|
progressVariants,
|
|
136
132
|
tableVariants,
|
|
137
133
|
tabsVariants,
|
|
138
|
-
|
|
134
|
+
Toast_default as toast,
|
|
139
135
|
useDebounce,
|
|
140
136
|
useIsInitialRenderCycle,
|
|
141
137
|
useLocalStorage
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fuf-stack/pixels",
|
|
3
3
|
"description": "fuf core react component library",
|
|
4
4
|
"author": "Fröhlich ∧ Frei",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.8.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
8
8
|
"module": "./dist/index.js",
|
|
@@ -210,7 +210,8 @@
|
|
|
210
210
|
"@heroui/tooltip": "2.2.21",
|
|
211
211
|
"framer-motion": "12.29.0",
|
|
212
212
|
"next-themes": "0.4.6",
|
|
213
|
-
"react-icons": "5.5.0"
|
|
213
|
+
"react-icons": "5.5.0",
|
|
214
|
+
"sonner": "2.0.7"
|
|
214
215
|
},
|
|
215
216
|
"devDependencies": {
|
|
216
217
|
"@types/debug": "4.1.12",
|
|
@@ -220,5 +221,5 @@
|
|
|
220
221
|
"react": "19.2.4",
|
|
221
222
|
"react-dom": "19.2.4"
|
|
222
223
|
},
|
|
223
|
-
"gitHead": "
|
|
224
|
+
"gitHead": "f7d55704ba58fa6b8355432d25e02cbc944ba1d7"
|
|
224
225
|
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
-
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
declare const toastVariants: tailwind_variants.TVReturnType<{
|
|
7
|
-
color: {
|
|
8
|
-
default: string;
|
|
9
|
-
foreground: {
|
|
10
|
-
progressIndicator: string;
|
|
11
|
-
};
|
|
12
|
-
primary: {
|
|
13
|
-
progressIndicator: string;
|
|
14
|
-
};
|
|
15
|
-
secondary: {
|
|
16
|
-
progressIndicator: string;
|
|
17
|
-
};
|
|
18
|
-
success: {
|
|
19
|
-
progressIndicator: string;
|
|
20
|
-
};
|
|
21
|
-
warning: {
|
|
22
|
-
progressIndicator: string;
|
|
23
|
-
};
|
|
24
|
-
danger: {
|
|
25
|
-
progressIndicator: string;
|
|
26
|
-
};
|
|
27
|
-
info: {};
|
|
28
|
-
};
|
|
29
|
-
variant: {
|
|
30
|
-
flat: string;
|
|
31
|
-
solid: string;
|
|
32
|
-
bordered: string;
|
|
33
|
-
};
|
|
34
|
-
}, {
|
|
35
|
-
base: string;
|
|
36
|
-
title: string;
|
|
37
|
-
description: string;
|
|
38
|
-
icon: string;
|
|
39
|
-
loadingComponent: string;
|
|
40
|
-
content: string;
|
|
41
|
-
motionDiv: string;
|
|
42
|
-
progressTrack: string;
|
|
43
|
-
progressIndicator: string;
|
|
44
|
-
closeButton: string;
|
|
45
|
-
closeIcon: string;
|
|
46
|
-
}, undefined, {
|
|
47
|
-
color: {
|
|
48
|
-
default: string;
|
|
49
|
-
foreground: {
|
|
50
|
-
progressIndicator: string;
|
|
51
|
-
};
|
|
52
|
-
primary: {
|
|
53
|
-
progressIndicator: string;
|
|
54
|
-
};
|
|
55
|
-
secondary: {
|
|
56
|
-
progressIndicator: string;
|
|
57
|
-
};
|
|
58
|
-
success: {
|
|
59
|
-
progressIndicator: string;
|
|
60
|
-
};
|
|
61
|
-
warning: {
|
|
62
|
-
progressIndicator: string;
|
|
63
|
-
};
|
|
64
|
-
danger: {
|
|
65
|
-
progressIndicator: string;
|
|
66
|
-
};
|
|
67
|
-
info: {};
|
|
68
|
-
};
|
|
69
|
-
variant: {
|
|
70
|
-
flat: string;
|
|
71
|
-
solid: string;
|
|
72
|
-
bordered: string;
|
|
73
|
-
};
|
|
74
|
-
}, {
|
|
75
|
-
base: string;
|
|
76
|
-
title: string;
|
|
77
|
-
description: string;
|
|
78
|
-
icon: string;
|
|
79
|
-
loadingComponent: string;
|
|
80
|
-
content: string;
|
|
81
|
-
motionDiv: string;
|
|
82
|
-
progressTrack: string;
|
|
83
|
-
progressIndicator: string;
|
|
84
|
-
closeButton: string;
|
|
85
|
-
closeIcon: string;
|
|
86
|
-
}, tailwind_variants.TVReturnType<{
|
|
87
|
-
color: {
|
|
88
|
-
default: string;
|
|
89
|
-
foreground: {
|
|
90
|
-
progressIndicator: string;
|
|
91
|
-
};
|
|
92
|
-
primary: {
|
|
93
|
-
progressIndicator: string;
|
|
94
|
-
};
|
|
95
|
-
secondary: {
|
|
96
|
-
progressIndicator: string;
|
|
97
|
-
};
|
|
98
|
-
success: {
|
|
99
|
-
progressIndicator: string;
|
|
100
|
-
};
|
|
101
|
-
warning: {
|
|
102
|
-
progressIndicator: string;
|
|
103
|
-
};
|
|
104
|
-
danger: {
|
|
105
|
-
progressIndicator: string;
|
|
106
|
-
};
|
|
107
|
-
info: {};
|
|
108
|
-
};
|
|
109
|
-
variant: {
|
|
110
|
-
flat: string;
|
|
111
|
-
solid: string;
|
|
112
|
-
bordered: string;
|
|
113
|
-
};
|
|
114
|
-
}, {
|
|
115
|
-
base: string;
|
|
116
|
-
title: string;
|
|
117
|
-
description: string;
|
|
118
|
-
icon: string;
|
|
119
|
-
loadingComponent: string;
|
|
120
|
-
content: string;
|
|
121
|
-
motionDiv: string;
|
|
122
|
-
progressTrack: string;
|
|
123
|
-
progressIndicator: string;
|
|
124
|
-
closeButton: string;
|
|
125
|
-
closeIcon: string;
|
|
126
|
-
}, undefined, unknown, unknown, undefined>>;
|
|
127
|
-
type AddToastVariantProps = TVProps<typeof toastVariants>;
|
|
128
|
-
type ClassName = TVClassName<typeof toastVariants>;
|
|
129
|
-
interface ToastProps extends AddToastVariantProps {
|
|
130
|
-
/** CSS class name */
|
|
131
|
-
className?: ClassName;
|
|
132
|
-
/** Icon displayed at the end of the Alert */
|
|
133
|
-
closeIcon?: ReactNode;
|
|
134
|
-
/** Color of the alert */
|
|
135
|
-
color?: AddToastVariantProps['color'];
|
|
136
|
-
/** Content displayed inside the Alert */
|
|
137
|
-
description?: ReactNode;
|
|
138
|
-
/** Content displayed at the end of the Alert */
|
|
139
|
-
endContent?: ReactNode;
|
|
140
|
-
/** Icon displayed at the start of the Alert */
|
|
141
|
-
icon?: ReactNode;
|
|
142
|
-
/** Component displayed until promise is resolved */
|
|
143
|
-
loadingComponent?: ReactNode;
|
|
144
|
-
/** Callback function called when the toast is closed */
|
|
145
|
-
onClose?: () => void;
|
|
146
|
-
/** Promise based on which the notification will be styled */
|
|
147
|
-
promise?: Promise<void>;
|
|
148
|
-
/** Whether the toast should show a progress bar */
|
|
149
|
-
shouldShowTimeoutProgress?: boolean;
|
|
150
|
-
/** Whether the toast should show a close button */
|
|
151
|
-
showCloseButton?: boolean;
|
|
152
|
-
/** Whether the toast should show an icon */
|
|
153
|
-
showIcon?: boolean;
|
|
154
|
-
/** Time the toast is displayed */
|
|
155
|
-
timeout?: number;
|
|
156
|
-
/** Content displayed at the top of the toast */
|
|
157
|
-
title?: ReactNode;
|
|
158
|
-
/** Variant of the toast */
|
|
159
|
-
variant?: AddToastVariantProps['variant'];
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* addToast function based on [HeroUI Toast](https://www.heroui.com//docs/components/toast)
|
|
163
|
-
*/
|
|
164
|
-
declare const addToast: ({ className, closeIcon, color, description, endContent, icon, loadingComponent, onClose, promise, shouldShowTimeoutProgress, showCloseButton, showIcon, timeout, title, variant, }: ToastProps) => void;
|
|
165
|
-
|
|
166
|
-
type ToastProviderToastProps = Omit<ToastProps, 'description' | 'endContent' | 'title'>;
|
|
167
|
-
interface ToastProviderProps {
|
|
168
|
-
disableAnimation?: boolean;
|
|
169
|
-
maxVisibleToasts?: number;
|
|
170
|
-
placement?: 'bottom-right' | 'bottom-left' | 'bottom-center' | 'top-right' | 'top-left' | 'top-center';
|
|
171
|
-
toastProps?: ToastProviderToastProps;
|
|
172
|
-
toastOffset?: number;
|
|
173
|
-
regionProps?: {
|
|
174
|
-
classNames?: Record<'base', string>;
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* ToastProvider component based on [HeroUI Toast](https://www.heroui.com//docs/components/toast)
|
|
179
|
-
*/
|
|
180
|
-
declare const ToastProvider: ({ disableAnimation, maxVisibleToasts, placement, toastProps, toastOffset, regionProps, }: ToastProviderProps) => react_jsx_runtime.JSX.Element;
|
|
181
|
-
|
|
182
|
-
export { type AddToastVariantProps as A, ToastProvider as T, addToast as a, type ToastProps as b, type ToastProviderProps as c, toastVariants as t };
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
-
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
declare const toastVariants: tailwind_variants.TVReturnType<{
|
|
7
|
-
color: {
|
|
8
|
-
default: string;
|
|
9
|
-
foreground: {
|
|
10
|
-
progressIndicator: string;
|
|
11
|
-
};
|
|
12
|
-
primary: {
|
|
13
|
-
progressIndicator: string;
|
|
14
|
-
};
|
|
15
|
-
secondary: {
|
|
16
|
-
progressIndicator: string;
|
|
17
|
-
};
|
|
18
|
-
success: {
|
|
19
|
-
progressIndicator: string;
|
|
20
|
-
};
|
|
21
|
-
warning: {
|
|
22
|
-
progressIndicator: string;
|
|
23
|
-
};
|
|
24
|
-
danger: {
|
|
25
|
-
progressIndicator: string;
|
|
26
|
-
};
|
|
27
|
-
info: {};
|
|
28
|
-
};
|
|
29
|
-
variant: {
|
|
30
|
-
flat: string;
|
|
31
|
-
solid: string;
|
|
32
|
-
bordered: string;
|
|
33
|
-
};
|
|
34
|
-
}, {
|
|
35
|
-
base: string;
|
|
36
|
-
title: string;
|
|
37
|
-
description: string;
|
|
38
|
-
icon: string;
|
|
39
|
-
loadingComponent: string;
|
|
40
|
-
content: string;
|
|
41
|
-
motionDiv: string;
|
|
42
|
-
progressTrack: string;
|
|
43
|
-
progressIndicator: string;
|
|
44
|
-
closeButton: string;
|
|
45
|
-
closeIcon: string;
|
|
46
|
-
}, undefined, {
|
|
47
|
-
color: {
|
|
48
|
-
default: string;
|
|
49
|
-
foreground: {
|
|
50
|
-
progressIndicator: string;
|
|
51
|
-
};
|
|
52
|
-
primary: {
|
|
53
|
-
progressIndicator: string;
|
|
54
|
-
};
|
|
55
|
-
secondary: {
|
|
56
|
-
progressIndicator: string;
|
|
57
|
-
};
|
|
58
|
-
success: {
|
|
59
|
-
progressIndicator: string;
|
|
60
|
-
};
|
|
61
|
-
warning: {
|
|
62
|
-
progressIndicator: string;
|
|
63
|
-
};
|
|
64
|
-
danger: {
|
|
65
|
-
progressIndicator: string;
|
|
66
|
-
};
|
|
67
|
-
info: {};
|
|
68
|
-
};
|
|
69
|
-
variant: {
|
|
70
|
-
flat: string;
|
|
71
|
-
solid: string;
|
|
72
|
-
bordered: string;
|
|
73
|
-
};
|
|
74
|
-
}, {
|
|
75
|
-
base: string;
|
|
76
|
-
title: string;
|
|
77
|
-
description: string;
|
|
78
|
-
icon: string;
|
|
79
|
-
loadingComponent: string;
|
|
80
|
-
content: string;
|
|
81
|
-
motionDiv: string;
|
|
82
|
-
progressTrack: string;
|
|
83
|
-
progressIndicator: string;
|
|
84
|
-
closeButton: string;
|
|
85
|
-
closeIcon: string;
|
|
86
|
-
}, tailwind_variants.TVReturnType<{
|
|
87
|
-
color: {
|
|
88
|
-
default: string;
|
|
89
|
-
foreground: {
|
|
90
|
-
progressIndicator: string;
|
|
91
|
-
};
|
|
92
|
-
primary: {
|
|
93
|
-
progressIndicator: string;
|
|
94
|
-
};
|
|
95
|
-
secondary: {
|
|
96
|
-
progressIndicator: string;
|
|
97
|
-
};
|
|
98
|
-
success: {
|
|
99
|
-
progressIndicator: string;
|
|
100
|
-
};
|
|
101
|
-
warning: {
|
|
102
|
-
progressIndicator: string;
|
|
103
|
-
};
|
|
104
|
-
danger: {
|
|
105
|
-
progressIndicator: string;
|
|
106
|
-
};
|
|
107
|
-
info: {};
|
|
108
|
-
};
|
|
109
|
-
variant: {
|
|
110
|
-
flat: string;
|
|
111
|
-
solid: string;
|
|
112
|
-
bordered: string;
|
|
113
|
-
};
|
|
114
|
-
}, {
|
|
115
|
-
base: string;
|
|
116
|
-
title: string;
|
|
117
|
-
description: string;
|
|
118
|
-
icon: string;
|
|
119
|
-
loadingComponent: string;
|
|
120
|
-
content: string;
|
|
121
|
-
motionDiv: string;
|
|
122
|
-
progressTrack: string;
|
|
123
|
-
progressIndicator: string;
|
|
124
|
-
closeButton: string;
|
|
125
|
-
closeIcon: string;
|
|
126
|
-
}, undefined, unknown, unknown, undefined>>;
|
|
127
|
-
type AddToastVariantProps = TVProps<typeof toastVariants>;
|
|
128
|
-
type ClassName = TVClassName<typeof toastVariants>;
|
|
129
|
-
interface ToastProps extends AddToastVariantProps {
|
|
130
|
-
/** CSS class name */
|
|
131
|
-
className?: ClassName;
|
|
132
|
-
/** Icon displayed at the end of the Alert */
|
|
133
|
-
closeIcon?: ReactNode;
|
|
134
|
-
/** Color of the alert */
|
|
135
|
-
color?: AddToastVariantProps['color'];
|
|
136
|
-
/** Content displayed inside the Alert */
|
|
137
|
-
description?: ReactNode;
|
|
138
|
-
/** Content displayed at the end of the Alert */
|
|
139
|
-
endContent?: ReactNode;
|
|
140
|
-
/** Icon displayed at the start of the Alert */
|
|
141
|
-
icon?: ReactNode;
|
|
142
|
-
/** Component displayed until promise is resolved */
|
|
143
|
-
loadingComponent?: ReactNode;
|
|
144
|
-
/** Callback function called when the toast is closed */
|
|
145
|
-
onClose?: () => void;
|
|
146
|
-
/** Promise based on which the notification will be styled */
|
|
147
|
-
promise?: Promise<void>;
|
|
148
|
-
/** Whether the toast should show a progress bar */
|
|
149
|
-
shouldShowTimeoutProgress?: boolean;
|
|
150
|
-
/** Whether the toast should show a close button */
|
|
151
|
-
showCloseButton?: boolean;
|
|
152
|
-
/** Whether the toast should show an icon */
|
|
153
|
-
showIcon?: boolean;
|
|
154
|
-
/** Time the toast is displayed */
|
|
155
|
-
timeout?: number;
|
|
156
|
-
/** Content displayed at the top of the toast */
|
|
157
|
-
title?: ReactNode;
|
|
158
|
-
/** Variant of the toast */
|
|
159
|
-
variant?: AddToastVariantProps['variant'];
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* addToast function based on [HeroUI Toast](https://www.heroui.com//docs/components/toast)
|
|
163
|
-
*/
|
|
164
|
-
declare const addToast: ({ className, closeIcon, color, description, endContent, icon, loadingComponent, onClose, promise, shouldShowTimeoutProgress, showCloseButton, showIcon, timeout, title, variant, }: ToastProps) => void;
|
|
165
|
-
|
|
166
|
-
type ToastProviderToastProps = Omit<ToastProps, 'description' | 'endContent' | 'title'>;
|
|
167
|
-
interface ToastProviderProps {
|
|
168
|
-
disableAnimation?: boolean;
|
|
169
|
-
maxVisibleToasts?: number;
|
|
170
|
-
placement?: 'bottom-right' | 'bottom-left' | 'bottom-center' | 'top-right' | 'top-left' | 'top-center';
|
|
171
|
-
toastProps?: ToastProviderToastProps;
|
|
172
|
-
toastOffset?: number;
|
|
173
|
-
regionProps?: {
|
|
174
|
-
classNames?: Record<'base', string>;
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* ToastProvider component based on [HeroUI Toast](https://www.heroui.com//docs/components/toast)
|
|
179
|
-
*/
|
|
180
|
-
declare const ToastProvider: ({ disableAnimation, maxVisibleToasts, placement, toastProps, toastOffset, regionProps, }: ToastProviderProps) => react_jsx_runtime.JSX.Element;
|
|
181
|
-
|
|
182
|
-
export { type AddToastVariantProps as A, ToastProvider as T, addToast as a, type ToastProps as b, type ToastProviderProps as c, toastVariants as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Alert/Alert.tsx","../src/Alert/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { AlertProps as HeroAlertProps } from '@heroui/alert';\nimport type { ReactNode } from 'react';\n\nimport { Alert as HeroAlert } from '@heroui/alert';\nimport { alert as heroAlertVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const alertVariants = tv({\n slots: {\n base: '',\n title: '',\n description: '',\n mainWrapper: '',\n closeButton: '',\n iconWrapper: '',\n alertIcon: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/alert.ts\n color: {\n info: {\n mainWrapper: 'text-inherit',\n title: 'text-inherit',\n description: 'text-inherit',\n },\n ...heroAlertVariants.variants.color,\n },\n variant: {\n ...heroAlertVariants.variants.variant,\n },\n sizeLimit: {\n height: {\n base: 'max-h-[150px] overflow-y-auto overflow-x-hidden',\n },\n width: {\n base: 'max-w-[480px] overflow-x-auto overflow-y-hidden',\n },\n both: {\n base: 'max-h-[150px] max-w-[480px] overflow-y-auto overflow-x-hidden',\n },\n },\n },\n compoundVariants: [\n ...heroAlertVariants.compoundVariants,\n {\n color: 'info',\n variant: 'solid',\n className: {\n base: 'bg-info text-info-foreground',\n alertIcon: 'text-info-foreground',\n closeButton: 'text-inherit',\n },\n },\n {\n color: 'info',\n variant: 'flat',\n className: {\n alertIcon: 'fill-current',\n base: 'dark:bg-info-50/50 bg-info-50 text-info-600',\n closeButton: 'text-info-500 data-[hover]:bg-info-200',\n iconWrapper: 'border-info-100 bg-info-50 dark:bg-info-100',\n },\n },\n {\n color: 'info',\n variant: 'faded',\n className: {\n alertIcon: 'fill-current',\n base: 'dark:bg-info-50/50 border-small border-info-200 bg-info-50 text-info-600 dark:border-info-100',\n closeButton: 'text-info-500 data-[hover]:bg-info-200',\n iconWrapper: 'border-info-100 bg-info-50 dark:bg-info-100',\n },\n },\n {\n color: 'info',\n variant: 'bordered',\n className: {\n alertIcon: 'fill-current',\n base: 'border-small border-info text-info',\n closeButton: 'text-info-500 data-[hover]:bg-info-200',\n iconWrapper: 'bg-info-100 dark:bg-info-50',\n },\n },\n ],\n});\n\nexport type VariantProps = TVProps<typeof alertVariants>;\ntype ClassName = TVClassName<typeof alertVariants>;\n\nexport interface AlertProps extends VariantProps {\n /** Content displayed inside the Alert if no description is given! */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Color scheme of the Alert */\n color?: VariantProps['color'];\n /** Content displayed at the end of the Alert */\n endContent?: ReactNode;\n /** Icon displayed at the start of the Alert */\n icon?: ReactNode;\n /** Whether the Alert can be closed */\n isClosable?: boolean;\n /** Callback fired when the close button is clicked */\n onClose?: () => void;\n /** Whether to show the icon at the start */\n showIcon?: boolean;\n /** limit height to 150px or width to 480px or both */\n sizeLimit?: VariantProps['sizeLimit'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Title displayed in the Alert above the content */\n title?: ReactNode;\n /** Style variant of the Alert */\n variant?: VariantProps['variant'];\n}\n\n/**\n * Alert component based on [HeroUI Alert](https://www.heroui.com//docs/components/alert)\n */\nconst Alert = ({\n children = undefined,\n className = undefined,\n color = 'primary',\n endContent = undefined,\n icon = undefined,\n isClosable = false,\n onClose = undefined,\n sizeLimit = undefined,\n showIcon = true,\n testId = undefined,\n title = undefined,\n variant = 'solid',\n}: AlertProps) => {\n const variants = alertVariants({\n color,\n variant,\n sizeLimit,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // pass color prop for heroui colors\n const heroColor = Object.keys(heroAlertVariants.variants.color).includes(\n color,\n )\n ? (color as HeroAlertProps['color'])\n : undefined;\n\n return (\n <HeroAlert\n classNames={classNames}\n color={heroColor}\n data-testid={testId}\n description={title ? children : undefined}\n endContent={endContent}\n hideIcon={!showIcon}\n icon={icon}\n isClosable={isClosable}\n onClose={onClose}\n title={(title ?? children) as string}\n variant={variant}\n />\n );\n};\n\nexport default Alert;\n","import Alert, { alertVariants } from './Alert';\n\nexport type { AlertProps } from './Alert';\n\nexport { Alert, alertVariants };\n\nexport default Alert;\n"],"mappings":";;;;;AAIA,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,yBAAyB;AAE3C,SAAS,IAAI,4BAA4B;AA+IrC;AA7IG,IAAM,gBAAgB,GAAG;AAAA,EAC9B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AAAA,EACA,UAAU;AAAA;AAAA,IAER,OAAO;AAAA,MACL,MAAM;AAAA,QACJ,aAAa;AAAA,QACb,OAAO;AAAA,QACP,aAAa;AAAA,MACf;AAAA,OACG,kBAAkB,SAAS;AAAA,IAEhC,SAAS,mBACJ,kBAAkB,SAAS;AAAA,IAEhC,WAAW;AAAA,MACT,QAAQ;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,OAAO;AAAA,QACL,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,kBAAkB;AAAA,IAChB,GAAG,kBAAkB;AAAA,IACrB;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,QACT,MAAM;AAAA,QACN,WAAW;AAAA,QACX,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,QACT,WAAW;AAAA,QACX,MAAM;AAAA,QACN,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,QACT,WAAW;AAAA,QACX,MAAM;AAAA,QACN,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,QACT,WAAW;AAAA,QACX,MAAM;AAAA,QACN,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAmCD,IAAM,QAAQ,CAAC;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,OAAO;AAAA,EACP,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AACZ,MAAkB;AAChB,QAAM,WAAW,cAAc;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,aAAa,qBAAqB,UAAU,WAAW,MAAM;AAGnE,QAAM,YAAY,OAAO,KAAK,kBAAkB,SAAS,KAAK,EAAE;AAAA,IAC9D;AAAA,EACF,IACK,QACD;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAO;AAAA,MACP,eAAa;AAAA,MACb,aAAa,QAAQ,WAAW;AAAA,MAChC;AAAA,MACA,UAAU,CAAC;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAQ,wBAAS;AAAA,MACjB;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,gBAAQ;;;AChKf,IAAOA,iBAAQ;","names":["Alert_default"]}
|
package/dist/chunk-56CIU4EG.cjs
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkAHEA4IJVcjs = require('./chunk-AHEA4IJV.cjs');
|
|
5
|
-
|
|
6
|
-
// src/Toast/index.ts
|
|
7
|
-
var _toast = require('@heroui/toast');
|
|
8
|
-
|
|
9
|
-
// src/Toast/addToast.tsx
|
|
10
|
-
var _theme = require('@heroui/theme');
|
|
11
|
-
|
|
12
|
-
var _pixelutils = require('@fuf-stack/pixel-utils');
|
|
13
|
-
var toastVariants = _pixelutils.tv.call(void 0, {
|
|
14
|
-
slots: {
|
|
15
|
-
base: "",
|
|
16
|
-
title: "",
|
|
17
|
-
description: "",
|
|
18
|
-
icon: "",
|
|
19
|
-
loadingComponent: "",
|
|
20
|
-
content: "",
|
|
21
|
-
motionDiv: "",
|
|
22
|
-
progressTrack: "",
|
|
23
|
-
progressIndicator: "",
|
|
24
|
-
closeButton: "",
|
|
25
|
-
closeIcon: ""
|
|
26
|
-
},
|
|
27
|
-
variants: {
|
|
28
|
-
// see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/toast.ts
|
|
29
|
-
color: _chunkAHEA4IJVcjs.__spreadValues.call(void 0, {
|
|
30
|
-
info: {}
|
|
31
|
-
}, _theme.toast.variants.color),
|
|
32
|
-
variant: _chunkAHEA4IJVcjs.__spreadValues.call(void 0, {}, _theme.toast.variants.variant)
|
|
33
|
-
},
|
|
34
|
-
compoundVariants: [
|
|
35
|
-
..._theme.toast.compoundVariants,
|
|
36
|
-
{
|
|
37
|
-
variant: "solid",
|
|
38
|
-
color: "info",
|
|
39
|
-
className: {
|
|
40
|
-
base: "bg-info text-info-foreground",
|
|
41
|
-
title: "text-info-foreground",
|
|
42
|
-
description: "text-info-foreground",
|
|
43
|
-
icon: "text-info-foreground",
|
|
44
|
-
closeIcon: "border-info-400 bg-info-100",
|
|
45
|
-
closeButton: "text-info-400 hover:text-info-600",
|
|
46
|
-
progressIndicator: "bg-info-400"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
color: "info",
|
|
51
|
-
variant: "flat",
|
|
52
|
-
className: {
|
|
53
|
-
base: "dark:bg-info-50/50 bg-info-50 text-info-600",
|
|
54
|
-
title: "text-info-600",
|
|
55
|
-
description: "text-info-500",
|
|
56
|
-
icon: "text-info-600",
|
|
57
|
-
closeIcon: "border-info-400 bg-info-100",
|
|
58
|
-
closeButton: "text-info-400 hover:text-info-600",
|
|
59
|
-
progressIndicator: "bg-info-400"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
color: "info",
|
|
64
|
-
variant: "bordered",
|
|
65
|
-
className: {
|
|
66
|
-
base: "border-small border-info text-info-600",
|
|
67
|
-
title: "text-info-600",
|
|
68
|
-
description: "text-info-500",
|
|
69
|
-
icon: "text-info-600",
|
|
70
|
-
closeIcon: "border-info-400 bg-info-100",
|
|
71
|
-
closeButton: "text-info-400 hover:text-info-600",
|
|
72
|
-
progressIndicator: "bg-info-400"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
var addToast = ({
|
|
78
|
-
className = void 0,
|
|
79
|
-
closeIcon = void 0,
|
|
80
|
-
color = "default",
|
|
81
|
-
description = void 0,
|
|
82
|
-
endContent = void 0,
|
|
83
|
-
icon = void 0,
|
|
84
|
-
loadingComponent = void 0,
|
|
85
|
-
onClose = void 0,
|
|
86
|
-
promise = void 0,
|
|
87
|
-
shouldShowTimeoutProgress = false,
|
|
88
|
-
showCloseButton = true,
|
|
89
|
-
showIcon = true,
|
|
90
|
-
timeout = 5e3,
|
|
91
|
-
title = void 0,
|
|
92
|
-
variant = "bordered"
|
|
93
|
-
}) => {
|
|
94
|
-
const variants = toastVariants({
|
|
95
|
-
color,
|
|
96
|
-
variant
|
|
97
|
-
});
|
|
98
|
-
const isHeroUIColor = Object.keys(_theme.toast.variants.color).includes(
|
|
99
|
-
color
|
|
100
|
-
);
|
|
101
|
-
const classNames = _pixelutils.variantsToClassNames.call(void 0, variants, className, "base");
|
|
102
|
-
_toast.addToast.call(void 0, {
|
|
103
|
-
classNames,
|
|
104
|
-
closeIcon,
|
|
105
|
-
color: isHeroUIColor ? color : void 0,
|
|
106
|
-
// TODO: 'data-testid': testId,
|
|
107
|
-
description,
|
|
108
|
-
endContent,
|
|
109
|
-
hideCloseButton: !showCloseButton,
|
|
110
|
-
hideIcon: !showIcon,
|
|
111
|
-
icon,
|
|
112
|
-
loadingComponent,
|
|
113
|
-
onClose,
|
|
114
|
-
promise,
|
|
115
|
-
shouldShowTimeoutProgress,
|
|
116
|
-
timeout,
|
|
117
|
-
title,
|
|
118
|
-
variant
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// src/Toast/ToastProvider.tsx
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
127
|
-
var ToastProvider = ({
|
|
128
|
-
disableAnimation = false,
|
|
129
|
-
maxVisibleToasts = 5,
|
|
130
|
-
placement = "top-center",
|
|
131
|
-
toastProps = void 0,
|
|
132
|
-
toastOffset = 26,
|
|
133
|
-
regionProps = void 0
|
|
134
|
-
}) => {
|
|
135
|
-
const variants = toastVariants({
|
|
136
|
-
color: toastProps == null ? void 0 : toastProps.color,
|
|
137
|
-
variant: toastProps == null ? void 0 : toastProps.variant
|
|
138
|
-
});
|
|
139
|
-
const isHeroUIColor = Object.keys(_theme.toast.variants.color).includes(
|
|
140
|
-
(toastProps == null ? void 0 : toastProps.color) || ""
|
|
141
|
-
);
|
|
142
|
-
const classNames = _pixelutils.variantsToClassNames.call(void 0,
|
|
143
|
-
variants,
|
|
144
|
-
toastProps == null ? void 0 : toastProps.className,
|
|
145
|
-
"base"
|
|
146
|
-
);
|
|
147
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
148
|
-
_toast.ToastProvider,
|
|
149
|
-
{
|
|
150
|
-
disableAnimation,
|
|
151
|
-
maxVisibleToasts,
|
|
152
|
-
placement,
|
|
153
|
-
regionProps,
|
|
154
|
-
toastOffset,
|
|
155
|
-
toastProps: _chunkAHEA4IJVcjs.__spreadProps.call(void 0, _chunkAHEA4IJVcjs.__spreadValues.call(void 0, {}, toastProps), {
|
|
156
|
-
classNames,
|
|
157
|
-
color: isHeroUIColor ? toastProps == null ? void 0 : toastProps.color : void 0
|
|
158
|
-
})
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
};
|
|
162
|
-
var ToastProvider_default = ToastProvider;
|
|
163
|
-
|
|
164
|
-
// src/Toast/index.ts
|
|
165
|
-
var Toast_default = addToast;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
exports.toastVariants = toastVariants; exports.addToast = addToast; exports.ToastProvider_default = ToastProvider_default; exports.Toast = _toast.Toast; exports.Toast_default = Toast_default;
|
|
174
|
-
//# sourceMappingURL=chunk-56CIU4EG.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-56CIU4EG.cjs","../src/Toast/index.ts","../src/Toast/addToast.tsx","../src/Toast/ToastProvider.tsx"],"names":["heroToastVariants","variantsToClassNames"],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACLA,sCAAsB;ADOtB;AACA;AEJA,sCAA2C;AAC3C;AAEA,oDAAyC;AAElC,IAAM,cAAA,EAAgB,4BAAA;AAAG,EAC9B,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,EAAA;AAAA,IACN,KAAA,EAAO,EAAA;AAAA,IACP,WAAA,EAAa,EAAA;AAAA,IACb,IAAA,EAAM,EAAA;AAAA,IACN,gBAAA,EAAkB,EAAA;AAAA,IAClB,OAAA,EAAS,EAAA;AAAA,IACT,SAAA,EAAW,EAAA;AAAA,IACX,aAAA,EAAe,EAAA;AAAA,IACf,iBAAA,EAAmB,EAAA;AAAA,IACnB,WAAA,EAAa,EAAA;AAAA,IACb,SAAA,EAAW;AAAA,EACb,CAAA;AAAA,EAC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cAAA,EACF,WAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,MAAA,EACb,KAAA;AAAA,MACN,CAAA;AAAA,IAAA;AAAA,EACF,CAAA;AAEJ,CAAA;AAEA,IAAO,sBAAA,EAAQ,aAAA;AH0Ff;AACA;ACzJA,IAAO,cAAA,EAAQ,QAAA;AD2Jf;AACA;AACE;AACA;AACA;AACA;AACA;AACF,+LAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-56CIU4EG.cjs","sourcesContent":[null,"import { Toast } from '@heroui/toast';\n\nimport { addToast, toastVariants } from './addToast';\nimport ToastProvider from './ToastProvider';\n\nexport type { ToastProps, AddToastVariantProps } from './addToast';\nexport type { ToastProviderProps } from './ToastProvider';\n\nexport { addToast, Toast, ToastProvider, toastVariants };\n\nexport default addToast;\n","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ToastProps as HeroToastProps } from '@heroui/toast';\nimport type { ReactNode } from 'react';\n\nimport { toast as heroToastVariants } from '@heroui/theme';\nimport { addToast as heroAddToast } from '@heroui/toast';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const toastVariants = tv({\n slots: {\n base: '',\n title: '',\n description: '',\n icon: '',\n loadingComponent: '',\n content: '',\n motionDiv: '',\n progressTrack: '',\n progressIndicator: '',\n closeButton: '',\n closeIcon: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/toast.ts\n color: {\n info: {},\n ...heroToastVariants.variants.color,\n },\n variant: {\n ...heroToastVariants.variants.variant,\n },\n },\n compoundVariants: [\n ...heroToastVariants.compoundVariants,\n {\n variant: 'solid',\n color: 'info',\n className: {\n base: 'bg-info text-info-foreground',\n title: 'text-info-foreground',\n description: 'text-info-foreground',\n icon: 'text-info-foreground',\n closeIcon: 'border-info-400 bg-info-100',\n closeButton: 'text-info-400 hover:text-info-600',\n progressIndicator: 'bg-info-400',\n },\n },\n {\n color: 'info',\n variant: 'flat',\n className: {\n base: 'dark:bg-info-50/50 bg-info-50 text-info-600',\n title: 'text-info-600',\n description: 'text-info-500',\n icon: 'text-info-600',\n closeIcon: 'border-info-400 bg-info-100',\n closeButton: 'text-info-400 hover:text-info-600',\n progressIndicator: 'bg-info-400',\n },\n },\n\n {\n color: 'info',\n variant: 'bordered',\n className: {\n base: 'border-small border-info text-info-600',\n title: 'text-info-600',\n description: 'text-info-500',\n icon: 'text-info-600',\n closeIcon: 'border-info-400 bg-info-100',\n closeButton: 'text-info-400 hover:text-info-600',\n progressIndicator: 'bg-info-400',\n },\n },\n ],\n});\n\nexport type AddToastVariantProps = TVProps<typeof toastVariants>;\ntype ClassName = TVClassName<typeof toastVariants>;\n\nexport interface ToastProps extends AddToastVariantProps {\n /** CSS class name */\n className?: ClassName;\n /** Icon displayed at the end of the Alert */\n closeIcon?: ReactNode;\n /** Color of the alert */\n color?: AddToastVariantProps['color'];\n /** Content displayed inside the Alert */\n description?: ReactNode;\n /** Content displayed at the end of the Alert */\n endContent?: ReactNode;\n /** Icon displayed at the start of the Alert */\n icon?: ReactNode;\n /** Component displayed until promise is resolved */\n loadingComponent?: ReactNode;\n /** Callback function called when the toast is closed */\n onClose?: () => void;\n /** Promise based on which the notification will be styled */\n promise?: Promise<void>;\n /** Whether the toast should show a progress bar */\n shouldShowTimeoutProgress?: boolean;\n /** Whether the toast should show a close button */\n showCloseButton?: boolean;\n /** Whether the toast should show an icon */\n showIcon?: boolean;\n /** Time the toast is displayed */\n timeout?: number;\n /** Content displayed at the top of the toast */\n title?: ReactNode;\n /** Variant of the toast */\n variant?: AddToastVariantProps['variant'];\n}\n\n/**\n * addToast function based on [HeroUI Toast](https://www.heroui.com//docs/components/toast)\n */\nexport const addToast = ({\n className = undefined,\n closeIcon = undefined,\n color = 'default',\n description = undefined,\n endContent = undefined,\n icon = undefined,\n loadingComponent = undefined,\n onClose = undefined,\n promise = undefined,\n shouldShowTimeoutProgress = false,\n showCloseButton = true,\n showIcon = true,\n timeout = 5000,\n title = undefined,\n variant = 'bordered',\n}: ToastProps) => {\n const variants = toastVariants({\n color,\n variant,\n });\n const isHeroUIColor = Object.keys(heroToastVariants.variants.color).includes(\n color,\n );\n const classNames = variantsToClassNames(variants, className, 'base');\n\n heroAddToast({\n classNames,\n closeIcon,\n color: isHeroUIColor ? (color as HeroToastProps['color']) : undefined,\n // TODO: 'data-testid': testId,\n description,\n endContent,\n hideCloseButton: !showCloseButton,\n hideIcon: !showIcon,\n icon,\n loadingComponent,\n onClose,\n promise,\n shouldShowTimeoutProgress,\n timeout,\n title,\n variant,\n });\n};\n\nexport default addToast;\n","import type { ToastProps as HeroToastProps } from '@heroui/toast';\nimport type { ToastProps } from './addToast';\n\nimport { toast as heroToastVariants } from '@heroui/theme';\nimport { ToastProvider as HeroToastProvider } from '@heroui/toast';\n\nimport { variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { toastVariants } from './addToast';\n\nexport type ToastProviderToastProps = Omit<\n ToastProps,\n 'description' | 'endContent' | 'title'\n>;\n\nexport interface ToastProviderProps {\n disableAnimation?: boolean;\n maxVisibleToasts?: number;\n placement?:\n | 'bottom-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'top-right'\n | 'top-left'\n | 'top-center';\n\n toastProps?: ToastProviderToastProps;\n toastOffset?: number;\n regionProps?: { classNames?: Record<'base', string> };\n}\n\n/**\n * ToastProvider component based on [HeroUI Toast](https://www.heroui.com//docs/components/toast)\n */\nconst ToastProvider = ({\n disableAnimation = false,\n maxVisibleToasts = 5,\n placement = 'top-center',\n toastProps = undefined,\n toastOffset = 26,\n regionProps = undefined,\n}: ToastProviderProps) => {\n const variants = toastVariants({\n color: toastProps?.color,\n variant: toastProps?.variant,\n });\n const isHeroUIColor = Object.keys(heroToastVariants.variants.color).includes(\n toastProps?.color || '',\n );\n const classNames = variantsToClassNames(\n variants,\n toastProps?.className,\n 'base',\n );\n return (\n <HeroToastProvider\n disableAnimation={disableAnimation}\n maxVisibleToasts={maxVisibleToasts}\n placement={placement}\n regionProps={regionProps}\n toastOffset={toastOffset}\n toastProps={{\n ...toastProps,\n classNames,\n color: isHeroUIColor\n ? (toastProps?.color as HeroToastProps['color'])\n : undefined,\n }}\n />\n );\n};\n\nexport default ToastProvider;\n"]}
|