fansunited-widgets-cdn 0.0.85 → 0.0.86-RC2
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/chunks/Alert-CuOsmojH.js +149 -0
- package/chunks/AspectRatio-D3Sgxj7p.js +125 -0
- package/chunks/Avatar-BTsEKfhc.js +186 -0
- package/chunks/Button-BV7YIFkS.js +858 -0
- package/chunks/Card-DRIT0wtY.js +129 -0
- package/chunks/CardContent-CD-WZh1l.js +60 -0
- package/chunks/ChevronRight-BrCKlr3T.js +11 -0
- package/chunks/Chip-6HLNTHMI.js +281 -0
- package/chunks/ClassicQuizWrapper-t04e9_6c.js +4883 -0
- package/chunks/CollectLeadForm-DtmR2Vuf-B_3JkHJC.js +1560 -0
- package/chunks/CollectLeadWrapper-CVAVswua.js +1294 -0
- package/chunks/DialogActions-C5kAgHal.js +45 -0
- package/chunks/DialogContent-MIXff4nd.js +60 -0
- package/chunks/EitherOrById-CAo8gPjm.js +1496 -0
- package/chunks/EitherOrPreviewWrapper-DFi2bviS.js +47 -0
- package/chunks/Error-DhQL89pn-BwTV1meb.js +418 -0
- package/chunks/EventGameWrapper-BxyLL3eA.js +7633 -0
- package/chunks/Grid-Dpv_ZL23.js +279 -0
- package/chunks/IconButton-Lt9Xks7c.js +207 -0
- package/chunks/Link-DLuj1USf.js +228 -0
- package/chunks/List-DLPlZGTP.js +397 -0
- package/chunks/ListItemDecorator-CE2eQLip.js +1882 -0
- package/chunks/MatchPredictionContainer-Ct6gXvLw.js +751 -0
- package/chunks/MatchQuizWrapper-Fu6RfWVn.js +11046 -0
- package/chunks/ModalDialog-Ci3hulZA.js +619 -0
- package/chunks/NotFoundSkeleton-BYJTzYJR-Be3R34nS.js +2764 -0
- package/chunks/OverlayLeadAfterCollection-DnqztPJ5-CpELr0AC.js +896 -0
- package/chunks/OverlayScoreStateSkeleton-C9FUhcnd-DMFELrvA.js +146 -0
- package/chunks/PersonalityQuizWrapper-MpUK4n3Y.js +34374 -0
- package/chunks/PlayerOfTheMatch-D4vuR7pz.js +1406 -0
- package/chunks/PollWrapper-CzKj8xxE.js +4198 -0
- package/chunks/Portal-BWqqFvVm-TuHZWjxn.js +12717 -0
- package/chunks/Portal-DA1mxzSo.js +41 -0
- package/chunks/PreviewQuizById-WWS_LyJR.js +4864 -0
- package/chunks/Select-p_cHpLhi.js +3418 -0
- package/chunks/Sheet-BaCzogZK.js +167 -0
- package/chunks/Snackbar-DHxnbCA3.js +358 -0
- package/chunks/Stack-Dgf2LXN0.js +117 -0
- package/chunks/Tabs-CSu_cWNi.js +784 -0
- package/chunks/TeamNextMatchPrediction-C7HilNqW.js +6 -0
- package/chunks/Tutorial-DFNZxmAx.js +427 -0
- package/chunks/createLucideIcon-B6NxpYkb.js +79 -0
- package/chunks/createSvgIcon-7h7XC877.js +119 -0
- package/chunks/createSvgIcon-DVA0KIUd.js +2490 -0
- package/chunks/dataAttributeParser-CF9vxaVN.js +28 -0
- package/chunks/default-quiz-bg-CTzaADn7.js +4 -0
- package/chunks/getReactElementRef-BD-S8A24.js +25 -0
- package/chunks/index-24AwmTVJ.js +85 -0
- package/chunks/index-3vJS8JzK.js +63 -0
- package/chunks/index-BSD7mvEU.js +57 -0
- package/chunks/index-BU6iona7.js +57 -0
- package/chunks/index-BqCHiyI6.js +59 -0
- package/chunks/index-C5qRf4TV.js +20 -0
- package/chunks/index-C9MpfjqV.js +35 -0
- package/chunks/index-CMmQs5A5.js +56 -0
- package/chunks/index-CicEY2Jv.js +5 -0
- package/chunks/index-DNeawo0R.js +17 -0
- package/chunks/index-DePIySlY.js +29 -0
- package/chunks/index-DoRYU_1L.js +41 -0
- package/chunks/index-DvgG9XJj.js +20 -0
- package/chunks/index-QpZE-92Y.js +33 -0
- package/chunks/index-rgFj976B.js +17 -0
- package/chunks/index-tzsdMoo-.js +16 -0
- package/chunks/index.es-CHqz6mjo.js +6162 -0
- package/chunks/init-BEkECL0v.js +32 -0
- package/chunks/main-XP7dqk6g.js +39843 -0
- package/chunks/resolveProps-BfYZubfk.js +37 -0
- package/chunks/users-D_xgC4iQ.js +16 -0
- package/chunks/variantColorInheritance-DI3wUohX.js +28 -0
- package/fu-widgets-loader.es.js +73 -0
- package/fu-widgets-loader.js +1 -0
- package/fu-widgets.es.js +4 -0
- package/fu-widgets.iife.js +621 -682
- package/manifest.json +84 -0
- package/package.json +9 -2
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { F as H, G as N, r as W, v as _, _ as $, w as s, x as c, y as u, E as B, j as p, z as v, D as J } from "./main-XP7dqk6g.js";
|
|
2
|
+
import { r as T, g as U, h as L } from "./Button-BV7YIFkS.js";
|
|
3
|
+
function M(o) {
|
|
4
|
+
return H("MuiAlert", o);
|
|
5
|
+
}
|
|
6
|
+
N("MuiAlert", ["root", "startDecorator", "endDecorator", "colorPrimary", "colorDanger", "colorNeutral", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]);
|
|
7
|
+
const k = ["children", "className", "color", "invertedColors", "role", "variant", "size", "startDecorator", "endDecorator", "component", "slots", "slotProps"], F = (o) => {
|
|
8
|
+
const {
|
|
9
|
+
variant: r,
|
|
10
|
+
color: e,
|
|
11
|
+
size: t
|
|
12
|
+
} = o, a = {
|
|
13
|
+
root: ["root", t && `size${v(t)}`, e && `color${v(e)}`, r && `variant${v(r)}`],
|
|
14
|
+
startDecorator: ["startDecorator"],
|
|
15
|
+
endDecorator: ["endDecorator"]
|
|
16
|
+
};
|
|
17
|
+
return J(a, M, {});
|
|
18
|
+
}, G = u("div", {
|
|
19
|
+
name: "JoyAlert",
|
|
20
|
+
slot: "Root",
|
|
21
|
+
overridesResolver: (o, r) => r.root
|
|
22
|
+
})(({
|
|
23
|
+
theme: o,
|
|
24
|
+
ownerState: r
|
|
25
|
+
}) => {
|
|
26
|
+
var e;
|
|
27
|
+
const {
|
|
28
|
+
p: t,
|
|
29
|
+
padding: a,
|
|
30
|
+
borderRadius: l
|
|
31
|
+
} = T({
|
|
32
|
+
theme: o,
|
|
33
|
+
ownerState: r
|
|
34
|
+
}, ["p", "padding", "borderRadius"]);
|
|
35
|
+
return [s({
|
|
36
|
+
"--Alert-radius": o.vars.radius.sm,
|
|
37
|
+
"--Alert-decoratorChildRadius": "max((var(--Alert-radius) - var(--variant-borderWidth, 0px)) - var(--Alert-padding), min(var(--Alert-padding) + var(--variant-borderWidth, 0px), var(--Alert-radius) / 2))",
|
|
38
|
+
"--Button-minHeight": "var(--Alert-decoratorChildHeight)",
|
|
39
|
+
"--IconButton-size": "var(--Alert-decoratorChildHeight)",
|
|
40
|
+
"--Button-radius": "var(--Alert-decoratorChildRadius)",
|
|
41
|
+
"--IconButton-radius": "var(--Alert-decoratorChildRadius)",
|
|
42
|
+
"--Icon-color": "currentColor"
|
|
43
|
+
}, r.size === "sm" && {
|
|
44
|
+
"--Alert-padding": "0.5rem",
|
|
45
|
+
"--Alert-decoratorChildHeight": "1.5rem",
|
|
46
|
+
"--Icon-fontSize": o.vars.fontSize.xl,
|
|
47
|
+
gap: "0.5rem"
|
|
48
|
+
}, r.size === "md" && {
|
|
49
|
+
"--Alert-padding": "0.75rem",
|
|
50
|
+
"--Alert-decoratorChildHeight": "2rem",
|
|
51
|
+
"--Icon-fontSize": o.vars.fontSize.xl,
|
|
52
|
+
gap: "0.625rem"
|
|
53
|
+
}, r.size === "lg" && {
|
|
54
|
+
"--Alert-padding": "1rem",
|
|
55
|
+
"--Alert-decoratorChildHeight": "2.375rem",
|
|
56
|
+
"--Icon-fontSize": o.vars.fontSize.xl2,
|
|
57
|
+
gap: "0.875rem"
|
|
58
|
+
}, {
|
|
59
|
+
backgroundColor: o.vars.palette.background.surface,
|
|
60
|
+
display: "flex",
|
|
61
|
+
position: "relative",
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
padding: "var(--Alert-padding)",
|
|
64
|
+
borderRadius: "var(--Alert-radius)"
|
|
65
|
+
}, o.typography[`body-${{
|
|
66
|
+
sm: "xs",
|
|
67
|
+
md: "sm",
|
|
68
|
+
lg: "md"
|
|
69
|
+
}[r.size]}`], {
|
|
70
|
+
fontWeight: o.vars.fontWeight.md
|
|
71
|
+
}, r.variant === "solid" && r.color && r.invertedColors && U(r.color)(o), r.variant === "soft" && r.color && r.invertedColors && L(r.color)(o), (e = o.variants[r.variant]) == null ? void 0 : e[r.color]), t !== void 0 && {
|
|
72
|
+
"--Alert-padding": t
|
|
73
|
+
}, a !== void 0 && {
|
|
74
|
+
"--Alert-padding": a
|
|
75
|
+
}, l !== void 0 && {
|
|
76
|
+
"--Alert-radius": l
|
|
77
|
+
}];
|
|
78
|
+
}), O = u("span", {
|
|
79
|
+
name: "JoyAlert",
|
|
80
|
+
slot: "StartDecorator",
|
|
81
|
+
overridesResolver: (o, r) => r.startDecorator
|
|
82
|
+
})({
|
|
83
|
+
display: "inherit",
|
|
84
|
+
flex: "none"
|
|
85
|
+
}), V = u("span", {
|
|
86
|
+
name: "JoyAlert",
|
|
87
|
+
slot: "EndDecorator",
|
|
88
|
+
overridesResolver: (o, r) => r.endDecorator
|
|
89
|
+
})({
|
|
90
|
+
display: "inherit",
|
|
91
|
+
flex: "none",
|
|
92
|
+
marginLeft: "auto"
|
|
93
|
+
}), Q = /* @__PURE__ */ W.forwardRef(function(r, e) {
|
|
94
|
+
const t = _({
|
|
95
|
+
props: r,
|
|
96
|
+
name: "JoyAlert"
|
|
97
|
+
}), {
|
|
98
|
+
children: a,
|
|
99
|
+
className: l,
|
|
100
|
+
color: A = "neutral",
|
|
101
|
+
invertedColors: D = !1,
|
|
102
|
+
role: f = "alert",
|
|
103
|
+
variant: x = "soft",
|
|
104
|
+
size: y = "md",
|
|
105
|
+
startDecorator: m,
|
|
106
|
+
endDecorator: g,
|
|
107
|
+
component: h,
|
|
108
|
+
slots: z = {},
|
|
109
|
+
slotProps: C = {}
|
|
110
|
+
} = t, R = $(t, k), i = s({}, t, {
|
|
111
|
+
color: A,
|
|
112
|
+
invertedColors: D,
|
|
113
|
+
variant: x,
|
|
114
|
+
size: y
|
|
115
|
+
}), n = F(i), d = s({}, R, {
|
|
116
|
+
component: h,
|
|
117
|
+
slots: z,
|
|
118
|
+
slotProps: C
|
|
119
|
+
}), [P, b] = c("root", {
|
|
120
|
+
ref: e,
|
|
121
|
+
className: B(n.root, l),
|
|
122
|
+
elementType: G,
|
|
123
|
+
externalForwardedProps: d,
|
|
124
|
+
ownerState: i,
|
|
125
|
+
additionalProps: {
|
|
126
|
+
role: f
|
|
127
|
+
}
|
|
128
|
+
}), [I, S] = c("startDecorator", {
|
|
129
|
+
className: n.startDecorator,
|
|
130
|
+
elementType: O,
|
|
131
|
+
externalForwardedProps: d,
|
|
132
|
+
ownerState: i
|
|
133
|
+
}), [j, E] = c("endDecorator", {
|
|
134
|
+
className: n.endDecorator,
|
|
135
|
+
elementType: V,
|
|
136
|
+
externalForwardedProps: d,
|
|
137
|
+
ownerState: i
|
|
138
|
+
});
|
|
139
|
+
return /* @__PURE__ */ p.jsxs(P, s({}, b, {
|
|
140
|
+
children: [m && /* @__PURE__ */ p.jsx(I, s({}, S, {
|
|
141
|
+
children: m
|
|
142
|
+
})), a, g && /* @__PURE__ */ p.jsx(j, s({}, E, {
|
|
143
|
+
children: g
|
|
144
|
+
}))]
|
|
145
|
+
}));
|
|
146
|
+
});
|
|
147
|
+
export {
|
|
148
|
+
Q as A
|
|
149
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { F as U, G as z, r as a, v as B, _ as D, w as s, x as p, y as h, j as d, z as m, D as J } from "./main-XP7dqk6g.js";
|
|
2
|
+
function N(t) {
|
|
3
|
+
return U("MuiAspectRatio", t);
|
|
4
|
+
}
|
|
5
|
+
z("MuiAspectRatio", ["root", "content", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]);
|
|
6
|
+
const T = ["children", "ratio", "minHeight", "maxHeight", "objectFit", "color", "variant", "component", "flex", "slots", "slotProps"], W = (t) => {
|
|
7
|
+
const {
|
|
8
|
+
variant: o,
|
|
9
|
+
color: e
|
|
10
|
+
} = t, i = {
|
|
11
|
+
root: ["root"],
|
|
12
|
+
content: ["content", o && `variant${m(o)}`, e && `color${m(e)}`]
|
|
13
|
+
};
|
|
14
|
+
return J(i, N, {});
|
|
15
|
+
}, I = h("div", {
|
|
16
|
+
name: "JoyAspectRatio",
|
|
17
|
+
slot: "Root",
|
|
18
|
+
overridesResolver: (t, o) => o.root
|
|
19
|
+
})(({
|
|
20
|
+
ownerState: t,
|
|
21
|
+
theme: o
|
|
22
|
+
}) => {
|
|
23
|
+
const e = typeof t.minHeight == "number" ? `${t.minHeight}px` : t.minHeight, i = typeof t.maxHeight == "number" ? `${t.maxHeight}px` : t.maxHeight;
|
|
24
|
+
return {
|
|
25
|
+
// a context variable for any child component
|
|
26
|
+
"--AspectRatio-paddingBottom": `clamp(var(--AspectRatio-minHeight), calc(100% / (${t.ratio})), var(--AspectRatio-maxHeight))`,
|
|
27
|
+
"--AspectRatio-maxHeight": i || "9999px",
|
|
28
|
+
"--AspectRatio-minHeight": e || "0px",
|
|
29
|
+
"--Icon-color": t.color !== "neutral" || t.variant === "solid" ? "currentColor" : o.vars.palette.text.icon,
|
|
30
|
+
borderRadius: "var(--AspectRatio-radius)",
|
|
31
|
+
display: t.flex ? "flex" : "block",
|
|
32
|
+
flex: t.flex ? 1 : "initial",
|
|
33
|
+
flexDirection: "column",
|
|
34
|
+
margin: "var(--AspectRatio-margin)"
|
|
35
|
+
};
|
|
36
|
+
}), M = h("div", {
|
|
37
|
+
name: "JoyAspectRatio",
|
|
38
|
+
slot: "Content",
|
|
39
|
+
overridesResolver: (t, o) => o.content
|
|
40
|
+
})(({
|
|
41
|
+
theme: t,
|
|
42
|
+
ownerState: o
|
|
43
|
+
}) => {
|
|
44
|
+
var e;
|
|
45
|
+
return s({
|
|
46
|
+
flex: 1,
|
|
47
|
+
position: "relative",
|
|
48
|
+
borderRadius: "inherit",
|
|
49
|
+
height: 0,
|
|
50
|
+
paddingBottom: "calc(var(--AspectRatio-paddingBottom) - 2 * var(--variant-borderWidth, 0px))",
|
|
51
|
+
overflow: "hidden",
|
|
52
|
+
transition: "inherit",
|
|
53
|
+
// makes it easy to add transition to the content
|
|
54
|
+
// use data-attribute instead of :first-child to support zero config SSR (emotion)
|
|
55
|
+
// use nested selector for integrating with nextjs image `fill` layout (spans are inserted on top of the img)
|
|
56
|
+
"& [data-first-child]": {
|
|
57
|
+
display: "flex",
|
|
58
|
+
justifyContent: "center",
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
boxSizing: "border-box",
|
|
61
|
+
position: "absolute",
|
|
62
|
+
width: "100%",
|
|
63
|
+
height: "100%",
|
|
64
|
+
objectFit: o.objectFit,
|
|
65
|
+
margin: 0,
|
|
66
|
+
padding: 0,
|
|
67
|
+
"& > img": {
|
|
68
|
+
// support art-direction that uses <picture><img /></picture>
|
|
69
|
+
width: "100%",
|
|
70
|
+
height: "100%",
|
|
71
|
+
objectFit: o.objectFit
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, t.typography["body-md"], (e = t.variants[o.variant]) == null ? void 0 : e[o.color]);
|
|
75
|
+
}), G = /* @__PURE__ */ a.forwardRef(function(o, e) {
|
|
76
|
+
const i = B({
|
|
77
|
+
props: o,
|
|
78
|
+
name: "JoyAspectRatio"
|
|
79
|
+
}), {
|
|
80
|
+
children: x,
|
|
81
|
+
ratio: g = "16 / 9",
|
|
82
|
+
minHeight: v,
|
|
83
|
+
maxHeight: u,
|
|
84
|
+
objectFit: R = "cover",
|
|
85
|
+
color: f = "neutral",
|
|
86
|
+
variant: y = "soft",
|
|
87
|
+
component: A,
|
|
88
|
+
flex: b = !1,
|
|
89
|
+
slots: H = {},
|
|
90
|
+
slotProps: j = {}
|
|
91
|
+
} = i, C = D(i, T), r = s({}, i, {
|
|
92
|
+
flex: b,
|
|
93
|
+
minHeight: v,
|
|
94
|
+
maxHeight: u,
|
|
95
|
+
objectFit: R,
|
|
96
|
+
ratio: g,
|
|
97
|
+
color: f,
|
|
98
|
+
variant: y
|
|
99
|
+
}), c = W(r), l = s({}, C, {
|
|
100
|
+
component: A,
|
|
101
|
+
slots: H,
|
|
102
|
+
slotProps: j
|
|
103
|
+
}), [P, F] = p("root", {
|
|
104
|
+
ref: e,
|
|
105
|
+
className: c.root,
|
|
106
|
+
elementType: I,
|
|
107
|
+
externalForwardedProps: l,
|
|
108
|
+
ownerState: r
|
|
109
|
+
}), [$, _] = p("content", {
|
|
110
|
+
className: c.content,
|
|
111
|
+
elementType: M,
|
|
112
|
+
externalForwardedProps: l,
|
|
113
|
+
ownerState: r
|
|
114
|
+
});
|
|
115
|
+
return /* @__PURE__ */ d.jsx(P, s({}, F, {
|
|
116
|
+
children: /* @__PURE__ */ d.jsx($, s({}, _, {
|
|
117
|
+
children: a.Children.map(x, (n, E) => E === 0 && /* @__PURE__ */ a.isValidElement(n) ? /* @__PURE__ */ a.cloneElement(n, {
|
|
118
|
+
"data-first-child": ""
|
|
119
|
+
}) : n)
|
|
120
|
+
}))
|
|
121
|
+
}));
|
|
122
|
+
});
|
|
123
|
+
export {
|
|
124
|
+
G as A
|
|
125
|
+
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { j as d, F as L, G as M, r as v, y as p, w as l, v as T, _ as U, x as z, z as h, D as w } from "./main-XP7dqk6g.js";
|
|
2
|
+
import { c as E } from "./createSvgIcon-7h7XC877.js";
|
|
3
|
+
const D = E(/* @__PURE__ */ d.jsx("path", {
|
|
4
|
+
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"
|
|
5
|
+
}), "Person");
|
|
6
|
+
function W(r) {
|
|
7
|
+
return L("MuiAvatar", r);
|
|
8
|
+
}
|
|
9
|
+
M("MuiAvatar", ["root", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "fallback", "sizeSm", "sizeMd", "sizeLg", "img", "variantOutlined", "variantSoft", "variantSolid"]);
|
|
10
|
+
const H = /* @__PURE__ */ v.createContext(void 0);
|
|
11
|
+
p("div", {
|
|
12
|
+
name: "JoyAvatarGroup",
|
|
13
|
+
slot: "Root",
|
|
14
|
+
overridesResolver: (r, a) => a.root
|
|
15
|
+
})(({
|
|
16
|
+
ownerState: r,
|
|
17
|
+
theme: a
|
|
18
|
+
}) => l({}, r.size === "sm" && {
|
|
19
|
+
"--AvatarGroup-gap": "-0.375rem",
|
|
20
|
+
"--Avatar-ringSize": "2px"
|
|
21
|
+
}, r.size === "md" && {
|
|
22
|
+
"--AvatarGroup-gap": "-0.5rem",
|
|
23
|
+
"--Avatar-ringSize": "2px"
|
|
24
|
+
}, r.size === "lg" && {
|
|
25
|
+
"--AvatarGroup-gap": "-0.625rem",
|
|
26
|
+
"--Avatar-ringSize": "4px"
|
|
27
|
+
}, {
|
|
28
|
+
"--Avatar-ring": `0 0 0 var(--Avatar-ringSize) var(--Avatar-ringColor, ${a.vars.palette.background.surface})`,
|
|
29
|
+
"--Avatar-marginInlineStart": "var(--AvatarGroup-gap)",
|
|
30
|
+
display: "flex",
|
|
31
|
+
marginInlineStart: "calc(-1 * var(--AvatarGroup-gap))"
|
|
32
|
+
}));
|
|
33
|
+
const O = ["alt", "color", "size", "variant", "src", "srcSet", "children", "component", "slots", "slotProps"], q = (r) => {
|
|
34
|
+
const {
|
|
35
|
+
size: a,
|
|
36
|
+
variant: t,
|
|
37
|
+
color: e,
|
|
38
|
+
src: o,
|
|
39
|
+
srcSet: s
|
|
40
|
+
} = r, n = {
|
|
41
|
+
root: ["root", t && `variant${h(t)}`, e && `color${h(e)}`, a && `size${h(a)}`],
|
|
42
|
+
img: [(o || s) && "img"],
|
|
43
|
+
fallback: ["fallback"]
|
|
44
|
+
};
|
|
45
|
+
return w(n, W, {});
|
|
46
|
+
}, B = p("div", {
|
|
47
|
+
name: "JoyAvatar",
|
|
48
|
+
slot: "Root",
|
|
49
|
+
overridesResolver: (r, a) => a.root
|
|
50
|
+
})(({
|
|
51
|
+
theme: r,
|
|
52
|
+
ownerState: a
|
|
53
|
+
}) => {
|
|
54
|
+
var t;
|
|
55
|
+
return l({
|
|
56
|
+
"--Icon-color": a.color !== "neutral" || a.variant === "solid" ? "currentColor" : r.vars.palette.text.icon
|
|
57
|
+
}, r.typography[`title-${a.size}`], a.size === "sm" && {
|
|
58
|
+
width: "var(--Avatar-size, 2rem)",
|
|
59
|
+
height: "var(--Avatar-size, 2rem)",
|
|
60
|
+
fontSize: "calc(var(--Avatar-size, 2rem) * 0.4375)"
|
|
61
|
+
// default as 14px
|
|
62
|
+
}, a.size === "md" && {
|
|
63
|
+
width: "var(--Avatar-size, 2.5rem)",
|
|
64
|
+
height: "var(--Avatar-size, 2.5rem)",
|
|
65
|
+
fontSize: "calc(var(--Avatar-size, 2.5rem) * 0.4)"
|
|
66
|
+
// default as 16px
|
|
67
|
+
}, a.size === "lg" && {
|
|
68
|
+
width: "var(--Avatar-size, 3rem)",
|
|
69
|
+
height: "var(--Avatar-size, 3rem)",
|
|
70
|
+
fontSize: "calc(var(--Avatar-size, 3rem) * 0.375)"
|
|
71
|
+
// default as 18px
|
|
72
|
+
}, {
|
|
73
|
+
marginInlineStart: "var(--Avatar-marginInlineStart)",
|
|
74
|
+
boxShadow: "var(--Avatar-ring)",
|
|
75
|
+
position: "relative",
|
|
76
|
+
display: "flex",
|
|
77
|
+
alignItems: "center",
|
|
78
|
+
justifyContent: "center",
|
|
79
|
+
flexShrink: 0,
|
|
80
|
+
lineHeight: 1,
|
|
81
|
+
overflow: "hidden",
|
|
82
|
+
borderRadius: "var(--Avatar-radius, 50%)",
|
|
83
|
+
userSelect: "none"
|
|
84
|
+
}, (t = r.variants[a.variant]) == null ? void 0 : t[a.color]);
|
|
85
|
+
}), K = p("img", {
|
|
86
|
+
name: "JoyAvatar",
|
|
87
|
+
slot: "Img",
|
|
88
|
+
overridesResolver: (r, a) => a.img
|
|
89
|
+
})({
|
|
90
|
+
width: "100%",
|
|
91
|
+
height: "100%",
|
|
92
|
+
textAlign: "center",
|
|
93
|
+
// Handle non-square image. The property isn't supported by IE11.
|
|
94
|
+
objectFit: "cover",
|
|
95
|
+
// Hide alt text.
|
|
96
|
+
color: "transparent",
|
|
97
|
+
// Hide the image broken icon, only works on Chrome.
|
|
98
|
+
textIndent: 1e4
|
|
99
|
+
}), Q = p(D, {
|
|
100
|
+
name: "JoyAvatar",
|
|
101
|
+
slot: "Fallback",
|
|
102
|
+
overridesResolver: (r, a) => a.fallback
|
|
103
|
+
})({
|
|
104
|
+
width: "64%",
|
|
105
|
+
height: "64%"
|
|
106
|
+
});
|
|
107
|
+
function V({
|
|
108
|
+
crossOrigin: r,
|
|
109
|
+
referrerPolicy: a,
|
|
110
|
+
src: t,
|
|
111
|
+
srcSet: e
|
|
112
|
+
}) {
|
|
113
|
+
const [o, s] = v.useState(!1);
|
|
114
|
+
return v.useEffect(() => {
|
|
115
|
+
if (!t && !e)
|
|
116
|
+
return;
|
|
117
|
+
s(!1);
|
|
118
|
+
let n = !0;
|
|
119
|
+
const i = new Image();
|
|
120
|
+
return i.onload = () => {
|
|
121
|
+
n && s("loaded");
|
|
122
|
+
}, i.onerror = () => {
|
|
123
|
+
n && s("error");
|
|
124
|
+
}, i.crossOrigin = r, i.referrerPolicy = a, t && (i.src = t), e && (i.srcset = e), () => {
|
|
125
|
+
n = !1;
|
|
126
|
+
};
|
|
127
|
+
}, [r, a, t, e]), o;
|
|
128
|
+
}
|
|
129
|
+
const ra = /* @__PURE__ */ v.forwardRef(function(a, t) {
|
|
130
|
+
const e = T({
|
|
131
|
+
props: a,
|
|
132
|
+
name: "JoyAvatar"
|
|
133
|
+
}), o = v.useContext(H), {
|
|
134
|
+
alt: s,
|
|
135
|
+
color: n = "neutral",
|
|
136
|
+
size: i = "md",
|
|
137
|
+
variant: I = "soft",
|
|
138
|
+
src: g,
|
|
139
|
+
srcSet: u,
|
|
140
|
+
children: x,
|
|
141
|
+
component: S,
|
|
142
|
+
slots: b = {},
|
|
143
|
+
slotProps: C = {}
|
|
144
|
+
} = e, P = U(e, O), k = a.variant || (o == null ? void 0 : o.variant) || I, R = a.color || (o == null ? void 0 : o.color) || n, j = a.size || (o == null ? void 0 : o.size) || i;
|
|
145
|
+
let c = null;
|
|
146
|
+
const m = l({}, e, {
|
|
147
|
+
color: R,
|
|
148
|
+
size: j,
|
|
149
|
+
variant: k,
|
|
150
|
+
grouped: !!o
|
|
151
|
+
}), A = q(m), f = l({}, P, {
|
|
152
|
+
component: S,
|
|
153
|
+
slots: b,
|
|
154
|
+
slotProps: C
|
|
155
|
+
}), [F, G] = z("root", {
|
|
156
|
+
ref: t,
|
|
157
|
+
className: A.root,
|
|
158
|
+
elementType: B,
|
|
159
|
+
externalForwardedProps: f,
|
|
160
|
+
ownerState: m
|
|
161
|
+
}), [N, y] = z("img", {
|
|
162
|
+
additionalProps: {
|
|
163
|
+
alt: s,
|
|
164
|
+
src: g,
|
|
165
|
+
srcSet: u
|
|
166
|
+
},
|
|
167
|
+
className: A.img,
|
|
168
|
+
elementType: K,
|
|
169
|
+
externalForwardedProps: f,
|
|
170
|
+
ownerState: m
|
|
171
|
+
}), [$, J] = z("fallback", {
|
|
172
|
+
className: A.fallback,
|
|
173
|
+
elementType: Q,
|
|
174
|
+
externalForwardedProps: f,
|
|
175
|
+
ownerState: m
|
|
176
|
+
}), _ = V(l({}, y, {
|
|
177
|
+
src: g,
|
|
178
|
+
srcSet: u
|
|
179
|
+
}));
|
|
180
|
+
return (g || u) && _ !== "error" ? c = /* @__PURE__ */ d.jsx(N, l({}, y)) : x != null ? c = x : s ? c = s[0] : c = /* @__PURE__ */ d.jsx($, l({}, J)), /* @__PURE__ */ d.jsx(F, l({}, G, {
|
|
181
|
+
children: c
|
|
182
|
+
}));
|
|
183
|
+
});
|
|
184
|
+
export {
|
|
185
|
+
ra as A
|
|
186
|
+
};
|