@koide-labs/ui 0.1.0 → 0.1.2
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/accordion.css +1 -1
- package/dist/alert-dialog.css +1 -1
- package/dist/anchor.css +1 -1
- package/dist/avatar.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/button.css +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/code.css +1 -1
- package/dist/collapse.css +1 -1
- package/dist/command.css +1 -1
- package/dist/components/accordion/accordion.js +40 -40
- package/dist/components/alert-dialog/alert-dialog.js +9 -9
- package/dist/components/anchor/anchor.js +5 -5
- package/dist/components/avatar/avatar.js +26 -26
- package/dist/components/badge/badge.js +13 -13
- package/dist/components/button/button.js +13 -13
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/code/code.js +48 -48
- package/dist/components/collapse/collapse.js +14 -14
- package/dist/components/command/command.js +121 -121
- package/dist/components/context-menu/context-menu.js +6 -6
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/heading/heading.js +6 -6
- package/dist/components/icon/icon.js +12 -12
- package/dist/components/icon-button/icon-button.js +26 -26
- package/dist/components/inline-code/inline-code.js +2 -2
- package/dist/components/input/input.js +1 -1
- package/dist/components/meter/meter.js +40 -40
- package/dist/components/multiline-input/multiline-input.js +1 -1
- package/dist/components/number-input/number-input.js +7 -7
- package/dist/components/password-input/password-input.js +2 -2
- package/dist/components/pill/pill.js +11 -11
- package/dist/components/popover/popover.js +21 -21
- package/dist/components/preview-card/preview-card.js +2 -2
- package/dist/components/radio-group/radio-group.js +54 -54
- package/dist/components/search-bar/search-bar.js +8 -8
- package/dist/components/select/select.js +75 -75
- package/dist/components/separator/index.js +1 -1
- package/dist/components/separator/separator.js +1 -1
- package/dist/components/slider/slider.js +128 -128
- package/dist/components/spinner/spinner.js +4 -4
- package/dist/components/stacked-avatars/stacked-avatars.js +35 -35
- package/dist/components/status-banner/status-banner.js +22 -22
- package/dist/components/surface/surface.js +14 -14
- package/dist/components/switch/switch.js +28 -28
- package/dist/components/tabs/tabs.js +132 -132
- package/dist/components/text/text.js +15 -15
- package/dist/components/timestamp/timestamp.js +73 -73
- package/dist/components/toaster/toaster.js +165 -165
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/components/view/view.js +40 -40
- package/dist/context-menu.css +1 -1
- package/dist/dialog.css +1 -1
- package/dist/{dialog.module-DsbQRp-d.js → dialog.module-Pi1eHwli.js} +13 -13
- package/dist/heading.css +1 -1
- package/dist/icon-button.css +1 -1
- package/dist/icon.css +1 -1
- package/dist/index.js +2 -2
- package/dist/inline-code.css +1 -1
- package/dist/input.css +1 -1
- package/dist/input.module-zw1dlr1_.js +8 -0
- package/dist/integrations/react-markdown/index.js +1 -1
- package/dist/meter.css +1 -1
- package/dist/number-input.css +1 -1
- package/dist/password-input.css +1 -1
- package/dist/pill.css +1 -1
- package/dist/popover.css +1 -1
- package/dist/preview-card.css +1 -1
- package/dist/radio-group.css +1 -1
- package/dist/search-bar.css +1 -1
- package/dist/select.css +1 -1
- package/dist/{separator-fh_wDZNf.js → separator-wNYojB9q.js} +8 -8
- package/dist/separator.css +1 -1
- package/dist/slider.css +1 -1
- package/dist/spinner.css +1 -1
- package/dist/stacked-avatars.css +1 -1
- package/dist/status-banner.css +1 -1
- package/dist/styles/core.css +1 -1
- package/dist/surface.css +1 -1
- package/dist/switch.css +1 -1
- package/dist/tabs.css +1 -1
- package/dist/text.css +1 -1
- package/dist/timestamp.css +1 -1
- package/dist/toaster.css +1 -1
- package/dist/{tooltip-oCp-elli.js → tooltip-DZkByWDR.js} +63 -63
- package/dist/tooltip.css +1 -1
- package/dist/view.css +1 -1
- package/dist/view.module-DlwuNdUj.js +6 -0
- package/dist/view2.css +1 -1
- package/package.json +1 -1
- package/dist/input.module-CtE19OH8.js +0 -8
- package/dist/view.module-Dj7wj0kk.js +0 -6
|
@@ -2,25 +2,25 @@ import { jsx as C, jsxs as Ae } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as jt } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { textify as $t } from "../../-utils.js";
|
|
5
|
-
import { c as E, S as Yt, l as p, d as Xt, e as Kt, i as Gt, f as Jt, p as
|
|
5
|
+
import { c as E, S as Yt, l as p, d as Xt, e as Kt, i as Gt, f as Jt, p as xt, t as Zt } from "../../transitions.module-D9mMAtfI.js";
|
|
6
6
|
import { View as Qt } from "../view/view.js";
|
|
7
7
|
import { Icon as Rt } from "../icon/icon.js";
|
|
8
8
|
import { v as en } from "../../visuallyHidden-CpJ-mhai.js";
|
|
9
9
|
import { b as gt, a as tn, m as St, d as It, u as Re } from "../../useRenderElement-DngNDu_P.js";
|
|
10
10
|
import { u as ht } from "../../useControlled-Du4sJyMj.js";
|
|
11
11
|
import { u as fe } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
|
|
12
|
-
import { u as
|
|
12
|
+
import { u as ye } from "../../useStableCallback-DKZHlUAT.js";
|
|
13
13
|
import { u as ct } from "../../useValueAsRef-B4EriRsI.js";
|
|
14
14
|
import { f as Ke } from "../../formatErrorMessage-BqPuTBN-.js";
|
|
15
15
|
import { c as nn, a as vt, u as Et, b as on, f as rn } from "../../LabelableContext-Be1u-eFg.js";
|
|
16
16
|
import { u as sn } from "../../useLabelableId-CX4tcfzK.js";
|
|
17
17
|
import { u as wt } from "../../useTransitionStatus-CmMyUh74.js";
|
|
18
|
-
import { c as
|
|
18
|
+
import { c as xe, n as Mt, f as ln, v as cn, w as an, x as tt } from "../../createBaseUIEventDetails-CCSfZ2vM.js";
|
|
19
19
|
import { u as at, t as At } from "../../useOpenChangeComplete-BHd-N7Ig.js";
|
|
20
20
|
import { u as un } from "../../useValueChanged-MJRmEWz1.js";
|
|
21
21
|
import { u as dn, b as fn, a as pn, I as mn, F as gn } from "../../InternalBackdrop-BSMKU-hc.js";
|
|
22
|
-
import { u as hn, a as bn, g as
|
|
23
|
-
import { u as
|
|
22
|
+
import { u as hn, a as bn, g as yn } from "../../getDisabledMountTransitionStyles-E2x-_lte.js";
|
|
23
|
+
import { u as xn, a as Rn } from "../../useTypeahead-BiL5IAVb.js";
|
|
24
24
|
import { o as rt } from "../../owner-rKN292Q9.js";
|
|
25
25
|
import { u as _e } from "../../useTimeout-BNni6aw5.js";
|
|
26
26
|
import { u as Tt } from "../../useButton-d3_JgBNr.js";
|
|
@@ -33,7 +33,7 @@ import { d as Vn } from "../../detectBrowser-Bl8Ki_1I.js";
|
|
|
33
33
|
import { u as Cn } from "../../useAnimationFrame-DvK1s63A.js";
|
|
34
34
|
import { u as Nn } from "../../ToolbarRootContext-CvvL0Tk1.js";
|
|
35
35
|
import { C as _n } from "../../composite-BwEK5cWH.js";
|
|
36
|
-
import { g as
|
|
36
|
+
import { g as yt } from "../../floating-ui.utils.dom-cbi420Pg.js";
|
|
37
37
|
import '../../select.css';function Pn(e) {
|
|
38
38
|
const t = n.useRef(!0);
|
|
39
39
|
t.current && (t.current = !1, e());
|
|
@@ -217,7 +217,7 @@ function Ln(e) {
|
|
|
217
217
|
setFilled: S,
|
|
218
218
|
name: G,
|
|
219
219
|
disabled: $,
|
|
220
|
-
validation:
|
|
220
|
+
validation: y
|
|
221
221
|
} = vt(), {
|
|
222
222
|
controlId: l
|
|
223
223
|
} = Et(), A = sn({
|
|
@@ -267,10 +267,10 @@ function Ln(e) {
|
|
|
267
267
|
scrollUpArrowVisible: !1,
|
|
268
268
|
scrollDownArrowVisible: !1,
|
|
269
269
|
hasScrollArrows: !1
|
|
270
|
-
})).current, ue = p(h, a.activeIndex), me = p(h, a.selectedIndex), ge = p(h, a.triggerElement), J = p(h, a.positionerElement), De = n.useMemo(() => I && Array.isArray(u) && u.length === 0 ? "" : Ne(u, f), [I, u, f]), Ge = n.useMemo(() => I && Array.isArray(u) ? u.map((
|
|
270
|
+
})).current, ue = p(h, a.activeIndex), me = p(h, a.selectedIndex), ge = p(h, a.triggerElement), J = p(h, a.positionerElement), De = n.useMemo(() => I && Array.isArray(u) && u.length === 0 ? "" : Ne(u, f), [I, u, f]), Ge = n.useMemo(() => I && Array.isArray(u) ? u.map((x) => Ne(x, f)) : Ne(u, f), [I, u, f]), We = ct(h.state.triggerElement);
|
|
271
271
|
on({
|
|
272
272
|
id: A,
|
|
273
|
-
commit:
|
|
273
|
+
commit: y.commit,
|
|
274
274
|
value: u,
|
|
275
275
|
controlRef: We,
|
|
276
276
|
name: O,
|
|
@@ -298,16 +298,16 @@ function Ln(e) {
|
|
|
298
298
|
const Ee = st(Y, u, X);
|
|
299
299
|
h.set("selectedIndex", Ee === -1 ? null : Ee);
|
|
300
300
|
}, [I, T, u, H, X, h]), un(u, () => {
|
|
301
|
-
P(O), N(u !== j.initialValue), ce() ?
|
|
301
|
+
P(O), N(u !== j.initialValue), ce() ? y.commit(u) : y.commit(u, !0);
|
|
302
302
|
});
|
|
303
|
-
const Te =
|
|
304
|
-
if (d?.(
|
|
303
|
+
const Te = ye((x, Y) => {
|
|
304
|
+
if (d?.(x, Y), !Y.isCanceled && (Q(x), !x && h.state.activeIndex !== null)) {
|
|
305
305
|
const Ee = ee.current[h.state.activeIndex];
|
|
306
306
|
queueMicrotask(() => {
|
|
307
307
|
Ee?.setAttribute("tabindex", "-1");
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
}), Ve =
|
|
310
|
+
}), Ve = ye(() => {
|
|
311
311
|
_(!1), h.set("activeIndex", null), W(), U?.(!1);
|
|
312
312
|
});
|
|
313
313
|
at({
|
|
@@ -320,13 +320,13 @@ function Ln(e) {
|
|
|
320
320
|
}), n.useImperativeHandle(q, () => ({
|
|
321
321
|
unmount: Ve
|
|
322
322
|
}), [Ve]);
|
|
323
|
-
const ve =
|
|
324
|
-
r?.(
|
|
325
|
-
}), de =
|
|
326
|
-
const
|
|
327
|
-
if (!
|
|
323
|
+
const ve = ye((x, Y) => {
|
|
324
|
+
r?.(x, Y), !Y.isCanceled && K(x);
|
|
325
|
+
}), de = ye(() => {
|
|
326
|
+
const x = h.state.listElement || z.current;
|
|
327
|
+
if (!x)
|
|
328
328
|
return;
|
|
329
|
-
const Y =
|
|
329
|
+
const Y = x.scrollTop, Ee = x.scrollTop + x.clientHeight, we = Y > 1, be = Ee < x.scrollHeight - 1;
|
|
330
330
|
h.state.scrollUpArrowVisible !== we && h.set("scrollUpArrowVisible", we), h.state.scrollDownArrowVisible !== be && h.set("scrollDownArrowVisible", be);
|
|
331
331
|
}), he = hn({
|
|
332
332
|
open: T,
|
|
@@ -340,14 +340,14 @@ function Ln(e) {
|
|
|
340
340
|
event: "mousedown"
|
|
341
341
|
}), ze = Xt(he, {
|
|
342
342
|
bubbles: !1
|
|
343
|
-
}), Je =
|
|
343
|
+
}), Je = xn(he, {
|
|
344
344
|
enabled: !v && !B,
|
|
345
345
|
listRef: ee,
|
|
346
346
|
activeIndex: ue,
|
|
347
347
|
selectedIndex: me,
|
|
348
348
|
disabledIndices: gt,
|
|
349
|
-
onNavigate(
|
|
350
|
-
|
|
349
|
+
onNavigate(x) {
|
|
350
|
+
x === null && !T || h.set("activeIndex", x);
|
|
351
351
|
},
|
|
352
352
|
// Implement our own listeners since `onPointerLeave` on each option fires while scrolling with
|
|
353
353
|
// the `alignItemWithTrigger=true`, causing a performance issue on Chrome.
|
|
@@ -357,11 +357,11 @@ function Ln(e) {
|
|
|
357
357
|
listRef: te,
|
|
358
358
|
activeIndex: ue,
|
|
359
359
|
selectedIndex: me,
|
|
360
|
-
onMatch(
|
|
361
|
-
T ? h.set("activeIndex",
|
|
360
|
+
onMatch(x) {
|
|
361
|
+
T ? h.set("activeIndex", x) : ve(H.current[x], xe("none"));
|
|
362
362
|
},
|
|
363
|
-
onTypingChange(
|
|
364
|
-
Z.current =
|
|
363
|
+
onTypingChange(x) {
|
|
364
|
+
Z.current = x;
|
|
365
365
|
}
|
|
366
366
|
}), {
|
|
367
367
|
getReferenceProps: Be,
|
|
@@ -416,13 +416,13 @@ function Ln(e) {
|
|
|
416
416
|
typingRef: Z,
|
|
417
417
|
selectionRef: oe,
|
|
418
418
|
selectedItemTextRef: ne,
|
|
419
|
-
validation:
|
|
419
|
+
validation: y,
|
|
420
420
|
onOpenChangeComplete: U,
|
|
421
421
|
keyboardActiveRef: le,
|
|
422
422
|
alignItemWithTriggerActiveRef: Ie,
|
|
423
423
|
initialValueRef: He
|
|
424
|
-
}), [h, O, R, B, v, I, V, f, se, ve, Te, qe, he.context.events,
|
|
425
|
-
const Y = Ne(
|
|
424
|
+
}), [h, O, R, B, v, I, V, f, se, ve, Te, qe, he.context.events, y, U, de]), Le = It(M, y.inputRef), Qe = I && Array.isArray(u) && u.length > 0, et = n.useMemo(() => !I || !Array.isArray(u) || !O ? null : u.map((x) => {
|
|
425
|
+
const Y = Ne(x, f);
|
|
426
426
|
return /* @__PURE__ */ C("input", {
|
|
427
427
|
type: "hidden",
|
|
428
428
|
name: O,
|
|
@@ -434,20 +434,20 @@ function Ln(e) {
|
|
|
434
434
|
children: /* @__PURE__ */ Ae(dt.Provider, {
|
|
435
435
|
value: he,
|
|
436
436
|
children: [ie, /* @__PURE__ */ C("input", {
|
|
437
|
-
...
|
|
437
|
+
...y.getInputValidationProps({
|
|
438
438
|
onFocus() {
|
|
439
439
|
h.state.triggerElement?.focus();
|
|
440
440
|
},
|
|
441
441
|
// Handle browser autofill.
|
|
442
|
-
onChange(
|
|
443
|
-
if (
|
|
442
|
+
onChange(x) {
|
|
443
|
+
if (x.nativeEvent.defaultPrevented)
|
|
444
444
|
return;
|
|
445
|
-
const Y =
|
|
445
|
+
const Y = x.target.value, Ee = xe(Mt, x.nativeEvent);
|
|
446
446
|
function we() {
|
|
447
447
|
if (I)
|
|
448
448
|
return;
|
|
449
449
|
const be = H.current.find((je) => Ne(je, f).toLowerCase() === Y.toLowerCase());
|
|
450
|
-
be != null && (N(be !== j.initialValue), ve(be, Ee), ce() &&
|
|
450
|
+
be != null && (N(be !== j.initialValue), ve(be, Ee), ce() && y.commit(be));
|
|
451
451
|
}
|
|
452
452
|
h.set("forceMount", !0), queueMicrotask(we);
|
|
453
453
|
}
|
|
@@ -494,15 +494,15 @@ const Ye = 2, kn = {
|
|
|
494
494
|
alignItemWithTriggerActiveRef: f,
|
|
495
495
|
disabled: X,
|
|
496
496
|
keyboardActiveRef: se
|
|
497
|
-
} = Se(), ie = b || X || i, P = p(M, a.open), N = p(M, a.value), ce = p(M, a.triggerProps), j = p(M, a.positionerElement), S = p(M, a.listElement), G = p(M, a.serializedValue), $ = ct(j),
|
|
497
|
+
} = Se(), ie = b || X || i, P = p(M, a.open), N = p(M, a.value), ce = p(M, a.triggerProps), j = p(M, a.positionerElement), S = p(M, a.listElement), G = p(M, a.serializedValue), $ = ct(j), y = n.useRef(null), l = _e(), A = _e(), {
|
|
498
498
|
getButtonProps: B,
|
|
499
499
|
buttonRef: O
|
|
500
500
|
} = Tt({
|
|
501
501
|
disabled: ie,
|
|
502
502
|
native: m
|
|
503
|
-
}), u =
|
|
503
|
+
}), u = ye((c) => {
|
|
504
504
|
M.set("triggerElement", c);
|
|
505
|
-
}), K = It(o,
|
|
505
|
+
}), K = It(o, y, O, u), T = _e(), Q = _e();
|
|
506
506
|
n.useEffect(() => {
|
|
507
507
|
if (P)
|
|
508
508
|
return Q.start(200, () => {
|
|
@@ -527,7 +527,7 @@ const Ye = 2, kn = {
|
|
|
527
527
|
tabIndex: ie ? -1 : 0,
|
|
528
528
|
ref: K,
|
|
529
529
|
onFocus(c) {
|
|
530
|
-
w(!0), P && f.current && U(!1,
|
|
530
|
+
w(!0), P && f.current && U(!1, xe(ln, c.nativeEvent)), l.start(0, () => {
|
|
531
531
|
M.set("forceMount", !0);
|
|
532
532
|
});
|
|
533
533
|
},
|
|
@@ -545,13 +545,13 @@ const Ye = 2, kn = {
|
|
|
545
545
|
return;
|
|
546
546
|
const g = rt(c.currentTarget);
|
|
547
547
|
function D(H) {
|
|
548
|
-
if (!
|
|
548
|
+
if (!y.current)
|
|
549
549
|
return;
|
|
550
550
|
const Z = H.target;
|
|
551
|
-
if (bt(
|
|
551
|
+
if (bt(y.current, Z) || bt($.current, Z) || Z === y.current)
|
|
552
552
|
return;
|
|
553
|
-
const le = Un(
|
|
554
|
-
H.clientX >= le.left - Ye && H.clientX <= le.right + Ye && H.clientY >= le.top - Ye && H.clientY <= le.bottom + Ye || U(!1,
|
|
553
|
+
const le = Un(y.current);
|
|
554
|
+
H.clientX >= le.left - Ye && H.clientX <= le.right + Ye && H.clientY >= le.top - Ye && H.clientY <= le.bottom + Ye || U(!1, xe(cn, H));
|
|
555
555
|
}
|
|
556
556
|
A.start(0, () => {
|
|
557
557
|
g.addEventListener("mouseup", D, {
|
|
@@ -570,7 +570,7 @@ const Ye = 2, kn = {
|
|
|
570
570
|
placeholder: !G
|
|
571
571
|
}), [R, P, ie, N, V, G]);
|
|
572
572
|
return Re("button", t, {
|
|
573
|
-
ref: [o,
|
|
573
|
+
ref: [o, y],
|
|
574
574
|
state: z,
|
|
575
575
|
stateAttributesMapping: kn,
|
|
576
576
|
props: te
|
|
@@ -684,15 +684,15 @@ const Ht = {
|
|
|
684
684
|
initialValueRef: ce,
|
|
685
685
|
popupRef: j,
|
|
686
686
|
setValue: S
|
|
687
|
-
} = Se(), G = Vt(), $ = p(f, a.open),
|
|
688
|
-
!
|
|
689
|
-
|
|
690
|
-
}, [f,
|
|
687
|
+
} = Se(), G = Vt(), $ = p(f, a.open), y = p(f, a.mounted), l = p(f, a.modal), A = p(f, a.value), B = p(f, a.openMethod), O = p(f, a.positionerElement), u = p(f, a.triggerElement), K = p(f, a.isItemEqualToValue), T = n.useRef(null), Q = n.useRef(null), [ee, te] = n.useState(L), z = y && ee && B !== "touch";
|
|
688
|
+
!y && ee !== L && te(L), fe(() => {
|
|
689
|
+
y || (a.scrollUpArrowVisible(f.state) && f.set("scrollUpArrowVisible", !1), a.scrollDownArrowVisible(f.state) && f.set("scrollDownArrowVisible", !1));
|
|
690
|
+
}, [f, y]), n.useImperativeHandle(ie, () => z), pn((z || l) && $ && B !== "touch", u);
|
|
691
691
|
const c = bn({
|
|
692
692
|
anchor: s,
|
|
693
693
|
floatingRootContext: G,
|
|
694
694
|
positionMethod: r,
|
|
695
|
-
mounted:
|
|
695
|
+
mounted: y,
|
|
696
696
|
side: d,
|
|
697
697
|
sideOffset: w,
|
|
698
698
|
align: F,
|
|
@@ -708,31 +708,31 @@ const Ht = {
|
|
|
708
708
|
const _ = {};
|
|
709
709
|
return $ || (_.pointerEvents = "none"), {
|
|
710
710
|
role: "presentation",
|
|
711
|
-
hidden: !
|
|
711
|
+
hidden: !y,
|
|
712
712
|
style: {
|
|
713
713
|
...D,
|
|
714
714
|
..._
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
|
-
}, [$,
|
|
717
|
+
}, [$, y, D]), Z = n.useMemo(() => ({
|
|
718
718
|
open: $,
|
|
719
719
|
side: g,
|
|
720
720
|
align: c.align,
|
|
721
721
|
anchorHidden: c.anchorHidden
|
|
722
|
-
}), [$, g, c.align, c.anchorHidden]), le =
|
|
722
|
+
}), [$, g, c.align, c.anchorHidden]), le = ye((_) => {
|
|
723
723
|
f.set("positionerElement", _);
|
|
724
724
|
}), ne = Re("div", t, {
|
|
725
725
|
ref: [o, le],
|
|
726
726
|
state: Z,
|
|
727
|
-
stateAttributesMapping:
|
|
727
|
+
stateAttributesMapping: xt,
|
|
728
728
|
props: [H, V]
|
|
729
|
-
}), oe = n.useRef(0), Ie =
|
|
729
|
+
}), oe = n.useRef(0), Ie = ye((_) => {
|
|
730
730
|
if (_.size === 0 && oe.current === 0 || N.current.length === 0)
|
|
731
731
|
return;
|
|
732
732
|
const ae = oe.current;
|
|
733
733
|
if (oe.current = _.size, _.size === ae)
|
|
734
734
|
return;
|
|
735
|
-
const pe =
|
|
735
|
+
const pe = xe(Mt);
|
|
736
736
|
if (ae !== 0 && !f.state.multiple && A !== null && st(N.current, A, K) === -1) {
|
|
737
737
|
const W = ce.current, ue = W != null && nt(N.current, W, K) ? W : null;
|
|
738
738
|
S(ue, pe), ue === null && (f.set("selectedIndex", null), P.current = null);
|
|
@@ -765,7 +765,7 @@ const Ht = {
|
|
|
765
765
|
onMapChange: Ie,
|
|
766
766
|
children: /* @__PURE__ */ Ae(ft.Provider, {
|
|
767
767
|
value: re,
|
|
768
|
-
children: [
|
|
768
|
+
children: [y && l && /* @__PURE__ */ C(mn, {
|
|
769
769
|
inert: En(!$),
|
|
770
770
|
cutout: u
|
|
771
771
|
}), ne]
|
|
@@ -778,7 +778,7 @@ function Bt(e) {
|
|
|
778
778
|
return t.top + 1 <= e.clientY && e.clientY <= t.bottom - 1 && t.left + 1 <= e.clientX && e.clientX <= t.right - 1;
|
|
779
779
|
}
|
|
780
780
|
const qn = {
|
|
781
|
-
...
|
|
781
|
+
...xt,
|
|
782
782
|
...At
|
|
783
783
|
}, Ut = /* @__PURE__ */ n.forwardRef(function(t, o) {
|
|
784
784
|
const {
|
|
@@ -803,7 +803,7 @@ const qn = {
|
|
|
803
803
|
setControlledAlignItemWithTrigger: f,
|
|
804
804
|
scrollDownArrowRef: X,
|
|
805
805
|
scrollUpArrowRef: se
|
|
806
|
-
} = Dt(), ie = Nn() != null, P = Vt(), N = _e(), ce = p(m, a.id), j = p(m, a.open), S = p(m, a.mounted), G = p(m, a.popupProps), $ = p(m, a.transitionStatus),
|
|
806
|
+
} = Dt(), ie = Nn() != null, P = Vt(), N = _e(), ce = p(m, a.id), j = p(m, a.open), S = p(m, a.mounted), G = p(m, a.popupProps), $ = p(m, a.transitionStatus), y = p(m, a.triggerElement), l = p(m, a.positionerElement), A = p(m, a.listElement), B = n.useRef(0), O = n.useRef(!1), u = n.useRef(0), K = n.useRef(!1), T = n.useRef({}), Q = Cn(), ee = ye((g) => {
|
|
807
807
|
if (!l || !d.current || !K.current)
|
|
808
808
|
return;
|
|
809
809
|
if (O.current || !V) {
|
|
@@ -850,17 +850,17 @@ const qn = {
|
|
|
850
850
|
S || V || (K.current = !1, O.current = !1, B.current = 0, u.current = 0, Xe(l, T.current));
|
|
851
851
|
}, [S, V, l, d]), fe(() => {
|
|
852
852
|
const g = d.current;
|
|
853
|
-
if (!(!S || !
|
|
853
|
+
if (!(!S || !y || !l || !g)) {
|
|
854
854
|
if (!V) {
|
|
855
855
|
K.current = !0, Q.request(M);
|
|
856
856
|
return;
|
|
857
857
|
}
|
|
858
858
|
queueMicrotask(() => {
|
|
859
|
-
const D = getComputedStyle(l), H = getComputedStyle(g), Z = rt(
|
|
859
|
+
const D = getComputedStyle(l), H = getComputedStyle(g), Z = rt(y), le = yt(l), ne = y.getBoundingClientRect(), oe = l.getBoundingClientRect(), Ie = ne.left, re = ne.height, _ = A || g, ae = _.scrollHeight, pe = parseFloat(H.borderBottomWidth), k = parseFloat(D.marginTop) || 10, W = parseFloat(D.marginBottom) || 10, h = parseFloat(D.minHeight) || 100, ue = 5, me = 5, ge = 20, J = Z.documentElement.clientHeight - k - W, De = Z.documentElement.clientWidth, Ge = J - ne.bottom + re, We = R.current, He = v.current;
|
|
860
860
|
let Te = 0, Ve = 0;
|
|
861
861
|
if (We && He) {
|
|
862
|
-
const Me = He.getBoundingClientRect(), Le = We.getBoundingClientRect(), Qe = Me.left - Ie, et = Le.left - oe.left,
|
|
863
|
-
Te = Qe - et, Ve = Y -
|
|
862
|
+
const Me = He.getBoundingClientRect(), Le = We.getBoundingClientRect(), Qe = Me.left - Ie, et = Le.left - oe.left, x = Me.top - ne.top + Me.height / 2, Y = Le.top - oe.top + Le.height / 2;
|
|
863
|
+
Te = Qe - et, Ve = Y - x;
|
|
864
864
|
}
|
|
865
865
|
const ve = Ge + Ve + W + pe;
|
|
866
866
|
let de = Math.min(J, ve);
|
|
@@ -883,12 +883,12 @@ const qn = {
|
|
|
883
883
|
});
|
|
884
884
|
});
|
|
885
885
|
}
|
|
886
|
-
}, [m, S, l,
|
|
886
|
+
}, [m, S, l, y, v, R, d, M, V, f, Q, X, se, A]), n.useEffect(() => {
|
|
887
887
|
if (!V || !l || !S)
|
|
888
888
|
return;
|
|
889
|
-
const g =
|
|
889
|
+
const g = yt(l);
|
|
890
890
|
function D(H) {
|
|
891
|
-
w(!1,
|
|
891
|
+
w(!1, xe(an, H));
|
|
892
892
|
}
|
|
893
893
|
return g.addEventListener("resize", D), () => {
|
|
894
894
|
g.removeEventListener("resize", D);
|
|
@@ -931,7 +931,7 @@ const qn = {
|
|
|
931
931
|
ref: [o, d],
|
|
932
932
|
state: te,
|
|
933
933
|
stateAttributesMapping: qn,
|
|
934
|
-
props: [G, z,
|
|
934
|
+
props: [G, z, yn($), {
|
|
935
935
|
className: !A && V ? lt.className : void 0
|
|
936
936
|
}, i]
|
|
937
937
|
});
|
|
@@ -967,7 +967,7 @@ const Lt = /* @__PURE__ */ n.forwardRef(function(t, o) {
|
|
|
967
967
|
style: Ht
|
|
968
968
|
},
|
|
969
969
|
className: w && v !== "touch" ? lt.className : void 0
|
|
970
|
-
}, M =
|
|
970
|
+
}, M = ye((U) => {
|
|
971
971
|
m.set("listElement", U);
|
|
972
972
|
});
|
|
973
973
|
return Re("div", t, {
|
|
@@ -1008,7 +1008,7 @@ const kt = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef(function(t, o) {
|
|
|
1008
1008
|
keyboardActiveRef: f,
|
|
1009
1009
|
multiple: X,
|
|
1010
1010
|
highlightItemOnHover: se
|
|
1011
|
-
} = Se(), ie = _e(), P = p(b, a.isActive, R.index), N = p(b, a.isSelected, R.index, i), ce = p(b, a.isSelectedByFocus, R.index), j = p(b, a.isItemEqualToValue), S = R.index, G = S !== -1, $ = n.useRef(null),
|
|
1011
|
+
} = Se(), ie = _e(), P = p(b, a.isActive, R.index), N = p(b, a.isSelected, R.index, i), ce = p(b, a.isSelectedByFocus, R.index), j = p(b, a.isItemEqualToValue), S = R.index, G = S !== -1, $ = n.useRef(null), y = ct(S);
|
|
1012
1012
|
fe(() => {
|
|
1013
1013
|
if (!G)
|
|
1014
1014
|
return;
|
|
@@ -1044,9 +1044,9 @@ const kt = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef(function(t, o) {
|
|
|
1044
1044
|
const g = b.state.value;
|
|
1045
1045
|
if (X) {
|
|
1046
1046
|
const D = Array.isArray(g) ? g : [], H = N ? Dn(D, i, j) : [...D, i];
|
|
1047
|
-
U(H,
|
|
1047
|
+
U(H, xe(tt, c));
|
|
1048
1048
|
} else
|
|
1049
|
-
U(i,
|
|
1049
|
+
U(i, xe(tt, c)), M(!1, xe(tt, c));
|
|
1050
1050
|
}
|
|
1051
1051
|
const ee = {
|
|
1052
1052
|
role: "option",
|
|
@@ -1101,11 +1101,11 @@ const kt = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef(function(t, o) {
|
|
|
1101
1101
|
props: [A, ee, w, K]
|
|
1102
1102
|
}), z = n.useMemo(() => ({
|
|
1103
1103
|
selected: N,
|
|
1104
|
-
indexRef:
|
|
1104
|
+
indexRef: y,
|
|
1105
1105
|
textRef: v,
|
|
1106
1106
|
selectedByFocus: ce,
|
|
1107
1107
|
hasRegistered: G
|
|
1108
|
-
}), [N,
|
|
1108
|
+
}), [N, y, v, ce, G]);
|
|
1109
1109
|
return /* @__PURE__ */ C(pt.Provider, {
|
|
1110
1110
|
value: z,
|
|
1111
1111
|
children: te
|
|
@@ -1178,13 +1178,13 @@ const qt = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef(function(t, o) {
|
|
|
1178
1178
|
});
|
|
1179
1179
|
}));
|
|
1180
1180
|
process.env.NODE_ENV !== "production" && (qt.displayName = "SelectItemText");
|
|
1181
|
-
const jn = "
|
|
1181
|
+
const jn = "_select__trigger_1eghs_2", $n = "_select__list_1eghs_21", Yn = "_select__item_1eghs_33", Pe = {
|
|
1182
1182
|
select__trigger: jn,
|
|
1183
|
-
"select__trigger-icon": "_select__trigger-
|
|
1183
|
+
"select__trigger-icon": "_select__trigger-icon_1eghs_17",
|
|
1184
1184
|
select__list: $n,
|
|
1185
1185
|
select__item: Yn,
|
|
1186
|
-
"select__item-indicator": "_select__item-
|
|
1187
|
-
"select__item-text": "_select__item-
|
|
1186
|
+
"select__item-indicator": "_select__item-indicator_1eghs_58",
|
|
1187
|
+
"select__item-text": "_select__item-text_1eghs_62"
|
|
1188
1188
|
};
|
|
1189
1189
|
function No({
|
|
1190
1190
|
placeholder: e,
|