fansunited-frontend-components 0.0.39 → 0.0.40
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/ChanceGame.js +104 -102
- package/ClassicQuizPlay.js +45 -42
- package/CollectLead.js +25 -24
- package/Discussion.js +376 -378
- package/EitherOrPlay.d.ts +4 -0
- package/EitherOrPlay.d.ts.map +1 -0
- package/EitherOrPlay.js +2533 -0
- package/EventGamePlay.js +59 -54
- package/MatchQuizPlay.js +63 -57
- package/PersonalityQuizPlay.js +7935 -7201
- package/PickThePair.js +153 -151
- package/PollVote.js +108 -104
- package/chunks/{AlertMessage-C2aBXCrl.js → AlertMessage-cjTHrMUK.js} +51 -51
- package/chunks/ArrowRightAlt-88jKjh6A.js +8 -0
- package/chunks/Avatar-CQCrd1m-.js +352 -0
- package/chunks/ChanceGameEmbedVariant-DWqOTf4o.js +1051 -0
- package/chunks/{CheckCircle-D-GH16Lb.js → CheckCircle-ClY-iOQ5.js} +105 -105
- package/chunks/{CollectLeadForm-o9NdYQgu.js → CollectLeadForm-0vVnu4DL.js} +5 -5
- package/chunks/FavoriteBorder-BHnvGBrn.js +11 -0
- package/chunks/{useInfoPage-v91yL5SS.js → NotFoundSkeleton-B3RNa8KJ.js} +451 -646
- package/chunks/Notification-BTtUhfZQ.js +615 -0
- package/chunks/OverlayLeadAfterCollection-CaBbwZVo.js +480 -0
- package/chunks/{OverlayScoreStateSkeleton-xvq9lQEi.js → OverlayScoreStateSkeleton-DJn0Rim3.js} +3 -3
- package/chunks/Person-D0Im9_zE.js +522 -0
- package/chunks/{PickOneOfX-C2YpLk40.js → PickOneOfX-DYQ4c1o2.js} +7 -7
- package/chunks/{Portal-DWAr8MhA.js → Portal-B9wkUnY2.js} +7 -7
- package/chunks/{ConstantsProvider-BPJJz9fq.js → PrizeCard-gMp7I66d.js} +3593 -2860
- package/chunks/{Spinner-m59ZJZ35.js → Spinner-BBA89t5s.js} +50 -50
- package/chunks/StandardLeadAfterCollection-L1cOGfS6.js +432 -0
- package/chunks/{Tabs-BGihvj9C.js → Tabs-D_n8rNw3.js} +28 -28
- package/chunks/{Textarea-Bzlb89Zp.js → Textarea-BdN2xj4j.js} +44 -44
- package/chunks/{TimerOutlined-DiX8hCoC.js → TimerOutlined-DmKZDDI-.js} +1 -1
- package/chunks/chevron-right-DGEksBI7.js +330 -0
- package/chunks/default-quiz-bg-vertical-CT7rrg9o.js +5 -0
- package/chunks/index-2s5UkG1y.js +1607 -0
- package/chunks/useImageVariant-pnFelF9A.js +535 -0
- package/chunks/useInfoPage-DPkzE5Gn.js +204 -0
- package/components.d.ts +2 -1
- package/components.d.ts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +4 -2
- package/package.json +1 -1
- package/chunks/ChanceGameEmbedVariant-BvIKBhq_.js +0 -2609
- package/chunks/Notification-Bwcoljir.js +0 -961
- package/chunks/OverlayLeadAfterCollection-B3D5ct0J.js +0 -901
- package/chunks/chevron-right-Dlc9ZKhv.js +0 -846
- package/chunks/useImageVariant-Do8kOVs2.js +0 -537
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
import { I as le, L as H, M as P, P as e, N as ue, O as de, _ as S, Q as N, l as W, m as X, R as j, s as A, r as fe, o as pe, p as me, q as ve, t as he, v as M, w as be, x, y as ke, c as ge, j as ye, h as Se, B as De, T as I } from "./PrizeCard-gMp7I66d.js";
|
|
2
|
+
import { jsx as y, jsxs as q } from "react/jsx-runtime";
|
|
3
|
+
import { C as Ee } from "./CheckCircle-ClY-iOQ5.js";
|
|
4
|
+
import * as c from "react";
|
|
5
|
+
import { e as Ce } from "./Spinner-BBA89t5s.js";
|
|
6
|
+
function $(r) {
|
|
7
|
+
return r.substring(2).toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
function xe(r, n) {
|
|
10
|
+
return n.documentElement.clientWidth < r.clientX || n.documentElement.clientHeight < r.clientY;
|
|
11
|
+
}
|
|
12
|
+
function R(r) {
|
|
13
|
+
const {
|
|
14
|
+
children: n,
|
|
15
|
+
disableReactTree: f = !1,
|
|
16
|
+
mouseEvent: o = "onClick",
|
|
17
|
+
onClickAway: d,
|
|
18
|
+
touchEvent: i = "onTouchEnd"
|
|
19
|
+
} = r, v = c.useRef(!1), p = c.useRef(null), h = c.useRef(!1), g = c.useRef(!1);
|
|
20
|
+
c.useEffect(() => (setTimeout(() => {
|
|
21
|
+
h.current = !0;
|
|
22
|
+
}, 0), () => {
|
|
23
|
+
h.current = !1;
|
|
24
|
+
}), []);
|
|
25
|
+
const b = le(
|
|
26
|
+
// @ts-expect-error TODO upstream fix
|
|
27
|
+
n.ref,
|
|
28
|
+
p
|
|
29
|
+
), l = H((s) => {
|
|
30
|
+
const u = g.current;
|
|
31
|
+
g.current = !1;
|
|
32
|
+
const k = P(p.current);
|
|
33
|
+
if (!h.current || !p.current || "clientX" in s && xe(s, k))
|
|
34
|
+
return;
|
|
35
|
+
if (v.current) {
|
|
36
|
+
v.current = !1;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
let t;
|
|
40
|
+
s.composedPath ? t = s.composedPath().indexOf(p.current) > -1 : t = !k.documentElement.contains(
|
|
41
|
+
// @ts-expect-error returns `false` as intended when not dispatched from a Node
|
|
42
|
+
s.target
|
|
43
|
+
) || p.current.contains(
|
|
44
|
+
// @ts-expect-error returns `false` as intended when not dispatched from a Node
|
|
45
|
+
s.target
|
|
46
|
+
), !t && (f || !u) && d(s);
|
|
47
|
+
}), D = (s) => (u) => {
|
|
48
|
+
g.current = !0;
|
|
49
|
+
const k = n.props[s];
|
|
50
|
+
k && k(u);
|
|
51
|
+
}, E = {
|
|
52
|
+
ref: b
|
|
53
|
+
};
|
|
54
|
+
return i !== !1 && (E[i] = D(i)), c.useEffect(() => {
|
|
55
|
+
if (i !== !1) {
|
|
56
|
+
const s = $(i), u = P(p.current), k = () => {
|
|
57
|
+
v.current = !0;
|
|
58
|
+
};
|
|
59
|
+
return u.addEventListener(s, l), u.addEventListener("touchmove", k), () => {
|
|
60
|
+
u.removeEventListener(s, l), u.removeEventListener("touchmove", k);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}, [l, i]), o !== !1 && (E[o] = D(o)), c.useEffect(() => {
|
|
64
|
+
if (o !== !1) {
|
|
65
|
+
const s = $(o), u = P(p.current);
|
|
66
|
+
return u.addEventListener(s, l), () => {
|
|
67
|
+
u.removeEventListener(s, l);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}, [l, o]), /* @__PURE__ */ y(c.Fragment, {
|
|
71
|
+
children: /* @__PURE__ */ c.cloneElement(n, E)
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
process.env.NODE_ENV !== "production" && (R.propTypes = {
|
|
75
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
76
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
77
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
78
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
79
|
+
/**
|
|
80
|
+
* The wrapped element.
|
|
81
|
+
*/
|
|
82
|
+
children: Ce.isRequired,
|
|
83
|
+
/**
|
|
84
|
+
* If `true`, the React tree is ignored and only the DOM tree is considered.
|
|
85
|
+
* This prop changes how portaled elements are handled.
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
disableReactTree: e.bool,
|
|
89
|
+
/**
|
|
90
|
+
* The mouse event to listen to. You can disable the listener by providing `false`.
|
|
91
|
+
* @default 'onClick'
|
|
92
|
+
*/
|
|
93
|
+
mouseEvent: e.oneOf(["onClick", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", !1]),
|
|
94
|
+
/**
|
|
95
|
+
* Callback fired when a "click away" event is detected.
|
|
96
|
+
*/
|
|
97
|
+
onClickAway: e.func.isRequired,
|
|
98
|
+
/**
|
|
99
|
+
* The touch event to listen to. You can disable the listener by providing `false`.
|
|
100
|
+
* @default 'onTouchEnd'
|
|
101
|
+
*/
|
|
102
|
+
touchEvent: e.oneOf(["onTouchEnd", "onTouchStart", !1])
|
|
103
|
+
});
|
|
104
|
+
process.env.NODE_ENV !== "production" && (R.propTypes = ue(R.propTypes));
|
|
105
|
+
function Re(r = {}) {
|
|
106
|
+
const {
|
|
107
|
+
autoHideDuration: n = null,
|
|
108
|
+
disableWindowBlurListener: f = !1,
|
|
109
|
+
onClose: o,
|
|
110
|
+
open: d,
|
|
111
|
+
resumeHideDuration: i
|
|
112
|
+
} = r, v = de();
|
|
113
|
+
c.useEffect(() => {
|
|
114
|
+
if (!d)
|
|
115
|
+
return;
|
|
116
|
+
function t(a) {
|
|
117
|
+
a.defaultPrevented || (a.key === "Escape" || a.key === "Esc") && (o == null || o(a, "escapeKeyDown"));
|
|
118
|
+
}
|
|
119
|
+
return document.addEventListener("keydown", t), () => {
|
|
120
|
+
document.removeEventListener("keydown", t);
|
|
121
|
+
};
|
|
122
|
+
}, [d, o]);
|
|
123
|
+
const p = H((t, a) => {
|
|
124
|
+
o == null || o(t, a);
|
|
125
|
+
}), h = H((t) => {
|
|
126
|
+
!o || t == null || v.start(t, () => {
|
|
127
|
+
p(null, "timeout");
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
c.useEffect(() => (d && h(n), v.clear), [d, n, h, v]);
|
|
131
|
+
const g = (t) => {
|
|
132
|
+
o == null || o(t, "clickaway");
|
|
133
|
+
}, b = v.clear, l = c.useCallback(() => {
|
|
134
|
+
n != null && h(i ?? n * 0.5);
|
|
135
|
+
}, [n, i, h]), D = (t) => (a) => {
|
|
136
|
+
const m = t.onBlur;
|
|
137
|
+
m == null || m(a), l();
|
|
138
|
+
}, E = (t) => (a) => {
|
|
139
|
+
const m = t.onFocus;
|
|
140
|
+
m == null || m(a), b();
|
|
141
|
+
}, s = (t) => (a) => {
|
|
142
|
+
const m = t.onMouseEnter;
|
|
143
|
+
m == null || m(a), b();
|
|
144
|
+
}, u = (t) => (a) => {
|
|
145
|
+
const m = t.onMouseLeave;
|
|
146
|
+
m == null || m(a), l();
|
|
147
|
+
};
|
|
148
|
+
return c.useEffect(() => {
|
|
149
|
+
if (!f && d)
|
|
150
|
+
return window.addEventListener("focus", l), window.addEventListener("blur", b), () => {
|
|
151
|
+
window.removeEventListener("focus", l), window.removeEventListener("blur", b);
|
|
152
|
+
};
|
|
153
|
+
}, [f, d, l, b]), {
|
|
154
|
+
getRootProps: (t = {}) => {
|
|
155
|
+
const a = S({}, N(r), N(t));
|
|
156
|
+
return S({
|
|
157
|
+
// ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
|
|
158
|
+
// See https://github.com/mui/material-ui/issues/29080
|
|
159
|
+
role: "presentation"
|
|
160
|
+
}, t, a, {
|
|
161
|
+
onBlur: D(a),
|
|
162
|
+
onFocus: E(a),
|
|
163
|
+
onMouseEnter: s(a),
|
|
164
|
+
onMouseLeave: u(a)
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
onClickAway: g
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function Fe(r) {
|
|
171
|
+
return W("MuiDivider", r);
|
|
172
|
+
}
|
|
173
|
+
const Ue = X("MuiDivider", ["root", "horizontal", "vertical", "insetContext", "insetNone"]);
|
|
174
|
+
function Oe(r) {
|
|
175
|
+
return W("MuiSnackbar", r);
|
|
176
|
+
}
|
|
177
|
+
X("MuiSnackbar", ["root", "anchorOriginTopCenter", "anchorOriginBottomCenter", "anchorOriginTopRight", "anchorOriginBottomRight", "anchorOriginTopLeft", "anchorOriginBottomLeft", "colorPrimary", "colorDanger", "colorNeutral", "colorSuccess", "colorWarning", "endDecorator", "sizeSm", "sizeMd", "sizeLg", "startDecorator", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]);
|
|
178
|
+
const Te = ["anchorOrigin", "animationDuration", "autoHideDuration", "color", "children", "className", "component", "disableWindowBlurListener", "endDecorator", "invertedColors", "onBlur", "onClose", "onFocus", "onMouseEnter", "onMouseLeave", "onUnmount", "open", "resumeHideDuration", "size", "slots", "slotProps", "startDecorator", "variant"];
|
|
179
|
+
let V = (r) => r, F, U;
|
|
180
|
+
const ze = (r) => {
|
|
181
|
+
const {
|
|
182
|
+
variant: n,
|
|
183
|
+
color: f,
|
|
184
|
+
size: o,
|
|
185
|
+
anchorOrigin: d
|
|
186
|
+
} = r, i = {
|
|
187
|
+
root: ["root", o && `size${x(o)}`, f && `color${x(f)}`, n && `variant${x(n)}`, `anchorOrigin${x(d.vertical)}${x(d.horizontal)}`],
|
|
188
|
+
startDecorator: ["startDecorator"],
|
|
189
|
+
endDecorator: ["endDecorator"]
|
|
190
|
+
};
|
|
191
|
+
return ke(i, Oe, {});
|
|
192
|
+
}, we = j(F || (F = V`
|
|
193
|
+
0% {
|
|
194
|
+
transform: translateX(var(--Snackbar-translateX, 0px)) translateY(calc(var(--_Snackbar-anchorBottom, 1) * 100%));
|
|
195
|
+
opacity: 0;
|
|
196
|
+
}
|
|
197
|
+
50% {
|
|
198
|
+
opacity: 1;
|
|
199
|
+
}
|
|
200
|
+
100% {
|
|
201
|
+
transform: translateX(var(--Snackbar-translateX, 0px)) translateY(0);
|
|
202
|
+
}
|
|
203
|
+
`)), Le = j(U || (U = V`
|
|
204
|
+
0% {
|
|
205
|
+
transform: translateX(var(--Snackbar-translateX, 0px)) translateY(0);
|
|
206
|
+
opacity: 1;
|
|
207
|
+
}
|
|
208
|
+
100% {
|
|
209
|
+
transform: translateX(var(--Snackbar-translateX, 0px)) translateY(calc(var(--_Snackbar-anchorBottom, 1) * 100%));
|
|
210
|
+
opacity: 0;
|
|
211
|
+
}
|
|
212
|
+
`)), Pe = A("div", {
|
|
213
|
+
name: "JoySnackbar",
|
|
214
|
+
slot: "Root",
|
|
215
|
+
overridesResolver: (r, n) => n.root
|
|
216
|
+
})(({
|
|
217
|
+
theme: r,
|
|
218
|
+
ownerState: n
|
|
219
|
+
}) => {
|
|
220
|
+
var f, o, d, i, v, p, h;
|
|
221
|
+
const {
|
|
222
|
+
p: g,
|
|
223
|
+
padding: b,
|
|
224
|
+
borderRadius: l
|
|
225
|
+
} = fe({
|
|
226
|
+
theme: r,
|
|
227
|
+
ownerState: n
|
|
228
|
+
}, ["p", "padding", "borderRadius"]);
|
|
229
|
+
return [S({
|
|
230
|
+
"--Snackbar-radius": r.vars.radius.sm,
|
|
231
|
+
"--Snackbar-decoratorChildRadius": "max((var(--Snackbar-radius) - var(--variant-borderWidth, 0px)) - var(--Snackbar-padding), min(var(--Snackbar-padding) + var(--variant-borderWidth, 0px), var(--Snackbar-radius) / 2))",
|
|
232
|
+
"--Button-minHeight": "var(--Snackbar-decoratorChildHeight)",
|
|
233
|
+
"--IconButton-size": "var(--Snackbar-decoratorChildHeight)",
|
|
234
|
+
"--Button-radius": "var(--Snackbar-decoratorChildRadius)",
|
|
235
|
+
"--IconButton-radius": "var(--Snackbar-decoratorChildRadius)",
|
|
236
|
+
"--Icon-color": "currentColor"
|
|
237
|
+
}, n.size === "sm" && {
|
|
238
|
+
"--Snackbar-padding": "0.75rem",
|
|
239
|
+
"--Snackbar-inset": "0.5rem",
|
|
240
|
+
"--Snackbar-decoratorChildHeight": "1.5rem",
|
|
241
|
+
"--Icon-fontSize": r.vars.fontSize.xl,
|
|
242
|
+
gap: "0.5rem"
|
|
243
|
+
}, n.size === "md" && {
|
|
244
|
+
"--Snackbar-padding": "1rem",
|
|
245
|
+
"--Snackbar-inset": "0.75rem",
|
|
246
|
+
// the spacing between Snackbar and the viewport
|
|
247
|
+
"--Snackbar-decoratorChildHeight": "2rem",
|
|
248
|
+
"--Icon-fontSize": r.vars.fontSize.xl,
|
|
249
|
+
gap: "0.625rem"
|
|
250
|
+
}, n.size === "lg" && {
|
|
251
|
+
"--Snackbar-padding": "1.25rem",
|
|
252
|
+
"--Snackbar-inset": "1rem",
|
|
253
|
+
"--Snackbar-decoratorChildHeight": "2.375rem",
|
|
254
|
+
"--Icon-fontSize": r.vars.fontSize.xl2,
|
|
255
|
+
gap: "0.875rem"
|
|
256
|
+
}, {
|
|
257
|
+
zIndex: r.vars.zIndex.snackbar,
|
|
258
|
+
position: "fixed",
|
|
259
|
+
display: "flex",
|
|
260
|
+
alignItems: "center",
|
|
261
|
+
minWidth: 300,
|
|
262
|
+
top: ((f = n.anchorOrigin) == null ? void 0 : f.vertical) === "top" ? "var(--Snackbar-inset)" : void 0,
|
|
263
|
+
left: ((o = n.anchorOrigin) == null ? void 0 : o.horizontal) === "left" ? "var(--Snackbar-inset)" : void 0,
|
|
264
|
+
bottom: ((d = n.anchorOrigin) == null ? void 0 : d.vertical) === "bottom" ? "var(--Snackbar-inset)" : void 0,
|
|
265
|
+
right: ((i = n.anchorOrigin) == null ? void 0 : i.horizontal) === "right" ? "var(--Snackbar-inset)" : void 0
|
|
266
|
+
}, ((v = n.anchorOrigin) == null ? void 0 : v.horizontal) === "center" && {
|
|
267
|
+
"--Snackbar-translateX": "-50%",
|
|
268
|
+
left: "50%",
|
|
269
|
+
transform: "translateX(var(--Snackbar-translateX))"
|
|
270
|
+
}, ((p = n.anchorOrigin) == null ? void 0 : p.vertical) === "top" && {
|
|
271
|
+
"--_Snackbar-anchorBottom": "-1"
|
|
272
|
+
}, {
|
|
273
|
+
animation: `${we} ${n.animationDuration}ms forwards`
|
|
274
|
+
}, !n.open && {
|
|
275
|
+
animationName: Le
|
|
276
|
+
}, {
|
|
277
|
+
boxShadow: r.vars.shadow.lg,
|
|
278
|
+
backgroundColor: r.vars.palette.background.surface,
|
|
279
|
+
padding: "var(--Snackbar-padding)",
|
|
280
|
+
borderRadius: "var(--Snackbar-radius)"
|
|
281
|
+
}, r.typography[`body-${{
|
|
282
|
+
sm: "xs",
|
|
283
|
+
md: "sm",
|
|
284
|
+
lg: "md"
|
|
285
|
+
}[n.size]}`], n.variant === "solid" && n.color && n.invertedColors && pe(n.color)(r), n.variant === "soft" && n.color && n.invertedColors && me(n.color)(r), (h = r.variants[n.variant]) == null ? void 0 : h[n.color]), g !== void 0 && {
|
|
286
|
+
"--Snackbar-padding": g
|
|
287
|
+
}, b !== void 0 && {
|
|
288
|
+
"--Snackbar-padding": b
|
|
289
|
+
}, l !== void 0 && {
|
|
290
|
+
"--Snackbar-radius": l
|
|
291
|
+
}];
|
|
292
|
+
}), Me = A("span", {
|
|
293
|
+
name: "JoySnackbar",
|
|
294
|
+
slot: "StartDecorator",
|
|
295
|
+
overridesResolver: (r, n) => n.startDecorator
|
|
296
|
+
})({
|
|
297
|
+
display: "inherit",
|
|
298
|
+
flex: "none"
|
|
299
|
+
}), He = A("span", {
|
|
300
|
+
name: "JoySnackbar",
|
|
301
|
+
slot: "EndDecorator",
|
|
302
|
+
overridesResolver: (r, n) => n.endDecorator
|
|
303
|
+
})({
|
|
304
|
+
display: "inherit",
|
|
305
|
+
flex: "none",
|
|
306
|
+
marginLeft: "auto"
|
|
307
|
+
}), Ae = {
|
|
308
|
+
vertical: "bottom",
|
|
309
|
+
horizontal: "right"
|
|
310
|
+
}, Y = /* @__PURE__ */ c.forwardRef(function(n, f) {
|
|
311
|
+
const o = ve({
|
|
312
|
+
props: n,
|
|
313
|
+
name: "JoySnackbar"
|
|
314
|
+
}), {
|
|
315
|
+
anchorOrigin: d = Ae,
|
|
316
|
+
animationDuration: i = 300,
|
|
317
|
+
autoHideDuration: v = null,
|
|
318
|
+
color: p = "neutral",
|
|
319
|
+
children: h,
|
|
320
|
+
className: g,
|
|
321
|
+
component: b,
|
|
322
|
+
disableWindowBlurListener: l = !1,
|
|
323
|
+
endDecorator: D,
|
|
324
|
+
invertedColors: E = !1,
|
|
325
|
+
onUnmount: s,
|
|
326
|
+
open: u,
|
|
327
|
+
size: k = "md",
|
|
328
|
+
slots: t = {},
|
|
329
|
+
slotProps: a,
|
|
330
|
+
startDecorator: m,
|
|
331
|
+
variant: J = "outlined"
|
|
332
|
+
} = o, K = he(o, Te), [Q, B] = c.useState(!0), [G, O] = c.useState(!1), T = c.useRef(s);
|
|
333
|
+
T.current = s, c.useEffect(() => {
|
|
334
|
+
if (u)
|
|
335
|
+
O(!1), B(!1);
|
|
336
|
+
else {
|
|
337
|
+
O(!0);
|
|
338
|
+
const L = setTimeout(() => {
|
|
339
|
+
var _;
|
|
340
|
+
B(!0), O(!1), (_ = T.current) == null || _.call(T);
|
|
341
|
+
}, i);
|
|
342
|
+
return () => {
|
|
343
|
+
clearTimeout(L);
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
}, [u, i]);
|
|
347
|
+
const C = S({}, o, {
|
|
348
|
+
anchorOrigin: d,
|
|
349
|
+
autoHideDuration: v,
|
|
350
|
+
color: p,
|
|
351
|
+
animationDuration: i,
|
|
352
|
+
disableWindowBlurListener: l,
|
|
353
|
+
invertedColors: E,
|
|
354
|
+
size: k,
|
|
355
|
+
variant: J
|
|
356
|
+
});
|
|
357
|
+
delete C.onUnmount;
|
|
358
|
+
const z = ze(C), {
|
|
359
|
+
getRootProps: Z,
|
|
360
|
+
onClickAway: ee
|
|
361
|
+
} = Re(C), ne = (L) => {
|
|
362
|
+
G || ee(L);
|
|
363
|
+
}, w = S({}, K, {
|
|
364
|
+
component: b,
|
|
365
|
+
slots: t,
|
|
366
|
+
slotProps: a
|
|
367
|
+
}), [re, oe] = M("root", {
|
|
368
|
+
ref: f,
|
|
369
|
+
className: be(z.root, g),
|
|
370
|
+
elementType: Pe,
|
|
371
|
+
externalForwardedProps: w,
|
|
372
|
+
getSlotProps: Z,
|
|
373
|
+
ownerState: C
|
|
374
|
+
}), [te, ae] = M("startDecorator", {
|
|
375
|
+
className: z.startDecorator,
|
|
376
|
+
elementType: Me,
|
|
377
|
+
externalForwardedProps: w,
|
|
378
|
+
ownerState: C
|
|
379
|
+
}), [se, ie] = M("endDecorator", {
|
|
380
|
+
className: z.endDecorator,
|
|
381
|
+
elementType: He,
|
|
382
|
+
externalForwardedProps: w,
|
|
383
|
+
ownerState: C
|
|
384
|
+
}), ce = t.clickAway || R;
|
|
385
|
+
return !u && Q ? null : /* @__PURE__ */ y(ce, S({
|
|
386
|
+
onClickAway: ne
|
|
387
|
+
}, typeof (a == null ? void 0 : a.clickAway) == "function" ? a.clickAway(C) : a == null ? void 0 : a.clickAway, {
|
|
388
|
+
children: /* @__PURE__ */ q(re, S({}, oe, {
|
|
389
|
+
children: [m && /* @__PURE__ */ y(te, S({}, ae, {
|
|
390
|
+
children: m
|
|
391
|
+
})), h, D && /* @__PURE__ */ y(se, S({}, ie, {
|
|
392
|
+
children: D
|
|
393
|
+
}))]
|
|
394
|
+
}))
|
|
395
|
+
}));
|
|
396
|
+
});
|
|
397
|
+
process.env.NODE_ENV !== "production" && (Y.propTypes = {
|
|
398
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
399
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
400
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
401
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
402
|
+
/**
|
|
403
|
+
* The anchor of the `Snackbar`.
|
|
404
|
+
* On smaller screens, the component grows to occupy all the available width,
|
|
405
|
+
* the horizontal alignment is ignored.
|
|
406
|
+
* @default { vertical: 'bottom', horizontal: 'right' }
|
|
407
|
+
*/
|
|
408
|
+
anchorOrigin: e.shape({
|
|
409
|
+
horizontal: e.oneOf(["center", "left", "right"]).isRequired,
|
|
410
|
+
vertical: e.oneOf(["bottom", "top"]).isRequired
|
|
411
|
+
}),
|
|
412
|
+
/**
|
|
413
|
+
* The duration of the animation in milliseconds. This value is used to control
|
|
414
|
+
* the length of time it takes for an animation to complete one cycle. It is also
|
|
415
|
+
* utilized for delaying the unmount of the component.
|
|
416
|
+
* Provide this value if you have your own animation so that we can precisely
|
|
417
|
+
* time the component's unmount to match your custom animation.
|
|
418
|
+
* @default 300
|
|
419
|
+
*/
|
|
420
|
+
animationDuration: e.number,
|
|
421
|
+
/**
|
|
422
|
+
* The number of milliseconds to wait before automatically calling the
|
|
423
|
+
* `onClose` function. `onClose` should then set the state of the `open`
|
|
424
|
+
* prop to hide the Snackbar. This behavior is disabled by default with
|
|
425
|
+
* the `null` value.
|
|
426
|
+
* @default null
|
|
427
|
+
*/
|
|
428
|
+
autoHideDuration: e.number,
|
|
429
|
+
/**
|
|
430
|
+
* @ignore
|
|
431
|
+
*/
|
|
432
|
+
children: e.node,
|
|
433
|
+
/**
|
|
434
|
+
* @ignore
|
|
435
|
+
*/
|
|
436
|
+
className: e.string,
|
|
437
|
+
/**
|
|
438
|
+
* The color of the component. It supports those theme colors that make sense for this component.
|
|
439
|
+
* @default 'neutral'
|
|
440
|
+
*/
|
|
441
|
+
color: e.oneOf(["danger", "neutral", "primary", "success", "warning"]),
|
|
442
|
+
/**
|
|
443
|
+
* The component used for the root node.
|
|
444
|
+
* Either a string to use a HTML element or a component.
|
|
445
|
+
*/
|
|
446
|
+
component: e.elementType,
|
|
447
|
+
/**
|
|
448
|
+
* If `true`, the `autoHideDuration` timer will expire even if the window is not focused.
|
|
449
|
+
* @default false
|
|
450
|
+
*/
|
|
451
|
+
disableWindowBlurListener: e.bool,
|
|
452
|
+
/**
|
|
453
|
+
* Element placed after the children.
|
|
454
|
+
*/
|
|
455
|
+
endDecorator: e.node,
|
|
456
|
+
/**
|
|
457
|
+
* If `true`, the children with an implicit color prop invert their colors to match the component's variant and color.
|
|
458
|
+
* @default false
|
|
459
|
+
*/
|
|
460
|
+
invertedColors: e.bool,
|
|
461
|
+
/**
|
|
462
|
+
* When displaying multiple consecutive snackbars using a single parent-rendered
|
|
463
|
+
* `<Snackbar/>`, add the `key` prop to ensure independent treatment of each message.
|
|
464
|
+
* For instance, use `<Snackbar key={message} />`. Otherwise, messages might update
|
|
465
|
+
* in place, and features like `autoHideDuration` could be affected.
|
|
466
|
+
*/
|
|
467
|
+
key: () => null,
|
|
468
|
+
/**
|
|
469
|
+
* @ignore
|
|
470
|
+
*/
|
|
471
|
+
onBlur: e.func,
|
|
472
|
+
/**
|
|
473
|
+
* Callback fired when the component requests to be closed.
|
|
474
|
+
* Typically `onClose` is used to set state in the parent component,
|
|
475
|
+
* which is used to control the `Snackbar` `open` prop.
|
|
476
|
+
* The `reason` parameter can optionally be used to control the response to `onClose`,
|
|
477
|
+
* for example ignoring `clickaway`.
|
|
478
|
+
*
|
|
479
|
+
* @param {React.SyntheticEvent<any> | Event} event The event source of the callback.
|
|
480
|
+
* @param {string} reason Can be: `"timeout"` (`autoHideDuration` expired), `"clickaway"`, or `"escapeKeyDown"`.
|
|
481
|
+
*/
|
|
482
|
+
onClose: e.func,
|
|
483
|
+
/**
|
|
484
|
+
* @ignore
|
|
485
|
+
*/
|
|
486
|
+
onFocus: e.func,
|
|
487
|
+
/**
|
|
488
|
+
* @ignore
|
|
489
|
+
*/
|
|
490
|
+
onMouseEnter: e.func,
|
|
491
|
+
/**
|
|
492
|
+
* @ignore
|
|
493
|
+
*/
|
|
494
|
+
onMouseLeave: e.func,
|
|
495
|
+
/**
|
|
496
|
+
* A callback fired when the component is about to be unmounted.
|
|
497
|
+
*/
|
|
498
|
+
onUnmount: e.func,
|
|
499
|
+
/**
|
|
500
|
+
* If `true`, the component is shown.
|
|
501
|
+
*/
|
|
502
|
+
open: e.bool.isRequired,
|
|
503
|
+
/**
|
|
504
|
+
* The number of milliseconds to wait before dismissing after user interaction.
|
|
505
|
+
* If `autoHideDuration` prop isn't specified, it does nothing.
|
|
506
|
+
* If `autoHideDuration` prop is specified but `resumeHideDuration` isn't,
|
|
507
|
+
* we default to `autoHideDuration / 2` ms.
|
|
508
|
+
*/
|
|
509
|
+
resumeHideDuration: e.number,
|
|
510
|
+
/**
|
|
511
|
+
* The size of the component.
|
|
512
|
+
* @default 'md'
|
|
513
|
+
*/
|
|
514
|
+
size: e.oneOf(["sm", "md", "lg"]),
|
|
515
|
+
/**
|
|
516
|
+
* The props used for each slot inside.
|
|
517
|
+
* @default {}
|
|
518
|
+
*/
|
|
519
|
+
slotProps: e.shape({
|
|
520
|
+
clickAway: e.oneOfType([e.func, e.shape({
|
|
521
|
+
children: e.element.isRequired,
|
|
522
|
+
disableReactTree: e.bool,
|
|
523
|
+
mouseEvent: e.oneOf(["onClick", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", !1]),
|
|
524
|
+
onClickAway: e.func.isRequired,
|
|
525
|
+
touchEvent: e.oneOf(["onTouchEnd", "onTouchStart", !1])
|
|
526
|
+
})]),
|
|
527
|
+
endDecorator: e.oneOfType([e.func, e.object]),
|
|
528
|
+
root: e.oneOfType([e.func, e.object]),
|
|
529
|
+
startDecorator: e.oneOfType([e.func, e.object])
|
|
530
|
+
}),
|
|
531
|
+
/**
|
|
532
|
+
* The components used for each slot inside.
|
|
533
|
+
* @default {}
|
|
534
|
+
*/
|
|
535
|
+
slots: e.shape({
|
|
536
|
+
clickAway: e.elementType,
|
|
537
|
+
endDecorator: e.elementType,
|
|
538
|
+
root: e.elementType,
|
|
539
|
+
startDecorator: e.elementType
|
|
540
|
+
}),
|
|
541
|
+
/**
|
|
542
|
+
* Element placed before the children.
|
|
543
|
+
*/
|
|
544
|
+
startDecorator: e.node,
|
|
545
|
+
/**
|
|
546
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
547
|
+
*/
|
|
548
|
+
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
549
|
+
/**
|
|
550
|
+
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
|
|
551
|
+
* @default 'outlined'
|
|
552
|
+
*/
|
|
553
|
+
variant: e.oneOf(["outlined", "plain", "soft", "solid"])
|
|
554
|
+
});
|
|
555
|
+
const Be = ge(/* @__PURE__ */ y("path", {
|
|
556
|
+
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"
|
|
557
|
+
}), "Error"), We = ({
|
|
558
|
+
notification: r,
|
|
559
|
+
onClose: n
|
|
560
|
+
}) => {
|
|
561
|
+
const f = ye(), o = Se();
|
|
562
|
+
return r.open ? /* @__PURE__ */ y(
|
|
563
|
+
Y,
|
|
564
|
+
{
|
|
565
|
+
open: r.open,
|
|
566
|
+
onClose: n,
|
|
567
|
+
autoHideDuration: r.variant === "error" ? 5e3 : 3e3,
|
|
568
|
+
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
569
|
+
color: r.variant === "success" ? "success" : "danger",
|
|
570
|
+
variant: "soft",
|
|
571
|
+
startDecorator: r.variant === "success" ? /* @__PURE__ */ y(Ee, {}) : /* @__PURE__ */ y(Be, {}),
|
|
572
|
+
sx: {
|
|
573
|
+
borderRadius: f.sm,
|
|
574
|
+
fontFamily: o.secondary,
|
|
575
|
+
minWidth: "300px",
|
|
576
|
+
maxWidth: "400px",
|
|
577
|
+
zIndex: 9999,
|
|
578
|
+
position: "fixed"
|
|
579
|
+
},
|
|
580
|
+
children: /* @__PURE__ */ q(De, { sx: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
581
|
+
r.title && /* @__PURE__ */ y(
|
|
582
|
+
I,
|
|
583
|
+
{
|
|
584
|
+
level: "title-md",
|
|
585
|
+
sx: {
|
|
586
|
+
fontWeight: 600,
|
|
587
|
+
fontSize: "16px",
|
|
588
|
+
lineHeight: 1.2,
|
|
589
|
+
color: "inherit"
|
|
590
|
+
},
|
|
591
|
+
children: r.title
|
|
592
|
+
}
|
|
593
|
+
),
|
|
594
|
+
r.message && /* @__PURE__ */ y(
|
|
595
|
+
I,
|
|
596
|
+
{
|
|
597
|
+
level: "body-sm",
|
|
598
|
+
sx: {
|
|
599
|
+
fontSize: "14px",
|
|
600
|
+
lineHeight: 1.3,
|
|
601
|
+
color: "inherit",
|
|
602
|
+
opacity: 0.9
|
|
603
|
+
},
|
|
604
|
+
children: r.message
|
|
605
|
+
}
|
|
606
|
+
)
|
|
607
|
+
] })
|
|
608
|
+
}
|
|
609
|
+
) : null;
|
|
610
|
+
};
|
|
611
|
+
export {
|
|
612
|
+
We as N,
|
|
613
|
+
Ue as d,
|
|
614
|
+
Fe as g
|
|
615
|
+
};
|