@wrdagency/blockout 1.0.4 → 1.0.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 (198) hide show
  1. package/dist/2NBKRL7C-CzwWfv1x.js +76 -0
  2. package/dist/2RSXSRCN-rMUAytae.js +61 -0
  3. package/dist/{4CMBR7SL-xNGezbCB.js → 4CMBR7SL-ChJnawVl.js} +132 -126
  4. package/dist/{5JTVDSTH-CIreO5bC.js → 5JTVDSTH-DcfjjEya.js} +4 -4
  5. package/dist/{5VQZOHHZ-CNzYHc1X.js → 5VQZOHHZ-BN-teS5E.js} +1 -1
  6. package/dist/{6VRAQV3D-BoLhl3hf.js → 6VRAQV3D-DK_p41oq.js} +6 -6
  7. package/dist/A3WPL2ZJ-CpUtG5Sk.js +12 -0
  8. package/dist/{BM6PGYQY-Bhr7peim.js → BM6PGYQY-CkMwDqt0.js} +2 -2
  9. package/dist/Check.es-CMkTf2It.js +38 -0
  10. package/dist/{DG5U6ZEL-C7eLVyh-.js → DG5U6ZEL-GfwW2sqh.js} +3 -3
  11. package/dist/EM5CXX6A-C74NAQPE.js +13 -0
  12. package/dist/{F5MUBM3I-_HauDyEF.js → F5MUBM3I-BbDMTUwx.js} +24 -24
  13. package/dist/{G7GW6PWC-Crp1Jn-8.js → G7GW6PWC-A0eDeXMt.js} +100 -96
  14. package/dist/IWEFDH56-CvOsIcbb.js +19 -0
  15. package/dist/{J2LQO3EC-CcHJqN0I.js → J2LQO3EC-DYtZQQv6.js} +4 -3
  16. package/dist/{KFH4SEIX-D-fCkpQv.js → KFH4SEIX-BFT9WmYk.js} +3 -3
  17. package/dist/{LMDWO4NN-DdLnHzru.js → LMDWO4NN-CIZvvtic.js} +233 -203
  18. package/dist/MAXQOH4L-DBaf8WKp.js +564 -0
  19. package/dist/MR26YJYP-DacZIkgJ.js +287 -0
  20. package/dist/MTZPJQMC-DPwZ6caC.js +13 -0
  21. package/dist/{O2PQ2652-THp22K4G.js → O2PQ2652-D2GSkoLq.js} +6 -6
  22. package/dist/P7GR5CS5-5PtDURPc.js +24 -0
  23. package/dist/{PFRGBC2K-DUhGSIey.js → PFRGBC2K-B9ko--FF.js} +34 -33
  24. package/dist/Plus.es-DJ5SuqNv.js +38 -0
  25. package/dist/RS7LB2H4-BvDKQaCt.js +18 -0
  26. package/dist/RZ4GPYOB-COPqjbOz.js +37 -0
  27. package/dist/{S43UC3DV-erT1ucAd.js → S43UC3DV-CiBKpqp8.js} +3 -3
  28. package/dist/{T7VMP3TM-C-Aesx9K.js → T7VMP3TM-C0xl-w4G.js} +21 -21
  29. package/dist/TP7N7UIH-Dc0CLLi8.js +33 -0
  30. package/dist/{UQQRIHDV-DIXH69U3.js → UQQRIHDV-BBkcyl82.js} +17 -17
  31. package/dist/UYGDZTLQ-9uAEICxv.js +13 -0
  32. package/dist/VIIRIBF3-uvnIyICw.js +31 -0
  33. package/dist/WMYDSCNQ-D4CU76mX.js +61 -0
  34. package/dist/{WYCIER3C-S-jsj0wy.js → WYCIER3C-CaoIoaX7.js} +4 -4
  35. package/dist/{YV4JVR4I-BXEaRiAN.js → YV4JVR4I-w1-dnslS.js} +47 -47
  36. package/dist/assets/index10.css +1 -1
  37. package/dist/assets/index11.css +1 -1
  38. package/dist/assets/index12.css +1 -1
  39. package/dist/assets/index13.css +1 -1
  40. package/dist/assets/index14.css +1 -1
  41. package/dist/assets/index15.css +1 -1
  42. package/dist/assets/index16.css +1 -1
  43. package/dist/assets/index17.css +1 -1
  44. package/dist/assets/index4.css +1 -1
  45. package/dist/assets/style16.css +1 -1
  46. package/dist/assets/style17.css +1 -1
  47. package/dist/assets/style18.css +1 -1
  48. package/dist/assets/style19.css +1 -1
  49. package/dist/assets/style20.css +1 -1
  50. package/dist/assets/style21.css +1 -1
  51. package/dist/assets/style22.css +1 -1
  52. package/dist/assets/style23.css +1 -1
  53. package/dist/assets/style24.css +1 -1
  54. package/dist/assets/style25.css +1 -1
  55. package/dist/assets/style26.css +1 -1
  56. package/dist/assets/style27.css +1 -0
  57. package/dist/components/breadcrumbs/index.js +5 -5
  58. package/dist/components/button/row.js +4 -4
  59. package/dist/components/controls/base-popover-control/index.js +4 -4
  60. package/dist/components/controls/card-number-control/index.js +1 -1
  61. package/dist/components/controls/date-control/index.js +1 -1
  62. package/dist/components/controls/date-control/picker.js +5 -5
  63. package/dist/components/controls/index.d.ts +1 -0
  64. package/dist/components/controls/index.js +12 -10
  65. package/dist/components/controls/list-control/item.js +34 -67
  66. package/dist/components/controls/list-control/list.js +1 -1
  67. package/dist/components/controls/recurrence-control/index.js +19 -18
  68. package/dist/components/controls/select-control/control.js +26 -37
  69. package/dist/components/controls/select-control/select.js +62 -1129
  70. package/dist/components/controls/tag-control/ariakit-experimental.d.ts +7 -0
  71. package/dist/components/controls/tag-control/ariakit-experimental.js +2308 -0
  72. package/dist/components/controls/tag-control/index.d.ts +10 -0
  73. package/dist/components/controls/tag-control/index.js +134 -0
  74. package/dist/components/controls/tag-control/props.d.ts +11 -0
  75. package/dist/components/controls/tag-control/props.js +29 -0
  76. package/dist/components/controls/text-control/index.js +1 -1
  77. package/dist/components/data-view/data/apply.js +15 -15
  78. package/dist/components/data-view/data/filter.js +14 -12
  79. package/dist/components/data-view/index.js +1 -1
  80. package/dist/components/data-view/layouts/grid/empty.js +1 -1
  81. package/dist/components/data-view/layouts/grid/group.js +9 -7
  82. package/dist/components/data-view/layouts/grid/item.js +9 -7
  83. package/dist/components/data-view/layouts/grid/root.js +1 -1
  84. package/dist/components/data-view/layouts/kanban/empty.js +1 -1
  85. package/dist/components/data-view/layouts/kanban/group.js +9 -7
  86. package/dist/components/data-view/layouts/kanban/item.js +9 -7
  87. package/dist/components/data-view/layouts/kanban/root.js +1 -1
  88. package/dist/components/data-view/layouts/list/empty.js +1 -1
  89. package/dist/components/data-view/layouts/list/group.js +9 -7
  90. package/dist/components/data-view/layouts/list/item.js +9 -7
  91. package/dist/components/data-view/layouts/list/root.js +1 -1
  92. package/dist/components/data-view/layouts/table/empty.js +9 -7
  93. package/dist/components/data-view/layouts/table/group.js +10 -8
  94. package/dist/components/data-view/layouts/table/item.js +10 -8
  95. package/dist/components/data-view/layouts/table/root.js +9 -7
  96. package/dist/components/data-view/parts/body/index.js +11 -9
  97. package/dist/components/data-view/parts/controls/index.js +9 -7
  98. package/dist/components/data-view/parts/controls/search.js +9 -7
  99. package/dist/components/data-view/parts/filters/editor.js +8 -6
  100. package/dist/components/data-view/parts/filters/index.js +1 -1
  101. package/dist/components/data-view/parts/filters/list.js +39 -73
  102. package/dist/components/data-view/parts/footer/actions.js +9 -7
  103. package/dist/components/data-view/parts/footer/index.js +9 -7
  104. package/dist/components/data-view/parts/footer/selection.js +9 -7
  105. package/dist/components/data-view/parts/view-control/index.js +23 -21
  106. package/dist/components/data-view/root.js +9 -7
  107. package/dist/components/data-view/slots/group/checkbox.js +9 -7
  108. package/dist/components/data-view/slots/group/context.js +1 -1
  109. package/dist/components/data-view/slots/group/icon.js +1 -1
  110. package/dist/components/data-view/slots/group/index.js +1 -1
  111. package/dist/components/data-view/slots/group/label.js +1 -1
  112. package/dist/components/data-view/slots/index.js +3 -3
  113. package/dist/components/data-view/slots/item/actions.js +1 -1
  114. package/dist/components/data-view/slots/item/checkbox.js +9 -7
  115. package/dist/components/data-view/slots/item/depth.js +3 -3
  116. package/dist/components/data-view/slots/item/description.js +1 -1
  117. package/dist/components/data-view/slots/item/index.js +2 -2
  118. package/dist/components/data-view/slots/item/properties.js +2 -2
  119. package/dist/components/data-view/slots/item/relations.js +3 -3
  120. package/dist/components/data-view/slots/item/tags.js +1 -1
  121. package/dist/components/data-view/slots/item/thumbnail.js +1 -1
  122. package/dist/components/data-view/slots/item/title.js +1 -1
  123. package/dist/components/data-view/slots/item/util.js +2 -2
  124. package/dist/components/data-view/slots/property/field/editable.js +8 -6
  125. package/dist/components/data-view/slots/property/field/index.js +2 -2
  126. package/dist/components/data-view/slots/property/field/static.js +1 -1
  127. package/dist/components/data-view/slots/property/index.js +1 -1
  128. package/dist/components/data-view/slots/property/label.js +1 -1
  129. package/dist/components/data-view/slots/root/checkbox.js +8 -6
  130. package/dist/components/data-view/slots/root/index.js +1 -1
  131. package/dist/components/filesystem/file.js +1 -1
  132. package/dist/components/filesystem/folder.js +29 -80
  133. package/dist/components/filesystem/list.js +1 -1
  134. package/dist/components/filesystem/root.js +1 -1
  135. package/dist/components/index.js +41 -39
  136. package/dist/components/menu/index.js +14 -13
  137. package/dist/components/menu/item.js +1 -1
  138. package/dist/components/menu/items/action.js +1 -1
  139. package/dist/components/menu/items/spacer.js +4 -16
  140. package/dist/components/menu/items/submenu.js +4 -3
  141. package/dist/components/menu/items/toggle.js +1 -1
  142. package/dist/components/pagination/index.js +1 -1
  143. package/dist/components/tabs/list.js +8 -36
  144. package/dist/components/tabs/panel.js +13 -126
  145. package/dist/components/tabs/root.js +14 -166
  146. package/dist/components/tabs/tab.js +5 -79
  147. package/dist/components/toolbar/divider.js +7 -19
  148. package/dist/components/toolbar/index.js +10 -24
  149. package/dist/components/toolbar/root.js +5 -67
  150. package/dist/components/window/index.js +2 -2
  151. package/dist/{composite-provider-R5SnRc_G.js → composite-provider-B-M1AaRb.js} +2 -2
  152. package/dist/disclosure-provider-DW9RmAuE.js +61 -0
  153. package/dist/{filter-C-ZkRgt_.js → filter-GoxwLwkT.js} +14 -12
  154. package/dist/{index-DI0cEpya.js → index-C_xrLeQq.js} +20 -18
  155. package/dist/{index-BW-2OhmK.js → index-DJ2XZnew.js} +7 -5
  156. package/dist/{index-Bj4Ga50P.js → index-DpV0obFX.js} +6 -4
  157. package/dist/index.js +87 -85
  158. package/dist/item-CYpF0or4.js +58 -0
  159. package/dist/{style-tA0yiKCL.js → match-sorter.esm-MNVE8H_6.js} +1 -1
  160. package/dist/menu-button-D0chRxS0.js +416 -0
  161. package/dist/menu-separator-Cy38O3cZ.js +16 -0
  162. package/dist/{picker-BkmBjgWA.js → picker-BAQPD-c9.js} +4 -4
  163. package/dist/popover-provider-DZV1nb7Q.js +10 -0
  164. package/dist/primitives/nav-link/index.d.ts +2 -2
  165. package/dist/primitives/popover/index.js +2 -2
  166. package/dist/primitives/popover/root.js +12 -3
  167. package/dist/primitives/popover/target.js +1 -1
  168. package/dist/primitives/popover/window.js +3 -3
  169. package/dist/primitives/tooltip/index.js +10 -173
  170. package/dist/select-popover-DYAZyLp4.js +542 -0
  171. package/dist/select-value-CeoMyvpZ.js +15 -0
  172. package/dist/{sortable.esm-De3H-_AA.js → sortable.esm-BuV7eW2H.js} +4 -4
  173. package/dist/{style-C7eFpUVU.js → style-CWAa57kN.js} +1 -1
  174. package/dist/tab-DjNG1rEI.js +79 -0
  175. package/dist/tab-list-DtMnUjoy.js +33 -0
  176. package/dist/tab-panel-DdkeLgKE.js +118 -0
  177. package/dist/tab-provider-BMkHrtIK.js +158 -0
  178. package/dist/tag-remove-BVa8oSsq.js +533 -0
  179. package/dist/toolbar-B7_t1rYu.js +68 -0
  180. package/dist/toolbar-separator-DBoO5XdF.js +16 -0
  181. package/dist/tooltip-anchor-CxZWazuo.js +173 -0
  182. package/dist/utils/url.js +6 -6
  183. package/package.json +1 -1
  184. package/dist/2NBKRL7C-Cug3TzgR.js +0 -85
  185. package/dist/2RSXSRCN-Bc3g-z-i.js +0 -61
  186. package/dist/A3WPL2ZJ-D0Eh1dEB.js +0 -11
  187. package/dist/EM5CXX6A-DKxCXPnz.js +0 -14
  188. package/dist/MR26YJYP-yD1_RvCA.js +0 -283
  189. package/dist/MTZPJQMC-RLG1q394.js +0 -12
  190. package/dist/P7GR5CS5-Dub2zqTX.js +0 -22
  191. package/dist/RS7LB2H4-C0kmTjy8.js +0 -15
  192. package/dist/RZ4GPYOB-c8s_KHUk.js +0 -37
  193. package/dist/TP7N7UIH-mdk33dnV.js +0 -34
  194. package/dist/UYGDZTLQ-fOwUiOjI.js +0 -12
  195. package/dist/VIIRIBF3-DylpToFV.js +0 -18
  196. package/dist/WMYDSCNQ-D43V-JUe.js +0 -62
  197. package/dist/item-C5GtZF5t.js +0 -470
  198. package/dist/root-C7IYlG1s.js +0 -20
@@ -0,0 +1,564 @@
1
+ import { u as Ge } from "./5JTVDSTH-DcfjjEya.js";
2
+ import { a as Je } from "./WMYDSCNQ-D4CU76mX.js";
3
+ import { a as Qe, C as Xe, b as Oe, c as Ye, d as Ze, e as ye, u as et, f as tt } from "./S43UC3DV-CiBKpqp8.js";
4
+ import { I as ot, S as nt, V as k, T as te, U as $, a1 as rt, x as st, a7 as ut, m as N, o as y, W as Ie, f as ae, c as ie, a as ce, _ as de, i as fe, a8 as lt, a9 as at, y as Ve, aa as se, ab as it, e as H, B as ct, b as ue, j as L, G as dt, q as Ee, n as we, a0 as ft, a4 as mt, $ as vt, K as pt, s as bt, O as Ct, P as St, k as gt, l as Ae, ac as xt, r as Vt } from "./LMDWO4NN-CIZvvtic.js";
5
+ import { h as le } from "./PFRGBC2K-B9ko--FF.js";
6
+ import { m as ht, p as Pt, t as Ot, c as yt, s as X, e as W, g as It, b as Et, d as oe, u as wt } from "./YV4JVR4I-w1-dnslS.js";
7
+ import { createContext as ke, useRef as z, useState as Le, useEffect as Y, useMemo as At, useCallback as kt, useContext as Lt } from "react";
8
+ import { e as _t, C as Tt } from "./P7GR5CS5-5PtDURPc.js";
9
+ import { c as Kt, a as Dt } from "./O2PQ2652-D2GSkoLq.js";
10
+ import { c as Rt, d as Mt, b as Bt } from "./4CMBR7SL-ChJnawVl.js";
11
+ import { jsx as Z } from "react/jsx-runtime";
12
+ import { u as Ft } from "./UQQRIHDV-BBkcyl82.js";
13
+ import { u as Ht } from "./6VRAQV3D-DK_p41oq.js";
14
+ import { i as Nt } from "./KFH4SEIX-BFT9WmYk.js";
15
+ var xo = ke(null), Vo = ke(
16
+ null
17
+ ), ne = ot(
18
+ [Tt],
19
+ [_t]
20
+ ), Ut = ne.useContext, ho = ne.useProviderContext, Po = ne.ContextProvider, Oo = ne.ScopedContextProvider, jt = st() && ut();
21
+ function qt(o = {}) {
22
+ var n = o, {
23
+ tag: r
24
+ } = n, e = nt(n, [
25
+ "tag"
26
+ ]);
27
+ const c = ht(e.store, Pt(r, ["value", "rtl"]));
28
+ Ot(e, c);
29
+ const d = r == null ? void 0 : r.getState(), u = c == null ? void 0 : c.getState(), T = k(
30
+ e.activeId,
31
+ u == null ? void 0 : u.activeId,
32
+ e.defaultActiveId,
33
+ null
34
+ ), w = Rt(te($({}, e), {
35
+ activeId: T,
36
+ includesBaseElement: k(
37
+ e.includesBaseElement,
38
+ u == null ? void 0 : u.includesBaseElement,
39
+ !0
40
+ ),
41
+ orientation: k(
42
+ e.orientation,
43
+ u == null ? void 0 : u.orientation,
44
+ "vertical"
45
+ ),
46
+ focusLoop: k(e.focusLoop, u == null ? void 0 : u.focusLoop, !0),
47
+ focusWrap: k(e.focusWrap, u == null ? void 0 : u.focusWrap, !0),
48
+ virtualFocus: k(
49
+ e.virtualFocus,
50
+ u == null ? void 0 : u.virtualFocus,
51
+ !0
52
+ )
53
+ })), I = Kt(te($({}, e), {
54
+ placement: k(
55
+ e.placement,
56
+ u == null ? void 0 : u.placement,
57
+ "bottom-start"
58
+ )
59
+ })), K = k(
60
+ e.value,
61
+ u == null ? void 0 : u.value,
62
+ e.defaultValue,
63
+ ""
64
+ ), O = k(
65
+ e.selectedValue,
66
+ u == null ? void 0 : u.selectedValue,
67
+ d == null ? void 0 : d.values,
68
+ e.defaultSelectedValue,
69
+ ""
70
+ ), f = Array.isArray(O), _ = te($($({}, w.getState()), I.getState()), {
71
+ value: K,
72
+ selectedValue: O,
73
+ resetValueOnSelect: k(
74
+ e.resetValueOnSelect,
75
+ u == null ? void 0 : u.resetValueOnSelect,
76
+ f
77
+ ),
78
+ resetValueOnHide: k(
79
+ e.resetValueOnHide,
80
+ u == null ? void 0 : u.resetValueOnHide,
81
+ f && !r
82
+ ),
83
+ activeValue: u == null ? void 0 : u.activeValue
84
+ }), l = yt(_, w, I, c);
85
+ return jt && X(
86
+ l,
87
+ () => W(l, ["virtualFocus"], () => {
88
+ l.setState("virtualFocus", !1);
89
+ })
90
+ ), X(l, () => {
91
+ if (r)
92
+ return rt(
93
+ W(l, ["selectedValue"], (i) => {
94
+ Array.isArray(i.selectedValue) && r.setValues(i.selectedValue);
95
+ }),
96
+ W(r, ["values"], (i) => {
97
+ l.setState("selectedValue", i.values);
98
+ })
99
+ );
100
+ }), X(
101
+ l,
102
+ () => W(l, ["resetValueOnHide", "mounted"], (i) => {
103
+ i.resetValueOnHide && (i.mounted || l.setState("value", K));
104
+ })
105
+ ), X(
106
+ l,
107
+ () => W(l, ["open"], (i) => {
108
+ i.open || (l.setState("activeId", T), l.setState("moves", 0));
109
+ })
110
+ ), X(
111
+ l,
112
+ () => W(l, ["moves", "activeId"], (i, A) => {
113
+ i.moves === A.moves && l.setState("activeValue", void 0);
114
+ })
115
+ ), X(
116
+ l,
117
+ () => It(l, ["moves", "renderedItems"], (i, A) => {
118
+ if (i.moves === A.moves) return;
119
+ const { activeId: V } = l.getState(), m = w.item(V);
120
+ l.setState("activeValue", m == null ? void 0 : m.value);
121
+ })
122
+ ), te($($($({}, I), w), l), {
123
+ tag: r,
124
+ setValue: (i) => l.setState("value", i),
125
+ resetValue: () => l.setState("value", _.value),
126
+ setSelectedValue: (i) => l.setState("selectedValue", i)
127
+ });
128
+ }
129
+ function $t(o) {
130
+ const n = Ut();
131
+ return o = N(y({}, o), {
132
+ tag: o.tag !== void 0 ? o.tag : n
133
+ }), Mt(o);
134
+ }
135
+ function Wt(o, n, r) {
136
+ return Ie(n, [r.tag]), oe(o, r, "value", "setValue"), oe(o, r, "selectedValue", "setSelectedValue"), oe(o, r, "resetValueOnHide"), oe(o, r, "resetValueOnSelect"), Object.assign(
137
+ Bt(
138
+ Dt(o, n, r),
139
+ n,
140
+ r
141
+ ),
142
+ { tag: r.tag }
143
+ );
144
+ }
145
+ function zt(o = {}) {
146
+ o = $t(o);
147
+ const [n, r] = Et(qt, o);
148
+ return Wt(n, r, o);
149
+ }
150
+ var Gt = "input";
151
+ function he(o, n, r) {
152
+ if (!r) return !1;
153
+ const e = o.find((c) => !c.disabled && c.value);
154
+ return (e == null ? void 0 : e.value) === n;
155
+ }
156
+ function Pe(o, n) {
157
+ return !n || o == null ? !1 : (o = pt(o), n.length > o.length && n.toLowerCase().indexOf(o.toLowerCase()) === 0);
158
+ }
159
+ function Jt(o) {
160
+ return o.type === "input";
161
+ }
162
+ function Qt(o) {
163
+ return o === "inline" || o === "list" || o === "both" || o === "none";
164
+ }
165
+ function Xt(o) {
166
+ const n = o.find((r) => {
167
+ var e;
168
+ return r.disabled ? !1 : ((e = r.element) == null ? void 0 : e.getAttribute("role")) !== "tab";
169
+ });
170
+ return n == null ? void 0 : n.id;
171
+ }
172
+ var Yt = ie(
173
+ function(n) {
174
+ var r = n, {
175
+ store: e,
176
+ focusable: c = !0,
177
+ autoSelect: d = !1,
178
+ getAutoSelectId: u,
179
+ setValueOnChange: T,
180
+ showMinLength: w = 0,
181
+ showOnChange: I,
182
+ showOnMouseDown: K,
183
+ showOnClick: O = K,
184
+ showOnKeyDown: f,
185
+ showOnKeyPress: _ = f,
186
+ blurActiveItemOnClick: l,
187
+ setValueOnClick: i = !0,
188
+ moveOnKeyPress: A = !0,
189
+ autoComplete: V = "list"
190
+ } = r, m = de(r, [
191
+ "store",
192
+ "focusable",
193
+ "autoSelect",
194
+ "getAutoSelectId",
195
+ "setValueOnChange",
196
+ "showMinLength",
197
+ "showOnChange",
198
+ "showOnMouseDown",
199
+ "showOnClick",
200
+ "showOnKeyDown",
201
+ "showOnKeyPress",
202
+ "blurActiveItemOnClick",
203
+ "setValueOnClick",
204
+ "moveOnKeyPress",
205
+ "autoComplete"
206
+ ]);
207
+ const G = Qe();
208
+ e = e || G, fe(
209
+ e,
210
+ process.env.NODE_ENV !== "production" && "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
211
+ );
212
+ const D = z(null), [J, h] = lt(), C = z(!1), M = z(!1), P = e.useState(
213
+ (t) => t.virtualFocus && d
214
+ ), x = V === "inline" || V === "both", [U, Q] = Le(x);
215
+ at(() => {
216
+ x && Q(!0);
217
+ }, [x]);
218
+ const s = e.useState("value"), b = z();
219
+ Y(() => W(e, ["selectedValue", "activeId"], (t, a) => {
220
+ b.current = a.selectedValue;
221
+ }), []);
222
+ const S = e.useState((t) => {
223
+ var a;
224
+ if (x && U && !(t.activeValue && Array.isArray(t.selectedValue) && (t.selectedValue.includes(t.activeValue) || (a = b.current) != null && a.includes(t.activeValue))))
225
+ return t.activeValue;
226
+ }), j = e.useState("renderedItems"), B = e.useState("open"), F = e.useState("contentElement"), ee = At(() => {
227
+ if (!x || !U) return s;
228
+ if (he(
229
+ j,
230
+ S,
231
+ P
232
+ )) {
233
+ if (Pe(s, S)) {
234
+ const a = (S == null ? void 0 : S.slice(s.length)) || "";
235
+ return s + a;
236
+ }
237
+ return s;
238
+ }
239
+ return S || s;
240
+ }, [x, U, j, S, P, s]);
241
+ Y(() => {
242
+ const t = D.current;
243
+ if (!t) return;
244
+ const a = () => Q(!0);
245
+ return t.addEventListener("combobox-item-move", a), () => {
246
+ t.removeEventListener("combobox-item-move", a);
247
+ };
248
+ }, []), Y(() => {
249
+ if (!x || !U || !S || !he(
250
+ j,
251
+ S,
252
+ P
253
+ ) || !Pe(s, S)) return;
254
+ let a = it;
255
+ return queueMicrotask(() => {
256
+ const v = D.current;
257
+ if (!v) return;
258
+ const { start: p, end: E } = Ve(v), R = s.length, g = S.length;
259
+ se(v, R, g), a = () => {
260
+ if (!le(v)) return;
261
+ const { start: q, end: ze } = Ve(v);
262
+ q === R && ze === g && se(v, p, E);
263
+ };
264
+ }), () => a();
265
+ }, [
266
+ J,
267
+ x,
268
+ U,
269
+ S,
270
+ j,
271
+ P,
272
+ s
273
+ ]);
274
+ const _e = z(null), me = H(u), ve = z(null);
275
+ Y(() => {
276
+ if (!B || !F) return;
277
+ const t = ct(F);
278
+ if (!t) return;
279
+ _e.current = t;
280
+ const a = () => {
281
+ C.current = !1;
282
+ }, v = () => {
283
+ if (!e || !C.current) return;
284
+ const { activeId: E } = e.getState();
285
+ E !== null && E !== ve.current && (C.current = !1);
286
+ }, p = { passive: !0, capture: !0 };
287
+ return t.addEventListener("wheel", a, p), t.addEventListener("touchmove", a, p), t.addEventListener("scroll", v, p), () => {
288
+ t.removeEventListener("wheel", a, !0), t.removeEventListener("touchmove", a, !0), t.removeEventListener("scroll", v, !0);
289
+ };
290
+ }, [B, F, e]), ue(() => {
291
+ s && (M.current || (C.current = !0));
292
+ }, [s]), ue(() => {
293
+ P !== "always" && B || (C.current = B);
294
+ }, [P, B]);
295
+ const pe = e.useState("resetValueOnSelect");
296
+ Ie(() => {
297
+ var t, a;
298
+ const v = C.current;
299
+ if (!e || !B || !v && !pe) return;
300
+ const { baseElement: p, contentElement: E, activeId: R } = e.getState();
301
+ if (!(p && !le(p))) {
302
+ if (E != null && E.hasAttribute("data-placing")) {
303
+ const g = new MutationObserver(h);
304
+ return g.observe(E, { attributeFilter: ["data-placing"] }), () => g.disconnect();
305
+ }
306
+ if (P && v) {
307
+ const g = me(j), q = g !== void 0 ? g : (t = Xt(j)) != null ? t : e.first();
308
+ ve.current = q, e.move(q ?? null);
309
+ } else {
310
+ const g = (a = e.item(R || e.first())) == null ? void 0 : a.element;
311
+ g && "scrollIntoView" in g && g.scrollIntoView({ block: "nearest", inline: "nearest" });
312
+ }
313
+ }
314
+ }, [
315
+ e,
316
+ B,
317
+ J,
318
+ s,
319
+ P,
320
+ pe,
321
+ me,
322
+ j
323
+ ]), Y(() => {
324
+ if (!x) return;
325
+ const t = D.current;
326
+ if (!t) return;
327
+ const a = [t, F].filter(
328
+ (p) => !!p
329
+ ), v = (p) => {
330
+ a.every((E) => vt(p, E)) && (e == null || e.setValue(ee));
331
+ };
332
+ for (const p of a)
333
+ p.addEventListener("focusout", v);
334
+ return () => {
335
+ for (const p of a)
336
+ p.removeEventListener("focusout", v);
337
+ };
338
+ }, [x, F, e, ee]);
339
+ const re = (t) => t.currentTarget.value.length >= w, be = m.onChange, Te = L(I ?? re), Ke = L(
340
+ // If the combobox is combined with tags, the value will be set by the tag
341
+ // input component.
342
+ T ?? !e.tag
343
+ ), De = H((t) => {
344
+ if (be == null || be(t), t.defaultPrevented || !e) return;
345
+ const a = t.currentTarget, { value: v, selectionStart: p, selectionEnd: E } = a, R = t.nativeEvent;
346
+ if (C.current = !0, Jt(R) && (R.isComposing && (C.current = !1, M.current = !0), x)) {
347
+ const g = R.inputType === "insertText" || R.inputType === "insertCompositionText", q = p === v.length;
348
+ Q(g && q);
349
+ }
350
+ if (Ke(t)) {
351
+ const g = v === e.getState().value;
352
+ e.setValue(v), queueMicrotask(() => {
353
+ se(a, p, E);
354
+ }), x && P && g && h();
355
+ }
356
+ Te(t) && e.show(), (!P || !C.current) && e.setActiveId(null);
357
+ }), Ce = m.onCompositionEnd, Re = H((t) => {
358
+ C.current = !0, M.current = !1, Ce == null || Ce(t), !t.defaultPrevented && P && h();
359
+ }), Se = m.onMouseDown, Me = L(
360
+ l ?? (() => !!(e != null && e.getState().includesBaseElement))
361
+ ), Be = L(i), Fe = L(O ?? re), He = H((t) => {
362
+ Se == null || Se(t), !t.defaultPrevented && (t.button || t.ctrlKey || e && (Me(t) && e.setActiveId(null), Be(t) && e.setValue(ee), Fe(t) && dt(t.currentTarget, "mouseup", e.show)));
363
+ }), ge = m.onKeyDown, Ne = L(_ ?? re), Ue = H((t) => {
364
+ if (ge == null || ge(t), t.repeat || (C.current = !1), t.defaultPrevented || t.ctrlKey || t.altKey || t.shiftKey || t.metaKey || !e) return;
365
+ const { open: a } = e.getState();
366
+ a || (t.key === "ArrowUp" || t.key === "ArrowDown") && Ne(t) && (t.preventDefault(), e.show());
367
+ }), xe = m.onBlur, je = H((t) => {
368
+ C.current = !1, xe == null || xe(t), t.defaultPrevented;
369
+ }), qe = Ee(m.id), $e = Qt(V) ? V : void 0, We = e.useState((t) => t.activeId === null);
370
+ return m = N(y({
371
+ id: qe,
372
+ role: "combobox",
373
+ "aria-autocomplete": $e,
374
+ "aria-haspopup": ft(F, "listbox"),
375
+ "aria-expanded": B,
376
+ "aria-controls": F == null ? void 0 : F.id,
377
+ "data-active-item": We || void 0,
378
+ value: ee
379
+ }, m), {
380
+ ref: we(D, m.ref),
381
+ onChange: De,
382
+ onCompositionEnd: Re,
383
+ onMouseDown: He,
384
+ onKeyDown: Ue,
385
+ onBlur: je
386
+ }), m = Ge(N(y({
387
+ store: e,
388
+ focusable: c
389
+ }, m), {
390
+ // Enable inline autocomplete when the user moves from the combobox input
391
+ // to an item.
392
+ moveOnKeyPress: (t) => mt(A, t) ? !1 : (x && Q(!0), !0)
393
+ })), m = Je(y({ store: e }, m)), y({ autoComplete: "off" }, m);
394
+ }
395
+ ), yo = ae(function(n) {
396
+ const r = Yt(n);
397
+ return ce(Gt, r);
398
+ });
399
+ function Io(o = {}) {
400
+ const n = zt(o);
401
+ return /* @__PURE__ */ Z(Xe, { value: n, children: o.children });
402
+ }
403
+ var Zt = "div";
404
+ function eo(o, n) {
405
+ if (n != null)
406
+ return o == null ? !1 : Array.isArray(o) ? o.includes(n) : o === n;
407
+ }
408
+ function to(o) {
409
+ var n;
410
+ return (n = {
411
+ menu: "menuitem",
412
+ listbox: "option",
413
+ tree: "treeitem"
414
+ }[o]) != null ? n : "option";
415
+ }
416
+ var oo = ie(
417
+ function(n) {
418
+ var r = n, {
419
+ store: e,
420
+ value: c,
421
+ hideOnClick: d,
422
+ setValueOnClick: u,
423
+ selectValueOnClick: T = !0,
424
+ resetValueOnSelect: w,
425
+ focusOnHover: I = !1,
426
+ moveOnKeyPress: K = !0,
427
+ getItem: O
428
+ } = r, f = de(r, [
429
+ "store",
430
+ "value",
431
+ "hideOnClick",
432
+ "setValueOnClick",
433
+ "selectValueOnClick",
434
+ "resetValueOnSelect",
435
+ "focusOnHover",
436
+ "moveOnKeyPress",
437
+ "getItem"
438
+ ]), _;
439
+ const l = Oe();
440
+ e = e || l, fe(
441
+ e,
442
+ process.env.NODE_ENV !== "production" && "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
443
+ );
444
+ const { resetValueOnSelectState: i, multiSelectable: A, selected: V } = wt(e, {
445
+ resetValueOnSelectState: "resetValueOnSelect",
446
+ multiSelectable(s) {
447
+ return Array.isArray(s.selectedValue);
448
+ },
449
+ selected(s) {
450
+ return eo(s.selectedValue, c);
451
+ }
452
+ }), m = kt(
453
+ (s) => {
454
+ const b = N(y({}, s), { value: c });
455
+ return O ? O(b) : b;
456
+ },
457
+ [c, O]
458
+ );
459
+ u = u ?? !A, d = d ?? (c != null && !A);
460
+ const G = f.onClick, D = L(u), J = L(T), h = L(
461
+ (_ = w ?? i) != null ? _ : A
462
+ ), C = L(d), M = H((s) => {
463
+ G == null || G(s), !s.defaultPrevented && (Ct(s) || St(s) || (c != null && (J(s) && (h(s) && (e == null || e.resetValue()), e == null || e.setSelectedValue((b) => Array.isArray(b) ? b.includes(c) ? b.filter((S) => S !== c) : [...b, c] : c)), D(s) && (e == null || e.setValue(c))), C(s) && (e == null || e.hide())));
464
+ }), P = f.onKeyDown, x = H((s) => {
465
+ if (P == null || P(s), s.defaultPrevented) return;
466
+ const b = e == null ? void 0 : e.getState().baseElement;
467
+ if (!b || le(b)) return;
468
+ (s.key.length === 1 || s.key === "Backspace" || s.key === "Delete") && (queueMicrotask(() => b.focus()), gt(b) && (e == null || e.setValue(b.value)));
469
+ });
470
+ A && V != null && (f = y({
471
+ "aria-selected": V
472
+ }, f)), f = Ae(
473
+ f,
474
+ (s) => /* @__PURE__ */ Z(Ye.Provider, { value: c, children: /* @__PURE__ */ Z(Ze.Provider, { value: V ?? !1, children: s }) }),
475
+ [c, V]
476
+ );
477
+ const U = Lt(ye);
478
+ f = N(y({
479
+ role: to(U),
480
+ children: c
481
+ }, f), {
482
+ onClick: M,
483
+ onKeyDown: x
484
+ });
485
+ const Q = L(K);
486
+ return f = Ht(N(y({
487
+ store: e
488
+ }, f), {
489
+ getItem: m,
490
+ // Dispatch a custom event on the combobox input when moving to an item
491
+ // with the keyboard so the Combobox component can enable inline
492
+ // autocompletion.
493
+ moveOnKeyPress: (s) => {
494
+ if (!Q(s)) return !1;
495
+ const b = new Event("combobox-item-move"), S = e == null ? void 0 : e.getState().baseElement;
496
+ return S == null || S.dispatchEvent(b), !0;
497
+ }
498
+ })), f = Ft(y({ store: e, focusOnHover: I }, f)), f;
499
+ }
500
+ ), Eo = bt(
501
+ ae(function(n) {
502
+ const r = oo(n);
503
+ return ce(Zt, r);
504
+ })
505
+ ), no = "div", ro = ie(
506
+ function(n) {
507
+ var r = n, { store: e, alwaysVisible: c } = r, d = de(r, ["store", "alwaysVisible"]);
508
+ const u = Oe(!0), T = et();
509
+ e = e || T;
510
+ const w = !!e && e === u;
511
+ fe(
512
+ e,
513
+ process.env.NODE_ENV !== "production" && "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
514
+ );
515
+ const I = z(null), K = Ee(d.id), O = e.useState("mounted"), f = Nt(O, d.hidden, c), _ = f ? N(y({}, d.style), { display: "none" }) : d.style, l = e.useState(
516
+ (h) => Array.isArray(h.selectedValue)
517
+ ), i = xt(I, "role", d.role), V = (i === "listbox" || i === "tree" || i === "grid") && l || void 0, [m, G] = Le(!1), D = e.useState("contentElement");
518
+ ue(() => {
519
+ if (!O) return;
520
+ const h = I.current;
521
+ if (!h || D !== h) return;
522
+ const C = () => {
523
+ G(!!h.querySelector("[role='listbox']"));
524
+ }, M = new MutationObserver(C);
525
+ return M.observe(h, {
526
+ subtree: !0,
527
+ childList: !0,
528
+ attributeFilter: ["role"]
529
+ }), C(), () => M.disconnect();
530
+ }, [O, D]), m || (d = y({
531
+ role: "listbox",
532
+ "aria-multiselectable": V
533
+ }, d)), d = Ae(
534
+ d,
535
+ (h) => /* @__PURE__ */ Z(tt, { value: e, children: /* @__PURE__ */ Z(ye.Provider, { value: i, children: h }) }),
536
+ [e, i]
537
+ );
538
+ const J = K && (!u || !w) ? e.setContentElement : null;
539
+ return d = N(y({
540
+ id: K,
541
+ hidden: f
542
+ }, d), {
543
+ ref: we(J, I, d.ref),
544
+ style: _
545
+ }), Vt(d);
546
+ }
547
+ ), wo = ae(function(n) {
548
+ const r = ro(n);
549
+ return ce(no, r);
550
+ });
551
+ export {
552
+ Io as C,
553
+ xo as T,
554
+ yo as a,
555
+ wo as b,
556
+ Eo as c,
557
+ Ut as d,
558
+ Vo as e,
559
+ ho as f,
560
+ Oo as g,
561
+ Po as h,
562
+ zt as i,
563
+ ro as u
564
+ };