@wrdagency/blockout 1.0.27 → 1.0.30

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 (128) hide show
  1. package/dist/{2NBKRL7C-M2oB5mLz.js → 2NBKRL7C-DBbnghCe.js} +16 -16
  2. package/dist/{2RSXSRCN-BtBMZ8Lx.js → 2RSXSRCN-BxQ_v-Je.js} +15 -15
  3. package/dist/{4CMBR7SL-C-0Aig1V.js → 4CMBR7SL-DezfZPUS.js} +18 -18
  4. package/dist/{5JTVDSTH-BOGL3M3F.js → 5JTVDSTH-CZ7mfyUK.js} +4 -4
  5. package/dist/{5VQZOHHZ-DADExXg7.js → 5VQZOHHZ-DLX-ulBK.js} +1 -1
  6. package/dist/{6VRAQV3D-pTuMqsWW.js → 6VRAQV3D-BYmT0QTl.js} +6 -6
  7. package/dist/{A3WPL2ZJ-BiXYGxnE.js → A3WPL2ZJ-24tGIJIQ.js} +2 -2
  8. package/dist/{BM6PGYQY-DL-j4NGc.js → BM6PGYQY-DCbkDr5N.js} +2 -2
  9. package/dist/{DG5U6ZEL-Bn6QlO7C.js → DG5U6ZEL-DB0iwihy.js} +3 -3
  10. package/dist/{EM5CXX6A-B4C-NFJy.js → EM5CXX6A-B4ZS4Hs_.js} +2 -2
  11. package/dist/{F5MUBM3I-D6cacg-c.js → F5MUBM3I-75qY3y0N.js} +9 -9
  12. package/dist/{G7GW6PWC-C6qSYISF.js → G7GW6PWC-Dk4hVbAk.js} +74 -74
  13. package/dist/{IWEFDH56-Da7lGcXC.js → IWEFDH56-BACkQ6dc.js} +3 -3
  14. package/dist/{J2LQO3EC-XUQS0UAH.js → J2LQO3EC-BXJIaM2U.js} +2 -2
  15. package/dist/JMHAJKUZ-D5KCN1Aj.js +114 -0
  16. package/dist/{KFH4SEIX-C-0wHvda.js → KFH4SEIX-DaQeP5D_.js} +3 -3
  17. package/dist/{LMDWO4NN-ZnclRjpA.js → LMDWO4NN-CpSMaD5G.js} +21 -21
  18. package/dist/MAXQOH4L-BYWBWXpb.js +459 -0
  19. package/dist/{MR26YJYP-CWddku_H.js → MR26YJYP-CTh6rCwA.js} +39 -39
  20. package/dist/{MTZPJQMC-CNgogsHX.js → MTZPJQMC-D2i4-LA_.js} +2 -2
  21. package/dist/{O2PQ2652-DkPiHeUQ.js → O2PQ2652-DIoegIkE.js} +3 -3
  22. package/dist/{P7GR5CS5-bOyAbBNR.js → P7GR5CS5-3RsPGPTy.js} +1 -1
  23. package/dist/{PFRGBC2K-BS9YO5-Q.js → PFRGBC2K-BdRJd-gU.js} +16 -16
  24. package/dist/{RS7LB2H4-BpSl1D2T.js → RS7LB2H4-COOfOq9w.js} +1 -1
  25. package/dist/{RZ4GPYOB-D4dwmRZg.js → RZ4GPYOB-CovncfhJ.js} +5 -5
  26. package/dist/{S43UC3DV-BVbmEy3J.js → S43UC3DV-HCi6u_G4.js} +8 -8
  27. package/dist/{T7VMP3TM-BnzhAoaO.js → T7VMP3TM-C8D6mVva.js} +21 -21
  28. package/dist/{TIW3GMFC-C4Bh_hzw.js → TIW3GMFC-BF0w2_9R.js} +4 -4
  29. package/dist/{TP7N7UIH-Bs0NX7lb.js → TP7N7UIH-C4jXJDlO.js} +2 -2
  30. package/dist/{UQQRIHDV-C_0T8mGy.js → UQQRIHDV-DEGlgATx.js} +8 -8
  31. package/dist/{UYGDZTLQ-BDhCZlZ2.js → UYGDZTLQ-HiDKLOW5.js} +2 -2
  32. package/dist/{VIIRIBF3-CQdc2eWO.js → VIIRIBF3-B-djNAU9.js} +3 -3
  33. package/dist/{WMYDSCNQ-J1-TanSP.js → WMYDSCNQ-pGjWB-Pk.js} +6 -6
  34. package/dist/{WYCIER3C-CABEZy1i.js → WYCIER3C-CxfgpZG_.js} +2 -2
  35. package/dist/{YORGHBM4-B1RRY_xR.js → YORGHBM4-D_fOXG5Y.js} +1 -1
  36. package/dist/{YV4JVR4I-BuKFdNa0.js → YV4JVR4I-CQnJhUSg.js} +38 -38
  37. package/dist/assets/button.css +1 -1
  38. package/dist/assets/index2.css +1 -1
  39. package/dist/assets/index9.css +1 -1
  40. package/dist/assets/static.css +1 -1
  41. package/dist/assets/style.css +1 -1
  42. package/dist/assets/style16.css +1 -1
  43. package/dist/assets/style25.css +1 -1
  44. package/dist/assets/style6.css +1 -1
  45. package/dist/{combobox-group-Q7OatWHm.js → combobox-group-hNvv1WJm.js} +3 -3
  46. package/dist/{combobox-popover-CDfaOt6J.js → combobox-popover-BZ_1wNrj.js} +5 -5
  47. package/dist/components/avatar/index.d.ts +2 -2
  48. package/dist/components/avatar/index.js +20 -18
  49. package/dist/components/breadcrumbs/index.js +5 -5
  50. package/dist/components/button/row.js +4 -4
  51. package/dist/components/command-palette/dialog.js +2 -2
  52. package/dist/components/command-palette/index.js +5 -3
  53. package/dist/components/command-palette/presets.d.ts +4 -0
  54. package/dist/components/command-palette/presets.js +10 -0
  55. package/dist/components/command-palette/static.d.ts +4 -11
  56. package/dist/components/command-palette/static.js +43 -124
  57. package/dist/components/controls/base-popover-control/index.js +3 -3
  58. package/dist/components/controls/date-control/index.js +1 -1
  59. package/dist/components/controls/date-control/picker.js +5 -5
  60. package/dist/components/controls/select-control/control.js +23 -23
  61. package/dist/components/controls/select-control/props.d.ts +2 -2
  62. package/dist/components/controls/select-control/select.js +79 -67
  63. package/dist/components/controls/tag-control/ariakit-experimental.js +1102 -1115
  64. package/dist/components/controls/tag-control/index.js +8 -7
  65. package/dist/components/dialog/index.js +2 -2
  66. package/dist/components/filesystem/file.js +1 -1
  67. package/dist/components/filesystem/folder.js +5 -5
  68. package/dist/components/filesystem/list.js +1 -1
  69. package/dist/components/filesystem/root.js +1 -1
  70. package/dist/components/index.d.ts +1 -1
  71. package/dist/components/menu/index.js +2 -2
  72. package/dist/components/menu/item.js +1 -1
  73. package/dist/components/menu/items/action.js +1 -1
  74. package/dist/components/menu/items/spacer.js +1 -1
  75. package/dist/components/menu/items/submenu.js +3 -3
  76. package/dist/components/menu/items/toggle.js +1 -1
  77. package/dist/components/shell/index.js +14 -12
  78. package/dist/components/shell/navigation-separator.d.ts +6 -0
  79. package/dist/components/shell/navigation-separator.js +14 -0
  80. package/dist/components/shell/sidebar-item.d.ts +5 -4
  81. package/dist/components/shell/sidebar-item.js +25 -19
  82. package/dist/components/tabs/list.js +1 -1
  83. package/dist/components/tabs/panel.js +1 -1
  84. package/dist/components/tabs/root.js +1 -1
  85. package/dist/components/tabs/tab.js +1 -1
  86. package/dist/components/toolbar/divider.js +1 -1
  87. package/dist/components/toolbar/index.js +1 -1
  88. package/dist/components/toolbar/root.js +1 -1
  89. package/dist/components/window/index.js +1 -1
  90. package/dist/{composite-provider-VHhinf1k.js → composite-provider-BPIeS4Cg.js} +2 -2
  91. package/dist/{disclosure-provider-BUQRx-hY.js → disclosure-provider-cEVysvZT.js} +2 -2
  92. package/dist/index.d.ts +1 -0
  93. package/dist/index.js +76 -55
  94. package/dist/{item-PTynqLvp.js → item-CmTk8eHD.js} +2 -2
  95. package/dist/{menu-button-RmWWFvwE.js → menu-button-GQO5dB3U.js} +12 -12
  96. package/dist/{menu-separator-DgYHkDAA.js → menu-separator-Z6pSHpX5.js} +3 -3
  97. package/dist/{picker-DioIiYC0.js → picker-DyJogHYh.js} +4 -4
  98. package/dist/{popover-provider-HlPXIcud.js → popover-provider-BJEfhgr1.js} +2 -2
  99. package/dist/presets-BDIhXP0C.js +148 -0
  100. package/dist/primitives/icon-label/index.d.ts +2 -0
  101. package/dist/primitives/icon-label/index.js +18 -14
  102. package/dist/primitives/link/index.d.ts +3 -1
  103. package/dist/primitives/link/index.js +25 -24
  104. package/dist/primitives/nav-link/index.d.ts +4 -3
  105. package/dist/primitives/nav-link/index.js +21 -17
  106. package/dist/primitives/popover/root.d.ts +2 -3
  107. package/dist/primitives/popover/root.js +1 -1
  108. package/dist/primitives/popover/target.js +1 -1
  109. package/dist/primitives/popover/window.js +3 -3
  110. package/dist/primitives/tooltip/index.d.ts +2 -0
  111. package/dist/primitives/tooltip/index.js +36 -24
  112. package/dist/select-popover-CGgkyRb4.js +559 -0
  113. package/dist/{select-value-3BLrBdZV.js → select-value-B3DYk9eV.js} +2 -2
  114. package/dist/{tab-CKUPUgQ2.js → tab-DejwS4C8.js} +4 -4
  115. package/dist/{tab-list-CzsRzSiN.js → tab-list-CndMWcVv.js} +3 -3
  116. package/dist/{tab-panel-YGzJnU1g.js → tab-panel-DedzuWUA.js} +7 -7
  117. package/dist/{tab-provider-CV8qTybg.js → tab-provider-B0BoLfST.js} +6 -6
  118. package/dist/{tag-remove-DmlHu_9b.js → tag-remove-Dz-sGbyZ.js} +24 -24
  119. package/dist/{toolbar-BlVhTG5v.js → toolbar-PSaF1mdF.js} +5 -5
  120. package/dist/{toolbar-separator-liolx0p8.js → toolbar-separator-DJHiHbGj.js} +3 -3
  121. package/dist/{tooltip-arrow-CjZ1x0xv.js → tooltip-arrow-BVwULA6B.js} +17 -17
  122. package/dist/types/options.d.ts +14 -0
  123. package/dist/types/options.js +44 -12
  124. package/dist/utils/index.d.ts +8 -0
  125. package/dist/utils/index.js +23 -0
  126. package/package.json +1 -1
  127. package/dist/MAXQOH4L-lpuvS1NR.js +0 -564
  128. package/dist/select-popover-P8y2n3bQ.js +0 -542
@@ -1,542 +0,0 @@
1
- import { u as Se, a as se, S as be, b as xe, c as Oe, d as Ce, e as de } from "./DG5U6ZEL-Bn6QlO7C.js";
2
- import { u as Ie } from "./MTZPJQMC-CNgogsHX.js";
3
- import { c as R, _ as T, i as Y, m as I, o as p, r as Ae, f as H, a as F, Y as De, V as W, U as O, W as V, X as _e, j as k, e as le, H as Ve, l as X, n as he, S as ke, s as Ke, q as ge, t as Le, P as Me, Q as Ne, R as Re, h as Te, u as He, ac as Fe } from "./LMDWO4NN-ZnclRjpA.js";
4
- import { useMemo as ae, useState as Q, useRef as je, useEffect as ne, useCallback as Be, useContext as me, createContext as $e } from "react";
5
- import { jsx as P, jsxs as oe, Fragment as ve } from "react/jsx-runtime";
6
- import { u as we } from "./T7VMP3TM-BnzhAoaO.js";
7
- import { u as Ue } from "./WMYDSCNQ-J1-TanSP.js";
8
- import { t as ye } from "./7PRQYBBV-91wrWGjk.js";
9
- import { c as qe, a as We } from "./O2PQ2652-DkPiHeUQ.js";
10
- import { c as ze, d as Ge, b as Qe } from "./4CMBR7SL-C-0Aig1V.js";
11
- import { u as Xe } from "./S43UC3DV-BVbmEy3J.js";
12
- import { m as Ye, o as Je, t as Ze, c as et, s as z, d as re, g as tt, b as ot, f as pe, u as rt } from "./YV4JVR4I-BuKFdNa0.js";
13
- import { u as nt } from "./UQQRIHDV-C_0T8mGy.js";
14
- import { u as st } from "./6VRAQV3D-pTuMqsWW.js";
15
- import { i as lt } from "./KFH4SEIX-C-0wHvda.js";
16
- import { u as at } from "./5JTVDSTH-BOGL3M3F.js";
17
- import { c as it, u as ut } from "./G7GW6PWC-C6qSYISF.js";
18
- var ct = "span", dt = {
19
- top: "4,10 8,6 12,10",
20
- right: "6,4 10,8 6,12",
21
- bottom: "4,6 8,10 12,6",
22
- left: "10,4 6,8 10,12"
23
- }, Pe = R(function(o) {
24
- var r = o, { store: e, placement: t } = r, a = T(r, ["store", "placement"]);
25
- const m = Ie();
26
- e = e || m, Y(
27
- e,
28
- process.env.NODE_ENV !== "production" && "PopoverDisclosureArrow must be wrapped in a PopoverDisclosure component."
29
- );
30
- const E = e.useState((n) => t || n.placement).split("-")[0], u = dt[E], l = ae(
31
- () => /* @__PURE__ */ P(
32
- "svg",
33
- {
34
- display: "block",
35
- fill: "none",
36
- stroke: "currentColor",
37
- strokeLinecap: "round",
38
- strokeLinejoin: "round",
39
- strokeWidth: 1.5,
40
- viewBox: "0 0 16 16",
41
- height: "1em",
42
- width: "1em",
43
- children: /* @__PURE__ */ P("polyline", { points: u })
44
- }
45
- ),
46
- [u]
47
- );
48
- return a = I(p({
49
- children: l,
50
- "aria-hidden": !0
51
- }, a), {
52
- style: p({
53
- width: "1em",
54
- height: "1em",
55
- pointerEvents: "none"
56
- }, a.style)
57
- }), Ae(a);
58
- }), Qt = H(
59
- function(o) {
60
- const r = Pe(o);
61
- return F(ct, r);
62
- }
63
- );
64
- function mt(s = {}) {
65
- var o = s, {
66
- combobox: r
67
- } = o, e = De(o, [
68
- "combobox"
69
- ]);
70
- const t = Ye(
71
- e.store,
72
- Je(r, [
73
- "value",
74
- "items",
75
- "renderedItems",
76
- "baseElement",
77
- "arrowElement",
78
- "anchorElement",
79
- "contentElement",
80
- "popoverElement",
81
- "disclosureElement"
82
- ])
83
- );
84
- Ze(e, t);
85
- const a = t.getState(), m = ze(W(V({}, e), {
86
- store: t,
87
- virtualFocus: O(
88
- e.virtualFocus,
89
- a.virtualFocus,
90
- !0
91
- ),
92
- includesBaseElement: O(
93
- e.includesBaseElement,
94
- a.includesBaseElement,
95
- !1
96
- ),
97
- activeId: O(
98
- e.activeId,
99
- a.activeId,
100
- e.defaultActiveId,
101
- null
102
- ),
103
- orientation: O(
104
- e.orientation,
105
- a.orientation,
106
- "vertical"
107
- )
108
- })), S = qe(W(V({}, e), {
109
- store: t,
110
- placement: O(
111
- e.placement,
112
- a.placement,
113
- "bottom-start"
114
- )
115
- })), E = new String(""), u = W(V(V({}, m.getState()), S.getState()), {
116
- value: O(
117
- e.value,
118
- a.value,
119
- e.defaultValue,
120
- E
121
- ),
122
- setValueOnMove: O(
123
- e.setValueOnMove,
124
- a.setValueOnMove,
125
- !1
126
- ),
127
- labelElement: O(a.labelElement, null),
128
- selectElement: O(a.selectElement, null),
129
- listElement: O(a.listElement, null)
130
- }), l = et(u, m, S, t);
131
- return z(
132
- l,
133
- () => re(l, ["value", "items"], (n) => {
134
- if (n.value !== E || !n.items.length) return;
135
- const f = n.items.find(
136
- (b) => !b.disabled && b.value != null
137
- );
138
- (f == null ? void 0 : f.value) != null && l.setState("value", f.value);
139
- })
140
- ), z(
141
- l,
142
- () => re(l, ["mounted"], (n) => {
143
- n.mounted || l.setState("activeId", u.activeId);
144
- })
145
- ), z(
146
- l,
147
- () => re(l, ["mounted", "items", "value"], (n) => {
148
- if (r || n.mounted) return;
149
- const f = ye(n.value), b = f[f.length - 1];
150
- if (b == null) return;
151
- const w = n.items.find(
152
- (g) => !g.disabled && g.value === b
153
- );
154
- w && l.setState("activeId", w.id);
155
- })
156
- ), z(
157
- l,
158
- () => tt(l, ["setValueOnMove", "moves"], (n) => {
159
- const { mounted: f, value: b, activeId: w } = l.getState();
160
- if (!n.setValueOnMove && f || Array.isArray(b) || !n.moves || !w) return;
161
- const g = m.item(w);
162
- !g || g.disabled || g.value == null || l.setState("value", g.value);
163
- })
164
- ), W(V(V(V({}, m), S), l), {
165
- combobox: r,
166
- setValue: (n) => l.setState("value", n),
167
- setLabelElement: (n) => l.setState("labelElement", n),
168
- setSelectElement: (n) => l.setState("selectElement", n),
169
- setListElement: (n) => l.setState("listElement", n)
170
- });
171
- }
172
- function vt(s) {
173
- const o = Xe();
174
- return s = I(p({}, s), {
175
- combobox: s.combobox !== void 0 ? s.combobox : o
176
- }), Ge(s);
177
- }
178
- function pt(s, o, r) {
179
- return _e(o, [r.combobox]), pe(s, r, "value", "setValue"), pe(s, r, "setValueOnMove"), Object.assign(
180
- We(
181
- Qe(s, o, r),
182
- o,
183
- r
184
- ),
185
- { combobox: r.combobox }
186
- );
187
- }
188
- function ft(s = {}) {
189
- s = vt(s);
190
- const [o, r] = ot(mt, s);
191
- return pt(o, r, s);
192
- }
193
- var St = "span", bt = R(
194
- function(o) {
195
- var r = o, { store: e } = r, t = T(r, ["store"]);
196
- const a = Se();
197
- return e = e || a, t = Pe(p({ store: e }, t)), t;
198
- }
199
- ), ht = H(function(o) {
200
- const r = bt(o);
201
- return F(St, r);
202
- }), gt = "button";
203
- function wt(s) {
204
- return Array.from(s.selectedOptions).map((o) => o.value);
205
- }
206
- function G(s, o) {
207
- return () => {
208
- const r = o();
209
- if (!r) return;
210
- let e = 0, t = s.item(r);
211
- const a = t;
212
- for (; t && t.value == null; ) {
213
- const m = o(++e);
214
- if (!m) return;
215
- if (t = s.item(m), t === a) break;
216
- }
217
- return t == null ? void 0 : t.id;
218
- };
219
- }
220
- var yt = R(function(o) {
221
- var r = o, {
222
- store: e,
223
- name: t,
224
- form: a,
225
- required: m,
226
- showOnKeyDown: S = !0,
227
- moveOnKeyDown: E = !0,
228
- toggleOnPress: u = !0,
229
- toggleOnClick: l = u
230
- } = r, n = T(r, [
231
- "store",
232
- "name",
233
- "form",
234
- "required",
235
- "showOnKeyDown",
236
- "moveOnKeyDown",
237
- "toggleOnPress",
238
- "toggleOnClick"
239
- ]);
240
- const f = se();
241
- e = e || f, Y(
242
- e,
243
- process.env.NODE_ENV !== "production" && "Select must receive a `store` prop or be wrapped in a SelectProvider component."
244
- );
245
- const b = n.onKeyDown, w = k(S), g = k(E), y = e.useState("placement").split("-")[0], x = e.useState("value"), D = Array.isArray(x), L = le((c) => {
246
- var d;
247
- if (b == null || b(c), c.defaultPrevented || !e) return;
248
- const { orientation: Z, items: ee, activeId: $ } = e.getState(), U = Z !== "horizontal", q = Z !== "vertical", v = !!((d = ee.find((ce) => !ce.disabled && ce.value != null)) != null && d.rowId), ie = {
249
- ArrowUp: (v || U) && G(e, e.up),
250
- ArrowRight: (v || q) && G(e, e.next),
251
- ArrowDown: (v || U) && G(e, e.down),
252
- ArrowLeft: (v || q) && G(e, e.previous)
253
- }[c.key];
254
- ie && g(c) && (c.preventDefault(), e.move(ie()));
255
- const ue = y === "top" || y === "bottom";
256
- ({
257
- ArrowDown: ue,
258
- ArrowUp: ue,
259
- ArrowLeft: y === "left",
260
- ArrowRight: y === "right"
261
- })[c.key] && w(c) && (c.preventDefault(), e.move($), Ve(c.currentTarget, "keyup", e.show));
262
- });
263
- n = X(
264
- n,
265
- (c) => /* @__PURE__ */ P(be, { value: e, children: c }),
266
- [e]
267
- );
268
- const [j, M] = Q(!1), C = je(!1);
269
- ne(() => {
270
- const c = C.current;
271
- C.current = !1, !c && M(!1);
272
- }, [x]);
273
- const N = e.useState((c) => {
274
- var d;
275
- return (d = c.labelElement) == null ? void 0 : d.id;
276
- }), i = n["aria-label"], h = n["aria-labelledby"] || N, _ = e.useState((c) => {
277
- if (t)
278
- return c.items;
279
- }), A = ae(() => [...new Set(_ == null ? void 0 : _.map((c) => c.value).filter((c) => c != null))], [_]);
280
- n = X(
281
- n,
282
- (c) => t ? /* @__PURE__ */ oe(ve, { children: [
283
- /* @__PURE__ */ oe(
284
- "select",
285
- {
286
- style: {
287
- border: 0,
288
- clip: "rect(0 0 0 0)",
289
- height: "1px",
290
- margin: "-1px",
291
- overflow: "hidden",
292
- padding: 0,
293
- position: "absolute",
294
- whiteSpace: "nowrap",
295
- width: "1px"
296
- },
297
- tabIndex: -1,
298
- "aria-hidden": !0,
299
- "aria-label": i,
300
- "aria-labelledby": h,
301
- name: t,
302
- form: a,
303
- required: m,
304
- disabled: n.disabled,
305
- value: x,
306
- multiple: D,
307
- onFocus: () => {
308
- var d;
309
- return (d = e == null ? void 0 : e.getState().selectElement) == null ? void 0 : d.focus();
310
- },
311
- onChange: (d) => {
312
- C.current = !0, M(!0), e == null || e.setValue(
313
- D ? wt(d.target) : d.target.value
314
- );
315
- },
316
- children: [
317
- ye(x).map((d) => d == null || A.includes(d) ? null : /* @__PURE__ */ P("option", { value: d, children: d }, d)),
318
- A.map((d) => /* @__PURE__ */ P("option", { value: d, children: d }, d))
319
- ]
320
- }
321
- ),
322
- c
323
- ] }) : c,
324
- [
325
- e,
326
- i,
327
- h,
328
- t,
329
- a,
330
- m,
331
- x,
332
- D,
333
- A,
334
- n.disabled
335
- ]
336
- );
337
- const B = /* @__PURE__ */ oe(ve, { children: [
338
- x,
339
- /* @__PURE__ */ P(ht, {})
340
- ] }), J = e.useState("contentElement");
341
- return n = I(p({
342
- role: "combobox",
343
- "aria-autocomplete": "none",
344
- "aria-labelledby": N,
345
- "aria-haspopup": ke(J, "listbox"),
346
- "data-autofill": j || void 0,
347
- "data-name": t,
348
- children: B
349
- }, n), {
350
- ref: he(e.setSelectElement, n.ref),
351
- onKeyDown: L
352
- }), n = Ue(p({ store: e, toggleOnClick: l }, n)), n = we(p({ store: e }, n)), n;
353
- }), Xt = H(function(o) {
354
- const r = yt(o);
355
- return F(gt, r);
356
- });
357
- function Yt(s = {}) {
358
- const o = ft(s);
359
- return /* @__PURE__ */ P(xe, { value: o, children: s.children });
360
- }
361
- var Pt = "div";
362
- function Et(s, o) {
363
- if (o != null)
364
- return s == null ? !1 : Array.isArray(s) ? s.includes(o) : s === o;
365
- }
366
- var xt = R(
367
- function(o) {
368
- var r = o, {
369
- store: e,
370
- value: t,
371
- getItem: a,
372
- hideOnClick: m,
373
- setValueOnClick: S = t != null,
374
- preventScrollOnKeyDown: E = !0,
375
- focusOnHover: u = !0
376
- } = r, l = T(r, [
377
- "store",
378
- "value",
379
- "getItem",
380
- "hideOnClick",
381
- "setValueOnClick",
382
- "preventScrollOnKeyDown",
383
- "focusOnHover"
384
- ]), n;
385
- const f = Oe();
386
- e = e || f, Y(
387
- e,
388
- process.env.NODE_ENV !== "production" && "SelectItem must be wrapped in a SelectList or SelectPopover component."
389
- );
390
- const b = ge(l.id), w = Le(l), { listElement: g, multiSelectable: K, selected: y, autoFocus: x } = rt(e, {
391
- listElement: "listElement",
392
- multiSelectable(i) {
393
- return Array.isArray(i.value);
394
- },
395
- selected(i) {
396
- return Et(i.value, t);
397
- },
398
- autoFocus(i) {
399
- return t == null || i.value == null || i.activeId !== b && (e != null && e.item(i.activeId)) ? !1 : Array.isArray(i.value) ? i.value[i.value.length - 1] === t : i.value === t;
400
- }
401
- }), D = Be(
402
- (i) => {
403
- const h = I(p({}, i), {
404
- value: w ? void 0 : t,
405
- children: t
406
- });
407
- return a ? a(h) : h;
408
- },
409
- [w, t, a]
410
- );
411
- m = m ?? (t != null && !K);
412
- const L = l.onClick, j = k(S), M = k(m), C = le((i) => {
413
- L == null || L(i), !i.defaultPrevented && (Me(i) || Ne(i) || (j(i) && t != null && (e == null || e.setValue((h) => Array.isArray(h) ? h.includes(t) ? h.filter((_) => _ !== t) : [...h, t] : t)), M(i) && (e == null || e.hide())));
414
- });
415
- l = X(
416
- l,
417
- (i) => /* @__PURE__ */ P(Ce.Provider, { value: y ?? !1, children: i }),
418
- [y]
419
- ), l = I(p({
420
- id: b,
421
- role: Re(g),
422
- "aria-selected": y,
423
- children: t
424
- }, l), {
425
- autoFocus: (n = l.autoFocus) != null ? n : x,
426
- onClick: C
427
- }), l = st(p({
428
- store: e,
429
- getItem: D,
430
- preventScrollOnKeyDown: E
431
- }, l));
432
- const N = k(u);
433
- return l = nt(I(p({
434
- store: e
435
- }, l), {
436
- // We have to disable focusOnHover when the popup is closed, otherwise
437
- // the active item will change to null (the container) when the popup is
438
- // closed by clicking on an item.
439
- focusOnHover(i) {
440
- if (!N(i)) return !1;
441
- const h = e == null ? void 0 : e.getState();
442
- return !!(h != null && h.open);
443
- }
444
- })), l;
445
- }
446
- ), Jt = Ke(
447
- H(function(o) {
448
- const r = xt(o);
449
- return F(Pt, r);
450
- })
451
- ), Ot = "div", fe = $e(null), Ee = R(
452
- function(o) {
453
- var r = o, {
454
- store: e,
455
- resetOnEscape: t = !0,
456
- hideOnEnter: a = !0,
457
- focusOnMove: m = !0,
458
- composite: S,
459
- alwaysVisible: E
460
- } = r, u = T(r, [
461
- "store",
462
- "resetOnEscape",
463
- "hideOnEnter",
464
- "focusOnMove",
465
- "composite",
466
- "alwaysVisible"
467
- ]);
468
- const l = Se();
469
- e = e || l, Y(
470
- e,
471
- process.env.NODE_ENV !== "production" && "SelectList must receive a `store` prop or be wrapped in a SelectProvider component."
472
- );
473
- const n = ge(u.id), f = e.useState("value"), b = Array.isArray(f), [w, g] = Q(f), K = e.useState("mounted");
474
- ne(() => {
475
- K || g(f);
476
- }, [K, f]), t = t && !b;
477
- const y = u.onKeyDown, x = k(t), D = k(a), L = le((v) => {
478
- y == null || y(v), !v.defaultPrevented && (v.key === "Escape" && x(v) && (e == null || e.setValue(w)), (v.key === " " || v.key === "Enter") && Te(v) && D(v) && (v.preventDefault(), e == null || e.hide()));
479
- }), j = me(de), M = Q(), [C, N] = j || M, i = ae(
480
- () => [C, N],
481
- [C]
482
- ), [h, _] = Q(null), A = me(fe);
483
- ne(() => {
484
- if (A)
485
- return A(e), () => A(null);
486
- }, [A, e]), u = X(
487
- u,
488
- (v) => /* @__PURE__ */ P(be, { value: e, children: /* @__PURE__ */ P(fe.Provider, { value: _, children: /* @__PURE__ */ P(de.Provider, { value: i, children: v }) }) }),
489
- [e, i]
490
- );
491
- const B = !!e.combobox;
492
- S = S ?? (!B && h !== e);
493
- const [J, c] = He(
494
- S ? e.setListElement : null
495
- ), d = Fe(J, "role", u.role), ee = (S || (d === "listbox" || d === "menu" || d === "tree" || d === "grid")) && b || void 0, $ = lt(K, u.hidden, E), U = $ ? I(p({}, u.style), { display: "none" }) : u.style;
496
- S && (u = p({
497
- role: "listbox",
498
- "aria-multiselectable": ee
499
- }, u));
500
- const q = e.useState(
501
- (v) => {
502
- var te;
503
- return C || ((te = v.labelElement) == null ? void 0 : te.id);
504
- }
505
- );
506
- return u = I(p({
507
- id: n,
508
- "aria-labelledby": q,
509
- hidden: $
510
- }, u), {
511
- ref: he(c, u.ref),
512
- style: U,
513
- onKeyDown: L
514
- }), u = at(I(p({ store: e }, u), { composite: S })), u = we(p({ store: e, typeahead: !B }, u)), u;
515
- }
516
- ), Zt = H(function(o) {
517
- const r = Ee(o);
518
- return F(Ot, r);
519
- }), Ct = "div", It = R(
520
- function(o) {
521
- var r = o, { store: e, alwaysVisible: t } = r, a = T(r, ["store", "alwaysVisible"]);
522
- const m = se();
523
- return e = e || m, a = Ee(p({ store: e, alwaysVisible: t }, a)), a = ut(p({ store: e, alwaysVisible: t }, a)), a;
524
- }
525
- ), eo = it(
526
- H(function(o) {
527
- const r = It(o);
528
- return F(Ct, r);
529
- }),
530
- se
531
- );
532
- export {
533
- Qt as P,
534
- Yt as S,
535
- Xt as a,
536
- eo as b,
537
- Zt as c,
538
- Jt as d,
539
- ht as e,
540
- ft as f,
541
- Pe as u
542
- };