fansunited-frontend-components 0.0.49 → 0.0.52
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/Betslip.d.ts +5 -0
- package/Betslip.d.ts.map +1 -0
- package/Betslip.js +5 -0
- package/ChanceGame.js +87 -86
- package/ClassicQuizPlay.js +174 -173
- package/CollectLead.js +33 -32
- package/Discussion.js +1 -1
- package/EitherOrPlay.js +171 -170
- package/EventGamePlay.js +25 -24
- package/Leaderboard.js +88 -87
- package/MatchQuizPlay.js +28 -27
- package/PersonalityQuizPlay.js +21 -20
- package/PickThePair.js +87 -86
- package/PollVote.js +19 -18
- package/Predictor.js +4756 -4693
- package/README.md +523 -1
- package/chunks/{AlertMessage-Ds45MBHB.js → AlertMessage-CQ9WJHSb.js} +25 -24
- package/chunks/{ArrowRightAlt-DKADQN2o.js → ArrowRightAlt-C1U8SNu-.js} +5 -5
- package/chunks/{Avatar-K1EWhhkA.js → Avatar-COVJnfGS.js} +79 -78
- package/chunks/Button-COvmPv4P.js +2270 -0
- package/chunks/{ChanceGameEmbedVariant-DqFg4YKU.js → ChanceGameEmbedVariant-lfZlSATv.js} +44 -43
- package/chunks/{CheckCircle-CV9iMpkZ.js → CheckCircle-h7-xLUq-.js} +27 -26
- package/chunks/{Close-C6Cw96SJ.js → Close-BTC6xyyj.js} +1 -1
- package/chunks/{Close-BHp4N1-6.js → Close-DBaorsP1.js} +1 -1
- package/chunks/{CollectLeadForm-DnLKA8qz.js → CollectLeadForm-O7Cpe0ix.js} +128 -127
- package/chunks/{Divider-BvUimRFw.js → Divider-DBCeQt9x.js} +15 -14
- package/chunks/{Edit-CZ3ni-Ur.js → Edit-BwwxJdNv.js} +35 -34
- package/chunks/{EmojiEvents-DpmLq98V.js → EmojiEvents-DVPGlTU_.js} +3 -3
- package/chunks/{FavoriteBorder-DUK_DrY4.js → FavoriteBorder-BnhfbKy1.js} +1 -1
- package/chunks/{FormControl-BUItlVIg.js → FormControl-COjw1gQd.js} +38 -37
- package/chunks/{FormLabel-CeTNPUn7.js → FormLabel-e5_v5cjP.js} +18 -17
- package/chunks/{Input-MJCQcYzo.js → Input-er-Yyqtt.js} +17 -16
- package/chunks/{KeyboardArrowDown-SZpn2GhJ.js → KeyboardArrowDown-BeaYH92n.js} +1 -1
- package/chunks/{ModalDialog-Cfgv9UAA.js → ModalDialog-XkhZtgYm.js} +58 -57
- package/chunks/{NotFoundSkeleton-Cs6DtD9u.js → NotFoundSkeleton-C71TRYl5.js} +95 -94
- package/chunks/{Notification-pcKtlRms.js → Notification-CkPupg9q.js} +57 -56
- package/chunks/{OverlayApiErrorSkeleton-Dl3s5Oaf.js → OverlayApiErrorSkeleton-CkuDu9uV.js} +20 -19
- package/chunks/{OverlayLeadAfterCollection-F2TAV9wK.js → OverlayLeadAfterCollection-Dkxl4cKn.js} +28 -27
- package/chunks/{OverlayScoreStateSkeleton-LQ0svzeX.js → OverlayScoreStateSkeleton-RauDjIg5.js} +16 -15
- package/chunks/{Person-BGdniS_p.js → Person-WCt2MN5j.js} +32 -31
- package/chunks/{PickOneOfX-Ci4ZJf7G.js → PickOneOfX-DabfTR2W.js} +8 -7
- package/chunks/{Popper-DOVSI4rJ.js → Popper-OPgbZzY7.js} +127 -126
- package/chunks/{Portal-Cs0dgwmH.js → Portal-BQilulgu.js} +5 -5
- package/chunks/{PrizeCard-DF3QxwQJ.js → PrizeCard-DgHyperX.js} +5238 -6653
- package/chunks/{Select-BHeTdOYr.js → Select-9gmhEo71.js} +133 -132
- package/chunks/{Spinner-DbUB64Gj.js → Spinner-BoysVPn7.js} +12 -11
- package/chunks/{SplitLeadAfterCollection-DSw6X5fx.js → SplitLeadAfterCollection-C5oCDYT1.js} +15 -14
- package/chunks/{Stack-BpHk5eb0.js → Stack-INH9bhkC.js} +30 -29
- package/chunks/{StandardContentSkeleton-Bae1LLQ_.js → StandardContentSkeleton-DsAhzMfU.js} +1 -1
- package/chunks/{Tabs-hwJ7jsUl.js → Tabs-DaVatjCJ.js} +60 -59
- package/chunks/{Textarea-zOtMdgc5.js → Textarea-DeMxp3Zn.js} +48 -47
- package/chunks/{TimerOutlined-DWE7f0YX.js → TimerOutlined-DJh2vL3s.js} +3 -3
- package/chunks/{helpers-NuC1SzL3.js → helpers-Bd9FT9hj.js} +1 -1
- package/chunks/{index-D1K1OB4p.js → index-5MPtbA_r.js} +255 -239
- package/chunks/index-BjfKDjAM.js +4 -0
- package/chunks/main-DDb9jezz.js +1758 -0
- package/chunks/{main-hB01WcoP.js → main-DWw1vqVY.js} +38 -37
- package/chunks/{useEventCallback-CizlfWBo.js → useEventCallback-vbTEFVPa.js} +8 -7
- package/chunks/{useForwardedInput-RWDntqBU.js → useForwardedInput-DumYVfgj.js} +26 -25
- package/chunks/{useImageVariant-Cex1eIqq.js → useImageVariant-B1ObJh_B.js} +1 -1
- 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 +5 -3
- package/package.json +5 -1
- package/chunks/index-BaypiKlO.js +0 -4
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { jsxs as D, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { C as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { C as M } from "./CheckCircle-h7-xLUq-.js";
|
|
3
|
+
import { s as _, r as E, _ as i, t as J, v as $, P as r, J as f, l as z, u as k, b as B, c as L } from "./PrizeCard-DgHyperX.js";
|
|
4
|
+
import * as U from "react";
|
|
5
|
+
import { s as y, r as V, t as q, v as G, u as K, a as v, c as Q, T as g } from "./Button-COvmPv4P.js";
|
|
6
|
+
import { S as X } from "./Stack-INH9bhkC.js";
|
|
7
|
+
function Y(e) {
|
|
8
|
+
return _("MuiAlert", e);
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
E("MuiAlert", ["root", "startDecorator", "endDecorator", "colorPrimary", "colorDanger", "colorNeutral", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]);
|
|
10
11
|
const Z = ["children", "className", "color", "invertedColors", "role", "variant", "size", "startDecorator", "endDecorator", "component", "slots", "slotProps"], w = (e) => {
|
|
11
12
|
const {
|
|
12
13
|
variant: o,
|
|
13
14
|
color: a,
|
|
14
15
|
size: t
|
|
15
16
|
} = e, n = {
|
|
16
|
-
root: ["root", t && `size${
|
|
17
|
+
root: ["root", t && `size${f(t)}`, a && `color${f(a)}`, o && `variant${f(o)}`],
|
|
17
18
|
startDecorator: ["startDecorator"],
|
|
18
19
|
endDecorator: ["endDecorator"]
|
|
19
20
|
};
|
|
20
|
-
return
|
|
21
|
+
return Q(n, Y, {});
|
|
21
22
|
}, rr = y("div", {
|
|
22
23
|
name: "JoyAlert",
|
|
23
24
|
slot: "Root",
|
|
@@ -31,7 +32,7 @@ const Z = ["children", "className", "color", "invertedColors", "role", "variant"
|
|
|
31
32
|
p: t,
|
|
32
33
|
padding: n,
|
|
33
34
|
borderRadius: l
|
|
34
|
-
} =
|
|
35
|
+
} = V({
|
|
35
36
|
theme: e,
|
|
36
37
|
ownerState: o
|
|
37
38
|
}, ["p", "padding", "borderRadius"]);
|
|
@@ -71,7 +72,7 @@ const Z = ["children", "className", "color", "invertedColors", "role", "variant"
|
|
|
71
72
|
lg: "md"
|
|
72
73
|
}[o.size]}`], {
|
|
73
74
|
fontWeight: e.vars.fontWeight.md
|
|
74
|
-
}, o.variant === "solid" && o.color && o.invertedColors &&
|
|
75
|
+
}, o.variant === "solid" && o.color && o.invertedColors && q(o.color)(e), o.variant === "soft" && o.color && o.invertedColors && G(o.color)(e), (a = e.variants[o.variant]) == null ? void 0 : a[o.color]), t !== void 0 && {
|
|
75
76
|
"--Alert-padding": t
|
|
76
77
|
}, n !== void 0 && {
|
|
77
78
|
"--Alert-padding": n
|
|
@@ -93,8 +94,8 @@ const Z = ["children", "className", "color", "invertedColors", "role", "variant"
|
|
|
93
94
|
display: "inherit",
|
|
94
95
|
flex: "none",
|
|
95
96
|
marginLeft: "auto"
|
|
96
|
-
}), C = /* @__PURE__ */
|
|
97
|
-
const t =
|
|
97
|
+
}), C = /* @__PURE__ */ U.forwardRef(function(o, a) {
|
|
98
|
+
const t = K({
|
|
98
99
|
props: o,
|
|
99
100
|
name: "JoyAlert"
|
|
100
101
|
}), {
|
|
@@ -110,7 +111,7 @@ const Z = ["children", "className", "color", "invertedColors", "role", "variant"
|
|
|
110
111
|
component: I,
|
|
111
112
|
slots: S = {},
|
|
112
113
|
slotProps: R = {}
|
|
113
|
-
} = t, O =
|
|
114
|
+
} = t, O = J(t, Z), p = i({}, t, {
|
|
114
115
|
color: c,
|
|
115
116
|
invertedColors: d,
|
|
116
117
|
variant: b,
|
|
@@ -119,21 +120,21 @@ const Z = ["children", "className", "color", "invertedColors", "role", "variant"
|
|
|
119
120
|
component: I,
|
|
120
121
|
slots: S,
|
|
121
122
|
slotProps: R
|
|
122
|
-
}), [P, W] =
|
|
123
|
+
}), [P, W] = v("root", {
|
|
123
124
|
ref: a,
|
|
124
|
-
className:
|
|
125
|
+
className: $(u.root, l),
|
|
125
126
|
elementType: rr,
|
|
126
127
|
externalForwardedProps: m,
|
|
127
128
|
ownerState: p,
|
|
128
129
|
additionalProps: {
|
|
129
130
|
role: x
|
|
130
131
|
}
|
|
131
|
-
}), [N, j] =
|
|
132
|
+
}), [N, j] = v("startDecorator", {
|
|
132
133
|
className: u.startDecorator,
|
|
133
134
|
elementType: or,
|
|
134
135
|
externalForwardedProps: m,
|
|
135
136
|
ownerState: p
|
|
136
|
-
}), [F,
|
|
137
|
+
}), [F, H] = v("endDecorator", {
|
|
137
138
|
className: u.endDecorator,
|
|
138
139
|
elementType: er,
|
|
139
140
|
externalForwardedProps: m,
|
|
@@ -142,7 +143,7 @@ const Z = ["children", "className", "color", "invertedColors", "role", "variant"
|
|
|
142
143
|
return /* @__PURE__ */ D(P, i({}, W, {
|
|
143
144
|
children: [h && /* @__PURE__ */ s(N, i({}, j, {
|
|
144
145
|
children: h
|
|
145
|
-
})), n, A && /* @__PURE__ */ s(F, i({},
|
|
146
|
+
})), n, A && /* @__PURE__ */ s(F, i({}, H, {
|
|
146
147
|
children: A
|
|
147
148
|
}))]
|
|
148
149
|
}));
|
|
@@ -228,7 +229,7 @@ const tr = z(/* @__PURE__ */ s("path", {
|
|
|
228
229
|
}), "Warning"), ar = (e, o) => {
|
|
229
230
|
switch (e) {
|
|
230
231
|
case "success":
|
|
231
|
-
return /* @__PURE__ */ s(
|
|
232
|
+
return /* @__PURE__ */ s(M, {});
|
|
232
233
|
case "error":
|
|
233
234
|
return /* @__PURE__ */ s(sr, { sx: { color: o } });
|
|
234
235
|
case "info":
|
|
@@ -246,13 +247,13 @@ const tr = z(/* @__PURE__ */ s("path", {
|
|
|
246
247
|
case "neutral":
|
|
247
248
|
return "neutral";
|
|
248
249
|
}
|
|
249
|
-
},
|
|
250
|
+
}, ur = ({
|
|
250
251
|
variant: e,
|
|
251
252
|
title: o,
|
|
252
253
|
message: a,
|
|
253
254
|
description: t
|
|
254
255
|
}) => {
|
|
255
|
-
const n =
|
|
256
|
+
const n = k(), l = B(), c = L().secondary, d = nr(e);
|
|
256
257
|
return /* @__PURE__ */ s(
|
|
257
258
|
C,
|
|
258
259
|
{
|
|
@@ -269,7 +270,7 @@ const tr = z(/* @__PURE__ */ s("path", {
|
|
|
269
270
|
"--Icon-fontSize": "1.25em"
|
|
270
271
|
},
|
|
271
272
|
children: /* @__PURE__ */ D(
|
|
272
|
-
|
|
273
|
+
X,
|
|
273
274
|
{
|
|
274
275
|
sx: {
|
|
275
276
|
fontSize: "1.5em"
|
|
@@ -311,5 +312,5 @@ export {
|
|
|
311
312
|
C as A,
|
|
312
313
|
tr as I,
|
|
313
314
|
sr as W,
|
|
314
|
-
|
|
315
|
+
ur as a
|
|
315
316
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { u, e as h, B as S,
|
|
2
|
+
import { u, e as h, B as S, l as k } from "./PrizeCard-DgHyperX.js";
|
|
3
3
|
const x = (e) => ({
|
|
4
4
|
// Main container with background overlay (with ScoreStateWrapper)
|
|
5
5
|
mainContainerWithWrapper: {
|
|
@@ -55,12 +55,12 @@ const x = (e) => ({
|
|
|
55
55
|
entity: e,
|
|
56
56
|
backgroundImage: d,
|
|
57
57
|
imageBackgroundGradient: c,
|
|
58
|
-
children:
|
|
58
|
+
children: l,
|
|
59
59
|
isWrappedWithScoreStateWrapper: n = !1
|
|
60
60
|
}) => {
|
|
61
61
|
var t;
|
|
62
|
-
const o = u(),
|
|
63
|
-
spacingScale:
|
|
62
|
+
const o = u(), s = h(), r = ((t = e.branding) == null ? void 0 : t.colors) || null, b = o.customRadius.light.md, g = o.border.light.size, m = (r == null ? void 0 : r.borderColor) || o.colorSchemes.dark.secondaryContainer, i = x({
|
|
63
|
+
spacingScale: s,
|
|
64
64
|
mdBorderRadius: b,
|
|
65
65
|
borderSize: g,
|
|
66
66
|
borderColor: m,
|
|
@@ -72,7 +72,7 @@ const x = (e) => ({
|
|
|
72
72
|
S,
|
|
73
73
|
{
|
|
74
74
|
sx: n ? i.mainContainerWithWrapper : i.mainContainer,
|
|
75
|
-
children:
|
|
75
|
+
children: l
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
78
|
}, z = k(/* @__PURE__ */ a("path", {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as I, r as k, _ as c, P as o, t as R, v as L, J as N } from "./PrizeCard-DgHyperX.js";
|
|
2
2
|
import * as p from "react";
|
|
3
|
-
import { c as
|
|
3
|
+
import { s as z, u as j, a as h, c as _ } from "./Button-COvmPv4P.js";
|
|
4
|
+
import { c as V } from "./CheckCircle-h7-xLUq-.js";
|
|
4
5
|
import { jsx as v } from "react/jsx-runtime";
|
|
5
6
|
const W = V(/* @__PURE__ */ v("path", {
|
|
6
7
|
d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
@@ -9,21 +10,21 @@ function H(r) {
|
|
|
9
10
|
return I("MuiAvatar", r);
|
|
10
11
|
}
|
|
11
12
|
k("MuiAvatar", ["root", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "fallback", "sizeSm", "sizeMd", "sizeLg", "img", "variantOutlined", "variantSoft", "variantSolid"]);
|
|
12
|
-
function
|
|
13
|
+
function q(r) {
|
|
13
14
|
return I("MuiAvatarGroup", r);
|
|
14
15
|
}
|
|
15
16
|
k("MuiAvatarGroup", ["root"]);
|
|
16
|
-
const
|
|
17
|
+
const B = ["className", "color", "component", "size", "variant", "children", "slots", "slotProps"], C = /* @__PURE__ */ p.createContext(void 0);
|
|
17
18
|
process.env.NODE_ENV !== "production" && (C.displayName = "AvatarGroupContext");
|
|
18
|
-
const
|
|
19
|
+
const K = () => _({
|
|
19
20
|
root: ["root"]
|
|
20
|
-
},
|
|
21
|
+
}, q, {}), Q = z("div", {
|
|
21
22
|
name: "JoyAvatarGroup",
|
|
22
23
|
slot: "Root",
|
|
23
|
-
overridesResolver: (r,
|
|
24
|
+
overridesResolver: (r, e) => e.root
|
|
24
25
|
})(({
|
|
25
26
|
ownerState: r,
|
|
26
|
-
theme:
|
|
27
|
+
theme: e
|
|
27
28
|
}) => c({}, r.size === "sm" && {
|
|
28
29
|
"--AvatarGroup-gap": "-0.375rem",
|
|
29
30
|
"--Avatar-ringSize": "2px"
|
|
@@ -34,13 +35,13 @@ const B = () => _({
|
|
|
34
35
|
"--AvatarGroup-gap": "-0.625rem",
|
|
35
36
|
"--Avatar-ringSize": "4px"
|
|
36
37
|
}, {
|
|
37
|
-
"--Avatar-ring": `0 0 0 var(--Avatar-ringSize) var(--Avatar-ringColor, ${
|
|
38
|
+
"--Avatar-ring": `0 0 0 var(--Avatar-ringSize) var(--Avatar-ringColor, ${e.vars.palette.background.surface})`,
|
|
38
39
|
"--Avatar-marginInlineStart": "var(--AvatarGroup-gap)",
|
|
39
40
|
display: "flex",
|
|
40
41
|
marginInlineStart: "calc(-1 * var(--AvatarGroup-gap))"
|
|
41
|
-
})),
|
|
42
|
-
const t =
|
|
43
|
-
props:
|
|
42
|
+
})), X = /* @__PURE__ */ p.forwardRef(function(e, a) {
|
|
43
|
+
const t = j({
|
|
44
|
+
props: e,
|
|
44
45
|
name: "JoyAvatarGroup"
|
|
45
46
|
}), {
|
|
46
47
|
className: s,
|
|
@@ -51,15 +52,15 @@ const B = () => _({
|
|
|
51
52
|
children: d,
|
|
52
53
|
slots: m = {},
|
|
53
54
|
slotProps: g = {}
|
|
54
|
-
} = t, T =
|
|
55
|
+
} = t, T = R(t, B), y = p.useMemo(() => c({}, t, {
|
|
55
56
|
color: n,
|
|
56
57
|
component: i,
|
|
57
58
|
size: l,
|
|
58
59
|
variant: f
|
|
59
|
-
}), [n, i, t, l, f]), b =
|
|
60
|
+
}), [n, i, t, l, f]), b = K(), [x, O] = h("root", {
|
|
60
61
|
ref: a,
|
|
61
62
|
className: L(b.root, s),
|
|
62
|
-
elementType:
|
|
63
|
+
elementType: Q,
|
|
63
64
|
externalForwardedProps: c({}, T, {
|
|
64
65
|
component: i,
|
|
65
66
|
slots: m,
|
|
@@ -74,7 +75,7 @@ const B = () => _({
|
|
|
74
75
|
}))
|
|
75
76
|
});
|
|
76
77
|
});
|
|
77
|
-
process.env.NODE_ENV !== "production" && (
|
|
78
|
+
process.env.NODE_ENV !== "production" && (X.propTypes = {
|
|
78
79
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
79
80
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
80
81
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -83,86 +84,86 @@ process.env.NODE_ENV !== "production" && (Q.propTypes = {
|
|
|
83
84
|
* Used to render icon or text elements inside the AvatarGroup if `src` is not set.
|
|
84
85
|
* This can be an element, or just a string.
|
|
85
86
|
*/
|
|
86
|
-
children:
|
|
87
|
+
children: o.node,
|
|
87
88
|
/**
|
|
88
89
|
* @ignore
|
|
89
90
|
*/
|
|
90
|
-
className:
|
|
91
|
+
className: o.string,
|
|
91
92
|
/**
|
|
92
93
|
* The color of the component. It supports those theme colors that make sense for this component.
|
|
93
94
|
* @default 'neutral'
|
|
94
95
|
*/
|
|
95
|
-
color:
|
|
96
|
+
color: o.oneOfType([o.oneOf(["danger", "neutral", "primary", "success", "warning"]), o.string]),
|
|
96
97
|
/**
|
|
97
98
|
* The component used for the root node.
|
|
98
99
|
* Either a string to use a HTML element or a component.
|
|
99
100
|
*/
|
|
100
|
-
component:
|
|
101
|
+
component: o.elementType,
|
|
101
102
|
/**
|
|
102
103
|
* The size of the component.
|
|
103
104
|
* It accepts theme values between 'sm' and 'lg'.
|
|
104
105
|
* @default 'md'
|
|
105
106
|
*/
|
|
106
|
-
size:
|
|
107
|
+
size: o.oneOfType([o.oneOf(["lg", "md", "sm"]), o.string]),
|
|
107
108
|
/**
|
|
108
109
|
* The props used for each slot inside.
|
|
109
110
|
* @default {}
|
|
110
111
|
*/
|
|
111
|
-
slotProps:
|
|
112
|
-
root:
|
|
112
|
+
slotProps: o.shape({
|
|
113
|
+
root: o.oneOfType([o.func, o.object])
|
|
113
114
|
}),
|
|
114
115
|
/**
|
|
115
116
|
* The components used for each slot inside.
|
|
116
117
|
* @default {}
|
|
117
118
|
*/
|
|
118
|
-
slots:
|
|
119
|
-
root:
|
|
119
|
+
slots: o.shape({
|
|
120
|
+
root: o.elementType
|
|
120
121
|
}),
|
|
121
122
|
/**
|
|
122
123
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
123
124
|
*/
|
|
124
|
-
sx:
|
|
125
|
+
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
|
|
125
126
|
/**
|
|
126
127
|
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
|
|
127
128
|
* @default 'soft'
|
|
128
129
|
*/
|
|
129
|
-
variant:
|
|
130
|
+
variant: o.oneOfType([o.oneOf(["outlined", "plain", "soft", "solid"]), o.string])
|
|
130
131
|
});
|
|
131
132
|
const Y = ["alt", "color", "size", "variant", "src", "srcSet", "children", "component", "slots", "slotProps"], Z = (r) => {
|
|
132
133
|
const {
|
|
133
|
-
size:
|
|
134
|
+
size: e,
|
|
134
135
|
variant: a,
|
|
135
136
|
color: t,
|
|
136
137
|
src: s,
|
|
137
138
|
srcSet: n
|
|
138
139
|
} = r, i = {
|
|
139
|
-
root: ["root", a && `variant${N(a)}`, t && `color${N(t)}`,
|
|
140
|
+
root: ["root", a && `variant${N(a)}`, t && `color${N(t)}`, e && `size${N(e)}`],
|
|
140
141
|
img: [(s || n) && "img"],
|
|
141
142
|
fallback: ["fallback"]
|
|
142
143
|
};
|
|
143
144
|
return _(i, H, {});
|
|
144
|
-
},
|
|
145
|
+
}, oo = z("div", {
|
|
145
146
|
name: "JoyAvatar",
|
|
146
147
|
slot: "Root",
|
|
147
|
-
overridesResolver: (r,
|
|
148
|
+
overridesResolver: (r, e) => e.root
|
|
148
149
|
})(({
|
|
149
150
|
theme: r,
|
|
150
|
-
ownerState:
|
|
151
|
+
ownerState: e
|
|
151
152
|
}) => {
|
|
152
153
|
var a;
|
|
153
154
|
return c({
|
|
154
|
-
"--Icon-color":
|
|
155
|
-
}, r.typography[`title-${
|
|
155
|
+
"--Icon-color": e.color !== "neutral" || e.variant === "solid" ? "currentColor" : r.vars.palette.text.icon
|
|
156
|
+
}, r.typography[`title-${e.size}`], e.size === "sm" && {
|
|
156
157
|
width: "var(--Avatar-size, 2rem)",
|
|
157
158
|
height: "var(--Avatar-size, 2rem)",
|
|
158
159
|
fontSize: "calc(var(--Avatar-size, 2rem) * 0.4375)"
|
|
159
160
|
// default as 14px
|
|
160
|
-
},
|
|
161
|
+
}, e.size === "md" && {
|
|
161
162
|
width: "var(--Avatar-size, 2.5rem)",
|
|
162
163
|
height: "var(--Avatar-size, 2.5rem)",
|
|
163
164
|
fontSize: "calc(var(--Avatar-size, 2.5rem) * 0.4)"
|
|
164
165
|
// default as 16px
|
|
165
|
-
},
|
|
166
|
+
}, e.size === "lg" && {
|
|
166
167
|
width: "var(--Avatar-size, 3rem)",
|
|
167
168
|
height: "var(--Avatar-size, 3rem)",
|
|
168
169
|
fontSize: "calc(var(--Avatar-size, 3rem) * 0.375)"
|
|
@@ -179,11 +180,11 @@ const Y = ["alt", "color", "size", "variant", "src", "srcSet", "children", "comp
|
|
|
179
180
|
overflow: "hidden",
|
|
180
181
|
borderRadius: "var(--Avatar-radius, 50%)",
|
|
181
182
|
userSelect: "none"
|
|
182
|
-
}, (a = r.variants[
|
|
183
|
-
}),
|
|
183
|
+
}, (a = r.variants[e.variant]) == null ? void 0 : a[e.color]);
|
|
184
|
+
}), eo = z("img", {
|
|
184
185
|
name: "JoyAvatar",
|
|
185
186
|
slot: "Img",
|
|
186
|
-
overridesResolver: (r,
|
|
187
|
+
overridesResolver: (r, e) => e.img
|
|
187
188
|
})({
|
|
188
189
|
width: "100%",
|
|
189
190
|
height: "100%",
|
|
@@ -194,17 +195,17 @@ const Y = ["alt", "color", "size", "variant", "src", "srcSet", "children", "comp
|
|
|
194
195
|
color: "transparent",
|
|
195
196
|
// Hide the image broken icon, only works on Chrome.
|
|
196
197
|
textIndent: 1e4
|
|
197
|
-
}),
|
|
198
|
+
}), ro = z(W, {
|
|
198
199
|
name: "JoyAvatar",
|
|
199
200
|
slot: "Fallback",
|
|
200
|
-
overridesResolver: (r,
|
|
201
|
+
overridesResolver: (r, e) => e.fallback
|
|
201
202
|
})({
|
|
202
203
|
width: "64%",
|
|
203
204
|
height: "64%"
|
|
204
205
|
});
|
|
205
|
-
function
|
|
206
|
+
function to({
|
|
206
207
|
crossOrigin: r,
|
|
207
|
-
referrerPolicy:
|
|
208
|
+
referrerPolicy: e,
|
|
208
209
|
src: a,
|
|
209
210
|
srcSet: t
|
|
210
211
|
}) {
|
|
@@ -219,14 +220,14 @@ function te({
|
|
|
219
220
|
i && n("loaded");
|
|
220
221
|
}, l.onerror = () => {
|
|
221
222
|
i && n("error");
|
|
222
|
-
}, l.crossOrigin = r, l.referrerPolicy =
|
|
223
|
+
}, l.crossOrigin = r, l.referrerPolicy = e, a && (l.src = a), t && (l.srcset = t), () => {
|
|
223
224
|
i = !1;
|
|
224
225
|
};
|
|
225
|
-
}, [r,
|
|
226
|
+
}, [r, e, a, t]), s;
|
|
226
227
|
}
|
|
227
|
-
const
|
|
228
|
-
const t =
|
|
229
|
-
props:
|
|
228
|
+
const ao = /* @__PURE__ */ p.forwardRef(function(e, a) {
|
|
229
|
+
const t = j({
|
|
230
|
+
props: e,
|
|
230
231
|
name: "JoyAvatar"
|
|
231
232
|
}), s = p.useContext(C), {
|
|
232
233
|
alt: n,
|
|
@@ -239,47 +240,47 @@ const ae = /* @__PURE__ */ p.forwardRef(function(o, a) {
|
|
|
239
240
|
component: T,
|
|
240
241
|
slots: y = {},
|
|
241
242
|
slotProps: b = {}
|
|
242
|
-
} = t, x =
|
|
243
|
+
} = t, x = R(t, Y), O = e.variant || (s == null ? void 0 : s.variant) || f, F = e.color || (s == null ? void 0 : s.color) || i, $ = e.size || (s == null ? void 0 : s.size) || l;
|
|
243
244
|
let u = null;
|
|
244
245
|
const A = c({}, t, {
|
|
245
|
-
color:
|
|
246
|
-
size:
|
|
246
|
+
color: F,
|
|
247
|
+
size: $,
|
|
247
248
|
variant: O,
|
|
248
249
|
grouped: !!s
|
|
249
250
|
}), P = Z(A), S = c({}, x, {
|
|
250
251
|
component: T,
|
|
251
252
|
slots: y,
|
|
252
253
|
slotProps: b
|
|
253
|
-
}), [
|
|
254
|
+
}), [w, E] = h("root", {
|
|
254
255
|
ref: a,
|
|
255
256
|
className: P.root,
|
|
256
|
-
elementType:
|
|
257
|
+
elementType: oo,
|
|
257
258
|
externalForwardedProps: S,
|
|
258
259
|
ownerState: A
|
|
259
|
-
}), [
|
|
260
|
+
}), [J, G] = h("img", {
|
|
260
261
|
additionalProps: {
|
|
261
262
|
alt: n,
|
|
262
263
|
src: d,
|
|
263
264
|
srcSet: m
|
|
264
265
|
},
|
|
265
266
|
className: P.img,
|
|
266
|
-
elementType:
|
|
267
|
+
elementType: eo,
|
|
267
268
|
externalForwardedProps: S,
|
|
268
269
|
ownerState: A
|
|
269
|
-
}), [
|
|
270
|
+
}), [M, U] = h("fallback", {
|
|
270
271
|
className: P.fallback,
|
|
271
|
-
elementType:
|
|
272
|
+
elementType: ro,
|
|
272
273
|
externalForwardedProps: S,
|
|
273
274
|
ownerState: A
|
|
274
|
-
}), D =
|
|
275
|
+
}), D = to(c({}, G, {
|
|
275
276
|
src: d,
|
|
276
277
|
srcSet: m
|
|
277
278
|
}));
|
|
278
|
-
return (d || m) && D !== "error" ? u = /* @__PURE__ */ v(
|
|
279
|
+
return (d || m) && D !== "error" ? u = /* @__PURE__ */ v(J, c({}, G)) : g != null ? u = g : n ? u = n[0] : u = /* @__PURE__ */ v(M, c({}, U)), /* @__PURE__ */ v(w, c({}, E, {
|
|
279
280
|
children: u
|
|
280
281
|
}));
|
|
281
282
|
});
|
|
282
|
-
process.env.NODE_ENV !== "production" && (
|
|
283
|
+
process.env.NODE_ENV !== "production" && (ao.propTypes = {
|
|
283
284
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
284
285
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
285
286
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -288,65 +289,65 @@ process.env.NODE_ENV !== "production" && (ae.propTypes = {
|
|
|
288
289
|
* Used in combination with `src` or `srcSet` to
|
|
289
290
|
* provide an alt attribute for the rendered `img` element.
|
|
290
291
|
*/
|
|
291
|
-
alt:
|
|
292
|
+
alt: o.string,
|
|
292
293
|
/**
|
|
293
294
|
* Used to render icon or text elements inside the Avatar if `src` is not set.
|
|
294
295
|
* This can be an element, or just a string.
|
|
295
296
|
*/
|
|
296
|
-
children:
|
|
297
|
+
children: o.node,
|
|
297
298
|
/**
|
|
298
299
|
* The color of the component. It supports those theme colors that make sense for this component.
|
|
299
300
|
* @default 'neutral'
|
|
300
301
|
*/
|
|
301
|
-
color:
|
|
302
|
+
color: o.oneOfType([o.oneOf(["danger", "neutral", "primary", "success", "warning"]), o.string]),
|
|
302
303
|
/**
|
|
303
304
|
* The component used for the root node.
|
|
304
305
|
* Either a string to use a HTML element or a component.
|
|
305
306
|
*/
|
|
306
|
-
component:
|
|
307
|
+
component: o.elementType,
|
|
307
308
|
/**
|
|
308
309
|
* The size of the component.
|
|
309
310
|
* It accepts theme values between 'sm' and 'lg'.
|
|
310
311
|
* @default 'md'
|
|
311
312
|
*/
|
|
312
|
-
size:
|
|
313
|
+
size: o.oneOfType([o.oneOf(["lg", "md", "sm"]), o.string]),
|
|
313
314
|
/**
|
|
314
315
|
* The props used for each slot inside.
|
|
315
316
|
* @default {}
|
|
316
317
|
*/
|
|
317
|
-
slotProps:
|
|
318
|
-
fallback:
|
|
319
|
-
img:
|
|
320
|
-
root:
|
|
318
|
+
slotProps: o.shape({
|
|
319
|
+
fallback: o.oneOfType([o.func, o.object]),
|
|
320
|
+
img: o.oneOfType([o.func, o.object]),
|
|
321
|
+
root: o.oneOfType([o.func, o.object])
|
|
321
322
|
}),
|
|
322
323
|
/**
|
|
323
324
|
* The components used for each slot inside.
|
|
324
325
|
* @default {}
|
|
325
326
|
*/
|
|
326
|
-
slots:
|
|
327
|
-
fallback:
|
|
328
|
-
img:
|
|
329
|
-
root:
|
|
327
|
+
slots: o.shape({
|
|
328
|
+
fallback: o.elementType,
|
|
329
|
+
img: o.elementType,
|
|
330
|
+
root: o.elementType
|
|
330
331
|
}),
|
|
331
332
|
/**
|
|
332
333
|
* The `src` attribute for the `img` element.
|
|
333
334
|
*/
|
|
334
|
-
src:
|
|
335
|
+
src: o.string,
|
|
335
336
|
/**
|
|
336
337
|
* The `srcSet` attribute for the `img` element.
|
|
337
338
|
* Use this attribute for responsive image display.
|
|
338
339
|
*/
|
|
339
|
-
srcSet:
|
|
340
|
+
srcSet: o.string,
|
|
340
341
|
/**
|
|
341
342
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
342
343
|
*/
|
|
343
|
-
sx:
|
|
344
|
+
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
|
|
344
345
|
/**
|
|
345
346
|
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
|
|
346
347
|
* @default 'soft'
|
|
347
348
|
*/
|
|
348
|
-
variant:
|
|
349
|
+
variant: o.oneOfType([o.oneOf(["outlined", "plain", "soft", "solid"]), o.string])
|
|
349
350
|
});
|
|
350
351
|
export {
|
|
351
|
-
|
|
352
|
+
ao as A
|
|
352
353
|
};
|