@gv-tech/ui-web 2.29.2 → 2.29.3

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 (265) hide show
  1. package/dist/accordion.cjs +1 -1
  2. package/dist/accordion.mjs +53 -1
  3. package/dist/alert-dialog.cjs +1 -1
  4. package/dist/alert-dialog.mjs +99 -1
  5. package/dist/alert.cjs +1 -1
  6. package/dist/alert.mjs +1 -1
  7. package/dist/aspect-ratio.cjs +1 -1
  8. package/dist/aspect-ratio.mjs +10 -1
  9. package/dist/attachment.cjs +1 -1
  10. package/dist/attachment.mjs +25 -24
  11. package/dist/avatar.cjs +1 -1
  12. package/dist/avatar.mjs +49 -1
  13. package/dist/badge.cjs +1 -1
  14. package/dist/badge.mjs +5 -4
  15. package/dist/breadcrumb.cjs +1 -1
  16. package/dist/breadcrumb.mjs +12 -11
  17. package/dist/bubble.cjs +1 -1
  18. package/dist/bubble.mjs +4 -3
  19. package/dist/button-group.cjs +1 -1
  20. package/dist/button-group.mjs +12 -11
  21. package/dist/button.cjs +1 -1
  22. package/dist/button.mjs +4 -3
  23. package/dist/calendar.cjs +1 -1
  24. package/dist/calendar.mjs +97 -1
  25. package/dist/card.cjs +1 -1
  26. package/dist/card.mjs +1 -1
  27. package/dist/carousel.cjs +1 -1
  28. package/dist/carousel.mjs +107 -1
  29. package/dist/chart.cjs +2 -2
  30. package/dist/chart.mjs +1 -1
  31. package/dist/checkbox.cjs +1 -1
  32. package/dist/checkbox.mjs +19 -1
  33. package/dist/collapsible.cjs +1 -1
  34. package/dist/collapsible.mjs +12 -12
  35. package/dist/combobox.cjs +1 -1
  36. package/dist/combobox.mjs +161 -1
  37. package/dist/command.cjs +1 -1
  38. package/dist/command.mjs +89 -1
  39. package/dist/context-menu.cjs +1 -1
  40. package/dist/context-menu.mjs +123 -1
  41. package/dist/dialog.cjs +1 -1
  42. package/dist/dialog.mjs +40 -40
  43. package/dist/direction.cjs +1 -1
  44. package/dist/direction.mjs +7 -7
  45. package/dist/drawer.cjs +1 -1
  46. package/dist/drawer.mjs +1 -1
  47. package/dist/dropdown-menu.cjs +1 -1
  48. package/dist/dropdown-menu.mjs +126 -1
  49. package/dist/empty.cjs +1 -1
  50. package/dist/empty.mjs +1 -1
  51. package/dist/field.cjs +1 -1
  52. package/dist/field.mjs +36 -36
  53. package/dist/form.cjs +1 -1
  54. package/dist/form.mjs +36 -36
  55. package/dist/hover-card.cjs +1 -1
  56. package/dist/hover-card.mjs +30 -1
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.mjs +36 -36
  59. package/dist/input-group.cjs +1 -1
  60. package/dist/input-group.mjs +26 -26
  61. package/dist/input-otp.cjs +1 -1
  62. package/dist/input-otp.mjs +45 -1
  63. package/dist/input.cjs +1 -1
  64. package/dist/input.mjs +1 -1
  65. package/dist/item.cjs +1 -1
  66. package/dist/item.mjs +28 -27
  67. package/dist/kbd.cjs +1 -1
  68. package/dist/kbd.mjs +1 -1
  69. package/dist/label.cjs +1 -1
  70. package/dist/label.mjs +13 -1
  71. package/dist/marker.cjs +1 -1
  72. package/dist/marker.mjs +4 -3
  73. package/dist/menubar.cjs +1 -1
  74. package/dist/menubar.mjs +133 -1
  75. package/dist/message-scroller.cjs +1 -1
  76. package/dist/message-scroller.mjs +59 -1
  77. package/dist/message.cjs +1 -1
  78. package/dist/message.mjs +1 -1
  79. package/dist/native-select.cjs +1 -1
  80. package/dist/native-select.mjs +1 -1
  81. package/dist/navigation-menu.cjs +1 -1
  82. package/dist/navigation-menu.mjs +79 -1
  83. package/dist/pagination.cjs +1 -1
  84. package/dist/pagination.mjs +14 -14
  85. package/dist/popover.cjs +1 -1
  86. package/dist/popover.mjs +54 -1
  87. package/dist/progress.cjs +1 -1
  88. package/dist/progress.mjs +19 -1
  89. package/dist/questionnaire.cjs +1 -1
  90. package/dist/questionnaire.mjs +168 -1
  91. package/dist/radio-group.cjs +1 -1
  92. package/dist/radio-group.mjs +25 -1
  93. package/dist/resizable.cjs +1 -1
  94. package/dist/resizable.mjs +26 -1
  95. package/dist/rolldown-runtime-BocRIvOZ.js +1 -0
  96. package/dist/scroll-area.cjs +1 -1
  97. package/dist/scroll-area.mjs +35 -1
  98. package/dist/scroll-to-top.cjs +1 -1
  99. package/dist/search.cjs +1 -1
  100. package/dist/search.mjs +1 -1
  101. package/dist/select.cjs +1 -1
  102. package/dist/select.mjs +98 -1
  103. package/dist/separator.cjs +1 -1
  104. package/dist/separator.mjs +15 -1
  105. package/dist/sheet.cjs +1 -1
  106. package/dist/sheet.mjs +38 -38
  107. package/dist/{sidebar-C2ax_A0G.mjs → sidebar-DrU3nKaL.mjs} +138 -134
  108. package/dist/sidebar-uOtFHnBs.js +1 -0
  109. package/dist/sidebar.cjs +1 -1
  110. package/dist/sidebar.mjs +3 -1
  111. package/dist/skeleton.cjs +1 -1
  112. package/dist/skeleton.mjs +1 -1
  113. package/dist/slider.cjs +1 -1
  114. package/dist/slider.mjs +34 -1
  115. package/dist/spinner.cjs +1 -1
  116. package/dist/spinner.mjs +1 -1
  117. package/dist/support-fab.cjs +1 -1
  118. package/dist/switch.cjs +1 -1
  119. package/dist/switch.mjs +18 -1
  120. package/dist/table-of-contents.cjs +1 -1
  121. package/dist/table.cjs +1 -1
  122. package/dist/table.mjs +1 -1
  123. package/dist/tabs.cjs +1 -1
  124. package/dist/tabs.mjs +44 -1
  125. package/dist/text.cjs +1 -1
  126. package/dist/textarea.cjs +1 -1
  127. package/dist/textarea.mjs +1 -1
  128. package/dist/{theme-toggle-BSMwXb8o.mjs → theme-toggle-9KtAIRxy.mjs} +6 -6
  129. package/dist/theme-toggle-DkNI3bfh.js +1 -0
  130. package/dist/theme-toggle.cjs +1 -1
  131. package/dist/theme-toggle.mjs +2 -1
  132. package/dist/toast.cjs +1 -1
  133. package/dist/toast.mjs +52 -1
  134. package/dist/{toaster-D2BV6jez.mjs → toaster-8RrHPtlc.mjs} +8 -8
  135. package/dist/toaster-AFud4l6l.js +1 -0
  136. package/dist/toaster.cjs +1 -1
  137. package/dist/toaster.mjs +2 -1
  138. package/dist/toggle-group.cjs +1 -1
  139. package/dist/toggle-group.mjs +49 -1
  140. package/dist/toggle.cjs +1 -1
  141. package/dist/toggle.mjs +35 -1
  142. package/dist/tooltip.cjs +1 -1
  143. package/dist/tooltip.mjs +34 -1
  144. package/package.json +1 -1
  145. package/dist/accordion-Bd0-CZQn.js +0 -1
  146. package/dist/accordion-Cf6DNbLH.mjs +0 -244
  147. package/dist/alert-dialog-BxFH0Lwn.mjs +0 -180
  148. package/dist/alert-dialog-C6vNmGBL.js +0 -1
  149. package/dist/aspect-ratio-CdQevcDV.mjs +0 -38
  150. package/dist/aspect-ratio-Z4Nkc56X.js +0 -1
  151. package/dist/avatar-B5PWwGhY.mjs +0 -136
  152. package/dist/avatar-CFhYRM52.js +0 -1
  153. package/dist/calendar-D5qgt2o2.js +0 -1
  154. package/dist/calendar-DIqXNjOR.mjs +0 -3029
  155. package/dist/carousel-D-xEqRCX.js +0 -1
  156. package/dist/carousel-DPjWmM_A.mjs +0 -1169
  157. package/dist/checkbox-DEPm1BBc.mjs +0 -184
  158. package/dist/checkbox-DI9Hn_e_.js +0 -1
  159. package/dist/chunk-HBS6WEDP-D2-yWzIN.js +0 -1
  160. package/dist/chunk-HBS6WEDP-DD8ZmxRM.mjs +0 -62
  161. package/dist/combobox-C4y8AbZX.mjs +0 -5644
  162. package/dist/combobox-boXp-mix.js +0 -3
  163. package/dist/command-BnW6UIVk.js +0 -1
  164. package/dist/command-Cbsp7PBx.mjs +0 -542
  165. package/dist/context-menu-CwsdFpx1.js +0 -1
  166. package/dist/context-menu-FNgV55ZV.mjs +0 -315
  167. package/dist/dist-7YyzJonC.mjs +0 -39
  168. package/dist/dist-AlmToDtO.mjs +0 -17
  169. package/dist/dist-B76UOZbx.mjs +0 -40
  170. package/dist/dist-B7Ph9-T6.mjs +0 -44
  171. package/dist/dist-B7jnFMko.js +0 -1
  172. package/dist/dist-BOiFyvyS.mjs +0 -10
  173. package/dist/dist-BQkDLAY7.js +0 -1
  174. package/dist/dist-Bal96K8t.js +0 -1
  175. package/dist/dist-Blgp9lfa.js +0 -1
  176. package/dist/dist-BnlI08Je.mjs +0 -96
  177. package/dist/dist-Bu-uFV1C.mjs +0 -191
  178. package/dist/dist-C2BHd5i1.mjs +0 -460
  179. package/dist/dist-C516Vwxy.mjs +0 -116
  180. package/dist/dist-CBlqVBTk.js +0 -1
  181. package/dist/dist-CDcZ8WMF.js +0 -1
  182. package/dist/dist-CDksSmTD.mjs +0 -189
  183. package/dist/dist-CF-qVmmV.js +0 -1
  184. package/dist/dist-CIgGRTmJ.js +0 -1
  185. package/dist/dist-CJqVmdrU.js +0 -1
  186. package/dist/dist-COqM3IM6.mjs +0 -89
  187. package/dist/dist-CbWpCWog.mjs +0 -180
  188. package/dist/dist-CcGLWbPa.mjs +0 -19
  189. package/dist/dist-Cn4F8XlY.mjs +0 -220
  190. package/dist/dist-CoTs6T03.js +0 -1
  191. package/dist/dist-Co_xSt6d.js +0 -1
  192. package/dist/dist-Cu0GG-3j.mjs +0 -15
  193. package/dist/dist-DJqkhIXb.js +0 -1
  194. package/dist/dist-DKI-XYwI.mjs +0 -98
  195. package/dist/dist-DQeXXRYL.mjs +0 -201
  196. package/dist/dist-DW2ltK5-.js +0 -1
  197. package/dist/dist-DWcKY_sJ.js +0 -1
  198. package/dist/dist-DZiOPWLp.js +0 -1
  199. package/dist/dist-DdAeWIwf.js +0 -1
  200. package/dist/dist-DhubV_gU.mjs +0 -4
  201. package/dist/dist-DmY7elIQ.js +0 -1
  202. package/dist/dist-DoWtzxYc.mjs +0 -684
  203. package/dist/dist-DuQlxGyN.js +0 -1
  204. package/dist/dist-KFF7QKuL.js +0 -1
  205. package/dist/dist-RXrZgzkO.js +0 -1
  206. package/dist/dist-R_G5UQRm.js +0 -1
  207. package/dist/dist-dwRwxUPt.mjs +0 -22
  208. package/dist/dist-fzmUl3YX.mjs +0 -553
  209. package/dist/dist-hBsne-A2.mjs +0 -92
  210. package/dist/dist-ljiGYyay.mjs +0 -29
  211. package/dist/dist-pqMcQ1Nk.js +0 -1
  212. package/dist/dist-zmnQp5Xf.js +0 -1
  213. package/dist/dropdown-menu-ChuqZeix.js +0 -1
  214. package/dist/dropdown-menu-DU7KNoXP.mjs +0 -311
  215. package/dist/es2015-BooeZGhO.mjs +0 -554
  216. package/dist/es2015-Dggv0vx3.js +0 -41
  217. package/dist/floating-ui.react-dom-2hihjuTL.mjs +0 -1057
  218. package/dist/floating-ui.react-dom-BtFIezY4.js +0 -1
  219. package/dist/hover-card-BeqCs_2R.js +0 -1
  220. package/dist/hover-card-w8PmCyw2.mjs +0 -176
  221. package/dist/input-otp-Bn_Uy1mR.mjs +0 -398
  222. package/dist/input-otp-CTRB_0Xp.js +0 -20
  223. package/dist/label-Da0kELfR.mjs +0 -26
  224. package/dist/label-JMa1tFfC.js +0 -1
  225. package/dist/menubar-B7sRxpE4.mjs +0 -405
  226. package/dist/menubar-Bd-QKMcw.js +0 -1
  227. package/dist/message-scroller-B8AU0v3Y.mjs +0 -805
  228. package/dist/message-scroller-BJb4Mh_I.js +0 -1
  229. package/dist/navigation-menu-B-RwfscB.mjs +0 -638
  230. package/dist/navigation-menu-kPwxYZCR.js +0 -1
  231. package/dist/popover-Cq5cTNtC.js +0 -1
  232. package/dist/popover-T6Ra737i.mjs +0 -241
  233. package/dist/progress-e9YzxvRo.mjs +0 -90
  234. package/dist/progress-iUSEI7J9.js +0 -6
  235. package/dist/questionnaire-BLCvUX1C.mjs +0 -1137
  236. package/dist/questionnaire-CcymIPae.js +0 -1
  237. package/dist/radio-group-BKpiDcIb.mjs +0 -264
  238. package/dist/radio-group-DPEzCmxe.js +0 -1
  239. package/dist/resizable-ByF0NmN9.mjs +0 -2153
  240. package/dist/resizable-oL3v42zT.js +0 -1
  241. package/dist/rolldown-runtime-D7yIeQp2.mjs +0 -13
  242. package/dist/rolldown-runtime-DbbDpzbe.js +0 -1
  243. package/dist/scroll-area-BzNeOQ6C.mjs +0 -568
  244. package/dist/scroll-area-s4_ZJK59.js +0 -1
  245. package/dist/select-B_nRxX2Y.mjs +0 -831
  246. package/dist/select-j5_dph9S.js +0 -1
  247. package/dist/separator-Bn-3XUSJ.js +0 -1
  248. package/dist/separator-CCcMNS78.mjs +0 -38
  249. package/dist/sidebar-Cnem2n5A.js +0 -1
  250. package/dist/slider-B2PUTc7W.mjs +0 -484
  251. package/dist/slider-wZuXwuib.js +0 -1
  252. package/dist/switch-CD675xU7.js +0 -1
  253. package/dist/switch-ikzIzrme.mjs +0 -172
  254. package/dist/tabs-DCm5zOYB.mjs +0 -158
  255. package/dist/tabs-fcahDQDp.js +0 -1
  256. package/dist/theme-toggle-BGTJsIA-.js +0 -1
  257. package/dist/toast-C31v9P1K.js +0 -1
  258. package/dist/toast-vU5ISM03.mjs +0 -445
  259. package/dist/toaster-CaJyOCyC.js +0 -1
  260. package/dist/toggle-CSZdCCwX.js +0 -1
  261. package/dist/toggle-Cv9YYwLI.mjs +0 -58
  262. package/dist/toggle-group-RT8wyBwK.js +0 -1
  263. package/dist/toggle-group-qvjasXS-.mjs +0 -166
  264. package/dist/tooltip-7ERoN5mV.mjs +0 -386
  265. package/dist/tooltip-CC9_spXT.js +0 -1
@@ -1,831 +0,0 @@
1
- import { t as e } from "./dist-DoWtzxYc.mjs";
2
- import { t } from "./dist-BOiFyvyS.mjs";
3
- import { t as n } from "./dist-B76UOZbx.mjs";
4
- import { t as r } from "./dist-C2BHd5i1.mjs";
5
- import { a as i, n as a } from "./dist-C516Vwxy.mjs";
6
- import { t as o } from "./dist-COqM3IM6.mjs";
7
- import { n as s } from "./dist-dwRwxUPt.mjs";
8
- import { t as c } from "./dist-CbWpCWog.mjs";
9
- import { n as l, r as u, t as d } from "./es2015-BooeZGhO.mjs";
10
- import { t as f } from "./dist-CDksSmTD.mjs";
11
- import { t as p } from "./dist-Cu0GG-3j.mjs";
12
- import { a as m, i as h, n as g, t as _ } from "./dist-Cn4F8XlY.mjs";
13
- import { t as v } from "./dist-CcGLWbPa.mjs";
14
- import { t as y } from "./dist-BnlI08Je.mjs";
15
- import { t as b } from "./dist-B7Ph9-T6.mjs";
16
- import { t as x } from "./dist-AlmToDtO.mjs";
17
- import { t as S } from "./dist-DKI-XYwI.mjs";
18
- import { t as C } from "./dist-DhubV_gU.mjs";
19
- import { t as w } from "./dist-ljiGYyay.mjs";
20
- import { CheckIcon as T, ChevronDownIcon as E, ChevronUpIcon as D } from "lucide-react";
21
- import * as O from "react";
22
- import * as k from "react-dom";
23
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
24
- // ../../node_modules/.bun/@radix-ui+react-select@2.4.1+2b23df507bdda662/node_modules/@radix-ui/react-select/dist/index.mjs
25
- var N = Object.defineProperty, P = (e, t) => N(e, "name", {
26
- value: t,
27
- configurable: !0
28
- }), ee = {
29
- ItemAligned: "item-aligned",
30
- Popper: "popper"
31
- }, F = {
32
- LTR: "ltr",
33
- RTL: "rtl"
34
- }, te = [
35
- " ",
36
- "Enter",
37
- "ArrowUp",
38
- "ArrowDown"
39
- ], ne = [" ", "Enter"], I = "Select", [L, R, re] = r(I), [z, B] = o(I, [re, m]), V = m(), [H, U] = z(I), [W, G] = z(I);
40
- function K(e) {
41
- let { __scopeSelect: t, children: n, open: r, defaultOpen: i, onOpenChange: a, value: o, defaultValue: c, onValueChange: l, dir: u, name: d, autoComplete: f, disabled: m, required: h, form: g, internal_do_not_use_render: v } = e, y = V(t), [b, x] = O.useState(null), [C, w] = O.useState(null), [T, E] = O.useState(!1), D = s(u), [k, A] = S({
42
- prop: r,
43
- defaultProp: i ?? !1,
44
- onChange: a,
45
- caller: I
46
- }), [M, N] = S({
47
- prop: o,
48
- defaultProp: c,
49
- onChange: l,
50
- caller: I
51
- }), ee = O.useRef(null), F = O.useRef(!1), [te, ne] = O.useState(null), R = /* @__PURE__ */ P((e) => {
52
- ne({
53
- value: e,
54
- hasConsumerStoppedPropagation: F.current
55
- }), N(e);
56
- }, "handleUserSelect"), re = O.useRef(M);
57
- O.useEffect(() => {
58
- let e = g ? b?.ownerDocument.getElementById(g) : b?.form;
59
- if (e instanceof HTMLFormElement) {
60
- let t = /* @__PURE__ */ P(() => N(re.current), "reset");
61
- return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
62
- }
63
- }, [
64
- g,
65
- b,
66
- N
67
- ]);
68
- let z = !b || !!g || !!b.closest("form"), [B, U] = O.useState(/* @__PURE__ */ new Set()), G = p(), K = Array.from(B).map((e) => e.props.value).join(";"), ie = O.useCallback((e) => {
69
- U((t) => new Set(t).add(e));
70
- }, []), q = O.useCallback((e) => {
71
- U((t) => {
72
- let n = new Set(t);
73
- return n.delete(e), n;
74
- });
75
- }, []), J = {
76
- required: h,
77
- trigger: b,
78
- onTriggerChange: x,
79
- valueNode: C,
80
- onValueNodeChange: w,
81
- valueNodeHasChildren: T,
82
- onValueNodeHasChildrenChange: E,
83
- contentId: G,
84
- value: M,
85
- onValueChange: N,
86
- hasConsumerStoppedPropagationRef: F,
87
- userSelection: te,
88
- onUserSelect: R,
89
- open: k,
90
- onOpenChange: A,
91
- dir: D,
92
- triggerPointerDownPosRef: ee,
93
- disabled: m,
94
- name: d,
95
- autoComplete: f,
96
- form: g,
97
- nativeOptions: B,
98
- nativeSelectKey: K,
99
- isFormControl: z
100
- };
101
- return /* @__PURE__ */ j(_, {
102
- ...y,
103
- children: /* @__PURE__ */ j(H, {
104
- scope: t,
105
- ...J,
106
- children: /* @__PURE__ */ j(L.Provider, {
107
- scope: t,
108
- children: /* @__PURE__ */ j(W, {
109
- scope: t,
110
- onNativeOptionAdd: ie,
111
- onNativeOptionRemove: q,
112
- children: He(v) ? v(J) : n
113
- })
114
- })
115
- })
116
- });
117
- }
118
- P(K, "SelectProvider");
119
- var ie = /* @__PURE__ */ P((e) => {
120
- let { __scopeSelect: t, children: n, ...r } = e;
121
- return /* @__PURE__ */ j(K, {
122
- __scopeSelect: t,
123
- ...r,
124
- internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ M(A, { children: [n, e ? /* @__PURE__ */ j(Ve, { __scopeSelect: t }) : null] })
125
- });
126
- }, "Select"), q = "SelectTrigger", J = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
127
- let { __scopeSelect: r, disabled: a = !1, ...o } = e, s = V(r), c = U(q, r), l = c.disabled || a, u = i(t, c.onTriggerChange), d = R(r), f = O.useRef("touch"), [p, m, h] = Ue((e) => {
128
- let t = d().filter((e) => !e.disabled), n = We(t, e, t.find((e) => e.value === c.value));
129
- n !== void 0 && c.onUserSelect(n.value);
130
- }), _ = /* @__PURE__ */ P((e) => {
131
- l || (c.onOpenChange(!0), h()), e && (c.triggerPointerDownPosRef.current = {
132
- x: Math.round(e.pageX),
133
- y: Math.round(e.pageY)
134
- });
135
- }, "handleOpen");
136
- return /* @__PURE__ */ j(g, {
137
- asChild: !0,
138
- ...s,
139
- children: /* @__PURE__ */ j(b.button, {
140
- type: "button",
141
- role: "combobox",
142
- "aria-controls": c.open ? c.contentId : void 0,
143
- "aria-expanded": c.open,
144
- "aria-required": c.required,
145
- "aria-autocomplete": "none",
146
- dir: c.dir,
147
- "data-state": c.open ? "open" : "closed",
148
- disabled: l,
149
- "data-disabled": l ? "" : void 0,
150
- "data-placeholder": $(c.value) ? "" : void 0,
151
- ...o,
152
- ref: u,
153
- onClick: n(o.onClick, (e) => {
154
- e.currentTarget.focus(), f.current !== "mouse" && _(e);
155
- }),
156
- onPointerDown: n(o.onPointerDown, (e) => {
157
- f.current = e.pointerType;
158
- let t = e.target;
159
- t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), e.button === 0 && e.ctrlKey === !1 && e.pointerType === "mouse" && (_(e), e.preventDefault());
160
- }),
161
- onKeyDown: n(o.onKeyDown, (e) => {
162
- let t = p.current !== "";
163
- !(e.ctrlKey || e.altKey || e.metaKey) && e.key.length === 1 && (c.hasConsumerStoppedPropagationRef.current = e.isPropagationStopped(), m(e.key)), t && e.key === " " || te.includes(e.key) && (_(), e.preventDefault());
164
- })
165
- })
166
- });
167
- }, "SelectTrigger")), ae = "SelectValue", oe = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
168
- let { __scopeSelect: n, className: r, style: a, children: o, placeholder: s = "", ...c } = e, l = U(ae, n), { onValueNodeHasChildrenChange: u } = l, d = o !== void 0, f = i(t, l.onValueNodeChange);
169
- C(() => {
170
- u(d);
171
- }, [u, d]);
172
- let p = $(l.value);
173
- return /* @__PURE__ */ j(b.span, {
174
- ...c,
175
- asChild: !p && c.asChild,
176
- ref: f,
177
- style: { pointerEvents: "none" },
178
- children: /* @__PURE__ */ j(O.Fragment, { children: p ? s : o }, p ? "placeholder" : "value")
179
- });
180
- }, "SelectValue")), se = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
181
- let { __scopeSelect: n, children: r, ...i } = e;
182
- return /* @__PURE__ */ j(b.span, {
183
- "aria-hidden": !0,
184
- ...i,
185
- ref: t,
186
- children: r || "▼"
187
- });
188
- }, "SelectIcon")), [ce, le] = z("SelectPortal", { forceMount: void 0 }), ue = /* @__PURE__ */ P((e) => {
189
- let { __scopeSelect: t, forceMount: n, ...r } = e;
190
- return /* @__PURE__ */ j(ce, {
191
- scope: e.__scopeSelect,
192
- forceMount: n,
193
- children: /* @__PURE__ */ j(v, {
194
- asChild: !0,
195
- ...r
196
- })
197
- });
198
- }, "SelectPortal"), Y = "SelectContent", de = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
199
- let n = le(Y, e.__scopeSelect), { forceMount: r = n.forceMount, ...i } = e, a = U(Y, e.__scopeSelect), [o, s] = O.useState();
200
- return C(() => {
201
- s(new DocumentFragment());
202
- }, []), /* @__PURE__ */ j(y, {
203
- present: r || a.open,
204
- children: ({ present: e }) => e ? /* @__PURE__ */ j(he, {
205
- ...i,
206
- ref: t
207
- }) : /* @__PURE__ */ j(fe, {
208
- ...i,
209
- fragment: o
210
- })
211
- });
212
- }, "SelectContent")), fe = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
213
- let { __scopeSelect: n, children: r, fragment: i } = e;
214
- return i ? k.createPortal(/* @__PURE__ */ j(pe, {
215
- scope: n,
216
- children: /* @__PURE__ */ j(L.Slot, {
217
- scope: n,
218
- children: /* @__PURE__ */ j("div", {
219
- ref: t,
220
- children: r
221
- })
222
- })
223
- }), i) : null;
224
- }, "SelectContentFragment")), X = 10, [pe, Z] = z(Y), me = a("SelectContent.RemoveScroll"), he = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
225
- let { __scopeSelect: r } = e, { position: a = ee.ItemAligned, onCloseAutoFocus: o, onEscapeKeyDown: s, onPointerDownOutside: p, side: m, sideOffset: h, align: g, alignOffset: _, arrowPadding: v, collisionBoundary: y, collisionPadding: b, sticky: x, hideWhenDetached: S, avoidCollisions: C, ...w } = e, T = U(Y, r), [E, D] = O.useState(null), [k, A] = O.useState(null), M = i(t, D), [N, F] = O.useState(null), [te, ne] = O.useState(null), I = R(r), [L, re] = O.useState(!1), z = O.useRef(!1), B = O.useRef(!1), V = O.useRef(!1);
226
- O.useEffect(() => {
227
- if (E) return d(E);
228
- }, [E]), u();
229
- let H = O.useCallback((e) => {
230
- let [t, ...n] = I().map((e) => e.ref.current), [r] = n.slice(-1), i = document.activeElement;
231
- for (let n of e) if (n === i || (n?.scrollIntoView({ block: "nearest" }), n === t && k && (k.scrollTop = 0), n === r && k && (k.scrollTop = k.scrollHeight), n?.focus(), document.activeElement !== i)) return;
232
- }, [I, k]), W = O.useCallback(() => H([N, E]), [
233
- H,
234
- N,
235
- E
236
- ]);
237
- O.useEffect(() => {
238
- L && W();
239
- }, [L, W]);
240
- let { onOpenChange: G, triggerPointerDownPosRef: K } = T;
241
- O.useEffect(() => {
242
- if (E) {
243
- let e = {
244
- x: 0,
245
- y: 0
246
- }, t = /* @__PURE__ */ P((t) => {
247
- e = {
248
- x: Math.abs(Math.round(t.pageX) - (K.current?.x ?? 0)),
249
- y: Math.abs(Math.round(t.pageY) - (K.current?.y ?? 0))
250
- };
251
- }, "handlePointerMove"), n = /* @__PURE__ */ P((n) => {
252
- e.x <= 10 && e.y <= 10 ? n.preventDefault() : n.composedPath().includes(E) || G(!1), document.removeEventListener("pointermove", t), K.current = null;
253
- }, "handlePointerUp");
254
- return K.current !== null && (document.addEventListener("pointermove", t), document.addEventListener("pointerup", n, {
255
- capture: !0,
256
- once: !0
257
- })), () => {
258
- document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", n, { capture: !0 });
259
- };
260
- }
261
- }, [
262
- E,
263
- G,
264
- K
265
- ]), O.useEffect(() => {
266
- let e = /* @__PURE__ */ P(() => G(!1), "close");
267
- return window.addEventListener("blur", e), window.addEventListener("resize", e), () => {
268
- window.removeEventListener("blur", e), window.removeEventListener("resize", e);
269
- };
270
- }, [G]);
271
- let [ie, q] = Ue((e) => {
272
- let t = I().filter((e) => !e.disabled), n = We(t, e, t.find((e) => e.ref.current === document.activeElement));
273
- n && setTimeout(() => n.ref.current?.focus());
274
- }), J = O.useCallback((e, t, n) => {
275
- let r = !B.current;
276
- r && (B.current = !0);
277
- let i = !z.current && !n;
278
- T.value !== void 0 && T.value === t || i ? (F(e), i && (z.current = !0)) : r && F(e);
279
- }, [T.value]), ae = O.useCallback(() => E?.focus(), [E]), oe = O.useCallback((e, t, n) => {
280
- if (!e) return;
281
- let r = !V.current;
282
- r && (V.current = !0);
283
- let i = !z.current && !n;
284
- (T.value !== void 0 && T.value === t || i || r) && ne(e);
285
- }, [T.value]), se = a === ee.Popper ? _e : ge, ce = se === _e ? {
286
- side: m,
287
- sideOffset: h,
288
- align: g,
289
- alignOffset: _,
290
- arrowPadding: v,
291
- collisionBoundary: y,
292
- collisionPadding: b,
293
- sticky: x,
294
- hideWhenDetached: S,
295
- avoidCollisions: C
296
- } : {};
297
- return /* @__PURE__ */ j(pe, {
298
- scope: r,
299
- content: E,
300
- viewport: k,
301
- onViewportChange: A,
302
- itemRefCallback: J,
303
- selectedItem: N,
304
- onItemLeave: ae,
305
- itemTextRefCallback: oe,
306
- focusSelectedItem: W,
307
- selectedItemText: te,
308
- position: a,
309
- isPositioned: L,
310
- searchRef: ie,
311
- children: /* @__PURE__ */ j(l, {
312
- as: me,
313
- allowPinchZoom: !0,
314
- children: /* @__PURE__ */ j(f, {
315
- asChild: !0,
316
- trapped: T.open,
317
- onMountAutoFocus: (e) => {
318
- e.preventDefault();
319
- },
320
- onUnmountAutoFocus: n(o, (e) => {
321
- T.trigger?.focus({ preventScroll: !0 }), e.preventDefault();
322
- }),
323
- children: /* @__PURE__ */ j(c, {
324
- asChild: !0,
325
- disableOutsidePointerEvents: !0,
326
- onEscapeKeyDown: s,
327
- onPointerDownOutside: p,
328
- onFocusOutside: (e) => e.preventDefault(),
329
- onDismiss: () => T.onOpenChange(!1),
330
- children: /* @__PURE__ */ j(se, {
331
- role: "listbox",
332
- id: T.contentId,
333
- "data-state": T.open ? "open" : "closed",
334
- dir: T.dir,
335
- onContextMenu: (e) => e.preventDefault(),
336
- ...w,
337
- ...ce,
338
- onPlaced: () => re(!0),
339
- ref: M,
340
- style: {
341
- display: "flex",
342
- flexDirection: "column",
343
- outline: "none",
344
- ...w.style
345
- },
346
- onKeyDown: n(w.onKeyDown, (e) => {
347
- let t = e.ctrlKey || e.altKey || e.metaKey;
348
- if (e.key === "Tab" && e.preventDefault(), !t && e.key.length === 1 && q(e.key), [
349
- "ArrowUp",
350
- "ArrowDown",
351
- "Home",
352
- "End"
353
- ].includes(e.key)) {
354
- let t = I().filter((e) => !e.disabled).map((e) => e.ref.current);
355
- if (["ArrowUp", "End"].includes(e.key) && (t = t.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(e.key)) {
356
- let n = e.target, r = t.indexOf(n);
357
- t = t.slice(r + 1);
358
- }
359
- setTimeout(() => H(t)), e.preventDefault();
360
- }
361
- })
362
- })
363
- })
364
- })
365
- })
366
- });
367
- }, "SelectContentImpl")), ge = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, n) {
368
- let { __scopeSelect: r, onPlaced: a, ...o } = e, s = U(Y, r), c = Z(Y, r), [l, u] = O.useState(null), [d, f] = O.useState(null), p = i(n, f), m = R(r), h = O.useRef(!1), g = O.useRef(!0), { viewport: _, selectedItem: v, selectedItemText: y, focusSelectedItem: x } = c, S = O.useCallback(() => {
369
- if (s.trigger && s.valueNode && l && d && _ && v && y) {
370
- let e = s.trigger.getBoundingClientRect(), n = d.getBoundingClientRect(), r = s.valueNode.getBoundingClientRect(), i = y.getBoundingClientRect();
371
- if (s.dir !== F.RTL) {
372
- let a = i.left - n.left, o = r.left - a, s = e.left - o, c = e.width + s, u = Math.max(c, n.width), d = window.innerWidth - X, f = t(o, [X, Math.max(X, d - u)]);
373
- l.style.minWidth = c + "px", l.style.left = f + "px";
374
- } else {
375
- let a = n.right - i.right, o = window.innerWidth - r.right - a, s = window.innerWidth - e.right - o, c = e.width + s, u = Math.max(c, n.width), d = window.innerWidth - X, f = t(o, [X, Math.max(X, d - u)]);
376
- l.style.minWidth = c + "px", l.style.right = f + "px";
377
- }
378
- let o = m(), c = window.innerHeight - X * 2, u = _.scrollHeight, f = window.getComputedStyle(d), p = parseInt(f.borderTopWidth, 10), g = parseInt(f.paddingTop, 10), b = parseInt(f.borderBottomWidth, 10), x = parseInt(f.paddingBottom, 10), S = p + g + u + x + b, C = Math.min(v.offsetHeight * 5, S), w = window.getComputedStyle(_), T = parseInt(w.paddingTop, 10), E = parseInt(w.paddingBottom, 10), D = e.top + e.height / 2 - X, O = c - D, k = v.offsetHeight / 2, A = v.offsetTop + k, j = p + g + A, M = S - j;
379
- if (j <= D) {
380
- let e = o.length > 0 && v === o[o.length - 1].ref.current;
381
- l.style.bottom = "0px";
382
- let t = d.clientHeight - _.offsetTop - _.offsetHeight, n = j + Math.max(O, k + (e ? E : 0) + t + b);
383
- l.style.height = n + "px";
384
- } else {
385
- let e = o.length > 0 && v === o[0].ref.current;
386
- l.style.top = "0px";
387
- let t = Math.max(D, p + _.offsetTop + (e ? T : 0) + k) + M;
388
- l.style.height = t + "px", _.scrollTop = j - D + _.offsetTop;
389
- }
390
- l.style.margin = `${X}px 0`, l.style.minHeight = C + "px", l.style.maxHeight = c + "px", a?.(), requestAnimationFrame(() => h.current = !0);
391
- }
392
- }, [
393
- m,
394
- s.trigger,
395
- s.valueNode,
396
- l,
397
- d,
398
- _,
399
- v,
400
- y,
401
- s.dir,
402
- a
403
- ]);
404
- C(() => S(), [S]);
405
- let [w, T] = O.useState();
406
- C(() => {
407
- d && T(window.getComputedStyle(d).zIndex);
408
- }, [d]);
409
- let E = O.useCallback((e) => {
410
- e && g.current === !0 && (S(), x?.(), g.current = !1);
411
- }, [S, x]);
412
- return /* @__PURE__ */ j(ve, {
413
- scope: r,
414
- contentWrapper: l,
415
- shouldExpandOnScrollRef: h,
416
- onScrollButtonChange: E,
417
- children: /* @__PURE__ */ j("div", {
418
- ref: u,
419
- style: {
420
- display: "flex",
421
- flexDirection: "column",
422
- position: "fixed",
423
- zIndex: w
424
- },
425
- children: /* @__PURE__ */ j(b.div, {
426
- ...o,
427
- ref: p,
428
- style: {
429
- boxSizing: "border-box",
430
- maxHeight: "100%",
431
- ...o.style
432
- }
433
- })
434
- })
435
- });
436
- }, "SelectItemAlignedPosition")), _e = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
437
- let { __scopeSelect: n, align: r = "start", collisionPadding: i = X, ...a } = e, o = V(n);
438
- return /* @__PURE__ */ j(h, {
439
- ...o,
440
- ...a,
441
- ref: t,
442
- align: r,
443
- collisionPadding: i,
444
- style: {
445
- boxSizing: "border-box",
446
- ...a.style,
447
- "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
448
- "--radix-select-content-available-width": "var(--radix-popper-available-width)",
449
- "--radix-select-content-available-height": "var(--radix-popper-available-height)",
450
- "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
451
- "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
452
- }
453
- });
454
- }, "SelectPopperPosition")), [ve, ye] = z(Y, {}), be = "SelectViewport", xe = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
455
- let { __scopeSelect: r, nonce: a, ...o } = e, s = Z(be, r), c = ye(be, r), l = i(t, s.onViewportChange), u = O.useRef(0);
456
- return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j("style", {
457
- dangerouslySetInnerHTML: { __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}" },
458
- nonce: a
459
- }), /* @__PURE__ */ j(L.Slot, {
460
- scope: r,
461
- children: /* @__PURE__ */ j(b.div, {
462
- "data-radix-select-viewport": "",
463
- role: "presentation",
464
- ...o,
465
- ref: l,
466
- style: {
467
- position: "relative",
468
- flex: 1,
469
- overflow: "hidden auto",
470
- ...o.style
471
- },
472
- onScroll: n(o.onScroll, (e) => {
473
- let t = e.currentTarget, { contentWrapper: n, shouldExpandOnScrollRef: r } = c;
474
- if (r?.current && n) {
475
- let e = Math.abs(u.current - t.scrollTop);
476
- if (e > 0) {
477
- let r = window.innerHeight - X * 2, i = parseFloat(n.style.minHeight), a = parseFloat(n.style.height), o = Math.max(i, a);
478
- if (o < r) {
479
- let i = o + e, a = Math.min(r, i), s = i - a;
480
- n.style.height = a + "px", n.style.bottom === "0px" && (t.scrollTop = s > 0 ? s : 0, n.style.justifyContent = "flex-end");
481
- }
482
- }
483
- }
484
- u.current = t.scrollTop;
485
- })
486
- })
487
- })] });
488
- }, "SelectViewport")), [Se, Ce] = z("SelectGroup"), we = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
489
- let { __scopeSelect: n, ...r } = e, i = p();
490
- return /* @__PURE__ */ j(Se, {
491
- scope: n,
492
- id: i,
493
- children: /* @__PURE__ */ j(b.div, {
494
- role: "group",
495
- "aria-labelledby": i,
496
- ...r,
497
- ref: t
498
- })
499
- });
500
- }, "SelectGroup")), Te = "SelectLabel", Ee = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
501
- let { __scopeSelect: n, ...r } = e, i = Ce(Te, n);
502
- return /* @__PURE__ */ j(b.div, {
503
- id: i.id,
504
- ...r,
505
- ref: t
506
- });
507
- }, "SelectLabel")), De = "SelectItem", [Oe, ke] = z(De), Ae = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
508
- let { __scopeSelect: r, value: a, disabled: o = !1, textValue: s, ...c } = e, l = U(De, r), u = Z(De, r), d = l.value === a, [f, m] = O.useState(s ?? ""), [h, g] = O.useState(!1), _ = x((e) => u.itemRefCallback?.(e, a, o)), v = i(t, _), y = p(), S = O.useRef("touch");
509
- function C(e) {
510
- l.hasConsumerStoppedPropagationRef.current = e.isPropagationStopped(), l.onUserSelect(a), l.onOpenChange(!1);
511
- }
512
- return P(C, "handleSelect"), /* @__PURE__ */ j(Oe, {
513
- scope: r,
514
- value: a,
515
- disabled: o,
516
- textId: y,
517
- isSelected: d,
518
- onItemTextChange: O.useCallback((e) => {
519
- m((t) => t || (e?.textContent ?? "").trim());
520
- }, []),
521
- children: /* @__PURE__ */ j(L.ItemSlot, {
522
- scope: r,
523
- value: a,
524
- disabled: o,
525
- textValue: f,
526
- children: /* @__PURE__ */ j(b.div, {
527
- role: "option",
528
- "aria-labelledby": y,
529
- "data-highlighted": h ? "" : void 0,
530
- "aria-selected": d && h,
531
- "data-state": d ? "checked" : "unchecked",
532
- "aria-disabled": o || void 0,
533
- "data-disabled": o ? "" : void 0,
534
- tabIndex: o ? void 0 : -1,
535
- ...c,
536
- ref: v,
537
- onFocus: n(c.onFocus, () => g(!0)),
538
- onBlur: n(c.onBlur, () => g(!1)),
539
- onClick: n(c.onClick, (e) => {
540
- o || S.current !== "mouse" && C(e);
541
- }),
542
- onPointerUp: n(c.onPointerUp, (e) => {
543
- o || S.current === "mouse" && C(e);
544
- }),
545
- onPointerDown: n(c.onPointerDown, (e) => {
546
- S.current = e.pointerType;
547
- }),
548
- onPointerMove: n(c.onPointerMove, (e) => {
549
- S.current = e.pointerType, o ? u.onItemLeave?.() : S.current === "mouse" && e.currentTarget.focus({ preventScroll: !0 });
550
- }),
551
- onPointerLeave: n(c.onPointerLeave, (e) => {
552
- e.currentTarget === document.activeElement && u.onItemLeave?.();
553
- }),
554
- onKeyDown: n(c.onKeyDown, (e) => {
555
- o || e.target !== e.currentTarget || (u.searchRef?.current === "" || e.key !== " ") && (ne.includes(e.key) && C(e), e.key === " " && e.preventDefault());
556
- })
557
- })
558
- })
559
- });
560
- }, "SelectItem")), Q = "SelectItemText", je = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
561
- let { __scopeSelect: n, className: r, style: a, ...o } = e, s = U(Q, n), c = Z(Q, n), l = ke(Q, n), u = G(Q, n), [d, f] = O.useState(null), p = x((e) => c.itemTextRefCallback?.(e, l.value, l.disabled)), m = i(t, f, l.onItemTextChange, p), h = d?.textContent, g = O.useMemo(() => /* @__PURE__ */ j("option", {
562
- value: l.value,
563
- disabled: l.disabled,
564
- children: h
565
- }, l.value), [
566
- l.disabled,
567
- l.value,
568
- h
569
- ]), { onNativeOptionAdd: _, onNativeOptionRemove: v } = u;
570
- return C(() => (_(g), () => v(g)), [
571
- _,
572
- v,
573
- g
574
- ]), /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(b.span, {
575
- id: l.textId,
576
- ...o,
577
- ref: m
578
- }), l.isSelected && s.valueNode && !s.valueNodeHasChildren && !$(s.value) ? k.createPortal(o.children, s.valueNode) : null] });
579
- }, "SelectItemText")), Me = "SelectItemIndicator", Ne = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
580
- let { __scopeSelect: n, ...r } = e;
581
- return ke(Me, n).isSelected ? /* @__PURE__ */ j(b.span, {
582
- "aria-hidden": !0,
583
- ...r,
584
- ref: t
585
- }) : null;
586
- }, "SelectItemIndicator")), Pe = "SelectScrollUpButton", Fe = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
587
- let n = Z(Pe, e.__scopeSelect), r = ye(Pe, e.__scopeSelect), [a, o] = O.useState(!1), s = i(t, r.onScrollButtonChange);
588
- return C(() => {
589
- if (n.viewport && n.isPositioned) {
590
- let e = function() {
591
- let e = t.scrollTop > 0;
592
- o(e);
593
- };
594
- P(e, "handleScroll");
595
- let t = n.viewport;
596
- return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
597
- }
598
- }, [n.viewport, n.isPositioned]), a ? /* @__PURE__ */ j(Re, {
599
- ...e,
600
- ref: s,
601
- onAutoScroll: () => {
602
- let { viewport: e, selectedItem: t } = n;
603
- e && t && (e.scrollTop -= t.offsetHeight);
604
- }
605
- }) : null;
606
- }, "SelectScrollUpButton")), Ie = "SelectScrollDownButton", Le = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
607
- let n = Z(Ie, e.__scopeSelect), r = ye(Ie, e.__scopeSelect), [a, o] = O.useState(!1), s = i(t, r.onScrollButtonChange);
608
- return C(() => {
609
- if (n.viewport && n.isPositioned) {
610
- let e = function() {
611
- let e = t.scrollHeight - t.clientHeight, n = Math.ceil(t.scrollTop) < e;
612
- o(n);
613
- };
614
- P(e, "handleScroll");
615
- let t = n.viewport;
616
- return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
617
- }
618
- }, [n.viewport, n.isPositioned]), a ? /* @__PURE__ */ j(Re, {
619
- ...e,
620
- ref: s,
621
- onAutoScroll: () => {
622
- let { viewport: e, selectedItem: t } = n;
623
- e && t && (e.scrollTop += t.offsetHeight);
624
- }
625
- }) : null;
626
- }, "SelectScrollDownButton")), Re = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
627
- let { __scopeSelect: r, onAutoScroll: i, ...a } = e, o = Z("SelectScrollButton", r), s = O.useRef(null), c = R(r), l = O.useCallback(() => {
628
- s.current !== null && (window.clearInterval(s.current), s.current = null);
629
- }, []);
630
- return O.useEffect(() => () => l(), [l]), C(() => {
631
- c().find((e) => e.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
632
- }, [c]), /* @__PURE__ */ j(b.div, {
633
- "aria-hidden": !0,
634
- ...a,
635
- ref: t,
636
- style: {
637
- flexShrink: 0,
638
- ...a.style
639
- },
640
- onPointerDown: n(a.onPointerDown, () => {
641
- s.current === null && (s.current = window.setInterval(i, 50));
642
- }),
643
- onPointerMove: n(a.onPointerMove, () => {
644
- o.onItemLeave?.(), s.current === null && (s.current = window.setInterval(i, 50));
645
- }),
646
- onPointerLeave: n(a.onPointerLeave, () => {
647
- l();
648
- })
649
- });
650
- }, "SelectScrollButtonImpl")), ze = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
651
- let { __scopeSelect: n, ...r } = e;
652
- return /* @__PURE__ */ j(b.div, {
653
- "aria-hidden": !0,
654
- ...r,
655
- ref: t
656
- });
657
- }, "SelectSeparator")), Be = "SelectBubbleInput", Ve = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function({ __scopeSelect: e, ...t }, n) {
658
- let r = U(Be, e), { value: a, onValueChange: o, required: s, disabled: c, name: l, autoComplete: u, form: d, userSelection: f } = r, { nativeOptions: p, nativeSelectKey: m } = r, h = O.useRef(null), g = i(n, h), _ = a ?? "", v = O.useRef(_), y = O.useRef(f), x = O.useRef(!1), S = Array.from(p).some((e) => (e.props.value ?? "") === "");
659
- return O.useEffect(() => {
660
- let e = h.current;
661
- if (!e) return;
662
- let t = window.HTMLSelectElement.prototype, n = Object.getOwnPropertyDescriptor(t, "value").set, r = f !== null && f !== y.current;
663
- y.current = f;
664
- let i = v.current !== _;
665
- v.current = _;
666
- let a = r && i;
667
- if (r && !i && f.value !== _ && !f.hasConsumerStoppedPropagation && n) {
668
- x.current = !0;
669
- try {
670
- n.call(e, f.value), e.dispatchEvent(new Event("change", { bubbles: !0 }));
671
- } finally {
672
- x.current = !1, n.call(e, _);
673
- }
674
- return;
675
- }
676
- let o = a && !f.hasConsumerStoppedPropagation;
677
- if (i && n) {
678
- let t = new Event("change", { bubbles: o });
679
- n.call(e, _), e.dispatchEvent(t);
680
- }
681
- }, [_, f]), /* @__PURE__ */ M(b.select, {
682
- "aria-hidden": !0,
683
- required: s,
684
- tabIndex: -1,
685
- name: l,
686
- autoComplete: u,
687
- disabled: c,
688
- form: d,
689
- onChange: (e) => {
690
- x.current || o(e.target.value);
691
- },
692
- ...t,
693
- style: {
694
- ...w,
695
- ...t.style
696
- },
697
- ref: g,
698
- defaultValue: _,
699
- children: [$(a) && !S ? /* @__PURE__ */ j("option", { value: "" }) : null, Array.from(p)]
700
- }, m);
701
- }, "SelectBubbleInput"));
702
- function He(e) {
703
- return typeof e == "function";
704
- }
705
- P(He, "isFunction");
706
- function $(e) {
707
- return e === "" || e === void 0;
708
- }
709
- P($, "shouldShowPlaceholder");
710
- function Ue(e) {
711
- let t = x(e), n = O.useRef(""), r = O.useRef(0), i = O.useCallback((e) => {
712
- let i = n.current + e;
713
- t(i);
714
- function a(e) {
715
- n.current = e, window.clearTimeout(r.current), e !== "" && (r.current = window.setTimeout(() => a(""), 1e3));
716
- }
717
- P(a, "updateSearch"), a(i);
718
- }, [t]), a = O.useCallback(() => {
719
- n.current = "", window.clearTimeout(r.current);
720
- }, []);
721
- return O.useEffect(() => () => window.clearTimeout(r.current), []), [
722
- n,
723
- i,
724
- a
725
- ];
726
- }
727
- P(Ue, "useTypeaheadSearch");
728
- function We(e, t, n) {
729
- let r = t.length > 1 && Array.from(t).every((e) => e === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1, a = Ge(e, Math.max(i, 0));
730
- r.length === 1 && (a = a.filter((e) => e !== n));
731
- let o = a.find((e) => e.textValue.toLowerCase().startsWith(r.toLowerCase()));
732
- return o === n ? void 0 : o;
733
- }
734
- P(We, "findNextItem");
735
- function Ge(e, t) {
736
- return e.map((n, r) => e[(t + r) % e.length]);
737
- }
738
- P(Ge, "wrapArray");
739
- // src/select.tsx
740
- function Ke({ ...e }) {
741
- return /* @__PURE__ */ j(ie, {
742
- "data-slot": "select",
743
- ...e
744
- });
745
- }
746
- function qe({ className: t, ...n }) {
747
- return /* @__PURE__ */ j(we, {
748
- "data-slot": "select-group",
749
- className: e("scroll-my-1 p-1", t),
750
- ...n
751
- });
752
- }
753
- function Je({ ...e }) {
754
- return /* @__PURE__ */ j(oe, {
755
- "data-slot": "select-value",
756
- ...e
757
- });
758
- }
759
- function Ye({ className: t, size: n = "default", children: r, ...i }) {
760
- return /* @__PURE__ */ M(J, {
761
- "data-slot": "select-trigger",
762
- "data-size": n,
763
- className: e("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-lg border bg-transparent py-2 ps-2.5 pe-2 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", t),
764
- ...i,
765
- children: [r, /* @__PURE__ */ j(se, {
766
- asChild: !0,
767
- children: /* @__PURE__ */ j(E, { className: "text-muted-foreground pointer-events-none size-4" })
768
- })]
769
- });
770
- }
771
- function Xe({ className: t, children: n, position: r = "item-aligned", align: i = "center", ...a }) {
772
- return /* @__PURE__ */ j(ue, { children: /* @__PURE__ */ M(de, {
773
- "data-slot": "select-content",
774
- "data-align-trigger": r === "item-aligned",
775
- className: e("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none", r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1 rtl:data-[side=left]:translate-x-1 rtl:data-[side=right]:-translate-x-1", t),
776
- position: r,
777
- align: i,
778
- ...a,
779
- children: [
780
- /* @__PURE__ */ j(et, {}),
781
- /* @__PURE__ */ j(xe, {
782
- "data-position": r,
783
- className: e("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)", r === "popper" && ""),
784
- children: n
785
- }),
786
- /* @__PURE__ */ j(tt, {})
787
- ]
788
- }) });
789
- }
790
- function Ze({ className: t, ...n }) {
791
- return /* @__PURE__ */ j(Ee, {
792
- "data-slot": "select-label",
793
- className: e("text-muted-foreground px-1.5 py-1 text-xs", t),
794
- ...n
795
- });
796
- }
797
- function Qe({ className: t, children: n, ...r }) {
798
- return /* @__PURE__ */ M(Ae, {
799
- "data-slot": "select-item",
800
- className: e("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", t),
801
- ...r,
802
- children: [/* @__PURE__ */ j("span", {
803
- className: "pointer-events-none absolute end-2 flex size-4 items-center justify-center",
804
- children: /* @__PURE__ */ j(Ne, { children: /* @__PURE__ */ j(T, { className: "pointer-events-none" }) })
805
- }), /* @__PURE__ */ j(je, { children: n })]
806
- });
807
- }
808
- function $e({ className: t, ...n }) {
809
- return /* @__PURE__ */ j(ze, {
810
- "data-slot": "select-separator",
811
- className: e("bg-border pointer-events-none -mx-1 my-1 h-px", t),
812
- ...n
813
- });
814
- }
815
- function et({ className: t, ...n }) {
816
- return /* @__PURE__ */ j(Fe, {
817
- "data-slot": "select-scroll-up-button",
818
- className: e("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", t),
819
- ...n,
820
- children: /* @__PURE__ */ j(D, {})
821
- });
822
- }
823
- function tt({ className: t, ...n }) {
824
- return /* @__PURE__ */ j(Le, {
825
- "data-slot": "select-scroll-down-button",
826
- className: e("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", t),
827
- ...n,
828
- children: /* @__PURE__ */ j(E, {})
829
- });
830
- }
831
- export { Ze as a, $e as c, Qe as i, Ye as l, Xe as n, tt as o, qe as r, et as s, Ke as t, Je as u };