@gv-tech/ui-web 2.29.1 → 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 (273) hide show
  1. package/dist/accordion.cjs +1 -1
  2. package/dist/accordion.mjs +53 -2
  3. package/dist/alert-dialog.cjs +1 -1
  4. package/dist/alert-dialog.mjs +99 -2
  5. package/dist/alert.cjs +1 -1
  6. package/dist/alert.mjs +2 -3
  7. package/dist/aspect-ratio.cjs +1 -1
  8. package/dist/aspect-ratio.mjs +10 -2
  9. package/dist/attachment.cjs +1 -1
  10. package/dist/attachment.mjs +26 -26
  11. package/dist/avatar.cjs +1 -1
  12. package/dist/avatar.mjs +49 -2
  13. package/dist/badge.cjs +1 -1
  14. package/dist/badge.mjs +5 -5
  15. package/dist/breadcrumb.cjs +1 -1
  16. package/dist/breadcrumb.mjs +13 -13
  17. package/dist/bubble.cjs +1 -1
  18. package/dist/bubble.mjs +5 -5
  19. package/dist/button-group.cjs +1 -1
  20. package/dist/button-group.mjs +13 -13
  21. package/dist/button.cjs +1 -1
  22. package/dist/button.mjs +5 -5
  23. package/dist/calendar.cjs +1 -1
  24. package/dist/calendar.mjs +97 -2
  25. package/dist/card.cjs +1 -1
  26. package/dist/card.mjs +2 -3
  27. package/dist/carousel.cjs +1 -1
  28. package/dist/carousel.mjs +107 -2
  29. package/dist/chart.cjs +2 -2
  30. package/dist/chart.mjs +14 -15
  31. package/dist/checkbox.cjs +1 -1
  32. package/dist/checkbox.mjs +19 -2
  33. package/dist/collapsible.cjs +1 -1
  34. package/dist/collapsible.mjs +13 -14
  35. package/dist/combobox.cjs +1 -1
  36. package/dist/combobox.mjs +161 -2
  37. package/dist/command.cjs +1 -1
  38. package/dist/command.mjs +89 -2
  39. package/dist/context-menu.cjs +1 -1
  40. package/dist/context-menu.mjs +123 -2
  41. package/dist/dialog.cjs +1 -1
  42. package/dist/dialog.mjs +41 -42
  43. package/dist/direction.cjs +1 -1
  44. package/dist/direction.mjs +8 -9
  45. package/dist/drawer.cjs +1 -1
  46. package/dist/drawer.mjs +2 -3
  47. package/dist/dropdown-menu.cjs +1 -1
  48. package/dist/dropdown-menu.mjs +126 -2
  49. package/dist/empty.cjs +1 -1
  50. package/dist/empty.mjs +2 -3
  51. package/dist/field.cjs +1 -1
  52. package/dist/field.mjs +37 -38
  53. package/dist/form.cjs +1 -1
  54. package/dist/form.mjs +34 -35
  55. package/dist/hooks/use-theme.d.ts +52 -52
  56. package/dist/hover-card.cjs +1 -1
  57. package/dist/hover-card.mjs +30 -2
  58. package/dist/index.cjs +1 -1
  59. package/dist/index.mjs +66 -66
  60. package/dist/input-group.cjs +1 -1
  61. package/dist/input-group.mjs +27 -28
  62. package/dist/input-otp.cjs +1 -1
  63. package/dist/input-otp.mjs +45 -2
  64. package/dist/input.cjs +1 -1
  65. package/dist/input.mjs +2 -3
  66. package/dist/item.cjs +1 -1
  67. package/dist/item.mjs +29 -29
  68. package/dist/kbd.cjs +1 -1
  69. package/dist/kbd.mjs +2 -3
  70. package/dist/label.cjs +1 -1
  71. package/dist/label.mjs +13 -2
  72. package/dist/marker.cjs +1 -1
  73. package/dist/marker.mjs +5 -5
  74. package/dist/menubar.cjs +1 -1
  75. package/dist/menubar.mjs +133 -2
  76. package/dist/message-scroller.cjs +1 -1
  77. package/dist/message-scroller.mjs +59 -2
  78. package/dist/message.cjs +1 -1
  79. package/dist/message.mjs +2 -3
  80. package/dist/native-select.cjs +1 -1
  81. package/dist/native-select.mjs +2 -3
  82. package/dist/navigation-menu.cjs +1 -1
  83. package/dist/navigation-menu.mjs +79 -2
  84. package/dist/pagination.cjs +1 -1
  85. package/dist/pagination.mjs +15 -16
  86. package/dist/popover.cjs +1 -1
  87. package/dist/popover.mjs +54 -2
  88. package/dist/progress.cjs +1 -1
  89. package/dist/progress.mjs +19 -2
  90. package/dist/questionnaire.cjs +1 -1
  91. package/dist/questionnaire.mjs +168 -2
  92. package/dist/radio-group.cjs +1 -1
  93. package/dist/radio-group.mjs +25 -2
  94. package/dist/resizable.cjs +1 -1
  95. package/dist/resizable.mjs +26 -2
  96. package/dist/rolldown-runtime-BocRIvOZ.js +1 -0
  97. package/dist/scroll-area.cjs +1 -1
  98. package/dist/scroll-area.mjs +35 -2
  99. package/dist/scroll-to-top.cjs +1 -1
  100. package/dist/scroll-to-top.mjs +6 -11
  101. package/dist/search.cjs +1 -1
  102. package/dist/search.mjs +12 -13
  103. package/dist/select.cjs +1 -1
  104. package/dist/select.mjs +98 -2
  105. package/dist/separator.cjs +1 -1
  106. package/dist/separator.mjs +15 -2
  107. package/dist/sheet.cjs +1 -1
  108. package/dist/sheet.mjs +39 -40
  109. package/dist/{sidebar-DM9ee9wf.mjs → sidebar-DrU3nKaL.mjs} +137 -135
  110. package/dist/sidebar-uOtFHnBs.js +1 -0
  111. package/dist/sidebar.cjs +1 -1
  112. package/dist/sidebar.mjs +3 -2
  113. package/dist/skeleton.cjs +1 -1
  114. package/dist/skeleton.mjs +2 -3
  115. package/dist/slider.cjs +1 -1
  116. package/dist/slider.mjs +34 -2
  117. package/dist/sonner.mjs +1 -2
  118. package/dist/spinner.cjs +1 -1
  119. package/dist/spinner.mjs +2 -3
  120. package/dist/support-fab.cjs +1 -1
  121. package/dist/support-fab.mjs +21 -22
  122. package/dist/switch.cjs +1 -1
  123. package/dist/switch.mjs +18 -2
  124. package/dist/table-of-contents.cjs +1 -1
  125. package/dist/table-of-contents.mjs +5 -6
  126. package/dist/table.cjs +1 -1
  127. package/dist/table.mjs +2 -3
  128. package/dist/tabs.cjs +1 -1
  129. package/dist/tabs.mjs +44 -2
  130. package/dist/text.cjs +1 -1
  131. package/dist/text.mjs +14 -12
  132. package/dist/textarea.cjs +1 -1
  133. package/dist/textarea.mjs +2 -3
  134. package/dist/theme-provider.mjs +1 -2
  135. package/dist/{theme-toggle-3RStptYf.mjs → theme-toggle-9KtAIRxy.mjs} +18 -20
  136. package/dist/theme-toggle-DkNI3bfh.js +1 -0
  137. package/dist/theme-toggle.cjs +1 -1
  138. package/dist/theme-toggle.mjs +2 -2
  139. package/dist/toast.cjs +1 -1
  140. package/dist/toast.mjs +52 -2
  141. package/dist/{toaster-gT2b7mfE.mjs → toaster-8RrHPtlc.mjs} +10 -12
  142. package/dist/toaster-AFud4l6l.js +1 -0
  143. package/dist/toaster.cjs +1 -1
  144. package/dist/toaster.mjs +2 -2
  145. package/dist/toggle-group.cjs +1 -1
  146. package/dist/toggle-group.mjs +49 -2
  147. package/dist/toggle.cjs +1 -1
  148. package/dist/toggle.mjs +35 -2
  149. package/dist/tooltip.cjs +1 -1
  150. package/dist/tooltip.mjs +34 -2
  151. package/dist/{utils-A_oVsYw5.mjs → utils-DQKc9joa.mjs} +1 -2
  152. package/package.json +3 -3
  153. package/dist/accordion-D5QXSsCK.mjs +0 -248
  154. package/dist/accordion-DjyDOX-h.js +0 -1
  155. package/dist/alert-dialog-B-a0Wa1M.mjs +0 -182
  156. package/dist/alert-dialog-DYQAhGBC.js +0 -1
  157. package/dist/aspect-ratio-C-KOOyGP.js +0 -1
  158. package/dist/aspect-ratio-s7Ji1MSr.mjs +0 -40
  159. package/dist/avatar-4K3XjhP8.js +0 -1
  160. package/dist/avatar-d8Di248f.mjs +0 -138
  161. package/dist/calendar-DFj14O6r.js +0 -1
  162. package/dist/calendar-UW8h9dfh.mjs +0 -3182
  163. package/dist/carousel-CNGpg5df.js +0 -1
  164. package/dist/carousel-DG9xGJns.mjs +0 -1171
  165. package/dist/checkbox-BCgbTAdU.js +0 -1
  166. package/dist/checkbox-Dq8VHKDH.mjs +0 -186
  167. package/dist/chunk-BmowowmI.mjs +0 -14
  168. package/dist/chunk-HBS6WEDP-CQNaACTf.js +0 -1
  169. package/dist/chunk-HBS6WEDP-aK8IuEX9.mjs +0 -63
  170. package/dist/chunk-mLOUI7ql.js +0 -1
  171. package/dist/combobox-CpPIGtPJ.js +0 -4
  172. package/dist/combobox-b4OmCNw1.mjs +0 -5887
  173. package/dist/command-5hobOyGG.mjs +0 -545
  174. package/dist/command-Dbqnm9kI.js +0 -1
  175. package/dist/context-menu-DyTUismw.js +0 -1
  176. package/dist/context-menu-DzzU-_v8.mjs +0 -317
  177. package/dist/dist-1zUKVGvf.js +0 -1
  178. package/dist/dist-B057I8ju.mjs +0 -30
  179. package/dist/dist-BB78QQyQ.mjs +0 -41
  180. package/dist/dist-BBvidwzC.js +0 -1
  181. package/dist/dist-BEbV0Hal.mjs +0 -45
  182. package/dist/dist-BPL7gUpg.mjs +0 -18
  183. package/dist/dist-BTUvBzOm.js +0 -1
  184. package/dist/dist-BU-TFzJf.js +0 -1
  185. package/dist/dist-Bb5W_J2F.mjs +0 -39
  186. package/dist/dist-BbI6NHqR.mjs +0 -23
  187. package/dist/dist-BexAB6yo.mjs +0 -192
  188. package/dist/dist-BgXIqHHq.js +0 -1
  189. package/dist/dist-Bvfb4y_L.mjs +0 -100
  190. package/dist/dist-C8Pm6LRc.js +0 -1
  191. package/dist/dist-CGgemr2V.js +0 -1
  192. package/dist/dist-CPAF050o.mjs +0 -90
  193. package/dist/dist-CS572Be42.mjs +0 -11
  194. package/dist/dist-CUvxOuXM.mjs +0 -551
  195. package/dist/dist-C_iFkwIX.js +0 -1
  196. package/dist/dist-ClYM7l1t.js +0 -1
  197. package/dist/dist-CpKLY_uZ.mjs +0 -96
  198. package/dist/dist-D1qkELLT.js +0 -1
  199. package/dist/dist-D7-Fky36.js +0 -1
  200. package/dist/dist-DEpkkABT.js +0 -1
  201. package/dist/dist-DI1vapnL.mjs +0 -20
  202. package/dist/dist-DJqkhIXb2.js +0 -1
  203. package/dist/dist-DKXojpVG.js +0 -1
  204. package/dist/dist-DYUvPCPC.js +0 -1
  205. package/dist/dist-DZiOPWLp.js +0 -1
  206. package/dist/dist-DatgTWLz.mjs +0 -202
  207. package/dist/dist-Dm3IQk5b.mjs +0 -685
  208. package/dist/dist-DoivLw3t.js +0 -1
  209. package/dist/dist-Dq-h6VAy.mjs +0 -118
  210. package/dist/dist-Dt6m-kwU.mjs +0 -221
  211. package/dist/dist-E8ieJTBC.mjs +0 -190
  212. package/dist/dist-GazS1kfR.mjs +0 -5
  213. package/dist/dist-N97cIp0_.js +0 -1
  214. package/dist/dist-OqDzLHTa.mjs +0 -460
  215. package/dist/dist-Qm9hFvM1.js +0 -1
  216. package/dist/dist-UkWa-Arh.mjs +0 -16
  217. package/dist/dist-UnTrOmPV.js +0 -1
  218. package/dist/dist-YAADIsyo.js +0 -1
  219. package/dist/dist-Zs2sjYhL.js +0 -1
  220. package/dist/dist-hFLuJoMi.js +0 -1
  221. package/dist/dist-s7ibhASj.mjs +0 -181
  222. package/dist/dist-vu20fMUK.mjs +0 -93
  223. package/dist/dropdown-menu-BqAhn64y.mjs +0 -313
  224. package/dist/dropdown-menu-BtKOr--r.js +0 -1
  225. package/dist/es2015-DbAsWDbs.js +0 -41
  226. package/dist/es2015-DbsmTzuc.mjs +0 -571
  227. package/dist/floating-ui.react-dom-BwFRxNGc.js +0 -1
  228. package/dist/floating-ui.react-dom-CyupHsR6.mjs +0 -1062
  229. package/dist/hover-card-DMsxpR9G.mjs +0 -178
  230. package/dist/hover-card-DWXusgiI.js +0 -1
  231. package/dist/input-otp-D49Y9VcH.mjs +0 -409
  232. package/dist/input-otp-u3obpt-Q.js +0 -20
  233. package/dist/label-Dacwh21G.js +0 -1
  234. package/dist/label-DsSICLPc.mjs +0 -28
  235. package/dist/menubar-BYNeRuzx.js +0 -1
  236. package/dist/menubar-DZqEj6S1.mjs +0 -407
  237. package/dist/message-scroller-CS4t7Ypn.mjs +0 -824
  238. package/dist/message-scroller-DqLu0YI6.js +0 -1
  239. package/dist/navigation-menu-B36G3O83.js +0 -1
  240. package/dist/navigation-menu-RO6thDOF.mjs +0 -636
  241. package/dist/popover-DSBkc70V.mjs +0 -243
  242. package/dist/popover-DUHbvKB8.js +0 -1
  243. package/dist/progress-B9z08UXf.js +0 -6
  244. package/dist/progress-CQ4nQ85t.mjs +0 -92
  245. package/dist/questionnaire-CVED7G7R.mjs +0 -1159
  246. package/dist/questionnaire-PWClWvST.js +0 -1
  247. package/dist/radio-group-Bd3WbH5I.js +0 -1
  248. package/dist/radio-group-TRiAhMZB.mjs +0 -266
  249. package/dist/resizable-Cq60hEWB.js +0 -1
  250. package/dist/resizable-Qc8cVUKd.mjs +0 -2857
  251. package/dist/scroll-area-D6MiNHnJ.mjs +0 -564
  252. package/dist/scroll-area-DFUdJeSZ.js +0 -1
  253. package/dist/select-BFJUmjvX.mjs +0 -830
  254. package/dist/select-iQFoKU1s.js +0 -1
  255. package/dist/separator-2kr96SyF.mjs +0 -40
  256. package/dist/separator-Bo49G2aj.js +0 -1
  257. package/dist/sidebar-C6O8hLkz.js +0 -1
  258. package/dist/slider-CagVxozY.js +0 -1
  259. package/dist/slider-CdTCoQu1.mjs +0 -485
  260. package/dist/switch-CoeAC1Wk.js +0 -1
  261. package/dist/switch-zUBdj7jK.mjs +0 -174
  262. package/dist/tabs-DaE9pEbo.mjs +0 -160
  263. package/dist/tabs-TMhXe20x.js +0 -1
  264. package/dist/theme-toggle-DKh8WFLT.js +0 -1
  265. package/dist/toast-B0S3F09s.js +0 -1
  266. package/dist/toast-D0Yb-K84.mjs +0 -445
  267. package/dist/toaster-CX9im8R_.js +0 -1
  268. package/dist/toggle-B0hXPsi7.js +0 -1
  269. package/dist/toggle-BAeKd2N0.mjs +0 -59
  270. package/dist/toggle-group-CEKhUozD.mjs +0 -167
  271. package/dist/toggle-group-htyug3G7.js +0 -1
  272. package/dist/tooltip-BZazhXDZ.js +0 -1
  273. package/dist/tooltip-R_nK_Qh5.mjs +0 -390
@@ -1,830 +0,0 @@
1
- import { t as e } from "./dist-Dm3IQk5b.mjs";
2
- import { a as t, n } from "./dist-Dq-h6VAy.mjs";
3
- import { t as r } from "./dist-BEbV0Hal.mjs";
4
- import { t as i } from "./dist-B057I8ju.mjs";
5
- import { t as a } from "./dist-CPAF050o.mjs";
6
- import { t as o } from "./dist-GazS1kfR.mjs";
7
- import { t as s } from "./dist-OqDzLHTa.mjs";
8
- import { t as c } from "./dist-BB78QQyQ.mjs";
9
- import { t as l } from "./dist-Bvfb4y_L.mjs";
10
- import { t as u } from "./dist-CpKLY_uZ.mjs";
11
- import { t as d } from "./dist-UkWa-Arh.mjs";
12
- import { n as f } from "./dist-BbI6NHqR.mjs";
13
- import { t as p } from "./dist-BPL7gUpg.mjs";
14
- import { t as m } from "./dist-s7ibhASj.mjs";
15
- import { t as h } from "./dist-E8ieJTBC.mjs";
16
- import { t as g } from "./dist-DI1vapnL.mjs";
17
- import { n as _, r as v, t as y } from "./es2015-DbsmTzuc.mjs";
18
- import { a as b, i as x, n as S, t as C } from "./dist-Dt6m-kwU.mjs";
19
- import { t as w } from "./dist-CS572Be42.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
- //#region ../../node_modules/.bun/@radix-ui+react-select@2.4.1+b146eb580f4286be/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] = s(I), [z, B] = a(I, [re, b]), V = b(), [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: s, onValueChange: c, dir: u, name: p, autoComplete: m, disabled: h, required: g, form: _, internal_do_not_use_render: v } = e, y = V(t), [b, x] = O.useState(null), [S, w] = O.useState(null), [T, E] = O.useState(!1), D = f(u), [k, A] = l({
42
- prop: r,
43
- defaultProp: i ?? !1,
44
- onChange: a,
45
- caller: I
46
- }), [M, N] = l({
47
- prop: o,
48
- defaultProp: s,
49
- onChange: c,
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 = _ ? b?.ownerDocument.getElementById(_) : 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
- _,
65
- b,
66
- N
67
- ]);
68
- let z = b ? !!_ || !!b.closest("form") : !0, [B, U] = O.useState(/* @__PURE__ */ new Set()), G = d(), 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: g,
77
- trigger: b,
78
- onTriggerChange: x,
79
- valueNode: S,
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: h,
94
- name: p,
95
- autoComplete: m,
96
- form: _,
97
- nativeOptions: B,
98
- nativeSelectKey: K,
99
- isFormControl: z
100
- };
101
- return /* @__PURE__ */ j(C, {
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, n) {
127
- let { __scopeSelect: i, disabled: a = !1, ...o } = e, s = V(i), l = U(q, i), u = l.disabled || a, d = t(n, l.onTriggerChange), f = R(i), p = O.useRef("touch"), [m, h, g] = Ue((e) => {
128
- let t = f().filter((e) => !e.disabled), n = We(t, e, t.find((e) => e.value === l.value));
129
- n !== void 0 && l.onUserSelect(n.value);
130
- }), _ = /* @__PURE__ */ P((e) => {
131
- u || (l.onOpenChange(!0), g()), e && (l.triggerPointerDownPosRef.current = {
132
- x: Math.round(e.pageX),
133
- y: Math.round(e.pageY)
134
- });
135
- }, "handleOpen");
136
- return /* @__PURE__ */ j(S, {
137
- asChild: !0,
138
- ...s,
139
- children: /* @__PURE__ */ j(r.button, {
140
- type: "button",
141
- role: "combobox",
142
- "aria-controls": l.open ? l.contentId : void 0,
143
- "aria-expanded": l.open,
144
- "aria-required": l.required,
145
- "aria-autocomplete": "none",
146
- dir: l.dir,
147
- "data-state": l.open ? "open" : "closed",
148
- disabled: u,
149
- "data-disabled": u ? "" : void 0,
150
- "data-placeholder": $(l.value) ? "" : void 0,
151
- ...o,
152
- ref: d,
153
- onClick: c(o.onClick, (e) => {
154
- e.currentTarget.focus(), p.current !== "mouse" && _(e);
155
- }),
156
- onPointerDown: c(o.onPointerDown, (e) => {
157
- p.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: c(o.onKeyDown, (e) => {
162
- let t = m.current !== "";
163
- !(e.ctrlKey || e.altKey || e.metaKey) && e.key.length === 1 && (l.hasConsumerStoppedPropagationRef.current = e.isPropagationStopped(), h(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, n) {
168
- let { __scopeSelect: i, className: a, style: s, children: c, placeholder: l = "", ...u } = e, d = U(ae, i), { onValueNodeHasChildrenChange: f } = d, p = c !== void 0, m = t(n, d.onValueNodeChange);
169
- o(() => {
170
- f(p);
171
- }, [f, p]);
172
- let h = $(d.value);
173
- return /* @__PURE__ */ j(r.span, {
174
- ...u,
175
- asChild: h ? !1 : u.asChild,
176
- ref: m,
177
- style: { pointerEvents: "none" },
178
- children: /* @__PURE__ */ j(O.Fragment, { children: h ? l : c }, h ? "placeholder" : "value")
179
- });
180
- }, "SelectValue")), se = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
181
- let { __scopeSelect: n, children: i, ...a } = e;
182
- return /* @__PURE__ */ j(r.span, {
183
- "aria-hidden": !0,
184
- ...a,
185
- ref: t,
186
- children: i || "▼"
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(g, {
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), [s, c] = O.useState();
200
- return o(() => {
201
- c(new DocumentFragment());
202
- }, []), /* @__PURE__ */ j(u, {
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: s
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 = n("SelectContent.RemoveScroll"), he = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, n) {
225
- let { __scopeSelect: r } = e, { position: i = ee.ItemAligned, onCloseAutoFocus: a, onEscapeKeyDown: o, onPointerDownOutside: s, side: l, sideOffset: u, align: d, alignOffset: f, arrowPadding: p, collisionBoundary: g, 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 = t(n, 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 y(E);
228
- }, [E]), v();
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 = i === ee.Popper ? _e : ge, ce = se === _e ? {
286
- side: l,
287
- sideOffset: u,
288
- align: d,
289
- alignOffset: f,
290
- arrowPadding: p,
291
- collisionBoundary: g,
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: i,
309
- isPositioned: L,
310
- searchRef: ie,
311
- children: /* @__PURE__ */ j(_, {
312
- as: me,
313
- allowPinchZoom: !0,
314
- children: /* @__PURE__ */ j(h, {
315
- asChild: !0,
316
- trapped: T.open,
317
- onMountAutoFocus: (e) => {
318
- e.preventDefault();
319
- },
320
- onUnmountAutoFocus: c(a, (e) => {
321
- T.trigger?.focus({ preventScroll: !0 }), e.preventDefault();
322
- }),
323
- children: /* @__PURE__ */ j(m, {
324
- asChild: !0,
325
- disableOutsidePointerEvents: !0,
326
- onEscapeKeyDown: o,
327
- onPointerDownOutside: s,
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: c(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: i, onPlaced: a, ...s } = e, c = U(Y, i), l = Z(Y, i), [u, d] = O.useState(null), [f, p] = O.useState(null), m = t(n, p), h = R(i), g = O.useRef(!1), _ = O.useRef(!0), { viewport: v, selectedItem: y, selectedItemText: b, focusSelectedItem: x } = l, S = O.useCallback(() => {
369
- if (c.trigger && c.valueNode && u && f && v && y && b) {
370
- let e = c.trigger.getBoundingClientRect(), t = f.getBoundingClientRect(), n = c.valueNode.getBoundingClientRect(), r = b.getBoundingClientRect();
371
- if (c.dir !== F.RTL) {
372
- let i = r.left - t.left, a = n.left - i, o = e.left - a, s = e.width + o, c = Math.max(s, t.width), l = window.innerWidth - X, d = w(a, [X, Math.max(X, l - c)]);
373
- u.style.minWidth = s + "px", u.style.left = d + "px";
374
- } else {
375
- let i = t.right - r.right, a = window.innerWidth - n.right - i, o = window.innerWidth - e.right - a, s = e.width + o, c = Math.max(s, t.width), l = window.innerWidth - X, d = w(a, [X, Math.max(X, l - c)]);
376
- u.style.minWidth = s + "px", u.style.right = d + "px";
377
- }
378
- let i = h(), o = window.innerHeight - X * 2, s = v.scrollHeight, l = window.getComputedStyle(f), d = parseInt(l.borderTopWidth, 10), p = parseInt(l.paddingTop, 10), m = parseInt(l.borderBottomWidth, 10), _ = parseInt(l.paddingBottom, 10), x = d + p + s + _ + m, S = Math.min(y.offsetHeight * 5, x), C = window.getComputedStyle(v), T = parseInt(C.paddingTop, 10), E = parseInt(C.paddingBottom, 10), D = e.top + e.height / 2 - X, O = o - D, k = y.offsetHeight / 2, A = y.offsetTop + k, j = d + p + A, M = x - j;
379
- if (j <= D) {
380
- let e = i.length > 0 && y === i[i.length - 1].ref.current;
381
- u.style.bottom = "0px";
382
- let t = f.clientHeight - v.offsetTop - v.offsetHeight, n = j + Math.max(O, k + (e ? E : 0) + t + m);
383
- u.style.height = n + "px";
384
- } else {
385
- let e = i.length > 0 && y === i[0].ref.current;
386
- u.style.top = "0px";
387
- let t = Math.max(D, d + v.offsetTop + (e ? T : 0) + k) + M;
388
- u.style.height = t + "px", v.scrollTop = j - D + v.offsetTop;
389
- }
390
- u.style.margin = `${X}px 0`, u.style.minHeight = S + "px", u.style.maxHeight = o + "px", a?.(), requestAnimationFrame(() => g.current = !0);
391
- }
392
- }, [
393
- h,
394
- c.trigger,
395
- c.valueNode,
396
- u,
397
- f,
398
- v,
399
- y,
400
- b,
401
- c.dir,
402
- a
403
- ]);
404
- o(() => S(), [S]);
405
- let [C, T] = O.useState();
406
- return o(() => {
407
- f && T(window.getComputedStyle(f).zIndex);
408
- }, [f]), /* @__PURE__ */ j(ve, {
409
- scope: i,
410
- contentWrapper: u,
411
- shouldExpandOnScrollRef: g,
412
- onScrollButtonChange: O.useCallback((e) => {
413
- e && _.current === !0 && (S(), x?.(), _.current = !1);
414
- }, [S, x]),
415
- children: /* @__PURE__ */ j("div", {
416
- ref: d,
417
- style: {
418
- display: "flex",
419
- flexDirection: "column",
420
- position: "fixed",
421
- zIndex: C
422
- },
423
- children: /* @__PURE__ */ j(r.div, {
424
- ...s,
425
- ref: m,
426
- style: {
427
- boxSizing: "border-box",
428
- maxHeight: "100%",
429
- ...s.style
430
- }
431
- })
432
- })
433
- });
434
- }, "SelectItemAlignedPosition")), _e = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
435
- let { __scopeSelect: n, align: r = "start", collisionPadding: i = X, ...a } = e;
436
- return /* @__PURE__ */ j(x, {
437
- ...V(n),
438
- ...a,
439
- ref: t,
440
- align: r,
441
- collisionPadding: i,
442
- style: {
443
- boxSizing: "border-box",
444
- ...a.style,
445
- "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
446
- "--radix-select-content-available-width": "var(--radix-popper-available-width)",
447
- "--radix-select-content-available-height": "var(--radix-popper-available-height)",
448
- "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
449
- "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
450
- }
451
- });
452
- }, "SelectPopperPosition")), [ve, ye] = z(Y, {}), be = "SelectViewport", xe = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, n) {
453
- let { __scopeSelect: i, nonce: a, ...o } = e, s = Z(be, i), l = ye(be, i), u = t(n, s.onViewportChange), d = O.useRef(0);
454
- return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j("style", {
455
- 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}" },
456
- nonce: a
457
- }), /* @__PURE__ */ j(L.Slot, {
458
- scope: i,
459
- children: /* @__PURE__ */ j(r.div, {
460
- "data-radix-select-viewport": "",
461
- role: "presentation",
462
- ...o,
463
- ref: u,
464
- style: {
465
- position: "relative",
466
- flex: 1,
467
- overflow: "hidden auto",
468
- ...o.style
469
- },
470
- onScroll: c(o.onScroll, (e) => {
471
- let t = e.currentTarget, { contentWrapper: n, shouldExpandOnScrollRef: r } = l;
472
- if (r?.current && n) {
473
- let e = Math.abs(d.current - t.scrollTop);
474
- if (e > 0) {
475
- let r = window.innerHeight - X * 2, i = parseFloat(n.style.minHeight), a = parseFloat(n.style.height), o = Math.max(i, a);
476
- if (o < r) {
477
- let i = o + e, a = Math.min(r, i), s = i - a;
478
- n.style.height = a + "px", n.style.bottom === "0px" && (t.scrollTop = s > 0 ? s : 0, n.style.justifyContent = "flex-end");
479
- }
480
- }
481
- }
482
- d.current = t.scrollTop;
483
- })
484
- })
485
- })] });
486
- }, "SelectViewport")), [Se, Ce] = z("SelectGroup"), we = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
487
- let { __scopeSelect: n, ...i } = e, a = d();
488
- return /* @__PURE__ */ j(Se, {
489
- scope: n,
490
- id: a,
491
- children: /* @__PURE__ */ j(r.div, {
492
- role: "group",
493
- "aria-labelledby": a,
494
- ...i,
495
- ref: t
496
- })
497
- });
498
- }, "SelectGroup")), Te = "SelectLabel", Ee = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
499
- let { __scopeSelect: n, ...i } = e, a = Ce(Te, n);
500
- return /* @__PURE__ */ j(r.div, {
501
- id: a.id,
502
- ...i,
503
- ref: t
504
- });
505
- }, "SelectLabel")), De = "SelectItem", [Oe, ke] = z(De), Ae = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, n) {
506
- let { __scopeSelect: i, value: a, disabled: o = !1, textValue: s, ...l } = e, u = U(De, i), f = Z(De, i), m = u.value === a, [h, g] = O.useState(s ?? ""), [_, v] = O.useState(!1), y = t(n, p((e) => f.itemRefCallback?.(e, a, o))), b = d(), x = O.useRef("touch");
507
- function S(e) {
508
- u.hasConsumerStoppedPropagationRef.current = e.isPropagationStopped(), u.onUserSelect(a), u.onOpenChange(!1);
509
- }
510
- return P(S, "handleSelect"), /* @__PURE__ */ j(Oe, {
511
- scope: i,
512
- value: a,
513
- disabled: o,
514
- textId: b,
515
- isSelected: m,
516
- onItemTextChange: O.useCallback((e) => {
517
- g((t) => t || (e?.textContent ?? "").trim());
518
- }, []),
519
- children: /* @__PURE__ */ j(L.ItemSlot, {
520
- scope: i,
521
- value: a,
522
- disabled: o,
523
- textValue: h,
524
- children: /* @__PURE__ */ j(r.div, {
525
- role: "option",
526
- "aria-labelledby": b,
527
- "data-highlighted": _ ? "" : void 0,
528
- "aria-selected": m && _,
529
- "data-state": m ? "checked" : "unchecked",
530
- "aria-disabled": o || void 0,
531
- "data-disabled": o ? "" : void 0,
532
- tabIndex: o ? void 0 : -1,
533
- ...l,
534
- ref: y,
535
- onFocus: c(l.onFocus, () => v(!0)),
536
- onBlur: c(l.onBlur, () => v(!1)),
537
- onClick: c(l.onClick, (e) => {
538
- o || x.current !== "mouse" && S(e);
539
- }),
540
- onPointerUp: c(l.onPointerUp, (e) => {
541
- o || x.current === "mouse" && S(e);
542
- }),
543
- onPointerDown: c(l.onPointerDown, (e) => {
544
- x.current = e.pointerType;
545
- }),
546
- onPointerMove: c(l.onPointerMove, (e) => {
547
- x.current = e.pointerType, o ? f.onItemLeave?.() : x.current === "mouse" && e.currentTarget.focus({ preventScroll: !0 });
548
- }),
549
- onPointerLeave: c(l.onPointerLeave, (e) => {
550
- e.currentTarget === document.activeElement && f.onItemLeave?.();
551
- }),
552
- onKeyDown: c(l.onKeyDown, (e) => {
553
- o || e.target !== e.currentTarget || f.searchRef?.current !== "" && e.key === " " || (ne.includes(e.key) && S(e), e.key === " " && e.preventDefault());
554
- })
555
- })
556
- })
557
- });
558
- }, "SelectItem")), Q = "SelectItemText", je = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, n) {
559
- let { __scopeSelect: i, className: a, style: s, ...c } = e, l = U(Q, i), u = Z(Q, i), d = ke(Q, i), f = G(Q, i), [m, h] = O.useState(null), g = p((e) => u.itemTextRefCallback?.(e, d.value, d.disabled)), _ = t(n, h, d.onItemTextChange, g), v = m?.textContent, y = O.useMemo(() => /* @__PURE__ */ j("option", {
560
- value: d.value,
561
- disabled: d.disabled,
562
- children: v
563
- }, d.value), [
564
- d.disabled,
565
- d.value,
566
- v
567
- ]), { onNativeOptionAdd: b, onNativeOptionRemove: x } = f;
568
- return o(() => (b(y), () => x(y)), [
569
- b,
570
- x,
571
- y
572
- ]), /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(r.span, {
573
- id: d.textId,
574
- ...c,
575
- ref: _
576
- }), d.isSelected && l.valueNode && !l.valueNodeHasChildren && !$(l.value) ? k.createPortal(c.children, l.valueNode) : null] });
577
- }, "SelectItemText")), Me = "SelectItemIndicator", Ne = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
578
- let { __scopeSelect: n, ...i } = e;
579
- return ke(Me, n).isSelected ? /* @__PURE__ */ j(r.span, {
580
- "aria-hidden": !0,
581
- ...i,
582
- ref: t
583
- }) : null;
584
- }, "SelectItemIndicator")), Pe = "SelectScrollUpButton", Fe = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, n) {
585
- let r = Z(Pe, e.__scopeSelect), i = ye(Pe, e.__scopeSelect), [a, s] = O.useState(!1), c = t(n, i.onScrollButtonChange);
586
- return o(() => {
587
- if (r.viewport && r.isPositioned) {
588
- let e = function() {
589
- s(t.scrollTop > 0);
590
- };
591
- P(e, "handleScroll");
592
- let t = r.viewport;
593
- return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
594
- }
595
- }, [r.viewport, r.isPositioned]), a ? /* @__PURE__ */ j(Re, {
596
- ...e,
597
- ref: c,
598
- onAutoScroll: () => {
599
- let { viewport: e, selectedItem: t } = r;
600
- e && t && (e.scrollTop -= t.offsetHeight);
601
- }
602
- }) : null;
603
- }, "SelectScrollUpButton")), Ie = "SelectScrollDownButton", Le = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, n) {
604
- let r = Z(Ie, e.__scopeSelect), i = ye(Ie, e.__scopeSelect), [a, s] = O.useState(!1), c = t(n, i.onScrollButtonChange);
605
- return o(() => {
606
- if (r.viewport && r.isPositioned) {
607
- let e = function() {
608
- let e = t.scrollHeight - t.clientHeight;
609
- s(Math.ceil(t.scrollTop) < e);
610
- };
611
- P(e, "handleScroll");
612
- let t = r.viewport;
613
- return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
614
- }
615
- }, [r.viewport, r.isPositioned]), a ? /* @__PURE__ */ j(Re, {
616
- ...e,
617
- ref: c,
618
- onAutoScroll: () => {
619
- let { viewport: e, selectedItem: t } = r;
620
- e && t && (e.scrollTop += t.offsetHeight);
621
- }
622
- }) : null;
623
- }, "SelectScrollDownButton")), Re = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
624
- let { __scopeSelect: n, onAutoScroll: i, ...a } = e, s = Z("SelectScrollButton", n), l = O.useRef(null), u = R(n), d = O.useCallback(() => {
625
- l.current !== null && (window.clearInterval(l.current), l.current = null);
626
- }, []);
627
- return O.useEffect(() => () => d(), [d]), o(() => {
628
- u().find((e) => e.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
629
- }, [u]), /* @__PURE__ */ j(r.div, {
630
- "aria-hidden": !0,
631
- ...a,
632
- ref: t,
633
- style: {
634
- flexShrink: 0,
635
- ...a.style
636
- },
637
- onPointerDown: c(a.onPointerDown, () => {
638
- l.current === null && (l.current = window.setInterval(i, 50));
639
- }),
640
- onPointerMove: c(a.onPointerMove, () => {
641
- s.onItemLeave?.(), l.current === null && (l.current = window.setInterval(i, 50));
642
- }),
643
- onPointerLeave: c(a.onPointerLeave, () => {
644
- d();
645
- })
646
- });
647
- }, "SelectScrollButtonImpl")), ze = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
648
- let { __scopeSelect: n, ...i } = e;
649
- return /* @__PURE__ */ j(r.div, {
650
- "aria-hidden": !0,
651
- ...i,
652
- ref: t
653
- });
654
- }, "SelectSeparator")), Be = "SelectBubbleInput", Ve = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function({ __scopeSelect: e, ...n }, a) {
655
- let o = U(Be, e), { value: s, onValueChange: c, required: l, disabled: u, name: d, autoComplete: f, form: p, userSelection: m } = o, { nativeOptions: h, nativeSelectKey: g } = o, _ = O.useRef(null), v = t(a, _), y = s ?? "", b = O.useRef(y), x = O.useRef(m), S = O.useRef(!1), C = Array.from(h).some((e) => (e.props.value ?? "") === "");
656
- return O.useEffect(() => {
657
- let e = _.current;
658
- if (!e) return;
659
- let t = window.HTMLSelectElement.prototype, n = Object.getOwnPropertyDescriptor(t, "value").set, r = m !== null && m !== x.current;
660
- x.current = m;
661
- let i = b.current !== y;
662
- b.current = y;
663
- let a = r && i;
664
- if (r && !i && m.value !== y && !m.hasConsumerStoppedPropagation && n) {
665
- S.current = !0;
666
- try {
667
- n.call(e, m.value), e.dispatchEvent(new Event("change", { bubbles: !0 }));
668
- } finally {
669
- S.current = !1, n.call(e, y);
670
- }
671
- return;
672
- }
673
- let o = a && !m.hasConsumerStoppedPropagation;
674
- if (i && n) {
675
- let t = new Event("change", { bubbles: o });
676
- n.call(e, y), e.dispatchEvent(t);
677
- }
678
- }, [y, m]), /* @__PURE__ */ M(r.select, {
679
- "aria-hidden": !0,
680
- required: l,
681
- tabIndex: -1,
682
- name: d,
683
- autoComplete: f,
684
- disabled: u,
685
- form: p,
686
- onChange: (e) => {
687
- S.current || c(e.target.value);
688
- },
689
- ...n,
690
- style: {
691
- ...i,
692
- ...n.style
693
- },
694
- ref: v,
695
- defaultValue: y,
696
- children: [$(s) && !C ? /* @__PURE__ */ j("option", { value: "" }) : null, Array.from(h)]
697
- }, g);
698
- }, "SelectBubbleInput"));
699
- function He(e) {
700
- return typeof e == "function";
701
- }
702
- P(He, "isFunction");
703
- function $(e) {
704
- return e === "" || e === void 0;
705
- }
706
- P($, "shouldShowPlaceholder");
707
- function Ue(e) {
708
- let t = p(e), n = O.useRef(""), r = O.useRef(0), i = O.useCallback((e) => {
709
- let i = n.current + e;
710
- t(i);
711
- function a(e) {
712
- n.current = e, window.clearTimeout(r.current), e !== "" && (r.current = window.setTimeout(() => a(""), 1e3));
713
- }
714
- P(a, "updateSearch"), a(i);
715
- }, [t]), a = O.useCallback(() => {
716
- n.current = "", window.clearTimeout(r.current);
717
- }, []);
718
- return O.useEffect(() => () => window.clearTimeout(r.current), []), [
719
- n,
720
- i,
721
- a
722
- ];
723
- }
724
- P(Ue, "useTypeaheadSearch");
725
- function We(e, t, n) {
726
- 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));
727
- r.length === 1 && (a = a.filter((e) => e !== n));
728
- let o = a.find((e) => e.textValue.toLowerCase().startsWith(r.toLowerCase()));
729
- return o === n ? void 0 : o;
730
- }
731
- P(We, "findNextItem");
732
- function Ge(e, t) {
733
- return e.map((n, r) => e[(t + r) % e.length]);
734
- }
735
- P(Ge, "wrapArray");
736
- //#endregion
737
- //#region src/select.tsx
738
- function Ke({ ...e }) {
739
- return /* @__PURE__ */ j(ie, {
740
- "data-slot": "select",
741
- ...e
742
- });
743
- }
744
- function qe({ className: t, ...n }) {
745
- return /* @__PURE__ */ j(we, {
746
- "data-slot": "select-group",
747
- className: e("scroll-my-1 p-1", t),
748
- ...n
749
- });
750
- }
751
- function Je({ ...e }) {
752
- return /* @__PURE__ */ j(oe, {
753
- "data-slot": "select-value",
754
- ...e
755
- });
756
- }
757
- function Ye({ className: t, size: n = "default", children: r, ...i }) {
758
- return /* @__PURE__ */ M(J, {
759
- "data-slot": "select-trigger",
760
- "data-size": n,
761
- 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),
762
- ...i,
763
- children: [r, /* @__PURE__ */ j(se, {
764
- asChild: !0,
765
- children: /* @__PURE__ */ j(E, { className: "text-muted-foreground pointer-events-none size-4" })
766
- })]
767
- });
768
- }
769
- function Xe({ className: t, children: n, position: r = "item-aligned", align: i = "center", ...a }) {
770
- return /* @__PURE__ */ j(ue, { children: /* @__PURE__ */ M(de, {
771
- "data-slot": "select-content",
772
- "data-align-trigger": r === "item-aligned",
773
- 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),
774
- position: r,
775
- align: i,
776
- ...a,
777
- children: [
778
- /* @__PURE__ */ j(et, {}),
779
- /* @__PURE__ */ j(xe, {
780
- "data-position": r,
781
- 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" && ""),
782
- children: n
783
- }),
784
- /* @__PURE__ */ j(tt, {})
785
- ]
786
- }) });
787
- }
788
- function Ze({ className: t, ...n }) {
789
- return /* @__PURE__ */ j(Ee, {
790
- "data-slot": "select-label",
791
- className: e("text-muted-foreground px-1.5 py-1 text-xs", t),
792
- ...n
793
- });
794
- }
795
- function Qe({ className: t, children: n, ...r }) {
796
- return /* @__PURE__ */ M(Ae, {
797
- "data-slot": "select-item",
798
- 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),
799
- ...r,
800
- children: [/* @__PURE__ */ j("span", {
801
- className: "pointer-events-none absolute end-2 flex size-4 items-center justify-center",
802
- children: /* @__PURE__ */ j(Ne, { children: /* @__PURE__ */ j(T, { className: "pointer-events-none" }) })
803
- }), /* @__PURE__ */ j(je, { children: n })]
804
- });
805
- }
806
- function $e({ className: t, ...n }) {
807
- return /* @__PURE__ */ j(ze, {
808
- "data-slot": "select-separator",
809
- className: e("bg-border pointer-events-none -mx-1 my-1 h-px", t),
810
- ...n
811
- });
812
- }
813
- function et({ className: t, ...n }) {
814
- return /* @__PURE__ */ j(Fe, {
815
- "data-slot": "select-scroll-up-button",
816
- className: e("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", t),
817
- ...n,
818
- children: /* @__PURE__ */ j(D, {})
819
- });
820
- }
821
- function tt({ className: t, ...n }) {
822
- return /* @__PURE__ */ j(Le, {
823
- "data-slot": "select-scroll-down-button",
824
- className: e("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", t),
825
- ...n,
826
- children: /* @__PURE__ */ j(E, {})
827
- });
828
- }
829
- //#endregion
830
- 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 };