@pismo/marola 0.0.1-alpha.14 → 0.0.1-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SelectButton-DWZ2BRaX.js +44 -0
- package/dist/assets/InputSearch.css +1 -1
- package/dist/assets/SelectButton.css +1 -1
- package/dist/assets/Snackbar.css +1 -1
- package/dist/components/InputSearch/InputSearch.js +7 -7
- package/dist/components/Select/Select.d.ts +9 -8
- package/dist/components/Select/Select.js +153 -155
- package/dist/components/Select/Select.stories.d.ts +10 -19
- package/dist/components/Select/Select.stories.js +72 -48
- package/dist/components/Select/SelectButton.d.ts +3 -4
- package/dist/components/Select/SelectButton.js +2 -2
- package/dist/components/Snackbar/Snackbar.d.ts +17 -5
- package/dist/components/Snackbar/Snackbar.js +180 -180
- package/dist/components/Snackbar/Snackbar.stories.d.ts +318 -0
- package/dist/components/Snackbar/Snackbar.stories.js +62 -0
- package/dist/main.js +13 -13
- package/package.json +1 -1
- package/dist/SelectButton-DWtqAiwt.js +0 -45
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as h, jsxs as Oe } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as Ve } from "../../clsx-DB4S2d7J.js";
|
|
3
3
|
import { Typography as Ke } from "../Typography/Typography.js";
|
|
4
|
-
import { s as
|
|
5
|
-
import { a as g, _ as
|
|
4
|
+
import { s as H, S as ze } from "../../SelectButton-DWZ2BRaX.js";
|
|
5
|
+
import { a as g, _ as _e } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
6
6
|
import * as s from "react";
|
|
7
7
|
import { g as we, a as ke, u as X, e as ne, P as l, b as le, c as Ie, d as Me } from "../../index-CqjC7P5Y.js";
|
|
8
8
|
import { u as Je, c as se, a as ye, L as Q } from "../../combineHooksSlotProps-BHqhiBfc.js";
|
|
@@ -29,7 +29,7 @@ ke(Ae, ["root", "disabled", "selected", "highlighted"]);
|
|
|
29
29
|
function lt(n) {
|
|
30
30
|
const {
|
|
31
31
|
value: o,
|
|
32
|
-
label:
|
|
32
|
+
label: u,
|
|
33
33
|
disabled: a,
|
|
34
34
|
rootRef: r,
|
|
35
35
|
id: c
|
|
@@ -41,27 +41,27 @@ function lt(n) {
|
|
|
41
41
|
item: o
|
|
42
42
|
}), {
|
|
43
43
|
getRootProps: v,
|
|
44
|
-
rootRef:
|
|
44
|
+
rootRef: I
|
|
45
45
|
} = Ne({
|
|
46
46
|
disabled: a,
|
|
47
47
|
focusableWhenDisabled: !0
|
|
48
48
|
}), x = Te(c), y = s.useRef(null), R = s.useMemo(() => ({
|
|
49
49
|
disabled: a,
|
|
50
|
-
label:
|
|
50
|
+
label: u,
|
|
51
51
|
value: o,
|
|
52
52
|
ref: y,
|
|
53
53
|
id: x
|
|
54
|
-
}), [a,
|
|
55
|
-
index:
|
|
56
|
-
} = We(o, R), O = X(r, y,
|
|
54
|
+
}), [a, u, o, x]), {
|
|
55
|
+
index: M
|
|
56
|
+
} = We(o, R), O = X(r, y, I), N = (b) => (C) => {
|
|
57
57
|
var P;
|
|
58
58
|
(P = b.onKeyDown) == null || P.call(b, C), !C.defaultMuiPrevented && [" ", "Enter"].includes(C.key) && (C.defaultMuiPrevented = !0);
|
|
59
|
-
},
|
|
60
|
-
onKeyDown:
|
|
59
|
+
}, L = (b = {}) => ({
|
|
60
|
+
onKeyDown: N(b)
|
|
61
61
|
});
|
|
62
62
|
return {
|
|
63
63
|
getRootProps: (b = {}) => {
|
|
64
|
-
const C = ne(b), P = se(p, se(v,
|
|
64
|
+
const C = ne(b), P = se(p, se(v, L));
|
|
65
65
|
return g({}, b, C, P(C), {
|
|
66
66
|
id: x,
|
|
67
67
|
ref: O,
|
|
@@ -70,7 +70,7 @@ function lt(n) {
|
|
|
70
70
|
});
|
|
71
71
|
},
|
|
72
72
|
highlighted: f,
|
|
73
|
-
index:
|
|
73
|
+
index: M,
|
|
74
74
|
selected: d,
|
|
75
75
|
rootRef: O
|
|
76
76
|
};
|
|
@@ -80,13 +80,13 @@ function st(n) {
|
|
|
80
80
|
if (!o)
|
|
81
81
|
throw new Error("Option: ListContext was not found.");
|
|
82
82
|
const {
|
|
83
|
-
getItemState:
|
|
83
|
+
getItemState: u,
|
|
84
84
|
dispatch: a
|
|
85
85
|
} = o, {
|
|
86
86
|
highlighted: r,
|
|
87
87
|
selected: c,
|
|
88
88
|
focusable: p
|
|
89
|
-
} =
|
|
89
|
+
} = u(n), f = s.useCallback((v) => {
|
|
90
90
|
if (v !== n)
|
|
91
91
|
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"));
|
|
92
92
|
return {
|
|
@@ -106,14 +106,14 @@ const rt = ["children", "disabled", "label", "slotProps", "slots", "value"];
|
|
|
106
106
|
function it(n) {
|
|
107
107
|
const {
|
|
108
108
|
disabled: o,
|
|
109
|
-
highlighted:
|
|
109
|
+
highlighted: u,
|
|
110
110
|
selected: a
|
|
111
111
|
} = n;
|
|
112
112
|
return Ie({
|
|
113
|
-
root: ["root", o && "disabled",
|
|
113
|
+
root: ["root", o && "disabled", u && "highlighted", a && "selected"]
|
|
114
114
|
}, Me(nt));
|
|
115
115
|
}
|
|
116
|
-
const ut = /* @__PURE__ */ s.memo(/* @__PURE__ */ s.forwardRef(function(o,
|
|
116
|
+
const ut = /* @__PURE__ */ s.memo(/* @__PURE__ */ s.forwardRef(function(o, u) {
|
|
117
117
|
var a, r;
|
|
118
118
|
const {
|
|
119
119
|
children: c,
|
|
@@ -121,34 +121,34 @@ const ut = /* @__PURE__ */ s.memo(/* @__PURE__ */ s.forwardRef(function(o, i) {
|
|
|
121
121
|
label: f,
|
|
122
122
|
slotProps: d = {},
|
|
123
123
|
slots: v = {},
|
|
124
|
-
value:
|
|
125
|
-
} = o, x =
|
|
126
|
-
getRootProps:
|
|
127
|
-
selected:
|
|
124
|
+
value: I
|
|
125
|
+
} = o, x = _e(o, rt), y = (a = v.root) != null ? a : "li", R = s.useRef(null), M = X(R, u), O = f ?? (typeof c == "string" ? c : (r = R.current) == null || (r = r.textContent) == null ? void 0 : r.trim()), {
|
|
126
|
+
getRootProps: N,
|
|
127
|
+
selected: L,
|
|
128
128
|
highlighted: b,
|
|
129
129
|
index: C
|
|
130
130
|
} = lt({
|
|
131
131
|
disabled: p,
|
|
132
132
|
label: O,
|
|
133
|
-
rootRef:
|
|
134
|
-
value:
|
|
133
|
+
rootRef: M,
|
|
134
|
+
value: I
|
|
135
135
|
}), P = g({}, o, {
|
|
136
136
|
disabled: p,
|
|
137
137
|
highlighted: b,
|
|
138
138
|
index: C,
|
|
139
|
-
selected:
|
|
140
|
-
}), j = it(P),
|
|
141
|
-
getSlotProps:
|
|
139
|
+
selected: L
|
|
140
|
+
}), j = it(P), V = le({
|
|
141
|
+
getSlotProps: N,
|
|
142
142
|
elementType: y,
|
|
143
143
|
externalSlotProps: d.root,
|
|
144
144
|
externalForwardedProps: x,
|
|
145
145
|
className: j.root,
|
|
146
146
|
ownerState: P
|
|
147
147
|
});
|
|
148
|
-
return /* @__PURE__ */ h(y, g({},
|
|
148
|
+
return /* @__PURE__ */ h(y, g({}, V, {
|
|
149
149
|
children: c
|
|
150
150
|
}));
|
|
151
|
-
})), Le = /* @__PURE__ */ s.forwardRef(function(o,
|
|
151
|
+
})), Le = /* @__PURE__ */ s.forwardRef(function(o, u) {
|
|
152
152
|
const {
|
|
153
153
|
value: a
|
|
154
154
|
} = o, {
|
|
@@ -157,7 +157,7 @@ const ut = /* @__PURE__ */ s.memo(/* @__PURE__ */ s.forwardRef(function(o, i) {
|
|
|
157
157
|
return /* @__PURE__ */ h(ye.Provider, {
|
|
158
158
|
value: r,
|
|
159
159
|
children: /* @__PURE__ */ h(ut, g({}, o, {
|
|
160
|
-
ref:
|
|
160
|
+
ref: u
|
|
161
161
|
}))
|
|
162
162
|
});
|
|
163
163
|
});
|
|
@@ -210,13 +210,13 @@ const re = {
|
|
|
210
210
|
}, Be = (n) => {
|
|
211
211
|
const {
|
|
212
212
|
label: o,
|
|
213
|
-
value:
|
|
213
|
+
value: u
|
|
214
214
|
} = n;
|
|
215
|
-
return typeof o == "string" ? o : typeof
|
|
215
|
+
return typeof o == "string" ? o : typeof u == "string" ? u : String(n);
|
|
216
216
|
};
|
|
217
217
|
function at(n, o) {
|
|
218
218
|
const {
|
|
219
|
-
open:
|
|
219
|
+
open: u
|
|
220
220
|
} = n, {
|
|
221
221
|
context: {
|
|
222
222
|
selectionMode: a
|
|
@@ -226,8 +226,8 @@ function at(n, o) {
|
|
|
226
226
|
var r;
|
|
227
227
|
const d = (r = n.selectedValues[0]) != null ? r : ve(null, "start", o.context);
|
|
228
228
|
return g({}, n, {
|
|
229
|
-
open: !
|
|
230
|
-
highlightedValue:
|
|
229
|
+
open: !u,
|
|
230
|
+
highlightedValue: u ? null : d
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
233
|
if (o.type === re.browserAutoFill)
|
|
@@ -278,7 +278,7 @@ function ct(n) {
|
|
|
278
278
|
function dt(n) {
|
|
279
279
|
const {
|
|
280
280
|
areOptionsEqual: o,
|
|
281
|
-
buttonRef:
|
|
281
|
+
buttonRef: u,
|
|
282
282
|
defaultOpen: a = !1,
|
|
283
283
|
defaultValue: r,
|
|
284
284
|
disabled: c = !1,
|
|
@@ -286,32 +286,32 @@ function dt(n) {
|
|
|
286
286
|
listboxRef: f,
|
|
287
287
|
multiple: d = !1,
|
|
288
288
|
name: v,
|
|
289
|
-
required:
|
|
289
|
+
required: I,
|
|
290
290
|
onChange: x,
|
|
291
291
|
onHighlightChange: y,
|
|
292
292
|
onOpenChange: R,
|
|
293
|
-
open:
|
|
293
|
+
open: M,
|
|
294
294
|
options: O,
|
|
295
|
-
getOptionAsString:
|
|
296
|
-
getSerializedValue:
|
|
295
|
+
getOptionAsString: N = Be,
|
|
296
|
+
getSerializedValue: L = ct,
|
|
297
297
|
value: b,
|
|
298
298
|
componentName: C = "useSelect"
|
|
299
|
-
} = n, P = s.useRef(null), j = X(
|
|
300
|
-
let
|
|
301
|
-
b === void 0 && r === void 0 ?
|
|
299
|
+
} = n, P = s.useRef(null), j = X(u, P), V = s.useRef(null), $ = Te(p);
|
|
300
|
+
let B;
|
|
301
|
+
b === void 0 && r === void 0 ? B = [] : r !== void 0 && (d ? B = r : B = r == null ? [] : [r]);
|
|
302
302
|
const Y = s.useMemo(() => {
|
|
303
303
|
if (b !== void 0)
|
|
304
304
|
return d ? b : b == null ? [] : [b];
|
|
305
305
|
}, [b, d]), {
|
|
306
|
-
subitems:
|
|
306
|
+
subitems: T,
|
|
307
307
|
contextValue: F
|
|
308
|
-
} = Ge(),
|
|
308
|
+
} = Ge(), _ = s.useMemo(() => O != null ? new Map(O.map((e, t) => [e.value, {
|
|
309
309
|
value: e.value,
|
|
310
310
|
label: e.label,
|
|
311
311
|
disabled: e.disabled,
|
|
312
312
|
ref: /* @__PURE__ */ s.createRef(),
|
|
313
313
|
id: `${$}_${t}`
|
|
314
|
-
}])) :
|
|
314
|
+
}])) : T, [O, T, $]), ie = X(f, V), {
|
|
315
315
|
getRootProps: Z,
|
|
316
316
|
active: ue,
|
|
317
317
|
focusVisible: ae,
|
|
@@ -319,48 +319,48 @@ function dt(n) {
|
|
|
319
319
|
} = Ne({
|
|
320
320
|
disabled: c,
|
|
321
321
|
rootRef: j
|
|
322
|
-
}), q = s.useMemo(() => Array.from(
|
|
322
|
+
}), q = s.useMemo(() => Array.from(_.keys()), [_]), S = s.useCallback((e) => {
|
|
323
323
|
if (o !== void 0) {
|
|
324
|
-
const t = q.find((
|
|
325
|
-
return
|
|
324
|
+
const t = q.find((i) => o(i, e));
|
|
325
|
+
return _.get(t);
|
|
326
326
|
}
|
|
327
|
-
return
|
|
328
|
-
}, [
|
|
327
|
+
return _.get(e);
|
|
328
|
+
}, [_, o, q]), ee = s.useCallback((e) => {
|
|
329
329
|
var t;
|
|
330
|
-
const
|
|
331
|
-
return (t =
|
|
332
|
-
}, [
|
|
333
|
-
const t =
|
|
334
|
-
return t ?
|
|
335
|
-
}, [
|
|
330
|
+
const i = S(e);
|
|
331
|
+
return (t = i == null ? void 0 : i.disabled) != null ? t : !1;
|
|
332
|
+
}, [S]), te = s.useCallback((e) => {
|
|
333
|
+
const t = S(e);
|
|
334
|
+
return t ? N(t) : "";
|
|
335
|
+
}, [S, N]), ce = s.useMemo(() => ({
|
|
336
336
|
selectedValues: Y,
|
|
337
|
-
open:
|
|
338
|
-
}), [Y,
|
|
337
|
+
open: M
|
|
338
|
+
}), [Y, M]), de = s.useCallback((e) => {
|
|
339
339
|
var t;
|
|
340
|
-
return (t =
|
|
341
|
-
}, [
|
|
340
|
+
return (t = _.get(e)) == null ? void 0 : t.id;
|
|
341
|
+
}, [_]), pe = s.useCallback((e, t) => {
|
|
342
342
|
if (d)
|
|
343
343
|
x == null || x(e, t);
|
|
344
344
|
else {
|
|
345
|
-
var
|
|
346
|
-
x == null || x(e, (
|
|
345
|
+
var i;
|
|
346
|
+
x == null || x(e, (i = t[0]) != null ? i : null);
|
|
347
347
|
}
|
|
348
348
|
}, [d, x]), fe = s.useCallback((e, t) => {
|
|
349
349
|
y == null || y(e, t ?? null);
|
|
350
|
-
}, [y]), be = s.useCallback((e, t,
|
|
351
|
-
if (t === "open" && (R == null || R(
|
|
350
|
+
}, [y]), be = s.useCallback((e, t, i) => {
|
|
351
|
+
if (t === "open" && (R == null || R(i), i === !1 && (e == null ? void 0 : e.type) !== "blur")) {
|
|
352
352
|
var m;
|
|
353
353
|
(m = P.current) == null || m.focus();
|
|
354
354
|
}
|
|
355
355
|
}, [R]), ge = s.useCallback((e) => {
|
|
356
|
-
var t,
|
|
357
|
-
return e == null ? null : (t = (
|
|
358
|
-
}, [
|
|
356
|
+
var t, i;
|
|
357
|
+
return e == null ? null : (t = (i = T.get(e)) == null ? void 0 : i.ref.current) != null ? t : null;
|
|
358
|
+
}, [T]), me = {
|
|
359
359
|
getInitialState: () => {
|
|
360
360
|
var e;
|
|
361
361
|
return {
|
|
362
362
|
highlightedValue: null,
|
|
363
|
-
selectedValues: (e =
|
|
363
|
+
selectedValues: (e = B) != null ? e : [],
|
|
364
364
|
open: a
|
|
365
365
|
};
|
|
366
366
|
},
|
|
@@ -383,41 +383,41 @@ function dt(n) {
|
|
|
383
383
|
stateReducer: at,
|
|
384
384
|
componentName: C
|
|
385
385
|
}, {
|
|
386
|
-
dispatch:
|
|
386
|
+
dispatch: E,
|
|
387
387
|
getRootProps: he,
|
|
388
388
|
contextValue: K,
|
|
389
389
|
state: {
|
|
390
390
|
open: w,
|
|
391
|
-
highlightedValue:
|
|
391
|
+
highlightedValue: A,
|
|
392
392
|
selectedValues: k
|
|
393
393
|
},
|
|
394
394
|
rootRef: z
|
|
395
395
|
} = et(me), xe = s.useRef(w);
|
|
396
396
|
tt(() => {
|
|
397
|
-
if (w &&
|
|
397
|
+
if (w && A !== null) {
|
|
398
398
|
var e;
|
|
399
|
-
const t = (e =
|
|
400
|
-
if (!
|
|
399
|
+
const t = (e = S(A)) == null ? void 0 : e.ref;
|
|
400
|
+
if (!V.current || !(t != null && t.current))
|
|
401
401
|
return;
|
|
402
402
|
xe.current || t.current.focus({
|
|
403
403
|
preventScroll: !0
|
|
404
404
|
});
|
|
405
|
-
const
|
|
406
|
-
m.top <
|
|
405
|
+
const i = V.current.getBoundingClientRect(), m = t.current.getBoundingClientRect();
|
|
406
|
+
m.top < i.top ? V.current.scrollTop -= i.top - m.top : m.bottom > i.bottom && (V.current.scrollTop += m.bottom - i.bottom);
|
|
407
407
|
}
|
|
408
|
-
}, [w,
|
|
409
|
-
const J = s.useCallback((e) =>
|
|
410
|
-
var
|
|
411
|
-
if (e == null || (
|
|
408
|
+
}, [w, A, S]);
|
|
409
|
+
const J = s.useCallback((e) => S(e), [S]), Ce = (e) => (t) => {
|
|
410
|
+
var i;
|
|
411
|
+
if (e == null || (i = e.onClick) == null || i.call(e, t), !t.defaultMuiPrevented) {
|
|
412
412
|
const m = {
|
|
413
413
|
type: re.buttonClick,
|
|
414
414
|
event: t
|
|
415
415
|
};
|
|
416
|
-
|
|
416
|
+
E(m);
|
|
417
417
|
}
|
|
418
418
|
}, W = (e) => (t) => {
|
|
419
|
-
var
|
|
420
|
-
(
|
|
419
|
+
var i;
|
|
420
|
+
(i = e.onKeyDown) == null || i.call(e, t), !t.defaultMuiPrevented && (t.key === "ArrowDown" || t.key === "ArrowUp") && (t.preventDefault(), E({
|
|
421
421
|
type: Q.keyDown,
|
|
422
422
|
key: t.key,
|
|
423
423
|
event: t
|
|
@@ -425,29 +425,29 @@ function dt(n) {
|
|
|
425
425
|
}, oe = (e = {}) => ({
|
|
426
426
|
onClick: Ce(e),
|
|
427
427
|
onKeyDown: W(e)
|
|
428
|
-
}),
|
|
428
|
+
}), D = (e = {}) => g({}, e, oe(e), {
|
|
429
429
|
role: "combobox",
|
|
430
430
|
"aria-expanded": w,
|
|
431
431
|
"aria-controls": $
|
|
432
432
|
}), He = (e = {}) => {
|
|
433
|
-
const t = ne(e),
|
|
434
|
-
return g({}, e,
|
|
433
|
+
const t = ne(e), i = se(D, Z);
|
|
434
|
+
return g({}, e, i(t));
|
|
435
435
|
}, $e = (e) => (t) => {
|
|
436
|
-
var
|
|
437
|
-
(
|
|
436
|
+
var i, m;
|
|
437
|
+
(i = e.onBlur) == null || i.call(e, t), !t.defaultMuiPrevented && ((m = V.current) != null && m.contains(t.relatedTarget) || t.relatedTarget === P.current) && (t.defaultMuiPrevented = !0);
|
|
438
438
|
}, Fe = (e = {}) => ({
|
|
439
439
|
onBlur: $e(e)
|
|
440
440
|
}), qe = (e = {}) => {
|
|
441
|
-
const t = ne(e),
|
|
441
|
+
const t = ne(e), i = se(Fe, he);
|
|
442
442
|
return g({
|
|
443
443
|
id: $,
|
|
444
444
|
role: "listbox",
|
|
445
445
|
"aria-multiselectable": d ? "true" : void 0
|
|
446
|
-
}, e,
|
|
446
|
+
}, e, i(t));
|
|
447
447
|
};
|
|
448
448
|
s.useDebugValue({
|
|
449
449
|
selectedOptions: k,
|
|
450
|
-
highlightedOption:
|
|
450
|
+
highlightedOption: A,
|
|
451
451
|
open: w
|
|
452
452
|
});
|
|
453
453
|
const je = s.useMemo(() => g({}, K, F), [K, F]);
|
|
@@ -461,13 +461,13 @@ function dt(n) {
|
|
|
461
461
|
Pe = (Re = J(G)) != null ? Re : null;
|
|
462
462
|
}
|
|
463
463
|
const Ue = (e) => (t) => {
|
|
464
|
-
var
|
|
465
|
-
if (e == null || (
|
|
464
|
+
var i;
|
|
465
|
+
if (e == null || (i = e.onChange) == null || i.call(e, t), t.defaultMuiPrevented)
|
|
466
466
|
return;
|
|
467
|
-
const m =
|
|
468
|
-
t.target.value === "" ?
|
|
467
|
+
const m = _.get(t.target.value);
|
|
468
|
+
t.target.value === "" ? E({
|
|
469
469
|
type: Q.clearSelection
|
|
470
|
-
}) : m !== void 0 &&
|
|
470
|
+
}) : m !== void 0 && E({
|
|
471
471
|
type: re.browserAutoFill,
|
|
472
472
|
item: m.value,
|
|
473
473
|
event: t
|
|
@@ -479,7 +479,7 @@ function dt(n) {
|
|
|
479
479
|
buttonRef: U,
|
|
480
480
|
contextValue: je,
|
|
481
481
|
disabled: c,
|
|
482
|
-
dispatch:
|
|
482
|
+
dispatch: E,
|
|
483
483
|
getButtonProps: He,
|
|
484
484
|
getHiddenInputProps: (e = {}) => {
|
|
485
485
|
const t = ne(e);
|
|
@@ -487,8 +487,8 @@ function dt(n) {
|
|
|
487
487
|
name: v,
|
|
488
488
|
tabIndex: -1,
|
|
489
489
|
"aria-hidden": !0,
|
|
490
|
-
required:
|
|
491
|
-
value:
|
|
490
|
+
required: I ? !0 : void 0,
|
|
491
|
+
value: L(Pe),
|
|
492
492
|
style: ot
|
|
493
493
|
}, e, {
|
|
494
494
|
onChange: Ue(t)
|
|
@@ -500,13 +500,13 @@ function dt(n) {
|
|
|
500
500
|
open: w,
|
|
501
501
|
options: q,
|
|
502
502
|
value: G,
|
|
503
|
-
highlightedOption:
|
|
503
|
+
highlightedOption: A
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
506
|
function pt(n) {
|
|
507
507
|
const {
|
|
508
508
|
value: o,
|
|
509
|
-
children:
|
|
509
|
+
children: u
|
|
510
510
|
} = n, {
|
|
511
511
|
dispatch: a,
|
|
512
512
|
getItemIndex: r,
|
|
@@ -526,7 +526,7 @@ function pt(n) {
|
|
|
526
526
|
value: v,
|
|
527
527
|
children: /* @__PURE__ */ h(ye.Provider, {
|
|
528
528
|
value: d,
|
|
529
|
-
children:
|
|
529
|
+
children: u
|
|
530
530
|
})
|
|
531
531
|
});
|
|
532
532
|
}
|
|
@@ -535,68 +535,68 @@ function ft(n) {
|
|
|
535
535
|
return we(Ee, n);
|
|
536
536
|
}
|
|
537
537
|
ke(Ee, ["root", "button", "listbox", "popup", "active", "expanded", "disabled", "focusVisible"]);
|
|
538
|
-
var
|
|
538
|
+
var Se;
|
|
539
539
|
const bt = ["areOptionsEqual", "autoComplete", "autoFocus", "children", "defaultValue", "defaultListboxOpen", "disabled", "getSerializedValue", "listboxId", "listboxOpen", "multiple", "name", "required", "onChange", "onListboxOpenChange", "getOptionAsString", "renderValue", "placeholder", "slotProps", "slots", "value"];
|
|
540
540
|
function gt(n) {
|
|
541
541
|
var o;
|
|
542
542
|
return Array.isArray(n) ? /* @__PURE__ */ h(s.Fragment, {
|
|
543
|
-
children: n.map((
|
|
543
|
+
children: n.map((u) => u.label).join(", ")
|
|
544
544
|
}) : (o = n == null ? void 0 : n.label) != null ? o : null;
|
|
545
545
|
}
|
|
546
546
|
function mt(n) {
|
|
547
547
|
const {
|
|
548
548
|
active: o,
|
|
549
|
-
disabled:
|
|
549
|
+
disabled: u,
|
|
550
550
|
open: a,
|
|
551
551
|
focusVisible: r
|
|
552
552
|
} = n;
|
|
553
553
|
return Ie({
|
|
554
|
-
root: ["root",
|
|
555
|
-
listbox: ["listbox",
|
|
554
|
+
root: ["root", u && "disabled", r && "focusVisible", o && "active", a && "expanded"],
|
|
555
|
+
listbox: ["listbox", u && "disabled"],
|
|
556
556
|
popup: ["popup"]
|
|
557
557
|
}, Me(ft));
|
|
558
558
|
}
|
|
559
|
-
const De = /* @__PURE__ */ s.forwardRef(function(o,
|
|
559
|
+
const De = /* @__PURE__ */ s.forwardRef(function(o, u) {
|
|
560
560
|
var a, r, c, p, f;
|
|
561
561
|
const {
|
|
562
562
|
areOptionsEqual: d,
|
|
563
563
|
autoComplete: v,
|
|
564
|
-
autoFocus:
|
|
564
|
+
autoFocus: I,
|
|
565
565
|
children: x,
|
|
566
566
|
defaultValue: y,
|
|
567
567
|
defaultListboxOpen: R = !1,
|
|
568
|
-
disabled:
|
|
568
|
+
disabled: M,
|
|
569
569
|
getSerializedValue: O,
|
|
570
|
-
listboxId:
|
|
571
|
-
listboxOpen:
|
|
570
|
+
listboxId: N,
|
|
571
|
+
listboxOpen: L,
|
|
572
572
|
multiple: b = !1,
|
|
573
573
|
name: C,
|
|
574
574
|
required: P = !1,
|
|
575
575
|
onChange: j,
|
|
576
|
-
onListboxOpenChange:
|
|
576
|
+
onListboxOpenChange: V,
|
|
577
577
|
getOptionAsString: $ = Be,
|
|
578
|
-
renderValue:
|
|
578
|
+
renderValue: B,
|
|
579
579
|
placeholder: Y,
|
|
580
|
-
slotProps:
|
|
580
|
+
slotProps: T = {},
|
|
581
581
|
slots: F = {},
|
|
582
|
-
value:
|
|
583
|
-
} = o, ie =
|
|
584
|
-
ae(
|
|
585
|
-
}, []), de = X(
|
|
582
|
+
value: _
|
|
583
|
+
} = o, ie = _e(o, bt), Z = B ?? gt, [ue, ae] = s.useState(!1), U = s.useRef(null), q = s.useRef(null), S = (a = F.root) != null ? a : "button", ee = (r = F.listbox) != null ? r : "ul", te = (c = F.popup) != null ? c : "div", ce = s.useCallback((D) => {
|
|
584
|
+
ae(D != null);
|
|
585
|
+
}, []), de = X(u, U, ce);
|
|
586
586
|
s.useEffect(() => {
|
|
587
|
-
|
|
588
|
-
}, [
|
|
587
|
+
I && U.current.focus();
|
|
588
|
+
}, [I]);
|
|
589
589
|
const {
|
|
590
590
|
buttonActive: pe,
|
|
591
591
|
buttonFocusVisible: fe,
|
|
592
592
|
contextValue: be,
|
|
593
593
|
disabled: ge,
|
|
594
594
|
getButtonProps: me,
|
|
595
|
-
getListboxProps:
|
|
595
|
+
getListboxProps: E,
|
|
596
596
|
getHiddenInputProps: he,
|
|
597
597
|
getOptionMetadata: K,
|
|
598
598
|
value: w,
|
|
599
|
-
open:
|
|
599
|
+
open: A
|
|
600
600
|
} = dt({
|
|
601
601
|
name: C,
|
|
602
602
|
required: P,
|
|
@@ -605,35 +605,35 @@ const De = /* @__PURE__ */ s.forwardRef(function(o, i) {
|
|
|
605
605
|
buttonRef: de,
|
|
606
606
|
defaultOpen: R,
|
|
607
607
|
defaultValue: y,
|
|
608
|
-
disabled:
|
|
609
|
-
listboxId:
|
|
608
|
+
disabled: M,
|
|
609
|
+
listboxId: N,
|
|
610
610
|
multiple: b,
|
|
611
|
-
open:
|
|
611
|
+
open: L,
|
|
612
612
|
onChange: j,
|
|
613
|
-
onOpenChange:
|
|
613
|
+
onOpenChange: V,
|
|
614
614
|
getOptionAsString: $,
|
|
615
|
-
value:
|
|
615
|
+
value: _,
|
|
616
616
|
componentName: "Select"
|
|
617
617
|
}), k = g({}, o, {
|
|
618
618
|
active: pe,
|
|
619
619
|
defaultListboxOpen: R,
|
|
620
620
|
disabled: ge,
|
|
621
621
|
focusVisible: fe,
|
|
622
|
-
open:
|
|
622
|
+
open: A,
|
|
623
623
|
multiple: b,
|
|
624
624
|
renderValue: Z,
|
|
625
625
|
value: w
|
|
626
626
|
}), z = mt(k), xe = le({
|
|
627
|
-
elementType:
|
|
627
|
+
elementType: S,
|
|
628
628
|
getSlotProps: me,
|
|
629
|
-
externalSlotProps:
|
|
629
|
+
externalSlotProps: T.root,
|
|
630
630
|
externalForwardedProps: ie,
|
|
631
631
|
ownerState: k,
|
|
632
632
|
className: z.root
|
|
633
633
|
}), J = le({
|
|
634
634
|
elementType: ee,
|
|
635
|
-
getSlotProps:
|
|
636
|
-
externalSlotProps:
|
|
635
|
+
getSlotProps: E,
|
|
636
|
+
externalSlotProps: T.listbox,
|
|
637
637
|
additionalProps: {
|
|
638
638
|
ref: q
|
|
639
639
|
},
|
|
@@ -641,11 +641,11 @@ const De = /* @__PURE__ */ s.forwardRef(function(o, i) {
|
|
|
641
641
|
className: z.listbox
|
|
642
642
|
}), Ce = le({
|
|
643
643
|
elementType: te,
|
|
644
|
-
externalSlotProps:
|
|
644
|
+
externalSlotProps: T.popup,
|
|
645
645
|
additionalProps: {
|
|
646
646
|
anchor: U.current,
|
|
647
647
|
keepMounted: !0,
|
|
648
|
-
open:
|
|
648
|
+
open: A,
|
|
649
649
|
placement: "bottom-start",
|
|
650
650
|
role: void 0
|
|
651
651
|
},
|
|
@@ -654,17 +654,17 @@ const De = /* @__PURE__ */ s.forwardRef(function(o, i) {
|
|
|
654
654
|
});
|
|
655
655
|
let W;
|
|
656
656
|
if (b)
|
|
657
|
-
W = w.map((
|
|
657
|
+
W = w.map((D) => K(D)).filter((D) => D !== void 0);
|
|
658
658
|
else {
|
|
659
659
|
var oe;
|
|
660
660
|
W = (oe = K(w)) != null ? oe : null;
|
|
661
661
|
}
|
|
662
662
|
return /* @__PURE__ */ Oe(s.Fragment, {
|
|
663
|
-
children: [/* @__PURE__ */ h(
|
|
663
|
+
children: [/* @__PURE__ */ h(S, g({}, xe, {
|
|
664
664
|
children: (p = (f = Z(W)) != null ? f : Y) != null ? p : (
|
|
665
665
|
// fall back to a zero-width space to prevent layout shift
|
|
666
666
|
// from https://github.com/mui/material-ui/pull/24563
|
|
667
|
-
|
|
667
|
+
Se || (Se = /* @__PURE__ */ h("span", {
|
|
668
668
|
className: "notranslate",
|
|
669
669
|
children: ""
|
|
670
670
|
}))
|
|
@@ -813,48 +813,46 @@ process.env.NODE_ENV !== "production" && (De.propTypes = {
|
|
|
813
813
|
value: l.any
|
|
814
814
|
});
|
|
815
815
|
const ht = (n) => {
|
|
816
|
-
const { children: o, icon:
|
|
816
|
+
const { children: o, icon: u, className: a, ...r } = n;
|
|
817
817
|
return /* @__PURE__ */ Oe(
|
|
818
818
|
Le,
|
|
819
819
|
{
|
|
820
|
-
...
|
|
820
|
+
...r,
|
|
821
821
|
slotProps: {
|
|
822
|
-
root: (
|
|
823
|
-
className:
|
|
824
|
-
[
|
|
825
|
-
[
|
|
826
|
-
[I["select__listbox__option--highlighted"]]: r.highlighted
|
|
822
|
+
root: (c) => ({
|
|
823
|
+
className: Ve(H.select__listbox__option, a, {
|
|
824
|
+
[H["select__listbox__option--disabled"]]: c.disabled,
|
|
825
|
+
[H["select__listbox__option--selected"]]: c.selected
|
|
827
826
|
})
|
|
828
827
|
})
|
|
829
828
|
},
|
|
830
829
|
children: [
|
|
831
|
-
|
|
832
|
-
/* @__PURE__ */ h(Ke, { element: "span", variant: "body-small", className:
|
|
830
|
+
u ? /* @__PURE__ */ h("span", { className: H.select__listbox__option__icon, children: u }) : "",
|
|
831
|
+
/* @__PURE__ */ h(Ke, { element: "span", variant: "body-small", className: H.select__listbox__option__text, children: o })
|
|
833
832
|
]
|
|
834
833
|
}
|
|
835
834
|
);
|
|
836
835
|
}, xt = (n) => {
|
|
837
|
-
const { children: o,
|
|
836
|
+
const { children: o, className: u, onChange: a, ...r } = n;
|
|
838
837
|
return /* @__PURE__ */ h(
|
|
839
838
|
De,
|
|
840
839
|
{
|
|
841
840
|
...r,
|
|
842
841
|
onChange: (p, f) => {
|
|
843
|
-
|
|
842
|
+
a == null || a(f, p);
|
|
844
843
|
},
|
|
845
|
-
className:
|
|
844
|
+
className: Ve(H.select, u),
|
|
846
845
|
slots: { root: ze },
|
|
847
846
|
slotProps: {
|
|
848
|
-
listbox: { className:
|
|
849
|
-
popup: {
|
|
847
|
+
listbox: { className: H.select__listbox },
|
|
848
|
+
popup: { disablePortal: !0 }
|
|
850
849
|
},
|
|
851
|
-
"aria-labelledby": a,
|
|
852
850
|
children: o
|
|
853
851
|
}
|
|
854
852
|
);
|
|
855
853
|
};
|
|
856
854
|
xt.Option = ht;
|
|
857
855
|
export {
|
|
858
|
-
|
|
859
|
-
|
|
856
|
+
xt as Select,
|
|
857
|
+
ht as SelectOption
|
|
860
858
|
};
|