@rpcbase/ui 0.252.0 → 0.254.0

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 (353) hide show
  1. package/dist/components/Notifications/types.d.ts +2 -0
  2. package/dist/components/Notifications/types.d.ts.map +1 -1
  3. package/dist/index10.js +2 -2
  4. package/dist/index106.js +1 -1
  5. package/dist/index11.js +2 -2
  6. package/dist/index12.js +3 -3
  7. package/dist/index120.js +10 -10
  8. package/dist/index122.js +2 -2
  9. package/dist/index123.js +3 -3
  10. package/dist/index13.js +2 -2
  11. package/dist/index14.js +2 -2
  12. package/dist/index15.js +2 -2
  13. package/dist/index16.js +8 -8
  14. package/dist/index167.js +3 -3
  15. package/dist/index17.js +1 -1
  16. package/dist/index172.js +3 -3
  17. package/dist/index175.js +1 -1
  18. package/dist/index176.js +4 -4
  19. package/dist/index18.js +7 -7
  20. package/dist/index182.js +2 -2
  21. package/dist/index184.js +4 -4
  22. package/dist/index185.js +14 -14
  23. package/dist/index186.js +1 -1
  24. package/dist/index187.js +1 -1
  25. package/dist/index188.js +6 -6
  26. package/dist/index189.js +2 -2
  27. package/dist/index19.js +16 -16
  28. package/dist/index192.js +2 -2
  29. package/dist/index193.js +6 -6
  30. package/dist/index21.js +1 -1
  31. package/dist/index22.js +2 -2
  32. package/dist/index23.js +1 -1
  33. package/dist/index235.js +27 -14
  34. package/dist/index235.js.map +1 -1
  35. package/dist/index236.js +12 -7
  36. package/dist/index236.js.map +1 -1
  37. package/dist/index237.js +24 -9
  38. package/dist/index237.js.map +1 -1
  39. package/dist/index238.js +5 -10
  40. package/dist/index238.js.map +1 -1
  41. package/dist/index239.js +15 -20
  42. package/dist/index239.js.map +1 -1
  43. package/dist/index24.js +1 -1
  44. package/dist/index240.js +7 -8
  45. package/dist/index240.js.map +1 -1
  46. package/dist/index241.js +10 -9
  47. package/dist/index241.js.map +1 -1
  48. package/dist/index242.js +10 -9
  49. package/dist/index242.js.map +1 -1
  50. package/dist/index243.js +21 -4
  51. package/dist/index243.js.map +1 -1
  52. package/dist/index244.js +8 -5
  53. package/dist/index244.js.map +1 -1
  54. package/dist/index245.js +9 -16
  55. package/dist/index245.js.map +1 -1
  56. package/dist/index246.js +8 -8
  57. package/dist/index246.js.map +1 -1
  58. package/dist/index247.js +4 -18
  59. package/dist/index247.js.map +1 -1
  60. package/dist/index248.js +5 -20
  61. package/dist/index248.js.map +1 -1
  62. package/dist/index249.js +16 -12
  63. package/dist/index249.js.map +1 -1
  64. package/dist/index25.js +1 -1
  65. package/dist/index250.js +9 -29
  66. package/dist/index250.js.map +1 -1
  67. package/dist/index251.js +18 -12
  68. package/dist/index251.js.map +1 -1
  69. package/dist/index252.js +20 -25
  70. package/dist/index252.js.map +1 -1
  71. package/dist/index253.js +12 -5
  72. package/dist/index253.js.map +1 -1
  73. package/dist/index260.js +2 -2
  74. package/dist/index273.js +1 -1
  75. package/dist/index277.js +25 -20
  76. package/dist/index277.js.map +1 -1
  77. package/dist/index278.js +24 -62
  78. package/dist/index278.js.map +1 -1
  79. package/dist/index279.js +16 -6
  80. package/dist/index279.js.map +1 -1
  81. package/dist/index28.js +1 -1
  82. package/dist/index280.js +20 -6
  83. package/dist/index280.js.map +1 -1
  84. package/dist/index281.js +66 -11
  85. package/dist/index281.js.map +1 -1
  86. package/dist/index282.js +6 -3
  87. package/dist/index282.js.map +1 -1
  88. package/dist/index283.js +5 -50
  89. package/dist/index283.js.map +1 -1
  90. package/dist/index284.js +12 -4
  91. package/dist/index284.js.map +1 -1
  92. package/dist/index285.js +3 -29
  93. package/dist/index285.js.map +1 -1
  94. package/dist/index286.js +49 -15
  95. package/dist/index286.js.map +1 -1
  96. package/dist/index287.js +4 -6
  97. package/dist/index287.js.map +1 -1
  98. package/dist/index288.js +28 -20
  99. package/dist/index288.js.map +1 -1
  100. package/dist/index289.js +15 -52
  101. package/dist/index289.js.map +1 -1
  102. package/dist/index29.js +3 -56
  103. package/dist/index29.js.map +1 -1
  104. package/dist/index290.js +5 -20
  105. package/dist/index290.js.map +1 -1
  106. package/dist/index291.js +21 -41
  107. package/dist/index291.js.map +1 -1
  108. package/dist/index292.js +53 -39
  109. package/dist/index292.js.map +1 -1
  110. package/dist/index293.js +21 -46
  111. package/dist/index293.js.map +1 -1
  112. package/dist/index294.js +40 -19
  113. package/dist/index294.js.map +1 -1
  114. package/dist/index295.js +38 -69
  115. package/dist/index295.js.map +1 -1
  116. package/dist/index296.js +46 -18
  117. package/dist/index296.js.map +1 -1
  118. package/dist/index297.js +20 -3
  119. package/dist/index297.js.map +1 -1
  120. package/dist/index298.js +69 -10
  121. package/dist/index298.js.map +1 -1
  122. package/dist/index299.js +16 -12
  123. package/dist/index299.js.map +1 -1
  124. package/dist/index3.js +2 -2
  125. package/dist/index30.js +242 -3
  126. package/dist/index30.js.map +1 -1
  127. package/dist/index300.js +3 -18
  128. package/dist/index300.js.map +1 -1
  129. package/dist/index301.js +11 -36
  130. package/dist/index301.js.map +1 -1
  131. package/dist/index302.js +12 -238
  132. package/dist/index302.js.map +1 -1
  133. package/dist/index303.js +15 -249
  134. package/dist/index303.js.map +1 -1
  135. package/dist/index304.js +35 -67
  136. package/dist/index304.js.map +1 -1
  137. package/dist/index305.js +233 -93
  138. package/dist/index305.js.map +1 -1
  139. package/dist/index306.js +243 -74
  140. package/dist/index306.js.map +1 -1
  141. package/dist/index307.js +68 -3
  142. package/dist/index307.js.map +1 -1
  143. package/dist/index308.js +96 -26
  144. package/dist/index308.js.map +1 -1
  145. package/dist/index309.js +83 -16
  146. package/dist/index309.js.map +1 -1
  147. package/dist/index31.js +21 -239
  148. package/dist/index31.js.map +1 -1
  149. package/dist/index310.js +4 -35
  150. package/dist/index310.js.map +1 -1
  151. package/dist/index311.js +28 -16
  152. package/dist/index311.js.map +1 -1
  153. package/dist/index312.js +16 -3
  154. package/dist/index312.js.map +1 -1
  155. package/dist/index313.js +35 -27
  156. package/dist/index313.js.map +1 -1
  157. package/dist/index314.js +17 -28
  158. package/dist/index314.js.map +1 -1
  159. package/dist/index315.js +4 -4
  160. package/dist/index315.js.map +1 -1
  161. package/dist/index316.js +23 -75
  162. package/dist/index316.js.map +1 -1
  163. package/dist/index317.js +25 -269
  164. package/dist/index317.js.map +1 -1
  165. package/dist/index318.js +4 -12
  166. package/dist/index318.js.map +1 -1
  167. package/dist/index319.js +79 -11
  168. package/dist/index319.js.map +1 -1
  169. package/dist/index32.js +4 -23
  170. package/dist/index32.js.map +1 -1
  171. package/dist/index320.js +270 -23
  172. package/dist/index320.js.map +1 -1
  173. package/dist/index321.js +11 -16
  174. package/dist/index321.js.map +1 -1
  175. package/dist/index322.js +10 -125
  176. package/dist/index322.js.map +1 -1
  177. package/dist/index323.js +24 -4
  178. package/dist/index323.js.map +1 -1
  179. package/dist/index324.js +16 -65
  180. package/dist/index324.js.map +1 -1
  181. package/dist/index325.js +125 -13
  182. package/dist/index325.js.map +1 -1
  183. package/dist/index326.js +5 -7
  184. package/dist/index326.js.map +1 -1
  185. package/dist/index327.js +65 -5
  186. package/dist/index327.js.map +1 -1
  187. package/dist/index328.js +14 -4
  188. package/dist/index328.js.map +1 -1
  189. package/dist/index329.js +7 -10
  190. package/dist/index329.js.map +1 -1
  191. package/dist/index33.js +6 -3
  192. package/dist/index33.js.map +1 -1
  193. package/dist/index330.js +5 -7
  194. package/dist/index330.js.map +1 -1
  195. package/dist/index331.js +3 -133
  196. package/dist/index331.js.map +1 -1
  197. package/dist/index332.js +9 -398
  198. package/dist/index332.js.map +1 -1
  199. package/dist/index333.js +8 -5
  200. package/dist/index333.js.map +1 -1
  201. package/dist/index334.js +131 -50
  202. package/dist/index334.js.map +1 -1
  203. package/dist/index335.js +399 -11
  204. package/dist/index335.js.map +1 -1
  205. package/dist/index336.js +5 -28
  206. package/dist/index336.js.map +1 -1
  207. package/dist/index337.js +52 -11
  208. package/dist/index337.js.map +1 -1
  209. package/dist/index338.js +11 -24
  210. package/dist/index338.js.map +1 -1
  211. package/dist/index339.js +27 -28
  212. package/dist/index339.js.map +1 -1
  213. package/dist/index34.js +38 -8
  214. package/dist/index34.js.map +1 -1
  215. package/dist/index340.js +11 -16
  216. package/dist/index340.js.map +1 -1
  217. package/dist/index341.js +1 -1
  218. package/dist/index348.js +5 -51
  219. package/dist/index348.js.map +1 -1
  220. package/dist/index349.js +51 -5
  221. package/dist/index349.js.map +1 -1
  222. package/dist/index35.js +74 -35
  223. package/dist/index35.js.map +1 -1
  224. package/dist/index350.js +3 -3
  225. package/dist/index358.js +5 -5
  226. package/dist/index359.js +1 -1
  227. package/dist/index36.js +20 -74
  228. package/dist/index36.js.map +1 -1
  229. package/dist/index363.js +5 -5
  230. package/dist/index368.js +11 -5
  231. package/dist/index368.js.map +1 -1
  232. package/dist/index369.js +6 -3
  233. package/dist/index369.js.map +1 -1
  234. package/dist/index37.js +33 -18
  235. package/dist/index37.js.map +1 -1
  236. package/dist/index370.js +3 -12
  237. package/dist/index370.js.map +1 -1
  238. package/dist/index372.js +1 -1
  239. package/dist/index375.js +2 -2
  240. package/dist/index376.js +3 -3
  241. package/dist/index377.js +8 -8
  242. package/dist/index379.js +5 -5
  243. package/dist/index38.js +26 -36
  244. package/dist/index38.js.map +1 -1
  245. package/dist/index380.js +3 -3
  246. package/dist/index382.js +1 -1
  247. package/dist/index384.js +1 -1
  248. package/dist/index385.js +2 -2
  249. package/dist/index386.js +1 -1
  250. package/dist/index388.js +2 -2
  251. package/dist/index389.js +2 -2
  252. package/dist/index39.js +21 -26
  253. package/dist/index39.js.map +1 -1
  254. package/dist/index399.js +2 -2
  255. package/dist/index4.js +2 -2
  256. package/dist/index40.js +56 -20
  257. package/dist/index40.js.map +1 -1
  258. package/dist/index41.js +51 -59
  259. package/dist/index41.js.map +1 -1
  260. package/dist/index411.js +3 -15
  261. package/dist/index411.js.map +1 -1
  262. package/dist/index412.js +15 -3
  263. package/dist/index412.js.map +1 -1
  264. package/dist/index413.js +1 -1
  265. package/dist/index414.js +68 -5
  266. package/dist/index414.js.map +1 -1
  267. package/dist/index415.js +30 -55
  268. package/dist/index415.js.map +1 -1
  269. package/dist/index416.js +9 -68
  270. package/dist/index416.js.map +1 -1
  271. package/dist/index417.js +148 -26
  272. package/dist/index417.js.map +1 -1
  273. package/dist/index418.js +108 -9
  274. package/dist/index418.js.map +1 -1
  275. package/dist/index419.js +5 -153
  276. package/dist/index419.js.map +1 -1
  277. package/dist/index42.js +21 -50
  278. package/dist/index42.js.map +1 -1
  279. package/dist/index420.js +54 -106
  280. package/dist/index420.js.map +1 -1
  281. package/dist/index43.js +127 -18
  282. package/dist/index43.js.map +1 -1
  283. package/dist/index44.js +39 -122
  284. package/dist/index44.js.map +1 -1
  285. package/dist/index45.js +85 -42
  286. package/dist/index45.js.map +1 -1
  287. package/dist/index46.js +123 -87
  288. package/dist/index46.js.map +1 -1
  289. package/dist/index47.js +5 -126
  290. package/dist/index47.js.map +1 -1
  291. package/dist/index48.js +332 -5
  292. package/dist/index48.js.map +1 -1
  293. package/dist/index49.js +245 -320
  294. package/dist/index49.js.map +1 -1
  295. package/dist/index5.js +2 -2
  296. package/dist/index50.js +23 -254
  297. package/dist/index50.js.map +1 -1
  298. package/dist/index51.js +129 -25
  299. package/dist/index51.js.map +1 -1
  300. package/dist/index52.js +24 -129
  301. package/dist/index52.js.map +1 -1
  302. package/dist/index53.js +19 -22
  303. package/dist/index53.js.map +1 -1
  304. package/dist/index54.js +134 -19
  305. package/dist/index54.js.map +1 -1
  306. package/dist/index55.js +30 -133
  307. package/dist/index55.js.map +1 -1
  308. package/dist/index56.js +24 -30
  309. package/dist/index56.js.map +1 -1
  310. package/dist/index57.js +38 -26
  311. package/dist/index57.js.map +1 -1
  312. package/dist/index58.js +19 -39
  313. package/dist/index58.js.map +1 -1
  314. package/dist/index59.js +133 -18
  315. package/dist/index59.js.map +1 -1
  316. package/dist/index6.js +4 -4
  317. package/dist/index60.js +49 -134
  318. package/dist/index60.js.map +1 -1
  319. package/dist/index61.js +25 -48
  320. package/dist/index61.js.map +1 -1
  321. package/dist/index62.js +57 -28
  322. package/dist/index62.js.map +1 -1
  323. package/dist/index63.js +56 -57
  324. package/dist/index63.js.map +1 -1
  325. package/dist/index64.js +5 -5
  326. package/dist/index64.js.map +1 -1
  327. package/dist/index66.js +23 -11
  328. package/dist/index66.js.map +1 -1
  329. package/dist/index67.js +232 -17
  330. package/dist/index67.js.map +1 -1
  331. package/dist/index68.js +5 -5
  332. package/dist/index68.js.map +1 -1
  333. package/dist/index7.js +11 -11
  334. package/dist/index70.js +11 -23
  335. package/dist/index70.js.map +1 -1
  336. package/dist/index71.js +17 -232
  337. package/dist/index71.js.map +1 -1
  338. package/dist/index72.js +6 -2
  339. package/dist/index72.js.map +1 -1
  340. package/dist/index73.js +8 -2
  341. package/dist/index73.js.map +1 -1
  342. package/dist/index74.js +6 -2
  343. package/dist/index74.js.map +1 -1
  344. package/dist/index75.js +2 -2
  345. package/dist/index76.js +2 -6
  346. package/dist/index76.js.map +1 -1
  347. package/dist/index77.js +2 -8
  348. package/dist/index77.js.map +1 -1
  349. package/dist/index78.js +2 -6
  350. package/dist/index78.js.map +1 -1
  351. package/dist/index8.js +2 -2
  352. package/dist/index9.js +1 -1
  353. package/package.json +1 -1
package/dist/index49.js CHANGED
@@ -1,336 +1,261 @@
1
- import * as n from "react";
2
- import { visuallyHiddenInput as nt, visuallyHidden as st } from "./index277.js";
3
- import { useMergedRefs as lt } from "./index278.js";
4
- import { useRefWithInit as it } from "./index279.js";
5
- import { useOnFirstRender as at } from "./index280.js";
6
- import { usePreviousValue as ut } from "./index281.js";
7
- import { isElementDisabled as ct } from "./index282.js";
8
- import { useControlled as de } from "./index283.js";
9
- import { useIsoLayoutEffect as P } from "./index284.js";
10
- import { useStableCallback as C } from "./index285.js";
11
- import { useValueAsRef as ft } from "./index286.js";
12
- import { EMPTY_OBJECT as dt, EMPTY_ARRAY as me } from "./index287.js";
13
- import { SelectRootContext as mt, SelectFloatingContext as pt } from "./index288.js";
14
- import { useFieldRootContext as gt } from "./index289.js";
15
- import { useRegisterFieldControl as ht } from "./index290.js";
16
- import { useLabelableId as Rt } from "./index291.js";
17
- import { useTransitionStatus as yt } from "./index292.js";
18
- import { selectors as M } from "./index293.js";
1
+ import * as M from "react";
2
+ import { rectToClientRect as Jt } from "./index325.js";
3
+ import { addEventListener as Qt } from "./index326.js";
4
+ import { useStableCallback as te } from "./index288.js";
5
+ import { ownerDocument as Tt } from "./index310.js";
6
+ import { useIsoLayoutEffect as rt } from "./index287.js";
7
+ import { useAnimationFrame as ee } from "./index327.js";
8
+ import { useSelectRootContext as oe, useSelectFloatingContext as ne } from "./index291.js";
9
+ import { popupStateMapping as re } from "./index173.js";
10
+ import { useSelectPositionerContext as ie } from "./index321.js";
11
+ import { styleDisableScrollbar as Rt } from "./index328.js";
12
+ import { transitionStatusMapping as se } from "./index174.js";
13
+ import { useOpenChangeComplete as le } from "./index182.js";
14
+ import { useRenderElement as ce } from "./index172.js";
15
+ import { selectors as a } from "./index296.js";
16
+ import { clearStyles as Ct, LIST_FUNCTIONAL_STYLES as ae } from "./index322.js";
19
17
  import { createChangeEventDetails as pe } from "./index175.js";
20
- import { useOpenChangeComplete as It } from "./index182.js";
21
- import { useFormContext as xt } from "./index294.js";
22
- import { stringifyAsValue as I, stringifyAsLabel as vt } from "./index295.js";
23
- import { defaultItemEquality as Ct, findItemIndex as ge, compareItemEquality as bt } from "./index296.js";
24
- import { areArraysEqual as Vt } from "./index297.js";
25
- import { useValueChanged as At } from "./index298.js";
26
- import { useOpenInteractionType as St } from "./index192.js";
27
- import { getMaxScrollOffset as Pt, normalizeScrollOffset as Mt } from "./index299.js";
28
- import { j as w } from "./index30.js";
29
- import { useStore as E } from "./index300.js";
30
- import { useFloatingRootContext as wt } from "./index301.js";
31
- import { useClick as Et } from "./index193.js";
32
- import { useDismiss as Ot } from "./index302.js";
33
- import { useListNavigation as Tt } from "./index303.js";
34
- import { useTypeahead as Ft } from "./index304.js";
35
- import { mergeProps as he } from "./index305.js";
36
- import { FOCUSABLE_POPUP_PROPS as Lt } from "./index184.js";
37
- import { Store as Ut } from "./index306.js";
38
- import { none as Ht, focusOut as qt, outsidePress as Dt } from "./index177.js";
39
- function Cr(Re) {
18
+ import { useToolbarRootContext as me } from "./index329.js";
19
+ import { COMPOSITE_KEYS as ue } from "./index183.js";
20
+ import { getDisabledMountTransitionStyles as ge } from "./index330.js";
21
+ import { clamp as U } from "./index331.js";
22
+ import { SCROLL_EDGE_TOLERANCE_PX as v, getMaxScrollOffset as fe } from "./index302.js";
23
+ import { useCSPContext as he } from "./index332.js";
24
+ import { useDirection as de } from "./index333.js";
25
+ import { j as Ht } from "./index28.js";
26
+ import { useStore as d } from "./index303.js";
27
+ import { getWindow as it } from "./index334.js";
28
+ import { FloatingFocusManager as ye } from "./index185.js";
29
+ import { platform as xe } from "./index335.js";
30
+ import { webkit as Se } from "./index336.js";
31
+ import { windowResize as Te } from "./index177.js";
32
+ const Re = {
33
+ ...re,
34
+ ...se
35
+ }, Ce = /* @__PURE__ */ M.forwardRef(function(o, F) {
40
36
  const {
41
- id: ye,
42
- value: Ie,
43
- defaultValue: G = null,
44
- onValueChange: xe,
45
- open: ve,
46
- defaultOpen: Ce = !1,
47
- onOpenChange: be,
48
- name: K,
49
- form: O,
50
- autoComplete: Ve,
51
- disabled: Ae = !1,
52
- readOnly: p = !1,
53
- required: T = !1,
54
- modal: F = !0,
55
- actionsRef: Q,
56
- inputRef: Se,
57
- onOpenChangeComplete: L,
58
- items: U,
59
- multiple: s = !1,
60
- itemToStringLabel: b,
61
- itemToStringValue: a,
62
- isItemEqualToValue: g = Ct,
63
- highlightItemOnHover: H = !0,
64
- children: Pe
65
- } = Re, {
66
- clearErrors: Me
67
- } = xt(), {
68
- setDirty: we,
69
- setTouched: Ee,
70
- setFocused: Oe,
71
- validityData: Te,
72
- setFilled: X,
73
- name: Fe,
74
- disabled: Le,
75
- validation: y,
76
- validationMode: Ue
77
- } = gt(), f = Rt({
78
- id: ye
79
- }), c = Le || Ae, d = Fe ?? K, [t, He] = de({
80
- controlled: Ie,
81
- default: s ? G ?? me : G,
82
- name: "Select",
83
- state: "value"
84
- }), [l, qe] = de({
85
- controlled: ve,
86
- default: Ce,
87
- name: "Select",
88
- state: "open"
89
- }), q = n.useRef([]), D = n.useRef([]), j = n.useRef(null), De = n.useRef(null), je = n.useRef(0), Ne = n.useRef(null), h = n.useRef([]), Z = n.useRef(!1), _e = n.useRef(null), N = n.useRef(null), ke = n.useRef({
90
- allowSelectedMouseUp: !1,
91
- allowUnselectedMouseUp: !1,
92
- dragY: 0
93
- }), Ye = n.useRef(!1), {
94
- mounted: _,
95
- setMounted: ze,
96
- transitionStatus: k
97
- } = yt(l), {
98
- openMethod: ee,
99
- triggerProps: te
100
- } = St(l), r = it(() => new Ut({
101
- id: f,
102
- labelId: void 0,
103
- modal: F,
104
- multiple: s,
105
- itemToStringLabel: b,
106
- itemToStringValue: a,
107
- isItemEqualToValue: g,
108
- value: t,
109
- open: l,
110
- mounted: _,
111
- transitionStatus: k,
112
- items: U,
113
- forceMount: !1,
114
- openMethod: null,
115
- activeIndex: null,
116
- selectedIndex: null,
117
- popupProps: {},
118
- triggerProps: {},
119
- triggerElement: null,
120
- positionerElement: null,
121
- listElement: null,
122
- popupSide: null,
123
- scrollUpArrowVisible: !1,
124
- scrollDownArrowVisible: !1,
125
- hasScrollArrows: !1
126
- })).current, re = E(r, M.activeIndex), oe = E(r, M.selectedIndex), Be = E(r, M.triggerElement), We = E(r, M.positionerElement), Je = ut(ee), ne = ee ?? Je ?? null, $e = n.useMemo(() => s ? "" : I(t, a), [s, t, a]), Ge = n.useMemo(() => s && Array.isArray(t) ? t.map((e) => I(e, a)) : I(t, a), [s, t, a]), Ke = ft(r.state.triggerElement), Qe = C(() => Ge);
127
- ht(Ke, f, t, Qe, !c, K);
128
- const se = n.useRef(t), Y = s ? Array.isArray(t) && t.length > 0 : t != null && I(t, a) !== "";
129
- P(() => {
130
- t !== se.current && r.set("forceMount", !0);
131
- }, [r, t]), P(() => {
132
- X(Y);
133
- }, [Y, X]), P(function() {
134
- const o = h.current;
135
- let u;
136
- if (s) {
137
- const i = Array.isArray(t) ? t : [];
138
- if (i.length === 0)
139
- u = null;
140
- else {
141
- const m = i[i.length - 1], R = ge(o, m, g);
142
- u = R === -1 ? null : R;
143
- }
144
- } else {
145
- const i = ge(o, t, g);
146
- u = i === -1 ? null : i;
37
+ render: y,
38
+ className: A,
39
+ style: Ee,
40
+ finalFocus: Mt,
41
+ ...vt
42
+ } = o, {
43
+ store: i,
44
+ popupRef: p,
45
+ onOpenChangeComplete: Ft,
46
+ setOpen: st,
47
+ valueRef: lt,
48
+ firstItemTextRef: J,
49
+ selectedItemTextRef: ct,
50
+ multiple: wt,
51
+ handleScrollArrowVisibility: H,
52
+ scrollHandlerRef: Bt,
53
+ listRef: at,
54
+ highlightItemOnHover: pt
55
+ } = oe(), {
56
+ side: It,
57
+ align: Ot,
58
+ alignItemWithTriggerActive: s,
59
+ isPositioned: mt,
60
+ setControlledAlignItemWithTrigger: ut
61
+ } = ie(), At = me() != null, Lt = ne(), Q = de(), {
62
+ nonce: Dt,
63
+ disableStyleElements: Nt
64
+ } = he(), _t = d(i, a.id), m = d(i, a.open), $t = d(i, a.openMethod), Vt = d(i, a.mounted), Wt = d(i, a.popupProps), gt = d(i, a.transitionStatus), L = d(i, a.triggerElement), t = d(i, a.positionerElement), w = d(i, a.listElement), D = M.useRef(!1), N = M.useRef(!1), k = M.useRef({}), ft = ee(), tt = te((e) => {
65
+ if (!t || !p.current || !N.current)
66
+ return;
67
+ if (D.current || !s) {
68
+ H();
69
+ return;
147
70
  }
148
- u === null && (N.current = null), !l && r.set("selectedIndex", u);
149
- }, [Y, s, l, t, h, g, r, N]);
150
- function Xe(e) {
151
- const o = Te.initialValue;
152
- return Array.isArray(e) && Array.isArray(o) ? !Vt(e, o, (u, i) => bt(u, i, g)) : e !== o;
153
- }
154
- At(t, () => {
155
- Me(d), we(Xe(t)), y.change(t);
156
- });
157
- const z = C((e, o) => {
158
- be?.(e, o), !o.isCanceled && (qe(e), !e && (o.reason === qt || o.reason === Dt) && (Ee(!0), Oe(!1), Ue === "onBlur" && y.commit(t)));
159
- }), B = C(() => {
160
- ze(!1), r.update({
161
- activeIndex: null,
162
- openMethod: null
163
- }), L?.(!1);
71
+ const x = t.style.top === "0px", u = t.style.bottom === "0px";
72
+ if (!x && !u) {
73
+ H();
74
+ return;
75
+ }
76
+ const K = Pt(t), g = j(t.getBoundingClientRect().height, "y", K), _ = Tt(t), $ = it(t), V = $.getComputedStyle(t), B = parseFloat(V.marginTop), f = parseFloat(V.marginBottom), l = Et($.getComputedStyle(p.current)), S = Math.min(_.documentElement.clientHeight - B - f, l), c = e.scrollTop, W = X(e);
77
+ let T = 0, R = null, E = !1, I = !1;
78
+ const q = (r) => {
79
+ t.style.height = `${r}px`;
80
+ }, et = (r, O) => {
81
+ const z = U(r, 0, S - g);
82
+ z > 0 && q(g + z), e.scrollTop = O, S - (g + z) <= v && (D.current = !0), H();
83
+ }, P = x ? W - c : c, Y = Math.min(g + P, S);
84
+ if (T = Y, P <= v) {
85
+ et(P, x ? W : 0);
86
+ return;
87
+ }
88
+ if (S - Y > v)
89
+ x ? I = !0 : R = 0;
90
+ else if (E = !0, u && c < W) {
91
+ const r = g + P - S;
92
+ R = c - (P - r);
93
+ }
94
+ if (T = Math.ceil(T), T !== 0 && q(T), I || R != null) {
95
+ const r = X(e), O = I ? r : U(R, 0, r);
96
+ Math.abs(e.scrollTop - O) > v && (e.scrollTop = O);
97
+ }
98
+ (E || T >= S - v) && (D.current = !0), H();
164
99
  });
165
- It({
166
- enabled: !Q,
167
- open: l,
168
- ref: j,
100
+ M.useImperativeHandle(Bt, () => tt, [tt]), le({
101
+ open: m,
102
+ ref: p,
169
103
  onComplete() {
170
- l || B();
104
+ m && Ft?.(!0);
171
105
  }
172
- }), n.useImperativeHandle(Q, () => ({
173
- unmount: B
174
- }), [B]);
175
- const V = C((e, o) => {
176
- xe?.(e, o), !o.isCanceled && He(e);
177
- }), le = C(() => {
178
- const e = r.state.listElement || j.current;
179
- if (!e)
106
+ });
107
+ const Yt = {
108
+ open: m,
109
+ transitionStatus: gt,
110
+ side: It,
111
+ align: Ot
112
+ };
113
+ rt(() => {
114
+ !t || !p.current || Object.keys(k.current).length || (k.current = {
115
+ top: t.style.top || "0",
116
+ left: t.style.left || "0",
117
+ right: t.style.right,
118
+ height: t.style.height,
119
+ bottom: t.style.bottom,
120
+ minHeight: t.style.minHeight,
121
+ maxHeight: t.style.maxHeight,
122
+ marginTop: t.style.marginTop,
123
+ marginBottom: t.style.marginBottom
124
+ });
125
+ }, [p, t]), rt(() => {
126
+ m || s || (N.current = !1, D.current = !1, Ct(t, k.current));
127
+ }, [m, s, t, p]), rt(() => {
128
+ const e = p.current;
129
+ if (!m || !L || !t || !e || s && !mt || i.state.transitionStatus === "ending")
130
+ return;
131
+ if (!s) {
132
+ N.current = !0, ft.request(H), e.style.removeProperty("--transform-origin");
180
133
  return;
181
- const o = Pt(e.scrollHeight, e.clientHeight), u = Mt(e.scrollTop, o), i = u > 0, m = u < o;
182
- r.state.scrollUpArrowVisible !== i && r.set("scrollUpArrowVisible", i), r.state.scrollDownArrowVisible !== m && r.set("scrollDownArrowVisible", m);
183
- }), x = wt({
184
- open: l,
185
- onOpenChange: z,
186
- elements: {
187
- reference: Be,
188
- floating: We
189
134
  }
190
- }), ie = Et(x, {
191
- enabled: !p && !c,
192
- event: "mousedown"
193
- }), A = Ot(x), v = Tt(x, {
194
- enabled: !p && !c,
195
- listRef: q,
196
- activeIndex: re,
197
- selectedIndex: oe,
198
- disabledIndices: me,
199
- onNavigate(e) {
200
- e === null && !l || r.set("activeIndex", e);
135
+ const x = He(e);
136
+ e.style.removeProperty("--transform-origin");
137
+ try {
138
+ let u = ct.current;
139
+ u?.isConnected || (u = !a.hasSelectedValue(i.state) && J.current?.isConnected ? J.current : null);
140
+ const K = lt.current, g = it(t), _ = g.getComputedStyle(t), $ = g.getComputedStyle(e), V = Tt(L), B = Pt(L), f = Z(L.getBoundingClientRect(), B), l = Z(t.getBoundingClientRect(), B), S = f.height, c = w || e, W = c.scrollHeight, T = parseFloat($.borderBottomWidth), R = parseFloat(_.marginTop) || 10, E = parseFloat(_.marginBottom) || 10, I = parseFloat(_.minHeight) || 100, q = Et($), et = 5, P = 5, Y = 20, r = V.documentElement.clientHeight - R - E, O = V.documentElement.clientWidth, z = r - f.bottom + S;
141
+ let C, ht = Q === "rtl" ? f.right - l.width : f.left, dt = 0;
142
+ if (u && K) {
143
+ const h = Z(K.getBoundingClientRect(), B);
144
+ C = Z(u.getBoundingClientRect(), B), ht = l.left + (Q === "rtl" ? h.right - C.right : h.left - C.left);
145
+ const G = h.top - f.top + h.height / 2;
146
+ dt = C.top - l.top + C.height / 2 - G;
147
+ }
148
+ const ot = z + dt + E + T;
149
+ let b = Math.min(r, ot);
150
+ const kt = r - R - E, nt = ot - b, Kt = O - P;
151
+ t.style.left = `${U(ht, et, Kt - l.width)}px`, t.style.height = `${b}px`, t.style.maxHeight = "none", t.style.marginTop = `${R}px`, t.style.marginBottom = `${E}px`, e.style.height = "100%";
152
+ const yt = X(c), xt = nt >= yt - v;
153
+ xt && (b = Math.min(r, l.height) - (nt - yt));
154
+ const qt = f.top < Y || f.bottom > r - Y || Math.ceil(b) + v < Math.min(W, I), Gt = (g.visualViewport?.scale ?? 1) !== 1 && Se;
155
+ if (qt || Gt) {
156
+ N.current = !0, Ct(t, k.current), ut(!1);
157
+ return;
158
+ }
159
+ const Ut = Math.max(I, b);
160
+ if (xt) {
161
+ const h = Math.max(0, r - ot);
162
+ t.style.top = l.height >= kt ? "0" : `${h}px`, t.style.height = `${b}px`, c.scrollTop = X(c);
163
+ } else
164
+ t.style.bottom = "0", c.scrollTop = nt;
165
+ if (C) {
166
+ const h = l.top, G = l.height, St = C.top + C.height / 2, Xt = G > 0 ? (St - h) / G * 100 : 50, Zt = U(Xt, 0, 100);
167
+ e.style.setProperty("--transform-origin", `50% ${Zt}%`);
168
+ }
169
+ (Ut === r || b >= q) && (D.current = !0), H(), pt && i.state.selectedIndex === null && i.state.activeIndex === null && at.current[0] != null && i.set("activeIndex", 0), N.current = !0;
170
+ } finally {
171
+ x();
172
+ }
173
+ }, [i, m, t, L, lt, J, ct, p, H, s, ut, ft, w, at, pt, Q, mt]), M.useEffect(() => {
174
+ if (!s || !t || !m)
175
+ return;
176
+ const e = it(t);
177
+ function x(u) {
178
+ st(!1, pe(Te, u));
179
+ }
180
+ return Qt(e, "resize", x);
181
+ }, [st, s, t, m]);
182
+ const zt = {
183
+ ...w ? {
184
+ role: "presentation",
185
+ "aria-orientation": void 0
186
+ } : {
187
+ role: "listbox",
188
+ "aria-multiselectable": wt || void 0,
189
+ id: `${_t}-list`
190
+ },
191
+ onKeyDown(e) {
192
+ At && ue.has(e.key) && e.stopPropagation();
201
193
  },
202
- focusItemOnHover: H
203
- }), S = Ft(x, {
204
- enabled: !p && !c && (l || !s),
205
- listRef: D,
206
- activeIndex: re,
207
- selectedIndex: oe,
208
- // Skip disabled items while matching so typeahead advances to the next selectable item
209
- // (a click can never select a disabled item and native `<select>` skips them too). Resolve
210
- // the disabled state from the element via the attribute-only `isElementDisabled` so the
211
- // hidden, force-mounted items used for closed-trigger typeahead aren't dropped by the
212
- // `elementsRef`/visibility filter that `disabledIndices` deliberately sidesteps.
213
- disabledIndices: (e) => ct(q.current[e]),
214
- onMatch(e) {
215
- l ? r.set("activeIndex", e) : V(h.current[e], pe("none"));
194
+ onScroll(e) {
195
+ w || tt(e.currentTarget);
216
196
  },
217
- onTyping(e) {
218
- Z.current = e;
197
+ ...s && {
198
+ style: w ? {
199
+ height: "100%"
200
+ } : ae
219
201
  }
220
- }), W = n.useMemo(() => {
221
- const e = he(S.reference, v.reference, A.reference, ie.reference, te);
222
- return f && (e.id = f), e;
223
- }, [ie.reference, S.reference, v.reference, A.reference, te, f]), J = n.useMemo(() => he(Lt, S.floating, v.floating, A.floating), [S.floating, v.floating, A.floating]), ae = v.item ?? dt;
224
- at(() => {
225
- r.update({
226
- popupProps: J,
227
- triggerProps: W
228
- });
229
- }), P(() => {
230
- r.update({
231
- id: f,
232
- modal: F,
233
- multiple: s,
234
- value: t,
235
- open: l,
236
- mounted: _,
237
- transitionStatus: k,
238
- popupProps: J,
239
- triggerProps: W,
240
- items: U,
241
- itemToStringLabel: b,
242
- itemToStringValue: a,
243
- isItemEqualToValue: g,
244
- openMethod: ne
245
- });
246
- }, [r, f, F, s, t, l, _, k, J, W, U, b, a, g, ne]);
247
- const Ze = n.useMemo(() => ({
248
- store: r,
249
- name: d,
250
- required: T,
251
- disabled: c,
252
- readOnly: p,
253
- multiple: s,
254
- highlightItemOnHover: H,
255
- setValue: V,
256
- setOpen: z,
257
- listRef: q,
258
- popupRef: j,
259
- scrollHandlerRef: De,
260
- handleScrollArrowVisibility: le,
261
- scrollArrowsMountedCountRef: je,
262
- itemProps: ae,
263
- valueRef: Ne,
264
- valuesRef: h,
265
- labelsRef: D,
266
- typingRef: Z,
267
- selectionRef: ke,
268
- firstItemTextRef: _e,
269
- selectedItemTextRef: N,
270
- validation: y,
271
- onOpenChangeComplete: L,
272
- alignItemWithTriggerActiveRef: Ye,
273
- initialValueRef: se
274
- }), [r, d, T, c, p, s, H, V, z, ae, y, L, le]), et = lt(Se, y.inputRef), tt = s && Array.isArray(t) && t.length > 0, ue = s ? void 0 : d, rt = n.useMemo(() => !s || !Array.isArray(t) || !d ? null : t.map((e) => {
275
- const o = I(e, a);
276
- return /* @__PURE__ */ w.jsx("input", {
277
- type: "hidden",
278
- form: O,
279
- name: d,
280
- value: o,
281
- disabled: c
282
- }, o);
283
- }), [s, t, O, d, a, c]);
284
- return /* @__PURE__ */ w.jsx(mt.Provider, {
285
- value: Ze,
286
- children: /* @__PURE__ */ w.jsxs(pt.Provider, {
287
- value: x,
288
- children: [Pe, /* @__PURE__ */ w.jsx("input", {
289
- ...y.getValidationProps(c, {
290
- onFocus() {
291
- r.state.triggerElement?.focus({
292
- // Supported in Chrome from 144 (January 2026)
293
- focusVisible: !0
294
- });
295
- },
296
- // Handle browser autofill.
297
- onChange(e) {
298
- if (e.nativeEvent.defaultPrevented || c || p)
299
- return;
300
- const o = e.currentTarget.value, u = pe(Ht, e.nativeEvent);
301
- function i() {
302
- if (s)
303
- return;
304
- const m = o.toLowerCase();
305
- let R = h.current.findIndex(($) => I($, a).toLowerCase() === m || vt($, b).toLowerCase() === m);
306
- R === -1 && (R = h.current.findIndex(($, ot) => {
307
- const fe = D.current[ot];
308
- return fe != null && fe.toLowerCase() === m;
309
- }));
310
- const ce = R === -1 ? void 0 : h.current[R];
311
- ce != null && V(ce, u);
312
- }
313
- r.set("forceMount", !0), queueMicrotask(i);
314
- }
315
- }),
316
- id: f && ue == null ? `${f}-hidden-input` : void 0,
317
- form: O,
318
- name: ue,
319
- autoComplete: Ve,
320
- value: $e,
321
- disabled: c,
322
- required: T && !tt,
323
- readOnly: p,
324
- ref: et,
325
- style: d ? nt : st,
326
- tabIndex: -1,
327
- "aria-hidden": !0,
328
- suppressHydrationWarning: !0
329
- }), rt]
330
- })
202
+ }, jt = ce("div", o, {
203
+ ref: [F, p],
204
+ state: Yt,
205
+ stateAttributesMapping: Re,
206
+ props: [Wt, zt, ge(gt), {
207
+ className: !w && s ? Rt.className : void 0
208
+ }, vt]
331
209
  });
210
+ return /* @__PURE__ */ Ht.jsxs(M.Fragment, {
211
+ children: [!Nt && Rt.getElement(Dt), /* @__PURE__ */ Ht.jsx(ye, {
212
+ context: Lt,
213
+ modal: !1,
214
+ disabled: !Vt,
215
+ openInteractionType: $t,
216
+ returnFocus: Mt,
217
+ restoreFocus: !0,
218
+ children: jt
219
+ })]
220
+ });
221
+ });
222
+ process.env.NODE_ENV !== "production" && (Ce.displayName = "SelectPopup");
223
+ function Et(n) {
224
+ const o = n.maxHeight || "";
225
+ return o.endsWith("px") && parseFloat(o) || 1 / 0;
226
+ }
227
+ function X(n) {
228
+ return fe(n.scrollHeight, n.clientHeight);
229
+ }
230
+ function Pt(n) {
231
+ return xe.getScale(n);
232
+ }
233
+ function j(n, o, F) {
234
+ return n / F[o];
235
+ }
236
+ function Z(n, o) {
237
+ return Jt({
238
+ x: j(n.x, "x", o),
239
+ y: j(n.y, "y", o),
240
+ width: j(n.width, "x", o),
241
+ height: j(n.height, "y", o)
242
+ });
243
+ }
244
+ const bt = [["transform", "none"], ["scale", "1"], ["translate", "0 0"]];
245
+ function He(n) {
246
+ const {
247
+ style: o
248
+ } = n, F = {};
249
+ for (const [y, A] of bt)
250
+ F[y] = o.getPropertyValue(y), o.setProperty(y, A, "important");
251
+ return () => {
252
+ for (const [y] of bt) {
253
+ const A = F[y];
254
+ A ? o.setProperty(y, A) : o.removeProperty(y);
255
+ }
256
+ };
332
257
  }
333
258
  export {
334
- Cr as SelectRoot
259
+ Ce as SelectPopup
335
260
  };
336
261
  //# sourceMappingURL=index49.js.map