mimir-ui-kit 1.38.41 → 1.38.42

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.
@@ -1 +1 @@
1
- ._menu_i19t0_3{position:relative}._menu_i19t0_3 ._menu-button_i19t0_6{all:unset;cursor:pointer}._menu-items_i19t0_11{position:absolute;z-index:10000;width:220px;margin-top:var(--mimir-space-3xs);padding:var(--mimir-space-l) var(--mimir-space-xl);overflow:hidden!important;background-color:var(--white);box-shadow:0 3px 15px #1f202326}._menu-items-container_i19t0_22{display:flex;flex-direction:column;gap:var(--mimir-space-m)}._enter_i19t0_28{transition:opacity .15s ease-out,transform .15s ease-out}._enter-from_i19t0_32{transform:translateY(calc(var(--mimir-space-xxs) * -1));opacity:0}._enter-to_i19t0_37{transform:translateY(0);opacity:1}._leave_i19t0_42{transition:opacity .15s ease-in,transform .2s ease-in}._leave-from_i19t0_46{transform:translateY(0);opacity:1}._leave-to_i19t0_51{transform:translateY(calc(var(--mimir-space-xxs) * -1));opacity:0}
1
+ ._menu_1o2uo_3{position:relative}._menu_1o2uo_3 ._menu-button_1o2uo_6{all:unset;cursor:pointer}._menu-items_1o2uo_11{position:absolute;z-index:10000;width:220px;margin-top:var(--mimir-space-3xs);padding:var(--mimir-space-l) var(--mimir-space-xl);overflow:hidden!important;background-color:var(--white);box-shadow:0 3px 15px #1f202326}._menu-items-container_1o2uo_22{display:flex;flex-direction:column;gap:var(--mimir-space-m)}._close-button_1o2uo_28{position:absolute;top:var(--mimir-space-xs);right:var(--mimir-space-xs)}._enter_1o2uo_34{transition:opacity .15s ease-out,transform .15s ease-out}._enter-from_1o2uo_38{transform:translateY(calc(var(--mimir-space-xxs) * -1));opacity:0}._enter-to_1o2uo_43{transform:translateY(0);opacity:1}._leave_1o2uo_48{transition:opacity .15s ease-in,transform .2s ease-in}._leave-from_1o2uo_52{transform:translateY(0);opacity:1}._leave-to_1o2uo_57{transform:translateY(calc(var(--mimir-space-xxs) * -1));opacity:0}
@@ -41,6 +41,10 @@ type TProps = {
41
41
  * Открывать меню при наведении.
42
42
  */
43
43
  openOnHover?: boolean;
44
+ /**
45
+ * Нужна ли кнопка закрытия.
46
+ */
47
+ needCloseButton?: boolean;
44
48
  /**
45
49
  * Флаг открытия.
46
50
  */
@@ -49,5 +53,5 @@ type TProps = {
49
53
  /**
50
54
  * Компонент Dropdown, содержит в себе кнопку и панель выпадающего меню
51
55
  */
52
- export declare const Dropdown: import('react').MemoExoticComponent<({ children, position, popoverProps, className, buttonClassName, panelClassName, menuItemsClassName, buttonContent, openOnHover, isOpen }: TProps) => import("react/jsx-runtime").JSX.Element>;
56
+ export declare const Dropdown: import('react').MemoExoticComponent<({ children, position, popoverProps, className, buttonClassName, panelClassName, menuItemsClassName, buttonContent, needCloseButton, openOnHover, isOpen }: TProps) => import("react/jsx-runtime").JSX.Element>;
53
57
  export {};
@@ -1,59 +1,60 @@
1
- import { jsx as ce, jsxs as tt, Fragment as nt } from "react/jsx-runtime";
1
+ import { jsx as ce, jsxs as Le, Fragment as nt } from "react/jsx-runtime";
2
2
  import { c as fe } from "../../index-DIxK0V-G.js";
3
- import $, { createContext as ae, useState as W, useContext as ee, useRef as M, useEffect as de, useMemo as G, Fragment as pe, useReducer as rt, createRef as _e, useId as me, memo as ot, useCallback as Le } from "react";
4
- import { o as g, u as Ae, M as ve, W as V, y as z, O as oe, n as ie, m as lt, e as at, H as ue, s as Ie, p as ut, a as Q, T as it, $ as st, b as ct, D as Fe, I as dt, c as re } from "../../keyboard-CUMsrFX1.js";
5
- import { w as pt } from "../../use-active-press-BVQqDQ3V.js";
6
- import { n as Pe, s as vt, l as De, e as ft, E as mt, R as bt, v as ht, y as Pt, x as $t, a as yt, b as Et, m as gt, f as St, d as Tt, t as wt } from "../../portal-D3A00sie.js";
7
- import { e as _t } from "../../use-resolve-button-type-DhFdPxnv.js";
3
+ import y, { createContext as ae, useState as W, useContext as ee, useRef as M, useEffect as de, useMemo as K, Fragment as pe, useReducer as rt, createRef as we, useId as me, memo as ot, useCallback as Ae } from "react";
4
+ import { Button as lt } from "../Button/Button.js";
5
+ import { o as S, u as De, M as ve, W as V, y as z, O as oe, n as ie, m as at, e as ut, H as ue, s as Ie, p as it, a as Q, T as st, $ as ct, b as dt, D as Ce, I as pt, c as re } from "../../keyboard-CUMsrFX1.js";
6
+ import { w as vt } from "../../use-active-press-BVQqDQ3V.js";
7
+ import { n as Pe, s as ft, l as He, e as mt, E as bt, R as ht, v as Pt, y as $t, x as yt, a as Et, b as gt, m as St, f as Tt, d as _t, t as wt } from "../../portal-D3A00sie.js";
8
+ import { e as It } from "../../use-resolve-button-type-DhFdPxnv.js";
8
9
  import { T as be, s as he } from "../../hidden-Dn4lM6EL.js";
9
- import { R as ke, H as Me, i as D, c as He, u as $e, s as It } from "../../open-closed-CkTbpRyi.js";
10
+ import { R as ke, H as Me, i as D, c as Ge, u as $e, s as Ct } from "../../open-closed-CkTbpRyi.js";
10
11
  import { C as Ft } from "../../close-provider-CEutdhG8.js";
11
- import { r as Ge } from "../../bugs-diTMAGNw.js";
12
- import { b as Oe, P as le, F as Y, A as Ct, h as Bt, T as Ce } from "../../focus-management-Dp2_vbQ3.js";
13
- import { f as kt } from "../../use-is-mounted-D7cq4xsa.js";
14
- import '../../assets/Dropdown.css';function Mt({ defaultContainers: e = [], portals: t, mainTreeNode: o } = {}) {
15
- let d = Pe(o), f = g(() => {
16
- var h, m;
12
+ import { r as Ke } from "../../bugs-diTMAGNw.js";
13
+ import { b as Oe, P as le, F as Y, A as Bt, h as kt, T as Fe } from "../../focus-management-Dp2_vbQ3.js";
14
+ import { f as Mt } from "../../use-is-mounted-D7cq4xsa.js";
15
+ import '../../assets/Dropdown.css';function Ot({ defaultContainers: e = [], portals: t, mainTreeNode: o } = {}) {
16
+ let d = Pe(o), f = S(() => {
17
+ var b, m;
17
18
  let l = [];
18
19
  for (let r of e) r !== null && (r instanceof HTMLElement ? l.push(r) : "current" in r && r.current instanceof HTMLElement && l.push(r.current));
19
20
  if (t != null && t.current) for (let r of t.current) l.push(r);
20
- for (let r of (h = d == null ? void 0 : d.querySelectorAll("html > *, body > *")) != null ? h : []) r !== document.body && r !== document.head && r instanceof HTMLElement && r.id !== "headlessui-portal-root" && (o && (r.contains(o) || r.contains((m = o == null ? void 0 : o.getRootNode()) == null ? void 0 : m.host)) || l.some((y) => r.contains(y)) || l.push(r));
21
+ for (let r of (b = d == null ? void 0 : d.querySelectorAll("html > *, body > *")) != null ? b : []) r !== document.body && r !== document.head && r instanceof HTMLElement && r.id !== "headlessui-portal-root" && (o && (r.contains(o) || r.contains((m = o == null ? void 0 : o.getRootNode()) == null ? void 0 : m.host)) || l.some((h) => r.contains(h)) || l.push(r));
21
22
  return l;
22
23
  });
23
- return { resolveContainers: f, contains: g((h) => f().some((m) => m.contains(h))) };
24
+ return { resolveContainers: f, contains: S((b) => f().some((m) => m.contains(b))) };
24
25
  }
25
- let Ke = ae(null);
26
- function Ue({ children: e, node: t }) {
27
- let [o, d] = W(null), f = je(t ?? o);
28
- return $.createElement(Ke.Provider, { value: f }, e, f === null && $.createElement(be, { features: he.Hidden, ref: (h) => {
26
+ let Ue = ae(null);
27
+ function je({ children: e, node: t }) {
28
+ let [o, d] = W(null), f = Xe(t ?? o);
29
+ return y.createElement(Ue.Provider, { value: f }, e, f === null && y.createElement(be, { features: he.Hidden, ref: (b) => {
29
30
  var m, l;
30
- if (h) {
31
- for (let r of (l = (m = Ae(h)) == null ? void 0 : m.querySelectorAll("html > *, body > *")) != null ? l : []) if (r !== document.body && r !== document.head && r instanceof HTMLElement && r != null && r.contains(h)) {
31
+ if (b) {
32
+ for (let r of (l = (m = De(b)) == null ? void 0 : m.querySelectorAll("html > *, body > *")) != null ? l : []) if (r !== document.body && r !== document.head && r instanceof HTMLElement && r != null && r.contains(b)) {
32
33
  d(r);
33
34
  break;
34
35
  }
35
36
  }
36
37
  } }));
37
38
  }
38
- function je(e = null) {
39
+ function Xe(e = null) {
39
40
  var t;
40
- return (t = ee(Ke)) != null ? t : e;
41
+ return (t = ee(Ue)) != null ? t : e;
41
42
  }
42
43
  var J = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(J || {});
43
- function Xe() {
44
+ function We() {
44
45
  let e = M(0);
45
- return vt(!0, "keydown", (t) => {
46
+ return ft(!0, "keydown", (t) => {
46
47
  t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0);
47
48
  }, !0), e;
48
49
  }
49
- function We(e) {
50
+ function Ze(e) {
50
51
  var t;
51
- return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t : qe) !== pe || $.Children.count(e.children) === 1;
52
+ return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t : Je) !== pe || y.Children.count(e.children) === 1;
52
53
  }
53
54
  let ye = ae(null);
54
55
  ye.displayName = "TransitionContext";
55
- var Ot = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Ot || {});
56
- function xt() {
56
+ var xt = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(xt || {});
57
+ function Nt() {
57
58
  let e = ee(ye);
58
59
  if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
59
60
  return e;
@@ -68,102 +69,102 @@ Ee.displayName = "NestingContext";
68
69
  function ge(e) {
69
70
  return "children" in e ? ge(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
70
71
  }
71
- function Ze(e, t) {
72
- let o = Ie(e), d = M([]), f = kt(), h = ut(), m = g((c, a = oe.Hidden) => {
72
+ function qe(e, t) {
73
+ let o = Ie(e), d = M([]), f = Mt(), b = it(), m = S((c, a = oe.Hidden) => {
73
74
  let s = d.current.findIndex(({ el: u }) => u === c);
74
75
  s !== -1 && (Q(a, { [oe.Unmount]() {
75
76
  d.current.splice(s, 1);
76
77
  }, [oe.Hidden]() {
77
78
  d.current[s].state = "hidden";
78
- } }), h.microTask(() => {
79
+ } }), b.microTask(() => {
79
80
  var u;
80
81
  !ge(d) && f.current && ((u = o.current) == null || u.call(o));
81
82
  }));
82
- }), l = g((c) => {
83
+ }), l = S((c) => {
83
84
  let a = d.current.find(({ el: s }) => s === c);
84
85
  return a ? a.state !== "visible" && (a.state = "visible") : d.current.push({ el: c, state: "visible" }), () => m(c, oe.Unmount);
85
- }), r = M([]), y = M(Promise.resolve()), n = M({ enter: [], leave: [] }), E = g((c, a, s) => {
86
+ }), r = M([]), h = M(Promise.resolve()), n = M({ enter: [], leave: [] }), E = S((c, a, s) => {
86
87
  r.current.splice(0), t && (t.chains.current[a] = t.chains.current[a].filter(([u]) => u !== c)), t == null || t.chains.current[a].push([c, new Promise((u) => {
87
88
  r.current.push(u);
88
89
  })]), t == null || t.chains.current[a].push([c, new Promise((u) => {
89
- Promise.all(n.current[a].map(([b, I]) => I)).then(() => u());
90
- })]), a === "enter" ? y.current = y.current.then(() => t == null ? void 0 : t.wait.current).then(() => s(a)) : s(a);
91
- }), P = g((c, a, s) => {
92
- Promise.all(n.current[a].splice(0).map(([u, b]) => b)).then(() => {
90
+ Promise.all(n.current[a].map(([$, T]) => T)).then(() => u());
91
+ })]), a === "enter" ? h.current = h.current.then(() => t == null ? void 0 : t.wait.current).then(() => s(a)) : s(a);
92
+ }), P = S((c, a, s) => {
93
+ Promise.all(n.current[a].splice(0).map(([u, $]) => $)).then(() => {
93
94
  var u;
94
95
  (u = r.current.shift()) == null || u();
95
96
  }).then(() => s(a));
96
97
  });
97
- return G(() => ({ children: d, register: l, unregister: m, onStart: E, onStop: P, wait: y, chains: n }), [l, m, d, E, P, n, y]);
98
+ return K(() => ({ children: d, register: l, unregister: m, onStart: E, onStop: P, wait: h, chains: n }), [l, m, d, E, P, n, h]);
98
99
  }
99
- let qe = pe, Je = ve.RenderStrategy;
100
- function Nt(e, t) {
100
+ let Je = pe, Qe = ve.RenderStrategy;
101
+ function Lt(e, t) {
101
102
  var o, d;
102
- let { transition: f = !0, beforeEnter: h, afterEnter: m, beforeLeave: l, afterLeave: r, enter: y, enterFrom: n, enterTo: E, entered: P, leave: c, leaveFrom: a, leaveTo: s, ...u } = e, [b, I] = W(null), S = M(null), F = We(e), H = z(...F ? [S, t, I] : t === null ? [] : [t]), Z = (o = u.unmount) == null || o ? oe.Unmount : oe.Hidden, { show: C, appear: B, initial: q } = xt(), [k, O] = W(C ? "visible" : "hidden"), K = Rt(), { register: R, unregister: N } = K;
103
- ie(() => R(S), [R, S]), ie(() => {
104
- if (Z === oe.Hidden && S.current) {
105
- if (C && k !== "visible") {
103
+ let { transition: f = !0, beforeEnter: b, afterEnter: m, beforeLeave: l, afterLeave: r, enter: h, enterFrom: n, enterTo: E, entered: P, leave: c, leaveFrom: a, leaveTo: s, ...u } = e, [$, T] = W(null), g = M(null), C = Ze(e), H = z(...C ? [g, t, T] : t === null ? [] : [t]), Z = (o = u.unmount) == null || o ? oe.Unmount : oe.Hidden, { show: F, appear: B, initial: q } = Nt(), [k, O] = W(F ? "visible" : "hidden"), U = Rt(), { register: N, unregister: R } = U;
104
+ ie(() => N(g), [N, g]), ie(() => {
105
+ if (Z === oe.Hidden && g.current) {
106
+ if (F && k !== "visible") {
106
107
  O("visible");
107
108
  return;
108
109
  }
109
- return Q(k, { hidden: () => N(S), visible: () => R(S) });
110
+ return Q(k, { hidden: () => R(g), visible: () => N(g) });
110
111
  }
111
- }, [k, S, R, N, C, Z]);
112
- let U = De();
112
+ }, [k, g, N, R, F, Z]);
113
+ let j = He();
113
114
  ie(() => {
114
- if (F && U && k === "visible" && S.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
115
- }, [S, k, U, F]);
116
- let te = q && !B, j = B && C && q, v = M(!1), i = Ze(() => {
117
- v.current || (O("hidden"), N(S));
118
- }, K), p = g((A) => {
115
+ if (C && j && k === "visible" && g.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
116
+ }, [g, k, j, C]);
117
+ let te = q && !B, X = B && F && q, v = M(!1), i = qe(() => {
118
+ v.current || (O("hidden"), R(g));
119
+ }, U), p = S((A) => {
119
120
  v.current = !0;
120
121
  let ne = A ? "enter" : "leave";
121
- i.onStart(S, ne, (se) => {
122
- se === "enter" ? h == null || h() : se === "leave" && (l == null || l());
122
+ i.onStart(g, ne, (se) => {
123
+ se === "enter" ? b == null || b() : se === "leave" && (l == null || l());
123
124
  });
124
- }), T = g((A) => {
125
+ }), _ = S((A) => {
125
126
  let ne = A ? "enter" : "leave";
126
- v.current = !1, i.onStop(S, ne, (se) => {
127
+ v.current = !1, i.onStop(g, ne, (se) => {
127
128
  se === "enter" ? m == null || m() : se === "leave" && (r == null || r());
128
- }), ne === "leave" && !ge(i) && (O("hidden"), N(S));
129
+ }), ne === "leave" && !ge(i) && (O("hidden"), R(g));
129
130
  });
130
131
  de(() => {
131
- F && f || (p(C), T(C));
132
- }, [C, F, f]);
133
- let w = !(!f || !F || !U || te), [, _] = ke(w, b, C, { start: p, end: T }), x = lt({ ref: H, className: ((d = at(u.className, j && y, j && n, _.enter && y, _.enter && _.closed && n, _.enter && !_.closed && E, _.leave && c, _.leave && !_.closed && a, _.leave && _.closed && s, !_.transition && C && P)) == null ? void 0 : d.trim()) || void 0, ...Me(_) }), L = 0;
134
- return k === "visible" && (L |= D.Open), k === "hidden" && (L |= D.Closed), _.enter && (L |= D.Opening), _.leave && (L |= D.Closing), $.createElement(Ee.Provider, { value: i }, $.createElement(He, { value: L }, ue({ ourProps: x, theirProps: u, defaultTag: qe, features: Je, visible: k === "visible", name: "Transition.Child" })));
132
+ C && f || (p(F), _(F));
133
+ }, [F, C, f]);
134
+ let w = !(!f || !C || !j || te), [, I] = ke(w, $, F, { start: p, end: _ }), x = at({ ref: H, className: ((d = ut(u.className, X && h, X && n, I.enter && h, I.enter && I.closed && n, I.enter && !I.closed && E, I.leave && c, I.leave && !I.closed && a, I.leave && I.closed && s, !I.transition && F && P)) == null ? void 0 : d.trim()) || void 0, ...Me(I) }), L = 0;
135
+ return k === "visible" && (L |= D.Open), k === "hidden" && (L |= D.Closed), I.enter && (L |= D.Opening), I.leave && (L |= D.Closing), y.createElement(Ee.Provider, { value: i }, y.createElement(Ge, { value: L }, ue({ ourProps: x, theirProps: u, defaultTag: Je, features: Qe, visible: k === "visible", name: "Transition.Child" })));
135
136
  }
136
- function Lt(e, t) {
137
- let { show: o, appear: d = !1, unmount: f = !0, ...h } = e, m = M(null), l = We(e), r = z(...l ? [m, t] : t === null ? [] : [t]);
138
- De();
139
- let y = $e();
140
- if (o === void 0 && y !== null && (o = (y & D.Open) === D.Open), o === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
141
- let [n, E] = W(o ? "visible" : "hidden"), P = Ze(() => {
137
+ function At(e, t) {
138
+ let { show: o, appear: d = !1, unmount: f = !0, ...b } = e, m = M(null), l = Ze(e), r = z(...l ? [m, t] : t === null ? [] : [t]);
139
+ He();
140
+ let h = $e();
141
+ if (o === void 0 && h !== null && (o = (h & D.Open) === D.Open), o === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
142
+ let [n, E] = W(o ? "visible" : "hidden"), P = qe(() => {
142
143
  o || E("hidden");
143
144
  }), [c, a] = W(!0), s = M([o]);
144
145
  ie(() => {
145
146
  c !== !1 && s.current[s.current.length - 1] !== o && (s.current.push(o), a(!1));
146
147
  }, [s, o]);
147
- let u = G(() => ({ show: o, appear: d, initial: c }), [o, d, c]);
148
+ let u = K(() => ({ show: o, appear: d, initial: c }), [o, d, c]);
148
149
  ie(() => {
149
150
  o ? E("visible") : !ge(P) && m.current !== null && E("hidden");
150
151
  }, [o, P]);
151
- let b = { unmount: f }, I = g(() => {
152
- var F;
153
- c && a(!1), (F = e.beforeEnter) == null || F.call(e);
154
- }), S = g(() => {
155
- var F;
156
- c && a(!1), (F = e.beforeLeave) == null || F.call(e);
152
+ let $ = { unmount: f }, T = S(() => {
153
+ var C;
154
+ c && a(!1), (C = e.beforeEnter) == null || C.call(e);
155
+ }), g = S(() => {
156
+ var C;
157
+ c && a(!1), (C = e.beforeLeave) == null || C.call(e);
157
158
  });
158
- return $.createElement(Ee.Provider, { value: P }, $.createElement(ye.Provider, { value: u }, ue({ ourProps: { ...b, as: pe, children: $.createElement(Qe, { ref: r, ...b, ...h, beforeEnter: I, beforeLeave: S }) }, theirProps: {}, defaultTag: pe, features: Je, visible: n === "visible", name: "Transition" })));
159
+ return y.createElement(Ee.Provider, { value: P }, y.createElement(ye.Provider, { value: u }, ue({ ourProps: { ...$, as: pe, children: y.createElement(Ve, { ref: r, ...$, ...b, beforeEnter: T, beforeLeave: g }) }, theirProps: {}, defaultTag: pe, features: Qe, visible: n === "visible", name: "Transition" })));
159
160
  }
160
- function At(e, t) {
161
+ function Dt(e, t) {
161
162
  let o = ee(ye) !== null, d = $e() !== null;
162
- return $.createElement($.Fragment, null, !o && d ? $.createElement(Be, { ref: t, ...e }) : $.createElement(Qe, { ref: t, ...e }));
163
+ return y.createElement(y.Fragment, null, !o && d ? y.createElement(Be, { ref: t, ...e }) : y.createElement(Ve, { ref: t, ...e }));
163
164
  }
164
- let Be = V(Lt), Qe = V(Nt), Dt = V(At), Ht = Object.assign(Be, { Child: Dt, Root: Be });
165
- var Gt = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Gt || {}), Kt = ((e) => (e[e.TogglePopover = 0] = "TogglePopover", e[e.ClosePopover = 1] = "ClosePopover", e[e.SetButton = 2] = "SetButton", e[e.SetButtonId = 3] = "SetButtonId", e[e.SetPanel = 4] = "SetPanel", e[e.SetPanelId = 5] = "SetPanelId", e))(Kt || {});
166
- let Ut = { 0: (e) => ({ ...e, popoverState: Q(e.popoverState, { 0: 1, 1: 0 }), __demoMode: !1 }), 1(e) {
165
+ let Be = V(At), Ve = V(Lt), Ht = V(Dt), Gt = Object.assign(Be, { Child: Ht, Root: Be });
166
+ var Kt = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Kt || {}), Ut = ((e) => (e[e.TogglePopover = 0] = "TogglePopover", e[e.ClosePopover = 1] = "ClosePopover", e[e.SetButton = 2] = "SetButton", e[e.SetButtonId = 3] = "SetButtonId", e[e.SetPanel = 4] = "SetPanel", e[e.SetPanelId = 5] = "SetPanelId", e))(Ut || {});
167
+ let jt = { 0: (e) => ({ ...e, popoverState: Q(e.popoverState, { 0: 1, 1: 0 }), __demoMode: !1 }), 1(e) {
167
168
  return e.popoverState === 1 ? e : { ...e, popoverState: 1, __demoMode: !1 };
168
169
  }, 2(e, t) {
169
170
  return e.button === t.button ? e : { ...e, button: t.button };
@@ -185,65 +186,65 @@ function Se(e) {
185
186
  }
186
187
  let Te = ae(null);
187
188
  Te.displayName = "PopoverAPIContext";
188
- function Re(e) {
189
+ function Ne(e) {
189
190
  let t = ee(Te);
190
191
  if (t === null) {
191
192
  let o = new Error(`<${e} /> is missing a parent <Popover /> component.`);
192
- throw Error.captureStackTrace && Error.captureStackTrace(o, Re), o;
193
+ throw Error.captureStackTrace && Error.captureStackTrace(o, Ne), o;
193
194
  }
194
195
  return t;
195
196
  }
196
- let Ne = ae(null);
197
- Ne.displayName = "PopoverGroupContext";
198
- function Ve() {
199
- return ee(Ne);
197
+ let Re = ae(null);
198
+ Re.displayName = "PopoverGroupContext";
199
+ function Ye() {
200
+ return ee(Re);
200
201
  }
201
- let we = ae(null);
202
- we.displayName = "PopoverPanelContext";
203
- function jt() {
204
- return ee(we);
202
+ let _e = ae(null);
203
+ _e.displayName = "PopoverPanelContext";
204
+ function Xt() {
205
+ return ee(_e);
205
206
  }
206
- function Xt(e, t) {
207
- return Q(t.type, Ut, e, t);
207
+ function Wt(e, t) {
208
+ return Q(t.type, jt, e, t);
208
209
  }
209
- let Wt = "div";
210
- function Zt(e, t) {
210
+ let Zt = "div";
211
+ function qt(e, t) {
211
212
  var o;
212
- let { __demoMode: d = !1, ...f } = e, h = M(null), m = z(t, it((v) => {
213
- h.current = v;
214
- })), l = M([]), r = rt(Xt, { __demoMode: d, popoverState: d ? 0 : 1, buttons: l, button: null, buttonId: null, panel: null, panelId: null, beforePanelSentinel: _e(), afterPanelSentinel: _e(), afterButtonSentinel: _e() }), [{ popoverState: y, button: n, buttonId: E, panel: P, panelId: c, beforePanelSentinel: a, afterPanelSentinel: s, afterButtonSentinel: u }, b] = r, I = Pe((o = h.current) != null ? o : n), S = G(() => {
213
+ let { __demoMode: d = !1, ...f } = e, b = M(null), m = z(t, st((v) => {
214
+ b.current = v;
215
+ })), l = M([]), r = rt(Wt, { __demoMode: d, popoverState: d ? 0 : 1, buttons: l, button: null, buttonId: null, panel: null, panelId: null, beforePanelSentinel: we(), afterPanelSentinel: we(), afterButtonSentinel: we() }), [{ popoverState: h, button: n, buttonId: E, panel: P, panelId: c, beforePanelSentinel: a, afterPanelSentinel: s, afterButtonSentinel: u }, $] = r, T = Pe((o = b.current) != null ? o : n), g = K(() => {
215
216
  if (!n || !P) return !1;
216
217
  for (let x of document.querySelectorAll("body > *")) if (Number(x == null ? void 0 : x.contains(n)) ^ Number(x == null ? void 0 : x.contains(P))) return !0;
217
- let v = Oe(), i = v.indexOf(n), p = (i + v.length - 1) % v.length, T = (i + 1) % v.length, w = v[p], _ = v[T];
218
- return !P.contains(w) && !P.contains(_);
219
- }, [n, P]), F = Ie(E), H = Ie(c), Z = G(() => ({ buttonId: F, panelId: H, close: () => b({ type: 1 }) }), [F, H, b]), C = Ve(), B = C == null ? void 0 : C.registerPopover, q = g(() => {
218
+ let v = Oe(), i = v.indexOf(n), p = (i + v.length - 1) % v.length, _ = (i + 1) % v.length, w = v[p], I = v[_];
219
+ return !P.contains(w) && !P.contains(I);
220
+ }, [n, P]), C = Ie(E), H = Ie(c), Z = K(() => ({ buttonId: C, panelId: H, close: () => $({ type: 1 }) }), [C, H, $]), F = Ye(), B = F == null ? void 0 : F.registerPopover, q = S(() => {
220
221
  var v;
221
- return (v = C == null ? void 0 : C.isFocusWithinPopoverGroup()) != null ? v : (I == null ? void 0 : I.activeElement) && ((n == null ? void 0 : n.contains(I.activeElement)) || (P == null ? void 0 : P.contains(I.activeElement)));
222
+ return (v = F == null ? void 0 : F.isFocusWithinPopoverGroup()) != null ? v : (T == null ? void 0 : T.activeElement) && ((n == null ? void 0 : n.contains(T.activeElement)) || (P == null ? void 0 : P.contains(T.activeElement)));
222
223
  });
223
224
  de(() => B == null ? void 0 : B(Z), [B, Z]);
224
- let [k, O] = ft(), K = je(n), R = Mt({ mainTreeNode: K, portals: k, defaultContainers: [n, P] });
225
- mt(I == null ? void 0 : I.defaultView, "focus", (v) => {
226
- var i, p, T, w, _, x;
227
- v.target !== window && v.target instanceof HTMLElement && y === 0 && (q() || n && P && (R.contains(v.target) || (p = (i = a.current) == null ? void 0 : i.contains) != null && p.call(i, v.target) || (w = (T = s.current) == null ? void 0 : T.contains) != null && w.call(T, v.target) || (x = (_ = u.current) == null ? void 0 : _.contains) != null && x.call(_, v.target) || b({ type: 1 })));
228
- }, !0), bt(y === 0, R.resolveContainers, (v, i) => {
229
- b({ type: 1 }), Ct(i, Bt.Loose) || (v.preventDefault(), n == null || n.focus());
225
+ let [k, O] = mt(), U = Xe(n), N = Ot({ mainTreeNode: U, portals: k, defaultContainers: [n, P] });
226
+ bt(T == null ? void 0 : T.defaultView, "focus", (v) => {
227
+ var i, p, _, w, I, x;
228
+ v.target !== window && v.target instanceof HTMLElement && h === 0 && (q() || n && P && (N.contains(v.target) || (p = (i = a.current) == null ? void 0 : i.contains) != null && p.call(i, v.target) || (w = (_ = s.current) == null ? void 0 : _.contains) != null && w.call(_, v.target) || (x = (I = u.current) == null ? void 0 : I.contains) != null && x.call(I, v.target) || $({ type: 1 })));
229
+ }, !0), ht(h === 0, N.resolveContainers, (v, i) => {
230
+ $({ type: 1 }), Bt(i, kt.Loose) || (v.preventDefault(), n == null || n.focus());
230
231
  });
231
- let N = g((v) => {
232
- b({ type: 1 });
232
+ let R = S((v) => {
233
+ $({ type: 1 });
233
234
  let i = v ? v instanceof HTMLElement ? v : "current" in v && v.current instanceof HTMLElement ? v.current : n : n;
234
235
  i == null || i.focus();
235
- }), U = G(() => ({ close: N, isPortalled: S }), [N, S]), te = G(() => ({ open: y === 0, close: N }), [y, N]), j = { ref: m };
236
- return $.createElement(Ue, { node: K }, $.createElement(ht, null, $.createElement(we.Provider, { value: null }, $.createElement(xe.Provider, { value: r }, $.createElement(Te.Provider, { value: U }, $.createElement(Ft, { value: N }, $.createElement(He, { value: Q(y, { 0: D.Open, 1: D.Closed }) }, $.createElement(O, null, ue({ ourProps: j, theirProps: f, slot: te, defaultTag: Wt, name: "Popover" })))))))));
236
+ }), j = K(() => ({ close: R, isPortalled: g }), [R, g]), te = K(() => ({ open: h === 0, close: R }), [h, R]), X = { ref: m };
237
+ return y.createElement(je, { node: U }, y.createElement(Pt, null, y.createElement(_e.Provider, { value: null }, y.createElement(xe.Provider, { value: r }, y.createElement(Te.Provider, { value: j }, y.createElement(Ft, { value: R }, y.createElement(Ge, { value: Q(h, { 0: D.Open, 1: D.Closed }) }, y.createElement(O, null, ue({ ourProps: X, theirProps: f, slot: te, defaultTag: Zt, name: "Popover" })))))))));
237
238
  }
238
- let qt = "button";
239
- function Jt(e, t) {
240
- let o = me(), { id: d = `headlessui-popover-button-${o}`, disabled: f = !1, autoFocus: h = !1, ...m } = e, [l, r] = Se("Popover.Button"), { isPortalled: y } = Re("Popover.Button"), n = M(null), E = `headlessui-focus-sentinel-${me()}`, P = Ve(), c = P == null ? void 0 : P.closeOthers, a = jt() !== null;
239
+ let Jt = "button";
240
+ function Qt(e, t) {
241
+ let o = me(), { id: d = `headlessui-popover-button-${o}`, disabled: f = !1, autoFocus: b = !1, ...m } = e, [l, r] = Se("Popover.Button"), { isPortalled: h } = Ne("Popover.Button"), n = M(null), E = `headlessui-focus-sentinel-${me()}`, P = Ye(), c = P == null ? void 0 : P.closeOthers, a = Xt() !== null;
241
242
  de(() => {
242
243
  if (!a) return r({ type: 3, buttonId: d }), () => {
243
244
  r({ type: 3, buttonId: null });
244
245
  };
245
246
  }, [a, d, r]);
246
- let [s] = W(() => Symbol()), u = z(n, t, Pt(), g((i) => {
247
+ let [s] = W(() => Symbol()), u = z(n, t, $t(), S((i) => {
247
248
  if (!a) {
248
249
  if (i) l.buttons.current.push(s);
249
250
  else {
@@ -252,14 +253,14 @@ function Jt(e, t) {
252
253
  }
253
254
  l.buttons.current.length > 1 && console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."), i && r({ type: 2, button: i });
254
255
  }
255
- })), b = z(n, t), I = Pe(n), S = g((i) => {
256
- var p, T, w;
256
+ })), $ = z(n, t), T = Pe(n), g = S((i) => {
257
+ var p, _, w;
257
258
  if (a) {
258
259
  if (l.popoverState === 1) return;
259
260
  switch (i.key) {
260
261
  case re.Space:
261
262
  case re.Enter:
262
- i.preventDefault(), (T = (p = i.target).click) == null || T.call(p), r({ type: 1 }), (w = l.button) == null || w.focus();
263
+ i.preventDefault(), (_ = (p = i.target).click) == null || _.call(p), r({ type: 1 }), (w = l.button) == null || w.focus();
263
264
  break;
264
265
  }
265
266
  } else switch (i.key) {
@@ -269,55 +270,55 @@ function Jt(e, t) {
269
270
  break;
270
271
  case re.Escape:
271
272
  if (l.popoverState !== 0) return c == null ? void 0 : c(l.buttonId);
272
- if (!n.current || I != null && I.activeElement && !n.current.contains(I.activeElement)) return;
273
+ if (!n.current || T != null && T.activeElement && !n.current.contains(T.activeElement)) return;
273
274
  i.preventDefault(), i.stopPropagation(), r({ type: 1 });
274
275
  break;
275
276
  }
276
- }), F = g((i) => {
277
+ }), C = S((i) => {
277
278
  a || i.key === re.Space && i.preventDefault();
278
- }), H = g((i) => {
279
- var p, T;
280
- Ge(i.currentTarget) || f || (a ? (r({ type: 1 }), (p = l.button) == null || p.focus()) : (i.preventDefault(), i.stopPropagation(), l.popoverState === 1 && (c == null || c(l.buttonId)), r({ type: 0 }), (T = l.button) == null || T.focus()));
281
- }), Z = g((i) => {
279
+ }), H = S((i) => {
280
+ var p, _;
281
+ Ke(i.currentTarget) || f || (a ? (r({ type: 1 }), (p = l.button) == null || p.focus()) : (i.preventDefault(), i.stopPropagation(), l.popoverState === 1 && (c == null || c(l.buttonId)), r({ type: 0 }), (_ = l.button) == null || _.focus()));
282
+ }), Z = S((i) => {
282
283
  i.preventDefault(), i.stopPropagation();
283
- }), { isFocusVisible: C, focusProps: B } = st({ autoFocus: h }), { isHovered: q, hoverProps: k } = ct({ isDisabled: f }), { pressed: O, pressProps: K } = pt({ disabled: f }), R = l.popoverState === 0, N = G(() => ({ open: R, active: O || R, disabled: f, hover: q, focus: C, autofocus: h }), [R, q, C, O, f, h]), U = _t(e, l.button), te = a ? Fe({ ref: b, type: U, onKeyDown: S, onClick: H, disabled: f || void 0, autoFocus: h }, B, k, K) : Fe({ ref: u, id: l.buttonId, type: U, "aria-expanded": l.popoverState === 0, "aria-controls": l.panel ? l.panelId : void 0, disabled: f || void 0, autoFocus: h, onKeyDown: S, onKeyUp: F, onClick: H, onMouseDown: Z }, B, k, K), j = Xe(), v = g(() => {
284
+ }), { isFocusVisible: F, focusProps: B } = ct({ autoFocus: b }), { isHovered: q, hoverProps: k } = dt({ isDisabled: f }), { pressed: O, pressProps: U } = vt({ disabled: f }), N = l.popoverState === 0, R = K(() => ({ open: N, active: O || N, disabled: f, hover: q, focus: F, autofocus: b }), [N, q, F, O, f, b]), j = It(e, l.button), te = a ? Ce({ ref: $, type: j, onKeyDown: g, onClick: H, disabled: f || void 0, autoFocus: b }, B, k, U) : Ce({ ref: u, id: l.buttonId, type: j, "aria-expanded": l.popoverState === 0, "aria-controls": l.panel ? l.panelId : void 0, disabled: f || void 0, autoFocus: b, onKeyDown: g, onKeyUp: C, onClick: H, onMouseDown: Z }, B, k, U), X = We(), v = S(() => {
284
285
  let i = l.panel;
285
286
  if (!i) return;
286
287
  function p() {
287
- Q(j.current, { [J.Forwards]: () => le(i, Y.First), [J.Backwards]: () => le(i, Y.Last) }) === Ce.Error && le(Oe().filter((T) => T.dataset.headlessuiFocusGuard !== "true"), Q(j.current, { [J.Forwards]: Y.Next, [J.Backwards]: Y.Previous }), { relativeTo: l.button });
288
+ Q(X.current, { [J.Forwards]: () => le(i, Y.First), [J.Backwards]: () => le(i, Y.Last) }) === Fe.Error && le(Oe().filter((_) => _.dataset.headlessuiFocusGuard !== "true"), Q(X.current, { [J.Forwards]: Y.Next, [J.Backwards]: Y.Previous }), { relativeTo: l.button });
288
289
  }
289
290
  p();
290
291
  });
291
- return $.createElement($.Fragment, null, ue({ ourProps: te, theirProps: m, slot: N, defaultTag: qt, name: "Popover.Button" }), R && !a && y && $.createElement(be, { id: E, ref: l.afterButtonSentinel, features: he.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: v }));
292
+ return y.createElement(y.Fragment, null, ue({ ourProps: te, theirProps: m, slot: R, defaultTag: Jt, name: "Popover.Button" }), N && !a && h && y.createElement(be, { id: E, ref: l.afterButtonSentinel, features: he.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: v }));
292
293
  }
293
- let Qt = "div", Vt = ve.RenderStrategy | ve.Static;
294
- function Ye(e, t) {
295
- let o = me(), { id: d = `headlessui-popover-backdrop-${o}`, transition: f = !1, ...h } = e, [{ popoverState: m }, l] = Se("Popover.Backdrop"), [r, y] = W(null), n = z(t, y), E = $e(), [P, c] = ke(f, r, E !== null ? (E & D.Open) === D.Open : m === 0), a = g((b) => {
296
- if (Ge(b.currentTarget)) return b.preventDefault();
294
+ let Vt = "div", Yt = ve.RenderStrategy | ve.Static;
295
+ function ze(e, t) {
296
+ let o = me(), { id: d = `headlessui-popover-backdrop-${o}`, transition: f = !1, ...b } = e, [{ popoverState: m }, l] = Se("Popover.Backdrop"), [r, h] = W(null), n = z(t, h), E = $e(), [P, c] = ke(f, r, E !== null ? (E & D.Open) === D.Open : m === 0), a = S(($) => {
297
+ if (Ke($.currentTarget)) return $.preventDefault();
297
298
  l({ type: 1 });
298
- }), s = G(() => ({ open: m === 0 }), [m]), u = { ref: n, id: d, "aria-hidden": !0, onClick: a, ...Me(c) };
299
- return ue({ ourProps: u, theirProps: h, slot: s, defaultTag: Qt, features: Vt, visible: P, name: "Popover.Backdrop" });
299
+ }), s = K(() => ({ open: m === 0 }), [m]), u = { ref: n, id: d, "aria-hidden": !0, onClick: a, ...Me(c) };
300
+ return ue({ ourProps: u, theirProps: b, slot: s, defaultTag: Vt, features: Yt, visible: P, name: "Popover.Backdrop" });
300
301
  }
301
- let Yt = "div", zt = ve.RenderStrategy | ve.Static;
302
- function en(e, t) {
303
- let o = me(), { id: d = `headlessui-popover-panel-${o}`, focus: f = !1, anchor: h, portal: m = !1, modal: l = !1, transition: r = !1, ...y } = e, [n, E] = Se("Popover.Panel"), { close: P, isPortalled: c } = Re("Popover.Panel"), a = `headlessui-focus-sentinel-before-${o}`, s = `headlessui-focus-sentinel-after-${o}`, u = M(null), b = $t(h), [I, S] = yt(b), F = Et();
304
- b && (m = !0);
305
- let [H, Z] = W(null), C = z(u, t, b ? I : null, g((p) => E({ type: 4, panel: p })), Z), B = Pe(u), q = dt();
302
+ let zt = "div", en = ve.RenderStrategy | ve.Static;
303
+ function tn(e, t) {
304
+ let o = me(), { id: d = `headlessui-popover-panel-${o}`, focus: f = !1, anchor: b, portal: m = !1, modal: l = !1, transition: r = !1, ...h } = e, [n, E] = Se("Popover.Panel"), { close: P, isPortalled: c } = Ne("Popover.Panel"), a = `headlessui-focus-sentinel-before-${o}`, s = `headlessui-focus-sentinel-after-${o}`, u = M(null), $ = yt(b), [T, g] = Et($), C = gt();
305
+ $ && (m = !0);
306
+ let [H, Z] = W(null), F = z(u, t, $ ? T : null, S((p) => E({ type: 4, panel: p })), Z), B = Pe(u), q = pt();
306
307
  ie(() => (E({ type: 5, panelId: d }), () => {
307
308
  E({ type: 5, panelId: null });
308
309
  }), [d, E]);
309
- let k = $e(), [O, K] = ke(r, H, k !== null ? (k & D.Open) === D.Open : n.popoverState === 0);
310
- gt(O, n.button, () => {
310
+ let k = $e(), [O, U] = ke(r, H, k !== null ? (k & D.Open) === D.Open : n.popoverState === 0);
311
+ St(O, n.button, () => {
311
312
  E({ type: 1 });
312
313
  });
313
- let R = n.__demoMode ? !1 : l && O;
314
- St(R, B);
315
- let N = g((p) => {
316
- var T;
314
+ let N = n.__demoMode ? !1 : l && O;
315
+ Tt(N, B);
316
+ let R = S((p) => {
317
+ var _;
317
318
  switch (p.key) {
318
319
  case re.Escape:
319
320
  if (n.popoverState !== 0 || !u.current || B != null && B.activeElement && !u.current.contains(B.activeElement)) return;
320
- p.preventDefault(), p.stopPropagation(), E({ type: 1 }), (T = n.button) == null || T.focus();
321
+ p.preventDefault(), p.stopPropagation(), E({ type: 1 }), (_ = n.button) == null || _.focus();
321
322
  break;
322
323
  }
323
324
  });
@@ -329,30 +330,30 @@ function en(e, t) {
329
330
  let p = B == null ? void 0 : B.activeElement;
330
331
  u.current.contains(p) || le(u.current, Y.First);
331
332
  }, [n.__demoMode, f, u.current, n.popoverState]);
332
- let U = G(() => ({ open: n.popoverState === 0, close: P }), [n.popoverState, P]), te = Fe(b ? F() : {}, { ref: C, id: d, onKeyDown: N, onBlur: f && n.popoverState === 0 ? (p) => {
333
- var T, w, _, x, L;
333
+ let j = K(() => ({ open: n.popoverState === 0, close: P }), [n.popoverState, P]), te = Ce($ ? C() : {}, { ref: F, id: d, onKeyDown: R, onBlur: f && n.popoverState === 0 ? (p) => {
334
+ var _, w, I, x, L;
334
335
  let A = p.relatedTarget;
335
- A && u.current && ((T = u.current) != null && T.contains(A) || (E({ type: 1 }), ((_ = (w = n.beforePanelSentinel.current) == null ? void 0 : w.contains) != null && _.call(w, A) || (L = (x = n.afterPanelSentinel.current) == null ? void 0 : x.contains) != null && L.call(x, A)) && A.focus({ preventScroll: !0 })));
336
- } : void 0, tabIndex: -1, style: { ...y.style, ...S, "--button-width": Tt(n.button, !0).width }, ...Me(K) }), j = Xe(), v = g(() => {
336
+ A && u.current && ((_ = u.current) != null && _.contains(A) || (E({ type: 1 }), ((I = (w = n.beforePanelSentinel.current) == null ? void 0 : w.contains) != null && I.call(w, A) || (L = (x = n.afterPanelSentinel.current) == null ? void 0 : x.contains) != null && L.call(x, A)) && A.focus({ preventScroll: !0 })));
337
+ } : void 0, tabIndex: -1, style: { ...h.style, ...g, "--button-width": _t(n.button, !0).width }, ...Me(U) }), X = We(), v = S(() => {
337
338
  let p = u.current;
338
339
  if (!p) return;
339
- function T() {
340
- Q(j.current, { [J.Forwards]: () => {
340
+ function _() {
341
+ Q(X.current, { [J.Forwards]: () => {
341
342
  var w;
342
- le(p, Y.First) === Ce.Error && ((w = n.afterPanelSentinel.current) == null || w.focus());
343
+ le(p, Y.First) === Fe.Error && ((w = n.afterPanelSentinel.current) == null || w.focus());
343
344
  }, [J.Backwards]: () => {
344
345
  var w;
345
346
  (w = n.button) == null || w.focus({ preventScroll: !0 });
346
347
  } });
347
348
  }
348
- T();
349
- }), i = g(() => {
349
+ _();
350
+ }), i = S(() => {
350
351
  let p = u.current;
351
352
  if (!p) return;
352
- function T() {
353
- Q(j.current, { [J.Forwards]: () => {
353
+ function _() {
354
+ Q(X.current, { [J.Forwards]: () => {
354
355
  if (!n.button) return;
355
- let w = Oe(), _ = w.indexOf(n.button), x = w.slice(0, _ + 1), L = [...w.slice(_ + 1), ...x];
356
+ let w = Oe(), I = w.indexOf(n.button), x = w.slice(0, I + 1), L = [...w.slice(I + 1), ...x];
356
357
  for (let A of L.slice()) if (A.dataset.headlessuiFocusGuard === "true" || H != null && H.contains(A)) {
357
358
  let ne = L.indexOf(A);
358
359
  ne !== -1 && L.splice(ne, 1);
@@ -360,130 +361,149 @@ function en(e, t) {
360
361
  le(L, Y.First, { sorted: !1 });
361
362
  }, [J.Backwards]: () => {
362
363
  var w;
363
- le(p, Y.Previous) === Ce.Error && ((w = n.button) == null || w.focus());
364
+ le(p, Y.Previous) === Fe.Error && ((w = n.button) == null || w.focus());
364
365
  } });
365
366
  }
366
- T();
367
+ _();
367
368
  });
368
- return $.createElement(It, null, $.createElement(we.Provider, { value: d }, $.createElement(Te.Provider, { value: { close: P, isPortalled: c } }, $.createElement(wt, { enabled: m ? e.static || O : !1 }, O && c && $.createElement(be, { id: a, ref: n.beforePanelSentinel, features: he.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: v }), ue({ mergeRefs: q, ourProps: te, theirProps: y, slot: U, defaultTag: Yt, features: zt, visible: O, name: "Popover.Panel" }), O && c && $.createElement(be, { id: s, ref: n.afterPanelSentinel, features: he.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: i })))));
369
+ return y.createElement(Ct, null, y.createElement(_e.Provider, { value: d }, y.createElement(Te.Provider, { value: { close: P, isPortalled: c } }, y.createElement(wt, { enabled: m ? e.static || O : !1 }, O && c && y.createElement(be, { id: a, ref: n.beforePanelSentinel, features: he.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: v }), ue({ mergeRefs: q, ourProps: te, theirProps: h, slot: j, defaultTag: zt, features: en, visible: O, name: "Popover.Panel" }), O && c && y.createElement(be, { id: s, ref: n.afterPanelSentinel, features: he.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: i })))));
369
370
  }
370
- let tn = "div";
371
- function nn(e, t) {
372
- let o = M(null), d = z(o, t), [f, h] = W([]), m = g((a) => {
373
- h((s) => {
371
+ let nn = "div";
372
+ function rn(e, t) {
373
+ let o = M(null), d = z(o, t), [f, b] = W([]), m = S((a) => {
374
+ b((s) => {
374
375
  let u = s.indexOf(a);
375
376
  if (u !== -1) {
376
- let b = s.slice();
377
- return b.splice(u, 1), b;
377
+ let $ = s.slice();
378
+ return $.splice(u, 1), $;
378
379
  }
379
380
  return s;
380
381
  });
381
- }), l = g((a) => (h((s) => [...s, a]), () => m(a))), r = g(() => {
382
+ }), l = S((a) => (b((s) => [...s, a]), () => m(a))), r = S(() => {
382
383
  var a;
383
- let s = Ae(o);
384
+ let s = De(o);
384
385
  if (!s) return !1;
385
386
  let u = s.activeElement;
386
- return (a = o.current) != null && a.contains(u) ? !0 : f.some((b) => {
387
- var I, S;
388
- return ((I = s.getElementById(b.buttonId.current)) == null ? void 0 : I.contains(u)) || ((S = s.getElementById(b.panelId.current)) == null ? void 0 : S.contains(u));
387
+ return (a = o.current) != null && a.contains(u) ? !0 : f.some(($) => {
388
+ var T, g;
389
+ return ((T = s.getElementById($.buttonId.current)) == null ? void 0 : T.contains(u)) || ((g = s.getElementById($.panelId.current)) == null ? void 0 : g.contains(u));
389
390
  });
390
- }), y = g((a) => {
391
+ }), h = S((a) => {
391
392
  for (let s of f) s.buttonId.current !== a && s.close();
392
- }), n = G(() => ({ registerPopover: l, unregisterPopover: m, isFocusWithinPopoverGroup: r, closeOthers: y }), [l, m, r, y]), E = G(() => ({}), []), P = e, c = { ref: d };
393
- return $.createElement(Ue, null, $.createElement(Ne.Provider, { value: n }, ue({ ourProps: c, theirProps: P, slot: E, defaultTag: tn, name: "Popover.Group" })));
393
+ }), n = K(() => ({ registerPopover: l, unregisterPopover: m, isFocusWithinPopoverGroup: r, closeOthers: h }), [l, m, r, h]), E = K(() => ({}), []), P = e, c = { ref: d };
394
+ return y.createElement(je, null, y.createElement(Re.Provider, { value: n }, ue({ ourProps: c, theirProps: P, slot: E, defaultTag: nn, name: "Popover.Group" })));
394
395
  }
395
- let rn = V(Zt), ze = V(Jt), on = V(Ye), ln = V(Ye), et = V(en), an = V(nn), un = Object.assign(rn, { Button: ze, Backdrop: ln, Overlay: on, Panel: et, Group: an });
396
- const sn = "_menu_i19t0_3", cn = "_enter_i19t0_28", dn = "_leave_i19t0_42", X = {
397
- menu: sn,
398
- "menu-button": "_menu-button_i19t0_6",
399
- "menu-items": "_menu-items_i19t0_11",
400
- "menu-items-container": "_menu-items-container_i19t0_22",
401
- enter: cn,
402
- "enter-from": "_enter-from_i19t0_32",
403
- "enter-to": "_enter-to_i19t0_37",
404
- leave: dn,
405
- "leave-from": "_leave-from_i19t0_46",
406
- "leave-to": "_leave-to_i19t0_51"
407
- }, wn = 300, _n = ot(
396
+ let on = V(qt), et = V(Qt), ln = V(ze), an = V(ze), tt = V(tn), un = V(rn), sn = Object.assign(on, { Button: et, Backdrop: an, Overlay: ln, Panel: tt, Group: un });
397
+ const cn = "_menu_1o2uo_3", dn = "_enter_1o2uo_34", pn = "_leave_1o2uo_48", G = {
398
+ menu: cn,
399
+ "menu-button": "_menu-button_1o2uo_6",
400
+ "menu-items": "_menu-items_1o2uo_11",
401
+ "menu-items-container": "_menu-items-container_1o2uo_22",
402
+ "close-button": "_close-button_1o2uo_28",
403
+ enter: dn,
404
+ "enter-from": "_enter-from_1o2uo_38",
405
+ "enter-to": "_enter-to_1o2uo_43",
406
+ leave: pn,
407
+ "leave-from": "_leave-from_1o2uo_52",
408
+ "leave-to": "_leave-to_1o2uo_57"
409
+ }, In = 300, Cn = ot(
408
410
  ({
409
411
  children: e,
410
412
  position: t = "bottom end",
411
413
  popoverProps: o,
412
414
  className: d,
413
415
  buttonClassName: f,
414
- panelClassName: h,
416
+ panelClassName: b,
415
417
  menuItemsClassName: m,
416
418
  buttonContent: l,
417
- openOnHover: r = !1,
418
- isOpen: y = !1
419
+ needCloseButton: r,
420
+ openOnHover: h = !1,
421
+ isOpen: n = !1
419
422
  }) => {
420
- const [n, E] = W(y), P = M(null), c = M(null), a = Le(() => {
421
- r && E(!0);
422
- }, [r]), s = Le(
423
- (u) => {
424
- if (r) {
425
- const b = u.relatedTarget;
426
- P.current && !P.current.contains(b) && c.current && !c.current.contains(b) && E(!1);
423
+ const [E, P] = W(n), c = M(null), a = M(null), s = Ae(() => {
424
+ h && P(!0);
425
+ }, [h]), u = Ae(
426
+ ($) => {
427
+ if (h) {
428
+ const T = $.relatedTarget;
429
+ c.current && !c.current.contains(T) && a.current && !a.current.contains(T) && P(!1);
427
430
  }
428
431
  },
429
- [r]
432
+ [h]
430
433
  );
431
434
  return /* @__PURE__ */ ce(
432
- un,
435
+ sn,
433
436
  {
434
437
  as: "div",
435
- className: fe(X.menu, d),
438
+ className: fe(G.menu, d),
436
439
  ...o,
437
- children: ({ open: u, close: b }) => /* @__PURE__ */ tt(nt, { children: [
438
- /* @__PURE__ */ ce(
439
- ze,
440
- {
441
- ref: P,
442
- onMouseEnter: a,
443
- onMouseLeave: s,
444
- className: fe(X["menu-button"], f),
445
- children: l
446
- }
447
- ),
448
- /* @__PURE__ */ ce(
449
- Ht,
450
- {
451
- show: n || u,
452
- as: pe,
453
- enter: X.enter,
454
- enterFrom: X["enter-from"],
455
- enterTo: X["enter-to"],
456
- leave: X.leave,
457
- leaveFrom: X["leave-from"],
458
- leaveTo: X["leave-to"],
459
- children: /* @__PURE__ */ ce(
460
- et,
461
- {
462
- ref: c,
463
- anchor: t,
464
- onMouseEnter: a,
465
- onMouseLeave: s,
466
- className: fe(X["menu-items"], h),
467
- children: /* @__PURE__ */ ce(
468
- "div",
469
- {
470
- className: fe(
471
- X["menu-items-container"],
472
- m
440
+ children: ({ open: $, close: T }) => {
441
+ const g = () => {
442
+ T(), P(!1);
443
+ };
444
+ return /* @__PURE__ */ Le(nt, { children: [
445
+ /* @__PURE__ */ ce(
446
+ et,
447
+ {
448
+ ref: c,
449
+ onMouseEnter: s,
450
+ onMouseLeave: u,
451
+ className: fe(G["menu-button"], f),
452
+ children: l
453
+ }
454
+ ),
455
+ /* @__PURE__ */ ce(
456
+ Gt,
457
+ {
458
+ show: E || $,
459
+ as: pe,
460
+ enter: G.enter,
461
+ enterFrom: G["enter-from"],
462
+ enterTo: G["enter-to"],
463
+ leave: G.leave,
464
+ leaveFrom: G["leave-from"],
465
+ leaveTo: G["leave-to"],
466
+ children: /* @__PURE__ */ Le(
467
+ tt,
468
+ {
469
+ ref: a,
470
+ anchor: t,
471
+ onMouseEnter: s,
472
+ onMouseLeave: u,
473
+ className: fe(G["menu-items"], b),
474
+ children: [
475
+ r && /* @__PURE__ */ ce(
476
+ lt,
477
+ {
478
+ isIconButton: !0,
479
+ iconName: "Close16px",
480
+ onClick: g,
481
+ clear: !0,
482
+ className: G["close-button"]
483
+ }
473
484
  ),
474
- children: typeof e == "function" ? e({ close: b }) : e
475
- }
476
- )
477
- }
478
- )
479
- }
480
- )
481
- ] })
485
+ /* @__PURE__ */ ce(
486
+ "div",
487
+ {
488
+ className: fe(
489
+ G["menu-items-container"],
490
+ m
491
+ ),
492
+ children: typeof e == "function" ? e({ close: g }) : e
493
+ }
494
+ )
495
+ ]
496
+ }
497
+ )
498
+ }
499
+ )
500
+ ] });
501
+ }
482
502
  }
483
503
  );
484
504
  }
485
505
  );
486
506
  export {
487
- wn as ANIMATION_DELAY,
488
- _n as Dropdown
507
+ In as ANIMATION_DELAY,
508
+ Cn as Dropdown
489
509
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.38.41",
4
+ "version": "1.38.42",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {