@fuf-stack/pixels 0.41.0 → 0.41.2
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/Toast/index.cjs +16 -0
- package/dist/Toast/index.cjs.map +1 -0
- package/dist/Toast/index.d.cts +12 -0
- package/dist/Toast/index.d.ts +12 -0
- package/dist/Toast/index.js +16 -0
- package/dist/Toast/index.js.map +1 -0
- package/dist/ToastProvider-CL1v-bkE.d.cts +295 -0
- package/dist/ToastProvider-CL1v-bkE.d.ts +295 -0
- package/dist/chunk-GXIDQFQ6.cjs +174 -0
- package/dist/chunk-GXIDQFQ6.cjs.map +1 -0
- package/dist/chunk-ZMEVGJBC.js +174 -0
- package/dist/chunk-ZMEVGJBC.js.map +1 -0
- package/dist/index.cjs +8 -159
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -295
- package/dist/index.d.ts +7 -295
- package/dist/index.js +8 -159
- package/dist/index.js.map +1 -1
- package/package.json +7 -2
package/dist/index.js
CHANGED
|
@@ -14,6 +14,12 @@ import {
|
|
|
14
14
|
Tabs_default,
|
|
15
15
|
tabsVariants
|
|
16
16
|
} from "./chunk-JZHEG3SM.js";
|
|
17
|
+
import {
|
|
18
|
+
Toast,
|
|
19
|
+
ToastProvider_default,
|
|
20
|
+
addToast,
|
|
21
|
+
toastVariants
|
|
22
|
+
} from "./chunk-ZMEVGJBC.js";
|
|
17
23
|
import {
|
|
18
24
|
Tooltip_default
|
|
19
25
|
} from "./chunk-YXWPOEX6.js";
|
|
@@ -79,165 +85,7 @@ import {
|
|
|
79
85
|
Button_default,
|
|
80
86
|
buttonVariants
|
|
81
87
|
} from "./chunk-MAKWBTTW.js";
|
|
82
|
-
import
|
|
83
|
-
__spreadProps,
|
|
84
|
-
__spreadValues
|
|
85
|
-
} from "./chunk-J7N2552D.js";
|
|
86
|
-
|
|
87
|
-
// src/Toast/addToast.tsx
|
|
88
|
-
import { toast as heroToastVariants } from "@heroui/theme";
|
|
89
|
-
import { addToast as heroAddToast } from "@heroui/toast";
|
|
90
|
-
import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
91
|
-
var toastVariants = tv({
|
|
92
|
-
slots: {
|
|
93
|
-
base: "",
|
|
94
|
-
title: "",
|
|
95
|
-
description: "",
|
|
96
|
-
icon: "",
|
|
97
|
-
loadingIcon: "",
|
|
98
|
-
content: "",
|
|
99
|
-
motionDiv: "",
|
|
100
|
-
progressTrack: "",
|
|
101
|
-
progressIndicator: "",
|
|
102
|
-
closeButton: "",
|
|
103
|
-
closeIcon: ""
|
|
104
|
-
},
|
|
105
|
-
variants: {
|
|
106
|
-
// see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/toast.ts
|
|
107
|
-
color: __spreadValues({
|
|
108
|
-
info: {}
|
|
109
|
-
}, heroToastVariants.variants.color),
|
|
110
|
-
variant: __spreadValues({}, heroToastVariants.variants.variant)
|
|
111
|
-
},
|
|
112
|
-
compoundVariants: [
|
|
113
|
-
...heroToastVariants.compoundVariants,
|
|
114
|
-
{
|
|
115
|
-
variant: "solid",
|
|
116
|
-
color: "info",
|
|
117
|
-
className: {
|
|
118
|
-
base: "bg-info text-info-foreground",
|
|
119
|
-
title: "text-info-foreground",
|
|
120
|
-
description: "text-info-foreground",
|
|
121
|
-
icon: "text-info-foreground",
|
|
122
|
-
closeIcon: "border-info-400 bg-info-100",
|
|
123
|
-
closeButton: "text-info-400 hover:text-info-600",
|
|
124
|
-
progressIndicator: "bg-info-400"
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
color: "info",
|
|
129
|
-
variant: "flat",
|
|
130
|
-
className: {
|
|
131
|
-
base: "bg-info-50 text-info-600 dark:bg-info-50/50",
|
|
132
|
-
title: "text-info-600",
|
|
133
|
-
description: "text-info-500",
|
|
134
|
-
icon: "text-info-600",
|
|
135
|
-
closeIcon: "border-info-400 bg-info-100",
|
|
136
|
-
closeButton: "text-info-400 hover:text-info-600",
|
|
137
|
-
progressIndicator: "bg-info-400"
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
color: "info",
|
|
142
|
-
variant: "bordered",
|
|
143
|
-
className: {
|
|
144
|
-
base: "border-small border-info text-info-600",
|
|
145
|
-
title: "text-info-600",
|
|
146
|
-
description: "text-info-500",
|
|
147
|
-
icon: "text-info-600",
|
|
148
|
-
closeIcon: "border-info-400 bg-info-100",
|
|
149
|
-
closeButton: "text-info-400 hover:text-info-600",
|
|
150
|
-
progressIndicator: "bg-info-400"
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
]
|
|
154
|
-
});
|
|
155
|
-
var addToast = ({
|
|
156
|
-
className = void 0,
|
|
157
|
-
closeIcon = void 0,
|
|
158
|
-
color = "default",
|
|
159
|
-
description = void 0,
|
|
160
|
-
endContent = void 0,
|
|
161
|
-
icon = void 0,
|
|
162
|
-
loadingIcon = void 0,
|
|
163
|
-
onClose = void 0,
|
|
164
|
-
promise = void 0,
|
|
165
|
-
shouldShowTimeoutProgress = false,
|
|
166
|
-
showCloseButton = true,
|
|
167
|
-
showIcon = true,
|
|
168
|
-
timeout = 5e3,
|
|
169
|
-
title = void 0,
|
|
170
|
-
variant = "bordered"
|
|
171
|
-
}) => {
|
|
172
|
-
const variants = toastVariants({
|
|
173
|
-
color,
|
|
174
|
-
variant
|
|
175
|
-
});
|
|
176
|
-
const isHeroUIColor = Object.keys(heroToastVariants.variants.color).includes(
|
|
177
|
-
color
|
|
178
|
-
);
|
|
179
|
-
const classNames = variantsToClassNames(variants, className, "base");
|
|
180
|
-
heroAddToast({
|
|
181
|
-
classNames,
|
|
182
|
-
closeIcon,
|
|
183
|
-
color: isHeroUIColor ? color : void 0,
|
|
184
|
-
// TODO: 'data-testid': testId,
|
|
185
|
-
description,
|
|
186
|
-
endContent,
|
|
187
|
-
hideCloseButton: !showCloseButton,
|
|
188
|
-
hideIcon: !showIcon,
|
|
189
|
-
icon,
|
|
190
|
-
loadingIcon,
|
|
191
|
-
onClose,
|
|
192
|
-
promise,
|
|
193
|
-
shouldShowTimeoutProgress,
|
|
194
|
-
timeout,
|
|
195
|
-
title,
|
|
196
|
-
variant
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
// src/Toast/ToastProvider.tsx
|
|
201
|
-
import { toast as heroToastVariants2 } from "@heroui/theme";
|
|
202
|
-
import { ToastProvider as HeroToastProvider } from "@heroui/toast";
|
|
203
|
-
import { variantsToClassNames as variantsToClassNames2 } from "@fuf-stack/pixel-utils";
|
|
204
|
-
import { jsx } from "react/jsx-runtime";
|
|
205
|
-
var ToastProvider = ({
|
|
206
|
-
disableAnimation = false,
|
|
207
|
-
maxVisibleToasts = 5,
|
|
208
|
-
placement = "top-center",
|
|
209
|
-
toastProps = void 0,
|
|
210
|
-
toastOffset = 26,
|
|
211
|
-
regionProps = void 0
|
|
212
|
-
}) => {
|
|
213
|
-
const variants = toastVariants({
|
|
214
|
-
color: toastProps == null ? void 0 : toastProps.color,
|
|
215
|
-
variant: toastProps == null ? void 0 : toastProps.variant
|
|
216
|
-
});
|
|
217
|
-
const isHeroUIColor = Object.keys(heroToastVariants2.variants.color).includes(
|
|
218
|
-
(toastProps == null ? void 0 : toastProps.color) || ""
|
|
219
|
-
);
|
|
220
|
-
const classNames = variantsToClassNames2(
|
|
221
|
-
variants,
|
|
222
|
-
toastProps == null ? void 0 : toastProps.className,
|
|
223
|
-
"base"
|
|
224
|
-
);
|
|
225
|
-
return /* @__PURE__ */ jsx(
|
|
226
|
-
HeroToastProvider,
|
|
227
|
-
{
|
|
228
|
-
disableAnimation,
|
|
229
|
-
maxVisibleToasts,
|
|
230
|
-
placement,
|
|
231
|
-
regionProps,
|
|
232
|
-
toastOffset,
|
|
233
|
-
toastProps: __spreadProps(__spreadValues({}, toastProps), {
|
|
234
|
-
classNames,
|
|
235
|
-
color: isHeroUIColor ? toastProps == null ? void 0 : toastProps.color : void 0
|
|
236
|
-
})
|
|
237
|
-
}
|
|
238
|
-
);
|
|
239
|
-
};
|
|
240
|
-
var ToastProvider_default = ToastProvider;
|
|
88
|
+
import "./chunk-J7N2552D.js";
|
|
241
89
|
export {
|
|
242
90
|
Accordion_default as Accordion,
|
|
243
91
|
Alert_default as Alert,
|
|
@@ -258,6 +106,7 @@ export {
|
|
|
258
106
|
ProgressCircular_default as ProgressCircular,
|
|
259
107
|
Table_default as Table,
|
|
260
108
|
Tabs_default as Tabs,
|
|
109
|
+
Toast,
|
|
261
110
|
ToastProvider_default as ToastProvider,
|
|
262
111
|
Tooltip_default as Tooltip,
|
|
263
112
|
accordionVariants,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
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": "Hannes Tiede",
|
|
5
|
-
"version": "0.41.
|
|
5
|
+
"version": "0.41.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
8
8
|
"module": "./dist/index.js",
|
|
@@ -123,6 +123,11 @@
|
|
|
123
123
|
"import": "./dist/Tabs/index.js",
|
|
124
124
|
"require": "./dist/Tabs/index.cjs"
|
|
125
125
|
},
|
|
126
|
+
"./Toast": {
|
|
127
|
+
"types": "./dist/Toast/index.d.ts",
|
|
128
|
+
"import": "./dist/Toast/index.js",
|
|
129
|
+
"require": "./dist/Toast/index.cjs"
|
|
130
|
+
},
|
|
126
131
|
"./Tooltip": {
|
|
127
132
|
"types": "./dist/Tooltip/index.d.ts",
|
|
128
133
|
"import": "./dist/Tooltip/index.js",
|
|
@@ -188,8 +193,8 @@
|
|
|
188
193
|
"react": "19.0.0",
|
|
189
194
|
"react-dom": "19.0.0",
|
|
190
195
|
"@repo/storybook-config": "0.0.1",
|
|
191
|
-
"@repo/tailwind-config": "0.0.1",
|
|
192
196
|
"@repo/tsup-config": "0.0.1",
|
|
197
|
+
"@repo/tailwind-config": "0.0.1",
|
|
193
198
|
"@repo/vite-config": "0.0.1"
|
|
194
199
|
},
|
|
195
200
|
"scripts": {
|