@koide-labs/ui 0.0.15 → 0.1.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 (310) hide show
  1. package/dist/-utils.d.ts +2 -2
  2. package/dist/-utils.js +1 -1
  3. package/dist/{Button-DrPFFzo7.js → Button-BmcVHRRW.js} +2 -2
  4. package/dist/{CompositeRoot-CVk5a-pR.js → CompositeRoot-CCgh2M64.js} +6 -6
  5. package/dist/{FloatingPortal-tWyuKRSN.js → FloatingPortal-BQsQhvIr.js} +27 -27
  6. package/dist/{FloatingPortalLite-DVyq6YhV.js → FloatingPortalLite-_ECdFE7b.js} +1 -1
  7. package/dist/{InternalBackdrop-jYAiOJ8v.js → InternalBackdrop-BSMKU-hc.js} +13 -13
  8. package/dist/{LabelableContext-BMvjVwor.js → LabelableContext-Be1u-eFg.js} +2 -2
  9. package/dist/accordion.css +1 -0
  10. package/dist/alert-dialog.css +1 -0
  11. package/dist/anchor.css +1 -0
  12. package/dist/avatar.css +1 -0
  13. package/dist/badge.css +1 -0
  14. package/dist/button.css +1 -0
  15. package/dist/checkbox.css +1 -0
  16. package/dist/code.css +1 -0
  17. package/dist/collapse.css +1 -0
  18. package/dist/command.css +1 -0
  19. package/dist/components/accordion/accordion.d.ts +19 -0
  20. package/dist/components/accordion/accordion.js +701 -0
  21. package/dist/components/accordion/index.d.ts +1 -12
  22. package/dist/components/accordion/index.js +2 -697
  23. package/dist/components/alert-dialog/alert-dialog.d.ts +36 -0
  24. package/dist/components/alert-dialog/alert-dialog.js +138 -0
  25. package/dist/components/alert-dialog/index.d.ts +1 -26
  26. package/dist/components/alert-dialog/index.js +2 -134
  27. package/dist/components/anchor/anchor.d.ts +12 -0
  28. package/dist/components/anchor/anchor.js +21 -0
  29. package/dist/components/anchor/index.d.ts +1 -8
  30. package/dist/components/anchor/index.js +2 -19
  31. package/dist/components/avatar/avatar.d.ts +25 -0
  32. package/dist/components/avatar/avatar.js +161 -0
  33. package/dist/components/avatar/index.d.ts +1 -21
  34. package/dist/components/avatar/index.js +2 -159
  35. package/dist/components/badge/badge.d.ts +20 -0
  36. package/dist/components/badge/badge.js +42 -0
  37. package/dist/components/badge/index.d.ts +1 -16
  38. package/dist/components/badge/index.js +2 -40
  39. package/dist/components/button/button.d.ts +27 -0
  40. package/dist/components/button/button.js +47 -0
  41. package/dist/components/button/index.d.ts +1 -24
  42. package/dist/components/button/index.js +2 -45
  43. package/dist/components/checkbox/checkbox.d.ts +13 -0
  44. package/dist/components/checkbox/checkbox.js +269 -0
  45. package/dist/components/checkbox/index.d.ts +1 -9
  46. package/dist/components/checkbox/index.js +2 -267
  47. package/dist/components/code/code.d.ts +13 -0
  48. package/dist/components/code/code.js +1206 -0
  49. package/dist/components/code/index.d.ts +1 -9
  50. package/dist/components/code/index.js +2 -1204
  51. package/dist/components/collapse/collapse.d.ts +14 -0
  52. package/dist/components/collapse/collapse.js +35 -0
  53. package/dist/components/collapse/index.d.ts +1 -11
  54. package/dist/components/collapse/index.js +2 -33
  55. package/dist/components/command/command.d.ts +36 -0
  56. package/dist/components/command/command.js +1695 -0
  57. package/dist/components/command/index.d.ts +1 -15
  58. package/dist/components/command/index.js +2 -1693
  59. package/dist/components/context-menu/context-menu.d.ts +82 -0
  60. package/dist/components/context-menu/context-menu.js +1445 -0
  61. package/dist/components/context-menu/index.d.ts +1 -42
  62. package/dist/components/context-menu/index.js +2 -1442
  63. package/dist/components/dialog/dialog.d.ts +22 -0
  64. package/dist/components/dialog/dialog.js +140 -0
  65. package/dist/components/dialog/dialog.types.d.ts +38 -0
  66. package/dist/components/dialog/index.d.ts +1 -48
  67. package/dist/components/dialog/index.js +2 -136
  68. package/dist/components/heading/heading.d.ts +25 -0
  69. package/dist/components/heading/heading.js +36 -0
  70. package/dist/components/heading/index.d.ts +1 -44
  71. package/dist/components/heading/index.js +2 -49
  72. package/dist/components/icon/icon.d.ts +28 -0
  73. package/dist/components/icon/icon.js +43 -0
  74. package/dist/components/icon/{icon-names.d.ts → icon.types.d.ts} +4 -0
  75. package/dist/components/icon/icon.types.js +1 -0
  76. package/dist/components/icon/index.d.ts +2 -24
  77. package/dist/components/icon/index.js +2 -41
  78. package/dist/components/icon-button/icon-button.d.ts +16 -0
  79. package/dist/components/icon-button/icon-button.js +46 -0
  80. package/dist/components/icon-button/index.d.ts +1 -12
  81. package/dist/components/icon-button/index.js +2 -44
  82. package/dist/components/inline-code/index.d.ts +1 -6
  83. package/dist/components/inline-code/index.js +2 -20
  84. package/dist/components/inline-code/inline-code.d.ts +10 -0
  85. package/dist/components/inline-code/inline-code.js +25 -0
  86. package/dist/components/input/index.d.ts +1 -3
  87. package/dist/components/input/index.js +2 -117
  88. package/dist/components/input/input.d.ts +9 -0
  89. package/dist/components/input/input.js +126 -0
  90. package/dist/components/meter/index.d.ts +1 -18
  91. package/dist/components/meter/index.js +2 -163
  92. package/dist/components/meter/meter.d.ts +22 -0
  93. package/dist/components/meter/meter.js +165 -0
  94. package/dist/components/multiline-input/index.d.ts +1 -6
  95. package/dist/components/multiline-input/index.js +2 -98
  96. package/dist/components/multiline-input/multiline-input.d.ts +10 -0
  97. package/dist/components/multiline-input/multiline-input.js +100 -0
  98. package/dist/components/number-input/index.d.ts +1 -10
  99. package/dist/components/number-input/index.js +2 -1167
  100. package/dist/components/number-input/number-input.d.ts +14 -0
  101. package/dist/components/number-input/number-input.js +1169 -0
  102. package/dist/components/password-input/index.d.ts +1 -2
  103. package/dist/components/password-input/index.js +2 -27
  104. package/dist/components/password-input/password-input.d.ts +7 -0
  105. package/dist/components/password-input/password-input.js +29 -0
  106. package/dist/components/pill/index.d.ts +1 -13
  107. package/dist/components/pill/index.js +2 -36
  108. package/dist/components/pill/pill.d.ts +17 -0
  109. package/dist/components/pill/pill.js +38 -0
  110. package/dist/components/popover/index.d.ts +1 -21
  111. package/dist/components/popover/index.js +2 -634
  112. package/dist/components/popover/popover.d.ts +22 -0
  113. package/dist/components/popover/popover.js +634 -0
  114. package/dist/components/preview-card/index.d.ts +1 -17
  115. package/dist/components/preview-card/index.js +2 -400
  116. package/dist/components/preview-card/preview-card.d.ts +21 -0
  117. package/dist/components/preview-card/preview-card.js +402 -0
  118. package/dist/components/radio-group/index.d.ts +1 -0
  119. package/dist/components/radio-group/index.js +5 -0
  120. package/dist/components/radio-group/radio-group.d.ts +25 -0
  121. package/dist/components/{radio/index.js → radio-group/radio-group.js} +91 -90
  122. package/dist/components/search-bar/index.d.ts +1 -12
  123. package/dist/components/search-bar/index.js +2 -46
  124. package/dist/components/search-bar/search-bar.d.ts +16 -0
  125. package/dist/components/search-bar/search-bar.js +43 -0
  126. package/dist/components/select/index.d.ts +1 -16
  127. package/dist/components/select/index.js +2 -1261
  128. package/dist/components/select/select.d.ts +22 -0
  129. package/dist/components/select/select.js +1263 -0
  130. package/dist/components/separator/index.d.ts +1 -7
  131. package/dist/components/separator/index.js +2 -4
  132. package/dist/components/separator/separator.d.ts +10 -0
  133. package/dist/components/separator/separator.js +6 -0
  134. package/dist/components/slider/index.d.ts +1 -5
  135. package/dist/components/slider/index.js +2 -900
  136. package/dist/components/slider/slider.d.ts +10 -0
  137. package/dist/components/slider/slider.js +899 -0
  138. package/dist/components/spinner/index.d.ts +1 -2
  139. package/dist/components/spinner/index.js +2 -11
  140. package/dist/components/spinner/spinner.d.ts +7 -0
  141. package/dist/components/spinner/spinner.js +13 -0
  142. package/dist/components/stacked-avatars/index.d.ts +1 -14
  143. package/dist/components/stacked-avatars/index.js +2 -90
  144. package/dist/components/stacked-avatars/stacked-avatars.d.ts +18 -0
  145. package/dist/components/stacked-avatars/stacked-avatars.js +92 -0
  146. package/dist/components/status-banner/index.d.ts +1 -17
  147. package/dist/components/status-banner/index.js +2 -69
  148. package/dist/components/status-banner/status-banner.d.ts +22 -0
  149. package/dist/components/status-banner/status-banner.js +71 -0
  150. package/dist/components/surface/index.d.ts +2 -27
  151. package/dist/components/surface/index.js +2 -39
  152. package/dist/components/surface/surface.d.ts +26 -0
  153. package/dist/components/surface/surface.js +36 -0
  154. package/dist/components/surface/surface.types.d.ts +1 -0
  155. package/dist/components/surface/surface.types.js +1 -0
  156. package/dist/components/switch/index.d.ts +1 -5
  157. package/dist/components/switch/index.js +2 -194
  158. package/dist/components/switch/switch.d.ts +10 -0
  159. package/dist/components/switch/switch.js +193 -0
  160. package/dist/components/tabs/index.d.ts +1 -18
  161. package/dist/components/tabs/index.js +2 -507
  162. package/dist/components/tabs/tabs.d.ts +28 -0
  163. package/dist/components/tabs/tabs.js +511 -0
  164. package/dist/components/text/index.d.ts +1 -26
  165. package/dist/components/text/index.js +2 -46
  166. package/dist/components/text/text.d.ts +29 -0
  167. package/dist/components/text/text.js +48 -0
  168. package/dist/components/theme-provider/index.d.ts +1 -1
  169. package/dist/components/theme-provider/theme-provider.d.ts +8 -4
  170. package/dist/components/theme-provider/theme-provider.js +3 -3
  171. package/dist/components/timestamp/index.d.ts +1 -23
  172. package/dist/components/timestamp/index.js +2 -1390
  173. package/dist/components/timestamp/timestamp.d.ts +26 -0
  174. package/dist/components/timestamp/timestamp.js +1391 -0
  175. package/dist/components/toaster/index.d.ts +2 -0
  176. package/dist/components/toaster/index.js +7 -0
  177. package/dist/components/toaster/toaster.d.ts +7 -0
  178. package/dist/components/toaster/toaster.js +923 -0
  179. package/dist/components/{toast → toaster}/use-toast-manager.d.ts +3 -3
  180. package/dist/components/tooltip/index.d.ts +1 -14
  181. package/dist/components/tooltip/index.js +2 -710
  182. package/dist/components/tooltip/tooltip.d.ts +24 -0
  183. package/dist/components/tooltip/tooltip.js +9 -0
  184. package/dist/components/view/index.d.ts +2 -30
  185. package/dist/components/view/index.js +2 -79
  186. package/dist/components/view/view.d.ts +31 -0
  187. package/dist/components/view/view.js +83 -0
  188. package/dist/components/view/view.types.d.ts +5 -0
  189. package/dist/components/view/view.types.js +1 -0
  190. package/dist/components/visually-hidden/index.d.ts +5 -1
  191. package/dist/{composite-Bx7Szd_T.js → composite-BZzP-LlG.js} +3 -3
  192. package/dist/{composite-C9L5QmZL.js → composite-BwEK5cWH.js} +1 -1
  193. package/dist/context-menu.css +1 -0
  194. package/dist/{createBaseUIEventDetails-D8M2Yl-a.js → createBaseUIEventDetails-CCSfZ2vM.js} +7 -7
  195. package/dist/{detectBrowser-I-s3yzIE.js → detectBrowser-Bl8Ki_1I.js} +2 -2
  196. package/dist/dialog.css +1 -1
  197. package/dist/{dialog.module-BeF-6XAo.js → dialog.module-DsbQRp-d.js} +55 -55
  198. package/dist/{element-CZEOj04G.js → element-u5WgOZX1.js} +7 -7
  199. package/dist/{event-CKoGyQEJ.js → event-B89-Ng5h.js} +4 -4
  200. package/dist/{floating-ui.utils-C7pRWMZ_.js → floating-ui.utils-DUVaIF3G.js} +7 -7
  201. package/dist/{floating-ui.utils.dom-C7FS5id0.js → floating-ui.utils.dom-cbi420Pg.js} +4 -4
  202. package/dist/{getDisabledMountTransitionStyles-YfHPge6T.js → getDisabledMountTransitionStyles-E2x-_lte.js} +7 -7
  203. package/dist/heading.css +1 -0
  204. package/dist/icon-button.css +1 -0
  205. package/dist/icon.css +1 -0
  206. package/dist/index.d.ts +10 -10
  207. package/dist/index.js +86 -104
  208. package/dist/{inertValue-BCYGsdmf.js → inertValue-BTpPjX30.js} +1 -1
  209. package/dist/inline-code.css +1 -0
  210. package/dist/input.css +1 -1
  211. package/dist/input.module-CtE19OH8.js +8 -0
  212. package/dist/integrations/react-markdown/index.js +12 -12
  213. package/dist/meter.css +1 -0
  214. package/dist/number-input.css +1 -0
  215. package/dist/password-input.css +1 -0
  216. package/dist/pill.css +1 -0
  217. package/dist/popover.css +1 -0
  218. package/dist/preview-card.css +1 -0
  219. package/dist/radio-group.css +1 -0
  220. package/dist/safePolygon-DnkzOIur.js +558 -0
  221. package/dist/search-bar.css +1 -0
  222. package/dist/select.css +1 -0
  223. package/dist/{index-DVjyPAD4.js → separator-fh_wDZNf.js} +7 -11
  224. package/dist/separator.css +1 -0
  225. package/dist/slider.css +1 -0
  226. package/dist/spinner.css +1 -0
  227. package/dist/stacked-avatars.css +1 -0
  228. package/dist/status-banner.css +1 -0
  229. package/dist/styles/core.css +1 -1
  230. package/dist/surface.css +1 -0
  231. package/dist/switch.css +1 -0
  232. package/dist/tabs.css +1 -0
  233. package/dist/text.css +1 -0
  234. package/dist/timestamp.css +1 -0
  235. package/dist/toaster.css +1 -0
  236. package/dist/tooltip-oCp-elli.js +765 -0
  237. package/dist/tooltip.css +1 -0
  238. package/dist/transitions.css +1 -1
  239. package/dist/{transitions.module-CWX8e5cx.js → transitions.module-D9mMAtfI.js} +11 -11
  240. package/dist/{useAnimationFrame-451ugS_6.js → useAnimationFrame-DvK1s63A.js} +1 -1
  241. package/dist/{useButton-DfIwsdb8.js → useButton-d3_JgBNr.js} +3 -3
  242. package/dist/{useCompositeListItem-OkcAim_1.js → useCompositeListItem-CZp9WTnF.js} +2 -2
  243. package/dist/{useLabelableId-Ci_jDvmv.js → useLabelableId-CX4tcfzK.js} +3 -3
  244. package/dist/{useOpenChangeComplete-Dse9kY9E.js → useOpenChangeComplete-BHd-N7Ig.js} +5 -5
  245. package/dist/{useRender-CLx7dR_1.js → useRender-C3vlzS3t.js} +1 -1
  246. package/dist/{useRenderElement-DwToLA61.js → useRenderElement-DngNDu_P.js} +2 -2
  247. package/dist/{useRole-oDBdbuwQ.js → useRole-BD3OL1rr.js} +3 -3
  248. package/dist/{useStableCallback-CkTrVkNX.js → useStableCallback-DKZHlUAT.js} +1 -1
  249. package/dist/{useSyncedFloatingRootContext-Dorsv-jf.js → useSyncedFloatingRootContext-BB1vwkV-.js} +20 -20
  250. package/dist/{useTimeout-CflX-kz3.js → useTimeout-BNni6aw5.js} +1 -1
  251. package/dist/{useTransitionStatus-CUfcuGAV.js → useTransitionStatus-CmMyUh74.js} +1 -1
  252. package/dist/{useTypeahead-D85V2IUx.js → useTypeahead-BiL5IAVb.js} +11 -11
  253. package/dist/{useValueAsRef-HURLzret.js → useValueAsRef-B4EriRsI.js} +1 -1
  254. package/dist/{useValueChanged-DL757-yD.js → useValueChanged-MJRmEWz1.js} +1 -1
  255. package/dist/view.css +1 -1
  256. package/dist/view.module-Dj7wj0kk.js +6 -0
  257. package/dist/view2.css +1 -0
  258. package/package.json +1 -1
  259. package/dist/components/radio/index.d.ts +0 -13
  260. package/dist/components/toast/index.d.ts +0 -2
  261. package/dist/components/toast/index.js +0 -8
  262. package/dist/components/toast/toast.d.ts +0 -2
  263. package/dist/components/toast/toast.js +0 -921
  264. package/dist/components/tooltip/tooltip-arrow.d.ts +0 -3
  265. package/dist/components/tooltip/tooltip-arrow.js +0 -6
  266. package/dist/index10.css +0 -1
  267. package/dist/index11.css +0 -1
  268. package/dist/index12.css +0 -1
  269. package/dist/index13.css +0 -1
  270. package/dist/index14.css +0 -1
  271. package/dist/index15.css +0 -1
  272. package/dist/index16.css +0 -1
  273. package/dist/index17.css +0 -1
  274. package/dist/index18.css +0 -1
  275. package/dist/index19.css +0 -1
  276. package/dist/index20.css +0 -1
  277. package/dist/index21.css +0 -1
  278. package/dist/index22.css +0 -1
  279. package/dist/index23.css +0 -1
  280. package/dist/index24.css +0 -1
  281. package/dist/index25.css +0 -1
  282. package/dist/index26.css +0 -1
  283. package/dist/index27.css +0 -1
  284. package/dist/index28.css +0 -1
  285. package/dist/index29.css +0 -1
  286. package/dist/index3.css +0 -1
  287. package/dist/index30.css +0 -1
  288. package/dist/index31.css +0 -1
  289. package/dist/index32.css +0 -1
  290. package/dist/index33.css +0 -1
  291. package/dist/index34.css +0 -1
  292. package/dist/index35.css +0 -1
  293. package/dist/index36.css +0 -1
  294. package/dist/index37.css +0 -1
  295. package/dist/index4.css +0 -1
  296. package/dist/index5.css +0 -1
  297. package/dist/index6.css +0 -1
  298. package/dist/index7.css +0 -1
  299. package/dist/index8.css +0 -1
  300. package/dist/index9.css +0 -1
  301. package/dist/input.module-DDQY_Ij6.js +0 -7
  302. package/dist/safePolygon-DWy1dGKJ.js +0 -308
  303. package/dist/toast.css +0 -1
  304. package/dist/tooltip-arrow-cs6vjjqZ.js +0 -24
  305. package/dist/tooltip-arrow.css +0 -1
  306. package/dist/useHoverReferenceInteraction-SfOBPoXM.js +0 -264
  307. package/dist/usePopupAutoResize-CNR6Ekmx.js +0 -85
  308. package/dist/view.module-DfDLgJE0.js +0 -6
  309. /package/dist/components/{icon/icon-names.js → dialog/dialog.types.js} +0 -0
  310. /package/dist/components/{toast → toaster}/use-toast-manager.js +0 -0
@@ -0,0 +1,899 @@
1
+ import { jsx as be, jsxs as Je } from "react/jsx-runtime";
2
+ import { c as Ct } from "../../clsx-OuTLNxxd.js";
3
+ import { View as Pt } from "../view/view.js";
4
+ import * as a from "react";
5
+ import { o as Ne } from "../../owner-rKN292Q9.js";
6
+ import { u as _t } from "../../useControlled-Du4sJyMj.js";
7
+ import { u as H } from "../../useStableCallback-DKZHlUAT.js";
8
+ import { u as Qe } from "../../useValueAsRef-B4EriRsI.js";
9
+ import { u as He } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
10
+ import { w as Nt } from "../../warn-CKtX8MLJ.js";
11
+ import { c as we, n as wt, g as Ze, k as Et, m as Vt, r as At, u as Ge } from "../../createBaseUIEventDetails-CCSfZ2vM.js";
12
+ import { u as Tt } from "../../useValueChanged-MJRmEWz1.js";
13
+ import { u as Ue } from "../../useBaseUiId-B7WyxtIE.js";
14
+ import { u as Ee, m as Mt, d as Ot } from "../../useRenderElement-DngNDu_P.js";
15
+ import { c as ue } from "../../clamp-D0KDAQIz.js";
16
+ import { C as Ft, u as Bt } from "../../useCompositeListItem-CZp9WTnF.js";
17
+ import { c as Dt, a as et, u as Lt, b as kt } from "../../LabelableContext-Be1u-eFg.js";
18
+ import { f as $t } from "../../formatErrorMessage-BqPuTBN-.js";
19
+ import { d as tt, f as zt } from "../../element-u5WgOZX1.js";
20
+ import { a as qe } from "../../floating-ui.utils.dom-cbi420Pg.js";
21
+ import { u as qt } from "../../useAnimationFrame-DvK1s63A.js";
22
+ import { u as nt } from "../../DirectionContext-C2o_MF_i.js";
23
+ import { u as rt } from "../../useOnMount-VRW6CK2u.js";
24
+ import { v as We } from "../../valueToPercent-DaP9qN4u.js";
25
+ import { v as je } from "../../visuallyHidden-CpJ-mhai.js";
26
+ import { f as De } from "../../formatNumber-1UNwjeqf.js";
27
+ import { C as Ht, H as ot, E as it, d as st, b as at, c as ut, e as lt } from "../../composite-BwEK5cWH.js";
28
+ import { u as Ut } from "../../useLabelableId-CX4tcfzK.js";
29
+ import '../../slider.css';function ct(e, t, r = (i, o) => i === o) {
30
+ return e.length === t.length && e.every((i, o) => r(i, t[o]));
31
+ }
32
+ function dt(e, t) {
33
+ return e - t;
34
+ }
35
+ function Wt(e, t, r) {
36
+ const i = e.slice();
37
+ return i[t] = r, i.sort(dt);
38
+ }
39
+ function ft(e, t, r, i, o, l) {
40
+ let u = e;
41
+ return u = ue(u, r, i), o && (u = Wt(
42
+ l,
43
+ t,
44
+ // Bound the new value to the thumb's neighbours.
45
+ ue(u, l[t - 1] || -1 / 0, l[t + 1] || 1 / 0)
46
+ )), u;
47
+ }
48
+ function mt(e, t, r) {
49
+ if (!Array.isArray(e))
50
+ return !0;
51
+ const i = e.reduce((o, l, u, g) => (u === g.length - 1 || o.push(Math.abs(l - g[u + 1])), o), []);
52
+ return Math.min(...i) >= t * r;
53
+ }
54
+ const Ve = {
55
+ activeThumbIndex: () => null,
56
+ max: () => null,
57
+ min: () => null,
58
+ minStepsBetweenValues: () => null,
59
+ step: () => null,
60
+ values: () => null
61
+ }, Ke = /* @__PURE__ */ a.createContext(void 0);
62
+ process.env.NODE_ENV !== "production" && (Ke.displayName = "SliderRootContext");
63
+ function Le() {
64
+ const e = a.useContext(Ke);
65
+ if (e === void 0)
66
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SliderRootContext is missing. Slider parts must be placed within <Slider.Root>." : $t(62));
67
+ return e;
68
+ }
69
+ function Kt(e) {
70
+ return "key" in e ? Et : Vt;
71
+ }
72
+ function Yt(e, t) {
73
+ return typeof e == "number" && typeof t == "number" ? e === t : Array.isArray(e) && Array.isArray(t) ? ct(e, t) : !1;
74
+ }
75
+ const pt = /* @__PURE__ */ a.forwardRef(function(t, r) {
76
+ const {
77
+ "aria-labelledby": i,
78
+ className: o,
79
+ defaultValue: l,
80
+ disabled: u = !1,
81
+ id: g,
82
+ format: p,
83
+ largeStep: w = 10,
84
+ locale: h,
85
+ render: U,
86
+ max: E = 100,
87
+ min: m = 0,
88
+ minStepsBetweenValues: s = 0,
89
+ name: V,
90
+ onValueChange: x,
91
+ onValueCommitted: P,
92
+ orientation: y = "horizontal",
93
+ step: M = 1,
94
+ thumbCollisionBehavior: te = "push",
95
+ thumbAlignment: ne = "center",
96
+ value: re,
97
+ ...Re
98
+ } = t, le = Ue(g), W = H(x), ce = H(P), {
99
+ clearErrors: z
100
+ } = Dt(), {
101
+ state: q,
102
+ disabled: K,
103
+ name: S,
104
+ setTouched: Y,
105
+ setDirty: A,
106
+ validityData: R,
107
+ shouldValidateOnChange: _,
108
+ validation: B
109
+ } = et(), {
110
+ labelId: oe
111
+ } = Lt(), X = i ?? oe, G = K || u, de = S ?? V, [C, Ie] = _t({
112
+ controlled: re,
113
+ default: l ?? m,
114
+ name: "Slider"
115
+ }), ie = a.useRef(null), he = a.useRef(null), O = a.useRef([]), F = a.useRef(null), fe = a.useRef(null), ye = a.useRef(-1), D = a.useRef(null), L = a.useRef(null), se = a.useRef("none"), n = Qe(p), [f, c] = a.useState(-1), [b, d] = a.useState(-1), [$, me] = a.useState(!1), [J, ge] = a.useState(() => /* @__PURE__ */ new Map()), [Pe, Se] = a.useState([void 0, void 0]), I = H((v) => {
116
+ c(v), v !== -1 && d(v);
117
+ });
118
+ kt({
119
+ id: le,
120
+ commit: B.commit,
121
+ value: C,
122
+ controlRef: he,
123
+ name: de,
124
+ getValue: () => C
125
+ }), Tt(C, () => {
126
+ z(de), _() ? B.commit(C) : B.commit(C, !0);
127
+ const v = R.initialValue;
128
+ let pe;
129
+ Array.isArray(C) && Array.isArray(v) ? pe = !ct(C, v) : pe = C !== v, A(pe);
130
+ });
131
+ const xe = H((v) => {
132
+ v && (he.current = v);
133
+ }), Q = Array.isArray(C), Z = a.useMemo(() => Q ? C.slice().sort(dt) : [ue(C, m, E)], [E, m, Q, C]), j = H((v, pe) => {
134
+ if (Number.isNaN(v) || Yt(v, C))
135
+ return;
136
+ const ae = pe ?? we(wt, void 0, void 0, {
137
+ activeThumbIndex: -1
138
+ });
139
+ se.current = ae.reason;
140
+ const ve = new event.constructor(event.type, event);
141
+ Object.defineProperty(ve, "target", {
142
+ writable: !0,
143
+ value: {
144
+ value: v,
145
+ name: de
146
+ }
147
+ }), ae.event = ve, L.current = v, W(v, ae), !ae.isCanceled && Ie(v);
148
+ }), Ce = H((v, pe, ae) => {
149
+ const ve = ft(v, pe, m, E, Q, Z);
150
+ if (mt(ve, M, s)) {
151
+ const Te = Kt(ae);
152
+ j(ve, we(Te, ae.nativeEvent, void 0, {
153
+ activeThumbIndex: pe
154
+ })), Y(!0);
155
+ const Ye = L.current ?? ve;
156
+ ce(Ye, Ze(Te, ae.nativeEvent));
157
+ }
158
+ });
159
+ process.env.NODE_ENV !== "production" && m >= E && Nt("Slider `max` must be greater than `min`."), He(() => {
160
+ const v = tt(Ne(ie.current));
161
+ G && v && ie.current?.contains(v) && v.blur();
162
+ }, [G]), G && f !== -1 && I(-1);
163
+ const ee = a.useMemo(() => ({
164
+ ...q,
165
+ activeThumbIndex: f,
166
+ disabled: G,
167
+ dragging: $,
168
+ orientation: y,
169
+ max: E,
170
+ min: m,
171
+ minStepsBetweenValues: s,
172
+ step: M,
173
+ values: Z
174
+ }), [q, f, G, $, E, m, s, y, M, Z]), ke = a.useMemo(() => ({
175
+ active: f,
176
+ controlRef: he,
177
+ disabled: G,
178
+ dragging: $,
179
+ validation: B,
180
+ formatOptionsRef: n,
181
+ handleInputChange: Ce,
182
+ indicatorPosition: Pe,
183
+ inset: ne !== "center",
184
+ labelId: X,
185
+ largeStep: w,
186
+ lastUsedThumbIndex: b,
187
+ lastChangedValueRef: L,
188
+ lastChangeReasonRef: se,
189
+ locale: h,
190
+ max: E,
191
+ min: m,
192
+ minStepsBetweenValues: s,
193
+ name: de,
194
+ onValueCommitted: ce,
195
+ orientation: y,
196
+ pressedInputRef: F,
197
+ pressedThumbCenterOffsetRef: fe,
198
+ pressedThumbIndexRef: ye,
199
+ pressedValuesRef: D,
200
+ registerFieldControlRef: xe,
201
+ renderBeforeHydration: ne === "edge",
202
+ setActive: I,
203
+ setDragging: me,
204
+ setIndicatorPosition: Se,
205
+ setValue: j,
206
+ state: ee,
207
+ step: M,
208
+ thumbCollisionBehavior: te,
209
+ thumbMap: J,
210
+ thumbRefs: O,
211
+ values: Z
212
+ }), [f, he, X, G, $, B, n, Ce, Pe, w, b, L, se, h, E, m, s, de, ce, y, F, fe, ye, D, xe, I, me, Se, j, ee, M, te, ne, J, O, Z]), Ae = Ee("div", t, {
213
+ state: ee,
214
+ ref: [r, ie],
215
+ props: [{
216
+ "aria-labelledby": X,
217
+ id: le,
218
+ role: "group"
219
+ }, B.getValidationProps, Re],
220
+ stateAttributesMapping: Ve
221
+ });
222
+ return /* @__PURE__ */ be(Ke.Provider, {
223
+ value: ke,
224
+ children: /* @__PURE__ */ be(Ft, {
225
+ elementsRef: O,
226
+ onMapChange: ge,
227
+ children: Ae
228
+ })
229
+ });
230
+ });
231
+ process.env.NODE_ENV !== "production" && (pt.displayName = "SliderRoot");
232
+ function ht(e) {
233
+ const t = e.getBoundingClientRect();
234
+ return {
235
+ x: (t.left + t.right) / 2,
236
+ y: (t.top + t.bottom) / 2
237
+ };
238
+ }
239
+ function Gt(e) {
240
+ if (Math.abs(e) < 1) {
241
+ const r = e.toExponential().split("e-"), i = r[0].split(".")[1];
242
+ return (i ? i.length : 0) + parseInt(r[1], 10);
243
+ }
244
+ const t = e.toString().split(".")[1];
245
+ return t ? t.length : 0;
246
+ }
247
+ function gt(e, t, r) {
248
+ const i = Math.round((e - r) / t) * t + r;
249
+ return Number(i.toFixed(Gt(t)));
250
+ }
251
+ function Xe({
252
+ values: e,
253
+ index: t,
254
+ nextValue: r,
255
+ min: i,
256
+ max: o,
257
+ step: l,
258
+ minStepsBetweenValues: u,
259
+ initialValues: g
260
+ }) {
261
+ if (e.length === 0)
262
+ return [];
263
+ const p = e.slice(), w = l * u, h = p.length - 1, U = g ?? e, E = i + t * w, m = o - (h - t) * w;
264
+ p[t] = ue(r, E, m);
265
+ for (let s = t + 1; s <= h; s += 1) {
266
+ const V = p[s - 1] + w, x = o - (h - s) * w, P = U[s] ?? p[s];
267
+ let y = Math.max(p[s], V);
268
+ P < y && (y = Math.max(P, V)), p[s] = ue(y, V, x);
269
+ }
270
+ for (let s = t - 1; s >= 0; s -= 1) {
271
+ const V = p[s + 1] - w, x = i + s * w, P = U[s] ?? p[s];
272
+ let y = Math.min(p[s], V);
273
+ P > y && (y = Math.min(P, V)), p[s] = ue(y, x, V);
274
+ }
275
+ for (let s = 0; s <= h; s += 1)
276
+ p[s] = Number(p[s].toFixed(12));
277
+ return p;
278
+ }
279
+ function jt({
280
+ behavior: e,
281
+ values: t,
282
+ currentValues: r,
283
+ initialValues: i,
284
+ pressedIndex: o,
285
+ nextValue: l,
286
+ min: u,
287
+ max: g,
288
+ step: p,
289
+ minStepsBetweenValues: w
290
+ }) {
291
+ const h = r ?? t, U = i ?? t;
292
+ if (!(h.length > 1))
293
+ return {
294
+ value: l,
295
+ thumbIndex: 0,
296
+ didSwap: !1
297
+ };
298
+ const m = p * w;
299
+ switch (e) {
300
+ case "swap": {
301
+ const s = h[o], V = 1e-7, x = h.slice(), P = x[o - 1], y = x[o + 1], M = P != null ? P + m : u, te = y != null ? y - m : g, ne = ue(l, M, te), re = Number(ne.toFixed(12));
302
+ x[o] = re;
303
+ const Re = l > s, le = l < s, W = Re && y != null && l >= y - V, ce = le && P != null && l <= P + V;
304
+ if (!W && !ce)
305
+ return {
306
+ value: x,
307
+ thumbIndex: o,
308
+ didSwap: !1
309
+ };
310
+ const z = W ? o + 1 : o - 1, q = x.map((A, R) => {
311
+ if (R === o)
312
+ return re;
313
+ const _ = U[R];
314
+ return _ ?? h[R];
315
+ });
316
+ let K = l;
317
+ W ? K = Math.max(l, x[z]) : K = Math.min(l, x[z]);
318
+ const S = Xe({
319
+ values: x,
320
+ index: z,
321
+ nextValue: K,
322
+ min: u,
323
+ max: g,
324
+ step: p,
325
+ minStepsBetweenValues: w,
326
+ initialValues: q
327
+ }), Y = W ? z - 1 : z + 1;
328
+ if (Y >= 0 && Y < S.length) {
329
+ const A = S[Y - 1], R = S[Y + 1];
330
+ let _ = A != null ? A + m : u;
331
+ _ = Math.max(_, u + Y * m);
332
+ let B = R != null ? R - m : g;
333
+ B = Math.min(B, g - (S.length - 1 - Y) * m);
334
+ const oe = ue(re, _, B);
335
+ S[Y] = Number(oe.toFixed(12));
336
+ }
337
+ return {
338
+ value: S,
339
+ thumbIndex: z,
340
+ didSwap: !0
341
+ };
342
+ }
343
+ case "push":
344
+ return {
345
+ value: Xe({
346
+ values: h,
347
+ index: o,
348
+ nextValue: l,
349
+ min: u,
350
+ max: g,
351
+ step: p,
352
+ minStepsBetweenValues: w
353
+ }),
354
+ thumbIndex: o,
355
+ didSwap: !1
356
+ };
357
+ default: {
358
+ const s = h.slice(), V = s[o - 1], x = s[o + 1], P = V != null ? V + m : u, y = x != null ? x - m : g, M = ue(l, P, y);
359
+ return s[o] = Number(M.toFixed(12)), {
360
+ value: s,
361
+ thumbIndex: o,
362
+ didSwap: !1
363
+ };
364
+ }
365
+ }
366
+ }
367
+ const Xt = 2;
368
+ function Jt(e, t) {
369
+ if (!e)
370
+ return {
371
+ start: 0,
372
+ end: 0
373
+ };
374
+ function r(l) {
375
+ const u = l != null ? parseFloat(l) : 0;
376
+ return Number.isNaN(u) ? 0 : u;
377
+ }
378
+ const i = t ? "Top" : "InlineStart", o = t ? "Bottom" : "InlineEnd";
379
+ return {
380
+ start: r(e[`border${i}Width`]) + r(e[`padding${i}`]),
381
+ end: r(e[`border${o}Width`]) + r(e[`padding${o}`])
382
+ };
383
+ }
384
+ function Fe(e, t) {
385
+ if (t.current != null && e.changedTouches) {
386
+ const r = e;
387
+ for (let i = 0; i < r.changedTouches.length; i += 1) {
388
+ const o = r.changedTouches[i];
389
+ if (o.identifier === t.current)
390
+ return {
391
+ x: o.clientX,
392
+ y: o.clientY
393
+ };
394
+ }
395
+ return null;
396
+ }
397
+ return {
398
+ x: e.clientX,
399
+ y: e.clientY
400
+ };
401
+ }
402
+ const bt = /* @__PURE__ */ a.forwardRef(function(t, r) {
403
+ const {
404
+ render: i,
405
+ className: o,
406
+ ...l
407
+ } = t, {
408
+ disabled: u,
409
+ dragging: g,
410
+ validation: p,
411
+ inset: w,
412
+ lastChangedValueRef: h,
413
+ lastChangeReasonRef: U,
414
+ max: E,
415
+ min: m,
416
+ minStepsBetweenValues: s,
417
+ onValueCommitted: V,
418
+ orientation: x,
419
+ pressedInputRef: P,
420
+ pressedThumbCenterOffsetRef: y,
421
+ pressedThumbIndexRef: M,
422
+ pressedValuesRef: te,
423
+ registerFieldControlRef: ne,
424
+ renderBeforeHydration: re,
425
+ setActive: Re,
426
+ setDragging: le,
427
+ setValue: W,
428
+ state: ce,
429
+ step: z,
430
+ thumbCollisionBehavior: q,
431
+ thumbRefs: K,
432
+ values: S
433
+ } = Le(), Y = nt(), A = S.length > 1, R = x === "vertical", _ = a.useRef(null), B = a.useRef(null), oe = H((n) => {
434
+ n && B.current == null && B.current == null && (B.current = getComputedStyle(n));
435
+ }), X = a.useRef(null), G = a.useRef(0), de = a.useRef(0), C = Qe(S), Ie = H((n) => {
436
+ M.current !== n && (M.current = n);
437
+ const f = K.current[n];
438
+ if (!f) {
439
+ y.current = null, P.current = null;
440
+ return;
441
+ }
442
+ P.current = f.querySelector('input[type="range"]');
443
+ }), ie = H((n) => {
444
+ const f = _.current;
445
+ if (!f)
446
+ return null;
447
+ const {
448
+ width: c,
449
+ height: b,
450
+ bottom: d,
451
+ left: $,
452
+ right: me
453
+ } = f.getBoundingClientRect(), J = Jt(B.current, R), ge = de.current, Pe = (R ? b : c) - J.start - J.end - ge * 2, Se = y.current ?? 0, I = n.x - Se, xe = n.y - Se, Q = R ? d - xe - J.end : (Y === "rtl" ? me - I : I - $) - J.start, Z = ue((Q - ge) / Pe, 0, 1);
454
+ let j = (E - m) * Z + m;
455
+ if (j = gt(j, z, m), j = ue(j, m, E), !A)
456
+ return {
457
+ value: j,
458
+ thumbIndex: 0,
459
+ didSwap: !1
460
+ };
461
+ const Ce = M.current;
462
+ if (Ce < 0)
463
+ return null;
464
+ const ee = jt({
465
+ behavior: q,
466
+ values: S,
467
+ currentValues: C.current ?? S,
468
+ initialValues: te.current,
469
+ pressedIndex: Ce,
470
+ nextValue: j,
471
+ min: m,
472
+ max: E,
473
+ step: z,
474
+ minStepsBetweenValues: s
475
+ });
476
+ return q === "swap" && ee.didSwap ? Ie(ee.thumbIndex) : M.current = ee.thumbIndex, ee;
477
+ }), he = H((n) => {
478
+ te.current = A ? S.slice() : null, C.current = S;
479
+ const f = M.current;
480
+ let c = f;
481
+ if (f > -1 && f < S.length) {
482
+ if (S[f] === E) {
483
+ let b = f;
484
+ for (; b > 0 && S[b - 1] === E; )
485
+ b -= 1;
486
+ c = b;
487
+ }
488
+ } else {
489
+ const b = R ? "y" : "x";
490
+ let d;
491
+ c = -1;
492
+ for (let $ = 0; $ < K.current.length; $ += 1) {
493
+ const me = K.current[$];
494
+ if (qe(me)) {
495
+ const J = ht(me), ge = Math.abs(n[b] - J[b]);
496
+ (d === void 0 || ge <= d) && (c = $, d = ge);
497
+ }
498
+ }
499
+ }
500
+ if (c > -1 && c !== f && Ie(c), w) {
501
+ const b = K.current[c];
502
+ if (qe(b)) {
503
+ const d = b.getBoundingClientRect(), $ = R ? "height" : "width";
504
+ de.current = d[$] / 2;
505
+ }
506
+ }
507
+ }), O = H((n) => {
508
+ K.current?.[n]?.querySelector('input[type="range"]')?.focus({
509
+ preventScroll: !0
510
+ });
511
+ }), F = H((n) => {
512
+ const f = Fe(n, X);
513
+ if (f == null)
514
+ return;
515
+ if (G.current += 1, n.type === "pointermove" && n.buttons === 0) {
516
+ fe(n);
517
+ return;
518
+ }
519
+ const c = ie(f);
520
+ c != null && mt(c.value, z, s) && (!g && G.current > Xt && le(!0), W(c.value, we(At, n, void 0, {
521
+ activeThumbIndex: c.thumbIndex
522
+ })), C.current = Array.isArray(c.value) ? c.value : [c.value], c.didSwap && O(c.thumbIndex));
523
+ });
524
+ function fe(n) {
525
+ Re(-1), le(!1), P.current = null, y.current = null, M.current = -1;
526
+ const f = Fe(n, X), c = f != null ? ie(f) : null;
527
+ if (c != null) {
528
+ const b = U.current;
529
+ p.commit(h.current ?? c.value), V(h.current ?? c.value, Ze(b, n));
530
+ }
531
+ "pointerType" in n && _.current?.hasPointerCapture(n.pointerId) && _.current?.releasePointerCapture(n.pointerId), X.current = null, te.current = null, D();
532
+ }
533
+ const ye = H((n) => {
534
+ if (u)
535
+ return;
536
+ const f = n.changedTouches[0];
537
+ f != null && (X.current = f.identifier);
538
+ const c = Fe(n, X);
539
+ if (c != null) {
540
+ he(c);
541
+ const d = ie(c);
542
+ if (d == null)
543
+ return;
544
+ O(d.thumbIndex), W(d.value, we(Ge, n, void 0, {
545
+ activeThumbIndex: d.thumbIndex
546
+ })), C.current = Array.isArray(d.value) ? d.value : [d.value], d.didSwap && O(d.thumbIndex);
547
+ }
548
+ G.current = 0;
549
+ const b = Ne(_.current);
550
+ b.addEventListener("touchmove", F, {
551
+ passive: !0
552
+ }), b.addEventListener("touchend", fe, {
553
+ passive: !0
554
+ });
555
+ }), D = H(() => {
556
+ const n = Ne(_.current);
557
+ n.removeEventListener("pointermove", F), n.removeEventListener("pointerup", fe), n.removeEventListener("touchmove", F), n.removeEventListener("touchend", fe), te.current = null;
558
+ }), L = qt();
559
+ return a.useEffect(() => {
560
+ const n = _.current;
561
+ return n ? (n.addEventListener("touchstart", ye, {
562
+ passive: !0
563
+ }), () => {
564
+ n.removeEventListener("touchstart", ye), L.cancel(), D();
565
+ }) : () => D();
566
+ }, [D, ye, _, L]), a.useEffect(() => {
567
+ u && D();
568
+ }, [u, D]), Ee("div", t, {
569
+ state: ce,
570
+ ref: [r, ne, _, oe],
571
+ props: [{
572
+ "data-base-ui-slider-control": re ? "" : void 0,
573
+ onPointerDown(n) {
574
+ const f = _.current;
575
+ if (!f || u || n.defaultPrevented || !qe(n.target) || // Only handle left clicks
576
+ n.button !== 0)
577
+ return;
578
+ const c = Fe(n, X);
579
+ if (c != null) {
580
+ he(c);
581
+ const d = ie(c);
582
+ if (d == null)
583
+ return;
584
+ zt(K.current[d.thumbIndex], tt(Ne(f))) ? n.preventDefault() : L.request(() => {
585
+ O(d.thumbIndex);
586
+ }), le(!0), y.current != null || (W(d.value, we(Ge, n.nativeEvent, void 0, {
587
+ activeThumbIndex: d.thumbIndex
588
+ })), C.current = Array.isArray(d.value) ? d.value : [d.value], d.didSwap && O(d.thumbIndex));
589
+ }
590
+ n.nativeEvent.pointerId && f.setPointerCapture(n.nativeEvent.pointerId), G.current = 0;
591
+ const b = Ne(_.current);
592
+ b.addEventListener("pointermove", F, {
593
+ passive: !0
594
+ }), b.addEventListener("pointerup", fe, {
595
+ once: !0
596
+ });
597
+ },
598
+ tabIndex: -1
599
+ }, l],
600
+ stateAttributesMapping: Ve
601
+ });
602
+ });
603
+ process.env.NODE_ENV !== "production" && (bt.displayName = "SliderControl");
604
+ const yt = /* @__PURE__ */ a.forwardRef(function(t, r) {
605
+ const {
606
+ render: i,
607
+ className: o,
608
+ ...l
609
+ } = t, {
610
+ state: u
611
+ } = Le();
612
+ return Ee("div", t, {
613
+ state: u,
614
+ ref: r,
615
+ props: [{
616
+ style: {
617
+ position: "relative"
618
+ }
619
+ }, l],
620
+ stateAttributesMapping: Ve
621
+ });
622
+ });
623
+ process.env.NODE_ENV !== "production" && (yt.displayName = "SliderTrack");
624
+ let Qt = /* @__PURE__ */ (function(e) {
625
+ return e.index = "data-index", e.dragging = "data-dragging", e.orientation = "data-orientation", e.disabled = "data-disabled", e.readonly = "data-readonly", e.required = "data-required", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.focused = "data-focused", e;
626
+ })({});
627
+ const Zt = '!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();', vt = "PageUp", Rt = "PageDown", en = /* @__PURE__ */ new Set([lt, at, st, ut, ot, it, vt, Rt]);
628
+ function tn(e, t, r, i) {
629
+ if (!(t < 0))
630
+ return e.length === 2 ? t === 0 ? `${De(e[t], i, r)} start range` : `${De(e[t], i, r)} end range` : r ? De(e[t], i, r) : void 0;
631
+ }
632
+ function _e(e, t, r, i, o) {
633
+ return r === 1 ? Math.min(e + t, o) : Math.max(e - t, i);
634
+ }
635
+ const It = /* @__PURE__ */ a.forwardRef(function(t, r) {
636
+ const {
637
+ render: i,
638
+ children: o,
639
+ className: l,
640
+ "aria-describedby": u,
641
+ "aria-label": g,
642
+ "aria-labelledby": p,
643
+ disabled: w = !1,
644
+ getAriaLabel: h,
645
+ getAriaValueText: U,
646
+ id: E,
647
+ index: m,
648
+ inputRef: s,
649
+ onBlur: V,
650
+ onFocus: x,
651
+ onKeyDown: P,
652
+ tabIndex: y,
653
+ ...M
654
+ } = t, te = Ue(E), {
655
+ active: ne,
656
+ lastUsedThumbIndex: re,
657
+ controlRef: Re,
658
+ disabled: le,
659
+ validation: W,
660
+ formatOptionsRef: ce,
661
+ handleInputChange: z,
662
+ inset: q,
663
+ labelId: K,
664
+ largeStep: S,
665
+ locale: Y,
666
+ max: A,
667
+ min: R,
668
+ minStepsBetweenValues: _,
669
+ name: B,
670
+ orientation: oe,
671
+ pressedInputRef: X,
672
+ pressedThumbCenterOffsetRef: G,
673
+ pressedThumbIndexRef: de,
674
+ renderBeforeHydration: C,
675
+ setActive: Ie,
676
+ setIndicatorPosition: ie,
677
+ state: he,
678
+ step: O,
679
+ values: F
680
+ } = Le(), fe = nt(), ye = w || le, D = F.length > 1, L = oe === "vertical", se = fe === "rtl", {
681
+ setTouched: n,
682
+ setFocused: f,
683
+ validationMode: c
684
+ } = et(), b = a.useRef(null), d = a.useRef(null), $ = Ue(), me = Ut(), J = D ? $ : me, ge = a.useMemo(() => ({
685
+ inputId: J
686
+ }), [J]), {
687
+ ref: Pe,
688
+ index: Se
689
+ } = Bt({
690
+ metadata: ge
691
+ }), I = D ? m ?? Se : 0, xe = I === F.length - 1, Q = F[I], Z = We(Q, R, A), [j, Ce] = a.useState(!1), [ee, ke] = a.useState();
692
+ rt(() => Ce(!0));
693
+ const Ae = re >= 0 && re < F.length ? re : -1, v = H(() => {
694
+ const N = Re.current, T = b.current;
695
+ if (!N || !T)
696
+ return;
697
+ const k = T.getBoundingClientRect(), Me = N.getBoundingClientRect(), Oe = L ? "height" : "width", xt = Me[Oe] - k[Oe], $e = (k[Oe] / 2 + xt * Z / 100) / Me[Oe] * 100;
698
+ ke($e), I === 0 ? ie((ze) => [$e, ze[1]]) : xe && ie((ze) => [ze[0], $e]);
699
+ });
700
+ He(() => {
701
+ q && queueMicrotask(v);
702
+ }, [v, q]), He(() => {
703
+ q && v();
704
+ }, [v, q, Z]);
705
+ const pe = a.useCallback(() => {
706
+ const N = L ? "bottom" : "insetInlineStart", T = L ? "left" : "top";
707
+ let k;
708
+ return D ? ne === I ? k = 2 : Ae === I && (k = 1) : ne === I && (k = 1), q ? {
709
+ "--position": `${ee}%`,
710
+ visibility: C && !j || ee === void 0 ? "hidden" : void 0,
711
+ position: "absolute",
712
+ [N]: "var(--position)",
713
+ [T]: "50%",
714
+ translate: `${(L || !se ? -1 : 1) * 50}% ${(L ? 1 : -1) * 50}%`,
715
+ zIndex: k
716
+ } : Number.isFinite(Z) ? {
717
+ position: "absolute",
718
+ [N]: `${Z}%`,
719
+ [T]: "50%",
720
+ translate: `${(L || !se ? -1 : 1) * 50}% ${(L ? 1 : -1) * 50}%`,
721
+ zIndex: k
722
+ } : je;
723
+ }, [ne, I, q, j, ee, D, C, se, Ae, Z, L]);
724
+ let ae;
725
+ oe === "vertical" && (ae = se ? "vertical-rl" : "vertical-lr");
726
+ const ve = Mt({
727
+ "aria-label": typeof h == "function" ? h(I) : g,
728
+ "aria-labelledby": p ?? K,
729
+ "aria-describedby": u,
730
+ "aria-orientation": oe,
731
+ "aria-valuenow": Q,
732
+ "aria-valuetext": typeof U == "function" ? U(De(Q, Y, ce.current ?? void 0), Q, I) : tn(F, I, ce.current ?? void 0, Y),
733
+ disabled: ye,
734
+ id: J,
735
+ max: A,
736
+ min: R,
737
+ name: B,
738
+ onChange(N) {
739
+ z(N.target.valueAsNumber, I, N);
740
+ },
741
+ onFocus() {
742
+ Ie(I), f(!0);
743
+ },
744
+ onBlur() {
745
+ b.current && (Ie(-1), n(!0), f(!1), c === "onBlur" && W.commit(ft(Q, I, R, A, D, F)));
746
+ },
747
+ onKeyDown(N) {
748
+ if (!en.has(N.key))
749
+ return;
750
+ Ht.has(N.key) && N.stopPropagation();
751
+ let T = null;
752
+ const k = gt(Q, O, R);
753
+ switch (N.key) {
754
+ case lt:
755
+ T = _e(k, N.shiftKey ? S : O, 1, R, A);
756
+ break;
757
+ case ut:
758
+ T = _e(k, N.shiftKey ? S : O, se ? -1 : 1, R, A);
759
+ break;
760
+ case at:
761
+ T = _e(k, N.shiftKey ? S : O, -1, R, A);
762
+ break;
763
+ case st:
764
+ T = _e(k, N.shiftKey ? S : O, se ? 1 : -1, R, A);
765
+ break;
766
+ case vt:
767
+ T = _e(k, S, 1, R, A);
768
+ break;
769
+ case Rt:
770
+ T = _e(k, S, -1, R, A);
771
+ break;
772
+ case it:
773
+ T = A, D && (T = Number.isFinite(F[I + 1]) ? F[I + 1] - O * _ : A);
774
+ break;
775
+ case ot:
776
+ T = R, D && (T = Number.isFinite(F[I - 1]) ? F[I - 1] + O * _ : R);
777
+ break;
778
+ }
779
+ T !== null && (z(T, I, N), N.preventDefault());
780
+ },
781
+ step: O,
782
+ style: {
783
+ ...je,
784
+ // So that VoiceOver's focus indicator matches the thumb's dimensions
785
+ width: "100%",
786
+ height: "100%",
787
+ writingMode: ae
788
+ },
789
+ tabIndex: y ?? void 0,
790
+ type: "range",
791
+ value: Q ?? ""
792
+ }, W.getInputValidationProps), Te = Ot(d, W.inputRef, s);
793
+ return Ee("div", t, {
794
+ state: he,
795
+ ref: [r, Pe, b],
796
+ props: [{
797
+ [Qt.index]: I,
798
+ children: /* @__PURE__ */ Je(a.Fragment, {
799
+ children: [o, /* @__PURE__ */ be("input", {
800
+ ref: Te,
801
+ ...ve
802
+ }), q && !j && C && // this must be rendered with the last thumb to ensure all
803
+ // preceding thumbs are already rendered in the DOM
804
+ xe && /* @__PURE__ */ be("script", {
805
+ // eslint-disable-next-line react/no-danger
806
+ dangerouslySetInnerHTML: {
807
+ __html: Zt
808
+ },
809
+ suppressHydrationWarning: !0
810
+ })]
811
+ }),
812
+ id: te,
813
+ onBlur: V,
814
+ onFocus: x,
815
+ onPointerDown(N) {
816
+ if (de.current = I, b.current != null) {
817
+ const T = oe === "horizontal" ? "x" : "y", k = ht(b.current), Me = (oe === "horizontal" ? N.clientX : N.clientY) - k[T];
818
+ G.current = Me;
819
+ }
820
+ d.current != null && X.current !== d.current && (X.current = d.current);
821
+ },
822
+ style: pe(),
823
+ suppressHydrationWarning: C || void 0,
824
+ tabIndex: -1
825
+ }, M],
826
+ stateAttributesMapping: Ve
827
+ });
828
+ });
829
+ process.env.NODE_ENV !== "production" && (It.displayName = "SliderThumb");
830
+ function nn(e, t, r, i, o, l) {
831
+ const u = r === void 0 || t && i === void 0 ? "hidden" : void 0, g = e ? "bottom" : "insetInlineStart", p = e ? "height" : "width", h = {
832
+ visibility: o && !l ? "hidden" : u,
833
+ position: e ? "absolute" : "relative",
834
+ [e ? "width" : "height"]: "inherit"
835
+ };
836
+ return h["--start-position"] = `${r ?? 0}%`, t ? (h["--relative-size"] = `${(i ?? 0) - (r ?? 0)}%`, h[g] = "var(--start-position)", h[p] = "var(--relative-size)", h) : (h[g] = 0, h[p] = "var(--start-position)", h);
837
+ }
838
+ function rn(e, t, r, i) {
839
+ const o = e ? "bottom" : "insetInlineStart", l = e ? "height" : "width", g = {
840
+ position: e ? "absolute" : "relative",
841
+ [e ? "width" : "height"]: "inherit"
842
+ };
843
+ if (!t)
844
+ return g[o] = 0, g[l] = `${r}%`, g;
845
+ const p = i - r;
846
+ return g[o] = `${r}%`, g[l] = `${p}%`, g;
847
+ }
848
+ const St = /* @__PURE__ */ a.forwardRef(function(t, r) {
849
+ const {
850
+ render: i,
851
+ className: o,
852
+ ...l
853
+ } = t, {
854
+ indicatorPosition: u,
855
+ inset: g,
856
+ max: p,
857
+ min: w,
858
+ orientation: h,
859
+ renderBeforeHydration: U,
860
+ state: E,
861
+ values: m
862
+ } = Le(), [s, V] = a.useState(!1);
863
+ rt(() => V(!0));
864
+ const x = h === "vertical", P = m.length > 1, y = g ? nn(x, P, u[0], u[1], U, s) : rn(x, P, We(m[0], w, p), We(m[m.length - 1], w, p));
865
+ return Ee("div", t, {
866
+ state: E,
867
+ ref: r,
868
+ props: [{
869
+ "data-base-ui-slider-indicator": U ? "" : void 0,
870
+ style: y,
871
+ suppressHydrationWarning: U || void 0
872
+ }, l],
873
+ stateAttributesMapping: Ve
874
+ });
875
+ });
876
+ process.env.NODE_ENV !== "production" && (St.displayName = "SliderIndicator");
877
+ const on = "_slider__control_q5h2z_2", sn = "_slider__track_q5h2z_9", an = "_slider__indicator_q5h2z_17", un = "_slider__thumb_q5h2z_28", Be = {
878
+ slider__control: on,
879
+ slider__track: sn,
880
+ slider__indicator: an,
881
+ slider__thumb: un
882
+ };
883
+ function Dn({ color: e = "primary", ...t }) {
884
+ return /* @__PURE__ */ be(pt, { ...t, children: /* @__PURE__ */ be(bt, { className: Be.slider__control, children: /* @__PURE__ */ Je(
885
+ Pt,
886
+ {
887
+ render: /* @__PURE__ */ be(yt, {}),
888
+ color: e,
889
+ className: Be.slider__track,
890
+ children: [
891
+ /* @__PURE__ */ be(St, { className: Be.slider__indicator }),
892
+ /* @__PURE__ */ be(It, { className: Ct(Be.slider__thumb) })
893
+ ]
894
+ }
895
+ ) }) });
896
+ }
897
+ export {
898
+ Dn as Slider
899
+ };