@drjoshcsimmons/scl 0.1.15 → 0.2.1

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 (246) hide show
  1. package/LICENSE +1 -1
  2. package/dist/components/ui/accordion/accordion.d.ts +1 -1
  3. package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
  4. package/dist/components/ui/accordion/index.d.ts +1 -1
  5. package/dist/components/ui/accordion/index.d.ts.map +1 -1
  6. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  7. package/dist/components/ui/alert/index.d.ts +1 -1
  8. package/dist/components/ui/alert/index.d.ts.map +1 -1
  9. package/dist/components/ui/alert-dialog/alert-dialog.d.ts +2 -2
  10. package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
  11. package/dist/components/ui/alert-dialog/index.d.ts +1 -1
  12. package/dist/components/ui/alert-dialog/index.d.ts.map +1 -1
  13. package/dist/components/ui/avatar/avatar.d.ts +1 -1
  14. package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
  15. package/dist/components/ui/avatar/index.d.ts +1 -1
  16. package/dist/components/ui/avatar/index.d.ts.map +1 -1
  17. package/dist/components/ui/badge/badge.d.ts +1 -1
  18. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  19. package/dist/components/ui/badge/index.d.ts +1 -1
  20. package/dist/components/ui/badge/index.d.ts.map +1 -1
  21. package/dist/components/ui/button/button.d.ts.map +1 -1
  22. package/dist/components/ui/button/index.d.ts +1 -1
  23. package/dist/components/ui/button/index.d.ts.map +1 -1
  24. package/dist/components/ui/card/card.d.ts.map +1 -1
  25. package/dist/components/ui/card/index.d.ts +1 -1
  26. package/dist/components/ui/card/index.d.ts.map +1 -1
  27. package/dist/components/ui/checkbox/checkbox.d.ts +1 -1
  28. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
  29. package/dist/components/ui/checkbox/index.d.ts.map +1 -1
  30. package/dist/components/ui/collapsible/collapsible.d.ts.map +1 -1
  31. package/dist/components/ui/collapsible/index.d.ts +1 -1
  32. package/dist/components/ui/collapsible/index.d.ts.map +1 -1
  33. package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
  34. package/dist/components/ui/combobox/index.d.ts +1 -1
  35. package/dist/components/ui/combobox/index.d.ts.map +1 -1
  36. package/dist/components/ui/command/command.d.ts.map +1 -1
  37. package/dist/components/ui/command/index.d.ts +1 -1
  38. package/dist/components/ui/command/index.d.ts.map +1 -1
  39. package/dist/components/ui/dialog/dialog.d.ts +1 -1
  40. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  41. package/dist/components/ui/dialog/index.d.ts +1 -1
  42. package/dist/components/ui/dialog/index.d.ts.map +1 -1
  43. package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
  44. package/dist/components/ui/dithered-image/index.d.ts +1 -1
  45. package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
  46. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +1 -1
  47. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  48. package/dist/components/ui/dropdown-menu/index.d.ts +1 -1
  49. package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -1
  50. package/dist/components/ui/form/form.d.ts +1 -1
  51. package/dist/components/ui/form/form.d.ts.map +1 -1
  52. package/dist/components/ui/form/index.d.ts +1 -1
  53. package/dist/components/ui/form/index.d.ts.map +1 -1
  54. package/dist/components/ui/input/index.d.ts.map +1 -1
  55. package/dist/components/ui/input/input.d.ts.map +1 -1
  56. package/dist/components/ui/label/index.d.ts.map +1 -1
  57. package/dist/components/ui/label/label.d.ts +1 -1
  58. package/dist/components/ui/label/label.d.ts.map +1 -1
  59. package/dist/components/ui/popover/index.d.ts +1 -1
  60. package/dist/components/ui/popover/index.d.ts.map +1 -1
  61. package/dist/components/ui/popover/popover.d.ts +1 -1
  62. package/dist/components/ui/popover/popover.d.ts.map +1 -1
  63. package/dist/components/ui/progress/index.d.ts.map +1 -1
  64. package/dist/components/ui/progress/progress.d.ts +1 -1
  65. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  66. package/dist/components/ui/radio-group/index.d.ts.map +1 -1
  67. package/dist/components/ui/radio-group/radio-group.d.ts +1 -1
  68. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
  69. package/dist/components/ui/scroll-area/index.d.ts.map +1 -1
  70. package/dist/components/ui/scroll-area/scroll-area.d.ts +1 -1
  71. package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
  72. package/dist/components/ui/select/index.d.ts +1 -1
  73. package/dist/components/ui/select/index.d.ts.map +1 -1
  74. package/dist/components/ui/select/select.d.ts +1 -1
  75. package/dist/components/ui/select/select.d.ts.map +1 -1
  76. package/dist/components/ui/separator/index.d.ts.map +1 -1
  77. package/dist/components/ui/separator/separator.d.ts +1 -1
  78. package/dist/components/ui/separator/separator.d.ts.map +1 -1
  79. package/dist/components/ui/sheet/index.d.ts +1 -1
  80. package/dist/components/ui/sheet/index.d.ts.map +1 -1
  81. package/dist/components/ui/sheet/sheet.d.ts +2 -2
  82. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  83. package/dist/components/ui/skeleton/index.d.ts.map +1 -1
  84. package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
  85. package/dist/components/ui/slider/index.d.ts.map +1 -1
  86. package/dist/components/ui/slider/slider.d.ts +1 -1
  87. package/dist/components/ui/slider/slider.d.ts.map +1 -1
  88. package/dist/components/ui/statusline/index.d.ts.map +1 -1
  89. package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
  90. package/dist/components/ui/switch/index.d.ts.map +1 -1
  91. package/dist/components/ui/switch/switch.d.ts +1 -1
  92. package/dist/components/ui/switch/switch.d.ts.map +1 -1
  93. package/dist/components/ui/table/index.d.ts +1 -1
  94. package/dist/components/ui/table/index.d.ts.map +1 -1
  95. package/dist/components/ui/table/table.d.ts +1 -1
  96. package/dist/components/ui/table/table.d.ts.map +1 -1
  97. package/dist/components/ui/tabs/index.d.ts +1 -1
  98. package/dist/components/ui/tabs/index.d.ts.map +1 -1
  99. package/dist/components/ui/tabs/tabs.d.ts +1 -1
  100. package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
  101. package/dist/components/ui/terminal-textarea/index.d.ts.map +1 -1
  102. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
  103. package/dist/components/ui/textarea/index.d.ts.map +1 -1
  104. package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
  105. package/dist/components/ui/toggle/index.d.ts.map +1 -1
  106. package/dist/components/ui/toggle/toggle.d.ts +1 -1
  107. package/dist/components/ui/toggle/toggle.d.ts.map +1 -1
  108. package/dist/components/ui/tooltip/index.d.ts +1 -1
  109. package/dist/components/ui/tooltip/index.d.ts.map +1 -1
  110. package/dist/components/ui/tooltip/tooltip.d.ts +1 -1
  111. package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +12 -12
  114. package/dist/index10.js +42 -44
  115. package/dist/index100.js +4 -25
  116. package/dist/index101.js +30 -9
  117. package/dist/index102.js +10 -178
  118. package/dist/index103.js +646 -44
  119. package/dist/index104.js +1 -1
  120. package/dist/index105.js +3 -54
  121. package/dist/index106.js +47 -29
  122. package/dist/index107.js +30 -30
  123. package/dist/index108.js +50 -645
  124. package/dist/index109.js +29 -47
  125. package/dist/index11.js +5 -11
  126. package/dist/index110.js +47 -29
  127. package/dist/index113.js +48 -6
  128. package/dist/index115.js +11 -47
  129. package/dist/index116.js +204 -10
  130. package/dist/index117.js +20 -204
  131. package/dist/index118.js +399 -21
  132. package/dist/index119.js +6 -400
  133. package/dist/index12.js +2 -2
  134. package/dist/index120.js +48 -21
  135. package/dist/index121.js +15 -3
  136. package/dist/index122.js +3 -32
  137. package/dist/index123.js +32 -12
  138. package/dist/index124.js +18 -48
  139. package/dist/index125.js +25 -2
  140. package/dist/index126.js +29 -53
  141. package/dist/index127.js +5 -65
  142. package/dist/index128.js +2 -25
  143. package/dist/index129.js +53 -29
  144. package/dist/index13.js +2 -2
  145. package/dist/index130.js +65 -5
  146. package/dist/index136.js +1 -1
  147. package/dist/index137.js +1 -1
  148. package/dist/index14.js +5 -14
  149. package/dist/index141.js +1 -1
  150. package/dist/index142.js +1 -1
  151. package/dist/index143.js +1 -1
  152. package/dist/index148.js +21 -11
  153. package/dist/index149.js +11 -26
  154. package/dist/index15.js +15 -39
  155. package/dist/index150.js +27 -4
  156. package/dist/index151.js +4 -22
  157. package/dist/index16.js +3 -30
  158. package/dist/index17.js +24 -28
  159. package/dist/index18.js +11 -13
  160. package/dist/index20.js +5 -12
  161. package/dist/index21.js +3 -3
  162. package/dist/index22.js +10 -13
  163. package/dist/index23.js +7 -14
  164. package/dist/index24.js +8 -8
  165. package/dist/index25.js +23 -29
  166. package/dist/index26.js +15 -17
  167. package/dist/index27.js +50 -44
  168. package/dist/index28.js +2 -10
  169. package/dist/index29.js +6 -9
  170. package/dist/index3.js +18 -18
  171. package/dist/index30.js +27 -60
  172. package/dist/index31.js +4 -4
  173. package/dist/index32.js +16 -39
  174. package/dist/index33.js +7 -7
  175. package/dist/index34.js +1 -4
  176. package/dist/index36.js +5 -5
  177. package/dist/index37.js +7 -4
  178. package/dist/index38.js +99 -38
  179. package/dist/index39.js +37 -64
  180. package/dist/index4.js +6 -13
  181. package/dist/index40.js +10 -48
  182. package/dist/index41.js +48 -99
  183. package/dist/index42.js +65 -10
  184. package/dist/index45.js +4 -4
  185. package/dist/index46.js +1 -1
  186. package/dist/index48.js +228 -60
  187. package/dist/index49.js +15 -238
  188. package/dist/index5.js +13 -26
  189. package/dist/index50.js +109 -419
  190. package/dist/index51.js +30 -124
  191. package/dist/index52.js +61 -237
  192. package/dist/index53.js +236 -9
  193. package/dist/index54.js +11 -118
  194. package/dist/index55.js +58 -128
  195. package/dist/index56.js +249 -231
  196. package/dist/index57.js +225 -11
  197. package/dist/index58.js +9 -60
  198. package/dist/index59.js +11 -254
  199. package/dist/index6.js +44 -14
  200. package/dist/index60.js +115 -245
  201. package/dist/index61.js +22 -12
  202. package/dist/index62.js +811 -481
  203. package/dist/index63.js +9 -18
  204. package/dist/index64.js +67 -146
  205. package/dist/index65.js +249 -71
  206. package/dist/index66.js +12 -22
  207. package/dist/index67.js +212 -823
  208. package/dist/index68.js +118 -9
  209. package/dist/index69.js +511 -206
  210. package/dist/index7.js +5 -5
  211. package/dist/index70.js +5 -4
  212. package/dist/index71.js +407 -308
  213. package/dist/index72.js +318 -292
  214. package/dist/index73.js +310 -12
  215. package/dist/index74.js +12 -31
  216. package/dist/index75.js +161 -12
  217. package/dist/index77.js +1 -1
  218. package/dist/index80.js +1 -1
  219. package/dist/index81.js +1 -1
  220. package/dist/index82.js +1 -1
  221. package/dist/index84.js +118 -48
  222. package/dist/index85.js +12 -8
  223. package/dist/index86.js +135 -4
  224. package/dist/index87.js +219 -30
  225. package/dist/index88.js +14 -13
  226. package/dist/index89.js +64 -120
  227. package/dist/index9.js +6 -13
  228. package/dist/index90.js +46 -13
  229. package/dist/index91.js +48 -133
  230. package/dist/index92.js +8 -218
  231. package/dist/index93.js +30 -14
  232. package/dist/index94.js +8 -68
  233. package/dist/index95.js +176 -43
  234. package/dist/index96.js +25 -50
  235. package/dist/index97.js +6 -9
  236. package/dist/index98.js +54 -3
  237. package/dist/index99.js +10 -5
  238. package/dist/lib/utils.d.ts.map +1 -1
  239. package/dist/tokens/animations.d.ts.map +1 -1
  240. package/dist/tokens/colors.d.ts.map +1 -1
  241. package/dist/tokens/index.d.ts +3 -3
  242. package/dist/tokens/index.d.ts.map +1 -1
  243. package/dist/tokens/shadows.d.ts.map +1 -1
  244. package/dist/tokens/spacing.d.ts.map +1 -1
  245. package/dist/tokens/typography.d.ts.map +1 -1
  246. package/package.json +19 -9
package/dist/index62.js CHANGED
@@ -1,532 +1,862 @@
1
- import * as c from "react";
2
- import { Primitive as L } from "./index81.js";
3
- import { Presence as I } from "./index94.js";
4
- import { createContextScope as te } from "./index76.js";
5
- import { useComposedRefs as A } from "./index78.js";
6
- import { useCallbackRef as C } from "./index85.js";
7
- import { useDirection as ne } from "./index83.js";
8
- import { useLayoutEffect as le } from "./index86.js";
9
- import { clamp as ce } from "./index98.js";
10
- import { composeEventHandlers as R } from "./index79.js";
11
- import { jsx as b, jsxs as ie, Fragment as se } from "react/jsx-runtime";
12
- function ae(e, t) {
13
- return c.useReducer((r, l) => t[r][l] ?? r, e);
14
- }
15
- var V = "ScrollArea", [j] = te(V), [de, v] = j(V), q = c.forwardRef(
16
- (e, t) => {
1
+ import * as t from "react";
2
+ import * as be from "react-dom";
3
+ import { clamp as Re } from "./index105.js";
4
+ import { composeEventHandlers as E } from "./index79.js";
5
+ import { createCollection as st } from "./index77.js";
6
+ import { useComposedRefs as B } from "./index78.js";
7
+ import { createContextScope as lt } from "./index76.js";
8
+ import { useDirection as ct } from "./index83.js";
9
+ import { DismissableLayer as it } from "./index84.js";
10
+ import { useFocusGuards as at } from "./index85.js";
11
+ import { FocusScope as dt } from "./index86.js";
12
+ import { useId as Ie } from "./index82.js";
13
+ import { createPopperScope as _e, Root as ut, Anchor as pt, Content as ft, Arrow as mt } from "./index87.js";
14
+ import { Portal as ht } from "./index88.js";
15
+ import { Primitive as M } from "./index81.js";
16
+ import { createSlot as vt } from "./index106.js";
17
+ import { useCallbackRef as gt } from "./index99.js";
18
+ import { useControllableState as Ee } from "./index80.js";
19
+ import { useLayoutEffect as Y } from "./index100.js";
20
+ import { usePrevious as St } from "./index97.js";
21
+ import { VISUALLY_HIDDEN_STYLES as wt } from "./index107.js";
22
+ import { hideOthers as Ct } from "./index91.js";
23
+ import yt from "./index92.js";
24
+ import { jsx as m, jsxs as ce, Fragment as Te } from "react/jsx-runtime";
25
+ var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], J = "Select", [ae, de, Tt] = st(J), [te] = lt(J, [
26
+ Tt,
27
+ _e
28
+ ]), ue = _e(), [Pt, j] = te(J), [Rt, Et] = te(J), Ne = (n) => {
29
+ const {
30
+ __scopeSelect: c,
31
+ children: e,
32
+ open: i,
33
+ defaultOpen: l,
34
+ onOpenChange: u,
35
+ value: r,
36
+ defaultValue: s,
37
+ onValueChange: o,
38
+ dir: p,
39
+ name: g,
40
+ autoComplete: C,
41
+ disabled: P,
42
+ required: R,
43
+ form: T
44
+ } = n, a = ue(c), [v, y] = t.useState(null), [d, h] = t.useState(null), [A, O] = t.useState(!1), oe = ct(p), [b, L] = Ee({
45
+ prop: i,
46
+ defaultProp: l ?? !1,
47
+ onChange: u,
48
+ caller: J
49
+ }), [K, X] = Ee({
50
+ prop: r,
51
+ defaultProp: s,
52
+ onChange: o,
53
+ caller: J
54
+ }), V = t.useRef(null), H = v ? T || !!v.closest("form") : !0, [G, U] = t.useState(/* @__PURE__ */ new Set()), W = Array.from(G).map((_) => _.props.value).join(";");
55
+ return /* @__PURE__ */ m(ut, { ...a, children: /* @__PURE__ */ ce(
56
+ Pt,
57
+ {
58
+ required: R,
59
+ scope: c,
60
+ trigger: v,
61
+ onTriggerChange: y,
62
+ valueNode: d,
63
+ onValueNodeChange: h,
64
+ valueNodeHasChildren: A,
65
+ onValueNodeHasChildrenChange: O,
66
+ contentId: Ie(),
67
+ value: K,
68
+ onValueChange: X,
69
+ open: b,
70
+ onOpenChange: L,
71
+ dir: oe,
72
+ triggerPointerDownPosRef: V,
73
+ disabled: P,
74
+ children: [
75
+ /* @__PURE__ */ m(ae.Provider, { scope: c, children: /* @__PURE__ */ m(
76
+ Rt,
77
+ {
78
+ scope: n.__scopeSelect,
79
+ onNativeOptionAdd: t.useCallback((_) => {
80
+ U((k) => new Set(k).add(_));
81
+ }, []),
82
+ onNativeOptionRemove: t.useCallback((_) => {
83
+ U((k) => {
84
+ const F = new Set(k);
85
+ return F.delete(_), F;
86
+ });
87
+ }, []),
88
+ children: e
89
+ }
90
+ ) }),
91
+ H ? /* @__PURE__ */ ce(
92
+ tt,
93
+ {
94
+ "aria-hidden": !0,
95
+ required: R,
96
+ tabIndex: -1,
97
+ name: g,
98
+ autoComplete: C,
99
+ value: K,
100
+ onChange: (_) => X(_.target.value),
101
+ disabled: P,
102
+ form: T,
103
+ children: [
104
+ K === void 0 ? /* @__PURE__ */ m("option", { value: "" }) : null,
105
+ Array.from(G)
106
+ ]
107
+ },
108
+ W
109
+ ) : null
110
+ ]
111
+ }
112
+ ) });
113
+ };
114
+ Ne.displayName = J;
115
+ var Me = "SelectTrigger", Ae = t.forwardRef(
116
+ (n, c) => {
117
+ const { __scopeSelect: e, disabled: i = !1, ...l } = n, u = ue(e), r = j(Me, e), s = r.disabled || i, o = B(c, r.onTriggerChange), p = de(e), g = t.useRef("touch"), [C, P, R] = nt((a) => {
118
+ const v = p().filter((h) => !h.disabled), y = v.find((h) => h.value === r.value), d = rt(v, a, y);
119
+ d !== void 0 && r.onValueChange(d.value);
120
+ }), T = (a) => {
121
+ s || (r.onOpenChange(!0), R()), a && (r.triggerPointerDownPosRef.current = {
122
+ x: Math.round(a.pageX),
123
+ y: Math.round(a.pageY)
124
+ });
125
+ };
126
+ return /* @__PURE__ */ m(pt, { asChild: !0, ...u, children: /* @__PURE__ */ m(
127
+ M.button,
128
+ {
129
+ type: "button",
130
+ role: "combobox",
131
+ "aria-controls": r.contentId,
132
+ "aria-expanded": r.open,
133
+ "aria-required": r.required,
134
+ "aria-autocomplete": "none",
135
+ dir: r.dir,
136
+ "data-state": r.open ? "open" : "closed",
137
+ disabled: s,
138
+ "data-disabled": s ? "" : void 0,
139
+ "data-placeholder": ot(r.value) ? "" : void 0,
140
+ ...l,
141
+ ref: o,
142
+ onClick: E(l.onClick, (a) => {
143
+ a.currentTarget.focus(), g.current !== "mouse" && T(a);
144
+ }),
145
+ onPointerDown: E(l.onPointerDown, (a) => {
146
+ g.current = a.pointerType;
147
+ const v = a.target;
148
+ v.hasPointerCapture(a.pointerId) && v.releasePointerCapture(a.pointerId), a.button === 0 && a.ctrlKey === !1 && a.pointerType === "mouse" && (T(a), a.preventDefault());
149
+ }),
150
+ onKeyDown: E(l.onKeyDown, (a) => {
151
+ const v = C.current !== "";
152
+ !(a.ctrlKey || a.altKey || a.metaKey) && a.key.length === 1 && P(a.key), !(v && a.key === " ") && xt.includes(a.key) && (T(), a.preventDefault());
153
+ })
154
+ }
155
+ ) });
156
+ }
157
+ );
158
+ Ae.displayName = Me;
159
+ var Oe = "SelectValue", De = t.forwardRef(
160
+ (n, c) => {
161
+ const { __scopeSelect: e, className: i, style: l, children: u, placeholder: r = "", ...s } = n, o = j(Oe, e), { onValueNodeHasChildrenChange: p } = o, g = u !== void 0, C = B(c, o.onValueNodeChange);
162
+ return Y(() => {
163
+ p(g);
164
+ }, [p, g]), /* @__PURE__ */ m(
165
+ M.span,
166
+ {
167
+ ...s,
168
+ ref: C,
169
+ style: { pointerEvents: "none" },
170
+ children: ot(o.value) ? /* @__PURE__ */ m(Te, { children: r }) : u
171
+ }
172
+ );
173
+ }
174
+ );
175
+ De.displayName = Oe;
176
+ var bt = "SelectIcon", Le = t.forwardRef(
177
+ (n, c) => {
178
+ const { __scopeSelect: e, children: i, ...l } = n;
179
+ return /* @__PURE__ */ m(M.span, { "aria-hidden": !0, ...l, ref: c, children: i || "▼" });
180
+ }
181
+ );
182
+ Le.displayName = bt;
183
+ var _t = "SelectPortal", ke = (n) => /* @__PURE__ */ m(ht, { asChild: !0, ...n });
184
+ ke.displayName = _t;
185
+ var Q = "SelectContent", Be = t.forwardRef(
186
+ (n, c) => {
187
+ const e = j(Q, n.__scopeSelect), [i, l] = t.useState();
188
+ if (Y(() => {
189
+ l(new DocumentFragment());
190
+ }, []), !e.open) {
191
+ const u = i;
192
+ return u ? be.createPortal(
193
+ /* @__PURE__ */ m(Ve, { scope: n.__scopeSelect, children: /* @__PURE__ */ m(ae.Slot, { scope: n.__scopeSelect, children: /* @__PURE__ */ m("div", { children: n.children }) }) }),
194
+ u
195
+ ) : null;
196
+ }
197
+ return /* @__PURE__ */ m(He, { ...n, ref: c });
198
+ }
199
+ );
200
+ Be.displayName = Q;
201
+ var D = 10, [Ve, q] = te(Q), Nt = "SelectContentImpl", Mt = vt("SelectContent.RemoveScroll"), He = t.forwardRef(
202
+ (n, c) => {
17
203
  const {
18
- __scopeScrollArea: r,
19
- type: l = "hover",
20
- dir: o,
21
- scrollHideDelay: n = 600,
22
- ...i
23
- } = e, [s, a] = c.useState(null), [f, d] = c.useState(null), [h, u] = c.useState(null), [S, p] = c.useState(null), [y, M] = c.useState(null), [P, _] = c.useState(0), [U, D] = c.useState(0), [W, x] = c.useState(!1), [H, z] = c.useState(!1), m = A(t, (E) => a(E)), w = ne(o);
24
- return /* @__PURE__ */ b(
25
- de,
204
+ __scopeSelect: e,
205
+ position: i = "item-aligned",
206
+ onCloseAutoFocus: l,
207
+ onEscapeKeyDown: u,
208
+ onPointerDownOutside: r,
209
+ //
210
+ // PopperContent props
211
+ side: s,
212
+ sideOffset: o,
213
+ align: p,
214
+ alignOffset: g,
215
+ arrowPadding: C,
216
+ collisionBoundary: P,
217
+ collisionPadding: R,
218
+ sticky: T,
219
+ hideWhenDetached: a,
220
+ avoidCollisions: v,
221
+ //
222
+ ...y
223
+ } = n, d = j(Q, e), [h, A] = t.useState(null), [O, oe] = t.useState(null), b = B(c, (f) => A(f)), [L, K] = t.useState(null), [X, V] = t.useState(
224
+ null
225
+ ), H = de(e), [G, U] = t.useState(!1), W = t.useRef(!1);
226
+ t.useEffect(() => {
227
+ if (h) return Ct(h);
228
+ }, [h]), at();
229
+ const _ = t.useCallback(
230
+ (f) => {
231
+ const [I, ...N] = H().map((w) => w.ref.current), [x] = N.slice(-1), S = document.activeElement;
232
+ for (const w of f)
233
+ if (w === S || (w == null || w.scrollIntoView({ block: "nearest" }), w === I && O && (O.scrollTop = 0), w === x && O && (O.scrollTop = O.scrollHeight), w == null || w.focus(), document.activeElement !== S)) return;
234
+ },
235
+ [H, O]
236
+ ), k = t.useCallback(
237
+ () => _([L, h]),
238
+ [_, L, h]
239
+ );
240
+ t.useEffect(() => {
241
+ G && k();
242
+ }, [G, k]);
243
+ const { onOpenChange: F, triggerPointerDownPosRef: z } = d;
244
+ t.useEffect(() => {
245
+ if (h) {
246
+ let f = { x: 0, y: 0 };
247
+ const I = (x) => {
248
+ var S, w;
249
+ f = {
250
+ x: Math.abs(Math.round(x.pageX) - (((S = z.current) == null ? void 0 : S.x) ?? 0)),
251
+ y: Math.abs(Math.round(x.pageY) - (((w = z.current) == null ? void 0 : w.y) ?? 0))
252
+ };
253
+ }, N = (x) => {
254
+ f.x <= 10 && f.y <= 10 ? x.preventDefault() : h.contains(x.target) || F(!1), document.removeEventListener("pointermove", I), z.current = null;
255
+ };
256
+ return z.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", N, { capture: !0, once: !0 })), () => {
257
+ document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", N, { capture: !0 });
258
+ };
259
+ }
260
+ }, [h, F, z]), t.useEffect(() => {
261
+ const f = () => F(!1);
262
+ return window.addEventListener("blur", f), window.addEventListener("resize", f), () => {
263
+ window.removeEventListener("blur", f), window.removeEventListener("resize", f);
264
+ };
265
+ }, [F]);
266
+ const [pe, se] = nt((f) => {
267
+ const I = H().filter((S) => !S.disabled), N = I.find((S) => S.ref.current === document.activeElement), x = rt(I, f, N);
268
+ x && setTimeout(() => x.ref.current.focus());
269
+ }), fe = t.useCallback(
270
+ (f, I, N) => {
271
+ const x = !W.current && !N;
272
+ (d.value !== void 0 && d.value === I || x) && (K(f), x && (W.current = !0));
273
+ },
274
+ [d.value]
275
+ ), me = t.useCallback(() => h == null ? void 0 : h.focus(), [h]), ee = t.useCallback(
276
+ (f, I, N) => {
277
+ const x = !W.current && !N;
278
+ (d.value !== void 0 && d.value === I || x) && V(f);
279
+ },
280
+ [d.value]
281
+ ), le = i === "popper" ? Se : Ue, ne = le === Se ? {
282
+ side: s,
283
+ sideOffset: o,
284
+ align: p,
285
+ alignOffset: g,
286
+ arrowPadding: C,
287
+ collisionBoundary: P,
288
+ collisionPadding: R,
289
+ sticky: T,
290
+ hideWhenDetached: a,
291
+ avoidCollisions: v
292
+ } : {};
293
+ return /* @__PURE__ */ m(
294
+ Ve,
26
295
  {
27
- scope: r,
28
- type: l,
29
- dir: w,
30
- scrollHideDelay: n,
31
- scrollArea: s,
32
- viewport: f,
33
- onViewportChange: d,
296
+ scope: e,
34
297
  content: h,
35
- onContentChange: u,
36
- scrollbarX: S,
37
- onScrollbarXChange: p,
38
- scrollbarXEnabled: W,
39
- onScrollbarXEnabledChange: x,
40
- scrollbarY: y,
41
- onScrollbarYChange: M,
42
- scrollbarYEnabled: H,
43
- onScrollbarYEnabledChange: z,
44
- onCornerWidthChange: _,
45
- onCornerHeightChange: D,
46
- children: /* @__PURE__ */ b(
47
- L.div,
298
+ viewport: O,
299
+ onViewportChange: oe,
300
+ itemRefCallback: fe,
301
+ selectedItem: L,
302
+ onItemLeave: me,
303
+ itemTextRefCallback: ee,
304
+ focusSelectedItem: k,
305
+ selectedItemText: X,
306
+ position: i,
307
+ isPositioned: G,
308
+ searchRef: pe,
309
+ children: /* @__PURE__ */ m(yt, { as: Mt, allowPinchZoom: !0, children: /* @__PURE__ */ m(
310
+ dt,
48
311
  {
49
- dir: w,
50
- ...i,
51
- ref: m,
52
- style: {
53
- position: "relative",
54
- // Pass corner sizes as CSS vars to reduce re-renders of context consumers
55
- "--radix-scroll-area-corner-width": P + "px",
56
- "--radix-scroll-area-corner-height": U + "px",
57
- ...e.style
58
- }
312
+ asChild: !0,
313
+ trapped: d.open,
314
+ onMountAutoFocus: (f) => {
315
+ f.preventDefault();
316
+ },
317
+ onUnmountAutoFocus: E(l, (f) => {
318
+ var I;
319
+ (I = d.trigger) == null || I.focus({ preventScroll: !0 }), f.preventDefault();
320
+ }),
321
+ children: /* @__PURE__ */ m(
322
+ it,
323
+ {
324
+ asChild: !0,
325
+ disableOutsidePointerEvents: !0,
326
+ onEscapeKeyDown: u,
327
+ onPointerDownOutside: r,
328
+ onFocusOutside: (f) => f.preventDefault(),
329
+ onDismiss: () => d.onOpenChange(!1),
330
+ children: /* @__PURE__ */ m(
331
+ le,
332
+ {
333
+ role: "listbox",
334
+ id: d.contentId,
335
+ "data-state": d.open ? "open" : "closed",
336
+ dir: d.dir,
337
+ onContextMenu: (f) => f.preventDefault(),
338
+ ...y,
339
+ ...ne,
340
+ onPlaced: () => U(!0),
341
+ ref: b,
342
+ style: {
343
+ // flex layout so we can place the scroll buttons properly
344
+ display: "flex",
345
+ flexDirection: "column",
346
+ // reset the outline by default as the content MAY get focused
347
+ outline: "none",
348
+ ...y.style
349
+ },
350
+ onKeyDown: E(y.onKeyDown, (f) => {
351
+ const I = f.ctrlKey || f.altKey || f.metaKey;
352
+ if (f.key === "Tab" && f.preventDefault(), !I && f.key.length === 1 && se(f.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(f.key)) {
353
+ let x = H().filter((S) => !S.disabled).map((S) => S.ref.current);
354
+ if (["ArrowUp", "End"].includes(f.key) && (x = x.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(f.key)) {
355
+ const S = f.target, w = x.indexOf(S);
356
+ x = x.slice(w + 1);
357
+ }
358
+ setTimeout(() => _(x)), f.preventDefault();
359
+ }
360
+ })
361
+ }
362
+ )
363
+ }
364
+ )
59
365
  }
60
- )
366
+ ) })
61
367
  }
62
368
  );
63
369
  }
64
370
  );
65
- q.displayName = V;
66
- var $ = "ScrollAreaViewport", G = c.forwardRef(
67
- (e, t) => {
68
- const { __scopeScrollArea: r, children: l, nonce: o, ...n } = e, i = v($, r), s = c.useRef(null), a = A(t, s, i.onViewportChange);
69
- return /* @__PURE__ */ ie(se, { children: [
70
- /* @__PURE__ */ b(
371
+ He.displayName = Nt;
372
+ var At = "SelectItemAlignedPosition", Ue = t.forwardRef((n, c) => {
373
+ const { __scopeSelect: e, onPlaced: i, ...l } = n, u = j(Q, e), r = q(Q, e), [s, o] = t.useState(null), [p, g] = t.useState(null), C = B(c, (b) => g(b)), P = de(e), R = t.useRef(!1), T = t.useRef(!0), { viewport: a, selectedItem: v, selectedItemText: y, focusSelectedItem: d } = r, h = t.useCallback(() => {
374
+ if (u.trigger && u.valueNode && s && p && a && v && y) {
375
+ const b = u.trigger.getBoundingClientRect(), L = p.getBoundingClientRect(), K = u.valueNode.getBoundingClientRect(), X = y.getBoundingClientRect();
376
+ if (u.dir !== "rtl") {
377
+ const S = X.left - L.left, w = K.left - S, Z = b.left - w, $ = b.width + Z, he = Math.max($, L.width), ve = window.innerWidth - D, ge = Re(w, [
378
+ D,
379
+ // Prevents the content from going off the starting edge of the
380
+ // viewport. It may still go off the ending edge, but this can be
381
+ // controlled by the user since they may want to manage overflow in a
382
+ // specific way.
383
+ // https://github.com/radix-ui/primitives/issues/2049
384
+ Math.max(D, ve - he)
385
+ ]);
386
+ s.style.minWidth = $ + "px", s.style.left = ge + "px";
387
+ } else {
388
+ const S = L.right - X.right, w = window.innerWidth - K.right - S, Z = window.innerWidth - b.right - w, $ = b.width + Z, he = Math.max($, L.width), ve = window.innerWidth - D, ge = Re(w, [
389
+ D,
390
+ Math.max(D, ve - he)
391
+ ]);
392
+ s.style.minWidth = $ + "px", s.style.right = ge + "px";
393
+ }
394
+ const V = P(), H = window.innerHeight - D * 2, G = a.scrollHeight, U = window.getComputedStyle(p), W = parseInt(U.borderTopWidth, 10), _ = parseInt(U.paddingTop, 10), k = parseInt(U.borderBottomWidth, 10), F = parseInt(U.paddingBottom, 10), z = W + _ + G + F + k, pe = Math.min(v.offsetHeight * 5, z), se = window.getComputedStyle(a), fe = parseInt(se.paddingTop, 10), me = parseInt(se.paddingBottom, 10), ee = b.top + b.height / 2 - D, le = H - ee, ne = v.offsetHeight / 2, f = v.offsetTop + ne, I = W + _ + f, N = z - I;
395
+ if (I <= ee) {
396
+ const S = V.length > 0 && v === V[V.length - 1].ref.current;
397
+ s.style.bottom = "0px";
398
+ const w = p.clientHeight - a.offsetTop - a.offsetHeight, Z = Math.max(
399
+ le,
400
+ ne + // viewport might have padding bottom, include it to avoid a scrollable viewport
401
+ (S ? me : 0) + w + k
402
+ ), $ = I + Z;
403
+ s.style.height = $ + "px";
404
+ } else {
405
+ const S = V.length > 0 && v === V[0].ref.current;
406
+ s.style.top = "0px";
407
+ const Z = Math.max(
408
+ ee,
409
+ W + a.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
410
+ (S ? fe : 0) + ne
411
+ ) + N;
412
+ s.style.height = Z + "px", a.scrollTop = I - ee + a.offsetTop;
413
+ }
414
+ s.style.margin = `${D}px 0`, s.style.minHeight = pe + "px", s.style.maxHeight = H + "px", i == null || i(), requestAnimationFrame(() => R.current = !0);
415
+ }
416
+ }, [
417
+ P,
418
+ u.trigger,
419
+ u.valueNode,
420
+ s,
421
+ p,
422
+ a,
423
+ v,
424
+ y,
425
+ u.dir,
426
+ i
427
+ ]);
428
+ Y(() => h(), [h]);
429
+ const [A, O] = t.useState();
430
+ Y(() => {
431
+ p && O(window.getComputedStyle(p).zIndex);
432
+ }, [p]);
433
+ const oe = t.useCallback(
434
+ (b) => {
435
+ b && T.current === !0 && (h(), d == null || d(), T.current = !1);
436
+ },
437
+ [h, d]
438
+ );
439
+ return /* @__PURE__ */ m(
440
+ Dt,
441
+ {
442
+ scope: e,
443
+ contentWrapper: s,
444
+ shouldExpandOnScrollRef: R,
445
+ onScrollButtonChange: oe,
446
+ children: /* @__PURE__ */ m(
447
+ "div",
448
+ {
449
+ ref: o,
450
+ style: {
451
+ display: "flex",
452
+ flexDirection: "column",
453
+ position: "fixed",
454
+ zIndex: A
455
+ },
456
+ children: /* @__PURE__ */ m(
457
+ M.div,
458
+ {
459
+ ...l,
460
+ ref: C,
461
+ style: {
462
+ // When we get the height of the content, it includes borders. If we were to set
463
+ // the height without having `boxSizing: 'border-box'` it would be too big.
464
+ boxSizing: "border-box",
465
+ // We need to ensure the content doesn't get taller than the wrapper
466
+ maxHeight: "100%",
467
+ ...l.style
468
+ }
469
+ }
470
+ )
471
+ }
472
+ )
473
+ }
474
+ );
475
+ });
476
+ Ue.displayName = At;
477
+ var Ot = "SelectPopperPosition", Se = t.forwardRef((n, c) => {
478
+ const {
479
+ __scopeSelect: e,
480
+ align: i = "start",
481
+ collisionPadding: l = D,
482
+ ...u
483
+ } = n, r = ue(e);
484
+ return /* @__PURE__ */ m(
485
+ ft,
486
+ {
487
+ ...r,
488
+ ...u,
489
+ ref: c,
490
+ align: i,
491
+ collisionPadding: l,
492
+ style: {
493
+ // Ensure border-box for floating-ui calculations
494
+ boxSizing: "border-box",
495
+ ...u.style,
496
+ "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
497
+ "--radix-select-content-available-width": "var(--radix-popper-available-width)",
498
+ "--radix-select-content-available-height": "var(--radix-popper-available-height)",
499
+ "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
500
+ "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
501
+ }
502
+ }
503
+ );
504
+ });
505
+ Se.displayName = Ot;
506
+ var [Dt, Pe] = te(Q, {}), we = "SelectViewport", We = t.forwardRef(
507
+ (n, c) => {
508
+ const { __scopeSelect: e, nonce: i, ...l } = n, u = q(we, e), r = Pe(we, e), s = B(c, u.onViewportChange), o = t.useRef(0);
509
+ return /* @__PURE__ */ ce(Te, { children: [
510
+ /* @__PURE__ */ m(
71
511
  "style",
72
512
  {
73
513
  dangerouslySetInnerHTML: {
74
- __html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"
514
+ __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
75
515
  },
76
- nonce: o
516
+ nonce: i
77
517
  }
78
518
  ),
79
- /* @__PURE__ */ b(
80
- L.div,
519
+ /* @__PURE__ */ m(ae.Slot, { scope: e, children: /* @__PURE__ */ m(
520
+ M.div,
81
521
  {
82
- "data-radix-scroll-area-viewport": "",
83
- ...n,
84
- ref: a,
522
+ "data-radix-select-viewport": "",
523
+ role: "presentation",
524
+ ...l,
525
+ ref: s,
85
526
  style: {
86
- /**
87
- * We don't support `visible` because the intention is to have at least one scrollbar
88
- * if this component is used and `visible` will behave like `auto` in that case
89
- * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
90
- *
91
- * We don't handle `auto` because the intention is for the native implementation
92
- * to be hidden if using this component. We just want to ensure the node is scrollable
93
- * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
94
- * the browser from having to work out whether to render native scrollbars or not,
95
- * we tell it to with the intention of hiding them in CSS.
96
- */
97
- overflowX: i.scrollbarXEnabled ? "scroll" : "hidden",
98
- overflowY: i.scrollbarYEnabled ? "scroll" : "hidden",
99
- ...e.style
527
+ // we use position: 'relative' here on the `viewport` so that when we call
528
+ // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
529
+ // (independent of the scrollUpButton).
530
+ position: "relative",
531
+ flex: 1,
532
+ // Viewport should only be scrollable in the vertical direction.
533
+ // This won't work in vertical writing modes, so we'll need to
534
+ // revisit this if/when that is supported
535
+ // https://developer.chrome.com/blog/vertical-form-controls
536
+ overflow: "hidden auto",
537
+ ...l.style
100
538
  },
101
- children: /* @__PURE__ */ b("div", { ref: i.onContentChange, style: { minWidth: "100%", display: "table" }, children: l })
539
+ onScroll: E(l.onScroll, (p) => {
540
+ const g = p.currentTarget, { contentWrapper: C, shouldExpandOnScrollRef: P } = r;
541
+ if (P != null && P.current && C) {
542
+ const R = Math.abs(o.current - g.scrollTop);
543
+ if (R > 0) {
544
+ const T = window.innerHeight - D * 2, a = parseFloat(C.style.minHeight), v = parseFloat(C.style.height), y = Math.max(a, v);
545
+ if (y < T) {
546
+ const d = y + R, h = Math.min(T, d), A = d - h;
547
+ C.style.height = h + "px", C.style.bottom === "0px" && (g.scrollTop = A > 0 ? A : 0, C.style.justifyContent = "flex-end");
548
+ }
549
+ }
550
+ }
551
+ o.current = g.scrollTop;
552
+ })
102
553
  }
103
- )
554
+ ) })
104
555
  ] });
105
556
  }
106
557
  );
107
- G.displayName = $;
108
- var g = "ScrollAreaScrollbar", ue = c.forwardRef(
109
- (e, t) => {
110
- const { forceMount: r, ...l } = e, o = v(g, e.__scopeScrollArea), { onScrollbarXEnabledChange: n, onScrollbarYEnabledChange: i } = o, s = e.orientation === "horizontal";
111
- return c.useEffect(() => (s ? n(!0) : i(!0), () => {
112
- s ? n(!1) : i(!1);
113
- }), [s, n, i]), o.type === "hover" ? /* @__PURE__ */ b(fe, { ...l, ref: t, forceMount: r }) : o.type === "scroll" ? /* @__PURE__ */ b(he, { ...l, ref: t, forceMount: r }) : o.type === "auto" ? /* @__PURE__ */ b(J, { ...l, ref: t, forceMount: r }) : o.type === "always" ? /* @__PURE__ */ b(k, { ...l, ref: t }) : null;
558
+ We.displayName = we;
559
+ var Fe = "SelectGroup", [Lt, kt] = te(Fe), Ke = t.forwardRef(
560
+ (n, c) => {
561
+ const { __scopeSelect: e, ...i } = n, l = Ie();
562
+ return /* @__PURE__ */ m(Lt, { scope: e, id: l, children: /* @__PURE__ */ m(M.div, { role: "group", "aria-labelledby": l, ...i, ref: c }) });
114
563
  }
115
564
  );
116
- ue.displayName = g;
117
- var fe = c.forwardRef((e, t) => {
118
- const { forceMount: r, ...l } = e, o = v(g, e.__scopeScrollArea), [n, i] = c.useState(!1);
119
- return c.useEffect(() => {
120
- const s = o.scrollArea;
121
- let a = 0;
122
- if (s) {
123
- const f = () => {
124
- window.clearTimeout(a), i(!0);
125
- }, d = () => {
126
- a = window.setTimeout(() => i(!1), o.scrollHideDelay);
127
- };
128
- return s.addEventListener("pointerenter", f), s.addEventListener("pointerleave", d), () => {
129
- window.clearTimeout(a), s.removeEventListener("pointerenter", f), s.removeEventListener("pointerleave", d);
130
- };
131
- }
132
- }, [o.scrollArea, o.scrollHideDelay]), /* @__PURE__ */ b(I, { present: r || n, children: /* @__PURE__ */ b(
133
- J,
134
- {
135
- "data-state": n ? "visible" : "hidden",
136
- ...l,
137
- ref: t
138
- }
139
- ) });
140
- }), he = c.forwardRef((e, t) => {
141
- const { forceMount: r, ...l } = e, o = v(g, e.__scopeScrollArea), n = e.orientation === "horizontal", i = Y(() => a("SCROLL_END"), 100), [s, a] = ae("hidden", {
142
- hidden: {
143
- SCROLL: "scrolling"
144
- },
145
- scrolling: {
146
- SCROLL_END: "idle",
147
- POINTER_ENTER: "interacting"
148
- },
149
- interacting: {
150
- SCROLL: "interacting",
151
- POINTER_LEAVE: "idle"
152
- },
153
- idle: {
154
- HIDE: "hidden",
155
- SCROLL: "scrolling",
156
- POINTER_ENTER: "interacting"
157
- }
158
- });
159
- return c.useEffect(() => {
160
- if (s === "idle") {
161
- const f = window.setTimeout(() => a("HIDE"), o.scrollHideDelay);
162
- return () => window.clearTimeout(f);
163
- }
164
- }, [s, o.scrollHideDelay, a]), c.useEffect(() => {
165
- const f = o.viewport, d = n ? "scrollLeft" : "scrollTop";
166
- if (f) {
167
- let h = f[d];
168
- const u = () => {
169
- const S = f[d];
170
- h !== S && (a("SCROLL"), i()), h = S;
171
- };
172
- return f.addEventListener("scroll", u), () => f.removeEventListener("scroll", u);
173
- }
174
- }, [o.viewport, n, a, i]), /* @__PURE__ */ b(I, { present: r || s !== "hidden", children: /* @__PURE__ */ b(
175
- k,
176
- {
177
- "data-state": s === "hidden" ? "hidden" : "visible",
178
- ...l,
179
- ref: t,
180
- onPointerEnter: R(e.onPointerEnter, () => a("POINTER_ENTER")),
181
- onPointerLeave: R(e.onPointerLeave, () => a("POINTER_LEAVE"))
182
- }
183
- ) });
184
- }), J = c.forwardRef((e, t) => {
185
- const r = v(g, e.__scopeScrollArea), { forceMount: l, ...o } = e, [n, i] = c.useState(!1), s = e.orientation === "horizontal", a = Y(() => {
186
- if (r.viewport) {
187
- const f = r.viewport.offsetWidth < r.viewport.scrollWidth, d = r.viewport.offsetHeight < r.viewport.scrollHeight;
188
- i(s ? f : d);
189
- }
190
- }, 10);
191
- return T(r.viewport, a), T(r.content, a), /* @__PURE__ */ b(I, { present: l || n, children: /* @__PURE__ */ b(
192
- k,
193
- {
194
- "data-state": n ? "visible" : "hidden",
195
- ...o,
196
- ref: t
197
- }
198
- ) });
199
- }), k = c.forwardRef((e, t) => {
200
- const { orientation: r = "vertical", ...l } = e, o = v(g, e.__scopeScrollArea), n = c.useRef(null), i = c.useRef(0), [s, a] = c.useState({
201
- content: 0,
202
- viewport: 0,
203
- scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
204
- }), f = ee(s.viewport, s.content), d = {
205
- ...l,
206
- sizes: s,
207
- onSizesChange: a,
208
- hasThumb: f > 0 && f < 1,
209
- onThumbChange: (u) => n.current = u,
210
- onThumbPointerUp: () => i.current = 0,
211
- onThumbPointerDown: (u) => i.current = u
212
- };
213
- function h(u, S) {
214
- return ge(u, i.current, s, S);
565
+ Ke.displayName = Fe;
566
+ var Ge = "SelectLabel", ze = t.forwardRef(
567
+ (n, c) => {
568
+ const { __scopeSelect: e, ...i } = n, l = kt(Ge, e);
569
+ return /* @__PURE__ */ m(M.div, { id: l.id, ...i, ref: c });
215
570
  }
216
- return r === "horizontal" ? /* @__PURE__ */ b(
217
- be,
218
- {
219
- ...d,
220
- ref: t,
221
- onThumbPositionChange: () => {
222
- if (o.viewport && n.current) {
223
- const u = o.viewport.scrollLeft, S = F(u, s, o.dir);
224
- n.current.style.transform = `translate3d(${S}px, 0, 0)`;
225
- }
226
- },
227
- onWheelScroll: (u) => {
228
- o.viewport && (o.viewport.scrollLeft = u);
229
- },
230
- onDragScroll: (u) => {
231
- o.viewport && (o.viewport.scrollLeft = h(u, o.dir));
571
+ );
572
+ ze.displayName = Ge;
573
+ var ie = "SelectItem", [Bt, Ye] = te(ie), je = t.forwardRef(
574
+ (n, c) => {
575
+ const {
576
+ __scopeSelect: e,
577
+ value: i,
578
+ disabled: l = !1,
579
+ textValue: u,
580
+ ...r
581
+ } = n, s = j(ie, e), o = q(ie, e), p = s.value === i, [g, C] = t.useState(u ?? ""), [P, R] = t.useState(!1), T = B(
582
+ c,
583
+ (d) => {
584
+ var h;
585
+ return (h = o.itemRefCallback) == null ? void 0 : h.call(o, d, i, l);
232
586
  }
587
+ ), a = Ie(), v = t.useRef("touch"), y = () => {
588
+ l || (s.onValueChange(i), s.onOpenChange(!1));
589
+ };
590
+ if (i === "")
591
+ throw new Error(
592
+ "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
593
+ );
594
+ return /* @__PURE__ */ m(
595
+ Bt,
596
+ {
597
+ scope: e,
598
+ value: i,
599
+ disabled: l,
600
+ textId: a,
601
+ isSelected: p,
602
+ onItemTextChange: t.useCallback((d) => {
603
+ C((h) => h || ((d == null ? void 0 : d.textContent) ?? "").trim());
604
+ }, []),
605
+ children: /* @__PURE__ */ m(
606
+ ae.ItemSlot,
607
+ {
608
+ scope: e,
609
+ value: i,
610
+ disabled: l,
611
+ textValue: g,
612
+ children: /* @__PURE__ */ m(
613
+ M.div,
614
+ {
615
+ role: "option",
616
+ "aria-labelledby": a,
617
+ "data-highlighted": P ? "" : void 0,
618
+ "aria-selected": p && P,
619
+ "data-state": p ? "checked" : "unchecked",
620
+ "aria-disabled": l || void 0,
621
+ "data-disabled": l ? "" : void 0,
622
+ tabIndex: l ? void 0 : -1,
623
+ ...r,
624
+ ref: T,
625
+ onFocus: E(r.onFocus, () => R(!0)),
626
+ onBlur: E(r.onBlur, () => R(!1)),
627
+ onClick: E(r.onClick, () => {
628
+ v.current !== "mouse" && y();
629
+ }),
630
+ onPointerUp: E(r.onPointerUp, () => {
631
+ v.current === "mouse" && y();
632
+ }),
633
+ onPointerDown: E(r.onPointerDown, (d) => {
634
+ v.current = d.pointerType;
635
+ }),
636
+ onPointerMove: E(r.onPointerMove, (d) => {
637
+ var h;
638
+ v.current = d.pointerType, l ? (h = o.onItemLeave) == null || h.call(o) : v.current === "mouse" && d.currentTarget.focus({ preventScroll: !0 });
639
+ }),
640
+ onPointerLeave: E(r.onPointerLeave, (d) => {
641
+ var h;
642
+ d.currentTarget === document.activeElement && ((h = o.onItemLeave) == null || h.call(o));
643
+ }),
644
+ onKeyDown: E(r.onKeyDown, (d) => {
645
+ var A;
646
+ ((A = o.searchRef) == null ? void 0 : A.current) !== "" && d.key === " " || (It.includes(d.key) && y(), d.key === " " && d.preventDefault());
647
+ })
648
+ }
649
+ )
650
+ }
651
+ )
652
+ }
653
+ );
654
+ }
655
+ );
656
+ je.displayName = ie;
657
+ var re = "SelectItemText", qe = t.forwardRef(
658
+ (n, c) => {
659
+ const { __scopeSelect: e, className: i, style: l, ...u } = n, r = j(re, e), s = q(re, e), o = Ye(re, e), p = Et(re, e), [g, C] = t.useState(null), P = B(
660
+ c,
661
+ (y) => C(y),
662
+ o.onItemTextChange,
663
+ (y) => {
664
+ var d;
665
+ return (d = s.itemTextRefCallback) == null ? void 0 : d.call(s, y, o.value, o.disabled);
666
+ }
667
+ ), R = g == null ? void 0 : g.textContent, T = t.useMemo(
668
+ () => /* @__PURE__ */ m("option", { value: o.value, disabled: o.disabled, children: R }, o.value),
669
+ [o.disabled, o.value, R]
670
+ ), { onNativeOptionAdd: a, onNativeOptionRemove: v } = p;
671
+ return Y(() => (a(T), () => v(T)), [a, v, T]), /* @__PURE__ */ ce(Te, { children: [
672
+ /* @__PURE__ */ m(M.span, { id: o.textId, ...u, ref: P }),
673
+ o.isSelected && r.valueNode && !r.valueNodeHasChildren ? be.createPortal(u.children, r.valueNode) : null
674
+ ] });
675
+ }
676
+ );
677
+ qe.displayName = re;
678
+ var Xe = "SelectItemIndicator", Ze = t.forwardRef(
679
+ (n, c) => {
680
+ const { __scopeSelect: e, ...i } = n;
681
+ return Ye(Xe, e).isSelected ? /* @__PURE__ */ m(M.span, { "aria-hidden": !0, ...i, ref: c }) : null;
682
+ }
683
+ );
684
+ Ze.displayName = Xe;
685
+ var Ce = "SelectScrollUpButton", $e = t.forwardRef((n, c) => {
686
+ const e = q(Ce, n.__scopeSelect), i = Pe(Ce, n.__scopeSelect), [l, u] = t.useState(!1), r = B(c, i.onScrollButtonChange);
687
+ return Y(() => {
688
+ if (e.viewport && e.isPositioned) {
689
+ let s = function() {
690
+ const p = o.scrollTop > 0;
691
+ u(p);
692
+ };
693
+ const o = e.viewport;
694
+ return s(), o.addEventListener("scroll", s), () => o.removeEventListener("scroll", s);
233
695
  }
234
- ) : r === "vertical" ? /* @__PURE__ */ b(
235
- Se,
696
+ }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ m(
697
+ Qe,
236
698
  {
237
- ...d,
238
- ref: t,
239
- onThumbPositionChange: () => {
240
- if (o.viewport && n.current) {
241
- const u = o.viewport.scrollTop, S = F(u, s);
242
- n.current.style.transform = `translate3d(0, ${S}px, 0)`;
243
- }
244
- },
245
- onWheelScroll: (u) => {
246
- o.viewport && (o.viewport.scrollTop = u);
247
- },
248
- onDragScroll: (u) => {
249
- o.viewport && (o.viewport.scrollTop = h(u));
699
+ ...n,
700
+ ref: r,
701
+ onAutoScroll: () => {
702
+ const { viewport: s, selectedItem: o } = e;
703
+ s && o && (s.scrollTop = s.scrollTop - o.offsetHeight);
250
704
  }
251
705
  }
252
706
  ) : null;
253
- }), be = c.forwardRef((e, t) => {
254
- const { sizes: r, onSizesChange: l, ...o } = e, n = v(g, e.__scopeScrollArea), [i, s] = c.useState(), a = c.useRef(null), f = A(t, a, n.onScrollbarXChange);
255
- return c.useEffect(() => {
256
- a.current && s(getComputedStyle(a.current));
257
- }, [a]), /* @__PURE__ */ b(
258
- Q,
259
- {
260
- "data-orientation": "horizontal",
261
- ...o,
262
- ref: f,
263
- sizes: r,
264
- style: {
265
- bottom: 0,
266
- left: n.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
267
- right: n.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
268
- "--radix-scroll-area-thumb-width": X(r) + "px",
269
- ...e.style
270
- },
271
- onThumbPointerDown: (d) => e.onThumbPointerDown(d.x),
272
- onDragScroll: (d) => e.onDragScroll(d.x),
273
- onWheelScroll: (d, h) => {
274
- if (n.viewport) {
275
- const u = n.viewport.scrollLeft + d.deltaX;
276
- e.onWheelScroll(u), oe(u, h) && d.preventDefault();
277
- }
278
- },
279
- onResize: () => {
280
- a.current && n.viewport && i && l({
281
- content: n.viewport.scrollWidth,
282
- viewport: n.viewport.offsetWidth,
283
- scrollbar: {
284
- size: a.current.clientWidth,
285
- paddingStart: O(i.paddingLeft),
286
- paddingEnd: O(i.paddingRight)
287
- }
288
- });
289
- }
707
+ });
708
+ $e.displayName = Ce;
709
+ var ye = "SelectScrollDownButton", Je = t.forwardRef((n, c) => {
710
+ const e = q(ye, n.__scopeSelect), i = Pe(ye, n.__scopeSelect), [l, u] = t.useState(!1), r = B(c, i.onScrollButtonChange);
711
+ return Y(() => {
712
+ if (e.viewport && e.isPositioned) {
713
+ let s = function() {
714
+ const p = o.scrollHeight - o.clientHeight, g = Math.ceil(o.scrollTop) < p;
715
+ u(g);
716
+ };
717
+ const o = e.viewport;
718
+ return s(), o.addEventListener("scroll", s), () => o.removeEventListener("scroll", s);
290
719
  }
291
- );
292
- }), Se = c.forwardRef((e, t) => {
293
- const { sizes: r, onSizesChange: l, ...o } = e, n = v(g, e.__scopeScrollArea), [i, s] = c.useState(), a = c.useRef(null), f = A(t, a, n.onScrollbarYChange);
294
- return c.useEffect(() => {
295
- a.current && s(getComputedStyle(a.current));
296
- }, [a]), /* @__PURE__ */ b(
297
- Q,
720
+ }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ m(
721
+ Qe,
298
722
  {
299
- "data-orientation": "vertical",
300
- ...o,
301
- ref: f,
302
- sizes: r,
303
- style: {
304
- top: 0,
305
- right: n.dir === "ltr" ? 0 : void 0,
306
- left: n.dir === "rtl" ? 0 : void 0,
307
- bottom: "var(--radix-scroll-area-corner-height)",
308
- "--radix-scroll-area-thumb-height": X(r) + "px",
309
- ...e.style
310
- },
311
- onThumbPointerDown: (d) => e.onThumbPointerDown(d.y),
312
- onDragScroll: (d) => e.onDragScroll(d.y),
313
- onWheelScroll: (d, h) => {
314
- if (n.viewport) {
315
- const u = n.viewport.scrollTop + d.deltaY;
316
- e.onWheelScroll(u), oe(u, h) && d.preventDefault();
317
- }
318
- },
319
- onResize: () => {
320
- a.current && n.viewport && i && l({
321
- content: n.viewport.scrollHeight,
322
- viewport: n.viewport.offsetHeight,
323
- scrollbar: {
324
- size: a.current.clientHeight,
325
- paddingStart: O(i.paddingTop),
326
- paddingEnd: O(i.paddingBottom)
327
- }
328
- });
723
+ ...n,
724
+ ref: r,
725
+ onAutoScroll: () => {
726
+ const { viewport: s, selectedItem: o } = e;
727
+ s && o && (s.scrollTop = s.scrollTop + o.offsetHeight);
329
728
  }
330
729
  }
331
- );
332
- }), [me, K] = j(g), Q = c.forwardRef((e, t) => {
333
- const {
334
- __scopeScrollArea: r,
335
- sizes: l,
336
- hasThumb: o,
337
- onThumbChange: n,
338
- onThumbPointerUp: i,
339
- onThumbPointerDown: s,
340
- onThumbPositionChange: a,
341
- onDragScroll: f,
342
- onWheelScroll: d,
343
- onResize: h,
344
- ...u
345
- } = e, S = v(g, r), [p, y] = c.useState(null), M = A(t, (m) => y(m)), P = c.useRef(null), _ = c.useRef(""), U = S.viewport, D = l.content - l.viewport, W = C(d), x = C(a), H = Y(h, 10);
346
- function z(m) {
347
- if (P.current) {
348
- const w = m.clientX - P.current.left, E = m.clientY - P.current.top;
349
- f({ x: w, y: E });
350
- }
351
- }
352
- return c.useEffect(() => {
353
- const m = (w) => {
354
- const E = w.target;
355
- (p == null ? void 0 : p.contains(E)) && W(w, D);
356
- };
357
- return document.addEventListener("wheel", m, { passive: !1 }), () => document.removeEventListener("wheel", m, { passive: !1 });
358
- }, [U, p, D, W]), c.useEffect(x, [l, x]), T(p, H), T(S.content, H), /* @__PURE__ */ b(
359
- me,
730
+ ) : null;
731
+ });
732
+ Je.displayName = ye;
733
+ var Qe = t.forwardRef((n, c) => {
734
+ const { __scopeSelect: e, onAutoScroll: i, ...l } = n, u = q("SelectScrollButton", e), r = t.useRef(null), s = de(e), o = t.useCallback(() => {
735
+ r.current !== null && (window.clearInterval(r.current), r.current = null);
736
+ }, []);
737
+ return t.useEffect(() => () => o(), [o]), Y(() => {
738
+ var g;
739
+ const p = s().find((C) => C.ref.current === document.activeElement);
740
+ (g = p == null ? void 0 : p.ref.current) == null || g.scrollIntoView({ block: "nearest" });
741
+ }, [s]), /* @__PURE__ */ m(
742
+ M.div,
360
743
  {
361
- scope: r,
362
- scrollbar: p,
363
- hasThumb: o,
364
- onThumbChange: C(n),
365
- onThumbPointerUp: C(i),
366
- onThumbPositionChange: x,
367
- onThumbPointerDown: C(s),
368
- children: /* @__PURE__ */ b(
369
- L.div,
370
- {
371
- ...u,
372
- ref: M,
373
- style: { position: "absolute", ...u.style },
374
- onPointerDown: R(e.onPointerDown, (m) => {
375
- m.button === 0 && (m.target.setPointerCapture(m.pointerId), P.current = p.getBoundingClientRect(), _.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", S.viewport && (S.viewport.style.scrollBehavior = "auto"), z(m));
376
- }),
377
- onPointerMove: R(e.onPointerMove, z),
378
- onPointerUp: R(e.onPointerUp, (m) => {
379
- const w = m.target;
380
- w.hasPointerCapture(m.pointerId) && w.releasePointerCapture(m.pointerId), document.body.style.webkitUserSelect = _.current, S.viewport && (S.viewport.style.scrollBehavior = ""), P.current = null;
381
- })
382
- }
383
- )
744
+ "aria-hidden": !0,
745
+ ...l,
746
+ ref: c,
747
+ style: { flexShrink: 0, ...l.style },
748
+ onPointerDown: E(l.onPointerDown, () => {
749
+ r.current === null && (r.current = window.setInterval(i, 50));
750
+ }),
751
+ onPointerMove: E(l.onPointerMove, () => {
752
+ var p;
753
+ (p = u.onItemLeave) == null || p.call(u), r.current === null && (r.current = window.setInterval(i, 50));
754
+ }),
755
+ onPointerLeave: E(l.onPointerLeave, () => {
756
+ o();
757
+ })
384
758
  }
385
759
  );
386
- }), N = "ScrollAreaThumb", pe = c.forwardRef(
387
- (e, t) => {
388
- const { forceMount: r, ...l } = e, o = K(N, e.__scopeScrollArea);
389
- return /* @__PURE__ */ b(I, { present: r || o.hasThumb, children: /* @__PURE__ */ b(ve, { ref: t, ...l }) });
760
+ }), Vt = "SelectSeparator", et = t.forwardRef(
761
+ (n, c) => {
762
+ const { __scopeSelect: e, ...i } = n;
763
+ return /* @__PURE__ */ m(M.div, { "aria-hidden": !0, ...i, ref: c });
390
764
  }
391
- ), ve = c.forwardRef(
392
- (e, t) => {
393
- const { __scopeScrollArea: r, style: l, ...o } = e, n = v(N, r), i = K(N, r), { onThumbPositionChange: s } = i, a = A(
394
- t,
395
- (h) => i.onThumbChange(h)
396
- ), f = c.useRef(void 0), d = Y(() => {
397
- f.current && (f.current(), f.current = void 0);
398
- }, 100);
399
- return c.useEffect(() => {
400
- const h = n.viewport;
401
- if (h) {
402
- const u = () => {
403
- if (d(), !f.current) {
404
- const S = Pe(h, s);
405
- f.current = S, s();
406
- }
407
- };
408
- return s(), h.addEventListener("scroll", u), () => h.removeEventListener("scroll", u);
765
+ );
766
+ et.displayName = Vt;
767
+ var xe = "SelectArrow", Ht = t.forwardRef(
768
+ (n, c) => {
769
+ const { __scopeSelect: e, ...i } = n, l = ue(e), u = j(xe, e), r = q(xe, e);
770
+ return u.open && r.position === "popper" ? /* @__PURE__ */ m(mt, { ...l, ...i, ref: c }) : null;
771
+ }
772
+ );
773
+ Ht.displayName = xe;
774
+ var Ut = "SelectBubbleInput", tt = t.forwardRef(
775
+ ({ __scopeSelect: n, value: c, ...e }, i) => {
776
+ const l = t.useRef(null), u = B(i, l), r = St(c);
777
+ return t.useEffect(() => {
778
+ const s = l.current;
779
+ if (!s) return;
780
+ const o = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
781
+ o,
782
+ "value"
783
+ ).set;
784
+ if (r !== c && g) {
785
+ const C = new Event("change", { bubbles: !0 });
786
+ g.call(s, c), s.dispatchEvent(C);
409
787
  }
410
- }, [n.viewport, d, s]), /* @__PURE__ */ b(
411
- L.div,
788
+ }, [r, c]), /* @__PURE__ */ m(
789
+ M.select,
412
790
  {
413
- "data-state": i.hasThumb ? "visible" : "hidden",
414
- ...o,
415
- ref: a,
416
- style: {
417
- width: "var(--radix-scroll-area-thumb-width)",
418
- height: "var(--radix-scroll-area-thumb-height)",
419
- ...l
420
- },
421
- onPointerDownCapture: R(e.onPointerDownCapture, (h) => {
422
- const S = h.target.getBoundingClientRect(), p = h.clientX - S.left, y = h.clientY - S.top;
423
- i.onThumbPointerDown({ x: p, y });
424
- }),
425
- onPointerUp: R(e.onPointerUp, i.onThumbPointerUp)
791
+ ...e,
792
+ style: { ...wt, ...e.style },
793
+ ref: u,
794
+ defaultValue: c
426
795
  }
427
796
  );
428
797
  }
429
798
  );
430
- pe.displayName = N;
431
- var B = "ScrollAreaCorner", Z = c.forwardRef(
432
- (e, t) => {
433
- const r = v(B, e.__scopeScrollArea), l = !!(r.scrollbarX && r.scrollbarY);
434
- return r.type !== "scroll" && l ? /* @__PURE__ */ b(we, { ...e, ref: t }) : null;
435
- }
436
- );
437
- Z.displayName = B;
438
- var we = c.forwardRef((e, t) => {
439
- const { __scopeScrollArea: r, ...l } = e, o = v(B, r), [n, i] = c.useState(0), [s, a] = c.useState(0), f = !!(n && s);
440
- return T(o.scrollbarX, () => {
441
- var h;
442
- const d = ((h = o.scrollbarX) == null ? void 0 : h.offsetHeight) || 0;
443
- o.onCornerHeightChange(d), a(d);
444
- }), T(o.scrollbarY, () => {
445
- var h;
446
- const d = ((h = o.scrollbarY) == null ? void 0 : h.offsetWidth) || 0;
447
- o.onCornerWidthChange(d), i(d);
448
- }), f ? /* @__PURE__ */ b(
449
- L.div,
450
- {
451
- ...l,
452
- ref: t,
453
- style: {
454
- width: n,
455
- height: s,
456
- position: "absolute",
457
- right: o.dir === "ltr" ? 0 : void 0,
458
- left: o.dir === "rtl" ? 0 : void 0,
459
- bottom: 0,
460
- ...e.style
461
- }
462
- }
463
- ) : null;
464
- });
465
- function O(e) {
466
- return e ? parseInt(e, 10) : 0;
467
- }
468
- function ee(e, t) {
469
- const r = e / t;
470
- return isNaN(r) ? 0 : r;
799
+ tt.displayName = Ut;
800
+ function ot(n) {
801
+ return n === "" || n === void 0;
471
802
  }
472
- function X(e) {
473
- const t = ee(e.viewport, e.content), r = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, l = (e.scrollbar.size - r) * t;
474
- return Math.max(l, 18);
475
- }
476
- function ge(e, t, r, l = "ltr") {
477
- const o = X(r), n = o / 2, i = t || n, s = o - i, a = r.scrollbar.paddingStart + i, f = r.scrollbar.size - r.scrollbar.paddingEnd - s, d = r.content - r.viewport, h = l === "ltr" ? [0, d] : [d * -1, 0];
478
- return re([a, f], h)(e);
479
- }
480
- function F(e, t, r = "ltr") {
481
- const l = X(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, n = t.scrollbar.size - o, i = t.content - t.viewport, s = n - l, a = r === "ltr" ? [0, i] : [i * -1, 0], f = ce(e, a);
482
- return re([0, i], [0, s])(f);
483
- }
484
- function re(e, t) {
485
- return (r) => {
486
- if (e[0] === e[1] || t[0] === t[1]) return t[0];
487
- const l = (t[1] - t[0]) / (e[1] - e[0]);
488
- return t[0] + l * (r - e[0]);
489
- };
490
- }
491
- function oe(e, t) {
492
- return e > 0 && e < t;
803
+ function nt(n) {
804
+ const c = gt(n), e = t.useRef(""), i = t.useRef(0), l = t.useCallback(
805
+ (r) => {
806
+ const s = e.current + r;
807
+ c(s), function o(p) {
808
+ e.current = p, window.clearTimeout(i.current), p !== "" && (i.current = window.setTimeout(() => o(""), 1e3));
809
+ }(s);
810
+ },
811
+ [c]
812
+ ), u = t.useCallback(() => {
813
+ e.current = "", window.clearTimeout(i.current);
814
+ }, []);
815
+ return t.useEffect(() => () => window.clearTimeout(i.current), []), [e, l, u];
493
816
  }
494
- var Pe = (e, t = () => {
495
- }) => {
496
- let r = { left: e.scrollLeft, top: e.scrollTop }, l = 0;
497
- return function o() {
498
- const n = { left: e.scrollLeft, top: e.scrollTop }, i = r.left !== n.left, s = r.top !== n.top;
499
- (i || s) && t(), r = n, l = window.requestAnimationFrame(o);
500
- }(), () => window.cancelAnimationFrame(l);
501
- };
502
- function Y(e, t) {
503
- const r = C(e), l = c.useRef(0);
504
- return c.useEffect(() => () => window.clearTimeout(l.current), []), c.useCallback(() => {
505
- window.clearTimeout(l.current), l.current = window.setTimeout(r, t);
506
- }, [r, t]);
817
+ function rt(n, c, e) {
818
+ const l = c.length > 1 && Array.from(c).every((p) => p === c[0]) ? c[0] : c, u = e ? n.indexOf(e) : -1;
819
+ let r = Wt(n, Math.max(u, 0));
820
+ l.length === 1 && (r = r.filter((p) => p !== e));
821
+ const o = r.find(
822
+ (p) => p.textValue.toLowerCase().startsWith(l.toLowerCase())
823
+ );
824
+ return o !== e ? o : void 0;
507
825
  }
508
- function T(e, t) {
509
- const r = C(t);
510
- le(() => {
511
- let l = 0;
512
- if (e) {
513
- const o = new ResizeObserver(() => {
514
- cancelAnimationFrame(l), l = window.requestAnimationFrame(r);
515
- });
516
- return o.observe(e), () => {
517
- window.cancelAnimationFrame(l), o.unobserve(e);
518
- };
519
- }
520
- }, [e, r]);
826
+ function Wt(n, c) {
827
+ return n.map((e, i) => n[(c + i) % n.length]);
521
828
  }
522
- var He = q, ze = G, Ne = Z;
829
+ var uo = Ne, po = Ae, fo = De, mo = Le, ho = ke, vo = Be, go = We, So = Ke, wo = ze, Co = je, yo = qe, xo = Ze, Io = $e, To = Je, Po = et;
523
830
  export {
524
- Ne as Corner,
525
- He as Root,
526
- q as ScrollArea,
527
- Z as ScrollAreaCorner,
528
- ue as ScrollAreaScrollbar,
529
- pe as ScrollAreaThumb,
530
- G as ScrollAreaViewport,
531
- ze as Viewport
831
+ vo as Content,
832
+ So as Group,
833
+ mo as Icon,
834
+ Co as Item,
835
+ xo as ItemIndicator,
836
+ yo as ItemText,
837
+ wo as Label,
838
+ ho as Portal,
839
+ uo as Root,
840
+ To as ScrollDownButton,
841
+ Io as ScrollUpButton,
842
+ Ne as Select,
843
+ Ht as SelectArrow,
844
+ Be as SelectContent,
845
+ Ke as SelectGroup,
846
+ Le as SelectIcon,
847
+ je as SelectItem,
848
+ Ze as SelectItemIndicator,
849
+ qe as SelectItemText,
850
+ ze as SelectLabel,
851
+ ke as SelectPortal,
852
+ Je as SelectScrollDownButton,
853
+ $e as SelectScrollUpButton,
854
+ et as SelectSeparator,
855
+ Ae as SelectTrigger,
856
+ De as SelectValue,
857
+ We as SelectViewport,
858
+ Po as Separator,
859
+ po as Trigger,
860
+ fo as Value,
861
+ go as Viewport
532
862
  };