mimir-ui-kit 1.38.6 → 1.38.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{combobox-DgSZTriw.js → combobox-CVtJDVoZ.js} +251 -254
- package/dist/components/Accordion/Accordion.js +3 -3
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/Dropdown/Dropdown.js +32 -32
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.js +21 -21
- package/dist/components/Slider/Slider.d.ts +21 -8
- package/dist/components/Slider/Slider.js +388 -383
- package/dist/components/Switcher/Switcher.js +4 -4
- package/dist/components/TabTrail/TabTrail.js +4 -4
- package/dist/{field-C1kt7aNM.js → field-FJ34aSs4.js} +2 -2
- package/dist/{focus-management-BtPpk3D1.js → focus-management-DE4t_lW3.js} +1 -1
- package/dist/{hidden-PvGXrYUY.js → hidden-DbgtYPOH.js} +1 -1
- package/dist/{keyboard-mgWkd2Vh.js → keyboard-B0lm_zyn.js} +111 -114
- package/dist/{label-D4GFpe5F.js → label-y3ANLTNC.js} +2 -2
- package/dist/open-closed-CdldUPoq.js +86 -0
- package/dist/portal-WDFNoIMz.js +1908 -0
- package/dist/{use-active-press-CqLGIFz7.js → use-active-press-86hajhdd.js} +1 -1
- package/package.json +1 -1
- package/dist/open-closed-D2VjDhAN.js +0 -86
- package/dist/portal-DPqg52FR.js +0 -1946
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsxs as L, jsx as N } from "react/jsx-runtime";
|
2
|
-
import { H as te } from "../../field-
|
3
|
-
import { K as I, w as re, z as se, U as ae, u as ce, a as le, b as oe, T as ie, I as ne, G as ue, j as he, p as me } from "../../label-
|
4
|
-
import { W as de, H as j, y as pe, p as fe, o as $, $ as be, b as we, D as _e, c as H } from "../../keyboard-
|
2
|
+
import { H as te } from "../../field-FJ34aSs4.js";
|
3
|
+
import { K as I, w as re, z as se, U as ae, u as ce, a as le, b as oe, T as ie, I as ne, G as ue, j as he, p as me } from "../../label-y3ANLTNC.js";
|
4
|
+
import { W as de, H as j, y as pe, p as fe, o as $, $ as be, b as we, D as _e, c as H } from "../../keyboard-B0lm_zyn.js";
|
5
5
|
import u, { createContext as $e, useState as x, useMemo as G, useId as ge, useContext as ve, useRef as ke, useCallback as xe, Fragment as ye, forwardRef as Pe } from "react";
|
6
|
-
import { w as Ce } from "../../use-active-press-
|
6
|
+
import { w as Ce } from "../../use-active-press-86hajhdd.js";
|
7
7
|
import { e as De } from "../../use-resolve-button-type-DhFdPxnv.js";
|
8
8
|
import { r as Fe } from "../../bugs-diTMAGNw.js";
|
9
9
|
import { c as g } from "../../index-DIxK0V-G.js";
|
@@ -6,11 +6,11 @@ import { ETabTrailSize as Ae } from "./constants.js";
|
|
6
6
|
import { TabButtons as Se } from "./TabButtons/TabButtons.js";
|
7
7
|
import { ETabTrailButtonVariant as Fe } from "./TabButtons/constants.js";
|
8
8
|
import { NotificationBadge as De } from "../NotificationBadge/NotificationBadge.js";
|
9
|
-
import { n as W, M as se, W as V, s as j, y as q, o as A, H as z, $ as ce, b as Ne, D as de, a as G, u as Re, c as T, t as Me } from "../../keyboard-
|
10
|
-
import { w as Ce } from "../../use-active-press-
|
9
|
+
import { n as W, M as se, W as V, s as j, y as q, o as A, H as z, $ as ce, b as Ne, D as de, a as G, u as Re, c as T, t as Me } from "../../keyboard-B0lm_zyn.js";
|
10
|
+
import { w as Ce } from "../../use-active-press-86hajhdd.js";
|
11
11
|
import { e as Le } from "../../use-resolve-button-type-DhFdPxnv.js";
|
12
|
-
import { T as pe, s as Oe } from "../../hidden-
|
13
|
-
import { _ as B, T as J, P as N, F as I } from "../../focus-management-
|
12
|
+
import { T as pe, s as Oe } from "../../hidden-DbgtYPOH.js";
|
13
|
+
import { _ as B, T as J, P as N, F as I } from "../../focus-management-DE4t_lW3.js";
|
14
14
|
import '../../assets/TabTrail.css';function Be() {
|
15
15
|
let e = U(!1);
|
16
16
|
return W(() => (e.current = !0, () => {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import l, { useId as u, useMemo as f } from "react";
|
2
|
-
import { z as p, U as h, a as v, l as E, f as b, W as $ } from "./label-
|
3
|
-
import { W as H, H as W } from "./keyboard-
|
2
|
+
import { z as p, U as h, a as v, l as E, f as b, W as $ } from "./label-y3ANLTNC.js";
|
3
|
+
import { W as H, H as W } from "./keyboard-B0lm_zyn.js";
|
4
4
|
let P = "div";
|
5
5
|
function _(a, i) {
|
6
6
|
let d = `headlessui-control-${u()}`, [o, n] = p(), [m, s] = h(), c = v(), { disabled: e = c || !1, ...t } = a, r = f(() => ({ disabled: e }), [e]);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { u as N, a as v } from "./keyboard-
|
1
|
+
import { u as N, a as v } from "./keyboard-B0lm_zyn.js";
|
2
2
|
let m = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), F = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
3
3
|
var h = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(h || {}), x = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(x || {}), A = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(A || {});
|
4
4
|
function y(e = document.body) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { W as t, H as a } from "./keyboard-
|
1
|
+
import { W as t, H as a } from "./keyboard-B0lm_zyn.js";
|
2
2
|
let l = "span";
|
3
3
|
var p = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(p || {});
|
4
4
|
function s(e, n) {
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import U, { useRef as m, useCallback as h, useEffect as w, useState as M, useMemo as
|
1
|
+
import U, { useRef as m, useCallback as h, useEffect as w, useState as M, useMemo as ne, useLayoutEffect as re, forwardRef as oe, Fragment as O, isValidElement as ie, cloneElement as ae, createElement as ue } from "react";
|
2
2
|
const R = typeof document < "u" ? U.useLayoutEffect : () => {
|
3
3
|
};
|
4
|
-
function
|
4
|
+
function se(e) {
|
5
5
|
const n = m(null);
|
6
6
|
return R(() => {
|
7
7
|
n.current = e;
|
@@ -16,27 +16,24 @@ const F = (e) => {
|
|
16
16
|
var n;
|
17
17
|
return (n = e == null ? void 0 : e.ownerDocument) !== null && n !== void 0 ? n : document;
|
18
18
|
}, $ = (e) => e && "window" in e && e.window === e ? e : F(e).defaultView || window;
|
19
|
-
function
|
19
|
+
function ce(e) {
|
20
20
|
var n;
|
21
21
|
return typeof window > "u" || window.navigator == null ? !1 : ((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.brands.some((t) => e.test(t.brand))) || e.test(window.navigator.userAgent);
|
22
22
|
}
|
23
|
-
function
|
23
|
+
function le(e) {
|
24
24
|
var n;
|
25
25
|
return typeof window < "u" && window.navigator != null ? e.test(((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.platform) || window.navigator.platform) : !1;
|
26
26
|
}
|
27
|
-
function
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
return
|
35
|
-
}
|
36
|
-
|
37
|
-
return e.mozInputSource === 0 && e.isTrusted ? !0 : ve() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
38
|
-
}
|
39
|
-
class be {
|
27
|
+
function de() {
|
28
|
+
return le(/^Mac/i);
|
29
|
+
}
|
30
|
+
function fe() {
|
31
|
+
return ce(/Android/i);
|
32
|
+
}
|
33
|
+
function ve(e) {
|
34
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : fe() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
35
|
+
}
|
36
|
+
class pe {
|
40
37
|
isDefaultPrevented() {
|
41
38
|
return this.nativeEvent.defaultPrevented;
|
42
39
|
}
|
@@ -55,7 +52,7 @@ class be {
|
|
55
52
|
this.nativeEvent = t, this.target = t.target, this.currentTarget = t.currentTarget, this.relatedTarget = t.relatedTarget, this.bubbles = t.bubbles, this.cancelable = t.cancelable, this.defaultPrevented = t.defaultPrevented, this.eventPhase = t.eventPhase, this.isTrusted = t.isTrusted, this.timeStamp = t.timeStamp, this.type = n;
|
56
53
|
}
|
57
54
|
}
|
58
|
-
function
|
55
|
+
function _(e) {
|
59
56
|
let n = m({
|
60
57
|
isFocused: !1,
|
61
58
|
observer: null
|
@@ -66,14 +63,14 @@ function q(e) {
|
|
66
63
|
r.observer && (r.observer.disconnect(), r.observer = null);
|
67
64
|
};
|
68
65
|
}, []);
|
69
|
-
let t =
|
66
|
+
let t = se((r) => {
|
70
67
|
e == null || e(r);
|
71
68
|
});
|
72
69
|
return h((r) => {
|
73
70
|
if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
|
74
71
|
n.current.isFocused = !0;
|
75
72
|
let o = r.target, u = (c) => {
|
76
|
-
n.current.isFocused = !1, o.disabled && t(new
|
73
|
+
n.current.isFocused = !1, o.disabled && t(new pe("blur", c)), n.current.observer && (n.current.observer.disconnect(), n.current.observer = null);
|
77
74
|
};
|
78
75
|
o.addEventListener("focusout", u, {
|
79
76
|
once: !0
|
@@ -100,7 +97,7 @@ function q(e) {
|
|
100
97
|
t
|
101
98
|
]);
|
102
99
|
}
|
103
|
-
function
|
100
|
+
function be(e) {
|
104
101
|
let { isDisabled: n, onFocus: t, onBlur: r, onFocusChange: o } = e;
|
105
102
|
const u = h((a) => {
|
106
103
|
if (a.target === a.currentTarget)
|
@@ -108,7 +105,7 @@ function ge(e) {
|
|
108
105
|
}, [
|
109
106
|
r,
|
110
107
|
o
|
111
|
-
]), c =
|
108
|
+
]), c = _(u), i = h((a) => {
|
112
109
|
const l = F(a.target);
|
113
110
|
a.target === a.currentTarget && l.activeElement === a.target && (t && t(a), o && o(!0), c(a));
|
114
111
|
}, [
|
@@ -124,29 +121,29 @@ function ge(e) {
|
|
124
121
|
};
|
125
122
|
}
|
126
123
|
let L = null, C = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Map(), y = !1, I = !1;
|
127
|
-
const
|
124
|
+
const ge = {
|
128
125
|
Tab: !0,
|
129
126
|
Escape: !0
|
130
127
|
};
|
131
128
|
function B(e, n) {
|
132
129
|
for (let t of C) t(e, n);
|
133
130
|
}
|
134
|
-
function
|
135
|
-
return !(e.metaKey || !
|
131
|
+
function he(e) {
|
132
|
+
return !(e.metaKey || !de() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
136
133
|
}
|
137
134
|
function k(e) {
|
138
|
-
y = !0,
|
135
|
+
y = !0, he(e) && (L = "keyboard", B("keyboard", e));
|
139
136
|
}
|
140
137
|
function b(e) {
|
141
138
|
L = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (y = !0, B("pointer", e));
|
142
139
|
}
|
143
|
-
function
|
144
|
-
|
140
|
+
function q(e) {
|
141
|
+
ve(e) && (y = !0, L = "virtual");
|
145
142
|
}
|
146
|
-
function
|
143
|
+
function G(e) {
|
147
144
|
e.target === window || e.target === document || (!y && !I && (L = "virtual", B("virtual", e)), y = !1, I = !1);
|
148
145
|
}
|
149
|
-
function
|
146
|
+
function Y() {
|
150
147
|
y = !1, I = !0;
|
151
148
|
}
|
152
149
|
function W(e) {
|
@@ -155,30 +152,30 @@ function W(e) {
|
|
155
152
|
let r = n.HTMLElement.prototype.focus;
|
156
153
|
n.HTMLElement.prototype.focus = function() {
|
157
154
|
y = !0, r.apply(this, arguments);
|
158
|
-
}, t.addEventListener("keydown", k, !0), t.addEventListener("keyup", k, !0), t.addEventListener("click",
|
159
|
-
|
155
|
+
}, t.addEventListener("keydown", k, !0), t.addEventListener("keyup", k, !0), t.addEventListener("click", q, !0), n.addEventListener("focus", G, !0), n.addEventListener("blur", Y, !1), typeof PointerEvent < "u" ? (t.addEventListener("pointerdown", b, !0), t.addEventListener("pointermove", b, !0), t.addEventListener("pointerup", b, !0)) : (t.addEventListener("mousedown", b, !0), t.addEventListener("mousemove", b, !0), t.addEventListener("mouseup", b, !0)), n.addEventListener("beforeunload", () => {
|
156
|
+
z(e);
|
160
157
|
}, {
|
161
158
|
once: !0
|
162
159
|
}), T.set(n, {
|
163
160
|
focus: r
|
164
161
|
});
|
165
162
|
}
|
166
|
-
const
|
163
|
+
const z = (e, n) => {
|
167
164
|
const t = $(e), r = F(e);
|
168
|
-
n && r.removeEventListener("DOMContentLoaded", n), T.has(t) && (t.HTMLElement.prototype.focus = T.get(t).focus, r.removeEventListener("keydown", k, !0), r.removeEventListener("keyup", k, !0), r.removeEventListener("click",
|
165
|
+
n && r.removeEventListener("DOMContentLoaded", n), T.has(t) && (t.HTMLElement.prototype.focus = T.get(t).focus, r.removeEventListener("keydown", k, !0), r.removeEventListener("keyup", k, !0), r.removeEventListener("click", q, !0), t.removeEventListener("focus", G, !0), t.removeEventListener("blur", Y, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", b, !0), r.removeEventListener("pointermove", b, !0), r.removeEventListener("pointerup", b, !0)) : (r.removeEventListener("mousedown", b, !0), r.removeEventListener("mousemove", b, !0), r.removeEventListener("mouseup", b, !0)), T.delete(t));
|
169
166
|
};
|
170
|
-
function
|
167
|
+
function me(e) {
|
171
168
|
const n = F(e);
|
172
169
|
let t;
|
173
170
|
return n.readyState !== "loading" ? W(e) : (t = () => {
|
174
171
|
W(e);
|
175
|
-
}, n.addEventListener("DOMContentLoaded", t)), () =>
|
172
|
+
}, n.addEventListener("DOMContentLoaded", t)), () => z(e, t);
|
176
173
|
}
|
177
|
-
typeof document < "u" &&
|
178
|
-
function
|
174
|
+
typeof document < "u" && me();
|
175
|
+
function Z() {
|
179
176
|
return L !== "pointer";
|
180
177
|
}
|
181
|
-
const
|
178
|
+
const $e = /* @__PURE__ */ new Set([
|
182
179
|
"checkbox",
|
183
180
|
"radio",
|
184
181
|
"range",
|
@@ -189,22 +186,22 @@ const ye = /* @__PURE__ */ new Set([
|
|
189
186
|
"submit",
|
190
187
|
"reset"
|
191
188
|
]);
|
192
|
-
function
|
189
|
+
function ye(e, n, t) {
|
193
190
|
var r;
|
194
191
|
const o = typeof window < "u" ? $(t == null ? void 0 : t.target).HTMLInputElement : HTMLInputElement, u = typeof window < "u" ? $(t == null ? void 0 : t.target).HTMLTextAreaElement : HTMLTextAreaElement, c = typeof window < "u" ? $(t == null ? void 0 : t.target).HTMLElement : HTMLElement, i = typeof window < "u" ? $(t == null ? void 0 : t.target).KeyboardEvent : KeyboardEvent;
|
195
|
-
return e = e || (t == null ? void 0 : t.target) instanceof o &&
|
192
|
+
return e = e || (t == null ? void 0 : t.target) instanceof o && !$e.has(t == null || (r = t.target) === null || r === void 0 ? void 0 : r.type) || (t == null ? void 0 : t.target) instanceof u || (t == null ? void 0 : t.target) instanceof c && (t == null ? void 0 : t.target.isContentEditable), !(e && n === "keyboard" && t instanceof i && !ge[t.key]);
|
196
193
|
}
|
197
|
-
function
|
194
|
+
function Ee(e, n, t) {
|
198
195
|
W(), w(() => {
|
199
196
|
let r = (o, u) => {
|
200
|
-
|
197
|
+
ye(!!(t != null && t.isTextInput), o, u) && e(Z());
|
201
198
|
};
|
202
199
|
return C.add(r), () => {
|
203
200
|
C.delete(r);
|
204
201
|
};
|
205
202
|
}, n);
|
206
203
|
}
|
207
|
-
function
|
204
|
+
function we(e) {
|
208
205
|
let { isDisabled: n, onBlurWithin: t, onFocusWithin: r, onFocusWithinChange: o } = e, u = m({
|
209
206
|
isFocusWithin: !1
|
210
207
|
}), c = h((l) => {
|
@@ -213,7 +210,7 @@ function Te(e) {
|
|
213
210
|
t,
|
214
211
|
o,
|
215
212
|
u
|
216
|
-
]), i =
|
213
|
+
]), i = _(c), a = h((l) => {
|
217
214
|
!u.current.isFocusWithin && document.activeElement === l.target && (r && r(l), o && o(!0), u.current.isFocusWithin = !0, i(l));
|
218
215
|
}, [
|
219
216
|
r,
|
@@ -242,21 +239,21 @@ function N() {
|
|
242
239
|
function V(e) {
|
243
240
|
e.pointerType === "touch" && N();
|
244
241
|
}
|
245
|
-
function
|
242
|
+
function Te() {
|
246
243
|
if (!(typeof document > "u"))
|
247
244
|
return typeof PointerEvent < "u" ? document.addEventListener("pointerup", V) : document.addEventListener("touchend", N), A++, () => {
|
248
245
|
A--, !(A > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", V) : document.removeEventListener("touchend", N));
|
249
246
|
};
|
250
247
|
}
|
251
|
-
function
|
248
|
+
function Ce(e) {
|
252
249
|
let { onHoverStart: n, onHoverChange: t, onHoverEnd: r, isDisabled: o } = e, [u, c] = M(!1), i = m({
|
253
250
|
isHovered: !1,
|
254
251
|
ignoreEmulatedMouseEvents: !1,
|
255
252
|
pointerType: "",
|
256
253
|
target: null
|
257
254
|
}).current;
|
258
|
-
w(
|
259
|
-
let { hoverProps: a, triggerHoverEnd: l } =
|
255
|
+
w(Te, []);
|
256
|
+
let { hoverProps: a, triggerHoverEnd: l } = ne(() => {
|
260
257
|
let d = (s, p) => {
|
261
258
|
if (i.pointerType = p, o || p === "touch" || i.isHovered || !s.currentTarget.contains(s.target)) return;
|
262
259
|
i.isHovered = !0;
|
@@ -308,24 +305,24 @@ function Ie(e) {
|
|
308
305
|
isHovered: u
|
309
306
|
};
|
310
307
|
}
|
311
|
-
function
|
308
|
+
function Ie(e = {}) {
|
312
309
|
let { autoFocus: n = !1, isTextInput: t, within: r } = e, o = m({
|
313
310
|
isFocused: !1,
|
314
|
-
isFocusVisible: n ||
|
311
|
+
isFocusVisible: n || Z()
|
315
312
|
}), [u, c] = M(!1), [i, a] = M(() => o.current.isFocused && o.current.isFocusVisible), l = h(() => a(o.current.isFocused && o.current.isFocusVisible), []), d = h((s) => {
|
316
313
|
o.current.isFocused = s, c(s), l();
|
317
314
|
}, [
|
318
315
|
l
|
319
316
|
]);
|
320
|
-
|
317
|
+
Ee((s) => {
|
321
318
|
o.current.isFocusVisible = s, l();
|
322
319
|
}, [], {
|
323
320
|
isTextInput: t
|
324
321
|
});
|
325
|
-
let { focusProps: f } =
|
322
|
+
let { focusProps: f } = be({
|
326
323
|
isDisabled: r,
|
327
324
|
onFocusChange: d
|
328
|
-
}), { focusWithinProps: v } =
|
325
|
+
}), { focusWithinProps: v } = we({
|
329
326
|
isDisabled: !r,
|
330
327
|
onFocusWithinChange: d
|
331
328
|
});
|
@@ -335,8 +332,8 @@ function We(e = {}) {
|
|
335
332
|
focusProps: r ? v : f
|
336
333
|
};
|
337
334
|
}
|
338
|
-
var
|
339
|
-
let
|
335
|
+
var Fe = Object.defineProperty, Le = (e, n, t) => n in e ? Fe(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, j = (e, n, t) => (Le(e, typeof n != "symbol" ? n + "" : n, t), t);
|
336
|
+
let Pe = class {
|
340
337
|
constructor() {
|
341
338
|
j(this, "current", this.detect()), j(this, "handoffState", "pending"), j(this, "currentId", 0);
|
342
339
|
}
|
@@ -364,16 +361,16 @@ let He = class {
|
|
364
361
|
get isHandoffComplete() {
|
365
362
|
return this.handoffState === "complete";
|
366
363
|
}
|
367
|
-
},
|
368
|
-
function
|
369
|
-
return
|
364
|
+
}, J = new Pe();
|
365
|
+
function Ne(e) {
|
366
|
+
return J.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
|
370
367
|
}
|
371
|
-
function
|
368
|
+
function He(e) {
|
372
369
|
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((n) => setTimeout(() => {
|
373
370
|
throw n;
|
374
371
|
}));
|
375
372
|
}
|
376
|
-
function
|
373
|
+
function Q() {
|
377
374
|
let e = [], n = { addEventListener(t, r, o, u) {
|
378
375
|
return t.addEventListener(r, o, u), n.add(() => t.removeEventListener(r, o, u));
|
379
376
|
}, requestAnimationFrame(...t) {
|
@@ -386,7 +383,7 @@ function X() {
|
|
386
383
|
return n.add(() => clearTimeout(r));
|
387
384
|
}, microTask(...t) {
|
388
385
|
let r = { current: !0 };
|
389
|
-
return
|
386
|
+
return He(() => {
|
390
387
|
r.current && t[0]();
|
391
388
|
}), n.add(() => {
|
392
389
|
r.current = !1;
|
@@ -397,7 +394,7 @@ function X() {
|
|
397
394
|
Object.assign(t.style, { [r]: u });
|
398
395
|
});
|
399
396
|
}, group(t) {
|
400
|
-
let r =
|
397
|
+
let r = Q();
|
401
398
|
return t(r), this.add(() => r.dispose());
|
402
399
|
}, add(t) {
|
403
400
|
return e.includes(t) || e.push(t), () => {
|
@@ -409,38 +406,38 @@ function X() {
|
|
409
406
|
} };
|
410
407
|
return n;
|
411
408
|
}
|
412
|
-
function
|
413
|
-
let [e] = M(
|
409
|
+
function Be() {
|
410
|
+
let [e] = M(Q);
|
414
411
|
return w(() => () => e.dispose(), [e]), e;
|
415
412
|
}
|
416
|
-
let
|
417
|
-
|
413
|
+
let Se = (e, n) => {
|
414
|
+
J.isServer ? w(e, n) : re(e, n);
|
418
415
|
};
|
419
|
-
function
|
416
|
+
function Me(e) {
|
420
417
|
let n = m(e);
|
421
|
-
return
|
418
|
+
return Se(() => {
|
422
419
|
n.current = e;
|
423
420
|
}, [e]), n;
|
424
421
|
}
|
425
|
-
let
|
426
|
-
let n =
|
422
|
+
let ke = function(e) {
|
423
|
+
let n = Me(e);
|
427
424
|
return U.useCallback((...t) => n.current(...t), [n]);
|
428
425
|
};
|
429
426
|
function K(...e) {
|
430
427
|
return Array.from(new Set(e.flatMap((n) => typeof n == "string" ? n.split(" ") : []))).filter(Boolean).join(" ");
|
431
428
|
}
|
432
|
-
function
|
429
|
+
function X(e, n, ...t) {
|
433
430
|
if (e in n) {
|
434
431
|
let o = n[e];
|
435
432
|
return typeof o == "function" ? o(...t) : o;
|
436
433
|
}
|
437
434
|
let r = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map((o) => `"${o}"`).join(", ")}.`);
|
438
|
-
throw Error.captureStackTrace && Error.captureStackTrace(r,
|
435
|
+
throw Error.captureStackTrace && Error.captureStackTrace(r, X), r;
|
439
436
|
}
|
440
|
-
var
|
441
|
-
function
|
442
|
-
i = i ??
|
443
|
-
let a =
|
437
|
+
var De = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(De || {}), Oe = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(Oe || {});
|
438
|
+
function Ve({ ourProps: e, theirProps: n, slot: t, defaultTag: r, features: o, visible: u = !0, name: c, mergeRefs: i }) {
|
439
|
+
i = i ?? Ae;
|
440
|
+
let a = ee(n, e);
|
444
441
|
if (u) return S(a, t, r, c, i);
|
445
442
|
let l = o ?? 0;
|
446
443
|
if (l & 2) {
|
@@ -449,7 +446,7 @@ function Ke({ ourProps: e, theirProps: n, slot: t, defaultTag: r, features: o, v
|
|
449
446
|
}
|
450
447
|
if (l & 1) {
|
451
448
|
let { unmount: d = !0, ...f } = a;
|
452
|
-
return
|
449
|
+
return X(d ? 0 : 1, { 0() {
|
453
450
|
return null;
|
454
451
|
}, 1() {
|
455
452
|
return S({ ...f, hidden: !0, style: { display: "none" } }, t, r, c, i);
|
@@ -469,19 +466,19 @@ function S(e, n = {}, t, r, o) {
|
|
469
466
|
for (let p of s) f[`data-${p}`] = "";
|
470
467
|
}
|
471
468
|
}
|
472
|
-
if (u === O && (Object.keys(E(a)).length > 0 || Object.keys(E(f)).length > 0)) if (!
|
469
|
+
if (u === O && (Object.keys(E(a)).length > 0 || Object.keys(E(f)).length > 0)) if (!ie(d) || Array.isArray(d) && d.length > 1) {
|
473
470
|
if (Object.keys(E(a)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(E(a)).concat(Object.keys(E(f))).map((v) => ` - ${v}`).join(`
|
474
471
|
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((v) => ` - ${v}`).join(`
|
475
472
|
`)].join(`
|
476
473
|
`));
|
477
474
|
} else {
|
478
|
-
let v = d.props, s = v == null ? void 0 : v.className, p = typeof s == "function" ? (...H) => K(s(...H), a.className) : K(s, a.className), g = p ? { className: p } : {}, P =
|
475
|
+
let v = d.props, s = v == null ? void 0 : v.className, p = typeof s == "function" ? (...H) => K(s(...H), a.className) : K(s, a.className), g = p ? { className: p } : {}, P = ee(d.props, E(x(a, ["ref"])));
|
479
476
|
for (let H in f) H in P && delete f[H];
|
480
|
-
return
|
477
|
+
return ae(d, Object.assign({}, P, f, l, { ref: o(d.ref, l.ref) }, g));
|
481
478
|
}
|
482
|
-
return
|
479
|
+
return ue(u, Object.assign({}, x(a, ["ref"]), u !== O && l, u !== O && f), d);
|
483
480
|
}
|
484
|
-
function
|
481
|
+
function Ke() {
|
485
482
|
let e = m([]), n = h((t) => {
|
486
483
|
for (let r of e.current) r != null && (typeof r == "function" ? r(t) : r.current = t);
|
487
484
|
}, []);
|
@@ -489,12 +486,12 @@ function Ue() {
|
|
489
486
|
if (!t.every((r) => r == null)) return e.current = t, n;
|
490
487
|
};
|
491
488
|
}
|
492
|
-
function
|
489
|
+
function Ae(...e) {
|
493
490
|
return e.every((n) => n == null) ? void 0 : (n) => {
|
494
491
|
for (let t of e) t != null && (typeof t == "function" ? t(n) : t.current = n);
|
495
492
|
};
|
496
493
|
}
|
497
|
-
function
|
494
|
+
function ee(...e) {
|
498
495
|
if (e.length === 0) return {};
|
499
496
|
if (e.length === 1) return e[0];
|
500
497
|
let n = {}, t = {};
|
@@ -512,7 +509,7 @@ function te(...e) {
|
|
512
509
|
} });
|
513
510
|
return n;
|
514
511
|
}
|
515
|
-
function
|
512
|
+
function Ue(...e) {
|
516
513
|
if (e.length === 0) return {};
|
517
514
|
if (e.length === 1) return e[0];
|
518
515
|
let n = {}, t = {};
|
@@ -523,9 +520,9 @@ function Re(...e) {
|
|
523
520
|
} });
|
524
521
|
return n;
|
525
522
|
}
|
526
|
-
function
|
523
|
+
function Re(e) {
|
527
524
|
var n;
|
528
|
-
return Object.assign(
|
525
|
+
return Object.assign(oe(e), { displayName: (n = e.displayName) != null ? n : e.name });
|
529
526
|
}
|
530
527
|
function E(e) {
|
531
528
|
let n = Object.assign({}, e);
|
@@ -537,40 +534,40 @@ function x(e, n = []) {
|
|
537
534
|
for (let r of n) r in t && delete t[r];
|
538
535
|
return t;
|
539
536
|
}
|
540
|
-
let
|
541
|
-
function
|
542
|
-
return Object.assign(e, { [
|
537
|
+
let te = Symbol();
|
538
|
+
function _e(e, n = !0) {
|
539
|
+
return Object.assign(e, { [te]: n });
|
543
540
|
}
|
544
|
-
function
|
541
|
+
function qe(...e) {
|
545
542
|
let n = m(e);
|
546
543
|
w(() => {
|
547
544
|
n.current = e;
|
548
545
|
}, [e]);
|
549
|
-
let t =
|
546
|
+
let t = ke((r) => {
|
550
547
|
for (let o of n.current) o != null && (typeof o == "function" ? o(r) : o.current = r);
|
551
548
|
});
|
552
|
-
return e.every((r) => r == null || (r == null ? void 0 : r[
|
549
|
+
return e.every((r) => r == null || (r == null ? void 0 : r[te])) ? void 0 : t;
|
553
550
|
}
|
554
|
-
var
|
551
|
+
var je = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(je || {});
|
555
552
|
export {
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
553
|
+
Ie as $,
|
554
|
+
Ue as D,
|
555
|
+
Ve as H,
|
556
|
+
Ke as I,
|
557
|
+
De as M,
|
558
|
+
_e as T,
|
559
|
+
Re as W,
|
560
|
+
X as a,
|
561
|
+
Ce as b,
|
562
|
+
je as c,
|
563
|
+
Q as d,
|
564
|
+
J as e,
|
568
565
|
E as m,
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
566
|
+
Se as n,
|
567
|
+
ke as o,
|
568
|
+
Be as p,
|
569
|
+
Me as s,
|
570
|
+
He as t,
|
571
|
+
Ne as u,
|
572
|
+
qe as y
|
576
573
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import c, { createContext as v, useContext as p, useState as h, useRef as C, useEffect as N, useMemo as m, useId as O } from "react";
|
2
|
-
import { o as y, p as z, m as K, W as w, y as j, n as H, H as L } from "./keyboard-
|
2
|
+
import { o as y, p as z, m as K, W as w, y as j, n as H, H as L } from "./keyboard-B0lm_zyn.js";
|
3
3
|
import { createPortal as J } from "react-dom";
|
4
|
-
import { T as P, s as S } from "./hidden-
|
4
|
+
import { T as P, s as S } from "./hidden-DbgtYPOH.js";
|
5
5
|
let A = v(void 0);
|
6
6
|
function D() {
|
7
7
|
return p(A);
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import h, { useState as F, useCallback as c, useRef as m, createContext as A, useContext as E } from "react";
|
2
|
+
import { p as x, n as O, d as y } from "./keyboard-B0lm_zyn.js";
|
3
|
+
function k(e = 0) {
|
4
|
+
let [t, n] = F(e), l = c((o) => n(o), [t]), s = c((o) => n((u) => u | o), [t]), r = c((o) => (t & o) === o, [t]), a = c((o) => n((u) => u & ~o), [n]), i = c((o) => n((u) => u ^ o), [n]);
|
5
|
+
return { flags: t, setFlag: l, addFlag: s, hasFlag: r, removeFlag: a, toggleFlag: i };
|
6
|
+
}
|
7
|
+
var v;
|
8
|
+
typeof process < "u" && typeof globalThis < "u" && ((v = process == null ? void 0 : process.env) == null ? void 0 : v.NODE_ENV) === "test" && typeof Element.prototype.getAnimations > "u" && (Element.prototype.getAnimations = function() {
|
9
|
+
return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.", "Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.", "", "Example usage:", "```js", "import { mockAnimationsApi } from 'jsdom-testing-mocks'", "mockAnimationsApi()", "```"].join(`
|
10
|
+
`)), [];
|
11
|
+
});
|
12
|
+
var N = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(N || {});
|
13
|
+
function L(e) {
|
14
|
+
let t = {};
|
15
|
+
for (let n in e) e[n] === !0 && (t[`data-${n}`] = "");
|
16
|
+
return t;
|
17
|
+
}
|
18
|
+
function R(e, t, n, l) {
|
19
|
+
let [s, r] = F(n), { hasFlag: a, addFlag: i, removeFlag: o } = k(e && s ? 3 : 0), u = m(!1), d = m(!1), C = x();
|
20
|
+
return O(() => {
|
21
|
+
var f;
|
22
|
+
if (e) {
|
23
|
+
if (n && r(!0), !t) {
|
24
|
+
n && i(3);
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
return (f = void 0) == null || f.call(l, n), $(t, { inFlight: u, prepare() {
|
28
|
+
d.current ? d.current = !1 : d.current = u.current, u.current = !0, !d.current && (n ? (i(3), o(4)) : (i(4), o(2)));
|
29
|
+
}, run() {
|
30
|
+
d.current ? n ? (o(3), i(4)) : (o(4), i(3)) : n ? o(1) : i(1);
|
31
|
+
}, done() {
|
32
|
+
var g;
|
33
|
+
d.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (u.current = !1, o(7), n || r(!1), (g = void 0) == null || g.call(l, n));
|
34
|
+
} });
|
35
|
+
}
|
36
|
+
}, [e, n, t, C]), e ? [s, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
|
37
|
+
}
|
38
|
+
function $(e, { prepare: t, run: n, done: l, inFlight: s }) {
|
39
|
+
let r = y();
|
40
|
+
return P(e, { prepare: t, inFlight: s }), r.nextFrame(() => {
|
41
|
+
n(), r.requestAnimationFrame(() => {
|
42
|
+
r.add(j(e, l));
|
43
|
+
});
|
44
|
+
}), r.dispose;
|
45
|
+
}
|
46
|
+
function j(e, t) {
|
47
|
+
var n, l;
|
48
|
+
let s = y();
|
49
|
+
if (!e) return s.dispose;
|
50
|
+
let r = !1;
|
51
|
+
s.add(() => {
|
52
|
+
r = !0;
|
53
|
+
});
|
54
|
+
let a = (l = (n = e.getAnimations) == null ? void 0 : n.call(e).filter((i) => i instanceof CSSTransition)) != null ? l : [];
|
55
|
+
return a.length === 0 ? (t(), s.dispose) : (Promise.allSettled(a.map((i) => i.finished)).then(() => {
|
56
|
+
r || t();
|
57
|
+
}), s.dispose);
|
58
|
+
}
|
59
|
+
function P(e, { inFlight: t, prepare: n }) {
|
60
|
+
if (t != null && t.current) {
|
61
|
+
n();
|
62
|
+
return;
|
63
|
+
}
|
64
|
+
let l = e.style.transition;
|
65
|
+
e.style.transition = "none", n(), e.offsetHeight, e.style.transition = l;
|
66
|
+
}
|
67
|
+
let p = A(null);
|
68
|
+
p.displayName = "OpenClosedContext";
|
69
|
+
var S = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(S || {});
|
70
|
+
function T() {
|
71
|
+
return E(p);
|
72
|
+
}
|
73
|
+
function _({ value: e, children: t }) {
|
74
|
+
return h.createElement(p.Provider, { value: e }, t);
|
75
|
+
}
|
76
|
+
function w({ children: e }) {
|
77
|
+
return h.createElement(p.Provider, { value: null }, e);
|
78
|
+
}
|
79
|
+
export {
|
80
|
+
L as H,
|
81
|
+
R,
|
82
|
+
_ as c,
|
83
|
+
S as i,
|
84
|
+
w as s,
|
85
|
+
T as u
|
86
|
+
};
|