welcome-ui 0.0.0-dev.1763740954427 → 0.0.0-dev.1763744022817
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/DropdownMenu.js +97 -97
- package/dist/InputText.css +1 -1
- package/dist/InputText.js +54 -54
- package/dist/Search.css +1 -1
- package/dist/Search.js +135 -135
- package/dist/Toast.js +74 -74
- package/package.json +1 -1
package/dist/Toast.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import './Toast.css';
|
|
3
3
|
import { jsxs as z, jsx as y, Fragment as B } from "react/jsx-runtime";
|
|
4
4
|
import * as f from "react";
|
|
5
|
-
import { useRef as Y, useCallback as j, useEffect as
|
|
5
|
+
import { useRef as Y, useCallback as j, useEffect as P, useState as fe, forwardRef as Z, cloneElement as ge } from "react";
|
|
6
6
|
import { c as L } from "./index-PAaZGbyz.js";
|
|
7
7
|
import { Button as K } from "./Button.js";
|
|
8
8
|
import { CloseButton as Q } from "./CloseButton.js";
|
|
9
9
|
import { Icon as V } from "./Icon.js";
|
|
10
|
-
import { Text as
|
|
10
|
+
import { Text as C } from "./Text.js";
|
|
11
11
|
import { f as J } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
12
12
|
let ye = { data: "" }, be = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || ye, he = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, ve = /\/\*[^]*?\*\/| +/g, W = /\n+/g, w = (e, t) => {
|
|
13
13
|
let a = "", s = "", i = "";
|
|
@@ -25,21 +25,21 @@ let ye = { data: "" }, be = (e) => typeof window == "object" ? ((e ? e.querySele
|
|
|
25
25
|
return e;
|
|
26
26
|
}, xe = (e, t, a, s, i) => {
|
|
27
27
|
let o = X(e), r = v[o] || (v[o] = ((l) => {
|
|
28
|
-
let
|
|
29
|
-
for (;
|
|
30
|
-
return "go" +
|
|
28
|
+
let m = 0, c = 11;
|
|
29
|
+
for (; m < l.length; ) c = 101 * c + l.charCodeAt(m++) >>> 0;
|
|
30
|
+
return "go" + c;
|
|
31
31
|
})(o));
|
|
32
32
|
if (!v[r]) {
|
|
33
|
-
let l = o !== e ? e : ((
|
|
34
|
-
let
|
|
35
|
-
for (;
|
|
36
|
-
return
|
|
33
|
+
let l = o !== e ? e : ((m) => {
|
|
34
|
+
let c, d, u = [{}];
|
|
35
|
+
for (; c = he.exec(m.replace(ve, "")); ) c[4] ? u.shift() : c[3] ? (d = c[3].replace(W, " ").trim(), u.unshift(u[0][d] = u[0][d] || {})) : u[0][c[1]] = c[2].replace(W, " ").trim();
|
|
36
|
+
return u[0];
|
|
37
37
|
})(e);
|
|
38
38
|
v[r] = w(i ? { ["@keyframes " + r]: l } : l, a ? "" : "." + r);
|
|
39
39
|
}
|
|
40
40
|
let n = a && v.g ? v.g : null;
|
|
41
|
-
return a && (v.g = v[r]), ((l, c, d
|
|
42
|
-
|
|
41
|
+
return a && (v.g = v[r]), ((l, m, c, d) => {
|
|
42
|
+
d ? m.data = m.data.replace(d, l) : m.data.indexOf(l) === -1 && (m.data = c ? l + m.data : m.data + l);
|
|
43
43
|
})(v[r], t, s, n), r;
|
|
44
44
|
}, we = (e, t, a) => e.reduce((s, i, o) => {
|
|
45
45
|
let r = t[o];
|
|
@@ -66,8 +66,8 @@ function _(e, t) {
|
|
|
66
66
|
function i(o, r) {
|
|
67
67
|
let n = Object.assign({}, o), l = n.className || i.className;
|
|
68
68
|
a.p = Object.assign({ theme: R && R() }, n), a.o = / *go\d+/.test(l), n.className = A.apply(a, s) + (l ? " " + l : "");
|
|
69
|
-
let
|
|
70
|
-
return e[0] && (
|
|
69
|
+
let m = e;
|
|
70
|
+
return e[0] && (m = n.as || e, delete n.as), F && m[0] && F(n), ee(m, n);
|
|
71
71
|
}
|
|
72
72
|
return i;
|
|
73
73
|
};
|
|
@@ -113,85 +113,85 @@ var Ne = (e) => typeof e == "function", D = (e, t) => Ne(e) ? e(t) : e, je = /*
|
|
|
113
113
|
se(t, e);
|
|
114
114
|
}, $e = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, Ee = (e = {}, t = M) => {
|
|
115
115
|
let [a, s] = fe(h[t] || re), i = Y(h[t]);
|
|
116
|
-
|
|
116
|
+
P(() => (i.current !== h[t] && s(h[t]), O.push([t, s]), () => {
|
|
117
117
|
let r = O.findIndex(([n]) => n === t);
|
|
118
118
|
r > -1 && O.splice(r, 1);
|
|
119
119
|
}), [t]);
|
|
120
120
|
let o = a.toasts.map((r) => {
|
|
121
|
-
var n, l,
|
|
122
|
-
return { ...e, ...e[r.type], ...r, removeDelay: r.removeDelay || ((n = e[r.type]) == null ? void 0 : n.removeDelay) || (e == null ? void 0 : e.removeDelay), duration: r.duration || ((l = e[r.type]) == null ? void 0 : l.duration) || (e == null ? void 0 : e.duration) || $e[r.type], style: { ...e.style, ...(
|
|
121
|
+
var n, l, m;
|
|
122
|
+
return { ...e, ...e[r.type], ...r, removeDelay: r.removeDelay || ((n = e[r.type]) == null ? void 0 : n.removeDelay) || (e == null ? void 0 : e.removeDelay), duration: r.duration || ((l = e[r.type]) == null ? void 0 : l.duration) || (e == null ? void 0 : e.duration) || $e[r.type], style: { ...e.style, ...(m = e[r.type]) == null ? void 0 : m.style, ...r.style } };
|
|
123
123
|
});
|
|
124
124
|
return { ...a, toasts: o };
|
|
125
125
|
}, Te = (e, t = "blank", a) => ({ createdAt: Date.now(), visible: !0, dismissed: !1, type: t, ariaProps: { role: "status", "aria-live": "polite" }, message: e, pauseDuration: 0, ...a, id: (a == null ? void 0 : a.id) || je() }), $ = (e) => (t, a) => {
|
|
126
126
|
let s = Te(t, e, a);
|
|
127
127
|
return q(s.toasterId || ke(s.id))({ type: 2, toast: s }), s.id;
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
}, p = (e, t) => $("blank")(e, t);
|
|
129
|
+
p.error = $("error");
|
|
130
|
+
p.success = $("success");
|
|
131
|
+
p.loading = $("loading");
|
|
132
|
+
p.custom = $("custom");
|
|
133
|
+
p.dismiss = (e, t) => {
|
|
134
134
|
let a = { type: 3, toastId: e };
|
|
135
135
|
t ? q(t)(a) : oe(a);
|
|
136
136
|
};
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
p.dismissAll = (e) => p.dismiss(void 0, e);
|
|
138
|
+
p.remove = (e, t) => {
|
|
139
139
|
let a = { type: 4, toastId: e };
|
|
140
140
|
t ? q(t)(a) : oe(a);
|
|
141
141
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
let s =
|
|
142
|
+
p.removeAll = (e) => p.remove(void 0, e);
|
|
143
|
+
p.promise = (e, t, a) => {
|
|
144
|
+
let s = p.loading(t.loading, { ...a, ...a == null ? void 0 : a.loading });
|
|
145
145
|
return typeof e == "function" && (e = e()), e.then((i) => {
|
|
146
146
|
let o = t.success ? D(t.success, i) : void 0;
|
|
147
|
-
return o ?
|
|
147
|
+
return o ? p.success(o, { id: s, ...a, ...a == null ? void 0 : a.success }) : p.dismiss(s), i;
|
|
148
148
|
}).catch((i) => {
|
|
149
149
|
let o = t.error ? D(t.error, i) : void 0;
|
|
150
|
-
o ?
|
|
150
|
+
o ? p.error(o, { id: s, ...a, ...a == null ? void 0 : a.error }) : p.dismiss(s);
|
|
151
151
|
}), e;
|
|
152
152
|
};
|
|
153
153
|
var Oe = 1e3, De = (e, t = "default") => {
|
|
154
|
-
let { toasts: a, pausedAt: s } = Ee(e, t), i = Y(/* @__PURE__ */ new Map()).current, o = j((
|
|
155
|
-
if (i.has(
|
|
154
|
+
let { toasts: a, pausedAt: s } = Ee(e, t), i = Y(/* @__PURE__ */ new Map()).current, o = j((d, u = Oe) => {
|
|
155
|
+
if (i.has(d)) return;
|
|
156
156
|
let g = setTimeout(() => {
|
|
157
|
-
i.delete(
|
|
158
|
-
},
|
|
159
|
-
i.set(
|
|
157
|
+
i.delete(d), r({ type: 4, toastId: d });
|
|
158
|
+
}, u);
|
|
159
|
+
i.set(d, g);
|
|
160
160
|
}, []);
|
|
161
|
-
|
|
161
|
+
P(() => {
|
|
162
162
|
if (s) return;
|
|
163
|
-
let
|
|
163
|
+
let d = Date.now(), u = a.map((g) => {
|
|
164
164
|
if (g.duration === 1 / 0) return;
|
|
165
|
-
let E = (g.duration || 0) + g.pauseDuration - (
|
|
165
|
+
let E = (g.duration || 0) + g.pauseDuration - (d - g.createdAt);
|
|
166
166
|
if (E < 0) {
|
|
167
|
-
g.visible &&
|
|
167
|
+
g.visible && p.dismiss(g.id);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
return setTimeout(() =>
|
|
170
|
+
return setTimeout(() => p.dismiss(g.id, t), E);
|
|
171
171
|
});
|
|
172
172
|
return () => {
|
|
173
|
-
|
|
173
|
+
u.forEach((g) => g && clearTimeout(g));
|
|
174
174
|
};
|
|
175
175
|
}, [a, s, t]);
|
|
176
176
|
let r = j(q(t), [t]), n = j(() => {
|
|
177
177
|
r({ type: 5, time: Date.now() });
|
|
178
|
-
}, [r]), l = j((
|
|
179
|
-
r({ type: 1, toast: { id:
|
|
180
|
-
}, [r]),
|
|
178
|
+
}, [r]), l = j((d, u) => {
|
|
179
|
+
r({ type: 1, toast: { id: d, height: u } });
|
|
180
|
+
}, [r]), m = j(() => {
|
|
181
181
|
s && r({ type: 6, time: Date.now() });
|
|
182
|
-
}, [s, r]),
|
|
183
|
-
let { reverseOrder: g = !1, gutter: E = 8, defaultPosition: G } =
|
|
182
|
+
}, [s, r]), c = j((d, u) => {
|
|
183
|
+
let { reverseOrder: g = !1, gutter: E = 8, defaultPosition: G } = u || {}, I = a.filter((b) => (b.position || G) === (d.position || G) && b.height), ue = I.findIndex((b) => b.id === d.id), U = I.filter((b, S) => S < ue && b.visible).length;
|
|
184
184
|
return I.filter((b) => b.visible).slice(...g ? [U + 1] : [0, U]).reduce((b, S) => b + (S.height || 0) + E, 0);
|
|
185
185
|
}, [a]);
|
|
186
|
-
return
|
|
187
|
-
a.forEach((
|
|
188
|
-
if (
|
|
186
|
+
return P(() => {
|
|
187
|
+
a.forEach((d) => {
|
|
188
|
+
if (d.dismissed) o(d.id, d.removeDelay);
|
|
189
189
|
else {
|
|
190
|
-
let
|
|
191
|
-
|
|
190
|
+
let u = i.get(d.id);
|
|
191
|
+
u && (clearTimeout(u), i.delete(d.id));
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
|
-
}, [a, o]), { toasts: a, handlers: { updateHeight: l, startPause: n, endPause:
|
|
194
|
+
}, [a, o]), { toasts: a, handlers: { updateHeight: l, startPause: n, endPause: m, calculateOffset: c } };
|
|
195
195
|
}, Ae = x`
|
|
196
196
|
from {
|
|
197
197
|
transform: scale(0) rotate(45deg);
|
|
@@ -249,14 +249,14 @@ to {
|
|
|
249
249
|
animation-delay: 180ms;
|
|
250
250
|
transform: rotate(90deg);
|
|
251
251
|
}
|
|
252
|
-
`,
|
|
252
|
+
`, Pe = x`
|
|
253
253
|
from {
|
|
254
254
|
transform: rotate(0deg);
|
|
255
255
|
}
|
|
256
256
|
to {
|
|
257
257
|
transform: rotate(360deg);
|
|
258
258
|
}
|
|
259
|
-
`,
|
|
259
|
+
`, Ce = _("div")`
|
|
260
260
|
width: 12px;
|
|
261
261
|
height: 12px;
|
|
262
262
|
box-sizing: border-box;
|
|
@@ -264,7 +264,7 @@ to {
|
|
|
264
264
|
border-radius: 100%;
|
|
265
265
|
border-color: ${(e) => e.secondary || "#e0e0e0"};
|
|
266
266
|
border-right-color: ${(e) => e.primary || "#616161"};
|
|
267
|
-
animation: ${
|
|
267
|
+
animation: ${Pe} 1s linear infinite;
|
|
268
268
|
`, Re = x`
|
|
269
269
|
from {
|
|
270
270
|
transform: scale(0) rotate(45deg);
|
|
@@ -340,7 +340,7 @@ to {
|
|
|
340
340
|
forwards;
|
|
341
341
|
`, We = ({ toast: e }) => {
|
|
342
342
|
let { icon: t, type: a, iconTheme: s } = e;
|
|
343
|
-
return t !== void 0 ? typeof t == "string" ? f.createElement(Ue, null, t) : t : a === "blank" ? null : f.createElement(He, null, f.createElement(
|
|
343
|
+
return t !== void 0 ? typeof t == "string" ? f.createElement(Ue, null, t) : t : a === "blank" ? null : f.createElement(He, null, f.createElement(Ce, { ...s }), a !== "loading" && f.createElement(Me, null, a === "error" ? f.createElement(Se, { ...s }) : f.createElement(Le, { ...s })));
|
|
344
344
|
}, Be = (e) => `
|
|
345
345
|
0% {transform: translate3d(0,${e * -200}%,0) scale(.6); opacity:.5;}
|
|
346
346
|
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
@@ -394,10 +394,10 @@ var et = ({ id: e, className: t, style: a, onHeightUpdate: s, children: i }) =>
|
|
|
394
394
|
pointer-events: auto;
|
|
395
395
|
}
|
|
396
396
|
`, T = 16, ie = ({ reverseOrder: e, position: t = "top-center", toastOptions: a, gutter: s, children: i, toasterId: o, containerStyle: r, containerClassName: n }) => {
|
|
397
|
-
let { toasts: l, handlers:
|
|
398
|
-
return f.createElement("div", { "data-rht-toaster": o || "", style: { position: "fixed", zIndex: 9999, top: T, left: T, right: T, bottom: T, pointerEvents: "none", ...r }, className: n, onMouseEnter:
|
|
399
|
-
let
|
|
400
|
-
return f.createElement(et, { id:
|
|
397
|
+
let { toasts: l, handlers: m } = De(a, o);
|
|
398
|
+
return f.createElement("div", { "data-rht-toaster": o || "", style: { position: "fixed", zIndex: 9999, top: T, left: T, right: T, bottom: T, pointerEvents: "none", ...r }, className: n, onMouseEnter: m.startPause, onMouseLeave: m.endPause }, l.map((c) => {
|
|
399
|
+
let d = c.position || t, u = m.calculateOffset(c, { reverseOrder: e, gutter: s, defaultPosition: t }), g = tt(d, u);
|
|
400
|
+
return f.createElement(et, { id: c.id, key: c.id, onHeightUpdate: m.updateHeight, className: c.visible ? at : "", style: g }, c.type === "custom" ? D(c.message, c) : i ? i(c) : f.createElement(Xe, { toast: c, position: d }));
|
|
401
401
|
}));
|
|
402
402
|
};
|
|
403
403
|
const rt = "_root_q0jyz_2", st = "_icon_q0jyz_17", ot = "_progress_q0jyz_40", it = "_snackbar_q0jyz_63", nt = "_growl_q0jyz_71", lt = "_content_q0jyz_79", ct = "_title_q0jyz_91", H = {
|
|
@@ -427,14 +427,14 @@ const rt = "_root_q0jyz_2", st = "_icon_q0jyz_17", ot = "_progress_q0jyz_40", it
|
|
|
427
427
|
showProgressBar: r = !1,
|
|
428
428
|
title: n,
|
|
429
429
|
variant: l = "info",
|
|
430
|
-
...
|
|
431
|
-
},
|
|
430
|
+
...m
|
|
431
|
+
}, c) => /* @__PURE__ */ z("div", { className: N("root", `variant-${l}`, t), ref: c, ...m, children: [
|
|
432
432
|
/* @__PURE__ */ z("div", { className: N("growl"), children: [
|
|
433
433
|
l ? /* @__PURE__ */ y(V, { className: N("icon"), name: me[l], size: "lg" }) : null,
|
|
434
434
|
/* @__PURE__ */ z("div", { className: N("content"), children: [
|
|
435
435
|
/* @__PURE__ */ z("span", { children: [
|
|
436
|
-
/* @__PURE__ */ y(
|
|
437
|
-
/* @__PURE__ */ y(
|
|
436
|
+
/* @__PURE__ */ y(C, { variant: "body-md-strong", children: n }),
|
|
437
|
+
/* @__PURE__ */ y(C, { variant: "body-md", children: e })
|
|
438
438
|
] }),
|
|
439
439
|
a ? /* @__PURE__ */ y(B, { children: a }) : null
|
|
440
440
|
] }),
|
|
@@ -442,8 +442,8 @@ const rt = "_root_q0jyz_2", st = "_icon_q0jyz_17", ot = "_progress_q0jyz_40", it
|
|
|
442
442
|
Q,
|
|
443
443
|
{
|
|
444
444
|
className: N("close-button"),
|
|
445
|
-
onClick: (
|
|
446
|
-
|
|
445
|
+
onClick: (d) => {
|
|
446
|
+
d.preventDefault(), d.stopPropagation(), o == null || o();
|
|
447
447
|
},
|
|
448
448
|
size: "sm"
|
|
449
449
|
}
|
|
@@ -475,16 +475,16 @@ const k = L(H), ce = Z(
|
|
|
475
475
|
onClose: r,
|
|
476
476
|
variant: n = "info",
|
|
477
477
|
...l
|
|
478
|
-
},
|
|
478
|
+
}, m) => /* @__PURE__ */ z("div", { className: k("root", `variant-${n}`, t), ref: m, ...l, children: [
|
|
479
479
|
/* @__PURE__ */ z("div", { className: k("snackbar"), children: [
|
|
480
480
|
n ? /* @__PURE__ */ y(V, { className: k("icon"), name: me[n], size: "lg" }) : null,
|
|
481
|
-
/* @__PURE__ */ y(
|
|
481
|
+
/* @__PURE__ */ y(C, { variant: "body-md-strong", children: e }),
|
|
482
482
|
a ? /* @__PURE__ */ y(B, { children: a }) : null,
|
|
483
483
|
i ? /* @__PURE__ */ y(
|
|
484
484
|
Q,
|
|
485
485
|
{
|
|
486
|
-
onClick: (
|
|
487
|
-
|
|
486
|
+
onClick: (c) => {
|
|
487
|
+
c.preventDefault(), c.stopPropagation(), r == null || r();
|
|
488
488
|
},
|
|
489
489
|
size: "sm"
|
|
490
490
|
}
|
|
@@ -515,11 +515,11 @@ const dt = L(H), me = {
|
|
|
515
515
|
info: 7e3,
|
|
516
516
|
success: 7e3,
|
|
517
517
|
warning: 8e3
|
|
518
|
-
},
|
|
519
|
-
|
|
518
|
+
}, pe = ({ children: e, className: t, ...a }) => /* @__PURE__ */ y("p", { className: dt("title", t), ...a, children: e });
|
|
519
|
+
pe.displayName = "Toast.Title";
|
|
520
520
|
const xt = (e, t) => {
|
|
521
521
|
const s = ("type" in e ? e.type.displayName || e.type.name : void 0) === "Growl" ? "top-right" : "bottom-center", i = () => {
|
|
522
|
-
t != null && t.onClose && t.onClose(),
|
|
522
|
+
t != null && t.onClose && t.onClose(), p.dismiss(t == null ? void 0 : t.id);
|
|
523
523
|
}, o = e.props.variant || "info", r = {
|
|
524
524
|
duration: mt[o],
|
|
525
525
|
position: s,
|
|
@@ -531,7 +531,7 @@ const xt = (e, t) => {
|
|
|
531
531
|
},
|
|
532
532
|
...t
|
|
533
533
|
};
|
|
534
|
-
return
|
|
534
|
+
return p(
|
|
535
535
|
ge(e, { duration: r.duration, onClose: i }),
|
|
536
536
|
r
|
|
537
537
|
);
|
|
@@ -542,7 +542,7 @@ const wt = Object.assign(ie, {
|
|
|
542
542
|
GrowlAction: le,
|
|
543
543
|
Snackbar: ce,
|
|
544
544
|
SnackbarAction: de,
|
|
545
|
-
Title:
|
|
545
|
+
Title: pe
|
|
546
546
|
});
|
|
547
547
|
export {
|
|
548
548
|
me as ICON,
|