@szum-tech/design-system 3.17.0 → 3.18.2

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 (299) hide show
  1. package/dist/chunk-D5PAWOAZ.cjs +1 -0
  2. package/dist/chunk-JUNHRB4B.js +1 -0
  3. package/dist/chunk-P7BFOJLM.cjs +3 -0
  4. package/dist/chunk-ZYG2KYKK.js +3 -0
  5. package/dist/components/index.cjs +1 -924
  6. package/dist/components/index.d.cts +1650 -56
  7. package/dist/components/index.d.ts +1650 -56
  8. package/dist/components/index.js +1 -43
  9. package/dist/hooks/index.cjs +1 -35
  10. package/dist/hooks/index.js +1 -2
  11. package/dist/icons/index.cjs +2 -93
  12. package/dist/icons/index.js +2 -88
  13. package/dist/utils/index.cjs +1 -10
  14. package/dist/utils/index.js +1 -1
  15. package/package.json +30 -38
  16. package/dist/chunk-2WQJ36RD.cjs +0 -78
  17. package/dist/chunk-2Y2ZCPNV.cjs +0 -61
  18. package/dist/chunk-35H6T7OQ.cjs +0 -2912
  19. package/dist/chunk-375QAB65.cjs +0 -145
  20. package/dist/chunk-3DP3VMPN.js +0 -173
  21. package/dist/chunk-3GNVQFCK.cjs +0 -50
  22. package/dist/chunk-3RK5PCIC.js +0 -86
  23. package/dist/chunk-3WSQRFUY.cjs +0 -11
  24. package/dist/chunk-4LNGZHF2.cjs +0 -33
  25. package/dist/chunk-4TRADSTP.js +0 -34
  26. package/dist/chunk-5B37TQYT.cjs +0 -18
  27. package/dist/chunk-5F2Y65JH.js +0 -32
  28. package/dist/chunk-5MJPZUTO.js +0 -38
  29. package/dist/chunk-5MV54MWS.js +0 -46
  30. package/dist/chunk-6BSR3O2J.js +0 -53
  31. package/dist/chunk-6HX7ETL3.cjs +0 -183
  32. package/dist/chunk-7OD2NBSV.cjs +0 -50
  33. package/dist/chunk-A72LE53B.js +0 -21
  34. package/dist/chunk-A7SBXO2Y.cjs +0 -40
  35. package/dist/chunk-AAPMLWYK.js +0 -2831
  36. package/dist/chunk-B4M7Q5KX.cjs +0 -25
  37. package/dist/chunk-B7RHEMZH.js +0 -48
  38. package/dist/chunk-BTSHACKG.js +0 -123
  39. package/dist/chunk-BUJO4FB6.js +0 -252
  40. package/dist/chunk-CL2C6STG.cjs +0 -278
  41. package/dist/chunk-CXHDWIGF.cjs +0 -89
  42. package/dist/chunk-DGWBE2Y3.cjs +0 -205
  43. package/dist/chunk-DUAM4RTP.cjs +0 -23
  44. package/dist/chunk-EOTQVIA5.js +0 -993
  45. package/dist/chunk-EUH466AL.cjs +0 -179
  46. package/dist/chunk-F7NFSDOD.cjs +0 -91
  47. package/dist/chunk-G24PWQKG.js +0 -20
  48. package/dist/chunk-GEDBA3JU.cjs +0 -49
  49. package/dist/chunk-GYXQUTWZ.cjs +0 -59
  50. package/dist/chunk-H2BWO3SI.cjs +0 -11
  51. package/dist/chunk-H5NHGMSQ.js +0 -136
  52. package/dist/chunk-HCHVDUI6.cjs +0 -34
  53. package/dist/chunk-HNRVLRMN.js +0 -82
  54. package/dist/chunk-HPICKLBZ.cjs +0 -204
  55. package/dist/chunk-I3E75OQX.js +0 -16
  56. package/dist/chunk-I3RSTJP6.js +0 -20
  57. package/dist/chunk-IWF52DDE.js +0 -55
  58. package/dist/chunk-IZU3KULT.js +0 -41
  59. package/dist/chunk-K5AURCK5.js +0 -183
  60. package/dist/chunk-KTAIBRTH.cjs +0 -10
  61. package/dist/chunk-L2TRMQNN.js +0 -130
  62. package/dist/chunk-M7NIRB3U.js +0 -43
  63. package/dist/chunk-MNDQXDV4.cjs +0 -607
  64. package/dist/chunk-N4TYSZSU.cjs +0 -44
  65. package/dist/chunk-NU5UQPBX.cjs +0 -25
  66. package/dist/chunk-NXEZE7LG.js +0 -15
  67. package/dist/chunk-OCOCENE6.js +0 -42
  68. package/dist/chunk-OQCNPNPS.js +0 -23
  69. package/dist/chunk-OXZQGDTR.js +0 -208
  70. package/dist/chunk-OZSNSRLV.cjs +0 -1027
  71. package/dist/chunk-P4IL77YC.js +0 -66
  72. package/dist/chunk-P4JIMFSL.js +0 -51
  73. package/dist/chunk-P5IUC7HJ.js +0 -9
  74. package/dist/chunk-PBEZZMAB.js +0 -25
  75. package/dist/chunk-RKFU4DS3.cjs +0 -1064
  76. package/dist/chunk-S3ANEJJ7.cjs +0 -22
  77. package/dist/chunk-S3ZUFD6U.js +0 -23
  78. package/dist/chunk-SHPJGB2L.cjs +0 -19
  79. package/dist/chunk-TH44JYXB.cjs +0 -27
  80. package/dist/chunk-TMXVL5CV.cjs +0 -48
  81. package/dist/chunk-U3QKV7I4.js +0 -54
  82. package/dist/chunk-U7XZJQ4O.js +0 -36
  83. package/dist/chunk-UJX74PFK.cjs +0 -46
  84. package/dist/chunk-ULEEQ723.cjs +0 -108
  85. package/dist/chunk-UNOMGKAZ.cjs +0 -141
  86. package/dist/chunk-USIW3VT5.cjs +0 -73
  87. package/dist/chunk-VK2FJ65F.js +0 -575
  88. package/dist/chunk-VK5EX3OG.cjs +0 -132
  89. package/dist/chunk-WCQ5WKCQ.js +0 -1042
  90. package/dist/chunk-WMGJCB7O.js +0 -157
  91. package/dist/chunk-X3ZT3KGX.cjs +0 -53
  92. package/dist/chunk-X5O7GP4S.js +0 -48
  93. package/dist/chunk-X7WREEFD.js +0 -8
  94. package/dist/chunk-XENOUBSI.cjs +0 -37
  95. package/dist/chunk-XKCLVPUC.js +0 -176
  96. package/dist/chunk-XTKD76O5.js +0 -29
  97. package/dist/chunk-YBFG2IRJ.cjs +0 -225
  98. package/dist/chunk-YEFLGE3L.cjs +0 -47
  99. package/dist/chunk-YUMKV5TH.js +0 -56
  100. package/dist/chunk-ZD2QRAOX.js +0 -9
  101. package/dist/chunk-ZVF7J4EI.cjs +0 -58
  102. package/dist/color-picker.types-GI7dq2Ig.d.cts +0 -42
  103. package/dist/color-picker.types-GI7dq2Ig.d.ts +0 -42
  104. package/dist/components/accordion/index.cjs +0 -23
  105. package/dist/components/accordion/index.d.cts +0 -17
  106. package/dist/components/accordion/index.d.ts +0 -17
  107. package/dist/components/accordion/index.js +0 -2
  108. package/dist/components/alert/index.cjs +0 -19
  109. package/dist/components/alert/index.d.cts +0 -24
  110. package/dist/components/alert/index.d.ts +0 -24
  111. package/dist/components/alert/index.js +0 -2
  112. package/dist/components/alert-dialog/index.cjs +0 -43
  113. package/dist/components/alert-dialog/index.d.cts +0 -32
  114. package/dist/components/alert-dialog/index.d.ts +0 -32
  115. package/dist/components/alert-dialog/index.js +0 -2
  116. package/dist/components/avatar/index.cjs +0 -19
  117. package/dist/components/avatar/index.d.cts +0 -14
  118. package/dist/components/avatar/index.d.ts +0 -14
  119. package/dist/components/avatar/index.js +0 -2
  120. package/dist/components/badge/index.cjs +0 -19
  121. package/dist/components/badge/index.d.cts +0 -28
  122. package/dist/components/badge/index.d.ts +0 -28
  123. package/dist/components/badge/index.js +0 -2
  124. package/dist/components/badge-overflow/index.cjs +0 -183
  125. package/dist/components/badge-overflow/index.d.cts +0 -21
  126. package/dist/components/badge-overflow/index.d.ts +0 -21
  127. package/dist/components/badge-overflow/index.js +0 -161
  128. package/dist/components/breadcrump/index.cjs +0 -80
  129. package/dist/components/breadcrump/index.d.cts +0 -21
  130. package/dist/components/breadcrump/index.d.ts +0 -21
  131. package/dist/components/breadcrump/index.js +0 -72
  132. package/dist/components/button/index.cjs +0 -52
  133. package/dist/components/button/index.d.cts +0 -58
  134. package/dist/components/button/index.d.ts +0 -58
  135. package/dist/components/button/index.js +0 -43
  136. package/dist/components/card/index.cjs +0 -35
  137. package/dist/components/card/index.d.cts +0 -25
  138. package/dist/components/card/index.d.ts +0 -25
  139. package/dist/components/card/index.js +0 -2
  140. package/dist/components/carousel/index.cjs +0 -269
  141. package/dist/components/carousel/index.d.cts +0 -48
  142. package/dist/components/carousel/index.d.ts +0 -48
  143. package/dist/components/carousel/index.js +0 -238
  144. package/dist/components/checkbox/index.cjs +0 -11
  145. package/dist/components/checkbox/index.d.cts +0 -8
  146. package/dist/components/checkbox/index.d.ts +0 -8
  147. package/dist/components/checkbox/index.js +0 -2
  148. package/dist/components/collapsible/index.cjs +0 -18
  149. package/dist/components/collapsible/index.d.cts +0 -12
  150. package/dist/components/collapsible/index.d.ts +0 -12
  151. package/dist/components/collapsible/index.js +0 -1
  152. package/dist/components/color-picker/index.cjs +0 -92
  153. package/dist/components/color-picker/index.d.cts +0 -71
  154. package/dist/components/color-picker/index.d.ts +0 -71
  155. package/dist/components/color-picker/index.js +0 -43
  156. package/dist/components/color-swatch/index.cjs +0 -11
  157. package/dist/components/color-swatch/index.d.cts +0 -22
  158. package/dist/components/color-swatch/index.d.ts +0 -22
  159. package/dist/components/color-swatch/index.js +0 -2
  160. package/dist/components/counting-number/index.cjs +0 -11
  161. package/dist/components/counting-number/index.d.cts +0 -57
  162. package/dist/components/counting-number/index.d.ts +0 -57
  163. package/dist/components/counting-number/index.js +0 -2
  164. package/dist/components/dialog/index.cjs +0 -39
  165. package/dist/components/dialog/index.d.cts +0 -42
  166. package/dist/components/dialog/index.d.ts +0 -42
  167. package/dist/components/dialog/index.js +0 -2
  168. package/dist/components/dropdown-menu/index.cjs +0 -71
  169. package/dist/components/dropdown-menu/index.d.cts +0 -67
  170. package/dist/components/dropdown-menu/index.d.ts +0 -67
  171. package/dist/components/dropdown-menu/index.js +0 -2
  172. package/dist/components/empty/index.cjs +0 -31
  173. package/dist/components/empty/index.d.cts +0 -29
  174. package/dist/components/empty/index.d.ts +0 -29
  175. package/dist/components/empty/index.js +0 -2
  176. package/dist/components/field/index.cjs +0 -49
  177. package/dist/components/field/index.d.cts +0 -50
  178. package/dist/components/field/index.d.ts +0 -50
  179. package/dist/components/field/index.js +0 -4
  180. package/dist/components/file-upload/index.cjs +0 -60
  181. package/dist/components/file-upload/index.d.cts +0 -131
  182. package/dist/components/file-upload/index.d.ts +0 -131
  183. package/dist/components/file-upload/index.js +0 -3
  184. package/dist/components/header/index.cjs +0 -11
  185. package/dist/components/header/index.d.cts +0 -18
  186. package/dist/components/header/index.d.ts +0 -18
  187. package/dist/components/header/index.js +0 -2
  188. package/dist/components/input/index.cjs +0 -11
  189. package/dist/components/input/index.d.cts +0 -9
  190. package/dist/components/input/index.d.ts +0 -9
  191. package/dist/components/input/index.js +0 -2
  192. package/dist/components/item/index.cjs +0 -48
  193. package/dist/components/item/index.d.cts +0 -61
  194. package/dist/components/item/index.d.ts +0 -61
  195. package/dist/components/item/index.js +0 -3
  196. package/dist/components/label/index.cjs +0 -11
  197. package/dist/components/label/index.d.cts +0 -8
  198. package/dist/components/label/index.d.ts +0 -8
  199. package/dist/components/label/index.js +0 -2
  200. package/dist/components/marquee/index.cjs +0 -11
  201. package/dist/components/marquee/index.d.cts +0 -48
  202. package/dist/components/marquee/index.d.ts +0 -48
  203. package/dist/components/marquee/index.js +0 -2
  204. package/dist/components/masonry/index.cjs +0 -16
  205. package/dist/components/masonry/index.d.cts +0 -181
  206. package/dist/components/masonry/index.d.ts +0 -181
  207. package/dist/components/masonry/index.js +0 -3
  208. package/dist/components/popover/index.cjs +0 -35
  209. package/dist/components/popover/index.d.cts +0 -18
  210. package/dist/components/popover/index.d.ts +0 -18
  211. package/dist/components/popover/index.js +0 -2
  212. package/dist/components/progress/index.cjs +0 -11
  213. package/dist/components/progress/index.d.cts +0 -8
  214. package/dist/components/progress/index.d.ts +0 -8
  215. package/dist/components/progress/index.js +0 -2
  216. package/dist/components/radio-group/index.cjs +0 -15
  217. package/dist/components/radio-group/index.d.cts +0 -22
  218. package/dist/components/radio-group/index.d.ts +0 -22
  219. package/dist/components/radio-group/index.js +0 -2
  220. package/dist/components/scroll-area/index.cjs +0 -15
  221. package/dist/components/scroll-area/index.d.cts +0 -11
  222. package/dist/components/scroll-area/index.d.ts +0 -11
  223. package/dist/components/scroll-area/index.js +0 -2
  224. package/dist/components/select/index.cjs +0 -31
  225. package/dist/components/select/index.d.cts +0 -22
  226. package/dist/components/select/index.d.ts +0 -22
  227. package/dist/components/select/index.js +0 -2
  228. package/dist/components/separator/index.cjs +0 -11
  229. package/dist/components/separator/index.d.cts +0 -8
  230. package/dist/components/separator/index.d.ts +0 -8
  231. package/dist/components/separator/index.js +0 -2
  232. package/dist/components/sheet/index.cjs +0 -39
  233. package/dist/components/sheet/index.d.cts +0 -42
  234. package/dist/components/sheet/index.d.ts +0 -42
  235. package/dist/components/sheet/index.js +0 -2
  236. package/dist/components/sidebar/index.cjs +0 -148
  237. package/dist/components/sidebar/index.d.cts +0 -135
  238. package/dist/components/sidebar/index.d.ts +0 -135
  239. package/dist/components/sidebar/index.js +0 -43
  240. package/dist/components/skeleton/index.cjs +0 -11
  241. package/dist/components/skeleton/index.d.cts +0 -7
  242. package/dist/components/skeleton/index.d.ts +0 -7
  243. package/dist/components/skeleton/index.js +0 -2
  244. package/dist/components/sortable/index.cjs +0 -27
  245. package/dist/components/sortable/index.d.cts +0 -50
  246. package/dist/components/sortable/index.d.ts +0 -50
  247. package/dist/components/sortable/index.js +0 -2
  248. package/dist/components/spinner/index.cjs +0 -11
  249. package/dist/components/spinner/index.d.cts +0 -7
  250. package/dist/components/spinner/index.d.ts +0 -7
  251. package/dist/components/spinner/index.js +0 -2
  252. package/dist/components/status/index.cjs +0 -19
  253. package/dist/components/status/index.d.cts +0 -25
  254. package/dist/components/status/index.d.ts +0 -25
  255. package/dist/components/status/index.js +0 -2
  256. package/dist/components/stepper/index.cjs +0 -124
  257. package/dist/components/stepper/index.d.cts +0 -164
  258. package/dist/components/stepper/index.d.ts +0 -164
  259. package/dist/components/stepper/index.js +0 -43
  260. package/dist/components/switch/index.cjs +0 -11
  261. package/dist/components/switch/index.d.cts +0 -19
  262. package/dist/components/switch/index.d.ts +0 -19
  263. package/dist/components/switch/index.js +0 -2
  264. package/dist/components/tabs/index.cjs +0 -23
  265. package/dist/components/tabs/index.d.cts +0 -17
  266. package/dist/components/tabs/index.d.ts +0 -17
  267. package/dist/components/tabs/index.js +0 -2
  268. package/dist/components/textarea/index.cjs +0 -11
  269. package/dist/components/textarea/index.d.cts +0 -9
  270. package/dist/components/textarea/index.d.ts +0 -9
  271. package/dist/components/textarea/index.js +0 -2
  272. package/dist/components/timeline/index.cjs +0 -45
  273. package/dist/components/timeline/index.d.cts +0 -63
  274. package/dist/components/timeline/index.d.ts +0 -63
  275. package/dist/components/timeline/index.js +0 -4
  276. package/dist/components/toaster/index.cjs +0 -56
  277. package/dist/components/toaster/index.d.cts +0 -8
  278. package/dist/components/toaster/index.d.ts +0 -8
  279. package/dist/components/toaster/index.js +0 -43
  280. package/dist/components/tooltip/index.cjs +0 -19
  281. package/dist/components/tooltip/index.d.cts +0 -12
  282. package/dist/components/tooltip/index.d.ts +0 -12
  283. package/dist/components/tooltip/index.js +0 -2
  284. package/dist/components/typing-text/index.cjs +0 -11
  285. package/dist/components/typing-text/index.d.cts +0 -41
  286. package/dist/components/typing-text/index.d.ts +0 -41
  287. package/dist/components/typing-text/index.js +0 -2
  288. package/dist/components/word-rotate/index.cjs +0 -11
  289. package/dist/components/word-rotate/index.d.cts +0 -30
  290. package/dist/components/word-rotate/index.d.ts +0 -30
  291. package/dist/components/word-rotate/index.js +0 -2
  292. package/dist/direction-CUOPDLCj.d.cts +0 -7
  293. package/dist/direction-CUOPDLCj.d.ts +0 -7
  294. package/dist/popover-trigger-Cf4PPj0z.d.cts +0 -14
  295. package/dist/popover-trigger-Cf4PPj0z.d.ts +0 -14
  296. package/dist/select-Bf6XQtt-.d.cts +0 -12
  297. package/dist/select-Bf6XQtt-.d.ts +0 -12
  298. package/dist/tooltip-content-DqtogPBq.d.cts +0 -8
  299. package/dist/tooltip-content-DqtogPBq.d.ts +0 -8
@@ -1,2912 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkA7SBXO2Y_cjs = require('./chunk-A7SBXO2Y.cjs');
4
- var chunk3WSQRFUY_cjs = require('./chunk-3WSQRFUY.cjs');
5
- var chunkMNDQXDV4_cjs = require('./chunk-MNDQXDV4.cjs');
6
- var chunk6HX7ETL3_cjs = require('./chunk-6HX7ETL3.cjs');
7
- var chunk375QAB65_cjs = require('./chunk-375QAB65.cjs');
8
- var chunkKTAIBRTH_cjs = require('./chunk-KTAIBRTH.cjs');
9
- var chunkB4M7Q5KX_cjs = require('./chunk-B4M7Q5KX.cjs');
10
- var chunkGEDBA3JU_cjs = require('./chunk-GEDBA3JU.cjs');
11
- var chunkDUAM4RTP_cjs = require('./chunk-DUAM4RTP.cjs');
12
- var chunkF7NFSDOD_cjs = require('./chunk-F7NFSDOD.cjs');
13
- var chunkN4TYSZSU_cjs = require('./chunk-N4TYSZSU.cjs');
14
- var chunkH2BWO3SI_cjs = require('./chunk-H2BWO3SI.cjs');
15
- var React16 = require('react');
16
- var reactSlot = require('@radix-ui/react-slot');
17
- var radixUi = require('radix-ui');
18
- var jsxRuntime = require('react/jsx-runtime');
19
- var lucideReact = require('lucide-react');
20
- var classVarianceAuthority = require('class-variance-authority');
21
- var sonner = require('sonner');
22
-
23
- function _interopNamespace(e) {
24
- if (e && e.__esModule) return e;
25
- var n = Object.create(null);
26
- if (e) {
27
- Object.keys(e).forEach(function (k) {
28
- if (k !== 'default') {
29
- var d = Object.getOwnPropertyDescriptor(e, k);
30
- Object.defineProperty(n, k, d.get ? d : {
31
- enumerable: true,
32
- get: function () { return e[k]; }
33
- });
34
- }
35
- });
36
- }
37
- n.default = e;
38
- return Object.freeze(n);
39
- }
40
-
41
- var React16__namespace = /*#__PURE__*/_interopNamespace(React16);
42
-
43
- function VisuallyHiddenInput(props) {
44
- const { control, value, checked, bubbles = true, type = "hidden", style, ...inputProps } = props;
45
- const isCheckInput = React16__namespace.useMemo(() => type === "checkbox" || type === "radio" || type === "switch", [type]);
46
- const inputRef = React16__namespace.useRef(null);
47
- const prevValueRef = React16__namespace.useRef({
48
- value: isCheckInput ? checked : value,
49
- previous: isCheckInput ? checked : value
50
- });
51
- const prevValue = React16__namespace.useMemo(() => {
52
- const currentValue = isCheckInput ? checked : value;
53
- if (prevValueRef.current.value !== currentValue) {
54
- prevValueRef.current.previous = prevValueRef.current.value;
55
- prevValueRef.current.value = currentValue;
56
- }
57
- return prevValueRef.current.previous;
58
- }, [isCheckInput, value, checked]);
59
- const [controlSize, setControlSize] = React16__namespace.useState({});
60
- React16__namespace.useLayoutEffect(() => {
61
- if (!control) {
62
- setControlSize({});
63
- return;
64
- }
65
- setControlSize({
66
- width: control.offsetWidth,
67
- height: control.offsetHeight
68
- });
69
- if (typeof window === "undefined") return;
70
- const resizeObserver = new ResizeObserver((entries) => {
71
- if (!Array.isArray(entries) || !entries.length) return;
72
- const entry = entries[0];
73
- if (!entry) return;
74
- let width;
75
- let height;
76
- if ("borderBoxSize" in entry) {
77
- const borderSizeEntry = entry.borderBoxSize;
78
- const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
79
- width = borderSize.inlineSize;
80
- height = borderSize.blockSize;
81
- } else {
82
- width = control.offsetWidth;
83
- height = control.offsetHeight;
84
- }
85
- setControlSize({ width, height });
86
- });
87
- resizeObserver.observe(control, { box: "border-box" });
88
- return () => {
89
- resizeObserver.disconnect();
90
- };
91
- }, [control]);
92
- React16__namespace.useEffect(() => {
93
- const input = inputRef.current;
94
- if (!input) return;
95
- const inputProto = window.HTMLInputElement.prototype;
96
- const propertyKey = isCheckInput ? "checked" : "value";
97
- const eventType = isCheckInput ? "click" : "input";
98
- const currentValue = isCheckInput ? checked : value;
99
- const serializedCurrentValue = isCheckInput ? checked : typeof value === "object" && value !== null ? JSON.stringify(value) : value;
100
- const descriptor = Object.getOwnPropertyDescriptor(inputProto, propertyKey);
101
- const setter = descriptor?.set;
102
- if (prevValue !== currentValue && setter) {
103
- const event = new Event(eventType, { bubbles });
104
- setter.call(input, serializedCurrentValue);
105
- input.dispatchEvent(event);
106
- }
107
- }, [prevValue, value, checked, bubbles, isCheckInput]);
108
- const composedStyle = React16__namespace.useMemo(() => {
109
- return {
110
- ...style,
111
- ...controlSize.width !== void 0 && controlSize.height !== void 0 ? controlSize : {},
112
- border: 0,
113
- clip: "rect(0 0 0 0)",
114
- clipPath: "inset(50%)",
115
- height: "1px",
116
- margin: "-1px",
117
- overflow: "hidden",
118
- padding: 0,
119
- position: "absolute",
120
- whiteSpace: "nowrap",
121
- width: "1px"
122
- };
123
- }, [style, controlSize]);
124
- return /* @__PURE__ */ jsxRuntime.jsx(
125
- "input",
126
- {
127
- type,
128
- ...inputProps,
129
- ref: inputRef,
130
- "aria-hidden": isCheckInput,
131
- tabIndex: -1,
132
- defaultChecked: isCheckInput ? checked : void 0,
133
- style: composedStyle
134
- }
135
- );
136
- }
137
-
138
- // src/components/color-picker/color-picker.constants.ts
139
- var COLOR_PICKER_ROOT_NAME = "ColorPicker";
140
- var COLOR_PICKER_IMPL_NAME = "ColorPickerImpl";
141
- var COLOR_PICKER_TRIGGER_NAME = "ColorPickerTrigger";
142
- var COLOR_PICKER_CONTENT_NAME = "ColorPickerContent";
143
- var COLOR_PICKER_AREA_NAME = "ColorPickerArea";
144
- var COLOR_PICKER_HUE_SLIDER_NAME = "ColorPickerHueSlider";
145
- var COLOR_PICKER_ALPHA_SLIDER_NAME = "ColorPickerAlphaSlider";
146
- var COLOR_PICKER_SWATCH_NAME = "ColorPickerSwatch";
147
- var COLOR_PICKER_EYE_DROPPER_NAME = "ColorPickerEyeDropper";
148
- var COLOR_PICKER_FORMAT_SELECT_NAME = "ColorPickerFormatSelect";
149
- var COLOR_PICKER_INPUT_NAME = "ColorPickerInput";
150
- var COLOR_FORMATS = ["hex", "rgb", "hsl", "hsb"];
151
- var ColorPickerContext = React16__namespace.createContext(null);
152
- function useColorPickerContext(consumerName) {
153
- const context = React16__namespace.useContext(ColorPickerContext);
154
- if (!context) {
155
- throw new Error(`\`${consumerName}\` must be used within \`${COLOR_PICKER_ROOT_NAME}\``);
156
- }
157
- return context;
158
- }
159
-
160
- // src/components/color-picker/color-picker.utils.ts
161
- function hexToRgb(hex, alpha) {
162
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
163
- return result ? {
164
- r: Number.parseInt(result[1] ?? "0", 16),
165
- g: Number.parseInt(result[2] ?? "0", 16),
166
- b: Number.parseInt(result[3] ?? "0", 16),
167
- a: alpha ?? 1
168
- } : { r: 0, g: 0, b: 0, a: alpha ?? 1 };
169
- }
170
- function rgbToHex(color) {
171
- const toHex = (n) => {
172
- const hex = Math.round(n).toString(16);
173
- return hex.length === 1 ? `0${hex}` : hex;
174
- };
175
- return `#${toHex(color.r)}${toHex(color.g)}${toHex(color.b)}`;
176
- }
177
- function rgbToHsv(color) {
178
- const r = color.r / 255;
179
- const g = color.g / 255;
180
- const b = color.b / 255;
181
- const max = Math.max(r, g, b);
182
- const min = Math.min(r, g, b);
183
- const diff = max - min;
184
- let h = 0;
185
- if (diff !== 0) {
186
- switch (max) {
187
- case r:
188
- h = (g - b) / diff % 6;
189
- break;
190
- case g:
191
- h = (b - r) / diff + 2;
192
- break;
193
- case b:
194
- h = (r - g) / diff + 4;
195
- break;
196
- }
197
- }
198
- h = Math.round(h * 60);
199
- if (h < 0) h += 360;
200
- const s = max === 0 ? 0 : diff / max;
201
- return {
202
- h,
203
- s: Math.round(s * 100),
204
- v: Math.round(max * 100),
205
- a: color.a
206
- };
207
- }
208
- function hsvToRgb(hsv) {
209
- const h = hsv.h / 360;
210
- const s = hsv.s / 100;
211
- const v = hsv.v / 100;
212
- const i = Math.floor(h * 6);
213
- const f = h * 6 - i;
214
- const p = v * (1 - s);
215
- const q = v * (1 - f * s);
216
- const t = v * (1 - (1 - f) * s);
217
- let r;
218
- let g;
219
- let b;
220
- switch (i % 6) {
221
- case 0: {
222
- r = v;
223
- g = t;
224
- b = p;
225
- break;
226
- }
227
- case 1: {
228
- r = q;
229
- g = v;
230
- b = p;
231
- break;
232
- }
233
- case 2: {
234
- r = p;
235
- g = v;
236
- b = t;
237
- break;
238
- }
239
- case 3: {
240
- r = p;
241
- g = q;
242
- b = v;
243
- break;
244
- }
245
- case 4: {
246
- r = t;
247
- g = p;
248
- b = v;
249
- break;
250
- }
251
- case 5: {
252
- r = v;
253
- g = p;
254
- b = q;
255
- break;
256
- }
257
- default: {
258
- r = 0;
259
- g = 0;
260
- b = 0;
261
- }
262
- }
263
- return {
264
- r: Math.round(r * 255),
265
- g: Math.round(g * 255),
266
- b: Math.round(b * 255),
267
- a: hsv.a
268
- };
269
- }
270
- function rgbToHsl(color) {
271
- const r = color.r / 255;
272
- const g = color.g / 255;
273
- const b = color.b / 255;
274
- const max = Math.max(r, g, b);
275
- const min = Math.min(r, g, b);
276
- const diff = max - min;
277
- const sum = max + min;
278
- const l = sum / 2;
279
- let h = 0;
280
- let s = 0;
281
- if (diff !== 0) {
282
- s = l > 0.5 ? diff / (2 - sum) : diff / sum;
283
- if (max === r) {
284
- h = (g - b) / diff + (g < b ? 6 : 0);
285
- } else if (max === g) {
286
- h = (b - r) / diff + 2;
287
- } else if (max === b) {
288
- h = (r - g) / diff + 4;
289
- }
290
- h /= 6;
291
- }
292
- return {
293
- h: Math.round(h * 360),
294
- s: Math.round(s * 100),
295
- l: Math.round(l * 100)
296
- };
297
- }
298
- function hslToRgb(hsl, alpha = 1) {
299
- const h = hsl.h / 360;
300
- const s = hsl.s / 100;
301
- const l = hsl.l / 100;
302
- const c = (1 - Math.abs(2 * l - 1)) * s;
303
- const x = c * (1 - Math.abs(h * 6 % 2 - 1));
304
- const m = l - c / 2;
305
- let r = 0;
306
- let g = 0;
307
- let b = 0;
308
- if (h >= 0 && h < 1 / 6) {
309
- r = c;
310
- g = x;
311
- b = 0;
312
- } else if (h >= 1 / 6 && h < 2 / 6) {
313
- r = x;
314
- g = c;
315
- b = 0;
316
- } else if (h >= 2 / 6 && h < 3 / 6) {
317
- r = 0;
318
- g = c;
319
- b = x;
320
- } else if (h >= 3 / 6 && h < 4 / 6) {
321
- r = 0;
322
- g = x;
323
- b = c;
324
- } else if (h >= 4 / 6 && h < 5 / 6) {
325
- r = x;
326
- g = 0;
327
- b = c;
328
- } else if (h >= 5 / 6 && h < 1) {
329
- r = c;
330
- g = 0;
331
- b = x;
332
- }
333
- return {
334
- r: Math.round((r + m) * 255),
335
- g: Math.round((g + m) * 255),
336
- b: Math.round((b + m) * 255),
337
- a: alpha
338
- };
339
- }
340
- function colorToString(color, format = "hex") {
341
- switch (format) {
342
- case "hex":
343
- return rgbToHex(color);
344
- case "rgb":
345
- return color.a < 1 ? `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})` : `rgb(${color.r}, ${color.g}, ${color.b})`;
346
- case "hsl": {
347
- const hsl = rgbToHsl(color);
348
- return color.a < 1 ? `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${color.a})` : `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;
349
- }
350
- case "hsb": {
351
- const hsv = rgbToHsv(color);
352
- return color.a < 1 ? `hsba(${hsv.h}, ${hsv.s}%, ${hsv.v}%, ${color.a})` : `hsb(${hsv.h}, ${hsv.s}%, ${hsv.v}%)`;
353
- }
354
- default:
355
- return rgbToHex(color);
356
- }
357
- }
358
- function parseColorString(value) {
359
- const trimmed = value.trim();
360
- if (trimmed.startsWith("#")) {
361
- const hexMatch = trimmed.match(/^#([a-fA-F0-9]{3}|[a-fA-F0-9]{6})$/);
362
- if (hexMatch) return hexToRgb(trimmed);
363
- }
364
- const rgbMatch = trimmed.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)$/);
365
- if (rgbMatch) {
366
- return {
367
- r: Number.parseInt(rgbMatch[1] ?? "0", 10),
368
- g: Number.parseInt(rgbMatch[2] ?? "0", 10),
369
- b: Number.parseInt(rgbMatch[3] ?? "0", 10),
370
- a: rgbMatch[4] ? Number.parseFloat(rgbMatch[4]) : 1
371
- };
372
- }
373
- const hslMatch = trimmed.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*([\d.]+))?\s*\)$/);
374
- if (hslMatch) {
375
- const h = Number.parseInt(hslMatch[1] ?? "0", 10);
376
- const s = Number.parseInt(hslMatch[2] ?? "0", 10) / 100;
377
- const l = Number.parseInt(hslMatch[3] ?? "0", 10) / 100;
378
- const a = hslMatch[4] ? Number.parseFloat(hslMatch[4]) : 1;
379
- const c = (1 - Math.abs(2 * l - 1)) * s;
380
- const x = c * (1 - Math.abs(h / 60 % 2 - 1));
381
- const m = l - c / 2;
382
- let r = 0;
383
- let g = 0;
384
- let b = 0;
385
- if (h >= 0 && h < 60) {
386
- r = c;
387
- g = x;
388
- } else if (h >= 60 && h < 120) {
389
- r = x;
390
- g = c;
391
- } else if (h >= 120 && h < 180) {
392
- g = c;
393
- b = x;
394
- } else if (h >= 180 && h < 240) {
395
- g = x;
396
- b = c;
397
- } else if (h >= 240 && h < 300) {
398
- r = x;
399
- b = c;
400
- } else if (h >= 300 && h < 360) {
401
- r = c;
402
- b = x;
403
- }
404
- return {
405
- r: Math.round((r + m) * 255),
406
- g: Math.round((g + m) * 255),
407
- b: Math.round((b + m) * 255),
408
- a
409
- };
410
- }
411
- const hsbMatch = trimmed.match(/^hsba?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*([\d.]+))?\s*\)$/);
412
- if (hsbMatch) {
413
- const h = Number.parseInt(hsbMatch[1] ?? "0", 10);
414
- const s = Number.parseInt(hsbMatch[2] ?? "0", 10);
415
- const v = Number.parseInt(hsbMatch[3] ?? "0", 10);
416
- const a = hsbMatch[4] ? Number.parseFloat(hsbMatch[4]) : 1;
417
- return hsvToRgb({ h, s, v, a });
418
- }
419
- return null;
420
- }
421
-
422
- // src/components/color-picker/color-picker.store.tsx
423
- var ColorPickerStoreContext = React16__namespace.createContext(null);
424
- function useColorPickerStoreContext(consumerName) {
425
- const context = React16__namespace.useContext(ColorPickerStoreContext);
426
- if (!context) {
427
- throw new Error(`\`${consumerName}\` must be used within \`ColorPicker\``);
428
- }
429
- return context;
430
- }
431
- function useColorPickerStore(selector) {
432
- const store = useColorPickerStoreContext("useColorPickerStore");
433
- const getSnapshot = React16__namespace.useCallback(() => selector(store.getState()), [store, selector]);
434
- return React16__namespace.useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
435
- }
436
- function createColorPickerStore(listenersRef, stateRef, propsRef) {
437
- const store = {
438
- subscribe: (cb) => {
439
- listenersRef.current.add(cb);
440
- return () => listenersRef.current.delete(cb);
441
- },
442
- getState: () => stateRef.current,
443
- setColor: (value) => {
444
- if (Object.is(stateRef.current.color, value)) return;
445
- const prevState = { ...stateRef.current };
446
- stateRef.current.color = value;
447
- if (propsRef.current.onValueChange) {
448
- propsRef.current.onValueChange(colorToString(value, prevState.format));
449
- }
450
- store.notify();
451
- },
452
- setHsv: (value) => {
453
- if (Object.is(stateRef.current.hsv, value)) return;
454
- const prevState = { ...stateRef.current };
455
- stateRef.current.hsv = value;
456
- if (propsRef.current.onValueChange) {
457
- propsRef.current.onValueChange(colorToString(hsvToRgb(value), prevState.format));
458
- }
459
- store.notify();
460
- },
461
- setOpen: (value) => {
462
- if (Object.is(stateRef.current.open, value)) return;
463
- stateRef.current.open = value;
464
- propsRef.current.onOpenChange?.(value);
465
- store.notify();
466
- },
467
- setFormat: (value) => {
468
- if (Object.is(stateRef.current.format, value)) return;
469
- stateRef.current.format = value;
470
- propsRef.current.onFormatChange?.(value);
471
- store.notify();
472
- },
473
- notify: () => {
474
- for (const cb of listenersRef.current) cb();
475
- }
476
- };
477
- return store;
478
- }
479
- function ColorPicker(props) {
480
- const {
481
- value: valueProp,
482
- defaultValue = "#000000",
483
- onValueChange,
484
- format: formatProp,
485
- defaultFormat = "hex",
486
- onFormatChange,
487
- defaultOpen,
488
- open: openProp,
489
- onOpenChange,
490
- modal,
491
- name,
492
- disabled,
493
- inline,
494
- readOnly,
495
- required,
496
- ...rootProps
497
- } = props;
498
- const listenersRef = chunkN4TYSZSU_cjs.useLazyRef(() => /* @__PURE__ */ new Set());
499
- const stateRef = chunkN4TYSZSU_cjs.useLazyRef(() => {
500
- const colorString = valueProp ?? defaultValue;
501
- const color = hexToRgb(colorString);
502
- return {
503
- color,
504
- hsv: rgbToHsv(color),
505
- open: openProp ?? defaultOpen ?? false,
506
- format: formatProp ?? defaultFormat
507
- };
508
- });
509
- const propsRef = chunkN4TYSZSU_cjs.useAsRef({ onValueChange, onOpenChange, onFormatChange });
510
- const store = React16__namespace.useMemo(
511
- () => createColorPickerStore(listenersRef, stateRef, propsRef),
512
- [listenersRef, stateRef, propsRef]
513
- );
514
- return /* @__PURE__ */ jsxRuntime.jsx(ColorPickerStoreContext.Provider, { value: store, children: /* @__PURE__ */ jsxRuntime.jsx(
515
- ColorPickerImpl,
516
- {
517
- ...rootProps,
518
- value: valueProp,
519
- defaultOpen,
520
- open: openProp,
521
- modal,
522
- name,
523
- disabled,
524
- inline,
525
- readOnly,
526
- required
527
- }
528
- ) });
529
- }
530
- function ColorPickerImpl(props) {
531
- const {
532
- value: valueProp,
533
- dir: dirProp,
534
- defaultOpen,
535
- open: openProp,
536
- modal,
537
- name,
538
- ref,
539
- asChild,
540
- disabled,
541
- inline,
542
- readOnly,
543
- required,
544
- ...rootProps
545
- } = props;
546
- const store = useColorPickerStoreContext(COLOR_PICKER_IMPL_NAME);
547
- const dir = radixUi.Direction.useDirection(dirProp);
548
- const [formTrigger, setFormTrigger] = React16__namespace.useState(null);
549
- const composedRef = chunkF7NFSDOD_cjs.useComposedRefs(ref, (node) => setFormTrigger(node));
550
- const isFormControl = formTrigger ? !!formTrigger.closest("form") : true;
551
- chunkN4TYSZSU_cjs.useIsomorphicLayoutEffect(() => {
552
- if (valueProp !== void 0) {
553
- const currentState = store.getState();
554
- const color = hexToRgb(valueProp, currentState.color.a);
555
- store.setColor(color);
556
- store.setHsv(rgbToHsv(color));
557
- }
558
- }, [valueProp]);
559
- chunkN4TYSZSU_cjs.useIsomorphicLayoutEffect(() => {
560
- if (openProp !== void 0) {
561
- store.setOpen(openProp);
562
- }
563
- }, [openProp]);
564
- const contextValue = React16__namespace.useMemo(
565
- () => ({ dir, disabled, inline, readOnly, required }),
566
- [dir, disabled, inline, readOnly, required]
567
- );
568
- const value = useColorPickerStore((state) => rgbToHex(state.color));
569
- const open = useColorPickerStore((state) => state.open);
570
- const RootPrimitive = asChild ? radixUi.Slot.Slot : "div";
571
- if (inline) {
572
- return /* @__PURE__ */ jsxRuntime.jsxs(ColorPickerContext.Provider, { value: contextValue, children: [
573
- /* @__PURE__ */ jsxRuntime.jsx(RootPrimitive, { "data-slot": "color-picker", ...rootProps, ref: composedRef }),
574
- isFormControl && /* @__PURE__ */ jsxRuntime.jsx(
575
- VisuallyHiddenInput,
576
- {
577
- type: "hidden",
578
- control: formTrigger,
579
- name,
580
- value,
581
- disabled,
582
- readOnly,
583
- required
584
- }
585
- )
586
- ] });
587
- }
588
- return /* @__PURE__ */ jsxRuntime.jsx(ColorPickerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkGEDBA3JU_cjs.Popover, { defaultOpen, open, onOpenChange: store.setOpen, modal, children: [
589
- /* @__PURE__ */ jsxRuntime.jsx(RootPrimitive, { "data-slot": "color-picker", ...rootProps, ref: composedRef }),
590
- isFormControl && /* @__PURE__ */ jsxRuntime.jsx(
591
- VisuallyHiddenInput,
592
- {
593
- type: "hidden",
594
- control: formTrigger,
595
- name,
596
- value,
597
- disabled,
598
- readOnly,
599
- required
600
- }
601
- )
602
- ] }) });
603
- }
604
- function ColorPickerTrigger(props) {
605
- const { asChild, disabled, ...triggerProps } = props;
606
- const context = useColorPickerContext(COLOR_PICKER_TRIGGER_NAME);
607
- const isDisabled = disabled || context.disabled;
608
- const TriggerPrimitive = asChild ? radixUi.Slot.Slot : Button;
609
- return /* @__PURE__ */ jsxRuntime.jsx(chunkGEDBA3JU_cjs.PopoverTrigger, { asChild: true, disabled: isDisabled, children: /* @__PURE__ */ jsxRuntime.jsx(TriggerPrimitive, { "data-slot": "color-picker-trigger", ...triggerProps }) });
610
- }
611
- function ColorPickerContent(props) {
612
- const { asChild, className, children, ...popoverContentProps } = props;
613
- const context = useColorPickerContext(COLOR_PICKER_CONTENT_NAME);
614
- if (context.inline) {
615
- const ContentPrimitive = asChild ? radixUi.Slot.Slot : "div";
616
- return /* @__PURE__ */ jsxRuntime.jsx(
617
- ContentPrimitive,
618
- {
619
- "data-slot": "color-picker-content",
620
- ...popoverContentProps,
621
- className: chunkH2BWO3SI_cjs.cn("flex w-[340px] flex-col gap-4 p-4", className),
622
- children
623
- }
624
- );
625
- }
626
- return /* @__PURE__ */ jsxRuntime.jsx(
627
- chunkGEDBA3JU_cjs.PopoverContent,
628
- {
629
- "data-slot": "color-picker-content",
630
- asChild,
631
- ...popoverContentProps,
632
- className: chunkH2BWO3SI_cjs.cn("flex w-[340px] flex-col gap-4 p-4", className),
633
- children
634
- }
635
- );
636
- }
637
- function ColorPickerArea(props) {
638
- const {
639
- asChild,
640
- onPointerDown: onPointerDownProp,
641
- onPointerMove: onPointerMoveProp,
642
- onPointerUp: onPointerUpProp,
643
- className,
644
- ref,
645
- ...areaProps
646
- } = props;
647
- const propsRef = chunkN4TYSZSU_cjs.useAsRef({
648
- onPointerDown: onPointerDownProp,
649
- onPointerMove: onPointerMoveProp,
650
- onPointerUp: onPointerUpProp
651
- });
652
- const context = useColorPickerContext(COLOR_PICKER_AREA_NAME);
653
- const store = useColorPickerStoreContext(COLOR_PICKER_AREA_NAME);
654
- const hsv = useColorPickerStore((state) => state.hsv);
655
- const isDraggingRef = React16__namespace.useRef(false);
656
- const areaRef = React16__namespace.useRef(null);
657
- const composedRef = chunkF7NFSDOD_cjs.useComposedRefs(ref, areaRef);
658
- const updateColorFromPosition = React16__namespace.useCallback(
659
- (clientX, clientY) => {
660
- if (!areaRef.current) return;
661
- const rect = areaRef.current.getBoundingClientRect();
662
- const x = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width));
663
- const y = Math.max(0, Math.min(1, 1 - (clientY - rect.top) / rect.height));
664
- const newHsv = {
665
- h: hsv?.h ?? 0,
666
- s: Math.round(x * 100),
667
- v: Math.round(y * 100),
668
- a: hsv?.a ?? 1
669
- };
670
- store.setHsv(newHsv);
671
- store.setColor(hsvToRgb(newHsv));
672
- },
673
- [hsv, store]
674
- );
675
- const onPointerDown = React16__namespace.useCallback(
676
- (event) => {
677
- if (context.disabled) return;
678
- propsRef.current.onPointerDown?.(event);
679
- if (event.defaultPrevented) return;
680
- isDraggingRef.current = true;
681
- areaRef.current?.setPointerCapture(event.pointerId);
682
- updateColorFromPosition(event.clientX, event.clientY);
683
- },
684
- [context.disabled, updateColorFromPosition, propsRef]
685
- );
686
- const onPointerMove = React16__namespace.useCallback(
687
- (event) => {
688
- propsRef.current.onPointerMove?.(event);
689
- if (event.defaultPrevented) return;
690
- if (isDraggingRef.current) updateColorFromPosition(event.clientX, event.clientY);
691
- },
692
- [updateColorFromPosition, propsRef]
693
- );
694
- const onPointerUp = React16__namespace.useCallback(
695
- (event) => {
696
- propsRef.current.onPointerUp?.(event);
697
- if (event.defaultPrevented) return;
698
- isDraggingRef.current = false;
699
- areaRef.current?.releasePointerCapture(event.pointerId);
700
- },
701
- [propsRef]
702
- );
703
- const hue = hsv?.h ?? 0;
704
- const backgroundHue = hsvToRgb({ h: hue, s: 100, v: 100, a: 1 });
705
- const AreaPrimitive = asChild ? radixUi.Slot.Slot : "div";
706
- return /* @__PURE__ */ jsxRuntime.jsxs(
707
- AreaPrimitive,
708
- {
709
- "data-slot": "color-picker-area",
710
- ...areaProps,
711
- className: chunkH2BWO3SI_cjs.cn(
712
- "relative h-40 w-full cursor-crosshair touch-none rounded-sm border",
713
- context.disabled && "pointer-events-none opacity-50",
714
- className
715
- ),
716
- ref: composedRef,
717
- onPointerDown,
718
- onPointerMove,
719
- onPointerUp,
720
- children: [
721
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 overflow-hidden rounded-sm", children: [
722
- /* @__PURE__ */ jsxRuntime.jsx(
723
- "div",
724
- {
725
- className: "absolute inset-0",
726
- style: { backgroundColor: `rgb(${backgroundHue.r}, ${backgroundHue.g}, ${backgroundHue.b})` }
727
- }
728
- ),
729
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0", style: { background: "linear-gradient(to right, #fff, transparent)" } }),
730
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0", style: { background: "linear-gradient(to bottom, transparent, #000)" } })
731
- ] }),
732
- /* @__PURE__ */ jsxRuntime.jsx(
733
- "div",
734
- {
735
- className: "absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-sm",
736
- style: { left: `${hsv?.s ?? 0}%`, top: `${100 - (hsv?.v ?? 0)}%` }
737
- }
738
- )
739
- ]
740
- }
741
- );
742
- }
743
- function ColorPickerHueSlider(props) {
744
- const { className, ...sliderProps } = props;
745
- const context = useColorPickerContext(COLOR_PICKER_HUE_SLIDER_NAME);
746
- const store = useColorPickerStoreContext(COLOR_PICKER_HUE_SLIDER_NAME);
747
- const hsv = useColorPickerStore((state) => state.hsv);
748
- const onValueChange = React16__namespace.useCallback(
749
- (values) => {
750
- const newHsv = { h: values[0] ?? 0, s: hsv?.s ?? 0, v: hsv?.v ?? 0, a: hsv?.a ?? 1 };
751
- store.setHsv(newHsv);
752
- store.setColor(hsvToRgb(newHsv));
753
- },
754
- [hsv, store]
755
- );
756
- return /* @__PURE__ */ jsxRuntime.jsxs(
757
- radixUi.Slider.Root,
758
- {
759
- "data-slot": "color-picker-hue-slider",
760
- ...sliderProps,
761
- max: 360,
762
- step: 1,
763
- className: chunkH2BWO3SI_cjs.cn("relative flex w-full touch-none items-center select-none", className),
764
- value: [hsv?.h ?? 0],
765
- onValueChange,
766
- disabled: context.disabled,
767
- children: [
768
- /* @__PURE__ */ jsxRuntime.jsx(radixUi.Slider.Track, { className: "relative h-3 w-full grow overflow-hidden rounded-full bg-[linear-gradient(to_right,#ff0000_0%,#ffff00_16.66%,#00ff00_33.33%,#00ffff_50%,#0000ff_66.66%,#ff00ff_83.33%,#ff0000_100%)]", children: /* @__PURE__ */ jsxRuntime.jsx(radixUi.Slider.Range, { className: "absolute h-full" }) }),
769
- /* @__PURE__ */ jsxRuntime.jsx(radixUi.Slider.Thumb, { className: "border-primary/50 bg-background focus-visible:ring-ring block size-4 rounded-full border shadow transition-colors focus-visible:ring-1 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50" })
770
- ]
771
- }
772
- );
773
- }
774
- function ColorPickerAlphaSlider(props) {
775
- const { className, ...sliderProps } = props;
776
- const context = useColorPickerContext(COLOR_PICKER_ALPHA_SLIDER_NAME);
777
- const store = useColorPickerStoreContext(COLOR_PICKER_ALPHA_SLIDER_NAME);
778
- const color = useColorPickerStore((state) => state.color);
779
- const hsv = useColorPickerStore((state) => state.hsv);
780
- const onValueChange = React16__namespace.useCallback(
781
- (values) => {
782
- const alpha = (values[0] ?? 0) / 100;
783
- store.setColor({ ...color, a: alpha });
784
- store.setHsv({ ...hsv, a: alpha });
785
- },
786
- [color, hsv, store]
787
- );
788
- const gradientColor = `rgb(${color?.r ?? 0}, ${color?.g ?? 0}, ${color?.b ?? 0})`;
789
- return /* @__PURE__ */ jsxRuntime.jsxs(
790
- radixUi.Slider.Root,
791
- {
792
- "data-slot": "color-picker-alpha-slider",
793
- ...sliderProps,
794
- max: 100,
795
- step: 1,
796
- disabled: context.disabled,
797
- className: chunkH2BWO3SI_cjs.cn("relative flex w-full touch-none items-center select-none", className),
798
- value: [Math.round((color?.a ?? 1) * 100)],
799
- onValueChange,
800
- children: [
801
- /* @__PURE__ */ jsxRuntime.jsxs(
802
- radixUi.Slider.Track,
803
- {
804
- className: "relative h-3 w-full grow overflow-hidden rounded-full",
805
- style: {
806
- background: "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)",
807
- backgroundSize: "8px 8px",
808
- backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0px"
809
- },
810
- children: [
811
- /* @__PURE__ */ jsxRuntime.jsx(
812
- "div",
813
- {
814
- className: "absolute inset-0 rounded-full",
815
- style: { background: `linear-gradient(to right, transparent, ${gradientColor})` }
816
- }
817
- ),
818
- /* @__PURE__ */ jsxRuntime.jsx(radixUi.Slider.Range, { className: "absolute h-full" })
819
- ]
820
- }
821
- ),
822
- /* @__PURE__ */ jsxRuntime.jsx(radixUi.Slider.Thumb, { className: "border-primary/50 bg-background focus-visible:ring-ring block size-4 rounded-full border shadow transition-colors focus-visible:ring-1 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50" })
823
- ]
824
- }
825
- );
826
- }
827
- function ColorPickerSwatch(props) {
828
- const { asChild, className, ...swatchProps } = props;
829
- const context = useColorPickerContext(COLOR_PICKER_SWATCH_NAME);
830
- const color = useColorPickerStore((state) => state.color);
831
- const format = useColorPickerStore((state) => state.format);
832
- const backgroundStyle = React16__namespace.useMemo(() => {
833
- if (!color) {
834
- return {
835
- background: "linear-gradient(to bottom right, transparent calc(50% - 1px), hsl(var(--destructive)) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) no-repeat"
836
- };
837
- }
838
- const colorString = `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})`;
839
- if (color.a < 1) {
840
- return {
841
- background: `linear-gradient(${colorString}, ${colorString}), repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0% 50% / 8px 8px`
842
- };
843
- }
844
- return { backgroundColor: colorString };
845
- }, [color]);
846
- const ariaLabel = !color ? "No color selected" : `Current color: ${colorToString(color, format)}`;
847
- const SwatchPrimitive = asChild ? radixUi.Slot.Slot : "div";
848
- return /* @__PURE__ */ jsxRuntime.jsx(
849
- SwatchPrimitive,
850
- {
851
- role: "img",
852
- "aria-label": ariaLabel,
853
- "data-slot": "color-picker-swatch",
854
- ...swatchProps,
855
- className: chunkH2BWO3SI_cjs.cn("box-border size-8 rounded-sm border shadow-sm", context.disabled && "opacity-50", className),
856
- style: { ...backgroundStyle, forcedColorAdjust: "none" }
857
- }
858
- );
859
- }
860
- function ColorPickerEyeDropper(props) {
861
- const { size: sizeProp, children, disabled, ...buttonProps } = props;
862
- const context = useColorPickerContext(COLOR_PICKER_EYE_DROPPER_NAME);
863
- const store = useColorPickerStoreContext(COLOR_PICKER_EYE_DROPPER_NAME);
864
- const color = useColorPickerStore((state) => state.color);
865
- const isDisabled = disabled || context.disabled;
866
- const onEyeDropper = React16__namespace.useCallback(async () => {
867
- if (!window.EyeDropper) return;
868
- try {
869
- const eyeDropper = new window.EyeDropper();
870
- const result = await eyeDropper.open();
871
- if (result.sRGBHex) {
872
- const newColor = hexToRgb(result.sRGBHex, color?.a ?? 1);
873
- store.setColor(newColor);
874
- store.setHsv(rgbToHsv(newColor));
875
- }
876
- } catch (error) {
877
- console.warn("EyeDropper error:", error);
878
- }
879
- }, [color, store]);
880
- const hasEyeDropper = typeof window !== "undefined" && !!window.EyeDropper;
881
- if (!hasEyeDropper) return null;
882
- const size = sizeProp ?? (children ? "default" : "icon");
883
- return /* @__PURE__ */ jsxRuntime.jsx(
884
- Button,
885
- {
886
- "data-slot": "color-picker-eye-dropper",
887
- ...buttonProps,
888
- variant: "outline",
889
- size,
890
- onClick: onEyeDropper,
891
- disabled: isDisabled,
892
- children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PipetteIcon, {})
893
- }
894
- );
895
- }
896
- function ColorPickerFormatSelect(props) {
897
- const { size, disabled, className, ...selectProps } = props;
898
- const context = useColorPickerContext(COLOR_PICKER_FORMAT_SELECT_NAME);
899
- const store = useColorPickerStoreContext(COLOR_PICKER_FORMAT_SELECT_NAME);
900
- const isDisabled = disabled || context.disabled;
901
- const format = useColorPickerStore((state) => state.format);
902
- const onFormatChange = React16__namespace.useCallback(
903
- (value) => {
904
- store.setFormat(value);
905
- },
906
- [store]
907
- );
908
- return /* @__PURE__ */ jsxRuntime.jsx(
909
- chunk6HX7ETL3_cjs.Select,
910
- {
911
- "data-slot": "color-picker-format-select",
912
- ...selectProps,
913
- value: format,
914
- onValueChange: onFormatChange,
915
- disabled: isDisabled,
916
- size: size ?? "sm",
917
- className: chunkH2BWO3SI_cjs.cn(className),
918
- children: /* @__PURE__ */ jsxRuntime.jsx(chunk6HX7ETL3_cjs.SelectContent, { children: COLOR_FORMATS.map((f) => /* @__PURE__ */ jsxRuntime.jsx(chunk6HX7ETL3_cjs.SelectItem, { value: f, children: f.toUpperCase() }, f)) })
919
- }
920
- );
921
- }
922
- var inputGroupItemVariants = classVarianceAuthority.cva(
923
- "h-8 [-moz-appearance:textfield] focus-visible:z-10 focus-visible:ring-1 [&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0 [&::-webkit-outer-spin-button]:appearance-none",
924
- {
925
- variants: {
926
- position: {
927
- first: "rounded-e-none",
928
- middle: "-ms-px rounded-none border-l-0",
929
- last: "-ms-px rounded-s-none border-l-0",
930
- isolated: ""
931
- }
932
- },
933
- defaultVariants: {
934
- position: "isolated"
935
- }
936
- }
937
- );
938
- function ColorPickerInput(props) {
939
- const store = useColorPickerStoreContext(COLOR_PICKER_INPUT_NAME);
940
- const context = useColorPickerContext(COLOR_PICKER_INPUT_NAME);
941
- const color = useColorPickerStore((state) => state.color);
942
- const format = useColorPickerStore((state) => state.format);
943
- const hsv = useColorPickerStore((state) => state.hsv);
944
- const onColorChange = React16__namespace.useCallback(
945
- (newColor) => {
946
- const newHsv = rgbToHsv(newColor);
947
- store.setColor(newColor);
948
- store.setHsv(newHsv);
949
- },
950
- [store]
951
- );
952
- if (format === "hex") {
953
- return /* @__PURE__ */ jsxRuntime.jsx(HexInput, { color, onColorChange, context, ...props });
954
- }
955
- if (format === "rgb") {
956
- return /* @__PURE__ */ jsxRuntime.jsx(RgbInput, { color, onColorChange, context, ...props });
957
- }
958
- if (format === "hsl") {
959
- return /* @__PURE__ */ jsxRuntime.jsx(HslInput, { color, onColorChange, context, ...props });
960
- }
961
- if (format === "hsb") {
962
- return /* @__PURE__ */ jsxRuntime.jsx(HsbInput, { hsv, onColorChange, context, ...props });
963
- }
964
- }
965
- function InputGroupItem({ className, position, ...props }) {
966
- return /* @__PURE__ */ jsxRuntime.jsx(chunkB4M7Q5KX_cjs.Input, { "data-slot": "color-picker-input", className: chunkH2BWO3SI_cjs.cn(inputGroupItemVariants({ position, className })), ...props });
967
- }
968
- function HexInput(props) {
969
- const { color, onColorChange, context, withoutAlpha, className, ...inputProps } = props;
970
- const hexValue = rgbToHex(color);
971
- const alphaValue = Math.round((color?.a ?? 1) * 100);
972
- const onHexChange = React16__namespace.useCallback(
973
- (event) => {
974
- const value = event.target.value;
975
- const parsedColor = parseColorString(value);
976
- if (parsedColor) {
977
- onColorChange({ ...parsedColor, a: color?.a ?? 1 });
978
- }
979
- },
980
- [color, onColorChange]
981
- );
982
- const onAlphaChange = React16__namespace.useCallback(
983
- (event) => {
984
- const value = Number.parseInt(event.target.value, 10);
985
- if (!Number.isNaN(value) && value >= 0 && value <= 100) {
986
- onColorChange({ ...color, a: value / 100 });
987
- }
988
- },
989
- [color, onColorChange]
990
- );
991
- if (withoutAlpha) {
992
- return /* @__PURE__ */ jsxRuntime.jsx(
993
- InputGroupItem,
994
- {
995
- "aria-label": "Hex color value",
996
- position: "isolated",
997
- ...inputProps,
998
- placeholder: "#000000",
999
- className: chunkH2BWO3SI_cjs.cn("font-code", className),
1000
- value: hexValue,
1001
- onChange: onHexChange,
1002
- disabled: context.disabled
1003
- }
1004
- );
1005
- }
1006
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "color-picker-input-wrapper", className: chunkH2BWO3SI_cjs.cn("flex flex-1 items-center", className), children: [
1007
- /* @__PURE__ */ jsxRuntime.jsx(
1008
- InputGroupItem,
1009
- {
1010
- "aria-label": "Hex color value",
1011
- position: "first",
1012
- ...inputProps,
1013
- placeholder: "#000000",
1014
- className: "font-code flex-1",
1015
- value: hexValue,
1016
- onChange: onHexChange,
1017
- disabled: context.disabled
1018
- }
1019
- ),
1020
- /* @__PURE__ */ jsxRuntime.jsx(
1021
- InputGroupItem,
1022
- {
1023
- "aria-label": "Alpha transparency percentage",
1024
- position: "last",
1025
- ...inputProps,
1026
- placeholder: "100",
1027
- inputMode: "numeric",
1028
- pattern: "[0-9]*",
1029
- min: "0",
1030
- max: "100",
1031
- className: "w-14",
1032
- value: alphaValue,
1033
- onChange: onAlphaChange,
1034
- disabled: context.disabled
1035
- }
1036
- )
1037
- ] });
1038
- }
1039
- function RgbInput(props) {
1040
- const { color, onColorChange, context, withoutAlpha, className, ...inputProps } = props;
1041
- const rValue = Math.round(color?.r ?? 0);
1042
- const gValue = Math.round(color?.g ?? 0);
1043
- const bValue = Math.round(color?.b ?? 0);
1044
- const alphaValue = Math.round((color?.a ?? 1) * 100);
1045
- const onChannelChange = React16__namespace.useCallback(
1046
- (channel, max, isAlpha = false) => (event) => {
1047
- const value = Number.parseInt(event.target.value, 10);
1048
- if (!Number.isNaN(value) && value >= 0 && value <= max) {
1049
- const newValue = isAlpha ? value / 100 : value;
1050
- onColorChange({ ...color, [channel]: newValue });
1051
- }
1052
- },
1053
- [color, onColorChange]
1054
- );
1055
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "color-picker-input-wrapper", className: chunkH2BWO3SI_cjs.cn("flex flex-1 items-center", className), children: [
1056
- /* @__PURE__ */ jsxRuntime.jsx(
1057
- InputGroupItem,
1058
- {
1059
- "aria-label": "Red color component (0-255)",
1060
- position: "first",
1061
- ...inputProps,
1062
- placeholder: "0",
1063
- inputMode: "numeric",
1064
- pattern: "[0-9]*",
1065
- min: "0",
1066
- max: "255",
1067
- className: "w-14",
1068
- value: rValue,
1069
- onChange: onChannelChange("r", 255),
1070
- disabled: context.disabled
1071
- }
1072
- ),
1073
- /* @__PURE__ */ jsxRuntime.jsx(
1074
- InputGroupItem,
1075
- {
1076
- "aria-label": "Green color component (0-255)",
1077
- position: "middle",
1078
- ...inputProps,
1079
- placeholder: "0",
1080
- inputMode: "numeric",
1081
- pattern: "[0-9]*",
1082
- min: "0",
1083
- max: "255",
1084
- className: "w-14",
1085
- value: gValue,
1086
- onChange: onChannelChange("g", 255),
1087
- disabled: context.disabled
1088
- }
1089
- ),
1090
- /* @__PURE__ */ jsxRuntime.jsx(
1091
- InputGroupItem,
1092
- {
1093
- "aria-label": "Blue color component (0-255)",
1094
- position: withoutAlpha ? "last" : "middle",
1095
- ...inputProps,
1096
- placeholder: "0",
1097
- inputMode: "numeric",
1098
- pattern: "[0-9]*",
1099
- min: "0",
1100
- max: "255",
1101
- className: "w-14",
1102
- value: bValue,
1103
- onChange: onChannelChange("b", 255),
1104
- disabled: context.disabled
1105
- }
1106
- ),
1107
- !withoutAlpha && /* @__PURE__ */ jsxRuntime.jsx(
1108
- InputGroupItem,
1109
- {
1110
- "aria-label": "Alpha transparency percentage",
1111
- position: "last",
1112
- ...inputProps,
1113
- placeholder: "100",
1114
- inputMode: "numeric",
1115
- pattern: "[0-9]*",
1116
- min: "0",
1117
- max: "100",
1118
- className: "w-14",
1119
- value: alphaValue,
1120
- onChange: onChannelChange("a", 100, true),
1121
- disabled: context.disabled
1122
- }
1123
- )
1124
- ] });
1125
- }
1126
- function HslInput(props) {
1127
- const { color, onColorChange, context, withoutAlpha, className, ...inputProps } = props;
1128
- const hsl = React16__namespace.useMemo(() => rgbToHsl(color), [color]);
1129
- const alphaValue = Math.round((color?.a ?? 1) * 100);
1130
- const onHslChannelChange = React16__namespace.useCallback(
1131
- (channel, max) => (event) => {
1132
- const value = Number.parseInt(event.target.value, 10);
1133
- if (!Number.isNaN(value) && value >= 0 && value <= max) {
1134
- const newHsl = { ...hsl, [channel]: value };
1135
- const newColor = hslToRgb(newHsl, color?.a ?? 1);
1136
- onColorChange(newColor);
1137
- }
1138
- },
1139
- [hsl, color, onColorChange]
1140
- );
1141
- const onAlphaChange = React16__namespace.useCallback(
1142
- (event) => {
1143
- const value = Number.parseInt(event.target.value, 10);
1144
- if (!Number.isNaN(value) && value >= 0 && value <= 100) {
1145
- onColorChange({ ...color, a: value / 100 });
1146
- }
1147
- },
1148
- [color, onColorChange]
1149
- );
1150
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "color-picker-input-wrapper", className: chunkH2BWO3SI_cjs.cn("flex items-center", className), children: [
1151
- /* @__PURE__ */ jsxRuntime.jsx(
1152
- InputGroupItem,
1153
- {
1154
- "aria-label": "Hue degree (0-360)",
1155
- position: "first",
1156
- ...inputProps,
1157
- placeholder: "0",
1158
- inputMode: "numeric",
1159
- pattern: "[0-9]*",
1160
- min: "0",
1161
- max: "360",
1162
- className: "w-14",
1163
- value: hsl.h,
1164
- onChange: onHslChannelChange("h", 360),
1165
- disabled: context.disabled
1166
- }
1167
- ),
1168
- /* @__PURE__ */ jsxRuntime.jsx(
1169
- InputGroupItem,
1170
- {
1171
- "aria-label": "Saturation percentage (0-100)",
1172
- position: "middle",
1173
- ...inputProps,
1174
- placeholder: "0",
1175
- inputMode: "numeric",
1176
- pattern: "[0-9]*",
1177
- min: "0",
1178
- max: "100",
1179
- className: "w-14",
1180
- value: hsl.s,
1181
- onChange: onHslChannelChange("s", 100),
1182
- disabled: context.disabled
1183
- }
1184
- ),
1185
- /* @__PURE__ */ jsxRuntime.jsx(
1186
- InputGroupItem,
1187
- {
1188
- "aria-label": "Lightness percentage (0-100)",
1189
- position: withoutAlpha ? "last" : "middle",
1190
- ...inputProps,
1191
- placeholder: "0",
1192
- inputMode: "numeric",
1193
- pattern: "[0-9]*",
1194
- min: "0",
1195
- max: "100",
1196
- className: "w-14",
1197
- value: hsl.l,
1198
- onChange: onHslChannelChange("l", 100),
1199
- disabled: context.disabled
1200
- }
1201
- ),
1202
- !withoutAlpha && /* @__PURE__ */ jsxRuntime.jsx(
1203
- InputGroupItem,
1204
- {
1205
- "aria-label": "Alpha transparency percentage",
1206
- position: "last",
1207
- ...inputProps,
1208
- placeholder: "100",
1209
- inputMode: "numeric",
1210
- pattern: "[0-9]*",
1211
- min: "0",
1212
- max: "100",
1213
- className: "w-14",
1214
- value: alphaValue,
1215
- onChange: onAlphaChange,
1216
- disabled: context.disabled
1217
- }
1218
- )
1219
- ] });
1220
- }
1221
- function HsbInput(props) {
1222
- const { hsv, onColorChange, context, withoutAlpha, className, ...inputProps } = props;
1223
- const alphaValue = Math.round((hsv?.a ?? 1) * 100);
1224
- const onHsvChannelChange = React16__namespace.useCallback(
1225
- (channel, max) => (event) => {
1226
- const value = Number.parseInt(event.target.value, 10);
1227
- if (!Number.isNaN(value) && value >= 0 && value <= max) {
1228
- const newHsv = { ...hsv, [channel]: value };
1229
- const newColor = hsvToRgb(newHsv);
1230
- onColorChange(newColor);
1231
- }
1232
- },
1233
- [hsv, onColorChange]
1234
- );
1235
- const onAlphaChange = React16__namespace.useCallback(
1236
- (event) => {
1237
- const value = Number.parseInt(event.target.value, 10);
1238
- if (!Number.isNaN(value) && value >= 0 && value <= 100) {
1239
- const currentColor = hsvToRgb(hsv);
1240
- onColorChange({ ...currentColor, a: value / 100 });
1241
- }
1242
- },
1243
- [hsv, onColorChange]
1244
- );
1245
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "color-picker-input-wrapper", className: chunkH2BWO3SI_cjs.cn("flex items-center", className), children: [
1246
- /* @__PURE__ */ jsxRuntime.jsx(
1247
- InputGroupItem,
1248
- {
1249
- "aria-label": "Hue degree (0-360)",
1250
- position: "first",
1251
- ...inputProps,
1252
- placeholder: "0",
1253
- inputMode: "numeric",
1254
- pattern: "[0-9]*",
1255
- min: "0",
1256
- max: "360",
1257
- className: "w-14",
1258
- value: hsv?.h ?? 0,
1259
- onChange: onHsvChannelChange("h", 360),
1260
- disabled: context.disabled
1261
- }
1262
- ),
1263
- /* @__PURE__ */ jsxRuntime.jsx(
1264
- InputGroupItem,
1265
- {
1266
- "aria-label": "Saturation percentage (0-100)",
1267
- position: "middle",
1268
- ...inputProps,
1269
- placeholder: "0",
1270
- inputMode: "numeric",
1271
- pattern: "[0-9]*",
1272
- min: "0",
1273
- max: "100",
1274
- className: "w-14",
1275
- value: hsv?.s ?? 0,
1276
- onChange: onHsvChannelChange("s", 100),
1277
- disabled: context.disabled
1278
- }
1279
- ),
1280
- /* @__PURE__ */ jsxRuntime.jsx(
1281
- InputGroupItem,
1282
- {
1283
- "aria-label": "Brightness percentage (0-100)",
1284
- position: withoutAlpha ? "last" : "middle",
1285
- ...inputProps,
1286
- placeholder: "0",
1287
- inputMode: "numeric",
1288
- pattern: "[0-9]*",
1289
- min: "0",
1290
- max: "100",
1291
- className: "w-14",
1292
- value: hsv?.v ?? 0,
1293
- onChange: onHsvChannelChange("v", 100),
1294
- disabled: context.disabled
1295
- }
1296
- ),
1297
- !withoutAlpha && /* @__PURE__ */ jsxRuntime.jsx(
1298
- InputGroupItem,
1299
- {
1300
- "aria-label": "Alpha transparency percentage",
1301
- position: "last",
1302
- ...inputProps,
1303
- placeholder: "100",
1304
- inputMode: "numeric",
1305
- pattern: "[0-9]*",
1306
- min: "0",
1307
- max: "100",
1308
- className: "w-14",
1309
- value: alphaValue,
1310
- onChange: onAlphaChange,
1311
- disabled: context.disabled
1312
- }
1313
- )
1314
- ] });
1315
- }
1316
-
1317
- // src/components/stepper/stepper.constants.ts
1318
- var STEPPER_ROOT_NAME = "Stepper";
1319
- var STEPPER_NAV_NAME = "StepperNav";
1320
- var STEPPER_ITEM_NAME = "StepperItem";
1321
- var STEPPER_TRIGGER_NAME = "StepperTrigger";
1322
- var STEPPER_INDICATOR_NAME = "StepperIndicator";
1323
- var STEPPER_TITLE_NAME = "StepperTitle";
1324
- var STEPPER_DESCRIPTION_NAME = "StepperDescription";
1325
- var STEPPER_CONTENT_NAME = "StepperContent";
1326
- var STEPPER_PREV_TRIGGER_NAME = "StepperPrevTrigger";
1327
- var STEPPER_NEXT_TRIGGER_NAME = "StepperNextTrigger";
1328
- var STEPPER_ENTRY_FOCUS = "stepperFocusGroup.onEntryFocus";
1329
- var STEPPER_EVENT_OPTIONS = { bubbles: false, cancelable: true };
1330
- var STEPPER_ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
1331
- var STEPPER_MAP_KEY_TO_FOCUS_INTENT = {
1332
- ArrowLeft: "prev",
1333
- ArrowUp: "prev",
1334
- ArrowRight: "next",
1335
- ArrowDown: "next",
1336
- PageUp: "first",
1337
- Home: "first",
1338
- PageDown: "last",
1339
- End: "last"
1340
- };
1341
-
1342
- // src/components/stepper/stepper.context.tsx
1343
- var StepperContext = React16__namespace.createContext(null);
1344
- function useStepperContext(consumerName) {
1345
- const context = React16__namespace.useContext(StepperContext);
1346
- if (!context) {
1347
- throw new Error(`\`${consumerName}\` must be used within \`${STEPPER_ROOT_NAME}\``);
1348
- }
1349
- return context;
1350
- }
1351
- function createStepperStore(listenersRef, stateRef, onValueChange, onValueComplete, onValueAdd, onValueRemove, onValidate) {
1352
- const store = {
1353
- subscribe: (cb) => {
1354
- if (listenersRef.current) {
1355
- listenersRef.current.add(cb);
1356
- return () => listenersRef.current?.delete(cb);
1357
- }
1358
- return () => {
1359
- };
1360
- },
1361
- getState: () => stateRef.current ?? {
1362
- steps: /* @__PURE__ */ new Map(),
1363
- value: void 0
1364
- },
1365
- setState: (key, value) => {
1366
- const state = stateRef.current;
1367
- if (!state || Object.is(state[key], value)) return;
1368
- if (key === "value" && typeof value === "string") {
1369
- state.value = value;
1370
- onValueChange?.(value);
1371
- } else {
1372
- state[key] = value;
1373
- }
1374
- store.notify();
1375
- },
1376
- setStateWithValidation: async (value, direction) => {
1377
- if (!onValidate) {
1378
- store.setState("value", value);
1379
- return true;
1380
- }
1381
- try {
1382
- const isValid = await onValidate(value, direction);
1383
- if (isValid) {
1384
- store.setState("value", value);
1385
- }
1386
- return isValid;
1387
- } catch {
1388
- return false;
1389
- }
1390
- },
1391
- hasValidation: () => !!onValidate,
1392
- addStep: (newStep) => {
1393
- const state = stateRef.current;
1394
- if (state) {
1395
- state.steps = new Map(state.steps);
1396
- state.steps.set(newStep.value, newStep);
1397
- onValueAdd?.(newStep.value);
1398
- store.notify();
1399
- }
1400
- },
1401
- removeStep: (value) => {
1402
- const state = stateRef.current;
1403
- if (state) {
1404
- state.steps = new Map(state.steps);
1405
- state.steps.delete(value);
1406
- onValueRemove?.(value);
1407
- store.notify();
1408
- }
1409
- },
1410
- setStep: ({ value, disabled, loading, completed }) => {
1411
- const state = stateRef.current;
1412
- if (state) {
1413
- const step = state.steps.get(value);
1414
- if (step) {
1415
- const updatedStep = { ...step, completed, disabled, loading };
1416
- state.steps = new Map(state.steps);
1417
- state.steps.set(value, updatedStep);
1418
- if (completed !== step.completed) {
1419
- onValueComplete?.(value, completed);
1420
- }
1421
- store.notify();
1422
- }
1423
- }
1424
- },
1425
- notify: () => {
1426
- if (listenersRef.current) {
1427
- for (const cb of listenersRef.current) {
1428
- cb();
1429
- }
1430
- }
1431
- }
1432
- };
1433
- return store;
1434
- }
1435
- var StepperStoreContext = React16__namespace.createContext(null);
1436
- function useStepperStoreContext(consumerName) {
1437
- const context = React16__namespace.useContext(StepperStoreContext);
1438
- if (!context) {
1439
- throw new Error(`\`${consumerName}\` must be used within \`${STEPPER_ROOT_NAME}\``);
1440
- }
1441
- return context;
1442
- }
1443
- function useStepperStore(selector) {
1444
- const store = useStepperStoreContext("useStore");
1445
- const getSnapshot = React16__namespace.useCallback(() => selector(store.getState()), [selector, store]);
1446
- return React16__namespace.useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
1447
- }
1448
- function Stepper({
1449
- value,
1450
- defaultValue,
1451
- onValueChange,
1452
- onValueComplete,
1453
- onValueAdd,
1454
- onValueRemove,
1455
- onValidate,
1456
- id: idProp,
1457
- dir: dirProp,
1458
- orientation = "horizontal",
1459
- activationMode = "automatic",
1460
- asChild,
1461
- disabled = false,
1462
- nonInteractive = false,
1463
- loop = false,
1464
- className,
1465
- indicators = {},
1466
- ...rootProps
1467
- }) {
1468
- const id = React16__namespace.useId();
1469
- const rootId = idProp ?? id;
1470
- const listenersRef = chunkN4TYSZSU_cjs.useLazyRef(() => /* @__PURE__ */ new Set());
1471
- const stateRef = chunkN4TYSZSU_cjs.useLazyRef(() => ({
1472
- steps: /* @__PURE__ */ new Map(),
1473
- value: value ?? defaultValue
1474
- }));
1475
- const store = React16__namespace.useMemo(
1476
- () => createStepperStore(listenersRef, stateRef, onValueChange, onValueComplete, onValueAdd, onValueRemove, onValidate),
1477
- [listenersRef, stateRef, onValueChange, onValueComplete, onValueAdd, onValueRemove, onValidate]
1478
- );
1479
- chunkN4TYSZSU_cjs.useIsomorphicLayoutEffect(() => {
1480
- if (value !== void 0) {
1481
- store.setState("value", value);
1482
- }
1483
- }, [value]);
1484
- const dir = chunkMNDQXDV4_cjs.useDirection(dirProp);
1485
- const contextValue = React16__namespace.useMemo(
1486
- () => ({
1487
- id: rootId,
1488
- dir,
1489
- orientation,
1490
- activationMode,
1491
- disabled,
1492
- nonInteractive,
1493
- loop,
1494
- indicators
1495
- }),
1496
- [rootId, dir, orientation, activationMode, disabled, nonInteractive, loop, indicators]
1497
- );
1498
- const RootPrimitive = asChild ? reactSlot.Slot : "div";
1499
- return /* @__PURE__ */ jsxRuntime.jsx(StepperStoreContext.Provider, { value: store, children: /* @__PURE__ */ jsxRuntime.jsx(StepperContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
1500
- RootPrimitive,
1501
- {
1502
- id: rootId,
1503
- "data-disabled": disabled ? "" : void 0,
1504
- "data-orientation": orientation,
1505
- "data-slot": "stepper",
1506
- dir,
1507
- ...rootProps,
1508
- className: chunkH2BWO3SI_cjs.cn("flex w-full flex-col gap-4 data-[orientation=vertical]:flex-row", className)
1509
- }
1510
- ) }) });
1511
- }
1512
-
1513
- // src/components/stepper/stepper.types.ts
1514
- var StepperFocusIntent = {
1515
- FIRST: "first",
1516
- LAST: "last",
1517
- PREV: "prev",
1518
- NEXT: "next"
1519
- };
1520
- var StepperOrientation = {
1521
- HORIZONTAL: "horizontal",
1522
- VERTICAL: "vertical"
1523
- };
1524
- var StepperNavigationDirection = {
1525
- NEXT: "next",
1526
- PREV: "prev"
1527
- };
1528
- var StepperActivationMode = {
1529
- AUTOMATIC: "automatic",
1530
- MANUAL: "manual"
1531
- };
1532
- var StepperDataState = {
1533
- INACTIVE: "inactive",
1534
- ACTIVE: "active",
1535
- COMPLETED: "completed"
1536
- };
1537
- var StepperFocusContext = React16__namespace.createContext(null);
1538
- function useStepperFocusContext(consumerName) {
1539
- const context = React16__namespace.useContext(StepperFocusContext);
1540
- if (!context) {
1541
- throw new Error(`\`${consumerName}\` must be used within \`FocusProvider\``);
1542
- }
1543
- return context;
1544
- }
1545
-
1546
- // src/components/stepper/stepper.utils.tsx
1547
- function focusFirst(candidates, preventScroll = false) {
1548
- const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
1549
- for (const candidateRef of candidates) {
1550
- const candidate = candidateRef.current;
1551
- if (!candidate) continue;
1552
- if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
1553
- candidate.focus({ preventScroll });
1554
- if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
1555
- }
1556
- }
1557
- function getDataState(value, itemValue, stepState, steps, variant = "item") {
1558
- const stepKeys = Array.from(steps.keys());
1559
- const currentIndex = stepKeys.indexOf(itemValue);
1560
- if (stepState?.completed) {
1561
- return StepperDataState.COMPLETED;
1562
- }
1563
- if (value === itemValue) {
1564
- return variant === "separator" ? StepperDataState.INACTIVE : StepperDataState.ACTIVE;
1565
- }
1566
- if (value) {
1567
- const activeIndex = stepKeys.indexOf(value);
1568
- if (activeIndex > currentIndex) {
1569
- return StepperDataState.COMPLETED;
1570
- }
1571
- }
1572
- return StepperDataState.INACTIVE;
1573
- }
1574
- function getId(id, variant, value) {
1575
- return `${id}-${variant}-${value}`;
1576
- }
1577
- function wrapArray(array, startIndex) {
1578
- return array.map((_, index) => array[(startIndex + index) % array.length]);
1579
- }
1580
- function getDirectionAwareKey(key, dir) {
1581
- if (dir !== "rtl") return key;
1582
- return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
1583
- }
1584
- function getFocusIntent(event, dir, orientation) {
1585
- const key = getDirectionAwareKey(event.key, dir);
1586
- if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
1587
- if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
1588
- return STEPPER_MAP_KEY_TO_FOCUS_INTENT[key];
1589
- }
1590
- function StepperNav({ className, children, asChild, ref, ...listProps }) {
1591
- const context = useStepperContext(STEPPER_NAV_NAME);
1592
- const orientation = context.orientation;
1593
- const currentValue = useStepperStore((state) => state.value);
1594
- const [tabStopId, setTabStopId] = React16__namespace.useState(null);
1595
- const [isTabbingBackOut, setIsTabbingBackOut] = React16__namespace.useState(false);
1596
- const [focusableItemCount, setFocusableItemCount] = React16__namespace.useState(0);
1597
- const isClickFocusRef = React16__namespace.useRef(false);
1598
- const itemsRef = React16__namespace.useRef(/* @__PURE__ */ new Map());
1599
- const listRef = React16__namespace.useRef(null);
1600
- const composedRef = chunkMNDQXDV4_cjs.useComposedRefs(ref, listRef);
1601
- const onItemFocus = React16__namespace.useCallback((tabStopId2) => {
1602
- setTabStopId(tabStopId2);
1603
- }, []);
1604
- const onItemShiftTab = React16__namespace.useCallback(() => {
1605
- setIsTabbingBackOut(true);
1606
- }, []);
1607
- const onFocusableItemAdd = React16__namespace.useCallback(() => {
1608
- setFocusableItemCount((prevCount) => prevCount + 1);
1609
- }, []);
1610
- const onFocusableItemRemove = React16__namespace.useCallback(() => {
1611
- setFocusableItemCount((prevCount) => prevCount - 1);
1612
- }, []);
1613
- const onItemRegister = React16__namespace.useCallback((item) => {
1614
- itemsRef.current.set(item.id, item);
1615
- }, []);
1616
- const onItemUnregister = React16__namespace.useCallback((id) => {
1617
- itemsRef.current.delete(id);
1618
- }, []);
1619
- const getItems = React16__namespace.useCallback(() => {
1620
- return Array.from(itemsRef.current.values()).filter((item) => item.ref.current).sort((a, b) => {
1621
- const elementA = a.ref.current;
1622
- const elementB = b.ref.current;
1623
- if (!elementA || !elementB) return 0;
1624
- const position = elementA.compareDocumentPosition(elementB);
1625
- if (position & Node.DOCUMENT_POSITION_FOLLOWING) {
1626
- return -1;
1627
- }
1628
- if (position & Node.DOCUMENT_POSITION_PRECEDING) {
1629
- return 1;
1630
- }
1631
- return 0;
1632
- });
1633
- }, []);
1634
- const onBlur = React16__namespace.useCallback(
1635
- (event) => {
1636
- listProps.onBlur?.(event);
1637
- if (event.defaultPrevented) return;
1638
- setIsTabbingBackOut(false);
1639
- },
1640
- // eslint-disable-next-line react-hooks/exhaustive-deps
1641
- [listProps.onBlur]
1642
- );
1643
- const onFocus = React16__namespace.useCallback(
1644
- (event) => {
1645
- listProps.onFocus?.(event);
1646
- if (event.defaultPrevented) return;
1647
- const isKeyboardFocus = !isClickFocusRef.current;
1648
- if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
1649
- const entryFocusEvent = new CustomEvent(STEPPER_ENTRY_FOCUS, STEPPER_EVENT_OPTIONS);
1650
- event.currentTarget.dispatchEvent(entryFocusEvent);
1651
- if (!entryFocusEvent.defaultPrevented) {
1652
- const items = Array.from(itemsRef.current.values()).filter((item) => !item.disabled);
1653
- const selectedItem = currentValue ? items.find((item) => item.value === currentValue) : void 0;
1654
- const activeItem = items.find((item) => item.active);
1655
- const currentItem = items.find((item) => item.id === tabStopId);
1656
- const candidateItems = [selectedItem, activeItem, currentItem, ...items].filter(
1657
- Boolean
1658
- );
1659
- const candidateRefs = candidateItems.map((item) => item.ref);
1660
- focusFirst(candidateRefs, false);
1661
- }
1662
- }
1663
- isClickFocusRef.current = false;
1664
- },
1665
- // eslint-disable-next-line react-hooks/exhaustive-deps
1666
- [listProps.onFocus, isTabbingBackOut, currentValue, tabStopId]
1667
- );
1668
- const onMouseDown = React16__namespace.useCallback(
1669
- (event) => {
1670
- listProps.onMouseDown?.(event);
1671
- if (event.defaultPrevented) return;
1672
- isClickFocusRef.current = true;
1673
- },
1674
- // eslint-disable-next-line react-hooks/exhaustive-deps
1675
- [listProps.onMouseDown]
1676
- );
1677
- const focusContextValue = React16__namespace.useMemo(
1678
- () => ({
1679
- tabStopId,
1680
- onItemFocus,
1681
- onItemShiftTab,
1682
- onFocusableItemAdd,
1683
- onFocusableItemRemove,
1684
- onItemRegister,
1685
- onItemUnregister,
1686
- getItems
1687
- }),
1688
- [
1689
- tabStopId,
1690
- onItemFocus,
1691
- onItemShiftTab,
1692
- onFocusableItemAdd,
1693
- onFocusableItemRemove,
1694
- onItemRegister,
1695
- onItemUnregister,
1696
- getItems
1697
- ]
1698
- );
1699
- const StepperNavPrimitive = asChild ? reactSlot.Slot : "nav";
1700
- return /* @__PURE__ */ jsxRuntime.jsx(StepperFocusContext.Provider, { value: focusContextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
1701
- StepperNavPrimitive,
1702
- {
1703
- role: "tablist",
1704
- "data-slot": "stepper-nav",
1705
- "aria-orientation": orientation,
1706
- "data-orientation": orientation,
1707
- dir: context.dir,
1708
- tabIndex: isTabbingBackOut || focusableItemCount === 0 ? -1 : 0,
1709
- ref: composedRef,
1710
- onBlur,
1711
- onFocus,
1712
- onMouseDown,
1713
- className: chunkH2BWO3SI_cjs.cn(
1714
- "group/stepper-nav inline-flex gap-4",
1715
- "data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col",
1716
- className
1717
- ),
1718
- ...listProps,
1719
- children
1720
- }
1721
- ) });
1722
- }
1723
- var StepperItemContext = React16__namespace.createContext(null);
1724
- function useStepperItemContext(consumerName) {
1725
- const context = React16__namespace.useContext(StepperItemContext);
1726
- if (!context) {
1727
- throw new Error(`\`${consumerName}\` must be used within \`${STEPPER_ITEM_NAME}\``);
1728
- }
1729
- return context;
1730
- }
1731
- function StepperItem({
1732
- value: itemValue,
1733
- completed = false,
1734
- disabled = false,
1735
- loading = false,
1736
- asChild,
1737
- className,
1738
- children,
1739
- ...props
1740
- }) {
1741
- const { orientation, dir } = useStepperContext(STEPPER_ITEM_NAME);
1742
- const store = useStepperStoreContext(STEPPER_ITEM_NAME);
1743
- const value = useStepperStore((state) => state.value);
1744
- chunkN4TYSZSU_cjs.useIsomorphicLayoutEffect(() => {
1745
- store.addStep({ value: itemValue, completed, disabled, loading });
1746
- return () => {
1747
- store.removeStep(itemValue);
1748
- };
1749
- }, [itemValue, completed, disabled, loading]);
1750
- chunkN4TYSZSU_cjs.useIsomorphicLayoutEffect(() => {
1751
- store.setStep({ value: itemValue, completed, disabled, loading });
1752
- }, [itemValue, completed, disabled, loading]);
1753
- const stepState = useStepperStore((state) => state.steps.get(itemValue));
1754
- const steps = useStepperStore((state) => state.steps);
1755
- const dataState = getDataState(value, itemValue, stepState, steps);
1756
- const itemContextValue = React16__namespace.useMemo(
1757
- () => ({
1758
- value: itemValue,
1759
- stepState
1760
- }),
1761
- [itemValue, stepState]
1762
- );
1763
- const StepperItemPrimitive = asChild ? reactSlot.Slot : "div";
1764
- return /* @__PURE__ */ jsxRuntime.jsx(StepperItemContext.Provider, { value: itemContextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
1765
- StepperItemPrimitive,
1766
- {
1767
- "data-disabled": stepState?.disabled ? "" : void 0,
1768
- "data-orientation": orientation,
1769
- "data-state": dataState,
1770
- "data-slot": "stepper-item",
1771
- dir,
1772
- className: chunkH2BWO3SI_cjs.cn(
1773
- "group/step flex flex-1 flex-col justify-end data-[disabled]:opacity-50",
1774
- "",
1775
- // "group-data-[orientation=horizontal]/stepper-nav:flex-row group-data-[orientation=vertical]/stepper-nav:flex-col",
1776
- className
1777
- ),
1778
- ...props,
1779
- children: [
1780
- children,
1781
- /* @__PURE__ */ jsxRuntime.jsx(
1782
- "div",
1783
- {
1784
- "data-state": dataState,
1785
- className: chunkH2BWO3SI_cjs.cn(
1786
- "bg-border h-1 w-full transition-colors duration-500",
1787
- "data-[state=active]:bg-primary data-[state=completed]:bg-success"
1788
- )
1789
- }
1790
- )
1791
- ]
1792
- }
1793
- ) });
1794
- }
1795
- function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps }) {
1796
- const context = useStepperContext(STEPPER_TRIGGER_NAME);
1797
- const itemContext = useStepperItemContext(STEPPER_TRIGGER_NAME);
1798
- const store = useStepperStoreContext(STEPPER_TRIGGER_NAME);
1799
- const focusContext = useStepperFocusContext(STEPPER_TRIGGER_NAME);
1800
- const value = useStepperStore((state) => state.value);
1801
- const itemValue = itemContext.value;
1802
- const stepState = useStepperStore((state) => state.steps.get(itemValue));
1803
- const activationMode = context.activationMode;
1804
- const orientation = context.orientation;
1805
- const loop = context.loop;
1806
- const steps = useStepperStore((state) => state.steps);
1807
- const stepIndex = Array.from(steps.keys()).indexOf(itemValue);
1808
- const stepPosition = stepIndex + 1;
1809
- const stepCount = steps.size;
1810
- const triggerId = getId(context.id, "trigger", itemValue);
1811
- const contentId = getId(context.id, "content", itemValue);
1812
- const titleId = getId(context.id, "title", itemValue);
1813
- const descriptionId = getId(context.id, "description", itemValue);
1814
- const isDisabled = context.disabled || stepState?.disabled || disabled;
1815
- const isActive = value === itemValue;
1816
- const isTabStop = focusContext.tabStopId === triggerId;
1817
- const dataState = getDataState(value, itemValue, stepState, steps);
1818
- const triggerRef = React16__namespace.useRef(null);
1819
- const composedRef = chunkMNDQXDV4_cjs.useComposedRefs(ref, triggerRef);
1820
- const isArrowKeyPressedRef = React16__namespace.useRef(false);
1821
- const isMouseClickRef = React16__namespace.useRef(false);
1822
- React16__namespace.useEffect(() => {
1823
- function onKeyDown2(event) {
1824
- if (STEPPER_ARROW_KEYS.includes(event.key)) {
1825
- isArrowKeyPressedRef.current = true;
1826
- }
1827
- }
1828
- function onKeyUp() {
1829
- isArrowKeyPressedRef.current = false;
1830
- }
1831
- document.addEventListener("keydown", onKeyDown2);
1832
- document.addEventListener("keyup", onKeyUp);
1833
- return () => {
1834
- document.removeEventListener("keydown", onKeyDown2);
1835
- document.removeEventListener("keyup", onKeyUp);
1836
- };
1837
- }, []);
1838
- chunkN4TYSZSU_cjs.useIsomorphicLayoutEffect(() => {
1839
- focusContext.onItemRegister({
1840
- id: triggerId,
1841
- ref: triggerRef,
1842
- value: itemValue,
1843
- active: isTabStop,
1844
- disabled: !!isDisabled
1845
- });
1846
- if (!isDisabled) {
1847
- focusContext.onFocusableItemAdd();
1848
- }
1849
- return () => {
1850
- focusContext.onItemUnregister(triggerId);
1851
- if (!isDisabled) {
1852
- focusContext.onFocusableItemRemove();
1853
- }
1854
- };
1855
- }, [focusContext, triggerId, itemValue, isTabStop, isDisabled]);
1856
- const onClick = React16__namespace.useCallback(
1857
- async (event) => {
1858
- triggerProps.onClick?.(event);
1859
- if (event.defaultPrevented) return;
1860
- if (!isDisabled && !context.nonInteractive) {
1861
- const currentStepIndex = Array.from(steps.keys()).indexOf(value ?? "");
1862
- const targetStepIndex = Array.from(steps.keys()).indexOf(itemValue);
1863
- const direction = targetStepIndex > currentStepIndex ? "next" : "prev";
1864
- await store.setStateWithValidation(itemValue, direction);
1865
- }
1866
- },
1867
- // eslint-disable-next-line react-hooks/exhaustive-deps
1868
- [isDisabled, context.nonInteractive, store, itemValue, value, steps, triggerProps.onClick]
1869
- );
1870
- const onFocus = React16__namespace.useCallback(
1871
- async (event) => {
1872
- triggerProps.onFocus?.(event);
1873
- if (event.defaultPrevented) return;
1874
- focusContext.onItemFocus(triggerId);
1875
- const isKeyboardFocus = !isMouseClickRef.current;
1876
- if (!isActive && !isDisabled && activationMode !== "manual" && !context.nonInteractive && isKeyboardFocus) {
1877
- const currentStepIndex = Array.from(steps.keys()).indexOf(value || "");
1878
- const targetStepIndex = Array.from(steps.keys()).indexOf(itemValue);
1879
- const direction = targetStepIndex > currentStepIndex ? "next" : "prev";
1880
- await store.setStateWithValidation(itemValue, direction);
1881
- }
1882
- isMouseClickRef.current = false;
1883
- },
1884
- [
1885
- triggerProps,
1886
- focusContext,
1887
- triggerId,
1888
- isActive,
1889
- isDisabled,
1890
- activationMode,
1891
- context.nonInteractive,
1892
- steps,
1893
- value,
1894
- itemValue,
1895
- store
1896
- ]
1897
- );
1898
- const onKeyDown = React16__namespace.useCallback(
1899
- async (event) => {
1900
- triggerProps.onKeyDown?.(event);
1901
- if (event.defaultPrevented) return;
1902
- if (event.key === "Enter" && context.nonInteractive) {
1903
- event.preventDefault();
1904
- return;
1905
- }
1906
- if ((event.key === "Enter" || event.key === " ") && activationMode === "manual" && !context.nonInteractive) {
1907
- event.preventDefault();
1908
- if (!isDisabled && triggerRef.current) {
1909
- triggerRef.current.click();
1910
- }
1911
- return;
1912
- }
1913
- if (event.key === "Tab" && event.shiftKey) {
1914
- focusContext.onItemShiftTab();
1915
- return;
1916
- }
1917
- if (event.target !== event.currentTarget) return;
1918
- const focusIntent = getFocusIntent(event, context.dir, orientation);
1919
- if (focusIntent !== void 0) {
1920
- if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
1921
- event.preventDefault();
1922
- const items = focusContext.getItems().filter((item) => !item.disabled);
1923
- let candidateRefs = items.map((item) => item.ref);
1924
- if (focusIntent === "last") {
1925
- candidateRefs.reverse();
1926
- } else if (focusIntent === "prev" || focusIntent === "next") {
1927
- if (focusIntent === "prev") candidateRefs.reverse();
1928
- const currentIndex = candidateRefs.findIndex((ref2) => ref2.current === event.currentTarget);
1929
- candidateRefs = loop ? wrapArray(candidateRefs, currentIndex + 1) : candidateRefs.slice(currentIndex + 1);
1930
- }
1931
- if (store.hasValidation() && candidateRefs.length > 0) {
1932
- const nextRef = candidateRefs[0];
1933
- const nextElement = nextRef?.current;
1934
- const nextItem = items.find((item) => item.ref.current === nextElement);
1935
- if (nextItem && nextItem.value !== itemValue) {
1936
- const currentStepIndex = Array.from(steps.keys()).indexOf(value || "");
1937
- const targetStepIndex = Array.from(steps.keys()).indexOf(nextItem.value);
1938
- const direction = targetStepIndex > currentStepIndex ? "next" : "prev";
1939
- if (direction === "next") {
1940
- const isValid = await store.setStateWithValidation(nextItem.value, direction);
1941
- if (!isValid) return;
1942
- } else {
1943
- store.setState("value", nextItem.value);
1944
- }
1945
- queueMicrotask(() => nextElement?.focus());
1946
- return;
1947
- }
1948
- }
1949
- queueMicrotask(() => focusFirst(candidateRefs));
1950
- }
1951
- },
1952
- // eslint-disable-next-line react-hooks/exhaustive-deps
1953
- [
1954
- focusContext,
1955
- context.nonInteractive,
1956
- context.dir,
1957
- activationMode,
1958
- orientation,
1959
- loop,
1960
- isDisabled,
1961
- triggerProps.onKeyDown,
1962
- store,
1963
- itemValue,
1964
- value,
1965
- steps
1966
- ]
1967
- );
1968
- const onMouseDown = React16__namespace.useCallback(
1969
- (event) => {
1970
- triggerProps.onMouseDown?.(event);
1971
- if (event.defaultPrevented) {
1972
- return;
1973
- }
1974
- isMouseClickRef.current = true;
1975
- if (isDisabled) {
1976
- event.preventDefault();
1977
- } else {
1978
- focusContext.onItemFocus(triggerId);
1979
- }
1980
- },
1981
- // eslint-disable-next-line react-hooks/exhaustive-deps
1982
- [focusContext, triggerId, isDisabled, triggerProps.onMouseDown]
1983
- );
1984
- const TriggerPrimitive = asChild ? reactSlot.Slot : "button";
1985
- return /* @__PURE__ */ jsxRuntime.jsx(
1986
- TriggerPrimitive,
1987
- {
1988
- id: triggerId,
1989
- role: "tab",
1990
- type: "button",
1991
- disabled: isDisabled,
1992
- tabIndex: isTabStop ? 0 : -1,
1993
- ref: composedRef,
1994
- "data-slot": "stepper-trigger",
1995
- "data-disabled": isDisabled ? "" : void 0,
1996
- "data-state": dataState,
1997
- "aria-controls": contentId,
1998
- "aria-current": isActive ? "step" : void 0,
1999
- "aria-describedby": `${titleId} ${descriptionId}`,
2000
- "aria-posinset": stepPosition,
2001
- "aria-selected": isActive,
2002
- "aria-setsize": stepCount,
2003
- className: chunkH2BWO3SI_cjs.cn(
2004
- "inline-flex w-full cursor-pointer items-center gap-3 rounded text-left transition-colors duration-500 outline-none",
2005
- "disabled:pointer-events-none",
2006
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
2007
- className
2008
- ),
2009
- onClick,
2010
- onFocus,
2011
- onKeyDown,
2012
- onMouseDown,
2013
- ...triggerProps
2014
- }
2015
- );
2016
- }
2017
- function StepperIndicator({ className, children, asChild, ref, ...props }) {
2018
- const { indicators, dir } = useStepperContext(STEPPER_INDICATOR_NAME);
2019
- const itemContext = useStepperItemContext(STEPPER_INDICATOR_NAME);
2020
- const value = useStepperStore((state) => state.value);
2021
- const itemValue = itemContext.value;
2022
- const stepState = useStepperStore((state) => state.steps.get(itemValue));
2023
- const steps = useStepperStore((state) => state.steps);
2024
- const stepPosition = Array.from(steps.keys()).indexOf(itemValue) + 1;
2025
- const dataState = getDataState(value, itemValue, stepState, steps);
2026
- const StepperIndicatorPrimitive = asChild ? reactSlot.Slot : "div";
2027
- return /* @__PURE__ */ jsxRuntime.jsx(
2028
- StepperIndicatorPrimitive,
2029
- {
2030
- "data-slot": "stepper-indicator",
2031
- "data-state": dataState,
2032
- dir,
2033
- ref,
2034
- className: chunkH2BWO3SI_cjs.cn(
2035
- "bg-muted border-border text-muted-foreground relative flex size-6 shrink-0 items-center justify-center self-end overflow-hidden rounded-t border-x border-t text-xs transition-colors duration-500",
2036
- "data-[state=completed]:bg-success/50 data-[state=completed]:border-success data-[state=completed]:text-success-foreground",
2037
- "data-[state=active]:bg-primary/50 data-[state=active]:border-primary data-[state=active]:text-primary-foreground",
2038
- className
2039
- ),
2040
- ...props,
2041
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute", children: typeof children === "function" ? children(dataState) : indicators && (itemContext.stepState?.loading && indicators.loading || dataState === "completed" && indicators.completed || dataState === "active" && indicators.active || dataState === "inactive" && indicators.inactive) ? itemContext.stepState?.loading && indicators.loading || dataState === "completed" && indicators.completed || dataState === "active" && indicators.active || dataState === "inactive" && indicators.inactive : children ? children : stepPosition })
2042
- }
2043
- );
2044
- }
2045
- function StepperTitle({ className, asChild = false, ...props }) {
2046
- const context = useStepperContext(STEPPER_TITLE_NAME);
2047
- const itemContext = useStepperItemContext(STEPPER_TITLE_NAME);
2048
- const titleId = getId(context.id, "title", itemContext.value);
2049
- const TitlePrimitive = asChild ? reactSlot.Slot : "h3";
2050
- return /* @__PURE__ */ jsxRuntime.jsx(
2051
- TitlePrimitive,
2052
- {
2053
- id: titleId,
2054
- "data-slot": "stepper-title",
2055
- dir: context.dir,
2056
- className: chunkH2BWO3SI_cjs.cn("text-sm leading-none font-medium", className),
2057
- ...props
2058
- }
2059
- );
2060
- }
2061
- function StepperDescription({ className, asChild, ...props }) {
2062
- const context = useStepperContext(STEPPER_DESCRIPTION_NAME);
2063
- const itemContext = useStepperItemContext(STEPPER_DESCRIPTION_NAME);
2064
- const descriptionId = getId(context.id, "description", itemContext.value);
2065
- const StepperDescriptionPrimitive = asChild ? reactSlot.Slot : "span";
2066
- return /* @__PURE__ */ jsxRuntime.jsx(
2067
- StepperDescriptionPrimitive,
2068
- {
2069
- id: descriptionId,
2070
- "data-slot": "stepper-description",
2071
- dir: context.dir,
2072
- className: chunkH2BWO3SI_cjs.cn("text-muted-foreground text-sm", className),
2073
- ...props
2074
- }
2075
- );
2076
- }
2077
- function StepperPanel({ children, asChild = false, className, ...props }) {
2078
- const currentValue = useStepperStore((state) => state.value);
2079
- const StepperPanelPrimitive = asChild ? reactSlot.Slot : "div";
2080
- return /* @__PURE__ */ jsxRuntime.jsx(
2081
- StepperPanelPrimitive,
2082
- {
2083
- "data-slot": "stepper-panel",
2084
- "data-state": currentValue,
2085
- className: chunkH2BWO3SI_cjs.cn("w-full", className),
2086
- ...props,
2087
- children
2088
- }
2089
- );
2090
- }
2091
- function StepperContent({
2092
- value: valueProp,
2093
- asChild = false,
2094
- forceMount = false,
2095
- className,
2096
- ...props
2097
- }) {
2098
- const context = useStepperContext(STEPPER_CONTENT_NAME);
2099
- const value = useStepperStore((state) => state.value);
2100
- const contentId = getId(context.id, "content", valueProp);
2101
- const triggerId = getId(context.id, "trigger", valueProp);
2102
- const isActive = value === valueProp;
2103
- if (!isActive && !forceMount) {
2104
- return null;
2105
- }
2106
- const ContentPrimitive = asChild ? reactSlot.Slot : "div";
2107
- return /* @__PURE__ */ jsxRuntime.jsx(
2108
- ContentPrimitive,
2109
- {
2110
- id: contentId,
2111
- role: "tabpanel",
2112
- "data-state": value,
2113
- "aria-labelledby": triggerId,
2114
- "data-slot": "stepper-content",
2115
- dir: context.dir,
2116
- className: chunkH2BWO3SI_cjs.cn("w-full", className, !isActive && forceMount && "hidden"),
2117
- hidden: !isActive && forceMount,
2118
- ...props
2119
- }
2120
- );
2121
- }
2122
- function StepperNextTrigger({ asChild = false, onClick, disabled, ...props }) {
2123
- const store = useStepperStoreContext(STEPPER_NEXT_TRIGGER_NAME);
2124
- const value = useStepperStore((state) => state.value);
2125
- const steps = useStepperStore((state) => state.steps);
2126
- const stepKeys = Array.from(steps.keys());
2127
- const currentIndex = value ? stepKeys.indexOf(value) : -1;
2128
- const isDisabled = disabled || currentIndex >= stepKeys.length - 1;
2129
- const handleClick = React16__namespace.useCallback(
2130
- async (event) => {
2131
- onClick?.(event);
2132
- if (event.defaultPrevented || isDisabled) {
2133
- return;
2134
- }
2135
- const nextIndex = Math.min(currentIndex + 1, stepKeys.length - 1);
2136
- const nextStepValue = stepKeys[nextIndex];
2137
- if (nextStepValue) {
2138
- await store.setStateWithValidation(nextStepValue, "next");
2139
- }
2140
- },
2141
- [onClick, isDisabled, currentIndex, stepKeys, store]
2142
- );
2143
- const StepperNextTriggerPrimitive = asChild ? reactSlot.Slot : "button";
2144
- return /* @__PURE__ */ jsxRuntime.jsx(
2145
- StepperNextTriggerPrimitive,
2146
- {
2147
- type: "button",
2148
- "data-slot": "stepper-next-trigger",
2149
- disabled: isDisabled,
2150
- onClick: handleClick,
2151
- ...props
2152
- }
2153
- );
2154
- }
2155
- function StepperPrevTrigger({ asChild = false, disabled, onClick, ...props }) {
2156
- const store = useStepperStoreContext(STEPPER_PREV_TRIGGER_NAME);
2157
- const value = useStepperStore((state) => state.value);
2158
- const steps = useStepperStore((state) => state.steps);
2159
- const stepKeys = Array.from(steps.keys());
2160
- const currentIndex = value ? stepKeys.indexOf(value) : -1;
2161
- const isDisabled = disabled || currentIndex <= 0;
2162
- const handleClick = React16__namespace.useCallback(
2163
- async (event) => {
2164
- onClick?.(event);
2165
- if (event.defaultPrevented || isDisabled) {
2166
- return;
2167
- }
2168
- const prevIndex = Math.max(currentIndex - 1, 0);
2169
- const prevStepValue = stepKeys[prevIndex];
2170
- if (prevStepValue) {
2171
- store.setState("value", prevStepValue);
2172
- }
2173
- },
2174
- [currentIndex, isDisabled, onClick, stepKeys, store]
2175
- );
2176
- const StepperPrevTriggerPrimitive = asChild ? reactSlot.Slot : "button";
2177
- return /* @__PURE__ */ jsxRuntime.jsx(
2178
- StepperPrevTriggerPrimitive,
2179
- {
2180
- type: "button",
2181
- "data-slot": "stepper-prev-trigger",
2182
- disabled: isDisabled,
2183
- onClick: handleClick,
2184
- ...props
2185
- }
2186
- );
2187
- }
2188
- var Toaster = ({ theme = "system", ...props }) => {
2189
- return /* @__PURE__ */ jsxRuntime.jsx(
2190
- sonner.Toaster,
2191
- {
2192
- className: "group",
2193
- icons: {
2194
- success: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheckIcon, { className: "size-4" }),
2195
- info: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "size-4" }),
2196
- warning: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlertIcon, { className: "size-4" }),
2197
- error: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.OctagonXIcon, { className: "size-4" }),
2198
- loading: /* @__PURE__ */ jsxRuntime.jsx(chunk3WSQRFUY_cjs.Spinner, {})
2199
- },
2200
- toastOptions: {
2201
- classNames: {
2202
- toast: "!bg-popover !text-popover-foreground !border !border-border !rounded",
2203
- description: "!text-muted-foreground"
2204
- }
2205
- },
2206
- theme,
2207
- ...props
2208
- }
2209
- );
2210
- };
2211
-
2212
- // src/components/sidebar/sidebar.constants.ts
2213
- var SIDEBAR_COOKIE_NAME = "sidebar_state";
2214
- var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
2215
- var SIDEBAR_WIDTH = "16rem";
2216
- var SIDEBAR_WIDTH_MOBILE = "18rem";
2217
- var SIDEBAR_WIDTH_ICON = "3rem";
2218
- var SIDEBAR_ROOT_NAME = "SidebarProvider";
2219
- var SidebarContext = React16__namespace.createContext(null);
2220
- function useSidebarContext(consumerName) {
2221
- const context = React16__namespace.useContext(SidebarContext);
2222
- if (!context) {
2223
- throw new Error(`\`${consumerName}\` must be used within \`${SIDEBAR_ROOT_NAME}\``);
2224
- }
2225
- return context;
2226
- }
2227
- function useSidebar() {
2228
- return useSidebarContext("useSidebar");
2229
- }
2230
- function SidebarProvider({
2231
- defaultOpen = true,
2232
- open: openProp,
2233
- onOpenChange: setOpenProp,
2234
- className,
2235
- style,
2236
- children,
2237
- ...props
2238
- }) {
2239
- const isMobile = chunkF7NFSDOD_cjs.useIsMobile();
2240
- const [openMobile, setOpenMobile] = React16__namespace.useState(false);
2241
- const [_open, _setOpen] = React16__namespace.useState(defaultOpen);
2242
- const open = openProp ?? _open;
2243
- const setOpen = React16__namespace.useCallback(
2244
- (value) => {
2245
- const openState = typeof value === "function" ? value(open) : value;
2246
- if (setOpenProp) {
2247
- setOpenProp(openState);
2248
- } else {
2249
- _setOpen(openState);
2250
- }
2251
- document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
2252
- },
2253
- [setOpenProp, open]
2254
- );
2255
- const toggleSidebar = React16__namespace.useCallback(() => {
2256
- return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
2257
- }, [isMobile, setOpen, setOpenMobile]);
2258
- React16__namespace.useEffect(() => {
2259
- const handleKeyDown = (event) => {
2260
- if (event.key === "b" && (event.metaKey || event.ctrlKey)) {
2261
- event.preventDefault();
2262
- toggleSidebar();
2263
- }
2264
- };
2265
- window.addEventListener("keydown", handleKeyDown);
2266
- return () => window.removeEventListener("keydown", handleKeyDown);
2267
- }, [toggleSidebar]);
2268
- const state = open ? "expanded" : "collapsed";
2269
- const contextValue = React16__namespace.useMemo(
2270
- () => ({ state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar }),
2271
- [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
2272
- );
2273
- return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
2274
- "div",
2275
- {
2276
- "data-slot": "sidebar-wrapper",
2277
- style: {
2278
- "--sidebar-width": SIDEBAR_WIDTH,
2279
- "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
2280
- ...style
2281
- },
2282
- className: chunkH2BWO3SI_cjs.cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", className),
2283
- ...props,
2284
- children
2285
- }
2286
- ) });
2287
- }
2288
- function Sidebar({
2289
- side = "left",
2290
- variant = "sidebar",
2291
- collapsible = "offcanvas",
2292
- className,
2293
- children,
2294
- dir,
2295
- ...props
2296
- }) {
2297
- const { isMobile, state, openMobile, setOpenMobile } = useSidebarContext("Sidebar");
2298
- if (collapsible === "none") {
2299
- return /* @__PURE__ */ jsxRuntime.jsx(
2300
- "div",
2301
- {
2302
- "data-slot": "sidebar",
2303
- className: chunkH2BWO3SI_cjs.cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className),
2304
- ...props,
2305
- children
2306
- }
2307
- );
2308
- }
2309
- if (isMobile) {
2310
- return /* @__PURE__ */ jsxRuntime.jsx(chunk375QAB65_cjs.Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
2311
- chunk375QAB65_cjs.SheetContent,
2312
- {
2313
- dir,
2314
- "data-sidebar": "sidebar",
2315
- "data-slot": "sidebar",
2316
- "data-mobile": "true",
2317
- className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0",
2318
- style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
2319
- side,
2320
- showCloseButton: false,
2321
- children: [
2322
- /* @__PURE__ */ jsxRuntime.jsxs(chunk375QAB65_cjs.SheetHeader, { className: "sr-only", children: [
2323
- /* @__PURE__ */ jsxRuntime.jsx(chunk375QAB65_cjs.SheetTitle, { children: "Sidebar" }),
2324
- /* @__PURE__ */ jsxRuntime.jsx(chunk375QAB65_cjs.SheetDescription, { children: "Displays the mobile sidebar." })
2325
- ] }),
2326
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full flex-col", children })
2327
- ]
2328
- }
2329
- ) });
2330
- }
2331
- return /* @__PURE__ */ jsxRuntime.jsxs(
2332
- "div",
2333
- {
2334
- className: "group peer text-sidebar-foreground hidden md:block",
2335
- "data-state": state,
2336
- "data-collapsible": state === "collapsed" ? collapsible : "",
2337
- "data-variant": variant,
2338
- "data-side": side,
2339
- "data-slot": "sidebar",
2340
- children: [
2341
- /* @__PURE__ */ jsxRuntime.jsx(
2342
- "div",
2343
- {
2344
- "data-slot": "sidebar-gap",
2345
- className: chunkH2BWO3SI_cjs.cn(
2346
- "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
2347
- "group-data-[collapsible=offcanvas]:w-0",
2348
- "group-data-[side=right]:rotate-180",
2349
- variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
2350
- )
2351
- }
2352
- ),
2353
- /* @__PURE__ */ jsxRuntime.jsx(
2354
- "div",
2355
- {
2356
- "data-slot": "sidebar-container",
2357
- "data-side": side,
2358
- className: chunkH2BWO3SI_cjs.cn(
2359
- "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
2360
- variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
2361
- className
2362
- ),
2363
- ...props,
2364
- children: /* @__PURE__ */ jsxRuntime.jsx(
2365
- "div",
2366
- {
2367
- "data-sidebar": "sidebar",
2368
- "data-slot": "sidebar-inner",
2369
- className: "bg-sidebar group-data-[variant=floating]:ring-sidebar-border flex size-full flex-col group-data-[variant=floating]:rounded group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1",
2370
- children
2371
- }
2372
- )
2373
- }
2374
- )
2375
- ]
2376
- }
2377
- );
2378
- }
2379
- function SidebarTrigger({ className, onClick, ...props }) {
2380
- const { toggleSidebar } = useSidebarContext("SidebarTrigger");
2381
- return /* @__PURE__ */ jsxRuntime.jsxs(
2382
- Button,
2383
- {
2384
- "data-sidebar": "trigger",
2385
- "data-slot": "sidebar-trigger",
2386
- variant: "ghost",
2387
- size: "icon-sm",
2388
- className: chunkH2BWO3SI_cjs.cn(className),
2389
- onClick: (event) => {
2390
- onClick?.(event);
2391
- toggleSidebar();
2392
- },
2393
- ...props,
2394
- children: [
2395
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeftIcon, { className: "cn-rtl-flip" }),
2396
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
2397
- ]
2398
- }
2399
- );
2400
- }
2401
- function SidebarRail({ className, ...props }) {
2402
- const { toggleSidebar } = useSidebarContext("SidebarRail");
2403
- return /* @__PURE__ */ jsxRuntime.jsx(
2404
- "button",
2405
- {
2406
- "data-sidebar": "rail",
2407
- "data-slot": "sidebar-rail",
2408
- "aria-label": "Toggle Sidebar",
2409
- tabIndex: -1,
2410
- onClick: toggleSidebar,
2411
- title: "Toggle Sidebar",
2412
- className: chunkH2BWO3SI_cjs.cn(
2413
- "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
2414
- "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
2415
- "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
2416
- "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
2417
- "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
2418
- "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
2419
- className
2420
- ),
2421
- ...props
2422
- }
2423
- );
2424
- }
2425
- function SidebarInset({ className, ...props }) {
2426
- return /* @__PURE__ */ jsxRuntime.jsx(
2427
- "main",
2428
- {
2429
- "data-slot": "sidebar-inset",
2430
- className: chunkH2BWO3SI_cjs.cn(
2431
- "bg-background relative flex w-full flex-1 flex-col md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
2432
- className
2433
- ),
2434
- ...props
2435
- }
2436
- );
2437
- }
2438
- function SidebarInput({ className, ...props }) {
2439
- return /* @__PURE__ */ jsxRuntime.jsx(
2440
- chunkB4M7Q5KX_cjs.Input,
2441
- {
2442
- "data-slot": "sidebar-input",
2443
- "data-sidebar": "input",
2444
- className: chunkH2BWO3SI_cjs.cn("bg-background h-8 w-full shadow-none", className),
2445
- ...props
2446
- }
2447
- );
2448
- }
2449
- function SidebarHeader({ className, ...props }) {
2450
- return /* @__PURE__ */ jsxRuntime.jsx(
2451
- "div",
2452
- {
2453
- "data-slot": "sidebar-header",
2454
- "data-sidebar": "header",
2455
- className: chunkH2BWO3SI_cjs.cn("flex flex-col gap-2 p-2", className),
2456
- ...props
2457
- }
2458
- );
2459
- }
2460
- function SidebarFooter({ className, ...props }) {
2461
- return /* @__PURE__ */ jsxRuntime.jsx(
2462
- "div",
2463
- {
2464
- "data-slot": "sidebar-footer",
2465
- "data-sidebar": "footer",
2466
- className: chunkH2BWO3SI_cjs.cn("flex flex-col gap-2 p-2", className),
2467
- ...props
2468
- }
2469
- );
2470
- }
2471
- function SidebarSeparator({ className, ...props }) {
2472
- return /* @__PURE__ */ jsxRuntime.jsx(
2473
- chunkDUAM4RTP_cjs.Separator,
2474
- {
2475
- "data-slot": "sidebar-separator",
2476
- "data-sidebar": "separator",
2477
- className: chunkH2BWO3SI_cjs.cn("bg-sidebar-border mx-2 w-auto", className),
2478
- ...props
2479
- }
2480
- );
2481
- }
2482
- function SidebarContent({ className, ...props }) {
2483
- return /* @__PURE__ */ jsxRuntime.jsx(
2484
- "div",
2485
- {
2486
- "data-slot": "sidebar-content",
2487
- "data-sidebar": "content",
2488
- className: chunkH2BWO3SI_cjs.cn(
2489
- "no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
2490
- className
2491
- ),
2492
- ...props
2493
- }
2494
- );
2495
- }
2496
- function SidebarGroup({ className, ...props }) {
2497
- return /* @__PURE__ */ jsxRuntime.jsx(
2498
- "div",
2499
- {
2500
- "data-slot": "sidebar-group",
2501
- "data-sidebar": "group",
2502
- className: chunkH2BWO3SI_cjs.cn("relative flex w-full min-w-0 flex-col p-2", className),
2503
- ...props
2504
- }
2505
- );
2506
- }
2507
- function SidebarGroupLabel({ className, asChild = false, ...props }) {
2508
- const Comp = asChild ? reactSlot.Slot : "div";
2509
- return /* @__PURE__ */ jsxRuntime.jsx(
2510
- Comp,
2511
- {
2512
- "data-slot": "sidebar-group-label",
2513
- "data-sidebar": "group-label",
2514
- className: chunkH2BWO3SI_cjs.cn(
2515
- "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
2516
- className
2517
- ),
2518
- ...props
2519
- }
2520
- );
2521
- }
2522
- function SidebarGroupAction({ className, asChild = false, ...props }) {
2523
- const Comp = asChild ? reactSlot.Slot : "button";
2524
- return /* @__PURE__ */ jsxRuntime.jsx(
2525
- Comp,
2526
- {
2527
- "data-slot": "sidebar-group-action",
2528
- "data-sidebar": "group-action",
2529
- className: chunkH2BWO3SI_cjs.cn(
2530
- "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
2531
- className
2532
- ),
2533
- ...props
2534
- }
2535
- );
2536
- }
2537
- function SidebarGroupContent({ className, ...props }) {
2538
- return /* @__PURE__ */ jsxRuntime.jsx(
2539
- "div",
2540
- {
2541
- "data-slot": "sidebar-group-content",
2542
- "data-sidebar": "group-content",
2543
- className: chunkH2BWO3SI_cjs.cn("w-full text-sm", className),
2544
- ...props
2545
- }
2546
- );
2547
- }
2548
- function SidebarMenu({ className, ...props }) {
2549
- return /* @__PURE__ */ jsxRuntime.jsx(
2550
- "ul",
2551
- {
2552
- "data-slot": "sidebar-menu",
2553
- "data-sidebar": "menu",
2554
- className: chunkH2BWO3SI_cjs.cn("flex w-full min-w-0 flex-col gap-0", className),
2555
- ...props
2556
- }
2557
- );
2558
- }
2559
- function SidebarMenuItem({ className, ...props }) {
2560
- return /* @__PURE__ */ jsxRuntime.jsx(
2561
- "li",
2562
- {
2563
- "data-slot": "sidebar-menu-item",
2564
- "data-sidebar": "menu-item",
2565
- className: chunkH2BWO3SI_cjs.cn("group/menu-item relative", className),
2566
- ...props
2567
- }
2568
- );
2569
- }
2570
- var sidebarMenuButtonVariants = classVarianceAuthority.cva(
2571
- [
2572
- "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>span:last-child]:truncate",
2573
- "disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50",
2574
- "active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground",
2575
- "data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground",
2576
- "[&_svg]:size-4 [&_svg]:shrink-0"
2577
- ],
2578
- {
2579
- variants: {
2580
- variant: {
2581
- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
2582
- outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
2583
- },
2584
- size: {
2585
- default: "h-8 text-sm",
2586
- sm: "h-7 text-xs",
2587
- lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
2588
- }
2589
- },
2590
- defaultVariants: {
2591
- variant: "default",
2592
- size: "default"
2593
- }
2594
- }
2595
- );
2596
- function SidebarMenuButton({
2597
- asChild = false,
2598
- isActive = false,
2599
- variant = "default",
2600
- size = "default",
2601
- tooltip,
2602
- className,
2603
- ...props
2604
- }) {
2605
- const Comp = asChild ? reactSlot.Slot : "button";
2606
- const { isMobile, state } = useSidebarContext("SidebarMenuButton");
2607
- const button = /* @__PURE__ */ jsxRuntime.jsx(
2608
- Comp,
2609
- {
2610
- "data-slot": "sidebar-menu-button",
2611
- "data-sidebar": "menu-button",
2612
- "data-size": size,
2613
- "data-active": isActive,
2614
- className: chunkH2BWO3SI_cjs.cn(sidebarMenuButtonVariants({ variant, size }), className),
2615
- ...props
2616
- }
2617
- );
2618
- if (!tooltip) {
2619
- return button;
2620
- }
2621
- if (typeof tooltip === "string") {
2622
- tooltip = { children: tooltip };
2623
- }
2624
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkA7SBXO2Y_cjs.Tooltip, { children: [
2625
- /* @__PURE__ */ jsxRuntime.jsx(chunkA7SBXO2Y_cjs.TooltipTrigger, { asChild: true, children: button }),
2626
- /* @__PURE__ */ jsxRuntime.jsx(chunkA7SBXO2Y_cjs.TooltipContent, { side: "right", align: "center", hidden: state !== "collapsed" || isMobile, ...tooltip })
2627
- ] });
2628
- }
2629
- function SidebarMenuAction({
2630
- className,
2631
- asChild = false,
2632
- showOnHover = false,
2633
- ...props
2634
- }) {
2635
- const Comp = asChild ? reactSlot.Slot : "button";
2636
- return /* @__PURE__ */ jsxRuntime.jsx(
2637
- Comp,
2638
- {
2639
- "data-slot": "sidebar-menu-action",
2640
- "data-sidebar": "menu-action",
2641
- className: chunkH2BWO3SI_cjs.cn(
2642
- "text-sidebar-foreground ring-sidebar-ring peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
2643
- showOnHover && "peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",
2644
- className
2645
- ),
2646
- ...props
2647
- }
2648
- );
2649
- }
2650
- function SidebarMenuBadge({ className, ...props }) {
2651
- return /* @__PURE__ */ jsxRuntime.jsx(
2652
- "div",
2653
- {
2654
- "data-slot": "sidebar-menu-badge",
2655
- "data-sidebar": "menu-badge",
2656
- className: chunkH2BWO3SI_cjs.cn(
2657
- "text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1",
2658
- className
2659
- ),
2660
- ...props
2661
- }
2662
- );
2663
- }
2664
- function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
2665
- const [width] = React16__namespace.useState(() => {
2666
- return `${Math.floor(Math.random() * 40) + 50}%`;
2667
- });
2668
- return /* @__PURE__ */ jsxRuntime.jsxs(
2669
- "div",
2670
- {
2671
- "data-slot": "sidebar-menu-skeleton",
2672
- "data-sidebar": "menu-skeleton",
2673
- className: chunkH2BWO3SI_cjs.cn("flex h-8 items-center gap-2 rounded px-2", className),
2674
- ...props,
2675
- children: [
2676
- showIcon && /* @__PURE__ */ jsxRuntime.jsx(chunkKTAIBRTH_cjs.Skeleton, { className: "size-4 rounded", "data-sidebar": "menu-skeleton-icon" }),
2677
- /* @__PURE__ */ jsxRuntime.jsx(
2678
- chunkKTAIBRTH_cjs.Skeleton,
2679
- {
2680
- className: "h-4 max-w-(--skeleton-width) flex-1",
2681
- "data-sidebar": "menu-skeleton-text",
2682
- style: {
2683
- "--skeleton-width": width
2684
- }
2685
- }
2686
- )
2687
- ]
2688
- }
2689
- );
2690
- }
2691
- function SidebarMenuSub({ className, ...props }) {
2692
- return /* @__PURE__ */ jsxRuntime.jsx(
2693
- "ul",
2694
- {
2695
- "data-slot": "sidebar-menu-sub",
2696
- "data-sidebar": "menu-sub",
2697
- className: chunkH2BWO3SI_cjs.cn(
2698
- "border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",
2699
- className
2700
- ),
2701
- ...props
2702
- }
2703
- );
2704
- }
2705
- function SidebarMenuSubItem({ className, ...props }) {
2706
- return /* @__PURE__ */ jsxRuntime.jsx(
2707
- "li",
2708
- {
2709
- "data-slot": "sidebar-menu-sub-item",
2710
- "data-sidebar": "menu-sub-item",
2711
- className: chunkH2BWO3SI_cjs.cn("group/menu-sub-item relative", className),
2712
- ...props
2713
- }
2714
- );
2715
- }
2716
- function SidebarMenuSubButton({
2717
- asChild = false,
2718
- size = "md",
2719
- isActive = false,
2720
- className,
2721
- ...props
2722
- }) {
2723
- const Comp = asChild ? reactSlot.Slot : "a";
2724
- return /* @__PURE__ */ jsxRuntime.jsx(
2725
- Comp,
2726
- {
2727
- "data-slot": "sidebar-menu-sub-button",
2728
- "data-sidebar": "menu-sub-button",
2729
- "data-size": size,
2730
- "data-active": isActive,
2731
- className: chunkH2BWO3SI_cjs.cn(
2732
- "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[state=active]:bg-sidebar-accent data-[state=active]:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded px-2 outline-hidden group-data-[collapsible=icon]:hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
2733
- className
2734
- ),
2735
- ...props
2736
- }
2737
- );
2738
- }
2739
- var buttonVariants = classVarianceAuthority.cva(
2740
- [
2741
- "inline-flex shrink-0 items-center justify-center gap-2 rounded text-sm font-medium whitespace-nowrap transition-all outline-none",
2742
- "disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50",
2743
- "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
2744
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring",
2745
- "aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error"
2746
- ],
2747
- {
2748
- variants: {
2749
- variant: {
2750
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
2751
- error: "bg-error hover:bg-error/90 focus-visible:ring-error/20 dark:focus-visible:ring-error/40 dark:bg-error/60 text-white",
2752
- outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
2753
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
2754
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
2755
- link: "text-primary underline-offset-4 hover:underline"
2756
- },
2757
- size: {
2758
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
2759
- sm: "h-8 gap-1.5 rounded px-3 has-[>svg]:px-2.5",
2760
- lg: "h-10 rounded px-6 has-[>svg]:px-4",
2761
- icon: "size-9",
2762
- "icon-sm": "size-8",
2763
- "icon-lg": "size-10"
2764
- },
2765
- fullWidth: {
2766
- true: "w-full"
2767
- }
2768
- },
2769
- defaultVariants: {
2770
- variant: "default",
2771
- size: "default",
2772
- fullWidth: false
2773
- }
2774
- }
2775
- );
2776
- function Button({
2777
- asChild = false,
2778
- variant = "default",
2779
- disabled = false,
2780
- fullWidth = false,
2781
- loadingPosition: loadingPositionProp = "start",
2782
- children,
2783
- type = "button",
2784
- loading = false,
2785
- size = "default",
2786
- endIcon,
2787
- startIcon,
2788
- className,
2789
- ...props
2790
- }) {
2791
- const Comp = asChild ? reactSlot.Slot : "button";
2792
- const isDisabled = disabled || loading;
2793
- const loadingPosition = size?.startsWith("icon") ? "center" : loadingPositionProp;
2794
- return /* @__PURE__ */ jsxRuntime.jsx(
2795
- Comp,
2796
- {
2797
- "data-slot": "button",
2798
- "aria-disabled": isDisabled || void 0,
2799
- className: chunkH2BWO3SI_cjs.cn(buttonVariants({ fullWidth, size, variant }), className),
2800
- "data-state": loading ? "loading" : void 0,
2801
- disabled: isDisabled,
2802
- role: Comp !== "button" ? "button" : void 0,
2803
- tabIndex: isDisabled ? -1 : 0,
2804
- type: Comp === "button" ? type : void 0,
2805
- "data-size": size,
2806
- "data-variant": variant,
2807
- ...props,
2808
- children: /* @__PURE__ */ jsxRuntime.jsx(
2809
- ButtonContent,
2810
- {
2811
- loading,
2812
- size,
2813
- loadingPosition,
2814
- startIcon,
2815
- endIcon,
2816
- asChild,
2817
- children
2818
- }
2819
- )
2820
- }
2821
- );
2822
- }
2823
- function ButtonContent({
2824
- children,
2825
- loading = false,
2826
- loadingPosition = "start",
2827
- startIcon,
2828
- asChild,
2829
- endIcon,
2830
- ...props
2831
- }) {
2832
- const isStartLoading = loading && loadingPosition === "start";
2833
- const StartIcon = isStartLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunk3WSQRFUY_cjs.Spinner, { "aria-label": "Loading" }) : startIcon || null;
2834
- const isEndLoading = loading && loadingPosition === "end";
2835
- const EndIcon = isEndLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunk3WSQRFUY_cjs.Spinner, { "aria-label": "Loading" }) : endIcon || null;
2836
- const isCenterLoading = loading && loadingPosition === "center";
2837
- return asChild && React16__namespace.isValidElement(children) ? React16__namespace.cloneElement(
2838
- children,
2839
- props,
2840
- /* @__PURE__ */ jsxRuntime.jsxs(React16__namespace.Fragment, { children: [
2841
- StartIcon,
2842
- isCenterLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunk3WSQRFUY_cjs.Spinner, { "aria-label": "Loading" }) : React16__namespace.isValidElement(children) ? children.props?.children : null,
2843
- EndIcon
2844
- ] })
2845
- ) : /* @__PURE__ */ jsxRuntime.jsxs(React16__namespace.Fragment, { children: [
2846
- StartIcon,
2847
- isCenterLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunk3WSQRFUY_cjs.Spinner, { "aria-label": "Loading" }) : children,
2848
- EndIcon
2849
- ] });
2850
- }
2851
-
2852
- Object.defineProperty(exports, "toast", {
2853
- enumerable: true,
2854
- get: function () { return sonner.toast; }
2855
- });
2856
- exports.Button = Button;
2857
- exports.ColorPicker = ColorPicker;
2858
- exports.ColorPickerAlphaSlider = ColorPickerAlphaSlider;
2859
- exports.ColorPickerArea = ColorPickerArea;
2860
- exports.ColorPickerContent = ColorPickerContent;
2861
- exports.ColorPickerEyeDropper = ColorPickerEyeDropper;
2862
- exports.ColorPickerFormatSelect = ColorPickerFormatSelect;
2863
- exports.ColorPickerHueSlider = ColorPickerHueSlider;
2864
- exports.ColorPickerInput = ColorPickerInput;
2865
- exports.ColorPickerSwatch = ColorPickerSwatch;
2866
- exports.ColorPickerTrigger = ColorPickerTrigger;
2867
- exports.Sidebar = Sidebar;
2868
- exports.SidebarContent = SidebarContent;
2869
- exports.SidebarFooter = SidebarFooter;
2870
- exports.SidebarGroup = SidebarGroup;
2871
- exports.SidebarGroupAction = SidebarGroupAction;
2872
- exports.SidebarGroupContent = SidebarGroupContent;
2873
- exports.SidebarGroupLabel = SidebarGroupLabel;
2874
- exports.SidebarHeader = SidebarHeader;
2875
- exports.SidebarInput = SidebarInput;
2876
- exports.SidebarInset = SidebarInset;
2877
- exports.SidebarMenu = SidebarMenu;
2878
- exports.SidebarMenuAction = SidebarMenuAction;
2879
- exports.SidebarMenuBadge = SidebarMenuBadge;
2880
- exports.SidebarMenuButton = SidebarMenuButton;
2881
- exports.SidebarMenuItem = SidebarMenuItem;
2882
- exports.SidebarMenuSkeleton = SidebarMenuSkeleton;
2883
- exports.SidebarMenuSub = SidebarMenuSub;
2884
- exports.SidebarMenuSubButton = SidebarMenuSubButton;
2885
- exports.SidebarMenuSubItem = SidebarMenuSubItem;
2886
- exports.SidebarProvider = SidebarProvider;
2887
- exports.SidebarRail = SidebarRail;
2888
- exports.SidebarSeparator = SidebarSeparator;
2889
- exports.SidebarTrigger = SidebarTrigger;
2890
- exports.Stepper = Stepper;
2891
- exports.StepperActivationMode = StepperActivationMode;
2892
- exports.StepperContent = StepperContent;
2893
- exports.StepperDataState = StepperDataState;
2894
- exports.StepperDescription = StepperDescription;
2895
- exports.StepperFocusIntent = StepperFocusIntent;
2896
- exports.StepperIndicator = StepperIndicator;
2897
- exports.StepperItem = StepperItem;
2898
- exports.StepperNav = StepperNav;
2899
- exports.StepperNavigationDirection = StepperNavigationDirection;
2900
- exports.StepperNextTrigger = StepperNextTrigger;
2901
- exports.StepperOrientation = StepperOrientation;
2902
- exports.StepperPanel = StepperPanel;
2903
- exports.StepperPrevTrigger = StepperPrevTrigger;
2904
- exports.StepperTitle = StepperTitle;
2905
- exports.StepperTrigger = StepperTrigger;
2906
- exports.Toaster = Toaster;
2907
- exports.useColorPickerStore = useColorPickerStore;
2908
- exports.useSidebar = useSidebar;
2909
- exports.useSidebarContext = useSidebarContext;
2910
- exports.useStepperContext = useStepperContext;
2911
- exports.useStepperFocusContext = useStepperFocusContext;
2912
- exports.useStepperItemContext = useStepperItemContext;