fansunited-frontend-components 0.0.92 → 0.0.94

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.
Files changed (139) hide show
  1. package/Betslip.js +1 -1
  2. package/ChanceGame.js +139 -146
  3. package/ClassicQuizPlay.js +1 -1
  4. package/CollectLead.js +14 -20
  5. package/CompetitionStatistics.js +27 -27
  6. package/CompetitorCard.js +895 -891
  7. package/Discussion.js +1 -1
  8. package/EitherOrPlay.js +1 -1
  9. package/EventCard.js +1494 -1571
  10. package/EventGamePlay.js +1 -1
  11. package/Leaderboard.js +249 -257
  12. package/List.js +319 -436
  13. package/MatchQuizPlay.js +1 -1
  14. package/Odds.js +30 -30
  15. package/PersonalityQuizPlay.js +1 -1
  16. package/PickThePair.js +627 -693
  17. package/PlayerOfTheMatch.js +256 -279
  18. package/PollVote.js +1 -1
  19. package/Predictor.js +19443 -2
  20. package/README.md +2 -1
  21. package/Standings.js +94 -99
  22. package/TopX.js +5871 -6988
  23. package/chunks/ChanceGameEmbedVariant-C3NGwvTF.js +21 -0
  24. package/chunks/OddsSkeleton-Bav8FHHN.js +26 -0
  25. package/chunks/{OddsStrip-B159Nivm.js → OddsStrip-CviVfQI4.js} +51 -53
  26. package/chunks/{PickOneOfX-D9qlxKTD.js → PickOneOfX-a6Dv0-rR.js} +210 -212
  27. package/chunks/index-B1d9q8fX.js +4 -0
  28. package/chunks/index-BP0pvFJ4.js +4 -0
  29. package/chunks/index-CHZyL_g_.js +4 -0
  30. package/chunks/index-CeCUdRmF.js +4 -0
  31. package/chunks/index-Ckyyw-I8.js +4 -0
  32. package/chunks/index-DGvCP5G8.js +4 -0
  33. package/chunks/index-yjMVOgwO.js +4 -0
  34. package/chunks/{main-CcPVuc5G.js → main-CFwRpvUi.js} +219 -238
  35. package/chunks/{main-By2Fg4Us.js → main-D9tFZv2q.js} +272 -309
  36. package/chunks/{main-Db4YC1C9.js → main-Dj4Manb5.js} +386 -407
  37. package/chunks/{main-BhONg691.js → main-DjiQz1dv.js} +764 -1125
  38. package/chunks/{main-BoLNJccN.js → main-Dys2_Jt2.js} +1625 -1954
  39. package/chunks/{main-JAewg2VD.js → main-dwV_55lz.js} +409 -432
  40. package/chunks/main-eAQMCxQ7.js +1949 -0
  41. package/chunks/{main-CWfREbUv.js → main-gexg6lc-.js} +959 -977
  42. package/index.js +40 -44
  43. package/package.json +13 -5
  44. package/chunks/AccessTime-B7Q_InTi.js +0 -10
  45. package/chunks/AlertMessage-CTbc9daZ.js +0 -318
  46. package/chunks/Avatar-Ve0m4ut_.js +0 -353
  47. package/chunks/Button-x1sQVMH2.js +0 -665
  48. package/chunks/Card-DfxnA3Cz.js +0 -196
  49. package/chunks/CardActions-TMBAbk8a.js +0 -140
  50. package/chunks/CardContent-CLQHztIU.js +0 -106
  51. package/chunks/ChanceGameEmbedVariant-C3TKbPI4.js +0 -913
  52. package/chunks/CheckCircle-DW1VzjQO.js +0 -8
  53. package/chunks/Chip-BUoNpinI.js +0 -365
  54. package/chunks/CircularProgress-D88LgW2V.js +0 -317
  55. package/chunks/Close-BxLZcPtb.js +0 -9
  56. package/chunks/Close-DVx6f5-e.js +0 -8
  57. package/chunks/CollectLeadForm-DtUFKk99.js +0 -3419
  58. package/chunks/ConsentsList-BcIMKviP.js +0 -339
  59. package/chunks/DirectionScope-CK0duYt8.js +0 -36
  60. package/chunks/Divider-D_ALv2uC.js +0 -166
  61. package/chunks/Edit-CiKqhDom.js +0 -99
  62. package/chunks/EmojiEvents-BYoxruEl.js +0 -8
  63. package/chunks/FavoriteBorder-YhT6RHv5.js +0 -11
  64. package/chunks/FormControl-BNG04EhC.js +0 -656
  65. package/chunks/FormControlContext-Ct0huDDM.js +0 -6
  66. package/chunks/FormLabel-Bl7hTa8O.js +0 -130
  67. package/chunks/GlobalStyles-PokSS9bO.js +0 -12
  68. package/chunks/InlineSpinner-BhKW6lxZ.js +0 -28
  69. package/chunks/Input-B7kPqO0b.js +0 -391
  70. package/chunks/KeyboardArrowDown-OGGGLEnE.js +0 -8
  71. package/chunks/KeyboardArrowRight-DN7qrp17.js +0 -11
  72. package/chunks/KeyboardArrowUp-jvN5m_A0.js +0 -8
  73. package/chunks/Link-brb09X-6.js +0 -319
  74. package/chunks/ListItemButton-BFG5QJbo.js +0 -1151
  75. package/chunks/ModalClose-D3i-AyMB.js +0 -153
  76. package/chunks/ModalDialog-Be6w76fh.js +0 -880
  77. package/chunks/NotFoundSkeleton-BHRVG8yg.js +0 -83
  78. package/chunks/Notification-CC66HKXb.js +0 -614
  79. package/chunks/OddsSkeleton-BBOVhfsn.js +0 -137
  80. package/chunks/OverlayScoreStateSkeleton-D5rnBJ_w.js +0 -154
  81. package/chunks/OverlayScoreStateWrapperSkeleton-CTXzD0bm.js +0 -81
  82. package/chunks/OverlaySignInSkeleton-T8A_9Tco.js +0 -518
  83. package/chunks/OverlaySkeleton-y02LRXZy.js +0 -1193
  84. package/chunks/Person-BD-IO4aX.js +0 -8
  85. package/chunks/PersonOutline-Nxl_9g9S.js +0 -8
  86. package/chunks/Popper-CGfJHTbM.js +0 -1263
  87. package/chunks/Portal-DQQSLiON.js +0 -74
  88. package/chunks/Portal-X8O64KaQ.js +0 -66
  89. package/chunks/Predictor-BJBBwZ6R.js +0 -19513
  90. package/chunks/PrizeCard-B2tBhY45.js +0 -36400
  91. package/chunks/Search-jaDXe8g7.js +0 -14
  92. package/chunks/Select-CzBMHr7z.js +0 -1165
  93. package/chunks/Sheet-x-YGYOYz.js +0 -132
  94. package/chunks/SignInCta-3NFxIOuf.js +0 -79
  95. package/chunks/Spinner-_5U881sC.js +0 -39
  96. package/chunks/SportsSoccer-DLUgspA-.js +0 -20
  97. package/chunks/Stack-CDpKA1D-.js +0 -169
  98. package/chunks/StandardContentSkeleton-DaZftDxZ.js +0 -57
  99. package/chunks/Table-IJ9-D2DF.js +0 -394
  100. package/chunks/Tabs-iyOvjGfd.js +0 -1084
  101. package/chunks/Textarea-Dv_Z4l5j.js +0 -475
  102. package/chunks/TimerOutlined-jNsK__Zz.js +0 -8
  103. package/chunks/Tooltip-clSjN1oC.js +0 -535
  104. package/chunks/Typography-BsucZNXl.js +0 -775
  105. package/chunks/areArraysEqual-B3mXtHvh.js +0 -6
  106. package/chunks/colorInversionUtils-AoR_6ghW.js +0 -347
  107. package/chunks/createSvgIcon-BWoHeNkc.js +0 -2813
  108. package/chunks/createSvgIcon-DBkOhFdn.js +0 -206
  109. package/chunks/dividerClasses-BkQMLbsL.js +0 -9
  110. package/chunks/elementAcceptingRef-DjUfkpLB.js +0 -25
  111. package/chunks/enums-B1lTCQvC.js +0 -15
  112. package/chunks/formLabelClasses-N0g8NZ67.js +0 -9
  113. package/chunks/getReactElementRef-B3MFPBbS.js +0 -21
  114. package/chunks/helpers-CKFwVhwj.js +0 -558
  115. package/chunks/index-Bg5jypgn.js +0 -11
  116. package/chunks/index-Bnad45hB.js +0 -4
  117. package/chunks/index-C6rtfeRX.js +0 -4
  118. package/chunks/index-CFc0WTOi.js +0 -848
  119. package/chunks/index-C_kf8WZI.js +0 -4
  120. package/chunks/index-CaVpDbdC.js +0 -4
  121. package/chunks/index-DJJVbXn_.js +0 -4
  122. package/chunks/index-DQO7VDRC.js +0 -4
  123. package/chunks/index-Kgehqf8J.js +0 -4
  124. package/chunks/main-W_W6YBtr.js +0 -3280
  125. package/chunks/ownerWindow-PI509BpA.js +0 -7
  126. package/chunks/searchEntities-SJcoznz0.js +0 -38
  127. package/chunks/sportsEvents-CGX-WkNB.js +0 -27
  128. package/chunks/useButton-C9taTgFS.js +0 -106
  129. package/chunks/useConsents-BLhgfEDf.js +0 -1168
  130. package/chunks/useControlled-BYdyS7Pn.js +0 -31
  131. package/chunks/useEmbedCode-DCWnWGak.js +0 -31
  132. package/chunks/useEventCallback-C9W0M_8l.js +0 -14
  133. package/chunks/useForwardedInput-CkAnayh_.js +0 -180
  134. package/chunks/useImageVariant-B62O7iLC.js +0 -15
  135. package/chunks/useInfoPage-BHdgKdme.js +0 -50
  136. package/chunks/useParticipationDraft-Brnd_p3w.js +0 -307
  137. package/chunks/useSwitch-DLSSqtcZ.js +0 -66
  138. package/chunks/variantColorInheritance-DZr7CNx6.js +0 -30
  139. package/chunks/visuallyHidden-B8J7BVSJ.js +0 -14
@@ -1,1165 +0,0 @@
1
- import { S as Ae, _ as u, D as tt, F as Ne, G as Fe, P as o, H as We, I as ot, J as Le } from "./PrizeCard-B2tBhY45.js";
2
- import * as l from "react";
3
- import { u as se, e as me, s as G, a as qe, b as K, c as Je } from "./Typography-BsucZNXl.js";
4
- import { n as nt, f as rt, o as he, k as Be, m as Te, q as lt, h as at, i as ie, u as it, j as st, e as ct, b as ut, R as dt, S as pt, s as ft, G as bt, L as gt } from "./ListItemButton-BFG5QJbo.js";
5
- import { u as vt, V as mt } from "./variantColorInheritance-DZr7CNx6.js";
6
- import { jsx as h, jsxs as Me } from "react/jsx-runtime";
7
- import { u as Ue } from "./useButton-C9taTgFS.js";
8
- import { c as ht } from "./createSvgIcon-DBkOhFdn.js";
9
- import { r as St } from "./colorInversionUtils-AoR_6ghW.js";
10
- import { F as yt } from "./FormControlContext-Ct0huDDM.js";
11
- import { v as xt } from "./visuallyHidden-B8J7BVSJ.js";
12
- import { P as Ct } from "./Popper-CGfJHTbM.js";
13
- function Rt(e) {
14
- const {
15
- value: t,
16
- label: i,
17
- disabled: a,
18
- rootRef: c,
19
- id: p
20
- } = e, {
21
- getRootProps: b,
22
- highlighted: d,
23
- selected: f
24
- } = nt({
25
- item: t
26
- }), {
27
- getRootProps: x,
28
- rootRef: T
29
- } = Ue({
30
- disabled: a,
31
- focusableWhenDisabled: !0
32
- }), y = Ae(p), O = l.useRef(null), k = l.useMemo(() => ({
33
- disabled: a,
34
- label: i,
35
- value: t,
36
- ref: O,
37
- id: y
38
- }), [a, i, t, y]), {
39
- index: E
40
- } = rt(t, k), V = se(c, O, T), B = (g) => (C) => {
41
- var R;
42
- (R = g.onKeyDown) == null || R.call(g, C), !C.defaultMuiPrevented && [" ", "Enter"].includes(C.key) && (C.defaultMuiPrevented = !0);
43
- }, W = (g = {}) => ({
44
- onKeyDown: B(g)
45
- });
46
- return {
47
- getRootProps: (g = {}) => {
48
- const C = me(g), R = he(b, he(x, W));
49
- return u({}, g, C, R(C), {
50
- id: y,
51
- ref: V,
52
- role: "option",
53
- "aria-selected": f
54
- });
55
- },
56
- highlighted: d,
57
- index: E,
58
- selected: f,
59
- rootRef: V
60
- };
61
- }
62
- function It(e) {
63
- const t = l.useContext(Be);
64
- if (!t)
65
- throw new Error("Option: ListContext was not found.");
66
- const {
67
- getItemState: i,
68
- dispatch: a
69
- } = t, {
70
- highlighted: c,
71
- selected: p,
72
- focusable: b
73
- } = i(e), d = l.useCallback((x) => {
74
- if (x !== e)
75
- throw new Error(["Base UI Option: Tried to access the state of another Option.", "This is unsupported when the Option uses the OptionContextStabilizer as a performance optimization."].join("/n"));
76
- return {
77
- highlighted: c,
78
- selected: p,
79
- focusable: b
80
- };
81
- }, [c, p, b, e]);
82
- return {
83
- contextValue: l.useMemo(() => ({
84
- dispatch: a,
85
- getItemState: d
86
- }), [a, d])
87
- };
88
- }
89
- const Se = {
90
- buttonClick: "buttonClick",
91
- browserAutoFill: "browserAutoFill"
92
- }, Pt = (e) => {
93
- const {
94
- label: t,
95
- value: i
96
- } = e;
97
- return typeof t == "string" ? t : typeof i == "string" ? i : String(e);
98
- };
99
- function Ot(e, t) {
100
- const {
101
- open: i
102
- } = e, {
103
- context: {
104
- selectionMode: a
105
- }
106
- } = t;
107
- if (t.type === Se.buttonClick) {
108
- var c;
109
- const f = (c = e.selectedValues[0]) != null ? c : Te(null, "start", t.context);
110
- return u({}, e, {
111
- open: !i,
112
- highlightedValue: i ? null : f
113
- });
114
- }
115
- if (t.type === Se.browserAutoFill)
116
- return lt(t.item, e, t.context);
117
- const p = at(e, t);
118
- switch (t.type) {
119
- case ie.keyDown:
120
- if (e.open) {
121
- if (t.event.key === "Escape")
122
- return u({}, p, {
123
- open: !1
124
- });
125
- } else {
126
- if (t.event.key === "ArrowDown") {
127
- var b;
128
- return u({}, e, {
129
- open: !0,
130
- highlightedValue: (b = e.selectedValues[0]) != null ? b : Te(null, "start", t.context)
131
- });
132
- }
133
- if (t.event.key === "ArrowUp") {
134
- var d;
135
- return u({}, e, {
136
- open: !0,
137
- highlightedValue: (d = e.selectedValues[0]) != null ? d : Te(null, "end", t.context)
138
- });
139
- }
140
- }
141
- break;
142
- case ie.itemClick:
143
- if (a === "single")
144
- return u({}, p, {
145
- open: !1
146
- });
147
- break;
148
- case ie.blur:
149
- return u({}, p, {
150
- open: !1
151
- });
152
- default:
153
- return p;
154
- }
155
- return p;
156
- }
157
- function kt(e) {
158
- return Array.isArray(e) ? e.length === 0 ? "" : JSON.stringify(e.map((t) => t.value)) : (e == null ? void 0 : e.value) == null ? "" : typeof e.value == "string" || typeof e.value == "number" ? e.value : JSON.stringify(e.value);
159
- }
160
- function Vt(e) {
161
- const {
162
- areOptionsEqual: t,
163
- buttonRef: i,
164
- defaultOpen: a = !1,
165
- defaultValue: c,
166
- disabled: p = !1,
167
- listboxId: b,
168
- listboxRef: d,
169
- multiple: f = !1,
170
- name: x,
171
- required: T,
172
- onChange: y,
173
- onHighlightChange: O,
174
- onOpenChange: k,
175
- open: E,
176
- options: V,
177
- getOptionAsString: B = Pt,
178
- getSerializedValue: W = kt,
179
- value: g,
180
- componentName: C = "useSelect"
181
- } = e, R = l.useRef(null), Z = se(i, R), D = l.useRef(null), z = Ae(b);
182
- let H;
183
- g === void 0 && c === void 0 ? H = [] : c !== void 0 && (f ? H = c : H = c == null ? [] : [c]);
184
- const A = l.useMemo(() => {
185
- if (g !== void 0)
186
- return f ? g : g == null ? [] : [g];
187
- }, [g, f]), {
188
- subitems: _,
189
- contextValue: Q
190
- } = it(), I = l.useMemo(() => V != null ? new Map(V.map((n, r) => [n.value, {
191
- value: n.value,
192
- label: n.label,
193
- disabled: n.disabled,
194
- ref: /* @__PURE__ */ l.createRef(),
195
- id: `${z}_${r}`
196
- }])) : _, [V, _, z]), q = se(d, D), {
197
- getRootProps: ee,
198
- active: ce,
199
- focusVisible: ue,
200
- rootRef: de
201
- } = Ue({
202
- disabled: p,
203
- rootRef: Z
204
- }), J = l.useMemo(() => Array.from(I.keys()), [I]), $ = l.useCallback((n) => {
205
- if (t !== void 0) {
206
- const r = J.find((s) => t(s, n));
207
- return I.get(r);
208
- }
209
- return I.get(n);
210
- }, [I, t, J]), pe = l.useCallback((n) => {
211
- var r;
212
- const s = $(n);
213
- return (r = s == null ? void 0 : s.disabled) != null ? r : !1;
214
- }, [$]), fe = l.useCallback((n) => {
215
- const r = $(n);
216
- return r ? B(r) : "";
217
- }, [$, B]), be = l.useMemo(() => ({
218
- selectedValues: A,
219
- open: E
220
- }), [A, E]), te = l.useCallback((n) => {
221
- var r;
222
- return (r = I.get(n)) == null ? void 0 : r.id;
223
- }, [I]), ye = l.useCallback((n, r) => {
224
- if (f)
225
- y == null || y(n, r);
226
- else {
227
- var s;
228
- y == null || y(n, (s = r[0]) != null ? s : null);
229
- }
230
- }, [f, y]), xe = l.useCallback((n, r) => {
231
- O == null || O(n, r ?? null);
232
- }, [O]), Ce = l.useCallback((n, r, s) => {
233
- if (r === "open" && (k == null || k(s), s === !1 && (n == null ? void 0 : n.type) !== "blur")) {
234
- var S;
235
- (S = R.current) == null || S.focus();
236
- }
237
- }, [k]), m = l.useCallback((n) => {
238
- var r, s;
239
- return n == null ? null : (r = (s = _.get(n)) == null ? void 0 : s.ref.current) != null ? r : null;
240
- }, [_]), Re = {
241
- getInitialState: () => {
242
- var n;
243
- return {
244
- highlightedValue: null,
245
- selectedValues: (n = H) != null ? n : [],
246
- open: a
247
- };
248
- },
249
- getItemId: te,
250
- controlledProps: be,
251
- focusManagement: "DOM",
252
- getItemDomElement: m,
253
- itemComparer: t,
254
- isItemDisabled: pe,
255
- rootRef: q,
256
- onChange: ye,
257
- onHighlightChange: xe,
258
- onStateChange: Ce,
259
- reducerActionContext: l.useMemo(() => ({
260
- multiple: f
261
- }), [f]),
262
- items: J,
263
- getItemAsString: fe,
264
- selectionMode: f ? "multiple" : "single",
265
- stateReducer: Ot,
266
- componentName: C
267
- }, {
268
- dispatch: N,
269
- getRootProps: ge,
270
- contextValue: oe,
271
- state: {
272
- open: w,
273
- highlightedValue: U,
274
- selectedValues: j
275
- },
276
- rootRef: ne
277
- } = st(Re), Ie = l.useRef(w);
278
- tt(() => {
279
- if (w && U !== null) {
280
- var n;
281
- const r = (n = $(U)) == null ? void 0 : n.ref;
282
- if (!D.current || !(r != null && r.current))
283
- return;
284
- Ie.current || r.current.focus({
285
- preventScroll: !0
286
- });
287
- const s = D.current.getBoundingClientRect(), S = r.current.getBoundingClientRect();
288
- S.top < s.top ? D.current.scrollTop -= s.top - S.top : S.bottom > s.bottom && (D.current.scrollTop += S.bottom - s.bottom);
289
- }
290
- }, [w, U, $]);
291
- const re = l.useCallback((n) => $(n), [$]), Pe = (n) => (r) => {
292
- var s;
293
- if (n == null || (s = n.onClick) == null || s.call(n, r), !r.defaultMuiPrevented) {
294
- const S = {
295
- type: Se.buttonClick,
296
- event: r
297
- };
298
- N(S);
299
- }
300
- }, Oe = (n) => (r) => {
301
- var s;
302
- (s = n.onKeyDown) == null || s.call(n, r), !r.defaultMuiPrevented && (r.key === "ArrowDown" || r.key === "ArrowUp") && (r.preventDefault(), N({
303
- type: ie.keyDown,
304
- key: r.key,
305
- event: r
306
- }));
307
- }, ke = (n = {}) => ({
308
- onClick: Pe(n),
309
- onKeyDown: Oe(n)
310
- }), Ve = (n = {}) => u({}, n, ke(n), {
311
- role: "combobox",
312
- "aria-expanded": w,
313
- "aria-controls": z
314
- }), De = (n = {}) => {
315
- const r = me(n), s = he(Ve, ee);
316
- return u({}, n, s(r));
317
- }, ze = (n) => (r) => {
318
- var s, S;
319
- (s = n.onBlur) == null || s.call(n, r), !r.defaultMuiPrevented && ((S = D.current) != null && S.contains(r.relatedTarget) || r.relatedTarget === R.current) && (r.defaultMuiPrevented = !0);
320
- }, He = (n = {}) => ({
321
- onBlur: ze(n)
322
- }), le = (n = {}) => {
323
- const r = me(n), s = he(He, ge);
324
- return u({
325
- id: z,
326
- role: "listbox",
327
- "aria-multiselectable": f ? "true" : void 0
328
- }, n, s(r));
329
- };
330
- l.useDebugValue({
331
- selectedOptions: j,
332
- highlightedOption: U,
333
- open: w
334
- });
335
- const ve = l.useMemo(() => u({}, oe, Q), [oe, Q]);
336
- let L;
337
- e.multiple ? L = j : L = j.length > 0 ? j[0] : null;
338
- let P;
339
- if (f)
340
- P = L.map((n) => re(n)).filter((n) => n !== void 0);
341
- else {
342
- var M;
343
- P = (M = re(L)) != null ? M : null;
344
- }
345
- const F = (n) => (r) => {
346
- var s;
347
- if (n == null || (s = n.onChange) == null || s.call(n, r), r.defaultMuiPrevented)
348
- return;
349
- const S = I.get(r.target.value);
350
- r.target.value === "" ? N({
351
- type: ie.clearSelection
352
- }) : S !== void 0 && N({
353
- type: Se.browserAutoFill,
354
- item: S.value,
355
- event: r
356
- });
357
- };
358
- return {
359
- buttonActive: ce,
360
- buttonFocusVisible: ue,
361
- buttonRef: de,
362
- contextValue: ve,
363
- disabled: p,
364
- dispatch: N,
365
- getButtonProps: De,
366
- getHiddenInputProps: (n = {}) => {
367
- const r = me(n);
368
- return u({
369
- name: x,
370
- tabIndex: -1,
371
- "aria-hidden": !0,
372
- required: T ? !0 : void 0,
373
- value: W(P),
374
- style: xt
375
- }, n, {
376
- onChange: F(r)
377
- });
378
- },
379
- getListboxProps: le,
380
- getOptionMetadata: re,
381
- listboxRef: ne,
382
- open: w,
383
- options: J,
384
- value: L,
385
- highlightedOption: U
386
- };
387
- }
388
- function Dt(e) {
389
- const {
390
- value: t,
391
- children: i
392
- } = e, {
393
- dispatch: a,
394
- getItemIndex: c,
395
- getItemState: p,
396
- registerItem: b,
397
- totalSubitemCount: d
398
- } = t, f = l.useMemo(() => ({
399
- dispatch: a,
400
- getItemState: p,
401
- getItemIndex: c
402
- }), [a, c, p]), x = l.useMemo(() => ({
403
- getItemIndex: c,
404
- registerItem: b,
405
- totalSubitemCount: d
406
- }), [b, c, d]);
407
- return /* @__PURE__ */ h(ct.Provider, {
408
- value: x,
409
- children: /* @__PURE__ */ h(Be.Provider, {
410
- value: f,
411
- children: i
412
- })
413
- });
414
- }
415
- function zt(e) {
416
- return Fe("MuiOption", e);
417
- }
418
- const Ht = Ne("MuiOption", ["root", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "focusVisible", "disabled", "selected", "highlighted", "variantPlain", "variantSoft", "variantOutlined", "variantSolid"]), $t = ["component", "children", "disabled", "value", "label", "variant", "color", "slots", "slotProps"], Lt = (e) => {
419
- const {
420
- disabled: t,
421
- highlighted: i,
422
- selected: a
423
- } = e;
424
- return Je({
425
- root: ["root", t && "disabled", i && "highlighted", a && "selected"]
426
- }, zt, {});
427
- }, Tt = G(ut, {
428
- name: "JoyOption",
429
- slot: "Root",
430
- overridesResolver: (e, t) => t.root
431
- })(({
432
- theme: e,
433
- ownerState: t
434
- }) => {
435
- var i;
436
- const a = (i = e.variants[`${t.variant}Hover`]) == null ? void 0 : i[t.color];
437
- return {
438
- [`&.${Ht.highlighted}:not([aria-selected="true"])`]: {
439
- backgroundColor: a == null ? void 0 : a.backgroundColor
440
- }
441
- };
442
- }), Bt = /* @__PURE__ */ l.memo(/* @__PURE__ */ l.forwardRef(function(t, i) {
443
- var a;
444
- const c = qe({
445
- props: t,
446
- name: "JoyOption"
447
- }), {
448
- component: p = "li",
449
- children: b,
450
- disabled: d = !1,
451
- value: f,
452
- label: x,
453
- variant: T = "plain",
454
- color: y = "neutral",
455
- slots: O = {},
456
- slotProps: k = {}
457
- } = c, E = We(c, $t), V = l.useContext(dt), {
458
- variant: B = T,
459
- color: W = y
460
- } = vt(t.variant, t.color), g = l.useRef(null), C = se(g, i), R = x ?? (typeof b == "string" ? b : (a = g.current) == null ? void 0 : a.innerText), {
461
- getRootProps: Z,
462
- selected: D,
463
- highlighted: z,
464
- index: H
465
- } = Rt({
466
- disabled: d,
467
- label: R,
468
- value: f,
469
- rootRef: C
470
- }), A = u({}, c, {
471
- disabled: d,
472
- selected: D,
473
- highlighted: z,
474
- index: H,
475
- component: p,
476
- variant: B,
477
- color: W,
478
- row: V
479
- }), _ = Lt(A), Q = u({}, E, {
480
- component: p,
481
- slots: O,
482
- slotProps: k
483
- }), [I, q] = K("root", {
484
- ref: i,
485
- getSlotProps: Z,
486
- elementType: Tt,
487
- externalForwardedProps: Q,
488
- className: _.root,
489
- ownerState: A
490
- });
491
- return /* @__PURE__ */ h(I, u({}, q, {
492
- children: b
493
- }));
494
- })), _t = /* @__PURE__ */ l.forwardRef(function(t, i) {
495
- const {
496
- contextValue: a
497
- } = It(t.value);
498
- return /* @__PURE__ */ h(Be.Provider, {
499
- value: a,
500
- children: /* @__PURE__ */ h(Bt, u({}, t, {
501
- ref: i
502
- }))
503
- });
504
- });
505
- process.env.NODE_ENV !== "production" && (_t.propTypes = {
506
- // ┌────────────────────────────── Warning ──────────────────────────────┐
507
- // │ These PropTypes are generated from the TypeScript type definitions. │
508
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
509
- // └─────────────────────────────────────────────────────────────────────┘
510
- /**
511
- * The content of the component.
512
- */
513
- children: o.node,
514
- /**
515
- * The color of the component. It supports those theme colors that make sense for this component.
516
- * @default 'neutral'
517
- */
518
- color: o.oneOfType([o.oneOf(["danger", "neutral", "primary", "success", "warning"]), o.string]),
519
- /**
520
- * If `true`, the component is disabled.
521
- * @default false
522
- */
523
- disabled: o.bool,
524
- /**
525
- * A text representation of the option's content.
526
- * Used for keyboard text navigation matching.
527
- */
528
- label: o.oneOfType([o.element, o.string]),
529
- /**
530
- * The system prop that allows defining system overrides as well as additional CSS styles.
531
- */
532
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
533
- /**
534
- * The option value.
535
- */
536
- value: o.any.isRequired,
537
- /**
538
- * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
539
- * @default 'plain'
540
- */
541
- variant: o.oneOfType([o.oneOf(["outlined", "plain", "soft", "solid"]), o.string])
542
- });
543
- const wt = ht(/* @__PURE__ */ h("path", {
544
- d: "m12 5.83 2.46 2.46c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 3.7a.9959.9959 0 0 0-1.41 0L8.12 6.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 5.83zm0 12.34-2.46-2.46a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l3.17 3.18c.39.39 1.02.39 1.41 0l3.17-3.17c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L12 18.17z"
545
- }), "Unfold");
546
- function Mt(e) {
547
- return Fe("MuiSelect", e);
548
- }
549
- const Y = Ne("MuiSelect", ["root", "button", "indicator", "startDecorator", "endDecorator", "popper", "listbox", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg", "focusVisible", "disabled", "expanded", "multiple"]);
550
- var Ee;
551
- const Et = ["action", "autoFocus", "children", "defaultValue", "defaultListboxOpen", "disabled", "getSerializedValue", "placeholder", "listboxId", "listboxOpen", "onChange", "onListboxOpenChange", "onClose", "renderValue", "required", "value", "size", "variant", "color", "startDecorator", "endDecorator", "indicator", "aria-describedby", "aria-label", "aria-labelledby", "id", "name", "multiple", "slots", "slotProps"];
552
- function At(e) {
553
- var t;
554
- return Array.isArray(e) ? /* @__PURE__ */ h(l.Fragment, {
555
- children: e.map((i) => i.label).join(", ")
556
- }) : (t = e == null ? void 0 : e.label) != null ? t : "";
557
- }
558
- const Nt = [{
559
- name: "offset",
560
- options: {
561
- offset: [0, 4]
562
- }
563
- }, {
564
- // popper will have the same width as root element when open
565
- name: "equalWidth",
566
- enabled: !0,
567
- phase: "beforeWrite",
568
- requires: ["computeStyles"],
569
- fn: ({
570
- state: e
571
- }) => {
572
- e.styles.popper.width = `${e.rects.reference.width}px`;
573
- }
574
- }], Ft = (e) => {
575
- const {
576
- color: t,
577
- disabled: i,
578
- focusVisible: a,
579
- size: c,
580
- variant: p,
581
- open: b,
582
- multiple: d
583
- } = e, f = {
584
- root: ["root", i && "disabled", a && "focusVisible", b && "expanded", p && `variant${Le(p)}`, t && `color${Le(t)}`, c && `size${Le(c)}`, d && "multiple"],
585
- button: ["button"],
586
- startDecorator: ["startDecorator"],
587
- endDecorator: ["endDecorator"],
588
- indicator: ["indicator", b && "expanded"],
589
- listbox: ["listbox", b && "expanded", i && "disabled"]
590
- };
591
- return Je(f, Mt, {});
592
- }, Wt = G("div", {
593
- name: "JoySelect",
594
- slot: "Root",
595
- overridesResolver: (e, t) => t.root
596
- })(({
597
- theme: e,
598
- ownerState: t
599
- }) => {
600
- var i, a, c, p, b;
601
- const d = (i = e.variants[`${t.variant}`]) == null ? void 0 : i[t.color], {
602
- borderRadius: f
603
- } = St({
604
- theme: e,
605
- ownerState: t
606
- }, ["borderRadius"]);
607
- return [u({
608
- "--Select-radius": e.vars.radius.sm,
609
- "--Select-gap": "0.5rem",
610
- "--Select-placeholderOpacity": 0.64,
611
- "--Select-decoratorColor": e.vars.palette.text.icon,
612
- "--Select-focusedThickness": e.vars.focus.thickness,
613
- "--Select-focusedHighlight": (a = e.vars.palette[t.color === "neutral" ? "primary" : t.color]) == null ? void 0 : a[500],
614
- '&:not([data-inverted-colors="false"])': u({}, t.instanceColor && {
615
- "--_Select-focusedHighlight": (c = e.vars.palette[t.instanceColor === "neutral" ? "primary" : t.instanceColor]) == null ? void 0 : c[500]
616
- }, {
617
- "--Select-focusedHighlight": e.vars.palette.focusVisible
618
- }),
619
- "--Select-indicatorColor": d != null && d.backgroundColor ? d == null ? void 0 : d.color : e.vars.palette.text.tertiary
620
- }, t.size === "sm" && {
621
- "--Select-minHeight": "2rem",
622
- "--Select-paddingInline": "0.5rem",
623
- "--Select-decoratorChildHeight": "min(1.5rem, var(--Select-minHeight))",
624
- "--Icon-fontSize": e.vars.fontSize.xl
625
- }, t.size === "md" && {
626
- "--Select-minHeight": "2.25rem",
627
- "--Select-paddingInline": "0.75rem",
628
- "--Select-decoratorChildHeight": "min(1.75rem, var(--Select-minHeight))",
629
- "--Icon-fontSize": e.vars.fontSize.xl2
630
- }, t.size === "lg" && {
631
- "--Select-minHeight": "2.75rem",
632
- "--Select-paddingInline": "1rem",
633
- "--Select-decoratorChildHeight": "min(2.375rem, var(--Select-minHeight))",
634
- "--Icon-fontSize": e.vars.fontSize.xl2
635
- }, {
636
- // variables for controlling child components
637
- "--Select-decoratorChildOffset": "min(calc(var(--Select-paddingInline) - (var(--Select-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Select-decoratorChildHeight)) / 2), var(--Select-paddingInline))",
638
- "--_Select-paddingBlock": "max((var(--Select-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Select-decoratorChildHeight)) / 2, 0px)",
639
- "--Select-decoratorChildRadius": "max(var(--Select-radius) - var(--variant-borderWidth, 0px) - var(--_Select-paddingBlock), min(var(--_Select-paddingBlock) + var(--variant-borderWidth, 0px), var(--Select-radius) / 2))",
640
- "--Button-minHeight": "var(--Select-decoratorChildHeight)",
641
- "--Button-paddingBlock": "0px",
642
- // to ensure that the height of the button is equal to --Button-minHeight
643
- "--IconButton-size": "var(--Select-decoratorChildHeight)",
644
- "--Button-radius": "var(--Select-decoratorChildRadius)",
645
- "--IconButton-radius": "var(--Select-decoratorChildRadius)",
646
- boxSizing: "border-box"
647
- }, t.variant !== "plain" && {
648
- boxShadow: e.shadow.xs
649
- }, {
650
- minWidth: 0,
651
- minHeight: "var(--Select-minHeight)",
652
- position: "relative",
653
- display: "flex",
654
- alignItems: "center",
655
- borderRadius: "var(--Select-radius)",
656
- cursor: "pointer"
657
- }, !(d != null && d.backgroundColor) && {
658
- backgroundColor: e.vars.palette.background.surface
659
- }, t.size && {
660
- paddingBlock: {
661
- sm: 2,
662
- md: 3,
663
- lg: 4
664
- }[t.size]
665
- // the padding-block act as a minimum spacing between content and root element
666
- }, {
667
- paddingInline: "var(--Select-paddingInline)"
668
- }, e.typography[`body-${t.size}`], d, {
669
- "&::before": {
670
- boxSizing: "border-box",
671
- content: '""',
672
- display: "block",
673
- position: "absolute",
674
- pointerEvents: "none",
675
- top: 0,
676
- left: 0,
677
- right: 0,
678
- bottom: 0,
679
- zIndex: 1,
680
- borderRadius: "inherit",
681
- margin: "calc(var(--variant-borderWidth, 0px) * -1)"
682
- // for outlined variant
683
- },
684
- [`&.${Y.focusVisible}`]: {
685
- "--Select-indicatorColor": d == null ? void 0 : d.color,
686
- "&::before": {
687
- boxShadow: "inset 0 0 0 var(--Select-focusedThickness) var(--Select-focusedHighlight)"
688
- }
689
- },
690
- [`&.${Y.disabled}`]: {
691
- "--Select-indicatorColor": "inherit"
692
- }
693
- }), {
694
- "&:hover": (p = e.variants[`${t.variant}Hover`]) == null ? void 0 : p[t.color],
695
- [`&.${Y.disabled}`]: (b = e.variants[`${t.variant}Disabled`]) == null ? void 0 : b[t.color]
696
- }, f !== void 0 && {
697
- "--Select-radius": f
698
- }];
699
- }), qt = G("button", {
700
- name: "JoySelect",
701
- slot: "Button",
702
- overridesResolver: (e, t) => t.button
703
- })(({
704
- ownerState: e
705
- }) => u({
706
- // reset user-agent button style
707
- border: 0,
708
- outline: 0,
709
- background: "none",
710
- padding: 0,
711
- fontSize: "inherit",
712
- color: "inherit",
713
- alignSelf: "stretch",
714
- // make children horizontally aligned
715
- display: "flex",
716
- alignItems: "center",
717
- flex: 1,
718
- fontFamily: "inherit",
719
- cursor: "pointer",
720
- whiteSpace: "nowrap",
721
- overflow: "hidden"
722
- }, (e.value === null || e.value === void 0) && {
723
- opacity: "var(--Select-placeholderOpacity)"
724
- }, {
725
- "&::before": {
726
- content: '""',
727
- display: "block",
728
- position: "absolute",
729
- // TODO: use https://caniuse.com/?search=inset when ~94%
730
- top: "calc(-1 * var(--variant-borderWidth, 0px))",
731
- left: "calc(-1 * var(--variant-borderWidth, 0px))",
732
- right: "calc(-1 * var(--variant-borderWidth, 0px))",
733
- bottom: "calc(-1 * var(--variant-borderWidth, 0px))",
734
- borderRadius: "var(--Select-radius)"
735
- }
736
- })), Jt = G(pt, {
737
- name: "JoySelect",
738
- slot: "Listbox",
739
- overridesResolver: (e, t) => t.listbox
740
- })(({
741
- theme: e,
742
- ownerState: t
743
- }) => {
744
- var i;
745
- const a = (i = e.variants[t.variant]) == null ? void 0 : i[t.color];
746
- return u({
747
- "--focus-outline-offset": `calc(${e.vars.focus.thickness} * -1)`,
748
- // to prevent the focus outline from being cut by overflow
749
- "--ListItem-stickyBackground": (a == null ? void 0 : a.backgroundColor) || (a == null ? void 0 : a.background) || e.vars.palette.background.popup,
750
- "--ListItem-stickyTop": "calc(var(--List-padding, var(--ListDivider-gap)) * -1)"
751
- }, ft, {
752
- minWidth: "max-content",
753
- // prevent options from shrinking if some of them is wider than the Select's root.
754
- maxHeight: "44vh",
755
- // the best value from what I tried so far which does not cause screen flicker when listbox is open.
756
- overflow: "auto",
757
- outline: 0,
758
- boxShadow: e.shadow.md,
759
- borderRadius: `var(--List-radius, ${e.vars.radius.sm})`,
760
- // `unstable_popup-zIndex` is a private variable that lets other component, for example Modal, to override the z-index so that the listbox can be displayed above the Modal.
761
- zIndex: `var(--unstable_popup-zIndex, ${e.vars.zIndex.popup})`
762
- }, !(a != null && a.backgroundColor) && {
763
- backgroundColor: e.vars.palette.background.popup
764
- });
765
- }), Ut = G("span", {
766
- name: "JoySelect",
767
- slot: "StartDecorator",
768
- overridesResolver: (e, t) => t.startDecorator
769
- })({
770
- "--Button-margin": "0 0 0 calc(var(--Select-decoratorChildOffset) * -1)",
771
- "--IconButton-margin": "0 0 0 calc(var(--Select-decoratorChildOffset) * -1)",
772
- "--Icon-margin": "0 0 0 calc(var(--Select-paddingInline) / -4)",
773
- display: "inherit",
774
- alignItems: "center",
775
- color: "var(--Select-decoratorColor)",
776
- marginInlineEnd: "var(--Select-gap)"
777
- }), jt = G("span", {
778
- name: "JoySelect",
779
- slot: "EndDecorator",
780
- overridesResolver: (e, t) => t.endDecorator
781
- })({
782
- "--Button-margin": "0 calc(var(--Select-decoratorChildOffset) * -1) 0 0",
783
- "--IconButton-margin": "0 calc(var(--Select-decoratorChildOffset) * -1) 0 0",
784
- "--Icon-margin": "0 calc(var(--Select-paddingInline) / -4) 0 0",
785
- display: "inherit",
786
- alignItems: "center",
787
- color: "var(--Select-decoratorColor)",
788
- marginInlineStart: "var(--Select-gap)"
789
- }), Kt = G("span", {
790
- name: "JoySelect",
791
- slot: "Indicator"
792
- })(({
793
- ownerState: e,
794
- theme: t
795
- }) => u({}, e.size === "sm" && {
796
- "--Icon-fontSize": t.vars.fontSize.lg
797
- }, e.size === "md" && {
798
- "--Icon-fontSize": t.vars.fontSize.xl
799
- }, e.size === "lg" && {
800
- "--Icon-fontSize": t.vars.fontSize.xl2
801
- }, {
802
- "--Icon-color": e.color !== "neutral" || e.variant === "solid" ? "currentColor" : t.vars.palette.text.icon,
803
- display: "inherit",
804
- alignItems: "center",
805
- marginInlineStart: "var(--Select-gap)",
806
- marginInlineEnd: "calc(var(--Select-paddingInline) / -4)",
807
- [`.${Y.endDecorator} + &`]: {
808
- marginInlineStart: "calc(var(--Select-gap) / 2)"
809
- },
810
- [`&.${Y.expanded}, .${Y.disabled} > &`]: {
811
- "--Icon-color": "currentColor"
812
- }
813
- })), Gt = /* @__PURE__ */ l.forwardRef(function(t, i) {
814
- var a, c, p, b, d, f, x;
815
- const T = qe({
816
- props: t,
817
- name: "JoySelect"
818
- }), y = T, {
819
- action: O,
820
- autoFocus: k,
821
- children: E,
822
- defaultValue: V,
823
- defaultListboxOpen: B = !1,
824
- disabled: W,
825
- getSerializedValue: g,
826
- placeholder: C,
827
- listboxId: R,
828
- listboxOpen: Z,
829
- onChange: D,
830
- onListboxOpenChange: z,
831
- onClose: H,
832
- renderValue: A,
833
- required: _ = !1,
834
- value: Q,
835
- size: I = "md",
836
- variant: q = "outlined",
837
- color: ee = "neutral",
838
- startDecorator: ce,
839
- endDecorator: ue,
840
- indicator: de = Ee || (Ee = /* @__PURE__ */ h(wt, {})),
841
- // props to forward to the button (all handlers should go through slotProps.button)
842
- "aria-describedby": J,
843
- "aria-label": $,
844
- "aria-labelledby": pe,
845
- id: fe,
846
- name: be,
847
- multiple: te = !1,
848
- slots: ye = {},
849
- slotProps: xe = {}
850
- } = y, Ce = We(y, Et), m = l.useContext(yt);
851
- if (process.env.NODE_ENV !== "production") {
852
- const v = m == null ? void 0 : m.registerEffect;
853
- l.useEffect(() => {
854
- if (v)
855
- return v();
856
- }, [v]);
857
- }
858
- const Re = (a = (c = t.disabled) != null ? c : m == null ? void 0 : m.disabled) != null ? a : W, N = (p = (b = t.size) != null ? b : m == null ? void 0 : m.size) != null ? p : I, ge = (d = t.color) != null ? d : m != null && m.error ? "danger" : (f = m == null ? void 0 : m.color) != null ? f : ee, oe = A ?? At, [w, U] = l.useState(null), j = l.useRef(null), ne = l.useRef(null), Ie = se(i, j);
859
- l.useImperativeHandle(O, () => ({
860
- focusVisible: () => {
861
- var v;
862
- (v = ne.current) == null || v.focus();
863
- }
864
- }), []), l.useEffect(() => {
865
- U(j.current);
866
- }, []), l.useEffect(() => {
867
- k && ne.current.focus();
868
- }, [k]);
869
- const re = l.useCallback((v) => {
870
- z == null || z(v), v || H == null || H();
871
- }, [H, z]), {
872
- buttonActive: Pe,
873
- buttonFocusVisible: Oe,
874
- contextValue: ke,
875
- disabled: Ve,
876
- getButtonProps: De,
877
- getListboxProps: ze,
878
- getHiddenInputProps: He,
879
- getOptionMetadata: le,
880
- open: ve,
881
- value: L
882
- } = Vt({
883
- buttonRef: ne,
884
- defaultOpen: B,
885
- defaultValue: V,
886
- disabled: Re,
887
- getSerializedValue: g,
888
- listboxId: R,
889
- multiple: te,
890
- name: be,
891
- required: _,
892
- onChange: D,
893
- onOpenChange: re,
894
- open: Z,
895
- value: Q
896
- }), P = u({}, T, {
897
- active: Pe,
898
- defaultListboxOpen: B,
899
- disabled: Ve,
900
- focusVisible: Oe,
901
- open: ve,
902
- renderValue: oe,
903
- value: L,
904
- size: N,
905
- variant: q,
906
- color: ge
907
- }), M = Ft(P), F = u({}, Ce, {
908
- slots: ye,
909
- slotProps: xe
910
- }), X = l.useMemo(() => {
911
- let v;
912
- if (te)
913
- v = L.map(($e) => le($e)).filter(($e) => $e !== void 0);
914
- else {
915
- var we;
916
- v = (we = le(L)) != null ? we : null;
917
- }
918
- return v;
919
- }, [le, L, te]), [n, r] = K("root", {
920
- ref: Ie,
921
- className: M.root,
922
- elementType: Wt,
923
- externalForwardedProps: F,
924
- ownerState: P
925
- }), [s, S] = K("button", {
926
- additionalProps: {
927
- "aria-describedby": J ?? (m == null ? void 0 : m["aria-describedby"]),
928
- "aria-label": $,
929
- "aria-labelledby": pe ?? (m == null ? void 0 : m.labelId),
930
- "aria-required": _ ? "true" : void 0,
931
- id: fe ?? (m == null ? void 0 : m.htmlFor),
932
- name: be
933
- },
934
- className: M.button,
935
- elementType: qt,
936
- externalForwardedProps: F,
937
- getSlotProps: De,
938
- ownerState: P
939
- }), [je, ae] = K("listbox", {
940
- additionalProps: {
941
- anchorEl: w,
942
- open: ve,
943
- placement: "bottom",
944
- keepMounted: !0
945
- },
946
- className: M.listbox,
947
- elementType: Jt,
948
- externalForwardedProps: F,
949
- getSlotProps: ze,
950
- ownerState: u({}, P, {
951
- nesting: !1,
952
- row: !1,
953
- wrap: !1
954
- }),
955
- getSlotOwnerState: (v) => ({
956
- size: v.size || N,
957
- variant: v.variant || q,
958
- color: v.color || (v.disablePortal ? ge : ee),
959
- disableColorInversion: !v.disablePortal
960
- })
961
- }), [Ke, Ge] = K("startDecorator", {
962
- className: M.startDecorator,
963
- elementType: Ut,
964
- externalForwardedProps: F,
965
- ownerState: P
966
- }), [Qe, Xe] = K("endDecorator", {
967
- className: M.endDecorator,
968
- elementType: jt,
969
- externalForwardedProps: F,
970
- ownerState: P
971
- }), [Ye, Ze] = K("indicator", {
972
- className: M.indicator,
973
- elementType: Kt,
974
- externalForwardedProps: F,
975
- ownerState: P
976
- }), et = l.useMemo(() => [...Nt, ...ae.modifiers || []], [ae.modifiers]);
977
- let _e = C;
978
- return (Array.isArray(X) && X.length > 0 || !Array.isArray(X) && X) && (_e = oe(X)), /* @__PURE__ */ Me(l.Fragment, {
979
- children: [/* @__PURE__ */ Me(n, u({}, r, {
980
- children: [ce && /* @__PURE__ */ h(Ke, u({}, Ge, {
981
- children: ce
982
- })), /* @__PURE__ */ h(s, u({}, S, {
983
- children: _e
984
- })), ue && /* @__PURE__ */ h(Qe, u({}, Xe, {
985
- children: ue
986
- })), de && /* @__PURE__ */ h(Ye, u({}, Ze, {
987
- children: de
988
- })), /* @__PURE__ */ h("input", u({}, He()))]
989
- })), w && /* @__PURE__ */ h(je, u({}, ae, {
990
- className: ot(ae.className),
991
- modifiers: et
992
- }, !((x = T.slots) != null && x.listbox) && {
993
- as: Ct,
994
- slots: {
995
- root: ae.as || "ul"
996
- }
997
- }, {
998
- children: /* @__PURE__ */ h(Dt, {
999
- value: ke,
1000
- children: /* @__PURE__ */ h(mt, {
1001
- variant: q,
1002
- color: ee,
1003
- children: /* @__PURE__ */ h(bt.Provider, {
1004
- value: "select",
1005
- children: /* @__PURE__ */ h(gt, {
1006
- nested: !0,
1007
- children: E
1008
- })
1009
- })
1010
- })
1011
- })
1012
- }))]
1013
- });
1014
- });
1015
- process.env.NODE_ENV !== "production" && (Gt.propTypes = {
1016
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1017
- // │ These PropTypes are generated from the TypeScript type definitions. │
1018
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
1019
- // └─────────────────────────────────────────────────────────────────────┘
1020
- /**
1021
- * A ref for imperative actions. It currently only supports `focusVisible()` action.
1022
- */
1023
- action: o.oneOfType([o.func, o.shape({
1024
- current: o.shape({
1025
- focusVisible: o.func.isRequired
1026
- })
1027
- })]),
1028
- /**
1029
- * If `true`, the select element is focused during the first mount
1030
- * @default false
1031
- */
1032
- autoFocus: o.bool,
1033
- /**
1034
- * @ignore
1035
- */
1036
- children: o.node,
1037
- /**
1038
- * @ignore
1039
- */
1040
- className: o.string,
1041
- /**
1042
- * The color of the component. It supports those theme colors that make sense for this component.
1043
- * @default 'neutral'
1044
- */
1045
- color: o.oneOfType([o.oneOf(["danger", "neutral", "primary", "success", "warning"]), o.string]),
1046
- /**
1047
- * The component used for the root node.
1048
- * Either a string to use a HTML element or a component.
1049
- */
1050
- component: o.elementType,
1051
- /**
1052
- * If `true`, the select will be initially open.
1053
- * @default false
1054
- */
1055
- defaultListboxOpen: o.bool,
1056
- /**
1057
- * The default selected value. Use when the component is not controlled.
1058
- */
1059
- defaultValue: o.any,
1060
- /**
1061
- * If `true`, the component is disabled.
1062
- * @default false
1063
- */
1064
- disabled: o.bool,
1065
- /**
1066
- * Trailing adornment for the select.
1067
- */
1068
- endDecorator: o.node,
1069
- /**
1070
- * A function to convert the currently selected value to a string.
1071
- * Used to set a value of a hidden input associated with the select,
1072
- * so that the selected value can be posted with a form.
1073
- */
1074
- getSerializedValue: o.func,
1075
- /**
1076
- * The indicator(*) for the select.
1077
- * ________________
1078
- * [ value * ]
1079
- * ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
1080
- */
1081
- indicator: o.node,
1082
- /**
1083
- * `id` attribute of the listbox element.
1084
- * Also used to derive the `id` attributes of options.
1085
- */
1086
- listboxId: o.string,
1087
- /**
1088
- * Controls the open state of the select's listbox.
1089
- * @default undefined
1090
- */
1091
- listboxOpen: o.bool,
1092
- /**
1093
- * If `true`, selecting multiple values is allowed.
1094
- * This affects the type of the `value`, `defaultValue`, and `onChange` props.
1095
- */
1096
- multiple: o.bool,
1097
- /**
1098
- * Name of the element. For example used by the server to identify the fields in form submits.
1099
- */
1100
- name: o.string,
1101
- /**
1102
- * Callback fired when an option is selected.
1103
- */
1104
- onChange: o.func,
1105
- /**
1106
- * Triggered when focus leaves the menu and the menu should close.
1107
- */
1108
- onClose: o.func,
1109
- /**
1110
- * Callback fired when the component requests to be opened.
1111
- * Use in controlled mode (see listboxOpen).
1112
- */
1113
- onListboxOpenChange: o.func,
1114
- /**
1115
- * Text to show when there is no selected value.
1116
- */
1117
- placeholder: o.node,
1118
- /**
1119
- * Function that customizes the rendering of the selected value.
1120
- */
1121
- renderValue: o.func,
1122
- /**
1123
- * If `true`, the Select cannot be empty when submitting form.
1124
- * @default false
1125
- */
1126
- required: o.bool,
1127
- /**
1128
- * The size of the component.
1129
- */
1130
- size: o.oneOfType([o.oneOf(["sm", "md", "lg"]), o.string]),
1131
- /**
1132
- * The components used for each slot inside.
1133
- * @default {}
1134
- */
1135
- slots: o.shape({
1136
- button: o.elementType,
1137
- endDecorator: o.elementType,
1138
- indicator: o.elementType,
1139
- listbox: o.elementType,
1140
- root: o.elementType,
1141
- startDecorator: o.elementType
1142
- }),
1143
- /**
1144
- * Leading adornment for the select.
1145
- */
1146
- startDecorator: o.node,
1147
- /**
1148
- * The system prop that allows defining system overrides as well as additional CSS styles.
1149
- */
1150
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
1151
- /**
1152
- * The selected value.
1153
- * Set to `null` to deselect all options.
1154
- */
1155
- value: o.any,
1156
- /**
1157
- * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
1158
- * @default 'outlined'
1159
- */
1160
- variant: o.oneOfType([o.oneOf(["outlined", "plain", "soft", "solid"]), o.string])
1161
- });
1162
- export {
1163
- Gt as S,
1164
- _t as a
1165
- };