welcome-ui 10.6.4 → 10.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/Accordion.js +6 -6
  2. package/dist/Button.js +2 -2
  3. package/dist/Checkbox.js +1 -1
  4. package/dist/{CustomPopper-C1wIDHbM.js → CustomPopper-DWdMQOgg.js} +1 -1
  5. package/dist/D5lwkpmX-BTxFdaqc.js +1061 -0
  6. package/dist/DatePicker.js +2 -2
  7. package/dist/DateTimePicker.js +3 -3
  8. package/dist/DjvJNLSl-CB2sOBlX.js +88 -0
  9. package/dist/Drawer.js +4 -4
  10. package/dist/DropdownMenu.js +811 -925
  11. package/dist/Modal.js +14 -14
  12. package/dist/Popover.js +25 -24
  13. package/dist/Radio.js +1 -1
  14. package/dist/RadioGroup.js +41 -46
  15. package/dist/RadioTab.js +1 -1
  16. package/dist/Search.css +1 -1
  17. package/dist/Search.js +105 -106
  18. package/dist/Select.css +1 -1
  19. package/dist/Select.js +257 -251
  20. package/dist/Tabs.js +192 -198
  21. package/dist/TimePicker.js +4 -4
  22. package/dist/Toggle.js +1 -1
  23. package/dist/Tooltip.css +1 -1
  24. package/dist/Tooltip.js +150 -185
  25. package/dist/WelcomeLoader.js +86 -86
  26. package/dist/Window.js +5 -5
  27. package/dist/button-BmXyuOyT.js +24 -0
  28. package/dist/combobox-context-COdkPD-I.js +14 -0
  29. package/dist/command-JKE9Az0e.js +78 -0
  30. package/dist/composite-BOnUaIWf.js +198 -0
  31. package/dist/composite-item-CzuZunbi.js +763 -0
  32. package/dist/composite-store-BbsZpdXc.js +21 -0
  33. package/dist/dialog-RAMLmAdq.js +1222 -0
  34. package/dist/dialog-disclosure-xHQQLmS6.js +25 -0
  35. package/dist/dialog-dismiss-DVxKs13g.js +48 -0
  36. package/dist/disclosure-BQqv9Q8p.js +47 -0
  37. package/dist/disclosure-store-KfU9xwem.js +168 -0
  38. package/dist/hovercard-anchor-CgWES4cl.js +19 -0
  39. package/dist/hovercard-store-DjVhDVte.js +569 -0
  40. package/dist/index-B0vSTNCB.js +609 -0
  41. package/dist/popover-context-B2YQ_e3N.js +12 -0
  42. package/dist/popover-disclosure-a-bqp8Gt.js +183 -0
  43. package/dist/radio-J8ogFsWS.js +77 -0
  44. package/dist/tab-panel-DMICXMJc.js +187 -0
  45. package/dist/types/components/Accordion/index.d.ts +1 -1
  46. package/dist/types/components/Alert/components/Title.d.ts +1 -1
  47. package/dist/types/components/Alert/index.d.ts +1 -1
  48. package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +1 -1
  49. package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +1 -1
  50. package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +1 -1
  51. package/dist/types/components/Drawer/AssetDrawer/IconBlock.d.ts +1 -1
  52. package/dist/types/components/Drawer/components/Close.d.ts +1 -1
  53. package/dist/types/components/Drawer/index.d.ts +6 -6
  54. package/dist/types/components/FileDrop/components/FilePreview.d.ts +1 -1
  55. package/dist/types/components/FileDrop/components/Message.d.ts +1 -1
  56. package/dist/types/components/Icon/Sprite.d.ts +1 -1
  57. package/dist/types/components/Loader/index.d.ts +1 -1
  58. package/dist/types/components/Modal/Assets/AssetContent.d.ts +1 -1
  59. package/dist/types/components/Modal/Assets/AssetTitle.d.ts +1 -1
  60. package/dist/types/components/Modal/Assets/CloseButton.d.ts +1 -1
  61. package/dist/types/components/Modal/Assets/Iframe.d.ts +1 -1
  62. package/dist/types/components/Modal/Assets/index.d.ts +3 -3
  63. package/dist/types/components/Modal/components/Footer.d.ts +2 -2
  64. package/dist/types/components/Modal/index.d.ts +9 -9
  65. package/dist/types/components/PasswordInput/ToggleButton.d.ts +1 -1
  66. package/dist/types/components/Popover/Arrow.d.ts +1 -1
  67. package/dist/types/components/Popover/ContentWrapper.d.ts +1 -1
  68. package/dist/types/components/RadioGroup/index.d.ts +1 -1
  69. package/dist/types/components/Stepper/index.d.ts +2 -2
  70. package/dist/types/components/Stepper/utils.d.ts +1 -1
  71. package/dist/types/components/StickyNote/components/Button.d.ts +1 -1
  72. package/dist/types/components/StickyNote/components/Title.d.ts +1 -1
  73. package/dist/types/components/StickyNote/index.d.ts +2 -2
  74. package/dist/types/components/Swiper/components/SwiperNextButton.d.ts +1 -1
  75. package/dist/types/components/Swiper/components/SwiperPrevButton.d.ts +1 -1
  76. package/dist/types/components/Swiper/components/SwiperSlides.d.ts +1 -1
  77. package/dist/types/components/Swiper/index.d.ts +4 -4
  78. package/dist/types/components/Table/index.d.ts +5 -5
  79. package/dist/types/components/Tabs/utils.d.ts +1 -1
  80. package/dist/types/components/Toast/index.d.ts +2 -2
  81. package/dist/types/components/Window/components/Header.d.ts +4 -4
  82. package/dist/types/components/Window/index.d.ts +4 -4
  83. package/package.json +2 -2
  84. package/dist/5TKKKQCL-rs260p95.js +0 -80
  85. package/dist/7PRQYBBV-D9IY4qtU.js +0 -14
  86. package/dist/APVORPDK-i7Z_eBMP.js +0 -25
  87. package/dist/CVCFNOHX-Ck0bUDvo.js +0 -20
  88. package/dist/ECBEZ4YM-o09xUuV6.js +0 -600
  89. package/dist/HMKTUWOU-NkVXWCyR.js +0 -25
  90. package/dist/I7KWAPMF-DQWZpGyL.js +0 -86
  91. package/dist/IQYAUKXT-Cltvp3KN.js +0 -303
  92. package/dist/JMU4N4M5-DnfyqGdJ.js +0 -15
  93. package/dist/NDVACHQI-WTOpOfgG.js +0 -37
  94. package/dist/OCCHVUS4-BJVLPRH8.js +0 -48
  95. package/dist/PZ3OL7I2-Cfim3UGe.js +0 -61
  96. package/dist/Q5W46E73-5xQblshY.js +0 -346
  97. package/dist/RFRKSHIZ-C_FLl4qI.js +0 -147
  98. package/dist/U6HHPQDW-CzxyP5H7.js +0 -856
  99. package/dist/WLZ6H5FH-CuTcX7sR.js +0 -183
  100. package/dist/WZWDIE3S-CGqoM1Fy.js +0 -290
  101. package/dist/Z32PU2LQ-DMjfxuT9.js +0 -945
  102. package/dist/ZMWF7ASR-Jc8y_k3t.js +0 -166
  103. package/dist/tab-panel-Cc3MfOBM.js +0 -212
@@ -1,496 +1,447 @@
1
1
  "use client";
2
2
  import './DropdownMenu.css';
3
- import { jsx as l, jsxs as G } from "react/jsx-runtime";
4
- import { t as Te, c as De, u as Le, a as Oe, b as A, m as Mt, o as Ct, p as wt, s as Pe, d as Ne } from "./Q5W46E73-5xQblshY.js";
5
- import { H as xt, a as St, u as yt, b as pt, c as kt, d as _t } from "./ECBEZ4YM-o09xUuV6.js";
6
- import { u as fe, C as Fe, a as $e, f as It, b as Pt } from "./WZWDIE3S-CGqoM1Fy.js";
7
- import { c as w, f as x, a as S, i as L, b as Re, u as O, g as Ge, s as Nt, r as Z, d as Et, e as At, n as Tt, h as te, j as he, k as Dt, l as Lt, m as se, o as K, p as Ot, q as ne, t as Ft, v as $t, w as re, x as R, y as He, z as Rt, A as Gt, B as Ht, C as Ve, D as Vt, E as zt, F as Bt, G as ze, H as Kt, I as jt } from "./U6HHPQDW-CzxyP5H7.js";
8
- import { createContext as ve, useRef as be, useState as ge, useContext as Me, useCallback as Ut, useEffect as j, createRef as Wt, useMemo as qt, forwardRef as P, createElement as Zt } from "react";
9
- import { i as Jt } from "./WLZ6H5FH-CuTcX7sR.js";
10
- import { u as Qt } from "./ZMWF7ASR-Jc8y_k3t.js";
11
- import { c as Xt, R as Yt } from "./Z32PU2LQ-DMjfxuT9.js";
12
- import { c as H } from "./index-B6iGEm-i.js";
13
- import { f as U } from "./forwardRefWithAs-8eP3ZN15.js";
14
- import { u as en, a as tn } from "./RFRKSHIZ-C_FLl4qI.js";
15
- import { C as nn, u as rn } from "./I7KWAPMF-DQWZpGyL.js";
16
- import { u as on } from "./5TKKKQCL-rs260p95.js";
17
- import { c as un, u as an } from "./IQYAUKXT-Cltvp3KN.js";
18
- import { u as cn } from "./CVCFNOHX-Ck0bUDvo.js";
19
- import { Checkbox as sn } from "./Checkbox.js";
20
- import { Radio as ln } from "./Radio.js";
21
- import { Toggle as dn } from "./Toggle.js";
22
- import { Icon as Be } from "./Icon.js";
3
+ import { jsx as m, jsxs as G } from "react/jsx-runtime";
4
+ import { c as ht, R as bt } from "./dialog-RAMLmAdq.js";
5
+ import { H as gt, a as Ct, g as Ee, u as Mt, b as wt, c as xt, d as St } from "./hovercard-store-DjVhDVte.js";
6
+ import { u as le, C as Ne, a as Te, f as yt, b as kt, c as vt } from "./composite-item-CzuZunbi.js";
7
+ import { c as y, f as k, a as v, i as D, b as Ie, u as L, r as _t, d as Et, e as Nt, n as Tt, g as U, h as me, j as It, k as At, l as ie, m as z, o as Pt, p as Y, q as Ae, s as pt, t as Dt, v as ee, w as O, x as Pe, y as Lt, z as $t, A as Ot, B as pe, C as Gt, D as Ft, E as Ht, F as Rt, G as Vt, H as De, I as Bt, J as zt } from "./D5lwkpmX-BTxFdaqc.js";
8
+ import { createContext as de, useState as fe, useContext as te, useCallback as Wt, useEffect as W, useRef as Le, createRef as jt, useMemo as Kt, forwardRef as N, createElement as Ut } from "react";
9
+ import { u as qt } from "./composite-BOnUaIWf.js";
10
+ import { i as Zt } from "./disclosure-store-KfU9xwem.js";
11
+ import { u as S, t as $e, c as Oe, a as Ge, b as Fe, m as Jt, o as Qt, p as Xt, s as Se, d as ye } from "./index-B0vSTNCB.js";
12
+ import { u as Yt } from "./combobox-context-COdkPD-I.js";
13
+ import { u as en } from "./composite-store-BbsZpdXc.js";
14
+ import { c as F } from "./index-B6iGEm-i.js";
15
+ import { f as j } from "./forwardRefWithAs-8eP3ZN15.js";
16
+ import { u as tn, a as nn } from "./popover-disclosure-a-bqp8Gt.js";
17
+ import { C as rn, u as on, g as un } from "./DjvJNLSl-CB2sOBlX.js";
18
+ import { u as an } from "./radio-J8ogFsWS.js";
19
+ import { Checkbox as cn } from "./Checkbox.js";
20
+ import { Radio as sn } from "./Radio.js";
21
+ import { Toggle as ln } from "./Toggle.js";
22
+ import { Icon as He } from "./Icon.js";
23
23
  import { InputText as mn } from "./InputText.js";
24
- var fn = "hr", Ke = w(
25
- function({ orientation: e = "horizontal", ...t }) {
26
- return t = {
27
- role: "separator",
28
- "aria-orientation": e,
29
- ...t
30
- }, t;
31
- }
32
- );
33
- x(function(e) {
34
- const t = Ke(e);
35
- return S(fn, t);
24
+ import { w as dn } from "./command-JKE9Az0e.js";
25
+ const fn = "hr", Re = y(function({ orientation: e = "horizontal", ...t }) {
26
+ return t = {
27
+ role: "separator",
28
+ "aria-orientation": e,
29
+ ...t
30
+ }, t;
36
31
  });
37
- var hn = "hr", je = w(function({ store: e, ...t }) {
38
- const r = fe();
39
- e = e || r, L(
40
- e,
41
- process.env.NODE_ENV !== "production" && "CompositeSeparator must be wrapped in a Composite component."
42
- );
43
- const o = e.useState(
44
- (u) => u.orientation === "horizontal" ? "vertical" : "horizontal"
45
- );
46
- return t = Ke({ ...t, orientation: o }), t;
32
+ k(function(e) {
33
+ const t = Re(e);
34
+ return v(fn, t);
47
35
  });
48
- x(function(e) {
49
- const t = je(e);
50
- return S(hn, t);
36
+ const hn = "hr", Ve = y(function({ store: e, orientation: t, ...r }) {
37
+ const o = le();
38
+ e = e || o, D(e, process.env.NODE_ENV !== "production" && "CompositeSeparator must be wrapped in a Composite component.");
39
+ const i = S(e, ["orientation"], (u) => t ?? (u.orientation === "horizontal" ? "vertical" : "horizontal"));
40
+ return r = Re({
41
+ ...r,
42
+ orientation: i
43
+ }), r;
51
44
  });
52
- var Ue = Re(
53
- [$e],
54
- [Fe]
55
- ), vn = Ue.useContext, bn = Ue.useScopedContext;
56
- ve(
57
- void 0
58
- );
59
- var gn = "div", D = "";
60
- function ae() {
61
- D = "";
62
- }
45
+ k(function(e) {
46
+ const t = Ve(e);
47
+ return v(hn, t);
48
+ });
49
+ const Be = Ie([Te], [Ne]), bn = Be.useContext, gn = Be.useScopedContext, Cn = "div", ke = /* @__PURE__ */ new WeakMap();
63
50
  function Mn(n) {
64
- const e = n.target;
65
- return e && Et(e) ? !1 : n.key === " " && D.length ? !0 : n.key.length === 1 && !n.ctrlKey && !n.altKey && !n.metaKey && /^[\p{Letter}\p{Number}]$/u.test(n.key);
51
+ let e = ke.get(n);
52
+ return e || (e = {
53
+ chars: "",
54
+ cleanupTimeout: 0
55
+ }, ke.set(n, e)), e;
56
+ }
57
+ function J(n) {
58
+ n.chars = "";
66
59
  }
67
- function Cn(n, e) {
68
- if (At(n)) return !0;
60
+ function wn(n, e) {
69
61
  const t = n.target;
70
- return t ? e.some((o) => o.element === t) : !1;
62
+ return t && Et(t) ? !1 : n.key === " " && e.chars.length ? !0 : n.key.length === 1 && !n.ctrlKey && !n.altKey && !n.metaKey && /^[\p{Letter}\p{Number}]$/u.test(n.key);
71
63
  }
72
- function wn(n) {
64
+ function xn(n, e) {
65
+ if (Nt(n)) return !0;
66
+ const t = n.target;
67
+ return t ? e.some((r) => r.element === t) : !1;
68
+ }
69
+ function Sn(n) {
73
70
  return n.filter((e) => !e.disabled);
74
71
  }
75
- function Y(n, e) {
76
- var t;
77
- const r = ((t = n.element) == null ? void 0 : t.textContent) || n.children || // The composite item object itself doesn't include a value property, but
78
- // other components like Select do. Since CompositeTypeahead is a generic
79
- // component that can be used with those as well, we also consider the value
80
- // property as a fallback for the typeahead text content.
81
- "value" in n && n.value;
82
- return r ? Tt(r).trim().toLowerCase().startsWith(e.toLowerCase()) : !1;
72
+ function Q(n, e) {
73
+ var r;
74
+ const t = n.typeaheadText ?? (((r = n.element) == null ? void 0 : r.textContent) || n.children || "value" in n && n.value);
75
+ return t ? Tt(t).trim().toLowerCase().startsWith(e.toLowerCase()) : !1;
83
76
  }
84
- function xn(n, e, t) {
85
- if (!t) return n;
86
- const r = n.find((o) => o.id === t);
87
- return !r || !Y(r, e) || D !== e && Y(r, D) ? n : (D = e, It(
88
- n.filter((o) => Y(o, D)),
89
- t
90
- ).filter((o) => o.id !== t));
77
+ function yn({ activeId: n, char: e, items: t, typeaheadState: r }) {
78
+ if (!n) return t;
79
+ const o = t.find((u) => u.id === n);
80
+ if (!o || !Q(o, e)) return t;
81
+ const { chars: i } = r;
82
+ return i !== e && Q(o, i) ? t : (r.chars = e, yt(t.filter((u) => Q(u, e)), n).filter((u) => u.id !== n));
91
83
  }
92
- var Ce = w(function({ store: e, typeahead: t = !0, ...r }) {
93
- const o = fe();
94
- e = e || o, L(
95
- e,
96
- process.env.NODE_ENV !== "production" && "CompositeTypeahead must be a Composite component"
97
- );
98
- const u = r.onKeyDownCapture, c = be(0), i = O((s) => {
99
- if (u == null || u(s), s.defaultPrevented || !t || !e) return;
100
- if (!Mn(s))
101
- return ae();
102
- const { renderedItems: f, items: d, activeId: a, id: g } = e.getState();
103
- let m = wn(
104
- d.length > f.length ? d : f
105
- );
106
- const h = Ge(s.currentTarget), y = `[data-offscreen-id="${g}"]`, v = h.querySelectorAll(y);
107
- for (const C of v) {
108
- const T = C.ariaDisabled === "true" || "disabled" in C && !!C.disabled;
109
- m.push({ id: C.id, element: C, disabled: T });
110
- }
111
- if (v.length && (m = Nt(m, (C) => C.element)), !Cn(s, m)) return ae();
112
- s.preventDefault(), window.clearTimeout(c.current), c.current = window.setTimeout(() => {
113
- D = "";
84
+ const he = y(function({ store: e, typeahead: t = !0, ...r }) {
85
+ const o = le();
86
+ e = e || o, D(e, process.env.NODE_ENV !== "production" && "CompositeTypeahead must be a Composite component");
87
+ const i = r.onKeyDownCapture, u = L((s) => {
88
+ if (i == null || i(s), s.defaultPrevented || !t || !e) return;
89
+ const a = Mn(e);
90
+ if (!wn(s, a)) return J(a);
91
+ const { renderedItems: b, items: f, activeId: c } = e.getState();
92
+ let d = Sn(f.length > b.length ? f : b);
93
+ if (!xn(s, d)) return J(a);
94
+ s.preventDefault(), window.clearTimeout(a.cleanupTimeout), a.cleanupTimeout = window.setTimeout(() => {
95
+ J(a);
114
96
  }, 500);
115
- const p = s.key.toLowerCase();
116
- D += p, m = xn(m, p, a);
117
- const N = m.find((C) => Y(C, D));
118
- N ? e.move(N.id) : ae();
97
+ const g = s.key.toLowerCase();
98
+ a.chars += g, d = yn({
99
+ activeId: c,
100
+ char: g,
101
+ items: d,
102
+ typeaheadState: a
103
+ });
104
+ const h = d.find((M) => Q(M, a.chars));
105
+ h ? e.move(h.id) : J(a);
119
106
  });
120
107
  return r = {
121
108
  ...r,
122
- onKeyDownCapture: i
123
- }, Z(r);
109
+ onKeyDownCapture: u
110
+ }, _t(r);
124
111
  });
125
- x(function(e) {
126
- const t = Ce(e);
127
- return S(gn, t);
112
+ k(function(e) {
113
+ const t = he(e);
114
+ return v(Cn, t);
128
115
  });
129
- var We = ve(void 0), Sn = "div", qe = w(
130
- function(e) {
131
- const [t, r] = ge();
132
- return e = te(
133
- e,
134
- (o) => /* @__PURE__ */ l(We.Provider, { value: r, children: o }),
135
- []
136
- ), e = {
137
- role: "group",
138
- "aria-labelledby": t,
139
- ...e
140
- }, Z(e);
141
- }
142
- );
143
- x(function(e) {
144
- const t = qe(e);
145
- return S(Sn, t);
116
+ const ze = de(void 0), kn = "div", We = y(function(e) {
117
+ const [t, r] = fe();
118
+ return e = U(e, (o) => /* @__PURE__ */ m(ze.Provider, {
119
+ value: r,
120
+ children: o
121
+ }), []), e = {
122
+ role: "group",
123
+ "aria-labelledby": e["aria-label"] != null ? void 0 : t,
124
+ ...e
125
+ }, e;
146
126
  });
147
- var yn = "div", Ze = w(
148
- function({ store: e, ...t }) {
149
- return t = qe(t), t;
150
- }
151
- );
152
- x(function(e) {
153
- const t = Ze(e);
154
- return S(yn, t);
127
+ k(function(e) {
128
+ const t = We(e);
129
+ return v(kn, t);
155
130
  });
156
- var pn = "div", Je = w(
157
- function(e) {
158
- const t = Me(We), r = he(e.id);
159
- return Dt(() => (t == null || t(r), () => t == null ? void 0 : t(void 0)), [t, r]), e = {
160
- id: r,
161
- "aria-hidden": !0,
162
- ...e
163
- }, Z(e);
164
- }
165
- );
166
- x(function(e) {
167
- const t = Je(e);
168
- return S(pn, t);
131
+ const vn = "div", je = y(function({ store: e, ...t }) {
132
+ return t = We(t), t;
133
+ });
134
+ k(function(e) {
135
+ const t = je(e);
136
+ return v(vn, t);
169
137
  });
170
- var kn = "div", Qe = w(function({ store: e, ...t }) {
171
- return t = Je(t), t;
138
+ const _n = "div", Ke = y(function(e) {
139
+ const t = te(ze), r = me(e.id);
140
+ return It(() => (t == null || t(r), () => t == null ? void 0 : t(void 0)), [t, r]), e = {
141
+ "aria-hidden": !0,
142
+ ...e,
143
+ id: r
144
+ }, e;
145
+ });
146
+ k(function(e) {
147
+ const t = Ke(e);
148
+ return v(_n, t);
172
149
  });
173
- x(function(e) {
174
- const t = Qe(e);
175
- return S(kn, t);
150
+ const En = "div", Ue = y(function({ store: e, ...t }) {
151
+ return t = Ke(t), t;
176
152
  });
177
- var _n = "div";
178
- function Xe(n) {
153
+ k(function(e) {
154
+ const t = Ue(e);
155
+ return v(En, t);
156
+ });
157
+ const Nn = "div";
158
+ function Tn(n) {
179
159
  const e = n.relatedTarget;
180
- return (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE ? e : null;
160
+ return Ae(e) ? pt(n.currentTarget, e) : !1;
181
161
  }
162
+ const ae = Symbol("composite-hover");
182
163
  function In(n) {
183
- const e = Xe(n);
184
- return e ? Ft(n.currentTarget, e) : !1;
185
- }
186
- var le = Symbol("composite-hover");
187
- function Pn(n) {
188
- let e = Xe(n);
189
- if (!e) return !1;
164
+ const { relatedTarget: e } = n;
165
+ if (!Ae(e)) return !1;
166
+ let t = e;
190
167
  do {
191
- if ($t(e, le) && e[le]) return !0;
192
- e = e.parentElement;
193
- } while (e);
168
+ if (Dt(t, ae) && t[ae]) return !0;
169
+ t = t.parentElement;
170
+ } while (t);
194
171
  return !1;
195
172
  }
196
- var Ye = w(
197
- function({
198
- store: e,
199
- focusOnHover: t = !0,
200
- blurOnHoverEnd: r = !!t,
201
- ...o
202
- }) {
203
- const u = fe();
204
- e = e || u, L(
205
- e,
206
- process.env.NODE_ENV !== "production" && "CompositeHover must be wrapped in a Composite component."
207
- );
208
- const c = Lt(), i = o.onMouseMove, s = se(t), f = O((h) => {
209
- if (i == null || i(h), !h.defaultPrevented && c() && s(h)) {
210
- if (!K(h.currentTarget)) {
211
- const y = e == null ? void 0 : e.getState().baseElement;
212
- y && !Ot(y) && y.focus();
213
- }
214
- e == null || e.setActiveId(h.currentTarget.id);
173
+ const qe = y(function({ store: e, focusOnHover: t = !0, blurOnHoverEnd: r = !!t, ...o }) {
174
+ const i = le();
175
+ e = e || i, D(e, process.env.NODE_ENV !== "production" && "CompositeHover must be wrapped in a Composite component.");
176
+ const u = At(), s = o.onMouseMove, a = ie(t), b = L((h) => {
177
+ if (s == null || s(h), !h.defaultPrevented && u() && a(h)) {
178
+ if (!z(h.currentTarget)) {
179
+ const M = e == null ? void 0 : e.getState().compositeElement;
180
+ M && !Pt(M) && M.focus({ preventScroll: !0 });
215
181
  }
216
- }), d = o.onMouseLeave, a = se(r), g = O((h) => {
217
- var y;
218
- d == null || d(h), !h.defaultPrevented && c() && (In(h) || Pn(h) || s(h) && a(h) && (e == null || e.setActiveId(null), (y = e == null ? void 0 : e.getState().baseElement) == null || y.focus()));
219
- }), m = Ut((h) => {
220
- h && (h[le] = !0);
221
- }, []);
222
- return o = {
223
- ...o,
224
- ref: ne(m, o.ref),
225
- onMouseMove: f,
226
- onMouseLeave: g
227
- }, Z(o);
228
- }
229
- );
230
- re(
231
- x(function(e) {
232
- const t = Ye(e);
233
- return S(_n, t);
234
- })
235
- );
236
- var Nn = "span", En = /* @__PURE__ */ l(
237
- "svg",
238
- {
239
- display: "block",
240
- fill: "none",
241
- stroke: "currentColor",
242
- strokeLinecap: "round",
243
- strokeLinejoin: "round",
244
- strokeWidth: 1.5,
245
- viewBox: "0 0 16 16",
246
- height: "1em",
247
- width: "1em",
248
- children: /* @__PURE__ */ l("polyline", { points: "4,8 7,12 12,4" })
249
- }
250
- );
251
- function An(n) {
252
- return n.checked ? n.children || En : typeof n.children == "function" ? n.children : null;
182
+ e == null || e.setActiveId(h.currentTarget.id);
183
+ }
184
+ }), f = o.onMouseLeave, c = ie(r), d = L((h) => {
185
+ var M;
186
+ f == null || f(h), !h.defaultPrevented && u() && (Tn(h) || In(h) || a(h) && c(h) && (e == null || e.setActiveId(null), (M = e == null ? void 0 : e.getState().compositeElement) == null || M.focus({ preventScroll: !0 })));
187
+ }), g = Wt((h) => {
188
+ h && (h[ae] = !0);
189
+ }, []);
190
+ return o = {
191
+ ...o,
192
+ ref: Y(g, o.ref),
193
+ onMouseMove: b,
194
+ onMouseLeave: d
195
+ }, o;
196
+ });
197
+ ee(k(function(e) {
198
+ const t = qe(e);
199
+ return v(Nn, t);
200
+ }));
201
+ const An = "span", Pn = /* @__PURE__ */ m("svg", {
202
+ display: "block",
203
+ fill: "none",
204
+ stroke: "currentColor",
205
+ strokeLinecap: "round",
206
+ strokeLinejoin: "round",
207
+ strokeWidth: 1.5,
208
+ viewBox: "0 0 16 16",
209
+ height: "1em",
210
+ width: "1em",
211
+ children: /* @__PURE__ */ m("polyline", { points: "4,8 7,12 12,4" })
212
+ });
213
+ function pn(n) {
214
+ return n.checked ? n.children || Pn : null;
253
215
  }
254
- var et = w(
255
- function({ store: e, checked: t, ...r }) {
256
- const o = Me(nn);
257
- t = t ?? o;
258
- const u = An({ checked: t, children: r.children });
259
- return r = {
260
- "aria-hidden": !0,
261
- ...r,
262
- children: u,
263
- style: {
264
- width: "1em",
265
- height: "1em",
266
- pointerEvents: "none",
267
- ...r.style
268
- }
269
- }, Z(r);
270
- }
271
- );
272
- x(function(e) {
273
- const t = et(e);
274
- return S(Nn, t);
216
+ const Ze = y(function({ store: e, checked: t, ...r }) {
217
+ const o = te(rn);
218
+ t = t ?? o;
219
+ const i = pn({
220
+ checked: t,
221
+ children: r.children
222
+ });
223
+ return r = {
224
+ "aria-hidden": !0,
225
+ ...r,
226
+ children: i,
227
+ style: {
228
+ width: "1em",
229
+ height: "1em",
230
+ pointerEvents: "none",
231
+ ...r.style
232
+ }
233
+ }, r;
275
234
  });
276
- function Tn(n = {}) {
277
- var e;
278
- Te(n, n.store);
279
- const t = (e = n.store) == null ? void 0 : e.getState(), r = {
280
- value: R(
281
- n.value,
282
- t == null ? void 0 : t.value,
283
- n.defaultValue,
284
- !1
285
- )
286
- }, o = De(r, n.store);
235
+ k(function(e) {
236
+ const t = Ze(e);
237
+ return v(An, t);
238
+ });
239
+ function Dn(n = {}) {
240
+ var o;
241
+ $e(n, n.store);
242
+ const e = (o = n.store) == null ? void 0 : o.getState(), t = { value: O(n.value, e == null ? void 0 : e.value, n.defaultValue, !1) }, r = Oe(t, n.store);
287
243
  return {
288
- ...o,
289
- setValue: (u) => o.setState("value", u)
244
+ ...r,
245
+ setValue: (i) => r.setState("value", i)
290
246
  };
291
247
  }
292
- function Dn(n, e, t) {
293
- return He(e, [t.store]), Oe(n, t, "value", "setValue"), n;
248
+ function Ln(n, e, t) {
249
+ return Pe(e, [t.store, e]), Fe(n, t, "value", "setValue"), n;
294
250
  }
295
- function Ln(n = {}) {
296
- const [e, t] = Le(Tn, n);
297
- return Dn(e, t, n);
251
+ function $n(n = {}) {
252
+ const [e, t] = Ge(Dn, n);
253
+ return Ln(e, t, n);
298
254
  }
299
- var J = Re(
300
- [$e, St],
301
- [Fe, xt]
302
- ), oe = J.useContext, we = J.useScopedContext, ue = J.useProviderContext, tt = J.ContextProvider, On = J.ScopedContextProvider, nt = ve(
303
- void 0
304
- ), Fn = "div";
305
- function $n({ store: n, ...e }) {
306
- const [t, r] = ge(void 0), o = e["aria-label"], u = A(n, "disclosureElement"), c = A(n, "contentElement");
307
- return j(() => {
308
- const i = u;
309
- if (!i) return;
310
- const s = c;
255
+ const q = Ie([Te, Ct], [Ne, gt]), ne = q.useContext, be = q.useScopedContext, re = q.useProviderContext, Je = q.ContextProvider, On = q.ScopedContextProvider, Qe = de(void 0), Xe = de(!1), Gn = "div";
256
+ function Fn({ store: n, ...e }) {
257
+ const [t, r] = fe(void 0), o = e["aria-label"], i = S(n, "disclosureElement"), u = S(n, "contentElement");
258
+ return W(() => {
259
+ const s = i;
311
260
  if (!s) return;
312
- o || s.hasAttribute("aria-label") ? r(void 0) : i.id && r(i.id);
313
- }, [o, u, c]), t;
261
+ const a = u;
262
+ a && (o || a.hasAttribute("aria-label") ? r(void 0) : s.id && r(s.id));
263
+ }, [
264
+ o,
265
+ i,
266
+ u
267
+ ]), t;
314
268
  }
315
- var rt = w(
316
- function({ store: e, alwaysVisible: t, composite: r, ...o }) {
317
- const u = ue();
318
- e = e || u, L(
319
- e,
320
- process.env.NODE_ENV !== "production" && "MenuList must receive a `store` prop or be wrapped in a MenuProvider component."
321
- );
322
- const c = e.parent, i = e.menubar, s = !!c, f = he(o.id), d = o.onKeyDown, a = e.useState(
323
- (M) => M.placement.split("-")[0]
324
- ), g = e.useState(
325
- (M) => M.orientation === "both" ? void 0 : M.orientation
326
- ), m = g !== "vertical", h = A(
327
- i,
328
- (M) => !!M && M.orientation !== "vertical"
329
- ), y = O((M) => {
330
- if (d == null || d(M), !M.defaultPrevented) {
331
- if (s || i && !m) {
332
- const E = {
333
- ArrowRight: () => a === "left" && !m,
334
- ArrowLeft: () => a === "right" && !m,
335
- ArrowUp: () => a === "bottom" && m,
336
- ArrowDown: () => a === "top" && m
337
- }[M.key];
338
- if (E != null && E())
339
- return M.stopPropagation(), M.preventDefault(), e == null ? void 0 : e.hide();
340
- }
341
- if (i) {
342
- const E = {
343
- ArrowRight: () => {
344
- if (h)
345
- return i.next();
346
- },
347
- ArrowLeft: () => {
348
- if (h)
349
- return i.previous();
350
- },
351
- ArrowDown: () => {
352
- if (!h)
353
- return i.next();
354
- },
355
- ArrowUp: () => {
356
- if (!h)
357
- return i.previous();
358
- }
359
- }[M.key], B = E == null ? void 0 : E();
360
- B !== void 0 && (M.stopPropagation(), M.preventDefault(), i.move(B));
361
- }
269
+ const Ye = y(function({ store: e, alwaysVisible: t, composite: r, ...o }) {
270
+ const i = re();
271
+ e = e || i, D(e, process.env.NODE_ENV !== "production" && "MenuList must receive a `store` prop or be wrapped in a MenuProvider component.");
272
+ const u = e.parent, s = e.menubar, a = !!u, b = me(o.id), f = o.onKeyDown, c = S(e, ["placement"], (C) => Ee(C.placement)), d = S(e, ["orientation"], (C) => C.orientation === "both" ? void 0 : C.orientation), g = d !== "vertical", h = S(s, ["orientation"], (C) => !!C && C.orientation !== "vertical"), M = L((C) => {
273
+ if (f == null || f(C), !C.defaultPrevented) {
274
+ if (a || s && !g) {
275
+ const I = {
276
+ ArrowRight: () => c === "left" && !g,
277
+ ArrowLeft: () => c === "right" && !g,
278
+ ArrowUp: () => c === "bottom" && g,
279
+ ArrowDown: () => c === "top" && g
280
+ }[C.key];
281
+ if (I != null && I())
282
+ return C.stopPropagation(), C.preventDefault(), e == null ? void 0 : e.hide();
362
283
  }
363
- });
364
- o = te(
365
- o,
366
- (M) => /* @__PURE__ */ l(On, { value: e, children: M }),
367
- [e]
368
- );
369
- const v = $n({ store: e, ...o }), p = e.useState("mounted"), N = Jt(p, o.hidden, t), C = N ? { ...o.style, display: "none" } : o.style;
370
- o = {
371
- id: f,
372
- "aria-labelledby": v,
373
- hidden: N,
374
- ...o,
375
- ref: ne(f ? e.setContentElement : null, o.ref),
376
- style: C,
377
- onKeyDown: y
378
- };
379
- const T = !!e.combobox;
380
- return r = r ?? !T, r && (o = {
381
- role: "menu",
382
- "aria-orientation": g,
383
- ...o
384
- }), o = Qt({ store: e, composite: r, ...o }), o = Ce({ store: e, typeahead: !T, ...o }), o;
385
- }
386
- );
387
- x(function(e) {
388
- const t = rt(e);
389
- return S(Fn, t);
284
+ if (s) {
285
+ const I = {
286
+ ArrowRight: () => {
287
+ if (h)
288
+ return s.next();
289
+ },
290
+ ArrowLeft: () => {
291
+ if (h)
292
+ return s.previous();
293
+ },
294
+ ArrowDown: () => {
295
+ if (!h)
296
+ return s.next();
297
+ },
298
+ ArrowUp: () => {
299
+ if (!h)
300
+ return s.previous();
301
+ }
302
+ }[C.key], V = I == null ? void 0 : I();
303
+ V !== void 0 && (C.stopPropagation(), C.preventDefault(), s.move(V));
304
+ }
305
+ }
306
+ });
307
+ o = U(o, (C) => /* @__PURE__ */ m(On, {
308
+ value: e,
309
+ children: C
310
+ }), [e]);
311
+ const w = Fn({
312
+ store: e,
313
+ ...o
314
+ }), A = S(e, "mounted"), T = Zt(A, o.hidden, t), p = T ? {
315
+ ...o.style,
316
+ display: "none"
317
+ } : o.style;
318
+ o = U(o, (C) => /* @__PURE__ */ m(Xe.Provider, {
319
+ value: T,
320
+ children: C
321
+ }), [T]), o = {
322
+ "aria-labelledby": w,
323
+ hidden: T,
324
+ ...o,
325
+ id: b,
326
+ ref: Y(b ? e.setContentElement : null, o.ref),
327
+ style: p,
328
+ onKeyDown: M
329
+ };
330
+ const P = !!e.combobox;
331
+ return r = r ?? !P, r && (o = {
332
+ role: "menu",
333
+ "aria-orientation": d,
334
+ ...o
335
+ }), o = qt({
336
+ store: e,
337
+ composite: r,
338
+ ...o
339
+ }), o = he({
340
+ store: e,
341
+ typeahead: !P,
342
+ ...o
343
+ }), o;
390
344
  });
391
- var Rn = "div", Gn = w(function({
392
- store: e,
393
- modal: t = !1,
394
- portal: r = !!t,
395
- hideOnEscape: o = !0,
396
- autoFocusOnShow: u = !0,
397
- hideOnHoverOutside: c,
398
- alwaysVisible: i,
399
- ...s
400
- }) {
401
- const f = ue();
402
- e = e || f, L(
403
- e,
404
- process.env.NODE_ENV !== "production" && "Menu must receive a `store` prop or be wrapped in a MenuProvider component."
405
- );
406
- const d = be(null), a = e.parent, g = e.menubar, m = !!a, h = !!g && !m;
407
- s = {
408
- ...s,
409
- ref: ne(d, s.ref)
345
+ k(function(e) {
346
+ const t = Ye(e);
347
+ return v(Gn, t);
348
+ });
349
+ const Hn = "div", Rn = y(function({ store: e, modal: t = !1, portal: r = t, hideOnEscape: o = !0, autoFocusOnShow: i = !0, hideOnHoverOutside: u, alwaysVisible: s, ...a }) {
350
+ const b = re();
351
+ e = e || b, D(e, process.env.NODE_ENV !== "production" && "Menu must receive a `store` prop or be wrapped in a MenuProvider component.");
352
+ const f = Le(null), c = e.parent, d = e.menubar, g = !!c, h = !!d && !g, M = g ? !1 : t;
353
+ a = {
354
+ ...a,
355
+ ref: Y(f, a.ref)
410
356
  };
411
- const { "aria-labelledby": y, ...v } = rt({
357
+ const { "aria-labelledby": w, ...A } = Ye({
412
358
  store: e,
413
- alwaysVisible: i,
414
- ...s
359
+ alwaysVisible: s,
360
+ ...a
415
361
  });
416
- s = v;
417
- const [p, N] = ge(), C = e.useState("autoFocusOnShow"), T = e.useState("initialFocus"), M = e.useState("baseElement"), F = e.useState("renderedItems");
418
- j(() => {
419
- let I = !1;
420
- return N((_) => {
421
- var Q, _e, Ie;
422
- if (I || !C) return;
423
- if ((Q = _ == null ? void 0 : _.current) != null && Q.isConnected) return _;
424
- const X = Wt();
425
- switch (T) {
426
- // TODO: Refactor
427
- case "first":
428
- X.current = ((_e = F.find((q) => !q.disabled && q.element)) == null ? void 0 : _e.element) || null;
429
- break;
430
- case "last":
431
- X.current = ((Ie = [...F].reverse().find((q) => !q.disabled && q.element)) == null ? void 0 : Ie.element) || null;
432
- break;
433
- default:
434
- X.current = M;
435
- }
436
- return X;
362
+ a = A;
363
+ const [T, p] = fe(), P = S(e, [
364
+ "autoFocusOnShow",
365
+ "initialFocus",
366
+ "renderedItems",
367
+ "compositeElement"
368
+ ], (x) => {
369
+ var _;
370
+ if (!x.autoFocusOnShow) return;
371
+ const l = (E) => !E.disabled && !!E.element;
372
+ switch (x.initialFocus) {
373
+ case "first":
374
+ return ((_ = x.renderedItems.find(l)) == null ? void 0 : _.element) || null;
375
+ case "last":
376
+ for (let E = x.renderedItems.length - 1; E >= 0; E -= 1) {
377
+ const $ = x.renderedItems[E];
378
+ if ($ && l($)) return $.element;
379
+ }
380
+ return null;
381
+ default:
382
+ return x.compositeElement;
383
+ }
384
+ });
385
+ W(() => {
386
+ let x = !1;
387
+ return p((l) => {
388
+ var E;
389
+ if (x) return;
390
+ if (M && ((E = l == null ? void 0 : l.current) != null && E.isConnected)) return l;
391
+ if (P === void 0) return;
392
+ if (P && P === (l == null ? void 0 : l.current)) return l;
393
+ const _ = jt();
394
+ return _.current = P, _;
437
395
  }), () => {
438
- I = !0;
396
+ x = !0;
439
397
  };
440
- }, [e, C, T, F, M]);
441
- const E = m ? !1 : t, B = !!u, b = !!p || !!s.initialFocus || !!E, k = A(
442
- e.combobox || e,
443
- "contentElement"
444
- ), $ = A(
445
- (a == null ? void 0 : a.combobox) || a,
446
- "contentElement"
447
- ), W = qt(() => {
448
- if (!$ || !k) return;
449
- const I = k.getAttribute("role"), _ = $.getAttribute("role");
450
- if (!((_ === "menu" || _ === "menubar") && I === "menu"))
451
- return $;
452
- }, [k, $]);
453
- return W !== void 0 && (s = {
454
- preserveTabOrderAnchor: W,
455
- ...s
456
- }), s = yt({
398
+ }, [M, P]);
399
+ const C = !!T || !!a.initialFocus || M, I = i === !1 ? !1 : C && i, V = S(e, ["disclosureElement", "anchorElement"], (x) => x.disclosureElement || x.anchorElement), K = S(e.combobox || e, "contentElement"), B = S((c == null ? void 0 : c.combobox) || c, "contentElement"), Z = Kt(() => {
400
+ if (!B || !K) return;
401
+ const x = K.getAttribute("role"), l = B.getAttribute("role");
402
+ if (!((l === "menu" || l === "menubar") && x === "menu"))
403
+ return B;
404
+ }, [K, B]);
405
+ return Z !== void 0 && (a = {
406
+ preserveTabOrderAnchor: Z,
407
+ ...a
408
+ }), a = Mt({
457
409
  store: e,
458
- alwaysVisible: i,
459
- initialFocus: p,
460
- autoFocusOnShow: B ? b && u : C || !!E,
461
- ...s,
462
- hideOnEscape(I) {
463
- return Gt(o, I) ? !1 : (e == null || e.hideAll(), !0);
410
+ alwaysVisible: s,
411
+ initialFocus: T,
412
+ autoFocusOnShow: I,
413
+ finalFocus: V,
414
+ ...a,
415
+ hideOnEscape(x) {
416
+ return $t(o, x) ? !1 : (e == null || e.hideAll(), !0);
464
417
  },
465
- hideOnHoverOutside(I) {
466
- const _ = e == null ? void 0 : e.getState().disclosureElement;
467
- return (typeof c == "function" ? c(I) : c ?? (m ? !0 : h ? _ ? !K(_) : !0 : !1)) ? I.defaultPrevented || !m || !_ || (Rt(_, "mouseout", I), !K(_)) ? !0 : (requestAnimationFrame(() => {
468
- K(_) || e == null || e.hide();
418
+ hideOnHoverOutside(x) {
419
+ const l = e == null ? void 0 : e.getState().disclosureElement;
420
+ return (typeof u == "function" ? u(x) : u ?? (g ? !0 : h ? l ? !z(l) : !0 : !1)) ? x.defaultPrevented || !g || !l || (Lt(l, "mouseout", x), !z(l)) ? !0 : (requestAnimationFrame(() => {
421
+ z(l) || e == null || e.hide();
469
422
  }), !1) : !1;
470
423
  },
471
- modal: E,
424
+ modal: M,
472
425
  portal: r,
473
- backdrop: m ? !1 : s.backdrop
474
- }), s = {
475
- "aria-labelledby": y,
476
- ...s
477
- }, s;
478
- }), Hn = Xt(
479
- x(function(e) {
480
- const t = Gn(e);
481
- return S(Rn, t);
482
- }),
483
- ue
484
- ), Vn = "div", zn = w(
485
- function({ store: e, ...t }) {
486
- const r = oe();
487
- return e = e || r, en({ store: e, ...t });
488
- }
489
- ), Bn = x(function(e) {
426
+ backdrop: g ? !1 : a.backdrop
427
+ }), a = {
428
+ "aria-labelledby": w,
429
+ ...a
430
+ }, a;
431
+ }), Vn = ht(k(function(e) {
432
+ const t = Rn(e);
433
+ return v(Hn, t);
434
+ }), re), Bn = "div", zn = y(function({ store: e, ...t }) {
435
+ const r = ne();
436
+ return e = e || r, tn({
437
+ store: e,
438
+ ...t
439
+ });
440
+ }), Wn = k(function(e) {
490
441
  const t = zn(e);
491
- return S(Vn, t);
492
- }), Kn = "button";
493
- function jn(n, e) {
442
+ return v(Bn, t);
443
+ }), jn = "button";
444
+ function Kn(n, e) {
494
445
  return {
495
446
  ArrowDown: e === "bottom" || e === "top" ? "first" : !1,
496
447
  ArrowUp: e === "bottom" || e === "top" ? "last" : !1,
@@ -498,518 +449,453 @@ function jn(n, e) {
498
449
  ArrowLeft: e === "left" ? "first" : !1
499
450
  }[n.key];
500
451
  }
501
- function Ee(n, e) {
452
+ function ve(n, e) {
502
453
  return !!(n != null && n.some((t) => !t.element || t.element === e ? !1 : t.element.getAttribute("aria-expanded") === "true"));
503
454
  }
504
- var Un = w(
505
- function({
455
+ const Un = y(function({ store: e, focusable: t, accessibleWhenDisabled: r, showOnHover: o, unstable_showOnHoverWhenDisabled: i = !1, ...u }) {
456
+ const s = re();
457
+ e = e || s, D(e, process.env.NODE_ENV !== "production" && "MenuButton must receive a `store` prop or be wrapped in a MenuProvider component.");
458
+ const a = Le(null), b = e.parent, f = e.menubar, c = !!b, d = !!f && !c, g = Ot(u), h = (l) => g || Ft(l), M = () => {
459
+ const l = a.current;
460
+ l && (e == null || e.setDisclosureElement(l), e == null || e.show());
461
+ }, w = u.onFocus, A = L((l) => {
462
+ if (w == null || w(l), h(l.currentTarget) || l.defaultPrevented || (e == null || e.setAutoFocusOnShow(!1), e == null || e.setActiveId(null), !f) || !d) return;
463
+ const { items: _ } = f.getState();
464
+ ve(_, l.currentTarget) && M();
465
+ }), T = S(e, ["placement"], (l) => Ee(l.placement)), p = u.onKeyDown, P = L((l) => {
466
+ if (p == null || p(l), h(l.currentTarget) || l.defaultPrevented) return;
467
+ const _ = Kn(l, T);
468
+ if (_) {
469
+ l.preventDefault();
470
+ const { open: E } = e.getState();
471
+ if (E) {
472
+ const $ = _ === "last" ? e.last() : e.first();
473
+ e.move($);
474
+ return;
475
+ }
476
+ M(), e == null || e.setAutoFocusOnShow(!0), e == null || e.setInitialFocus(_);
477
+ }
478
+ }), C = u.onClick, I = L((l) => {
479
+ if (C == null || C(l), l.defaultPrevented || !e) return;
480
+ const _ = !l.detail, { open: E } = e.getState();
481
+ (!E || _) && ((!c || _) && e.setAutoFocusOnShow(!0), e.setInitialFocus(_ ? "first" : "container")), c && M();
482
+ });
483
+ u = U(u, (l) => /* @__PURE__ */ m(Je, {
484
+ value: e,
485
+ children: l
486
+ }), [e]), c && (u = {
487
+ ...u,
488
+ render: /* @__PURE__ */ m(bt.div, { render: u.render })
489
+ });
490
+ const V = me(u.id), K = S((b == null ? void 0 : b.combobox) || b, "contentElement"), B = c || d ? pe(K, "menuitem") : void 0, Z = S(e, "contentElement"), x = !!e.combobox;
491
+ return u = {
492
+ role: B,
493
+ "aria-haspopup": Gt(Z, x ? "dialog" : "menu"),
494
+ ...u,
495
+ id: V,
496
+ ref: Y(a, u.ref),
497
+ onFocus: A,
498
+ onKeyDown: P,
499
+ onClick: I
500
+ }, u = wt({
506
501
  store: e,
507
502
  focusable: t,
508
503
  accessibleWhenDisabled: r,
509
- showOnHover: o,
504
+ ...u,
505
+ unstable_showOnHoverWhenDisabled: i,
506
+ showOnHover: (l) => {
507
+ if (!(() => {
508
+ if (typeof o == "function") return o(l);
509
+ if (o != null) return o;
510
+ if (c) return !0;
511
+ if (!f) return !1;
512
+ const { items: $ } = f.getState();
513
+ return d && ve($);
514
+ })()) return !1;
515
+ const E = d ? f : b;
516
+ return E && E.setActiveId(l.currentTarget.id), !0;
517
+ }
518
+ }), u = nn({
519
+ store: e,
520
+ toggleOnClick: !c,
521
+ focusable: t,
522
+ accessibleWhenDisabled: r,
510
523
  ...u
511
- }) {
512
- const c = ue();
513
- e = e || c, L(
514
- e,
515
- process.env.NODE_ENV !== "production" && "MenuButton must receive a `store` prop or be wrapped in a MenuProvider component."
516
- );
517
- const i = be(null), s = e.parent, f = e.menubar, d = !!s, a = !!f && !d, g = Ht(u), m = () => {
518
- const b = i.current;
519
- b && (e == null || e.setDisclosureElement(b), e == null || e.setAnchorElement(b), e == null || e.show());
520
- }, h = u.onFocus, y = O((b) => {
521
- if (h == null || h(b), g || b.defaultPrevented || (e == null || e.setAutoFocusOnShow(!1), e == null || e.setActiveId(null), !f) || !a) return;
522
- const { items: k } = f.getState();
523
- Ee(k, b.currentTarget) && m();
524
- }), v = A(
525
- e,
526
- (b) => b.placement.split("-")[0]
527
- ), p = u.onKeyDown, N = O((b) => {
528
- if (p == null || p(b), g || b.defaultPrevented) return;
529
- const k = jn(b, v);
530
- k && (b.preventDefault(), m(), e == null || e.setAutoFocusOnShow(!0), e == null || e.setInitialFocus(k));
531
- }), C = u.onClick, T = O((b) => {
532
- if (C == null || C(b), b.defaultPrevented || !e) return;
533
- const k = !b.detail, { open: $ } = e.getState();
534
- (!$ || k) && ((!d || k) && e.setAutoFocusOnShow(!0), e.setInitialFocus(k ? "first" : "container")), d && m();
535
- });
536
- u = te(
537
- u,
538
- (b) => /* @__PURE__ */ l(tt, { value: e, children: b }),
539
- [e]
540
- ), d && (u = {
541
- ...u,
542
- render: /* @__PURE__ */ l(Yt.div, { render: u.render })
543
- });
544
- const M = he(u.id), F = A(
545
- (s == null ? void 0 : s.combobox) || s,
546
- "contentElement"
547
- ), E = d || a ? Ve(F, "menuitem") : void 0, B = e.useState("contentElement");
548
- return u = {
549
- id: M,
550
- role: E,
551
- "aria-haspopup": Vt(B, "menu"),
552
- ...u,
553
- ref: ne(i, u.ref),
554
- onFocus: y,
555
- onKeyDown: N,
556
- onClick: T
557
- }, u = pt({
558
- store: e,
559
- focusable: t,
560
- accessibleWhenDisabled: r,
561
- ...u,
562
- showOnHover: (b) => {
563
- if (!(() => {
564
- if (typeof o == "function") return o(b);
565
- if (o != null) return o;
566
- if (d) return !0;
567
- if (!f) return !1;
568
- const { items: I } = f.getState();
569
- return a && Ee(I);
570
- })()) return !1;
571
- const W = a ? f : s;
572
- return W && W.setActiveId(b.currentTarget.id), !0;
573
- }
574
- }), u = tn({
575
- store: e,
576
- toggleOnClick: !d,
577
- focusable: t,
578
- accessibleWhenDisabled: r,
579
- ...u
580
- }), u = Ce({
581
- store: e,
582
- typeahead: a,
583
- ...u
584
- }), u;
585
- }
586
- ), ot = x(function(e) {
524
+ }), u = he({
525
+ store: e,
526
+ typeahead: d,
527
+ ...u
528
+ }), u;
529
+ }), et = k(function(e) {
587
530
  const t = Un(e);
588
- return S(Kn, t);
589
- }), Wn = "div", qn = w(
590
- function(e) {
591
- return e = Ze(e), e;
592
- }
593
- ), Zn = x(function(e) {
594
- const t = qn(e);
595
- return S(Wn, t);
596
- }), Jn = "div", Qn = w(
597
- function(e) {
598
- return e = Qe(e), e;
599
- }
600
- ), Xn = x(function(e) {
601
- const t = Qn(e);
602
- return S(Jn, t);
603
- }), Yn = "div";
604
- function er(n, e, t) {
605
- var r;
531
+ return v(jn, dn(t));
532
+ }), qn = "div", Zn = y(function(e) {
533
+ return e = je(e), e;
534
+ }), Jn = k(function(e) {
535
+ const t = Zn(e);
536
+ return v(qn, t);
537
+ }), Qn = "div", Xn = y(function(e) {
538
+ return e = Ue(e), e;
539
+ }), Yn = k(function(e) {
540
+ const t = Xn(e);
541
+ return v(Qn, t);
542
+ }), er = "div";
543
+ function tr(n, e, t) {
544
+ var i, u;
606
545
  if (!n) return !1;
607
- if (K(n)) return !0;
608
- const o = e == null ? void 0 : e.find((s) => {
609
- var f;
610
- return s.element === t ? !1 : ((f = s.element) == null ? void 0 : f.getAttribute("aria-expanded")) === "true";
611
- }), u = (r = o == null ? void 0 : o.element) == null ? void 0 : r.getAttribute("aria-controls");
612
- if (!u) return !1;
613
- const i = Ge(n).getElementById(u);
614
- return i ? K(i) ? !0 : !!i.querySelector("[role=menuitem][aria-expanded=true]") : !1;
546
+ if (z(n)) return !0;
547
+ const r = (u = (i = e == null ? void 0 : e.find((s) => {
548
+ var a;
549
+ return s.element === t ? !1 : ((a = s.element) == null ? void 0 : a.getAttribute("aria-expanded")) === "true";
550
+ })) == null ? void 0 : i.element) == null ? void 0 : u.getAttribute("aria-controls");
551
+ if (!r) return !1;
552
+ const o = Vt(n).getElementById(r);
553
+ return o ? z(o) ? !0 : !!o.querySelector("[role=menuitem][aria-expanded=true]") : !1;
615
554
  }
616
- var xe = w(
617
- function({
555
+ const ge = y(function({ store: e, hideOnClick: t = !0, preventScrollOnKeyDown: r = !0, focusOnHover: o, blurOnHoverEnd: i, ...u }) {
556
+ const s = be(!0), a = gn();
557
+ e = e || s || a, D(e, process.env.NODE_ENV !== "production" && "MenuItem must be wrapped in a MenuList, Menu or Menubar component");
558
+ const b = u.onClick, f = ie(t), c = "hideAll" in e ? e.hideAll : void 0, d = !!c, g = L((w) => {
559
+ if (b == null || b(w), w.defaultPrevented || Ht(w) || Rt(w) || !c) return;
560
+ const A = w.currentTarget.getAttribute("aria-haspopup");
561
+ A && A !== "false" || f(w) && c();
562
+ }), h = S(e, ["contentElement"], (w) => "contentElement" in w ? w.contentElement : null), M = te(Xe);
563
+ return u = {
564
+ role: pe(h, "menuitem"),
565
+ ...u,
566
+ onClick: g
567
+ }, u = kt({
618
568
  store: e,
619
- hideOnClick: t = !0,
620
- preventScrollOnKeyDown: r = !0,
621
- focusOnHover: o,
622
- blurOnHoverEnd: u,
623
- ...c
624
- }) {
625
- const i = we(!0), s = bn();
626
- e = e || i || s, L(
627
- e,
628
- process.env.NODE_ENV !== "production" && "MenuItem must be wrapped in a MenuList, Menu or Menubar component"
629
- );
630
- const f = c.onClick, d = se(t), a = "hideAll" in e ? e.hideAll : void 0, g = !!a, m = O((v) => {
631
- f == null || f(v), !(v.defaultPrevented || zt(v) || Bt(v) || !a || v.currentTarget.getAttribute("aria-haspopup") === "menu") && d(v) && a();
632
- }), h = A(
633
- e,
634
- (v) => "contentElement" in v ? v.contentElement : null
635
- );
636
- return c = {
637
- role: Ve(h, "menuitem"),
638
- ...c,
639
- onClick: m
640
- }, c = Pt({
641
- store: e,
642
- preventScrollOnKeyDown: r,
643
- ...c
644
- }), c = Ye({
645
- store: e,
646
- ...c,
647
- focusOnHover(v) {
648
- const p = () => typeof o == "function" ? o(v) : o ?? !0;
649
- if (!e || !p()) return !1;
650
- const { baseElement: N, items: C } = e.getState();
651
- return g ? (v.currentTarget.hasAttribute("aria-expanded") && v.currentTarget.focus(), !0) : er(N, C, v.currentTarget) ? (v.currentTarget.focus(), !0) : !1;
652
- },
653
- blurOnHoverEnd(v) {
654
- return typeof u == "function" ? u(v) : u ?? g;
655
- }
656
- }), c;
657
- }
658
- ), Se = re(
659
- x(function(e) {
660
- const t = xe(e);
661
- return S(Yn, t);
662
- })
663
- ), tr = "span", nr = w(
664
- function({ store: e, checked: t, ...r }) {
665
- const o = Me(nt);
666
- return t = t ?? o, r = et({ ...r, checked: t }), r;
667
- }
668
- ), rr = x(function(e) {
669
- const t = nr(e);
670
- return S(tr, t);
671
- }), or = "div";
672
- function ur(n) {
673
- return Array.isArray(n) ? n.toString() : n;
674
- }
675
- function ie(n, e, t) {
569
+ preventScrollOnKeyDown: r,
570
+ ...u,
571
+ shouldRegisterItem: M ? !1 : u.shouldRegisterItem
572
+ }), u = qe({
573
+ store: e,
574
+ ...u,
575
+ focusOnHover(w) {
576
+ const A = () => typeof o == "function" ? o(w) : o ?? !0;
577
+ if (!e || !A()) return !1;
578
+ const { compositeElement: T, items: p } = e.getState();
579
+ return d ? (w.currentTarget.hasAttribute("aria-expanded") && w.currentTarget.focus({ preventScroll: !0 }), !0) : tr(T, p, w.currentTarget) ? (w.currentTarget.focus({ preventScroll: !0 }), !0) : !1;
580
+ },
581
+ blurOnHoverEnd(w) {
582
+ return typeof i == "function" ? i(w) : i ?? d;
583
+ }
584
+ }), u;
585
+ }), Ce = ee(k(function(e) {
586
+ const t = ge(e);
587
+ return v(er, t);
588
+ })), nr = "span", rr = y(function({ store: e, checked: t, ...r }) {
589
+ const o = te(Qe);
590
+ return t = t ?? o, r = Ze({
591
+ ...r,
592
+ checked: t
593
+ }), r;
594
+ }), or = k(function(e) {
595
+ const t = rr(e);
596
+ return v(nr, t);
597
+ }), ur = "div";
598
+ function oe(n, e, t) {
676
599
  if (e === void 0)
677
600
  return Array.isArray(n) ? n : !!t;
678
- const r = ur(e);
601
+ const r = un(e);
679
602
  return Array.isArray(n) ? t ? n.includes(r) ? n : [...n, r] : n.filter((o) => o !== r) : t ? r : n === r ? !1 : n;
680
603
  }
681
- var ar = w(
682
- function({
683
- store: e,
604
+ const ir = y(function({ store: e, name: t, value: r, checked: o, defaultChecked: i, hideOnClick: u = !1, ...s }) {
605
+ const a = be();
606
+ e = e || a, D(e, process.env.NODE_ENV !== "production" && "MenuItemCheckbox must be wrapped in a MenuList or Menu component");
607
+ const b = De(i);
608
+ W(() => {
609
+ e == null || e.setValue(t, (c = r !== void 0 ? [] : !1) => b ? oe(c, r, !0) : c);
610
+ }, [
611
+ e,
612
+ t,
613
+ r,
614
+ b
615
+ ]), W(() => {
616
+ o !== void 0 && (e == null || e.setValue(t, (c) => oe(c, r, o)));
617
+ }, [
618
+ e,
619
+ t,
620
+ r,
621
+ o
622
+ ]);
623
+ const f = $n({
624
+ value: S(e, ["values"], (c) => c.values[t]),
625
+ setValue(c) {
626
+ e == null || e.setValue(t, () => {
627
+ if (o === void 0) return c;
628
+ const d = oe(c, r, o);
629
+ return !Array.isArray(d) || !Array.isArray(c) ? d : Bt(c, d) ? c : d;
630
+ });
631
+ }
632
+ });
633
+ return s = {
634
+ role: "menuitemcheckbox",
635
+ ...s
636
+ }, s = on({
637
+ store: f,
684
638
  name: t,
685
639
  value: r,
686
640
  checked: o,
687
- defaultChecked: u,
688
- hideOnClick: c = !1,
689
- ...i
690
- }) {
691
- const s = we();
692
- e = e || s, L(
693
- e,
694
- process.env.NODE_ENV !== "production" && "MenuItemCheckbox must be wrapped in a MenuList or Menu component"
695
- );
696
- const f = ze(u);
697
- j(() => {
698
- e == null || e.setValue(t, (a = []) => f ? ie(a, r, !0) : a);
699
- }, [e, t, r, f]), j(() => {
700
- o !== void 0 && (e == null || e.setValue(t, (a) => ie(a, r, o)));
701
- }, [e, t, r, o]);
702
- const d = Ln({
703
- value: e.useState((a) => a.values[t]),
704
- setValue(a) {
705
- e == null || e.setValue(t, () => {
706
- if (o === void 0) return a;
707
- const g = ie(a, r, o);
708
- return !Array.isArray(g) || !Array.isArray(a) ? g : Kt(a, g) ? a : g;
709
- });
710
- }
711
- });
712
- return i = {
713
- role: "menuitemcheckbox",
714
- ...i
715
- }, i = rn({
716
- store: d,
717
- name: t,
718
- value: r,
719
- checked: o,
720
- ...i
721
- }), i = xe({ store: e, hideOnClick: c, ...i }), i;
722
- }
723
- ), ir = re(
724
- x(function(e) {
725
- const t = ar(e);
726
- return S(or, t);
727
- })
728
- ), cr = "div";
729
- function ce(n, e, t) {
641
+ ...s
642
+ }), s = ge({
643
+ store: e,
644
+ hideOnClick: u,
645
+ ...s
646
+ }), s;
647
+ }), ar = ee(k(function(e) {
648
+ const t = ir(e);
649
+ return v(ur, t);
650
+ })), cr = "div";
651
+ function ue(n, e, t) {
730
652
  return t === void 0 ? n : t ? e : n === e ? !1 : n;
731
653
  }
732
- var sr = w(
733
- function({
734
- store: e,
654
+ const sr = y(function({ store: e, name: t, value: r, checked: o, defaultChecked: i, onChange: u, hideOnClick: s = !1, ...a }) {
655
+ const b = be();
656
+ e = e || b, D(e, process.env.NODE_ENV !== "production" && "MenuItemRadio must be wrapped in a MenuList or Menu component");
657
+ const f = De(i);
658
+ W(() => {
659
+ e == null || e.setValue(t, (d = !1) => ue(d, r, f));
660
+ }, [
661
+ e,
662
+ t,
663
+ r,
664
+ f
665
+ ]), W(() => {
666
+ o !== void 0 && (e == null || e.setValue(t, (d) => ue(d, r, o)));
667
+ }, [
668
+ e,
669
+ t,
670
+ r,
671
+ o
672
+ ]);
673
+ const c = S(e, ["values"], (d) => d.values[t] === r);
674
+ return a = U(a, (d) => /* @__PURE__ */ m(Qe.Provider, {
675
+ value: c,
676
+ children: d
677
+ }), [c]), a = {
678
+ role: "menuitemradio",
679
+ ...a
680
+ }, a = an({
735
681
  name: t,
736
682
  value: r,
737
- checked: o,
738
- onChange: u,
739
- hideOnClick: c = !1,
740
- ...i
741
- }) {
742
- const s = we();
743
- e = e || s, L(
744
- e,
745
- process.env.NODE_ENV !== "production" && "MenuItemRadio must be wrapped in a MenuList or Menu component"
746
- );
747
- const f = ze(i.defaultChecked);
748
- j(() => {
749
- e == null || e.setValue(t, (a = !1) => ce(a, r, f));
750
- }, [e, t, r, f]), j(() => {
751
- o !== void 0 && (e == null || e.setValue(t, (a) => ce(a, r, o)));
752
- }, [e, t, r, o]);
753
- const d = e.useState((a) => a.values[t] === r);
754
- return i = te(
755
- i,
756
- (a) => /* @__PURE__ */ l(nt.Provider, { value: !!d, children: a }),
757
- [d]
758
- ), i = {
759
- role: "menuitemradio",
760
- ...i
761
- }, i = on({
762
- name: t,
763
- value: r,
764
- checked: d,
765
- onChange(a) {
766
- if (u == null || u(a), a.defaultPrevented) return;
767
- const g = a.currentTarget;
768
- e == null || e.setValue(t, (m) => ce(m, r, o ?? g.checked));
769
- },
770
- ...i
771
- }), i = xe({ store: e, hideOnClick: c, ...i }), i;
772
- }
773
- ), lr = re(
774
- x(function(e) {
775
- const t = sr(e);
776
- return S(cr, t);
777
- })
778
- );
779
- function dr({
780
- combobox: n,
781
- parent: e,
782
- menubar: t,
783
- ...r
784
- } = {}) {
785
- const o = !!t && !e, u = Mt(
786
- r.store,
787
- wt(e, ["values"]),
788
- Ct(n, [
789
- "arrowElement",
790
- "anchorElement",
791
- "contentElement",
792
- "popoverElement",
793
- "disclosureElement"
794
- ])
795
- );
796
- Te(r, u);
797
- const c = u.getState(), i = un({
683
+ checked: c,
684
+ onChange(d) {
685
+ if (u == null || u(d), d.defaultPrevented) return;
686
+ const g = d.currentTarget;
687
+ e == null || e.setValue(t, (h) => ue(h, r, o ?? g.checked));
688
+ },
689
+ ...a
690
+ }), a = ge({
691
+ store: e,
692
+ hideOnClick: s,
693
+ ...a
694
+ }), a;
695
+ }), lr = ee(k(function(e) {
696
+ const t = sr(e);
697
+ return v(cr, t);
698
+ }));
699
+ function mr({ combobox: n, parent: e, menubar: t, ...r } = {}) {
700
+ const o = !!t && !e, i = Jt(r.store, Xt(e, ["values"]), Qt(n, [
701
+ "arrowElement",
702
+ "anchorElement",
703
+ "contentElement",
704
+ "popoverElement",
705
+ "disclosureElement"
706
+ ]));
707
+ $e(r, i);
708
+ const u = i.getState(), s = vt({
798
709
  ...r,
799
- store: u,
800
- orientation: R(
801
- r.orientation,
802
- c.orientation,
803
- "vertical"
804
- )
805
- }), s = kt({
710
+ store: i,
711
+ orientation: O(r.orientation, u.orientation, "vertical")
712
+ }), a = xt({
806
713
  ...r,
807
- store: u,
808
- placement: R(
809
- r.placement,
810
- c.placement,
811
- "bottom-start"
812
- ),
813
- timeout: R(
814
- r.timeout,
815
- c.timeout,
816
- o ? 0 : 150
817
- ),
818
- hideTimeout: R(r.hideTimeout, c.hideTimeout, 0)
819
- }), f = {
820
- ...i.getState(),
714
+ store: i,
715
+ placement: O(r.placement, u.placement, "bottom-start"),
716
+ timeout: O(r.timeout, u.timeout, o ? 0 : 150),
717
+ hideTimeout: O(r.hideTimeout, u.hideTimeout, 0)
718
+ }), b = {
821
719
  ...s.getState(),
822
- initialFocus: R(c.initialFocus, "container"),
823
- values: R(
824
- r.values,
825
- c.values,
826
- r.defaultValues,
827
- {}
828
- )
829
- }, d = De(f, i, s, u);
830
- return Pe(
831
- d,
832
- () => Ne(d, ["mounted"], (a) => {
833
- a.mounted || d.setState("activeId", null);
834
- })
835
- ), Pe(
836
- d,
837
- () => Ne(e, ["orientation"], (a) => {
838
- d.setState(
839
- "placement",
840
- a.orientation === "vertical" ? "right-start" : "bottom-start"
841
- );
842
- })
843
- ), {
844
- ...i,
720
+ ...a.getState(),
721
+ initialFocus: O(u.initialFocus, "container"),
722
+ values: O(r.values, u.values, r.defaultValues, {})
723
+ }, f = Oe(b, s, a, i);
724
+ return Se(f, () => ye(f, ["mounted"], (c) => {
725
+ c.mounted || f.setState("activeId", null);
726
+ })), Se(f, () => ye(e, ["orientation"], (c) => {
727
+ f.setState("placement", c.orientation === "vertical" ? "right-start" : "bottom-start");
728
+ })), {
845
729
  ...s,
846
- ...d,
730
+ ...a,
731
+ ...f,
847
732
  combobox: n,
848
733
  parent: e,
849
734
  menubar: t,
850
735
  hideAll: () => {
851
- s.hide(), e == null || e.hideAll();
736
+ a.hide(), e == null || e.hideAll();
852
737
  },
853
- setInitialFocus: (a) => d.setState("initialFocus", a),
854
- setValues: (a) => d.setState("values", a),
855
- setValue: (a, g) => {
856
- a !== "__proto__" && a !== "constructor" && (Array.isArray(a) || d.setState("values", (m) => {
857
- const h = m[a], y = jt(g, h);
858
- return y === h ? m : {
859
- ...m,
860
- [a]: y !== void 0 && y
738
+ setInitialFocus: (c) => f.setState("initialFocus", c),
739
+ setValues: (c) => f.setState("values", c),
740
+ setValue: (c, d) => {
741
+ c !== "__proto__" && c !== "constructor" && (Array.isArray(c) || f.setState("values", (g) => {
742
+ const h = g[c], M = zt(d, h);
743
+ return M === h ? g : {
744
+ ...g,
745
+ [c]: M !== void 0 && M
861
746
  };
862
747
  }));
863
748
  }
864
749
  };
865
750
  }
866
- function mr(n, e, t) {
867
- return He(e, [t.combobox, t.parent, t.menubar]), Oe(n, t, "values", "setValues"), Object.assign(
868
- _t(
869
- an(n, e, t),
870
- e,
871
- t
872
- ),
873
- {
874
- combobox: t.combobox,
875
- parent: t.parent,
876
- menubar: t.menubar
877
- }
878
- );
751
+ function dr(n, e, t) {
752
+ return Pe(e, [
753
+ t.combobox,
754
+ t.parent,
755
+ t.menubar,
756
+ e
757
+ ]), Fe(n, t, "values", "setValues"), Object.assign(St(en(n, e, t), e, t), {
758
+ combobox: t.combobox,
759
+ parent: t.parent,
760
+ menubar: t.menubar
761
+ });
879
762
  }
880
- function ye(n = {}) {
881
- const e = oe(), t = vn(), r = cn();
763
+ function Me(n = {}) {
764
+ const e = ne(), t = bn(), r = Yt();
882
765
  n = {
883
766
  ...n,
884
767
  parent: n.parent !== void 0 ? n.parent : e,
885
768
  menubar: n.menubar !== void 0 ? n.menubar : t,
886
769
  combobox: n.combobox !== void 0 ? n.combobox : r
887
770
  };
888
- const [o, u] = Le(dr, n);
889
- return mr(o, u, n);
771
+ const [o, i] = Ge(mr, n);
772
+ return dr(o, i, n);
890
773
  }
891
774
  function fr(n = {}) {
892
- const e = ye(n);
893
- return /* @__PURE__ */ l(tt, { value: e, children: n.children });
775
+ const e = Me(n);
776
+ return /* @__PURE__ */ m(Je, {
777
+ value: e,
778
+ children: n.children
779
+ });
894
780
  }
895
- var hr = "hr", vr = w(
896
- function({ store: e, ...t }) {
897
- const r = oe();
898
- return e = e || r, t = je({ store: e, ...t }), t;
899
- }
900
- ), br = x(function(e) {
901
- const t = vr(e);
902
- return S(hr, t);
903
- });
904
- const gr = "_root_1u58t_2", Mr = "_arrow_1u58t_29", Cr = "_stroke_1u58t_1", wr = "_item_1u58t_55", xr = "_action_1u58t_94", Sr = "_search_1u58t_103", yr = "_separator_1u58t_146", V = {
905
- root: gr,
781
+ const hr = "hr", br = y(function({ store: e, ...t }) {
782
+ const r = ne();
783
+ return e = e || r, t = Ve({
784
+ store: e,
785
+ ...t
786
+ }), t;
787
+ }), gr = k(function(e) {
788
+ const t = br(e);
789
+ return v(hr, t);
790
+ }), Cr = "_root_1u58t_2", Mr = "_arrow_1u58t_29", wr = "_stroke_1u58t_1", xr = "_item_1u58t_55", Sr = "_action_1u58t_94", yr = "_search_1u58t_103", kr = "_separator_1u58t_146", H = {
791
+ root: Cr,
906
792
  arrow: Mr,
907
- stroke: Cr,
793
+ stroke: wr,
908
794
  "arrow-item": "_arrow-item_1u58t_38",
909
795
  "arrow-placement-bottom": "_arrow-placement-bottom_1u58t_43",
910
796
  "arrow-placement-left": "_arrow-placement-left_1u58t_46",
911
797
  "arrow-placement-right": "_arrow-placement-right_1u58t_49",
912
798
  "arrow-placement-top": "_arrow-placement-top_1u58t_52",
913
- item: wr,
914
- action: xr,
799
+ item: xr,
800
+ action: Sr,
915
801
  "group-label": "_group-label_1u58t_98",
916
- search: Sr,
802
+ search: yr,
917
803
  "item-content": "_item-content_1u58t_106",
918
804
  "item-description": "_item-description_1u58t_111",
919
805
  "item-default-check": "_item-default-check_1u58t_122",
920
806
  "item-toggle-check": "_item-toggle-check_1u58t_127",
921
807
  "item-checkbox": "_item-checkbox_1u58t_130",
922
808
  "item-radio": "_item-radio_1u58t_131",
923
- separator: yr,
809
+ separator: kr,
924
810
  "size-md": "_size-md_1u58t_155",
925
811
  "size-lg": "_size-lg_1u58t_162"
926
- }, pr = H(V), ut = U(
927
- ({ as: n = "button", className: e, ...t }, r) => /* @__PURE__ */ l(
928
- Se,
812
+ }, vr = F(H), tt = j(
813
+ ({ as: n = "button", className: e, ...t }, r) => /* @__PURE__ */ m(
814
+ Ce,
929
815
  {
930
816
  ...t,
931
- render: /* @__PURE__ */ l(n, { className: pr("item", "action", e), ref: r })
817
+ render: /* @__PURE__ */ m(n, { className: vr("item", "action", e), ref: r })
932
818
  }
933
819
  )
934
820
  );
935
- ut.displayName = "DropdownMenu.Action";
936
- const Ae = H(V), at = P(
821
+ tt.displayName = "DropdownMenu.Action";
822
+ const _e = F(H), nt = N(
937
823
  ({ className: n, store: e, ...t }, r) => {
938
- const o = oe(), u = e ?? o, c = A(u, "currentPlacement"), [i] = c.split("-");
939
- return /* @__PURE__ */ l(
940
- Bn,
824
+ const o = ne(), i = e ?? o, u = S(i, "currentPlacement"), [s] = u.split("-");
825
+ return /* @__PURE__ */ m(
826
+ Wn,
941
827
  {
942
828
  ...t,
943
829
  ref: r,
944
- render: /* @__PURE__ */ l("div", { className: Ae("arrow", n), children: /* @__PURE__ */ G(
830
+ render: /* @__PURE__ */ m("div", { className: _e("arrow", n), children: /* @__PURE__ */ G(
945
831
  "svg",
946
832
  {
947
- className: Ae("arrow-item", i && `arrow-placement-${i}`),
833
+ className: _e("arrow-item", s && `arrow-placement-${s}`),
948
834
  viewBox: "0 0 30 30",
949
835
  xmlns: "http://www.w3.org/2000/svg",
950
836
  children: [
951
- /* @__PURE__ */ l("path", { d: "M7 30L15 22L23 30H7Z", fill: "currentColor", fillRule: "nonzero", id: "stroke" }),
952
- /* @__PURE__ */ l("path", { d: "M8 30L15 23L22 30H8Z", fill: "currentColor", fillRule: "nonzero" })
837
+ /* @__PURE__ */ m("path", { d: "M7 30L15 22L23 30H7Z", fill: "currentColor", fillRule: "nonzero", id: "stroke" }),
838
+ /* @__PURE__ */ m("path", { d: "M8 30L15 23L22 30H8Z", fill: "currentColor", fillRule: "nonzero" })
953
839
  ]
954
840
  }
955
841
  ) }),
956
842
  size: 32,
957
- store: u
843
+ store: i
958
844
  }
959
845
  );
960
846
  }
961
847
  );
962
- at.displayName = "DropdownMenu.Arrow";
963
- const kr = H(V), it = U(
964
- ({ as: n = "div", ...e }, t) => /* @__PURE__ */ l(Zn, { ref: t, render: /* @__PURE__ */ l(n, {}), ...e })
848
+ nt.displayName = "DropdownMenu.Arrow";
849
+ const _r = F(H), rt = j(
850
+ ({ as: n = "div", ...e }, t) => /* @__PURE__ */ m(Jn, { ref: t, render: /* @__PURE__ */ m(n, {}), ...e })
965
851
  );
966
- it.displayName = "DropdownMenu.Group";
967
- const ct = U(
968
- ({ as: n = "div", className: e, ...t }, r) => /* @__PURE__ */ l(
969
- Xn,
852
+ rt.displayName = "DropdownMenu.Group";
853
+ const ot = j(
854
+ ({ as: n = "div", className: e, ...t }, r) => /* @__PURE__ */ m(
855
+ Yn,
970
856
  {
971
857
  ...t,
972
858
  ref: r,
973
- render: /* @__PURE__ */ l(n, { className: kr("item", "group-label", e) })
859
+ render: /* @__PURE__ */ m(n, { className: _r("item", "group-label", e) })
974
860
  }
975
861
  )
976
862
  );
977
- ct.displayName = "DropdownMenu.GroupLabel";
978
- const z = H(V), pe = U(
979
- ({ as: n = "button", children: e, className: t, name: r, onClick: o, value: u, variant: c, ...i }, s) => /* @__PURE__ */ l(
980
- Se,
863
+ ot.displayName = "DropdownMenu.GroupLabel";
864
+ const R = F(H), we = j(
865
+ ({ as: n = "button", children: e, className: t, name: r, onClick: o, value: i, variant: u, ...s }, a) => /* @__PURE__ */ m(
866
+ Ce,
981
867
  {
982
- hideOnClick: !c || c === "radio" || c === "radio-mark",
983
- ...i,
984
- onClick: (a) => {
985
- a.stopPropagation(), o == null || o(a);
868
+ hideOnClick: !u || u === "radio" || u === "radio-mark",
869
+ ...s,
870
+ onClick: (c) => {
871
+ c.stopPropagation(), o == null || o(c);
986
872
  },
987
- ref: s,
988
- render: /* @__PURE__ */ l(n, { className: z("item", t), children: (() => {
989
- switch (c) {
873
+ ref: a,
874
+ render: /* @__PURE__ */ m(n, { className: R("item", t), children: (() => {
875
+ switch (u) {
990
876
  case "checkbox":
991
- return /* @__PURE__ */ G(ee, { name: r, value: u, children: [
992
- /* @__PURE__ */ l(dt, { name: r, value: u }),
877
+ return /* @__PURE__ */ G(X, { name: r, value: i, children: [
878
+ /* @__PURE__ */ m(at, { name: r, value: i }),
993
879
  e
994
880
  ] });
995
881
  case "checkbox-mark":
996
- return /* @__PURE__ */ G(ee, { name: r, value: u, children: [
882
+ return /* @__PURE__ */ G(X, { name: r, value: i, children: [
997
883
  e,
998
- /* @__PURE__ */ l(me, {})
884
+ /* @__PURE__ */ m(se, {})
999
885
  ] });
1000
886
  case "radio":
1001
- return /* @__PURE__ */ G(de, { name: r, value: u, children: [
1002
- /* @__PURE__ */ l(mt, { name: r, value: u }),
887
+ return /* @__PURE__ */ G(ce, { name: r, value: i, children: [
888
+ /* @__PURE__ */ m(ct, { name: r, value: i }),
1003
889
  e
1004
890
  ] });
1005
891
  case "radio-mark":
1006
- return /* @__PURE__ */ G(de, { name: r, value: u, children: [
892
+ return /* @__PURE__ */ G(ce, { name: r, value: i, children: [
1007
893
  e,
1008
- /* @__PURE__ */ l(me, {})
894
+ /* @__PURE__ */ m(se, {})
1009
895
  ] });
1010
896
  case "toggle":
1011
- return /* @__PURE__ */ G(ee, { name: r, value: u, children: [
1012
- /* @__PURE__ */ l(ft, { name: r, value: u }),
897
+ return /* @__PURE__ */ G(X, { name: r, value: i, children: [
898
+ /* @__PURE__ */ m(st, { name: r, value: i }),
1013
899
  e
1014
900
  ] });
1015
901
  default:
@@ -1019,30 +905,30 @@ const z = H(V), pe = U(
1019
905
  }
1020
906
  )
1021
907
  );
1022
- pe.displayName = "DropdownMenu.Item";
1023
- const st = P(
1024
- ({ className: n, ...e }, t) => /* @__PURE__ */ l("div", { ...e, className: z("item-content", n), ref: t })
908
+ we.displayName = "DropdownMenu.Item";
909
+ const ut = N(
910
+ ({ className: n, ...e }, t) => /* @__PURE__ */ m("div", { ...e, className: R("item-content", n), ref: t })
1025
911
  );
1026
- st.displayName = "DropdownMenu.ItemContent";
1027
- const lt = P(
1028
- ({ className: n, ...e }, t) => /* @__PURE__ */ l("div", { ...e, className: z("item-description", n), ref: t })
912
+ ut.displayName = "DropdownMenu.ItemContent";
913
+ const it = N(
914
+ ({ className: n, ...e }, t) => /* @__PURE__ */ m("div", { ...e, className: R("item-description", n), ref: t })
1029
915
  );
1030
- lt.displayName = "DropdownMenu.ItemDescription";
1031
- const ee = P(
1032
- ({ className: n, ...e }, t) => /* @__PURE__ */ l(ir, { ...e, className: z("item-checkbox", n), ref: t })
916
+ it.displayName = "DropdownMenu.ItemDescription";
917
+ const X = N(
918
+ ({ className: n, ...e }, t) => /* @__PURE__ */ m(ar, { ...e, className: R("item-checkbox", n), ref: t })
1033
919
  );
1034
- ee.displayName = "DropdownMenu.ItemCheckbox";
1035
- const de = P(({ className: n, ...e }, t) => /* @__PURE__ */ l(lr, { ...e, className: z("item-radio", n), ref: t }));
1036
- de.displayName = "DropdownMenu.ItemRadio";
1037
- const me = P(
1038
- ({ className: n, ...e }, t) => /* @__PURE__ */ l(rr, { ...e, className: z("item-default-check", n), ref: t, children: /* @__PURE__ */ l(Be, { name: "check", size: "md" }) })
920
+ X.displayName = "DropdownMenu.ItemCheckbox";
921
+ const ce = N(({ className: n, ...e }, t) => /* @__PURE__ */ m(lr, { ...e, className: R("item-radio", n), ref: t }));
922
+ ce.displayName = "DropdownMenu.ItemRadio";
923
+ const se = N(
924
+ ({ className: n, ...e }, t) => /* @__PURE__ */ m(or, { ...e, className: R("item-default-check", n), ref: t, children: /* @__PURE__ */ m(He, { name: "check", size: "md" }) })
1039
925
  );
1040
- me.displayName = "DropdownMenu.ItemDefaultCheck";
1041
- const dt = P(
926
+ se.displayName = "DropdownMenu.ItemDefaultCheck";
927
+ const at = N(
1042
928
  ({ name: n, value: e = !0, ...t }, r) => {
1043
- const o = ke(n, e);
1044
- return /* @__PURE__ */ Zt(
1045
- sn,
929
+ const o = xe(n, e);
930
+ return /* @__PURE__ */ Ut(
931
+ cn,
1046
932
  {
1047
933
  "aria-hidden": "true",
1048
934
  ...t,
@@ -1053,108 +939,108 @@ const dt = P(
1053
939
  );
1054
940
  }
1055
941
  );
1056
- dt.displayName = "DropdownMenu.ItemCheckboxCheck";
1057
- const mt = P(
942
+ at.displayName = "DropdownMenu.ItemCheckboxCheck";
943
+ const ct = N(
1058
944
  ({ name: n, value: e, ...t }, r) => {
1059
- const o = ke(n, e);
1060
- return /* @__PURE__ */ l(ln, { "aria-hidden": "true", ...t, checked: o, ref: r });
945
+ const o = xe(n, e);
946
+ return /* @__PURE__ */ m(sn, { "aria-hidden": "true", ...t, checked: o, ref: r });
1061
947
  }
1062
948
  );
1063
- mt.displayName = "DropdownMenu.ItemRadioCheck";
1064
- const ft = P(
949
+ ct.displayName = "DropdownMenu.ItemRadioCheck";
950
+ const st = N(
1065
951
  ({ className: n, name: e, value: t = !0, ...r }, o) => {
1066
- const u = ke(e, t);
1067
- return /* @__PURE__ */ l(
1068
- dn,
952
+ const i = xe(e, t);
953
+ return /* @__PURE__ */ m(
954
+ ln,
1069
955
  {
1070
956
  "aria-hidden": "true",
1071
957
  ...r,
1072
- checked: u,
1073
- className: z("item-toggle-check", n),
958
+ checked: i,
959
+ className: R("item-toggle-check", n),
1074
960
  ref: o,
1075
961
  size: "sm"
1076
962
  }
1077
963
  );
1078
964
  }
1079
965
  );
1080
- ft.displayName = "DropdownMenu.ItemToggleCheck";
1081
- const ke = (n, e) => {
1082
- const t = ye(), o = A(t).values[n];
966
+ st.displayName = "DropdownMenu.ItemToggleCheck";
967
+ const xe = (n, e) => {
968
+ const t = Me(), o = S(t).values[n];
1083
969
  return Array.isArray(o) ? o.includes(e) : o === e;
1084
- }, _r = H(V), ht = U(
1085
- ({ as: n = mn, className: e, ...t }, r) => /* @__PURE__ */ l(
1086
- Se,
970
+ }, Er = F(H), lt = j(
971
+ ({ as: n = mn, className: e, ...t }, r) => /* @__PURE__ */ m(
972
+ Ce,
1087
973
  {
1088
974
  ...t,
1089
975
  hideOnClick: !1,
1090
976
  ref: r,
1091
- render: /* @__PURE__ */ l(n, { className: _r("item", "search", e), icon: /* @__PURE__ */ l(Be, { name: "search" }) })
977
+ render: /* @__PURE__ */ m(n, { className: Er("item", "search", e), icon: /* @__PURE__ */ m(He, { name: "search" }) })
1092
978
  }
1093
979
  )
1094
980
  );
1095
- ht.displayName = "DropdownMenu.Search";
1096
- const Ir = H(V), vt = P(
1097
- ({ className: n, ...e }, t) => /* @__PURE__ */ l(br, { ...e, ref: t, render: /* @__PURE__ */ l("hr", { className: Ir("separator", n) }) })
981
+ lt.displayName = "DropdownMenu.Search";
982
+ const Nr = F(H), mt = N(
983
+ ({ className: n, ...e }, t) => /* @__PURE__ */ m(gr, { ...e, ref: t, render: /* @__PURE__ */ m("hr", { className: Nr("separator", n) }) })
1098
984
  );
1099
- vt.displayName = "DropdownMenu.Separator";
1100
- const bt = U(
1101
- ({ as: n, onClick: e, store: t, ...r }, o) => /* @__PURE__ */ l(
1102
- ot,
985
+ mt.displayName = "DropdownMenu.Separator";
986
+ const dt = j(
987
+ ({ as: n, onClick: e, store: t, ...r }, o) => /* @__PURE__ */ m(
988
+ et,
1103
989
  {
1104
- onClick: (c) => {
1105
- c.preventDefault(), e == null || e(c), t.toggle();
990
+ onClick: (u) => {
991
+ u.preventDefault(), e == null || e(u), t.toggle();
1106
992
  },
1107
993
  ref: o,
1108
- render: n ? (c) => /* @__PURE__ */ l(n, { ...c }) : void 0,
994
+ render: n ? (u) => /* @__PURE__ */ m(n, { ...u }) : void 0,
1109
995
  store: t,
1110
996
  ...r
1111
997
  }
1112
998
  )
1113
999
  );
1114
- bt.displayName = "DropdownMenu.Trigger";
1115
- const gt = P(
1000
+ dt.displayName = "DropdownMenu.Trigger";
1001
+ const ft = N(
1116
1002
  ({ children: n, item: e, size: t = "lg", ...r }, o) => {
1117
- const u = ye();
1118
- return /* @__PURE__ */ G(fr, { store: u, children: [
1119
- /* @__PURE__ */ l(ot, { ...r, ref: o, render: /* @__PURE__ */ l(pe, { children: e }) }),
1120
- /* @__PURE__ */ l(Ar, { size: t, withGutter: !0, children: n })
1003
+ const i = Me();
1004
+ return /* @__PURE__ */ G(fr, { store: i, children: [
1005
+ /* @__PURE__ */ m(et, { ...r, ref: o, render: /* @__PURE__ */ m(we, { children: e }) }),
1006
+ /* @__PURE__ */ m(Pr, { size: t, withGutter: !0, children: n })
1121
1007
  ] });
1122
1008
  }
1123
1009
  );
1124
- gt.displayName = "DropdownMenu.Submenu";
1125
- const Pr = H(V), Nr = 8, Er = P(
1126
- ({ className: n, size: e = "lg", store: t, withGutter: r = !0, ...o }, u) => {
1127
- const c = A(t, "arrowElement");
1128
- return /* @__PURE__ */ l(
1129
- Hn,
1010
+ ft.displayName = "DropdownMenu.Submenu";
1011
+ const Tr = F(H), Ir = 8, Ar = N(
1012
+ ({ className: n, size: e = "lg", store: t, withGutter: r = !0, ...o }, i) => {
1013
+ const u = S(t, "arrowElement");
1014
+ return /* @__PURE__ */ m(
1015
+ Vn,
1130
1016
  {
1131
1017
  ...o,
1132
1018
  "aria-label": "dropdown-menu",
1133
1019
  className: n,
1134
- gutter: r && !c ? Nr : 0,
1135
- ref: u,
1136
- render: /* @__PURE__ */ l("div", { className: Pr("root", `size-${e}`, n) }),
1020
+ gutter: r && !u ? Ir : 0,
1021
+ ref: i,
1022
+ render: /* @__PURE__ */ m("div", { className: Tr("root", `size-${e}`, n) }),
1137
1023
  store: t,
1138
1024
  tabIndex: 0
1139
1025
  }
1140
1026
  );
1141
1027
  }
1142
- ), Ar = Object.assign(Er, {
1143
- Action: ut,
1144
- Arrow: at,
1145
- Content: st,
1146
- Description: lt,
1147
- Group: it,
1148
- GroupLabel: ct,
1149
- Item: pe,
1150
- Search: ht,
1151
- Separator: vt,
1152
- Submenu: gt,
1153
- Trigger: bt
1028
+ ), Pr = Object.assign(Ar, {
1029
+ Action: tt,
1030
+ Arrow: nt,
1031
+ Content: ut,
1032
+ Description: it,
1033
+ Group: rt,
1034
+ GroupLabel: ot,
1035
+ Item: we,
1036
+ Search: lt,
1037
+ Separator: mt,
1038
+ Submenu: ft,
1039
+ Trigger: dt
1154
1040
  });
1155
1041
  export {
1156
- Ar as DropdownMenu,
1157
- V as dropdownMenuClasses,
1158
- ye as useDropdownMenu,
1159
- A as useStoreState
1042
+ Pr as DropdownMenu,
1043
+ H as dropdownMenuClasses,
1044
+ Me as useDropdownMenu,
1045
+ S as useStoreState
1160
1046
  };