@pittorica/toast-react 0.23.1 → 0.24.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/index.js +118 -110
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as y, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { createPortal as
|
|
1
|
+
import { jsx as y, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as O, createElement as F, useState as V, useRef as D, useCallback as G, useEffect as H } from "react";
|
|
3
|
+
import { createPortal as J } from "react-dom";
|
|
4
4
|
/**
|
|
5
5
|
* @license @tabler/icons-react v3.36.1 - MIT
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license.
|
|
8
8
|
* See the LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
var
|
|
10
|
+
var K = {
|
|
11
11
|
outline: {
|
|
12
12
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13
13
|
width: 24,
|
|
@@ -34,22 +34,22 @@ var J = {
|
|
|
34
34
|
* This source code is licensed under the MIT license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
36
|
*/
|
|
37
|
-
const
|
|
38
|
-
const o =
|
|
39
|
-
({ color: n = "currentColor", size: c = 24, stroke: l = 2, title: s, className: p, children: d, ...
|
|
37
|
+
const Q = (e, i, r, t) => {
|
|
38
|
+
const o = O(
|
|
39
|
+
({ color: n = "currentColor", size: c = 24, stroke: l = 2, title: s, className: p, children: d, ...m }, f) => F(
|
|
40
40
|
"svg",
|
|
41
41
|
{
|
|
42
|
-
ref:
|
|
43
|
-
...
|
|
42
|
+
ref: f,
|
|
43
|
+
...K[e],
|
|
44
44
|
width: c,
|
|
45
45
|
height: c,
|
|
46
46
|
className: ["tabler-icon", `tabler-icon-${i}`, p].join(" "),
|
|
47
47
|
fill: n,
|
|
48
|
-
...
|
|
48
|
+
...m
|
|
49
49
|
},
|
|
50
50
|
[
|
|
51
|
-
s &&
|
|
52
|
-
...t.map(([g,
|
|
51
|
+
s && F("title", { key: "svg-title" }, s),
|
|
52
|
+
...t.map(([g, u]) => F(g, u)),
|
|
53
53
|
...Array.isArray(d) ? d : [d]
|
|
54
54
|
]
|
|
55
55
|
)
|
|
@@ -62,21 +62,21 @@ const K = (e, i, r, t) => {
|
|
|
62
62
|
* This source code is licensed under the MIT license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
64
|
*/
|
|
65
|
-
const
|
|
66
|
-
function
|
|
65
|
+
const U = [["path", { d: "M12 2l.324 .001l.318 .004l.616 .017l.299 .013l.579 .034l.553 .046c4.785 .464 6.732 2.411 7.196 7.196l.046 .553l.034 .579c.005 .098 .01 .198 .013 .299l.017 .616l.005 .642l-.005 .642l-.017 .616l-.013 .299l-.034 .579l-.046 .553c-.464 4.785 -2.411 6.732 -7.196 7.196l-.553 .046l-.579 .034c-.098 .005 -.198 .01 -.299 .013l-.616 .017l-.642 .005l-.642 -.005l-.616 -.017l-.299 -.013l-.579 -.034l-.553 -.046c-4.785 -.464 -6.732 -2.411 -7.196 -7.196l-.046 -.553l-.034 -.579a28.058 28.058 0 0 1 -.013 -.299l-.017 -.616c-.003 -.21 -.005 -.424 -.005 -.642l.001 -.324l.004 -.318l.017 -.616l.013 -.299l.034 -.579l.046 -.553c.464 -4.785 2.411 -6.732 7.196 -7.196l.553 -.046l.579 -.034c.098 -.005 .198 -.01 .299 -.013l.616 -.017c.21 -.003 .424 -.005 .642 -.005zm-1.489 7.14a1 1 0 0 0 -1.218 1.567l1.292 1.293l-1.292 1.293l-.083 .094a1 1 0 0 0 1.497 1.32l1.293 -1.292l1.293 1.292l.094 .083a1 1 0 0 0 1.32 -1.497l-1.292 -1.293l1.292 -1.293l.083 -.094a1 1 0 0 0 -1.497 -1.32l-1.293 1.292l-1.293 -1.292l-.094 -.083z", fill: "currentColor", key: "svg-0", strokeWidth: "0" }]], Y = Q("filled", "square-rounded-x-filled", "SquareRoundedXFilled", U);
|
|
66
|
+
function W(e) {
|
|
67
67
|
var i, r, t = "";
|
|
68
68
|
if (typeof e == "string" || typeof e == "number") t += e;
|
|
69
69
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
70
70
|
var o = e.length;
|
|
71
|
-
for (i = 0; i < o; i++) e[i] && (r =
|
|
71
|
+
for (i = 0; i < o; i++) e[i] && (r = W(e[i])) && (t && (t += " "), t += r);
|
|
72
72
|
} else for (r in e) e[r] && (t && (t += " "), t += r);
|
|
73
73
|
return t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
for (var e, i, r = 0, t = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (i =
|
|
75
|
+
function Z() {
|
|
76
|
+
for (var e, i, r = 0, t = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (i = W(e)) && (t && (t += " "), t += i);
|
|
77
77
|
return t;
|
|
78
78
|
}
|
|
79
|
-
const
|
|
79
|
+
const E = ({
|
|
80
80
|
ref: e,
|
|
81
81
|
as: i = "div",
|
|
82
82
|
children: r,
|
|
@@ -88,11 +88,11 @@ const L = ({
|
|
|
88
88
|
ml: s,
|
|
89
89
|
p,
|
|
90
90
|
pt: d,
|
|
91
|
-
pr:
|
|
92
|
-
pb:
|
|
91
|
+
pr: m,
|
|
92
|
+
pb: f,
|
|
93
93
|
pl: g,
|
|
94
|
-
width:
|
|
95
|
-
height:
|
|
94
|
+
width: u,
|
|
95
|
+
height: h,
|
|
96
96
|
position: v,
|
|
97
97
|
style: b,
|
|
98
98
|
className: $,
|
|
@@ -101,12 +101,13 @@ const L = ({
|
|
|
101
101
|
rel: x,
|
|
102
102
|
htmlFor: T,
|
|
103
103
|
type: A,
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
name: k,
|
|
105
|
+
disabled: R,
|
|
106
|
+
...B
|
|
106
107
|
}) => {
|
|
107
108
|
const a = {};
|
|
108
|
-
t && (a.display = t),
|
|
109
|
-
const
|
|
109
|
+
t && (a.display = t), u && (a.width = u), h && (a.height = h), v && (a.position = v), o && (a.margin = `var(--pittorica-space-${o})`), n && (a.marginTop = `var(--pittorica-space-${n})`), c && (a.marginRight = `var(--pittorica-space-${c})`), l && (a.marginBottom = `var(--pittorica-space-${l})`), s && (a.marginLeft = `var(--pittorica-space-${s})`), p && (a.padding = `var(--pittorica-space-${p})`), d && (a.paddingTop = `var(--pittorica-space-${d})`), m && (a.paddingRight = `var(--pittorica-space-${m})`), f && (a.paddingBottom = `var(--pittorica-space-${f})`), g && (a.paddingLeft = `var(--pittorica-space-${g})`);
|
|
110
|
+
const C = {
|
|
110
111
|
...b,
|
|
111
112
|
...a
|
|
112
113
|
};
|
|
@@ -114,47 +115,48 @@ const L = ({
|
|
|
114
115
|
i,
|
|
115
116
|
{
|
|
116
117
|
ref: e,
|
|
117
|
-
className:
|
|
118
|
-
style:
|
|
118
|
+
className: Z("pittorica-box", $),
|
|
119
|
+
style: C,
|
|
119
120
|
href: w,
|
|
120
121
|
target: N,
|
|
121
122
|
rel: x,
|
|
122
123
|
htmlFor: T,
|
|
123
124
|
type: A,
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
name: k,
|
|
126
|
+
disabled: R,
|
|
127
|
+
...B,
|
|
126
128
|
children: r
|
|
127
129
|
}
|
|
128
130
|
);
|
|
129
131
|
};
|
|
130
|
-
|
|
131
|
-
function
|
|
132
|
+
E.displayName = "Box";
|
|
133
|
+
function q(e) {
|
|
132
134
|
var i, r, t = "";
|
|
133
135
|
if (typeof e == "string" || typeof e == "number") t += e;
|
|
134
136
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
135
137
|
var o = e.length;
|
|
136
|
-
for (i = 0; i < o; i++) e[i] && (r =
|
|
138
|
+
for (i = 0; i < o; i++) e[i] && (r = q(e[i])) && (t && (t += " "), t += r);
|
|
137
139
|
} else for (r in e) e[r] && (t && (t += " "), t += r);
|
|
138
140
|
return t;
|
|
139
141
|
}
|
|
140
|
-
function
|
|
141
|
-
for (var e, i, r = 0, t = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (i =
|
|
142
|
+
function tt() {
|
|
143
|
+
for (var e, i, r = 0, t = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (i = q(e)) && (t && (t += " "), t += i);
|
|
142
144
|
return t;
|
|
143
145
|
}
|
|
144
|
-
function
|
|
146
|
+
function z(e) {
|
|
145
147
|
var i, r, t = "";
|
|
146
148
|
if (typeof e == "string" || typeof e == "number") t += e;
|
|
147
149
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
148
150
|
var o = e.length;
|
|
149
|
-
for (i = 0; i < o; i++) e[i] && (r =
|
|
151
|
+
for (i = 0; i < o; i++) e[i] && (r = z(e[i])) && (t && (t += " "), t += r);
|
|
150
152
|
} else for (r in e) e[r] && (t && (t += " "), t += r);
|
|
151
153
|
return t;
|
|
152
154
|
}
|
|
153
|
-
function
|
|
154
|
-
for (var e, i, r = 0, t = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (i =
|
|
155
|
+
function et() {
|
|
156
|
+
for (var e, i, r = 0, t = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (i = z(e)) && (t && (t += " "), t += i);
|
|
155
157
|
return t;
|
|
156
158
|
}
|
|
157
|
-
const
|
|
159
|
+
const _ = ({
|
|
158
160
|
ref: e,
|
|
159
161
|
as: i = "div",
|
|
160
162
|
children: r,
|
|
@@ -166,11 +168,11 @@ const z = ({
|
|
|
166
168
|
ml: s,
|
|
167
169
|
p,
|
|
168
170
|
pt: d,
|
|
169
|
-
pr:
|
|
170
|
-
pb:
|
|
171
|
+
pr: m,
|
|
172
|
+
pb: f,
|
|
171
173
|
pl: g,
|
|
172
|
-
width:
|
|
173
|
-
height:
|
|
174
|
+
width: u,
|
|
175
|
+
height: h,
|
|
174
176
|
position: v,
|
|
175
177
|
style: b,
|
|
176
178
|
className: $,
|
|
@@ -179,12 +181,13 @@ const z = ({
|
|
|
179
181
|
rel: x,
|
|
180
182
|
htmlFor: T,
|
|
181
183
|
type: A,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
+
name: k,
|
|
185
|
+
disabled: R,
|
|
186
|
+
...B
|
|
184
187
|
}) => {
|
|
185
188
|
const a = {};
|
|
186
|
-
t && (a.display = t),
|
|
187
|
-
const
|
|
189
|
+
t && (a.display = t), u && (a.width = u), h && (a.height = h), v && (a.position = v), o && (a.margin = `var(--pittorica-space-${o})`), n && (a.marginTop = `var(--pittorica-space-${n})`), c && (a.marginRight = `var(--pittorica-space-${c})`), l && (a.marginBottom = `var(--pittorica-space-${l})`), s && (a.marginLeft = `var(--pittorica-space-${s})`), p && (a.padding = `var(--pittorica-space-${p})`), d && (a.paddingTop = `var(--pittorica-space-${d})`), m && (a.paddingRight = `var(--pittorica-space-${m})`), f && (a.paddingBottom = `var(--pittorica-space-${f})`), g && (a.paddingLeft = `var(--pittorica-space-${g})`);
|
|
190
|
+
const C = {
|
|
188
191
|
...b,
|
|
189
192
|
...a
|
|
190
193
|
};
|
|
@@ -192,21 +195,22 @@ const z = ({
|
|
|
192
195
|
i,
|
|
193
196
|
{
|
|
194
197
|
ref: e,
|
|
195
|
-
className:
|
|
196
|
-
style:
|
|
198
|
+
className: et("pittorica-box", $),
|
|
199
|
+
style: C,
|
|
197
200
|
href: w,
|
|
198
201
|
target: N,
|
|
199
202
|
rel: x,
|
|
200
203
|
htmlFor: T,
|
|
201
204
|
type: A,
|
|
202
|
-
|
|
203
|
-
|
|
205
|
+
name: k,
|
|
206
|
+
disabled: R,
|
|
207
|
+
...B,
|
|
204
208
|
children: r
|
|
205
209
|
}
|
|
206
210
|
);
|
|
207
211
|
};
|
|
208
|
-
|
|
209
|
-
const
|
|
212
|
+
_.displayName = "Box";
|
|
213
|
+
const I = ({
|
|
210
214
|
children: e,
|
|
211
215
|
variant: i = "filled",
|
|
212
216
|
color: r = "indigo",
|
|
@@ -222,12 +226,12 @@ const _ = ({
|
|
|
222
226
|
"--pittorica-on-source-color": "#ffffff"
|
|
223
227
|
};
|
|
224
228
|
return /* @__PURE__ */ y(
|
|
225
|
-
|
|
229
|
+
_,
|
|
226
230
|
{
|
|
227
231
|
...l,
|
|
228
232
|
as: l.href ? "a" : "button",
|
|
229
233
|
ref: c,
|
|
230
|
-
className:
|
|
234
|
+
className: tt(
|
|
231
235
|
"pittorica-icon-button",
|
|
232
236
|
`pittorica-icon-button--${i}`,
|
|
233
237
|
`pittorica-icon-button--${t}`,
|
|
@@ -238,34 +242,34 @@ const _ = ({
|
|
|
238
242
|
}
|
|
239
243
|
);
|
|
240
244
|
};
|
|
241
|
-
|
|
242
|
-
function
|
|
245
|
+
I.displayName = "IconButton";
|
|
246
|
+
function M(e) {
|
|
243
247
|
var i, r, t = "";
|
|
244
248
|
if (typeof e == "string" || typeof e == "number") t += e;
|
|
245
249
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
246
250
|
var o = e.length;
|
|
247
|
-
for (i = 0; i < o; i++) e[i] && (r =
|
|
251
|
+
for (i = 0; i < o; i++) e[i] && (r = M(e[i])) && (t && (t += " "), t += r);
|
|
248
252
|
} else for (r in e) e[r] && (t && (t += " "), t += r);
|
|
249
253
|
return t;
|
|
250
254
|
}
|
|
251
|
-
function
|
|
252
|
-
for (var e, i, r = 0, t = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (i =
|
|
255
|
+
function rt() {
|
|
256
|
+
for (var e, i, r = 0, t = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (i = M(e)) && (t && (t += " "), t += i);
|
|
253
257
|
return t;
|
|
254
258
|
}
|
|
255
|
-
function
|
|
259
|
+
function P(e) {
|
|
256
260
|
var i, r, t = "";
|
|
257
261
|
if (typeof e == "string" || typeof e == "number") t += e;
|
|
258
262
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
259
263
|
var o = e.length;
|
|
260
|
-
for (i = 0; i < o; i++) e[i] && (r =
|
|
264
|
+
for (i = 0; i < o; i++) e[i] && (r = P(e[i])) && (t && (t += " "), t += r);
|
|
261
265
|
} else for (r in e) e[r] && (t && (t += " "), t += r);
|
|
262
266
|
return t;
|
|
263
267
|
}
|
|
264
|
-
function
|
|
265
|
-
for (var e, i, r = 0, t = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (i =
|
|
268
|
+
function it() {
|
|
269
|
+
for (var e, i, r = 0, t = "", o = arguments.length; r < o; r++) (e = arguments[r]) && (i = P(e)) && (t && (t += " "), t += i);
|
|
266
270
|
return t;
|
|
267
271
|
}
|
|
268
|
-
const
|
|
272
|
+
const X = ({
|
|
269
273
|
ref: e,
|
|
270
274
|
as: i = "div",
|
|
271
275
|
children: r,
|
|
@@ -277,11 +281,11 @@ const P = ({
|
|
|
277
281
|
ml: s,
|
|
278
282
|
p,
|
|
279
283
|
pt: d,
|
|
280
|
-
pr:
|
|
281
|
-
pb:
|
|
284
|
+
pr: m,
|
|
285
|
+
pb: f,
|
|
282
286
|
pl: g,
|
|
283
|
-
width:
|
|
284
|
-
height:
|
|
287
|
+
width: u,
|
|
288
|
+
height: h,
|
|
285
289
|
position: v,
|
|
286
290
|
style: b,
|
|
287
291
|
className: $,
|
|
@@ -290,12 +294,13 @@ const P = ({
|
|
|
290
294
|
rel: x,
|
|
291
295
|
htmlFor: T,
|
|
292
296
|
type: A,
|
|
293
|
-
|
|
294
|
-
|
|
297
|
+
name: k,
|
|
298
|
+
disabled: R,
|
|
299
|
+
...B
|
|
295
300
|
}) => {
|
|
296
301
|
const a = {};
|
|
297
|
-
t && (a.display = t),
|
|
298
|
-
const
|
|
302
|
+
t && (a.display = t), u && (a.width = u), h && (a.height = h), v && (a.position = v), o && (a.margin = `var(--pittorica-space-${o})`), n && (a.marginTop = `var(--pittorica-space-${n})`), c && (a.marginRight = `var(--pittorica-space-${c})`), l && (a.marginBottom = `var(--pittorica-space-${l})`), s && (a.marginLeft = `var(--pittorica-space-${s})`), p && (a.padding = `var(--pittorica-space-${p})`), d && (a.paddingTop = `var(--pittorica-space-${d})`), m && (a.paddingRight = `var(--pittorica-space-${m})`), f && (a.paddingBottom = `var(--pittorica-space-${f})`), g && (a.paddingLeft = `var(--pittorica-space-${g})`);
|
|
303
|
+
const C = {
|
|
299
304
|
...b,
|
|
300
305
|
...a
|
|
301
306
|
};
|
|
@@ -303,21 +308,22 @@ const P = ({
|
|
|
303
308
|
i,
|
|
304
309
|
{
|
|
305
310
|
ref: e,
|
|
306
|
-
className:
|
|
307
|
-
style:
|
|
311
|
+
className: it("pittorica-box", $),
|
|
312
|
+
style: C,
|
|
308
313
|
href: w,
|
|
309
314
|
target: N,
|
|
310
315
|
rel: x,
|
|
311
316
|
htmlFor: T,
|
|
312
317
|
type: A,
|
|
313
|
-
|
|
314
|
-
|
|
318
|
+
name: k,
|
|
319
|
+
disabled: R,
|
|
320
|
+
...B,
|
|
315
321
|
children: r
|
|
316
322
|
}
|
|
317
323
|
);
|
|
318
324
|
};
|
|
319
|
-
|
|
320
|
-
const
|
|
325
|
+
X.displayName = "Box";
|
|
326
|
+
const S = ({
|
|
321
327
|
children: e,
|
|
322
328
|
as: i = "span",
|
|
323
329
|
weight: r = "regular",
|
|
@@ -329,10 +335,11 @@ const j = ({
|
|
|
329
335
|
href: s,
|
|
330
336
|
target: p,
|
|
331
337
|
rel: d,
|
|
332
|
-
htmlFor:
|
|
333
|
-
|
|
338
|
+
htmlFor: m,
|
|
339
|
+
name: f,
|
|
340
|
+
...g
|
|
334
341
|
}) => {
|
|
335
|
-
const
|
|
342
|
+
const u = (n == null ? void 0 : n.startsWith("#")) || (n == null ? void 0 : n.startsWith("rgb")) || (n == null ? void 0 : n.startsWith("hsl")), h = /* @__PURE__ */ new Set([
|
|
336
343
|
"danger",
|
|
337
344
|
"success",
|
|
338
345
|
"error",
|
|
@@ -344,41 +351,42 @@ const j = ({
|
|
|
344
351
|
"slate",
|
|
345
352
|
"blue",
|
|
346
353
|
"red"
|
|
347
|
-
]),
|
|
354
|
+
]), v = (() => {
|
|
348
355
|
if (n)
|
|
349
|
-
return n === "inherit" ? "inherit" :
|
|
350
|
-
})(),
|
|
356
|
+
return n === "inherit" ? "inherit" : u ? n : h.has(n) ? `var(--pittorica-${n}-9)` : n;
|
|
357
|
+
})(), b = {
|
|
351
358
|
...l,
|
|
352
359
|
textAlign: t,
|
|
353
|
-
color:
|
|
360
|
+
color: v
|
|
354
361
|
};
|
|
355
362
|
return /* @__PURE__ */ y(
|
|
356
|
-
|
|
363
|
+
X,
|
|
357
364
|
{
|
|
358
365
|
as: i,
|
|
359
|
-
className:
|
|
366
|
+
className: rt(
|
|
360
367
|
"pittorica-text",
|
|
361
368
|
{ "pittorica-text--truncate": o },
|
|
362
369
|
c
|
|
363
370
|
),
|
|
364
371
|
"data-weight": r,
|
|
365
|
-
style:
|
|
372
|
+
style: b,
|
|
366
373
|
href: s,
|
|
367
374
|
target: p,
|
|
368
375
|
rel: d,
|
|
369
|
-
htmlFor:
|
|
370
|
-
|
|
376
|
+
htmlFor: m,
|
|
377
|
+
name: f,
|
|
378
|
+
...g,
|
|
371
379
|
children: e
|
|
372
380
|
}
|
|
373
381
|
);
|
|
374
|
-
},
|
|
375
|
-
const i = Math.random().toString(36).slice(2, 9), r = new CustomEvent(
|
|
382
|
+
}, L = "pittorica-toast", st = (e) => {
|
|
383
|
+
const i = Math.random().toString(36).slice(2, 9), r = new CustomEvent(L, { detail: { ...e, id: i } });
|
|
376
384
|
globalThis.dispatchEvent(r);
|
|
377
|
-
},
|
|
378
|
-
const [e, i] =
|
|
385
|
+
}, lt = () => {
|
|
386
|
+
const [e, i] = V([]), r = D(/* @__PURE__ */ new Set()), t = G((o) => {
|
|
379
387
|
i((n) => n.filter((c) => c.id !== o));
|
|
380
388
|
}, []);
|
|
381
|
-
return
|
|
389
|
+
return H(() => {
|
|
382
390
|
const o = (n) => {
|
|
383
391
|
const l = n.detail;
|
|
384
392
|
if (i((s) => [...s, l]), l.duration !== 0) {
|
|
@@ -388,38 +396,38 @@ const j = ({
|
|
|
388
396
|
r.current.add(s);
|
|
389
397
|
}
|
|
390
398
|
};
|
|
391
|
-
return globalThis.addEventListener(
|
|
392
|
-
globalThis.removeEventListener(
|
|
399
|
+
return globalThis.addEventListener(L, o), () => {
|
|
400
|
+
globalThis.removeEventListener(L, o);
|
|
393
401
|
for (const n of r.current) clearTimeout(n);
|
|
394
402
|
r.current.clear();
|
|
395
403
|
};
|
|
396
|
-
}, [t]), typeof document > "u" ? null :
|
|
404
|
+
}, [t]), typeof document > "u" ? null : J(
|
|
397
405
|
/* @__PURE__ */ y(
|
|
398
|
-
|
|
406
|
+
E,
|
|
399
407
|
{
|
|
400
408
|
className: "pittorica-toast-viewport",
|
|
401
409
|
role: "region",
|
|
402
410
|
"aria-label": "Notifications",
|
|
403
|
-
children: e.map((o) => /* @__PURE__ */
|
|
404
|
-
|
|
411
|
+
children: e.map((o) => /* @__PURE__ */ j(
|
|
412
|
+
E,
|
|
405
413
|
{
|
|
406
414
|
className: "pittorica-toast-root",
|
|
407
415
|
role: "status",
|
|
408
416
|
"aria-live": "polite",
|
|
409
417
|
children: [
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */ y(
|
|
412
|
-
o.description && /* @__PURE__ */ y(
|
|
418
|
+
/* @__PURE__ */ j(E, { className: "pittorica-toast-content", children: [
|
|
419
|
+
/* @__PURE__ */ y(S, { weight: "bold", style: { display: "block" }, children: o.title }),
|
|
420
|
+
o.description && /* @__PURE__ */ y(S, { color: "slate", style: { display: "block" }, children: o.description })
|
|
413
421
|
] }),
|
|
414
422
|
/* @__PURE__ */ y(
|
|
415
|
-
|
|
423
|
+
I,
|
|
416
424
|
{
|
|
417
425
|
variant: "text",
|
|
418
426
|
color: "slate",
|
|
419
427
|
size: "1",
|
|
420
428
|
onClick: () => t(o.id),
|
|
421
429
|
"aria-label": "Close",
|
|
422
|
-
children: /* @__PURE__ */ y(
|
|
430
|
+
children: /* @__PURE__ */ y(Y, { size: 18 })
|
|
423
431
|
}
|
|
424
432
|
)
|
|
425
433
|
]
|
|
@@ -432,6 +440,6 @@ const j = ({
|
|
|
432
440
|
);
|
|
433
441
|
};
|
|
434
442
|
export {
|
|
435
|
-
|
|
436
|
-
|
|
443
|
+
lt as ToastProvider,
|
|
444
|
+
st as toast
|
|
437
445
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pittorica/toast-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@tabler/icons-react": "^3.36.1",
|
|
13
13
|
"clsx": "^2.1.1",
|
|
14
|
-
"@pittorica/box-react": "0.
|
|
15
|
-
"@pittorica/icon-button-react": "0.
|
|
16
|
-
"@pittorica/text-react": "0.
|
|
14
|
+
"@pittorica/box-react": "0.24.0",
|
|
15
|
+
"@pittorica/icon-button-react": "0.24.0",
|
|
16
|
+
"@pittorica/text-react": "0.24.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"typescript": "^5.0.0",
|
|
26
26
|
"vite": "^5.0.0",
|
|
27
27
|
"vitest": "^2.1.9",
|
|
28
|
-
"@pittorica/button-react": "0.
|
|
29
|
-
"@pittorica/flex-react": "0.
|
|
30
|
-
"pittorica": "0.
|
|
31
|
-
"
|
|
28
|
+
"@pittorica/button-react": "0.24.0",
|
|
29
|
+
"@pittorica/flex-react": "0.24.0",
|
|
30
|
+
"@pittorica/theme-react": "0.24.0",
|
|
31
|
+
"pittorica": "0.24.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": ">=19",
|