@constructive-io/ui 0.3.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -22
  3. package/dist/components/alert-dialog.cjs +333 -0
  4. package/dist/components/alert-dialog.cjs.map +1 -0
  5. package/dist/components/alert-dialog.d.cts +32 -0
  6. package/dist/components/alert-dialog.d.ts +16 -15
  7. package/dist/components/alert-dialog.js +89 -102
  8. package/dist/components/alert-dialog.js.map +1 -1
  9. package/dist/components/alert.cjs +119 -0
  10. package/dist/components/alert.cjs.map +1 -0
  11. package/dist/components/alert.d.cts +19 -0
  12. package/dist/components/alert.d.ts +10 -5
  13. package/dist/components/alert.js +62 -6
  14. package/dist/components/alert.js.map +1 -1
  15. package/dist/components/app-bar.cjs +367 -0
  16. package/dist/components/app-bar.cjs.map +1 -0
  17. package/dist/components/app-bar.d.cts +26 -0
  18. package/dist/components/app-bar.d.ts +26 -0
  19. package/dist/components/app-bar.js +344 -0
  20. package/dist/components/app-bar.js.map +1 -0
  21. package/dist/components/app-shell.cjs +1792 -0
  22. package/dist/components/app-shell.cjs.map +1 -0
  23. package/dist/components/app-shell.d.cts +106 -0
  24. package/dist/components/app-shell.d.ts +106 -0
  25. package/dist/components/app-shell.js +1771 -0
  26. package/dist/components/app-shell.js.map +1 -0
  27. package/dist/components/autocomplete.cjs +418 -0
  28. package/dist/components/autocomplete.cjs.map +1 -0
  29. package/dist/components/autocomplete.d.cts +28 -0
  30. package/dist/components/autocomplete.d.ts +15 -15
  31. package/dist/components/autocomplete.js +9 -30
  32. package/dist/components/autocomplete.js.map +1 -1
  33. package/dist/components/avatar.cjs +51 -0
  34. package/dist/components/avatar.cjs.map +1 -0
  35. package/dist/components/avatar.d.cts +12 -0
  36. package/dist/components/avatar.d.ts +3 -4
  37. package/dist/components/avatar.js +11 -1
  38. package/dist/components/avatar.js.map +1 -1
  39. package/dist/components/badge.cjs +66 -0
  40. package/dist/components/badge.cjs.map +1 -0
  41. package/dist/components/badge.d.cts +15 -0
  42. package/dist/components/badge.js +1 -1
  43. package/dist/components/badge.js.map +1 -1
  44. package/dist/components/breadcrumb.cjs +118 -0
  45. package/dist/components/breadcrumb.cjs.map +1 -0
  46. package/dist/components/breadcrumb.d.cts +14 -0
  47. package/dist/components/breadcrumb.d.ts +9 -9
  48. package/dist/components/breadcrumb.js +19 -83
  49. package/dist/components/breadcrumb.js.map +1 -1
  50. package/dist/components/button.cjs +169 -0
  51. package/dist/components/button.cjs.map +1 -0
  52. package/dist/components/button.d.cts +20 -0
  53. package/dist/components/button.d.ts +3 -0
  54. package/dist/components/button.js +105 -21
  55. package/dist/components/button.js.map +1 -1
  56. package/dist/components/calendar-rac.cjs +85 -0
  57. package/dist/components/calendar-rac.cjs.map +1 -0
  58. package/dist/components/calendar-rac.d.cts +13 -0
  59. package/dist/components/calendar-rac.d.ts +3 -3
  60. package/dist/components/card.cjs +99 -0
  61. package/dist/components/card.cjs.map +1 -0
  62. package/dist/components/card.d.cts +18 -0
  63. package/dist/components/card.d.ts +7 -8
  64. package/dist/components/card.js +23 -8
  65. package/dist/components/card.js.map +1 -1
  66. package/dist/components/checkbox-group.cjs +18 -0
  67. package/dist/components/checkbox-group.cjs.map +1 -0
  68. package/dist/components/checkbox-group.d.cts +7 -0
  69. package/dist/components/checkbox-group.d.ts +2 -2
  70. package/dist/components/checkbox.cjs +121 -0
  71. package/dist/components/checkbox.cjs.map +1 -0
  72. package/dist/components/checkbox.d.cts +8 -0
  73. package/dist/components/checkbox.d.ts +3 -3
  74. package/dist/components/checkbox.js +73 -41
  75. package/dist/components/checkbox.js.map +1 -1
  76. package/dist/components/collapsible.cjs +127 -0
  77. package/dist/components/collapsible.cjs.map +1 -0
  78. package/dist/components/collapsible.d.cts +44 -0
  79. package/dist/components/collapsible.d.ts +8 -18
  80. package/dist/components/collapsible.js +7 -27
  81. package/dist/components/collapsible.js.map +1 -1
  82. package/dist/components/combobox.cjs +551 -0
  83. package/dist/components/combobox.cjs.map +1 -0
  84. package/dist/components/combobox.d.cts +43 -0
  85. package/dist/components/combobox.d.ts +17 -18
  86. package/dist/components/combobox.js +37 -48
  87. package/dist/components/combobox.js.map +1 -1
  88. package/dist/components/command.cjs +236 -0
  89. package/dist/components/command.cjs.map +1 -0
  90. package/dist/components/command.d.cts +23 -0
  91. package/dist/components/command.d.ts +14 -15
  92. package/dist/components/command.js +5 -38
  93. package/dist/components/command.js.map +1 -1
  94. package/dist/components/dialog.cjs +431 -0
  95. package/dist/components/dialog.cjs.map +1 -0
  96. package/dist/components/dialog.d.cts +30 -0
  97. package/dist/components/dialog.d.ts +13 -18
  98. package/dist/components/dialog.js +75 -119
  99. package/dist/components/dialog.js.map +1 -1
  100. package/dist/components/dock.cjs +121 -0
  101. package/dist/components/dock.cjs.map +1 -0
  102. package/dist/components/dock.d.cts +30 -0
  103. package/dist/components/dock.d.ts +1 -2
  104. package/dist/components/dock.js +7 -5
  105. package/dist/components/dock.js.map +1 -1
  106. package/dist/components/drawer.cjs +149 -0
  107. package/dist/components/drawer.cjs.map +1 -0
  108. package/dist/components/drawer.d.cts +15 -0
  109. package/dist/components/drawer.d.ts +10 -11
  110. package/dist/components/drawer.js +11 -40
  111. package/dist/components/drawer.js.map +1 -1
  112. package/dist/components/dropdown-menu.cjs +292 -0
  113. package/dist/components/dropdown-menu.cjs.map +1 -0
  114. package/dist/components/dropdown-menu.d.cts +52 -0
  115. package/dist/components/dropdown-menu.d.ts +23 -21
  116. package/dist/components/dropdown-menu.js +67 -191
  117. package/dist/components/dropdown-menu.js.map +1 -1
  118. package/dist/components/empty.cjs +106 -0
  119. package/dist/components/empty.cjs.map +1 -0
  120. package/dist/components/empty.d.cts +15 -0
  121. package/dist/components/empty.d.ts +15 -0
  122. package/dist/components/empty.js +99 -0
  123. package/dist/components/empty.js.map +1 -0
  124. package/dist/components/field.cjs +295 -0
  125. package/dist/components/field.cjs.map +1 -0
  126. package/dist/components/field.d.cts +46 -0
  127. package/dist/components/field.d.ts +34 -39
  128. package/dist/components/field.js +220 -72
  129. package/dist/components/field.js.map +1 -1
  130. package/dist/components/flickering-grid.cjs +176 -0
  131. package/dist/components/flickering-grid.cjs.map +1 -0
  132. package/dist/components/flickering-grid.d.cts +15 -0
  133. package/dist/components/flickering-grid.js +25 -2
  134. package/dist/components/flickering-grid.js.map +1 -1
  135. package/dist/components/flow-zoom-panel.cjs +194 -0
  136. package/dist/components/flow-zoom-panel.cjs.map +1 -0
  137. package/dist/components/flow-zoom-panel.d.cts +12 -0
  138. package/dist/components/flow-zoom-panel.d.ts +12 -0
  139. package/dist/components/flow-zoom-panel.js +173 -0
  140. package/dist/components/flow-zoom-panel.js.map +1 -0
  141. package/dist/components/form-control.cjs +193 -0
  142. package/dist/components/form-control.cjs.map +1 -0
  143. package/dist/components/form-control.d.cts +14 -0
  144. package/dist/components/form-control.d.ts +1 -2
  145. package/dist/components/form-control.js +2 -4
  146. package/dist/components/form-control.js.map +1 -1
  147. package/dist/components/form.cjs +208 -0
  148. package/dist/components/form.cjs.map +1 -0
  149. package/dist/components/form.d.cts +36 -0
  150. package/dist/components/form.d.ts +7 -8
  151. package/dist/components/input-group.cjs +184 -0
  152. package/dist/components/input-group.cjs.map +1 -0
  153. package/dist/components/input-group.d.cts +17 -0
  154. package/dist/components/input-group.d.ts +6 -7
  155. package/dist/components/input-group.js +3 -2
  156. package/dist/components/input-group.js.map +1 -1
  157. package/dist/components/input.cjs +62 -0
  158. package/dist/components/input.cjs.map +1 -0
  159. package/dist/components/input.d.cts +10 -0
  160. package/dist/components/input.d.ts +1 -2
  161. package/dist/components/input.js +1 -1
  162. package/dist/components/input.js.map +1 -1
  163. package/dist/components/json-input.cjs +351 -0
  164. package/dist/components/json-input.cjs.map +1 -0
  165. package/dist/components/json-input.d.cts +25 -0
  166. package/dist/components/json-input.d.ts +3 -3
  167. package/dist/components/json-input.js +89 -112
  168. package/dist/components/json-input.js.map +1 -1
  169. package/dist/components/label.cjs +29 -0
  170. package/dist/components/label.cjs.map +1 -0
  171. package/dist/components/label.d.cts +10 -0
  172. package/dist/components/label.d.ts +1 -2
  173. package/dist/components/motion-grid.cjs +108 -0
  174. package/dist/components/motion-grid.cjs.map +1 -0
  175. package/dist/components/motion-grid.d.cts +19 -0
  176. package/dist/components/motion-grid.d.ts +1 -2
  177. package/dist/components/motion-grid.js +9 -4
  178. package/dist/components/motion-grid.js.map +1 -1
  179. package/dist/components/multi-select.cjs +796 -0
  180. package/dist/components/multi-select.cjs.map +1 -0
  181. package/dist/components/multi-select.d.cts +198 -0
  182. package/dist/components/multi-select.js +54 -162
  183. package/dist/components/multi-select.js.map +1 -1
  184. package/dist/components/page-header.cjs +19 -0
  185. package/dist/components/page-header.cjs.map +1 -0
  186. package/dist/components/page-header.d.cts +17 -0
  187. package/dist/components/page-header.d.ts +2 -2
  188. package/dist/components/pagination.cjs +295 -0
  189. package/dist/components/pagination.cjs.map +1 -0
  190. package/dist/components/pagination.d.cts +18 -0
  191. package/dist/components/pagination.d.ts +7 -8
  192. package/dist/components/pagination.js +152 -29
  193. package/dist/components/pagination.js.map +1 -1
  194. package/dist/components/popover.cjs +140 -0
  195. package/dist/components/popover.cjs.map +1 -0
  196. package/dist/components/popover.d.cts +39 -0
  197. package/dist/components/popover.d.ts +13 -9
  198. package/dist/components/popover.js +56 -132
  199. package/dist/components/popover.js.map +1 -1
  200. package/dist/components/portal.cjs +109 -0
  201. package/dist/components/portal.cjs.map +1 -0
  202. package/dist/components/portal.d.cts +117 -0
  203. package/dist/components/portal.d.ts +16 -7
  204. package/dist/components/portal.js +13 -8
  205. package/dist/components/portal.js.map +1 -1
  206. package/dist/components/progress.cjs +31 -0
  207. package/dist/components/progress.cjs.map +1 -0
  208. package/dist/components/progress.d.cts +9 -0
  209. package/dist/components/progress.d.ts +1 -2
  210. package/dist/components/progress.js +1 -2
  211. package/dist/components/progress.js.map +1 -1
  212. package/dist/components/progressive-blur-scroll-container.cjs +144 -0
  213. package/dist/components/progressive-blur-scroll-container.cjs.map +1 -0
  214. package/dist/components/progressive-blur-scroll-container.d.cts +25 -0
  215. package/dist/components/progressive-blur-scroll-container.d.ts +2 -2
  216. package/dist/components/progressive-blur.cjs +70 -0
  217. package/dist/components/progressive-blur.cjs.map +1 -0
  218. package/dist/components/progressive-blur.d.cts +16 -0
  219. package/dist/components/progressive-blur.d.ts +2 -2
  220. package/dist/components/radio-group.cjs +52 -0
  221. package/dist/components/radio-group.cjs.map +1 -0
  222. package/dist/components/radio-group.d.cts +10 -0
  223. package/dist/components/radio-group.d.ts +3 -3
  224. package/dist/components/radio-group.js +21 -10
  225. package/dist/components/radio-group.js.map +1 -1
  226. package/dist/components/record-picker.cjs +420 -0
  227. package/dist/components/record-picker.cjs.map +1 -0
  228. package/dist/components/record-picker.d.cts +16 -0
  229. package/dist/components/record-picker.d.ts +2 -2
  230. package/dist/components/record-picker.js +76 -43
  231. package/dist/components/record-picker.js.map +1 -1
  232. package/dist/components/resizable.cjs +76 -0
  233. package/dist/components/resizable.cjs.map +1 -0
  234. package/dist/components/resizable.d.cts +10 -0
  235. package/dist/components/resizable.d.ts +3 -4
  236. package/dist/components/responsive-diagram.cjs +67 -0
  237. package/dist/components/responsive-diagram.cjs.map +1 -0
  238. package/dist/components/responsive-diagram.d.cts +10 -0
  239. package/dist/components/responsive-diagram.d.ts +2 -2
  240. package/dist/components/scroll-area.cjs +92 -0
  241. package/dist/components/scroll-area.cjs.map +1 -0
  242. package/dist/components/scroll-area.d.cts +11 -0
  243. package/dist/components/scroll-area.d.ts +5 -6
  244. package/dist/components/select.cjs +329 -0
  245. package/dist/components/select.cjs.map +1 -0
  246. package/dist/components/select.d.cts +46 -0
  247. package/dist/components/select.d.ts +13 -14
  248. package/dist/components/select.js +76 -67
  249. package/dist/components/select.js.map +1 -1
  250. package/dist/components/separator.cjs +26 -0
  251. package/dist/components/separator.cjs.map +1 -0
  252. package/dist/components/separator.d.cts +10 -0
  253. package/dist/components/separator.d.ts +1 -2
  254. package/dist/components/sheet.cjs +489 -0
  255. package/dist/components/sheet.cjs.map +1 -0
  256. package/dist/components/sheet.d.cts +107 -0
  257. package/dist/components/sheet.d.ts +14 -19
  258. package/dist/components/sheet.js +119 -264
  259. package/dist/components/sheet.js.map +1 -1
  260. package/dist/components/sidebar.cjs +1300 -0
  261. package/dist/components/sidebar.cjs.map +1 -0
  262. package/dist/components/sidebar.d.cts +70 -0
  263. package/dist/components/sidebar.d.ts +32 -39
  264. package/dist/components/sidebar.js +401 -362
  265. package/dist/components/sidebar.js.map +1 -1
  266. package/dist/components/skeleton.cjs +36 -0
  267. package/dist/components/skeleton.cjs.map +1 -0
  268. package/dist/components/skeleton.d.cts +10 -0
  269. package/dist/components/skeleton.d.ts +5 -2
  270. package/dist/components/skeleton.js +19 -1
  271. package/dist/components/skeleton.js.map +1 -1
  272. package/dist/components/sonner.cjs +25 -0
  273. package/dist/components/sonner.cjs.map +1 -0
  274. package/dist/components/sonner.d.cts +10 -0
  275. package/dist/components/sonner.d.ts +2 -2
  276. package/dist/components/stack/index.cjs +1516 -0
  277. package/dist/components/stack/index.cjs.map +1 -0
  278. package/dist/components/stack/index.d.cts +672 -0
  279. package/dist/components/stack/index.d.ts +36 -38
  280. package/dist/components/stack/index.js +42 -31
  281. package/dist/components/stack/index.js.map +1 -1
  282. package/dist/components/stepper.cjs +314 -0
  283. package/dist/components/stepper.cjs.map +1 -0
  284. package/dist/components/stepper.d.cts +31 -0
  285. package/dist/components/stepper.d.ts +9 -8
  286. package/dist/components/stepper.js +22 -15
  287. package/dist/components/stepper.js.map +1 -1
  288. package/dist/components/switch.cjs +46 -0
  289. package/dist/components/switch.cjs.map +1 -0
  290. package/dist/components/switch.d.cts +7 -0
  291. package/dist/components/switch.d.ts +1 -2
  292. package/dist/components/switch.js +9 -5
  293. package/dist/components/switch.js.map +1 -1
  294. package/dist/components/table.cjs +133 -0
  295. package/dist/components/table.cjs.map +1 -0
  296. package/dist/components/table.d.cts +22 -0
  297. package/dist/components/table.d.ts +19 -12
  298. package/dist/components/table.js +72 -13
  299. package/dist/components/table.js.map +1 -1
  300. package/dist/components/tabs.cjs +53 -0
  301. package/dist/components/tabs.cjs.map +1 -0
  302. package/dist/components/tabs.d.cts +9 -0
  303. package/dist/components/tabs.d.ts +4 -5
  304. package/dist/components/tabs.js +2 -2
  305. package/dist/components/tabs.js.map +1 -1
  306. package/dist/components/tags.cjs +451 -0
  307. package/dist/components/tags.cjs.map +1 -0
  308. package/dist/components/tags.d.cts +40 -0
  309. package/dist/components/tags.d.ts +10 -10
  310. package/dist/components/tags.js +129 -154
  311. package/dist/components/tags.js.map +1 -1
  312. package/dist/components/textarea.cjs +56 -0
  313. package/dist/components/textarea.cjs.map +1 -0
  314. package/dist/components/textarea.d.cts +9 -0
  315. package/dist/components/textarea.d.ts +1 -2
  316. package/dist/components/toast/index.cjs +612 -0
  317. package/dist/components/toast/index.cjs.map +1 -0
  318. package/dist/components/toast/index.d.cts +52 -0
  319. package/dist/components/toast/index.js +90 -127
  320. package/dist/components/toast/index.js.map +1 -1
  321. package/dist/components/tooltip.cjs +92 -0
  322. package/dist/components/tooltip.cjs.map +1 -0
  323. package/dist/components/tooltip.d.cts +28 -0
  324. package/dist/components/tooltip.d.ts +5 -6
  325. package/dist/components/tooltip.js +23 -130
  326. package/dist/components/tooltip.js.map +1 -1
  327. package/dist/components/unlink-button.cjs +197 -0
  328. package/dist/components/unlink-button.cjs.map +1 -0
  329. package/dist/components/unlink-button.d.cts +14 -0
  330. package/dist/components/unlink-button.d.ts +2 -2
  331. package/dist/components/unlink-button.js +105 -21
  332. package/dist/components/unlink-button.js.map +1 -1
  333. package/dist/index.cjs +2040 -1577
  334. package/dist/index.cjs.map +1 -1
  335. package/dist/index.d.cts +492 -509
  336. package/dist/index.d.ts +492 -509
  337. package/dist/index.js +1862 -1443
  338. package/dist/index.js.map +1 -1
  339. package/package.json +286 -45
  340. package/src/styles/globals.css +155 -203
  341. package/dist/components/org-chart/index.d.ts +0 -54
  342. package/dist/components/org-chart/index.js +0 -861
  343. package/dist/components/org-chart/index.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { clsx } from 'clsx';
3
3
  import { twMerge } from 'tailwind-merge';
4
- import * as React19 from 'react';
5
- import React19__default, { createContext, memo, useState, useCallback, useMemo, useRef, useContext, useEffect, Suspense, useLayoutEffect, useReducer } from 'react';
4
+ import * as React21 from 'react';
5
+ import React21__default, { createContext, memo, useState, useCallback, useMemo, useRef, useContext, useEffect, Suspense, useLayoutEffect, useReducer } from 'react';
6
6
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
7
7
  import { cva } from 'class-variance-authority';
8
8
  import { Separator as Separator$1 } from '@base-ui/react/separator';
@@ -13,7 +13,9 @@ import { Radio as Radio$1 } from '@base-ui/react/radio';
13
13
  import { RadioGroup as RadioGroup$1 } from '@base-ui/react/radio-group';
14
14
  import { Switch as Switch$1 } from '@base-ui/react/switch';
15
15
  import { Select as Select$1 } from '@base-ui/react/select';
16
- import { ChevronsUpDownIcon, XCircle, XIcon, ChevronDown, SearchIcon, CheckIcon, Ellipsis, Pencil, Trash2, ChevronRight, ChevronUpIcon, ChevronDownIcon, CircleIcon, ChevronRightIcon, X, GripVerticalIcon, ChevronLeftIcon, MoreHorizontalIcon, LoaderCircleIcon, PanelLeftIcon, WandSparkles, InfoIcon, CheckCircleIcon, AlertTriangleIcon, Loader2, AlertCircleIcon, CopyIcon, CircleAlert, CheckCircle2, Network, UserPlus } from 'lucide-react';
16
+ import { ChevronsUpDownIcon, XCircle, XIcon, ChevronDown, SearchIcon, CheckIcon, ChevronRight, ChevronUpIcon, ChevronDownIcon, CircleIcon, ChevronRightIcon, X, GripVerticalIcon, ChevronLeftIcon, MoreHorizontalIcon, LoaderCircleIcon, PanelLeftIcon, WandSparkles, InfoIcon, CheckCircleIcon, AlertTriangleIcon, Loader2, AlertCircleIcon, CopyIcon, CircleAlert, CheckCircle2 } from 'lucide-react';
17
+ import { useFloatingOverlayPortalProps, useRootPortalContainer, ModalPortalScope } from '@constructive-io/ui/portal';
18
+ export { ModalPortalScope, PORTAL_ROOT_ID, PortalRoot, useFloatingOverlayPortalProps, useInModalOverlay, usePortalContainer, usePortalContext, useRootPortalContainer } from '@constructive-io/ui/portal';
17
19
  import { Progress as Progress$1 } from '@base-ui/react/progress';
18
20
  import { FormProvider, Controller, useFormContext, useFormState } from 'react-hook-form';
19
21
  import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
@@ -22,14 +24,16 @@ import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
22
24
  import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
23
25
  import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
24
26
  import { Menu } from '@base-ui/react/menu';
25
- import { useMotionValue, motion, useReducedMotion, useTransform, useSpring, AnimatePresence } from 'motion/react';
27
+ import { useMotionValue, useReducedMotion, motion, useTransform, useSpring, AnimatePresence } from 'motion/react';
26
28
  import { Drawer as Drawer$1 } from 'vaul';
27
29
  import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
28
30
  import { Collapsible as Collapsible$1 } from '@base-ui/react/collapsible';
29
31
  import * as ResizablePrimitive from 'react-resizable-panels';
32
+ import { mergeProps as mergeProps$1 } from '@base-ui/react/merge-props';
33
+ import { useRender } from '@base-ui/react/use-render';
30
34
  import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
31
35
  import { Autocomplete as Autocomplete$1 } from '@base-ui/react/autocomplete';
32
- import { Handle, Position, useReactFlow, Panel, ReactFlowProvider, useNodesState, useEdgesState, ReactFlow, Background, BackgroundVariant, getSmoothStepPath, BaseEdge } from '@xyflow/react';
36
+ import { useReactFlow, Panel } from '@xyflow/react';
33
37
  import { RiAddLine, RiSubtractLine, RiFocus3Line, RiSearchLine, RiLoader4Line, RiCheckLine, RiCloseLine } from '@remixicon/react';
34
38
  import { Command as Command$1 } from 'cmdk';
35
39
  import { Combobox as Combobox$1 } from '@base-ui/react/combobox';
@@ -39,7 +43,6 @@ import { Calendar as Calendar$1, composeRenderProps, RangeCalendar as RangeCalen
39
43
  import { Toaster as Toaster$1, toast } from 'sonner';
40
44
  import { createPortal } from 'react-dom';
41
45
  import { useDrag } from '@use-gesture/react';
42
- import '@xyflow/react/dist/style.css';
43
46
 
44
47
  // src/lib/utils.ts
45
48
  function cn(...inputs) {
@@ -75,33 +78,23 @@ function mergeProps(slotProps, childProps) {
75
78
  }
76
79
  return { ...slotProps, ...overrideProps };
77
80
  }
78
- function mergePropsWithRef(parentProps, childElement) {
79
- const childProps = childElement.props;
80
- const parentRef = parentProps.ref;
81
- const childRef = childProps.ref;
82
- const mergedProps = mergeProps(parentProps, childProps);
83
- if (parentRef || childRef) {
84
- mergedProps.ref = composeRefs(parentRef, childRef);
85
- }
86
- return mergedProps;
87
- }
88
81
  function isSlottable(child) {
89
- return React19.isValidElement(child);
82
+ return React21.isValidElement(child);
90
83
  }
91
- var Slot = React19.forwardRef((props, forwardedRef) => {
84
+ var Slot = React21.forwardRef((props, forwardedRef) => {
92
85
  const { children, ...slotProps } = props;
93
86
  if (isSlottable(children)) {
94
87
  const childProps = children.props;
95
88
  const childRef = childProps.ref;
96
- return React19.cloneElement(children, {
89
+ return React21.cloneElement(children, {
97
90
  ...mergeProps(slotProps, childProps),
98
91
  ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
99
92
  });
100
93
  }
101
- if (React19.Children.count(children) > 1) {
102
- const childrenArray = React19.Children.toArray(children);
94
+ if (React21.Children.count(children) > 1) {
95
+ const childrenArray = React21.Children.toArray(children);
103
96
  const slottableChild = childrenArray.find(
104
- (child) => React19.isValidElement(child) && child.type === Slottable
97
+ (child) => React21.isValidElement(child) && child.type === Slottable
105
98
  );
106
99
  if (slottableChild) {
107
100
  const newElement = slottableChild.props.children;
@@ -109,12 +102,12 @@ var Slot = React19.forwardRef((props, forwardedRef) => {
109
102
  const newElementProps = newElement.props;
110
103
  const newChildren = childrenArray.map((child) => {
111
104
  if (child === slottableChild) {
112
- return React19.Children.count(newElementProps.children) > 1 ? React19.Children.only(null) : newElementProps.children;
105
+ return React21.Children.count(newElementProps.children) > 1 ? React21.Children.only(null) : newElementProps.children;
113
106
  }
114
107
  return child;
115
108
  });
116
109
  const childRef = newElementProps.ref;
117
- return React19.cloneElement(newElement, {
110
+ return React21.cloneElement(newElement, {
118
111
  ...mergeProps(slotProps, newElementProps),
119
112
  ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
120
113
  children: newChildren
@@ -137,7 +130,9 @@ function useControllableState({
137
130
  const isControlled = prop !== void 0;
138
131
  const value = isControlled ? prop : uncontrolledValue;
139
132
  const onChangeRef = useRef(onChange);
140
- onChangeRef.current = onChange;
133
+ useEffect(() => {
134
+ onChangeRef.current = onChange;
135
+ }, [onChange]);
141
136
  const setValue = useCallback(
142
137
  (newValue) => {
143
138
  if (!isControlled) {
@@ -283,24 +278,29 @@ var variants = {
283
278
  }
284
279
  };
285
280
  var buttonVariants = cva(
286
- "[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
281
+ "[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-sm outline-none transition-[box-shadow,scale] duration-150 ease-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 motion-reduce:transition-shadow [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
287
282
  {
288
283
  defaultVariants: {
289
284
  size: "default",
285
+ static: false,
290
286
  variant: "default"
291
287
  },
292
288
  variants: {
289
+ static: {
290
+ false: "motion-safe:active:not-disabled:scale-[0.96]",
291
+ true: null
292
+ },
293
293
  size: {
294
- default: "h-9 px-[calc(--spacing(3)-1px)] sm:h-8",
295
- icon: "size-9 sm:size-8",
296
- "icon-lg": "size-10 sm:size-9",
297
- "icon-sm": "size-8 sm:size-7",
298
- "icon-xl": 'size-11 sm:size-10 [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
299
- "icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-3.5',
300
- lg: "h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9",
301
- sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7",
302
- xl: 'h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
303
- xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*="size-"])]:size-4 sm:[&_svg:not([class*="size-"])]:size-3.5'
294
+ default: "h-10 min-w-10 px-[calc(--spacing(3)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
295
+ icon: "size-10 pointer-coarse:size-11",
296
+ "icon-lg": "size-11",
297
+ "icon-sm": "size-8 pointer-coarse:size-11",
298
+ "icon-xl": 'size-11 [&_svg:not([class*="size-"])]:size-5',
299
+ "icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:size-11 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4',
300
+ lg: "h-11 min-w-11 px-[calc(--spacing(3.5)-1px)]",
301
+ sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
302
+ xl: 'h-12 min-w-12 px-[calc(--spacing(4)-1px)] text-lg [&_svg:not([class*="size-"])]:size-5',
303
+ xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11 [&_svg:not([class*="size-"])]:size-3.5'
304
304
  },
305
305
  variant: {
306
306
  default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
@@ -314,23 +314,29 @@ var buttonVariants = cva(
314
314
  }
315
315
  }
316
316
  );
317
- var Button = React19.forwardRef(
318
- ({ className, variant, size, asChild, children, type = "button", ...props }, ref) => {
319
- const buttonClasses = cn(buttonVariants({ className, size, variant }));
320
- if (asChild && React19.isValidElement(children)) {
321
- const childProps = children.props;
322
- return React19.cloneElement(children, {
323
- ...props,
324
- className: cn(buttonClasses, childProps.className),
325
- "data-slot": "button"
326
- });
317
+ var Button = React21.forwardRef(
318
+ ({ className, variant, size, static: isStatic, asChild, children, type = "button", ...props }, ref) => {
319
+ const buttonClasses = cn(buttonVariants({ className, size, static: isStatic, variant }));
320
+ const Comp = asChild ? Slot : "button";
321
+ if (asChild) {
322
+ const SlottedComp = Comp;
323
+ return /* @__PURE__ */ jsx(
324
+ SlottedComp,
325
+ {
326
+ ref,
327
+ className: buttonClasses,
328
+ "data-slot": "button",
329
+ ...props,
330
+ children
331
+ }
332
+ );
327
333
  }
328
334
  return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
329
335
  }
330
336
  );
331
337
  Button.displayName = "Button";
332
338
  var badgeVariants = cva(
333
- "relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button,a&]:cursor-pointer [button,a&]:pointer-coarse:after:absolute [button,a&]:pointer-coarse:after:size-full [button,a&]:pointer-coarse:after:min-h-11 [button,a&]:pointer-coarse:after:min-w-11",
339
+ "relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button,a&]:cursor-pointer [button,a&]:pointer-coarse:min-h-11 [button,a&]:pointer-coarse:min-w-11",
334
340
  {
335
341
  defaultVariants: {
336
342
  size: "default",
@@ -355,7 +361,7 @@ var badgeVariants = cva(
355
361
  }
356
362
  }
357
363
  );
358
- var Badge = React19.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx("span", { ref, "data-slot": "badge", className: cn(badgeVariants({ variant, size }), className), ...props }));
364
+ var Badge = React21.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx("span", { ref, "data-slot": "badge", className: cn(badgeVariants({ variant, size }), className), ...props }));
359
365
  Badge.displayName = "Badge";
360
366
  function Label({ className, ...props }) {
361
367
  return /* @__PURE__ */ jsx(
@@ -373,21 +379,40 @@ function Label({ className, ...props }) {
373
379
  );
374
380
  }
375
381
  function Skeleton({ className, ...props }) {
376
- return /* @__PURE__ */ jsx("div", { "data-slot": "skeleton", className: cn("bg-primary/10 animate-pulse rounded-md", className), ...props });
382
+ return /* @__PURE__ */ jsx(
383
+ "div",
384
+ {
385
+ "data-slot": "skeleton",
386
+ className: cn(
387
+ "rounded-md",
388
+ // Quiet base (muted, not primary/10)
389
+ "bg-muted",
390
+ // Soft, low-contrast band — mostly muted with a faint lift mid-pass
391
+ "[background-image:linear-gradient(90deg,var(--muted)_0%,color-mix(in_oklch,var(--muted)_92%,var(--foreground))_50%,var(--muted)_100%)]",
392
+ "bg-[length:220%_100%]",
393
+ // Slow, relaxed sweep
394
+ "animate-[shimmer_4.5s_ease-in-out_infinite]",
395
+ "motion-reduce:animate-none",
396
+ className
397
+ ),
398
+ ...props
399
+ }
400
+ );
377
401
  }
378
402
  var cardVariants = cva(
379
403
  // Base styles
380
- "bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-6 transition-all duration-200",
404
+ "bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-6",
381
405
  {
382
406
  variants: {
383
407
  variant: {
384
- default: "border border-border/50 shadow-card",
385
- elevated: "border border-border/40 shadow-card-lg",
408
+ default: "shadow-card",
409
+ elevated: "shadow-card-lg",
386
410
  flat: "border border-border/60 shadow-none",
387
- ghost: "border-transparent shadow-none bg-transparent",
411
+ ghost: "bg-transparent shadow-none",
388
412
  interactive: [
389
- "border border-border/50 shadow-card",
390
- "hover:shadow-card-lg hover:border-border/70 hover:-translate-y-0.5",
413
+ "shadow-card",
414
+ "hover:shadow-card-lg motion-safe:hover:-translate-y-0.5",
415
+ "transition-[box-shadow,translate] duration-200 motion-reduce:transition-shadow",
391
416
  "cursor-pointer"
392
417
  ]
393
418
  }
@@ -415,10 +440,24 @@ function CardHeader({ className, ...props }) {
415
440
  );
416
441
  }
417
442
  function CardTitle({ className, ...props }) {
418
- return /* @__PURE__ */ jsx("div", { "data-slot": "card-title", className: cn("leading-none font-semibold tracking-tight", className), ...props });
443
+ return /* @__PURE__ */ jsx(
444
+ "div",
445
+ {
446
+ "data-slot": "card-title",
447
+ className: cn("text-balance leading-none font-semibold tracking-tight", className),
448
+ ...props
449
+ }
450
+ );
419
451
  }
420
452
  function CardDescription({ className, ...props }) {
421
- return /* @__PURE__ */ jsx("div", { "data-slot": "card-description", className: cn("text-muted-foreground text-sm", className), ...props });
453
+ return /* @__PURE__ */ jsx(
454
+ "div",
455
+ {
456
+ "data-slot": "card-description",
457
+ className: cn("text-muted-foreground text-pretty text-sm", className),
458
+ ...props
459
+ }
460
+ );
422
461
  }
423
462
  function CardAction({ className, ...props }) {
424
463
  return /* @__PURE__ */ jsx(
@@ -448,12 +487,22 @@ function Separator({ className, orientation = "horizontal", decorative: _decorat
448
487
  );
449
488
  }
450
489
  var alertVariants = cva(
451
- "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
490
+ [
491
+ "group/alert relative w-full rounded-xl border px-4 py-3.5 text-sm",
492
+ "grid grid-cols-[0_minmax(0,1fr)] items-start gap-y-1",
493
+ "has-[>svg]:grid-cols-[1rem_minmax(0,1fr)] has-[>svg]:gap-x-3",
494
+ "[&>svg]:col-start-1 [&>svg]:row-span-full [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-current",
495
+ "[&>svg]:pointer-events-none",
496
+ "shadow-xs"
497
+ ].join(" "),
452
498
  {
453
499
  variants: {
454
500
  variant: {
455
- default: "bg-background text-foreground",
456
- destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
501
+ default: "border-border/80 bg-card text-card-foreground [&>svg]:text-foreground",
502
+ destructive: "border-destructive/30 bg-destructive/8 text-destructive dark:border-destructive/35 dark:bg-destructive/12 [&>svg]:text-destructive",
503
+ info: "border-info/30 bg-info/8 text-info-foreground dark:border-info/35 dark:bg-info/12 [&>svg]:text-info",
504
+ success: "border-success/30 bg-success/8 text-success-foreground dark:border-success/35 dark:bg-success/12 [&>svg]:text-success",
505
+ warning: "border-warning/30 bg-warning/8 text-warning-foreground dark:border-warning/35 dark:bg-warning/12 [&>svg]:text-warning"
457
506
  }
458
507
  },
459
508
  defaultVariants: {
@@ -461,14 +510,60 @@ var alertVariants = cva(
461
510
  }
462
511
  }
463
512
  );
464
- var Alert = React19.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props }));
513
+ var Alert = React21.forwardRef(
514
+ ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
515
+ "div",
516
+ {
517
+ ref,
518
+ role: "alert",
519
+ "data-slot": "alert",
520
+ "data-variant": variant ?? "default",
521
+ className: cn(alertVariants({ variant }), className),
522
+ ...props
523
+ }
524
+ )
525
+ );
465
526
  Alert.displayName = "Alert";
466
- var AlertTitle = React19.forwardRef(
467
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("h5", { ref, className: cn("mb-1 leading-none font-medium tracking-tight", className), ...props })
527
+ var AlertTitle = React21.forwardRef(
528
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
529
+ "h5",
530
+ {
531
+ ref,
532
+ "data-slot": "alert-title",
533
+ className: cn(
534
+ "col-start-2 min-h-4 font-medium leading-snug tracking-tight",
535
+ // Keep title on the semantic color; default uses card foreground
536
+ "text-current",
537
+ className
538
+ ),
539
+ ...props
540
+ }
541
+ )
468
542
  );
469
543
  AlertTitle.displayName = "AlertTitle";
470
- var AlertDescription = React19.forwardRef(
471
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("text-sm [&_p]:leading-relaxed", className), ...props })
544
+ var AlertDescription = React21.forwardRef(
545
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
546
+ "div",
547
+ {
548
+ ref,
549
+ "data-slot": "alert-description",
550
+ className: cn(
551
+ "col-start-2 text-pretty text-sm leading-relaxed",
552
+ // Default: muted body. Semantic variants: slightly softer than title for hierarchy.
553
+ "text-muted-foreground",
554
+ "group-data-[variant=destructive]/alert:text-destructive/85",
555
+ "group-data-[variant=info]/alert:text-info-foreground/85",
556
+ "group-data-[variant=success]/alert:text-success-foreground/85",
557
+ "group-data-[variant=warning]/alert:text-warning-foreground/85",
558
+ "[&_p]:leading-relaxed",
559
+ // Inline code with spacing that won't glue to neighbors
560
+ "[&_code]:mx-0.5 [&_code]:rounded-md [&_code]:bg-foreground/6 [&_code]:px-1.5 [&_code]:py-0.5",
561
+ "[&_code]:font-mono [&_code]:text-[0.8125em] [&_code]:font-normal [&_code]:text-current",
562
+ className
563
+ ),
564
+ ...props
565
+ }
566
+ )
472
567
  );
473
568
  AlertDescription.displayName = "AlertDescription";
474
569
  function Input({ className, size = "default", unstyled = false, ...props }) {
@@ -503,7 +598,7 @@ function Input({ className, size = "default", unstyled = false, ...props }) {
503
598
  Input$1,
504
599
  {
505
600
  className: cn(
506
- "w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none",
601
+ "w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none pointer-coarse:min-h-11",
507
602
  isFloating ? "h-11 pt-4.5 pb-1 leading-none placeholder:text-transparent sm:h-10" : "h-8.5 leading-8.5 placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5",
508
603
  size === "sm" && (isFloating ? "h-10 px-[calc(--spacing(2.5)-1px)] pt-4 pb-1 sm:h-9" : "h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5"),
509
604
  size === "lg" && (isFloating ? "h-12 pt-5 pb-1.5 sm:h-11" : "h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5"),
@@ -560,55 +655,87 @@ function Textarea({ className, size = "default", unstyled = false, ...props }) {
560
655
  }
561
656
  );
562
657
  }
563
- var Checkbox = React19.forwardRef(({ className, ...props }, ref) => {
564
- return /* @__PURE__ */ jsx(
658
+ var Checkbox = React21.forwardRef(({ className, ...props }, ref) => {
659
+ return /* @__PURE__ */ jsxs(
565
660
  Checkbox$1.Root,
566
661
  {
567
662
  ref,
568
663
  className: cn(
569
- "relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[4px] border border-input bg-background bg-clip-padding outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:bg-clip-border dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none",
664
+ "relative inline-flex size-10 shrink-0 items-center justify-center outline-none transition-transform duration-150 ease-out motion-safe:active:not-data-disabled:scale-[0.96] motion-reduce:transition-none pointer-coarse:size-11 data-disabled:cursor-not-allowed data-disabled:opacity-64 aria-invalid:[&_[data-slot=checkbox-control]]:border-destructive/36 focus-visible:[&_[data-slot=checkbox-control]]:ring-2 focus-visible:[&_[data-slot=checkbox-control]]:ring-ring focus-visible:[&_[data-slot=checkbox-control]]:ring-offset-1 focus-visible:[&_[data-slot=checkbox-control]]:ring-offset-background focus-visible:aria-invalid:[&_[data-slot=checkbox-control]]:border-destructive/64 focus-visible:aria-invalid:[&_[data-slot=checkbox-control]]:ring-destructive/48 dark:aria-invalid:[&_[data-slot=checkbox-control]]:ring-destructive/24",
570
665
  className
571
666
  ),
572
667
  "data-slot": "checkbox",
573
668
  ...props,
574
- children: /* @__PURE__ */ jsx(
575
- Checkbox$1.Indicator,
576
- {
577
- className: "-inset-px absolute flex items-center justify-center rounded-[4px] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground",
578
- "data-slot": "checkbox-indicator",
579
- render: (props2, state) => /* @__PURE__ */ jsx("span", { ...props2, children: state.indeterminate ? /* @__PURE__ */ jsx(
580
- "svg",
581
- {
582
- className: "size-3.5 sm:size-3",
583
- fill: "none",
584
- height: "24",
585
- stroke: "currentColor",
586
- strokeLinecap: "round",
587
- strokeLinejoin: "round",
588
- strokeWidth: "3",
589
- viewBox: "0 0 24 24",
590
- width: "24",
591
- xmlns: "http://www.w3.org/2000/svg",
592
- children: /* @__PURE__ */ jsx("path", { d: "M5.252 12h13.496" })
593
- }
594
- ) : /* @__PURE__ */ jsx(
595
- "svg",
596
- {
597
- className: "size-3.5 sm:size-3",
598
- fill: "none",
599
- height: "24",
600
- stroke: "currentColor",
601
- strokeLinecap: "round",
602
- strokeLinejoin: "round",
603
- strokeWidth: "3",
604
- viewBox: "0 0 24 24",
605
- width: "24",
606
- xmlns: "http://www.w3.org/2000/svg",
607
- children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
608
- }
609
- ) })
610
- }
611
- )
669
+ children: [
670
+ /* @__PURE__ */ jsx(
671
+ "span",
672
+ {
673
+ "aria-hidden": "true",
674
+ className: "pointer-events-none absolute size-4.5 rounded-[4px] border border-input bg-background bg-clip-padding shadow-[0_1px_--theme(--color-black/4%)] sm:size-4 dark:bg-input/32 dark:bg-clip-border dark:shadow-[0_-1px_--theme(--color-white/8%)]",
675
+ "data-slot": "checkbox-control"
676
+ }
677
+ ),
678
+ /* @__PURE__ */ jsx(
679
+ Checkbox$1.Indicator,
680
+ {
681
+ keepMounted: true,
682
+ className: "absolute flex size-4.5 items-center justify-center rounded-[4px] text-primary-foreground transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] data-unchecked:scale-[0.25] data-unchecked:opacity-0 data-unchecked:blur-[4px] data-checked:bg-primary data-indeterminate:text-foreground motion-reduce:transition-none sm:size-4",
683
+ "data-slot": "checkbox-indicator",
684
+ render: (props2, state) => /* @__PURE__ */ jsxs("span", { ...props2, children: [
685
+ /* @__PURE__ */ jsx(
686
+ "span",
687
+ {
688
+ className: cn(
689
+ "absolute inset-0 flex items-center justify-center transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none",
690
+ state.indeterminate ? "scale-100 opacity-100 blur-0" : "scale-[0.25] opacity-0 blur-[4px]"
691
+ ),
692
+ children: /* @__PURE__ */ jsx(
693
+ "svg",
694
+ {
695
+ className: "size-3.5 sm:size-3",
696
+ fill: "none",
697
+ height: "24",
698
+ stroke: "currentColor",
699
+ strokeLinecap: "round",
700
+ strokeLinejoin: "round",
701
+ strokeWidth: "3",
702
+ viewBox: "0 0 24 24",
703
+ width: "24",
704
+ xmlns: "http://www.w3.org/2000/svg",
705
+ children: /* @__PURE__ */ jsx("path", { d: "M5.252 12h13.496" })
706
+ }
707
+ )
708
+ }
709
+ ),
710
+ /* @__PURE__ */ jsx(
711
+ "span",
712
+ {
713
+ className: cn(
714
+ "absolute inset-0 flex items-center justify-center transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none",
715
+ state.indeterminate ? "scale-[0.25] opacity-0 blur-[4px]" : "scale-100 opacity-100 blur-0"
716
+ ),
717
+ children: /* @__PURE__ */ jsx(
718
+ "svg",
719
+ {
720
+ className: "size-3.5 sm:size-3",
721
+ fill: "none",
722
+ height: "24",
723
+ stroke: "currentColor",
724
+ strokeLinecap: "round",
725
+ strokeLinejoin: "round",
726
+ strokeWidth: "3",
727
+ viewBox: "0 0 24 24",
728
+ width: "24",
729
+ xmlns: "http://www.w3.org/2000/svg",
730
+ children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
731
+ }
732
+ )
733
+ }
734
+ )
735
+ ] })
736
+ }
737
+ )
738
+ ]
612
739
  }
613
740
  );
614
741
  });
@@ -620,22 +747,33 @@ function RadioGroup({ className, ...props }) {
620
747
  return /* @__PURE__ */ jsx(RadioGroup$1, { className: cn("flex flex-col gap-3", className), "data-slot": "radio-group", ...props });
621
748
  }
622
749
  function Radio({ className, ...props }) {
623
- return /* @__PURE__ */ jsx(
750
+ return /* @__PURE__ */ jsxs(
624
751
  Radio$1.Root,
625
752
  {
626
753
  className: cn(
627
- "relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-full border border-input bg-background bg-clip-padding shadow-xs outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-full not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:bg-clip-border dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none",
754
+ "relative inline-flex size-10 shrink-0 items-center justify-center outline-none transition-transform duration-150 ease-out motion-safe:active:not-data-disabled:scale-[0.96] motion-reduce:transition-none pointer-coarse:size-11 data-disabled:cursor-not-allowed data-disabled:opacity-64 aria-invalid:[&_[data-slot=radio-control]]:border-destructive/36 focus-visible:[&_[data-slot=radio-control]]:ring-2 focus-visible:[&_[data-slot=radio-control]]:ring-ring focus-visible:[&_[data-slot=radio-control]]:ring-offset-1 focus-visible:[&_[data-slot=radio-control]]:ring-offset-background focus-visible:aria-invalid:[&_[data-slot=radio-control]]:border-destructive/64 focus-visible:aria-invalid:[&_[data-slot=radio-control]]:ring-destructive/48 dark:aria-invalid:[&_[data-slot=radio-control]]:ring-destructive/24",
628
755
  className
629
756
  ),
630
757
  "data-slot": "radio",
631
758
  ...props,
632
- children: /* @__PURE__ */ jsx(
633
- Radio$1.Indicator,
634
- {
635
- className: "-inset-px absolute flex size-4.5 items-center justify-center rounded-full before:size-2 before:rounded-full before:bg-primary-foreground data-unchecked:hidden data-checked:bg-primary sm:size-4 sm:before:size-1.5",
636
- "data-slot": "radio-indicator"
637
- }
638
- )
759
+ children: [
760
+ /* @__PURE__ */ jsx(
761
+ "span",
762
+ {
763
+ "aria-hidden": "true",
764
+ className: "pointer-events-none absolute size-4.5 rounded-full border border-input bg-background bg-clip-padding shadow-xs sm:size-4 dark:bg-input/32 dark:bg-clip-border",
765
+ "data-slot": "radio-control"
766
+ }
767
+ ),
768
+ /* @__PURE__ */ jsx(
769
+ Radio$1.Indicator,
770
+ {
771
+ keepMounted: true,
772
+ className: "absolute flex size-4.5 items-center justify-center rounded-full transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] before:size-2 before:rounded-full before:bg-primary-foreground data-unchecked:scale-[0.25] data-unchecked:opacity-0 data-unchecked:blur-[4px] data-checked:bg-primary motion-reduce:transition-none sm:size-4 sm:before:size-1.5",
773
+ "data-slot": "radio-indicator"
774
+ }
775
+ )
776
+ ]
639
777
  }
640
778
  );
641
779
  }
@@ -645,10 +783,14 @@ function Switch({ className, ...props }) {
645
783
  {
646
784
  "data-slot": "switch",
647
785
  className: cn(
648
- `peer data-[checked]:bg-primary data-[unchecked]:bg-input focus-visible:border-ring
649
- focus-visible:ring-ring/50 dark:data-[unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0
650
- items-center rounded-full border border-transparent shadow-xs transition-all outline-none
651
- focus-visible:ring-[3px] data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,
786
+ `peer relative inline-flex h-10 w-11 shrink-0 items-center justify-center outline-none
787
+ before:pointer-events-none before:absolute before:left-1/2 before:top-1/2 before:h-[1.15rem]
788
+ before:w-8 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:border
789
+ before:border-transparent before:bg-input before:shadow-xs before:transition-[background-color,box-shadow]
790
+ data-[checked]:before:bg-primary dark:data-[unchecked]:before:bg-input/80
791
+ focus-visible:before:border-ring focus-visible:before:ring-[3px] focus-visible:before:ring-ring/50
792
+ transition-transform duration-150 ease-out motion-safe:active:not-data-disabled:scale-[0.96]
793
+ motion-reduce:transition-none pointer-coarse:h-11 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,
652
794
  className
653
795
  ),
654
796
  ...props,
@@ -658,7 +800,7 @@ function Switch({ className, ...props }) {
658
800
  "data-slot": "switch-thumb",
659
801
  className: cn(
660
802
  `bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground
661
- pointer-events-none block size-4 rounded-full ring-0 transition-transform
803
+ pointer-events-none absolute left-[calc(50%-1rem)] top-1/2 block size-4 -translate-y-1/2 rounded-full ring-0 transition-transform
662
804
  data-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0`
663
805
  )
664
806
  }
@@ -666,73 +808,6 @@ function Switch({ className, ...props }) {
666
808
  }
667
809
  );
668
810
  }
669
- var PORTAL_ROOT_ID = "portal-root";
670
- var PortalContext = React19.createContext({
671
- layer: "base",
672
- depth: 0,
673
- floatingPortalStrategy: "root",
674
- floatingZIndex: "default"
675
- });
676
- function ModalPortalScope({
677
- children,
678
- floatingPortalStrategy = "nested",
679
- floatingZIndex = "default"
680
- }) {
681
- const parentContext = React19.useContext(PortalContext);
682
- const depth = parentContext.layer === "modal" ? parentContext.depth + 1 : 0;
683
- const value = React19.useMemo(
684
- () => ({
685
- layer: "modal",
686
- depth,
687
- floatingPortalStrategy,
688
- floatingZIndex
689
- }),
690
- [depth, floatingPortalStrategy, floatingZIndex]
691
- );
692
- return /* @__PURE__ */ jsx(PortalContext.Provider, { value, children });
693
- }
694
- function usePortalContext() {
695
- return React19.useContext(PortalContext);
696
- }
697
- function useInModalOverlay() {
698
- return React19.useContext(PortalContext).layer === "modal";
699
- }
700
- function useRootPortalContainer() {
701
- const [container, setContainer] = React19.useState(null);
702
- React19.useLayoutEffect(() => {
703
- const el = document.getElementById(PORTAL_ROOT_ID);
704
- setContainer(el);
705
- }, []);
706
- return container;
707
- }
708
- function useFloatingOverlayPortalProps() {
709
- const rootContainer = useRootPortalContainer();
710
- const { floatingPortalStrategy, floatingZIndex } = React19.useContext(PortalContext);
711
- const container = floatingPortalStrategy === "nested" ? void 0 : rootContainer ?? null;
712
- const zIndexClass = floatingZIndex === "elevated" ? "z-[var(--z-layer-floating-elevated)]" : "z-[var(--z-layer-floating)]";
713
- return { container, zIndexClass };
714
- }
715
- function PortalRoot() {
716
- return /* @__PURE__ */ jsx(
717
- "div",
718
- {
719
- id: PORTAL_ROOT_ID,
720
- "data-slot": "portal-root",
721
- style: {
722
- position: "fixed",
723
- inset: 0,
724
- zIndex: "var(--z-layer-portal-root)",
725
- pointerEvents: "none"
726
- // Children (portal contents) will have pointer-events: auto
727
- }
728
- }
729
- );
730
- }
731
- function usePortalContainer() {
732
- if (typeof document === "undefined") return void 0;
733
- const el = document.getElementById(PORTAL_ROOT_ID);
734
- return el instanceof HTMLElement ? el : void 0;
735
- }
736
811
  function Select({ onValueChange, ...props }) {
737
812
  return /* @__PURE__ */ jsx(
738
813
  Select$1.Root,
@@ -746,14 +821,14 @@ function Select({ onValueChange, ...props }) {
746
821
  }
747
822
  );
748
823
  }
749
- var SelectTrigger = React19.forwardRef(
824
+ var SelectTrigger = React21.forwardRef(
750
825
  ({ className, size = "default", children, ...props }, ref) => {
751
826
  return /* @__PURE__ */ jsxs(
752
827
  Select$1.Trigger,
753
828
  {
754
829
  ref,
755
830
  className: cn(
756
- "relative inline-flex min-h-9 w-full min-w-36 select-none items-center justify-between gap-2 rounded-lg border border-input bg-background bg-clip-padding px-[calc(--spacing(3)-1px)] text-left text-base outline-none ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-data-disabled:not-focus-visible:not-aria-invalid:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 focus-visible:border-ring focus-visible:ring-[3px] aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/16 data-disabled:pointer-events-none data-disabled:opacity-64 sm:min-h-8 sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-focus-visible:not-aria-invalid:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [[data-disabled],:focus-visible,[aria-invalid],[data-pressed]]:shadow-none",
831
+ "relative inline-flex min-h-9 w-full min-w-36 select-none items-center justify-between gap-2 rounded-lg border border-input bg-background bg-clip-padding px-[calc(--spacing(3)-1px)] text-left text-base outline-none ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-data-disabled:not-focus-visible:not-aria-invalid:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] pointer-coarse:min-h-11 sm:pointer-coarse:min-h-11 focus-visible:border-ring focus-visible:ring-[3px] aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/16 data-disabled:pointer-events-none data-disabled:opacity-64 sm:min-h-8 sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-focus-visible:not-aria-invalid:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [[data-disabled],:focus-visible,[aria-invalid],[data-pressed]]:shadow-none",
757
832
  size === "sm" && "min-h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:min-h-7",
758
833
  size === "lg" && "min-h-10 sm:min-h-9",
759
834
  className
@@ -802,7 +877,7 @@ function SelectPopup({
802
877
  children: /* @__PURE__ */ jsxs(
803
878
  Select$1.Popup,
804
879
  {
805
- className: "origin-(--transform-origin) transition-[scale,opacity] has-data-[side=none]:scale-100 has-data-starting-style:scale-98 has-data-starting-style:opacity-0 has-data-[side=none]:transition-none",
880
+ className: "origin-(--transform-origin) scale-100 opacity-100 transition-[scale,opacity] duration-150 data-[side=none]:transition-none data-starting-style:scale-98 data-ending-style:scale-98 data-starting-style:opacity-0 data-ending-style:opacity-0 motion-reduce:transition-none",
806
881
  "data-slot": "select-popup",
807
882
  ...props,
808
883
  children: [
@@ -848,27 +923,37 @@ function SelectItem({
848
923
  Select$1.Item,
849
924
  {
850
925
  className: cn(
851
- "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
926
+ "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none pointer-coarse:min-h-11 sm:pointer-coarse:min-h-11 data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
852
927
  className
853
928
  ),
854
929
  "data-slot": "select-item",
855
930
  ...props,
856
931
  children: [
857
- /* @__PURE__ */ jsx(Select$1.ItemIndicator, { className: "col-start-1", children: /* @__PURE__ */ jsx(
858
- "svg",
932
+ /* @__PURE__ */ jsx(
933
+ Select$1.ItemIndicator,
859
934
  {
860
- fill: "none",
861
- height: "24",
862
- stroke: "currentColor",
863
- strokeLinecap: "round",
864
- strokeLinejoin: "round",
865
- strokeWidth: "2",
866
- viewBox: "0 0 24 24",
867
- width: "24",
868
- xmlns: "http://www.w3.org/1500/svg",
869
- children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
935
+ keepMounted: true,
936
+ className: (state) => cn(
937
+ "col-start-1 transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none",
938
+ state.selected ? "scale-100 opacity-100 blur-0" : "scale-[0.25] opacity-0 blur-[4px]"
939
+ ),
940
+ children: /* @__PURE__ */ jsx(
941
+ "svg",
942
+ {
943
+ fill: "none",
944
+ height: "24",
945
+ stroke: "currentColor",
946
+ strokeLinecap: "round",
947
+ strokeLinejoin: "round",
948
+ strokeWidth: "2",
949
+ viewBox: "0 0 24 24",
950
+ width: "24",
951
+ xmlns: "http://www.w3.org/1500/svg",
952
+ children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
953
+ }
954
+ )
870
955
  }
871
- ) }),
956
+ ),
872
957
  /* @__PURE__ */ jsx(Select$1.ItemText, { className: "col-start-2 min-w-0", children })
873
958
  ]
874
959
  }
@@ -912,27 +997,37 @@ function SelectRichItem({
912
997
  Select$1.Item,
913
998
  {
914
999
  className: cn(
915
- "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1.5 ps-2 pe-4 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
1000
+ "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1.5 ps-2 pe-4 text-base outline-none pointer-coarse:min-h-11 sm:pointer-coarse:min-h-11 data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
916
1001
  className
917
1002
  ),
918
1003
  "data-slot": "select-rich-item",
919
1004
  ...props,
920
1005
  children: [
921
- /* @__PURE__ */ jsx(Select$1.ItemIndicator, { className: "col-start-1 self-start mt-0.5", children: /* @__PURE__ */ jsx(
922
- "svg",
1006
+ /* @__PURE__ */ jsx(
1007
+ Select$1.ItemIndicator,
923
1008
  {
924
- fill: "none",
925
- height: "24",
926
- stroke: "currentColor",
927
- strokeLinecap: "round",
928
- strokeLinejoin: "round",
929
- strokeWidth: "2",
930
- viewBox: "0 0 24 24",
931
- width: "24",
932
- xmlns: "http://www.w3.org/2000/svg",
933
- children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
1009
+ keepMounted: true,
1010
+ className: (state) => cn(
1011
+ "col-start-1 mt-0.5 self-start transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none",
1012
+ state.selected ? "scale-100 opacity-100 blur-0" : "scale-[0.25] opacity-0 blur-[4px]"
1013
+ ),
1014
+ children: /* @__PURE__ */ jsx(
1015
+ "svg",
1016
+ {
1017
+ fill: "none",
1018
+ height: "24",
1019
+ stroke: "currentColor",
1020
+ strokeLinecap: "round",
1021
+ strokeLinejoin: "round",
1022
+ strokeWidth: "2",
1023
+ viewBox: "0 0 24 24",
1024
+ width: "24",
1025
+ xmlns: "http://www.w3.org/2000/svg",
1026
+ children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
1027
+ }
1028
+ )
934
1029
  }
935
- ) }),
1030
+ ),
936
1031
  /* @__PURE__ */ jsxs(Select$1.ItemText, { className: "col-start-2 min-w-0 flex flex-col gap-0.5", children: [
937
1032
  /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
938
1033
  icon,
@@ -954,27 +1049,37 @@ function SelectFieldItem({
954
1049
  Select$1.Item,
955
1050
  {
956
1051
  className: cn(
957
- "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
1052
+ "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none pointer-coarse:min-h-11 sm:pointer-coarse:min-h-11 data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
958
1053
  className
959
1054
  ),
960
1055
  "data-slot": "select-field-item",
961
1056
  ...props,
962
1057
  children: [
963
- /* @__PURE__ */ jsx(Select$1.ItemIndicator, { className: "col-start-1", children: /* @__PURE__ */ jsx(
964
- "svg",
1058
+ /* @__PURE__ */ jsx(
1059
+ Select$1.ItemIndicator,
965
1060
  {
966
- fill: "none",
967
- height: "24",
968
- stroke: "currentColor",
969
- strokeLinecap: "round",
970
- strokeLinejoin: "round",
971
- strokeWidth: "2",
972
- viewBox: "0 0 24 24",
973
- width: "24",
974
- xmlns: "http://www.w3.org/2000/svg",
975
- children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
1061
+ keepMounted: true,
1062
+ className: (state) => cn(
1063
+ "col-start-1 transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none",
1064
+ state.selected ? "scale-100 opacity-100 blur-0" : "scale-[0.25] opacity-0 blur-[4px]"
1065
+ ),
1066
+ children: /* @__PURE__ */ jsx(
1067
+ "svg",
1068
+ {
1069
+ fill: "none",
1070
+ height: "24",
1071
+ stroke: "currentColor",
1072
+ strokeLinecap: "round",
1073
+ strokeLinejoin: "round",
1074
+ strokeWidth: "2",
1075
+ viewBox: "0 0 24 24",
1076
+ width: "24",
1077
+ xmlns: "http://www.w3.org/2000/svg",
1078
+ children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
1079
+ }
1080
+ )
976
1081
  }
977
- ) }),
1082
+ ),
978
1083
  /* @__PURE__ */ jsxs(Select$1.ItemText, { className: "col-start-2 min-w-0 flex items-center justify-between gap-2", children: [
979
1084
  /* @__PURE__ */ jsx("span", { className: "truncate", children: name }),
980
1085
  type && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs shrink-0", children: type })
@@ -993,23 +1098,22 @@ function Progress({ className, value, ...props }) {
993
1098
  Progress$1.Indicator,
994
1099
  {
995
1100
  "data-slot": "progress-indicator",
996
- className: "bg-primary h-full w-full flex-1 transition-all",
997
- style: { transform: `translateX(-${100 - (value || 0)}%)` }
1101
+ className: "bg-primary h-full transition-[width] duration-200 ease-out motion-reduce:transition-none"
998
1102
  }
999
1103
  )
1000
1104
  }
1001
1105
  ) });
1002
1106
  }
1003
1107
  var Form = FormProvider;
1004
- var FormFieldContext = React19.createContext({});
1108
+ var FormFieldContext = React21.createContext({});
1005
1109
  var FormField = ({
1006
1110
  ...props
1007
1111
  }) => {
1008
1112
  return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
1009
1113
  };
1010
1114
  var useFormField = () => {
1011
- const fieldContext = React19.useContext(FormFieldContext);
1012
- const itemContext = React19.useContext(FormItemContext);
1115
+ const fieldContext = React21.useContext(FormFieldContext);
1116
+ const itemContext = React21.useContext(FormItemContext);
1013
1117
  const { getFieldState } = useFormContext();
1014
1118
  const formState = useFormState({ name: fieldContext.name });
1015
1119
  const fieldState = getFieldState(fieldContext.name, formState);
@@ -1026,9 +1130,9 @@ var useFormField = () => {
1026
1130
  ...fieldState
1027
1131
  };
1028
1132
  };
1029
- var FormItemContext = React19.createContext({});
1133
+ var FormItemContext = React21.createContext({});
1030
1134
  function FormItem({ className, ...props }) {
1031
- const id = React19.useId();
1135
+ const id = React21.useId();
1032
1136
  return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { "data-slot": "form-item", className: cn("grid gap-2", className), ...props }) });
1033
1137
  }
1034
1138
  function FormLabel({ className, ...props }) {
@@ -1078,7 +1182,7 @@ function FormMessage({ className, ...props }) {
1078
1182
  return /* @__PURE__ */ jsx("p", { "data-slot": "form-message", id: formMessageId, className: cn("text-destructive text-sm", className), ...props, children: body });
1079
1183
  }
1080
1184
  function FormControl2({ children, label, id, layout = "stacked", error, className }) {
1081
- const generatedId = React19.useId();
1185
+ const generatedId = React21.useId();
1082
1186
  const inputId = id || generatedId;
1083
1187
  const errorId = error ? `${inputId}-error` : void 0;
1084
1188
  const childProps = {
@@ -1089,7 +1193,7 @@ function FormControl2({ children, label, id, layout = "stacked", error, classNam
1089
1193
  if (layout === "floating") {
1090
1194
  childProps.placeholder = " ";
1091
1195
  }
1092
- const childWithProps = React19.cloneElement(children, childProps);
1196
+ const childWithProps = React21.cloneElement(children, childProps);
1093
1197
  if (layout === "floating") {
1094
1198
  return /* @__PURE__ */ jsxs("div", { className: cn("space-y-1", className), children: [
1095
1199
  /* @__PURE__ */ jsxs(
@@ -1098,12 +1202,10 @@ function FormControl2({ children, label, id, layout = "stacked", error, classNam
1098
1202
  className: cn(
1099
1203
  "relative",
1100
1204
  // Float label when focused
1101
- "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:top-2",
1102
1205
  "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0",
1103
1206
  "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]",
1104
1207
  "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-primary/80",
1105
1208
  // Float label when there's a value
1106
- "has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:top-2",
1107
1209
  "has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:translate-y-0",
1108
1210
  "has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:scale-[0.7]",
1109
1211
  // Error
@@ -1126,11 +1228,11 @@ function FormControl2({ children, label, id, layout = "stacked", error, classNam
1126
1228
  "data-slot": "form-control-label",
1127
1229
  className: cn(
1128
1230
  // Base: centered when empty
1129
- "pointer-events-none absolute start-3 top-1/2 -translate-y-1/2",
1231
+ "pointer-events-none absolute start-3 top-2 translate-y-[0.45rem]",
1130
1232
  // Small, subtle typography
1131
1233
  "origin-left text-[13px] leading-none font-normal text-muted-foreground/60 select-none",
1132
1234
  // Snappy transition
1133
- "transition-[top,transform,color] duration-200 ease-out",
1235
+ "transition-[transform,color] duration-200 ease-out motion-reduce:transition-none",
1134
1236
  // Error state
1135
1237
  error && "text-destructive"
1136
1238
  ),
@@ -1154,7 +1256,8 @@ function InputGroup({ className, ...props }) {
1154
1256
  "div",
1155
1257
  {
1156
1258
  className: cn(
1157
- "relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-primary/60 has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] has-[input:focus-visible,textarea:focus-visible]:ring-primary/35 sm:text-sm dark:bg-input/32 dark:bg-clip-border dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/8%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]",
1259
+ // Match aria-invalid="true" only. aria-invalid="false" must not paint as invalid.
1260
+ "relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid=true],textarea[aria-invalid=true]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-primary/60 has-[input[aria-invalid=true],textarea[aria-invalid=true]]:border-destructive/36 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid=true],textarea[aria-invalid=true]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] has-[input:focus-visible,textarea:focus-visible]:ring-primary/35 sm:text-sm dark:bg-input/32 dark:bg-clip-border dark:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid=true],textarea[aria-invalid=true]]:before:shadow-[0_-1px_--theme(--color-white/8%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]",
1158
1261
  className
1159
1262
  ),
1160
1263
  "data-slot": "input-group",
@@ -1223,48 +1326,200 @@ function InputGroupInput({ className, ...props }) {
1223
1326
  function InputGroupTextarea({ className, ...props }) {
1224
1327
  return /* @__PURE__ */ jsx(Textarea, { className, unstyled: true, ...props });
1225
1328
  }
1226
- function Field({
1227
- label,
1228
- description,
1229
- error,
1230
- required,
1231
- htmlFor,
1329
+ function FieldSet({ className, ...props }) {
1330
+ return /* @__PURE__ */ jsx(
1331
+ "fieldset",
1332
+ {
1333
+ "data-slot": "field-set",
1334
+ className: cn(
1335
+ "flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
1336
+ className
1337
+ ),
1338
+ ...props
1339
+ }
1340
+ );
1341
+ }
1342
+ function FieldLegend({
1232
1343
  className,
1233
- children
1344
+ variant = "legend",
1345
+ ...props
1234
1346
  }) {
1235
- return /* @__PURE__ */ jsxs("div", { "data-slot": "field", className: cn("grid gap-2", className), children: [
1236
- /* @__PURE__ */ jsxs(
1237
- Label,
1238
- {
1239
- htmlFor,
1240
- "data-slot": "field-label",
1241
- className: cn(error && "text-destructive"),
1242
- children: [
1243
- label,
1244
- required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", "aria-hidden": "true", children: "*" })
1245
- ]
1246
- }
1247
- ),
1347
+ return /* @__PURE__ */ jsx(
1348
+ "legend",
1349
+ {
1350
+ "data-slot": "field-legend",
1351
+ "data-variant": variant,
1352
+ className: cn("mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className),
1353
+ ...props
1354
+ }
1355
+ );
1356
+ }
1357
+ function FieldGroup({ className, ...props }) {
1358
+ return /* @__PURE__ */ jsx(
1359
+ "div",
1360
+ {
1361
+ "data-slot": "field-group",
1362
+ className: cn(
1363
+ `group/field-group @container/field-group flex w-full flex-col gap-5
1364
+ data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,
1365
+ className
1366
+ ),
1367
+ ...props
1368
+ }
1369
+ );
1370
+ }
1371
+ var fieldVariants = cva("group/field flex w-full gap-2 data-[invalid=true]:text-destructive", {
1372
+ variants: {
1373
+ orientation: {
1374
+ vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
1375
+ horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
1376
+ responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
1377
+ }
1378
+ },
1379
+ defaultVariants: {
1380
+ orientation: "vertical"
1381
+ }
1382
+ });
1383
+ function isLegacyFieldProps(props) {
1384
+ return typeof props.label === "string";
1385
+ }
1386
+ function FieldContainer({ className, orientation = "vertical", ...props }) {
1387
+ return /* @__PURE__ */ jsx(
1388
+ "div",
1389
+ {
1390
+ role: "group",
1391
+ "data-slot": "field",
1392
+ "data-orientation": orientation,
1393
+ className: cn(fieldVariants({ orientation }), className),
1394
+ ...props
1395
+ }
1396
+ );
1397
+ }
1398
+ function Field(props) {
1399
+ if (!isLegacyFieldProps(props)) {
1400
+ return /* @__PURE__ */ jsx(FieldContainer, { ...props });
1401
+ }
1402
+ const {
1403
+ label,
1404
+ description,
1405
+ descriptionId,
1406
+ error,
1407
+ errorId,
1408
+ required,
1409
+ htmlFor,
1410
+ className,
1411
+ children
1412
+ } = props;
1413
+ return /* @__PURE__ */ jsxs(FieldContainer, { className, "data-invalid": Boolean(error), children: [
1414
+ /* @__PURE__ */ jsxs(FieldLabel, { htmlFor, children: [
1415
+ label,
1416
+ required && /* @__PURE__ */ jsx("span", { className: "ml-1 text-destructive", "aria-hidden": "true", children: "*" })
1417
+ ] }),
1248
1418
  children,
1249
- description && /* @__PURE__ */ jsx(
1250
- "p",
1251
- {
1252
- "data-slot": "field-description",
1253
- className: "text-muted-foreground text-sm",
1254
- children: description
1255
- }
1256
- ),
1257
- error && /* @__PURE__ */ jsx(
1258
- "p",
1259
- {
1260
- "data-slot": "field-error",
1261
- className: "text-destructive text-sm",
1262
- role: "alert",
1263
- children: error
1264
- }
1265
- )
1419
+ description && /* @__PURE__ */ jsx(FieldDescription, { id: descriptionId, children: description }),
1420
+ error && /* @__PURE__ */ jsx(FieldError, { id: errorId, children: error })
1266
1421
  ] });
1267
1422
  }
1423
+ function FieldContent({ className, ...props }) {
1424
+ return /* @__PURE__ */ jsx(
1425
+ "div",
1426
+ {
1427
+ "data-slot": "field-content",
1428
+ className: cn("group/field-content flex flex-1 flex-col gap-0.5 leading-snug", className),
1429
+ ...props
1430
+ }
1431
+ );
1432
+ }
1433
+ function FieldLabel({ className, ...props }) {
1434
+ return /* @__PURE__ */ jsx(
1435
+ Label,
1436
+ {
1437
+ "data-slot": "field-label",
1438
+ className: cn(
1439
+ `group/field-label peer/field-label flex w-fit gap-2 leading-snug
1440
+ group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5
1441
+ has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border
1442
+ *:data-[slot=field]:p-2.5 has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,
1443
+ className
1444
+ ),
1445
+ ...props
1446
+ }
1447
+ );
1448
+ }
1449
+ function FieldTitle({ className, ...props }) {
1450
+ return /* @__PURE__ */ jsx(
1451
+ "div",
1452
+ {
1453
+ "data-slot": "field-label",
1454
+ className: cn(
1455
+ "flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",
1456
+ className
1457
+ ),
1458
+ ...props
1459
+ }
1460
+ );
1461
+ }
1462
+ function FieldDescription({ className, ...props }) {
1463
+ return /* @__PURE__ */ jsx(
1464
+ "p",
1465
+ {
1466
+ "data-slot": "field-description",
1467
+ className: cn(
1468
+ `text-left text-sm leading-normal font-normal text-muted-foreground
1469
+ group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5 last:mt-0 nth-last-2:-mt-1
1470
+ [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,
1471
+ className
1472
+ ),
1473
+ ...props
1474
+ }
1475
+ );
1476
+ }
1477
+ function FieldSeparator({
1478
+ children,
1479
+ className,
1480
+ ...props
1481
+ }) {
1482
+ return /* @__PURE__ */ jsxs(
1483
+ "div",
1484
+ {
1485
+ "data-slot": "field-separator",
1486
+ "data-content": Boolean(children),
1487
+ className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
1488
+ ...props,
1489
+ children: [
1490
+ /* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" }),
1491
+ children && /* @__PURE__ */ jsx("span", { className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground", "data-slot": "field-separator-content", children })
1492
+ ]
1493
+ }
1494
+ );
1495
+ }
1496
+ function FieldError({
1497
+ className,
1498
+ children,
1499
+ errors,
1500
+ ...props
1501
+ }) {
1502
+ const content = React21.useMemo(() => {
1503
+ if (children) return children;
1504
+ if (!errors?.length) return null;
1505
+ const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
1506
+ if (uniqueErrors.length === 1) return uniqueErrors[0]?.message;
1507
+ return /* @__PURE__ */ jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
1508
+ (error, index) => error?.message && /* @__PURE__ */ jsx("li", { children: error.message }, `${error.message}-${index}`)
1509
+ ) });
1510
+ }, [children, errors]);
1511
+ if (!content) return null;
1512
+ return /* @__PURE__ */ jsx(
1513
+ "div",
1514
+ {
1515
+ role: "alert",
1516
+ "data-slot": "field-error",
1517
+ className: cn("text-sm font-normal text-destructive", className),
1518
+ ...props,
1519
+ children: content
1520
+ }
1521
+ );
1522
+ }
1268
1523
  function FieldRow({
1269
1524
  label,
1270
1525
  description,
@@ -1274,42 +1529,109 @@ function FieldRow({
1274
1529
  className,
1275
1530
  children
1276
1531
  }) {
1277
- const labelElement = /* @__PURE__ */ jsx(
1278
- Label,
1532
+ const labelElement = /* @__PURE__ */ jsx(FieldLabel, { htmlFor, children: label });
1533
+ return /* @__PURE__ */ jsxs(
1534
+ "div",
1279
1535
  {
1280
- htmlFor,
1281
- "data-slot": "field-label",
1536
+ "data-slot": "field-row",
1537
+ "data-invalid": Boolean(error),
1538
+ className: cn("group/field flex flex-col gap-2 data-[invalid=true]:text-destructive", className),
1539
+ children: [
1540
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1541
+ labelPosition === "start" && labelElement,
1542
+ children,
1543
+ labelPosition === "end" && labelElement
1544
+ ] }),
1545
+ description && /* @__PURE__ */ jsx(FieldDescription, { children: description }),
1546
+ error && /* @__PURE__ */ jsx(FieldError, { children: error })
1547
+ ]
1548
+ }
1549
+ );
1550
+ }
1551
+ function Empty({ className, ...props }) {
1552
+ return /* @__PURE__ */ jsx(
1553
+ "div",
1554
+ {
1555
+ "data-slot": "empty",
1282
1556
  className: cn(
1283
- "text-sm font-medium leading-none",
1284
- error && "text-destructive"
1557
+ "flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",
1558
+ className
1285
1559
  ),
1286
- children: label
1560
+ ...props
1561
+ }
1562
+ );
1563
+ }
1564
+ function EmptyHeader({ className, ...props }) {
1565
+ return /* @__PURE__ */ jsx(
1566
+ "div",
1567
+ {
1568
+ "data-slot": "empty-header",
1569
+ className: cn("flex max-w-sm flex-col items-center gap-2", className),
1570
+ ...props
1571
+ }
1572
+ );
1573
+ }
1574
+ var emptyMediaVariants = cva("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
1575
+ variants: {
1576
+ variant: {
1577
+ default: "bg-transparent",
1578
+ icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*=size-])]:size-4"
1579
+ }
1580
+ },
1581
+ defaultVariants: {
1582
+ variant: "default"
1583
+ }
1584
+ });
1585
+ function EmptyMedia({
1586
+ className,
1587
+ variant = "default",
1588
+ ...props
1589
+ }) {
1590
+ return /* @__PURE__ */ jsx(
1591
+ "div",
1592
+ {
1593
+ "data-slot": "empty-icon",
1594
+ "data-variant": variant,
1595
+ className: cn(emptyMediaVariants({ variant, className })),
1596
+ ...props
1597
+ }
1598
+ );
1599
+ }
1600
+ function EmptyTitle({ className, ...props }) {
1601
+ return /* @__PURE__ */ jsx(
1602
+ "div",
1603
+ {
1604
+ "data-slot": "empty-title",
1605
+ className: cn("text-sm font-medium tracking-tight", className),
1606
+ ...props
1607
+ }
1608
+ );
1609
+ }
1610
+ function EmptyDescription({ className, ...props }) {
1611
+ return /* @__PURE__ */ jsx(
1612
+ "p",
1613
+ {
1614
+ "data-slot": "empty-description",
1615
+ className: cn(
1616
+ "text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
1617
+ className
1618
+ ),
1619
+ ...props
1620
+ }
1621
+ );
1622
+ }
1623
+ function EmptyContent({ className, ...props }) {
1624
+ return /* @__PURE__ */ jsx(
1625
+ "div",
1626
+ {
1627
+ "data-slot": "empty-content",
1628
+ className: cn(
1629
+ "flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance",
1630
+ className
1631
+ ),
1632
+ ...props
1287
1633
  }
1288
1634
  );
1289
- return /* @__PURE__ */ jsxs("div", { "data-slot": "field-row", className: cn("grid gap-2", className), children: [
1290
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1291
- labelPosition === "start" && labelElement,
1292
- children,
1293
- labelPosition === "end" && labelElement
1294
- ] }),
1295
- description && /* @__PURE__ */ jsx(
1296
- "p",
1297
- {
1298
- "data-slot": "field-description",
1299
- className: "text-muted-foreground text-sm",
1300
- children: description
1301
- }
1302
- ),
1303
- error && /* @__PURE__ */ jsx(
1304
- "p",
1305
- {
1306
- "data-slot": "field-error",
1307
- className: "text-destructive text-sm",
1308
- role: "alert",
1309
- children: error
1310
- }
1311
- )
1312
- ] });
1313
1635
  }
1314
1636
  function TooltipProvider({ delay = 0, delayDuration, ...props }) {
1315
1637
  return /* @__PURE__ */ jsx(Tooltip$1.Provider, { "data-slot": "tooltip-provider", delay: delayDuration ?? delay, ...props });
@@ -1317,24 +1639,18 @@ function TooltipProvider({ delay = 0, delayDuration, ...props }) {
1317
1639
  function Tooltip({ delayDuration: _delayDuration, ...props }) {
1318
1640
  return /* @__PURE__ */ jsx(Tooltip$1.Root, { "data-slot": "tooltip", ...props });
1319
1641
  }
1320
- function TooltipTrigger({ delay = 0, asChild, children, ...props }) {
1321
- if (asChild && React19.isValidElement(children)) {
1322
- return /* @__PURE__ */ jsx(
1323
- Tooltip$1.Trigger,
1324
- {
1325
- "data-slot": "tooltip-trigger",
1326
- delay,
1327
- ...props,
1328
- render: (triggerProps) => {
1329
- return React19.cloneElement(
1330
- children,
1331
- mergePropsWithRef(triggerProps, children)
1332
- );
1333
- }
1334
- }
1335
- );
1336
- }
1337
- return /* @__PURE__ */ jsx(Tooltip$1.Trigger, { "data-slot": "tooltip-trigger", delay, ...props, children });
1642
+ function TooltipTrigger({ delay = 0, asChild, children, render, ...props }) {
1643
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
1644
+ return /* @__PURE__ */ jsx(
1645
+ Tooltip$1.Trigger,
1646
+ {
1647
+ "data-slot": "tooltip-trigger",
1648
+ delay,
1649
+ render: render ?? childRender,
1650
+ ...props,
1651
+ children: childRender ? void 0 : children
1652
+ }
1653
+ );
1338
1654
  }
1339
1655
  function TooltipContent({
1340
1656
  className,
@@ -1351,14 +1667,17 @@ function TooltipContent({
1351
1667
  {
1352
1668
  "data-slot": "tooltip-content",
1353
1669
  className: cn(
1354
- `bg-popover text-popover-foreground data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95
1355
- data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95
1356
- data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2
1357
- data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2
1358
- relative max-w-70 rounded-md border px-2 py-1 text-xs`,
1670
+ `bg-popover text-popover-foreground origin-(--transform-origin) relative max-w-70 rounded-md border px-2 py-1
1671
+ text-xs transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
1672
+ data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
1673
+ data-[side=bottom]:data-starting-style:-translate-y-2
1674
+ data-[side=left]:data-starting-style:translate-x-2
1675
+ data-[side=right]:data-starting-style:-translate-x-2
1676
+ data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
1359
1677
  className
1360
1678
  ),
1361
1679
  ...props,
1680
+ role: "tooltip",
1362
1681
  children: [
1363
1682
  children,
1364
1683
  showArrow && /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]" })
@@ -1369,25 +1688,31 @@ function TooltipContent({
1369
1688
  function Popover({ ...props }) {
1370
1689
  return /* @__PURE__ */ jsx(Popover$1.Root, { "data-slot": "popover", ...props });
1371
1690
  }
1372
- function PopoverTrigger({ asChild, nativeButton, children, ...props }) {
1373
- if (asChild && React19.isValidElement(children)) {
1374
- return /* @__PURE__ */ jsx(
1375
- Popover$1.Trigger,
1376
- {
1377
- "data-slot": "popover-trigger",
1378
- nativeButton: nativeButton ?? true,
1379
- ...props,
1380
- render: (triggerProps) => {
1381
- const { nativeButton: _, ...rest } = triggerProps;
1382
- return React19.cloneElement(
1383
- children,
1384
- mergePropsWithRef(rest, children)
1385
- );
1386
- }
1387
- }
1388
- );
1389
- }
1390
- return /* @__PURE__ */ jsx(Popover$1.Trigger, { "data-slot": "popover-trigger", nativeButton, ...props, children });
1691
+ function PopoverTrigger({ asChild, children, render, nativeButton, ...props }) {
1692
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
1693
+ return /* @__PURE__ */ jsx(
1694
+ Popover$1.Trigger,
1695
+ {
1696
+ "data-slot": "popover-trigger",
1697
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
1698
+ render: render ?? childRender,
1699
+ ...props,
1700
+ children: childRender ? void 0 : children
1701
+ }
1702
+ );
1703
+ }
1704
+ function PopoverClose({ asChild, children, render, nativeButton, ...props }) {
1705
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
1706
+ return /* @__PURE__ */ jsx(
1707
+ Popover$1.Close,
1708
+ {
1709
+ "data-slot": "popover-close",
1710
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
1711
+ render: render ?? childRender,
1712
+ ...props,
1713
+ children: childRender ? void 0 : children
1714
+ }
1715
+ );
1391
1716
  }
1392
1717
  function PopoverContent({
1393
1718
  className,
@@ -1415,11 +1740,13 @@ function PopoverContent({
1415
1740
  {
1416
1741
  "data-slot": "popover-content",
1417
1742
  className: cn(
1418
- `bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out
1419
- data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95
1420
- data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2
1421
- data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 w-72 rounded-md border p-4
1422
- shadow-md outline-hidden`,
1743
+ `bg-popover text-popover-foreground origin-(--transform-origin) w-72 rounded-md border p-4 shadow-md outline-hidden
1744
+ transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
1745
+ data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
1746
+ data-[side=bottom]:data-starting-style:-translate-y-2
1747
+ data-[side=left]:data-starting-style:translate-x-2
1748
+ data-[side=right]:data-starting-style:-translate-x-2
1749
+ data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
1423
1750
  className
1424
1751
  ),
1425
1752
  ...props,
@@ -1435,7 +1762,27 @@ function PopoverContent({
1435
1762
  function PopoverAnchor({ ...props }) {
1436
1763
  return /* @__PURE__ */ jsx("div", { "data-slot": "popover-anchor", ...props });
1437
1764
  }
1438
- var ScrollArea = React19.forwardRef(
1765
+ function PopoverTitle({ className, ...props }) {
1766
+ return /* @__PURE__ */ jsx(
1767
+ Popover$1.Title,
1768
+ {
1769
+ "data-slot": "popover-title",
1770
+ className: cn("font-medium leading-none", className),
1771
+ ...props
1772
+ }
1773
+ );
1774
+ }
1775
+ function PopoverDescription({ className, ...props }) {
1776
+ return /* @__PURE__ */ jsx(
1777
+ Popover$1.Description,
1778
+ {
1779
+ "data-slot": "popover-description",
1780
+ className: cn("text-muted-foreground text-sm", className),
1781
+ ...props
1782
+ }
1783
+ );
1784
+ }
1785
+ var ScrollArea = React21.forwardRef(
1439
1786
  ({ className, children, scrollFade = false, scrollbarGutter = false, ...props }, ref) => {
1440
1787
  return /* @__PURE__ */ jsxs(
1441
1788
  ScrollArea$1.Root,
@@ -1491,55 +1838,42 @@ function ScrollBar({
1491
1838
  );
1492
1839
  }
1493
1840
  var Dialog = Dialog$1.Root;
1494
- function DialogPortal({ keepMounted = true, ...props }) {
1495
- const container = useRootPortalContainer();
1841
+ function DialogPortal({ container: containerProp, ...props }) {
1842
+ const rootContainer = useRootPortalContainer();
1843
+ const container = containerProp === void 0 ? rootContainer ?? void 0 : containerProp;
1496
1844
  const style = {
1497
1845
  ...props.style ?? {},
1498
1846
  // Ensure floating overlays inside dialogs (select/menu/popover/tooltip) stack above the dialog.
1499
1847
  // Nested Base UI portals inherit this var via Base UI portal nesting.
1500
1848
  ["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
1501
1849
  };
1502
- return /* @__PURE__ */ jsx(Dialog$1.Portal, { keepMounted, container, ...props, style });
1850
+ return /* @__PURE__ */ jsx(Dialog$1.Portal, { container, ...props, style });
1503
1851
  }
1504
- function DialogTrigger({ asChild, nativeButton, children, ...props }) {
1505
- if (asChild && React19.isValidElement(children)) {
1506
- return /* @__PURE__ */ jsx(
1507
- Dialog$1.Trigger,
1508
- {
1509
- "data-slot": "dialog-trigger",
1510
- nativeButton: nativeButton ?? true,
1511
- ...props,
1512
- render: (triggerProps) => {
1513
- const { nativeButton: _, ...rest } = triggerProps;
1514
- return React19.cloneElement(
1515
- children,
1516
- mergePropsWithRef(rest, children)
1517
- );
1518
- }
1519
- }
1520
- );
1521
- }
1522
- return /* @__PURE__ */ jsx(Dialog$1.Trigger, { "data-slot": "dialog-trigger", nativeButton, ...props, children });
1852
+ function DialogTrigger({ asChild, children, render, nativeButton, ...props }) {
1853
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
1854
+ return /* @__PURE__ */ jsx(
1855
+ Dialog$1.Trigger,
1856
+ {
1857
+ "data-slot": "dialog-trigger",
1858
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
1859
+ render: render ?? childRender,
1860
+ ...props,
1861
+ children: childRender ? void 0 : children
1862
+ }
1863
+ );
1523
1864
  }
1524
- function DialogClose({ asChild, nativeButton, children, ...props }) {
1525
- if (asChild && React19.isValidElement(children)) {
1526
- return /* @__PURE__ */ jsx(
1527
- Dialog$1.Close,
1528
- {
1529
- "data-slot": "dialog-close",
1530
- nativeButton: nativeButton ?? true,
1531
- ...props,
1532
- render: (closeProps) => {
1533
- const { nativeButton: _, ...rest } = closeProps;
1534
- return React19.cloneElement(
1535
- children,
1536
- mergePropsWithRef(rest, children)
1537
- );
1538
- }
1539
- }
1540
- );
1541
- }
1542
- return /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "dialog-close", nativeButton, ...props, children });
1865
+ function DialogClose({ asChild, children, render, nativeButton, ...props }) {
1866
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
1867
+ return /* @__PURE__ */ jsx(
1868
+ Dialog$1.Close,
1869
+ {
1870
+ "data-slot": "dialog-close",
1871
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
1872
+ render: render ?? childRender,
1873
+ ...props,
1874
+ children: childRender ? void 0 : children
1875
+ }
1876
+ );
1543
1877
  }
1544
1878
  function DialogBackdrop({
1545
1879
  className,
@@ -1592,7 +1926,7 @@ function DialogPopup({
1592
1926
  Dialog$1.Popup,
1593
1927
  {
1594
1928
  className: cn(
1595
- "-translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-full min-h-0 w-full min-w-0 max-w-lg scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]",
1929
+ "-translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-full min-h-0 w-full min-w-0 max-w-lg scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg transition-[scale,opacity,translate] duration-200 ease-in-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]",
1596
1930
  bottomStickOnMobile && "max-sm:rounded-none max-sm:border-x-0 max-sm:border-t max-sm:border-b-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4 max-sm:before:hidden max-sm:before:rounded-none",
1597
1931
  className
1598
1932
  ),
@@ -1698,28 +2032,25 @@ function DialogPanel({ className, ...props }) {
1698
2032
  function AlertDialog({ ...props }) {
1699
2033
  return /* @__PURE__ */ jsx(AlertDialog$1.Root, { "data-slot": "alert-dialog", ...props });
1700
2034
  }
1701
- function AlertDialogTrigger({ asChild, nativeButton, children, ...props }) {
1702
- if (asChild && React19.isValidElement(children)) {
1703
- return /* @__PURE__ */ jsx(
1704
- AlertDialog$1.Trigger,
1705
- {
1706
- "data-slot": "alert-dialog-trigger",
1707
- nativeButton: nativeButton ?? true,
1708
- ...props,
1709
- render: (triggerProps) => {
1710
- const { nativeButton: _, ...rest } = triggerProps;
1711
- return React19.cloneElement(
1712
- children,
1713
- mergePropsWithRef(rest, children)
1714
- );
1715
- }
1716
- }
1717
- );
1718
- }
1719
- return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, { "data-slot": "alert-dialog-trigger", nativeButton, ...props, children });
2035
+ function AlertDialogTrigger({ asChild, children, render, nativeButton, ...props }) {
2036
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
2037
+ return /* @__PURE__ */ jsx(
2038
+ AlertDialog$1.Trigger,
2039
+ {
2040
+ "data-slot": "alert-dialog-trigger",
2041
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
2042
+ render: render ?? childRender,
2043
+ ...props,
2044
+ children: childRender ? void 0 : children
2045
+ }
2046
+ );
1720
2047
  }
1721
- function AlertDialogPortal({ keepMounted = true, ...props }) {
1722
- const container = useRootPortalContainer();
2048
+ function AlertDialogPortal({
2049
+ container: containerProp,
2050
+ ...props
2051
+ }) {
2052
+ const rootContainer = useRootPortalContainer();
2053
+ const container = containerProp === void 0 ? rootContainer ?? void 0 : containerProp;
1723
2054
  const style = {
1724
2055
  ...props.style ?? {},
1725
2056
  ["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
@@ -1728,7 +2059,6 @@ function AlertDialogPortal({ keepMounted = true, ...props }) {
1728
2059
  AlertDialog$1.Portal,
1729
2060
  {
1730
2061
  "data-slot": "alert-dialog-portal",
1731
- keepMounted,
1732
2062
  container,
1733
2063
  ...props,
1734
2064
  style
@@ -1811,26 +2141,49 @@ function AlertDialogDescription({
1811
2141
  }
1812
2142
  );
1813
2143
  }
1814
- function AlertDialogAction({ className, ...props }) {
2144
+ function AlertDialogAction({
2145
+ asChild,
2146
+ children,
2147
+ render,
2148
+ nativeButton,
2149
+ className,
2150
+ ...props
2151
+ }) {
2152
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
1815
2153
  return /* @__PURE__ */ jsx(
1816
2154
  AlertDialog$1.Close,
1817
2155
  {
1818
2156
  "data-slot": "alert-dialog-action",
1819
2157
  className: cn(buttonVariants(), className),
1820
- ...props
2158
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
2159
+ render: render ?? childRender,
2160
+ ...props,
2161
+ children: childRender ? void 0 : children
1821
2162
  }
1822
2163
  );
1823
2164
  }
1824
- function AlertDialogCancel({ className, ...props }) {
2165
+ function AlertDialogCancel({
2166
+ asChild,
2167
+ children,
2168
+ render,
2169
+ nativeButton,
2170
+ className,
2171
+ ...props
2172
+ }) {
2173
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
1825
2174
  return /* @__PURE__ */ jsx(
1826
2175
  AlertDialog$1.Close,
1827
2176
  {
1828
2177
  "data-slot": "alert-dialog-cancel",
1829
2178
  className: cn(buttonVariants({ variant: "outline" }), className),
1830
- ...props
2179
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
2180
+ render: render ?? childRender,
2181
+ ...props,
2182
+ children: childRender ? void 0 : children
1831
2183
  }
1832
2184
  );
1833
2185
  }
2186
+ var DropdownMenuGroupContext = React21.createContext(false);
1834
2187
  function DropdownMenu({ ...props }) {
1835
2188
  return /* @__PURE__ */ jsx(Menu.Root, { "data-slot": "dropdown-menu", ...props });
1836
2189
  }
@@ -1838,25 +2191,18 @@ function DropdownMenuPortal({ ...props }) {
1838
2191
  const { container } = useFloatingOverlayPortalProps();
1839
2192
  return /* @__PURE__ */ jsx(Menu.Portal, { "data-slot": "dropdown-menu-portal", container, ...props });
1840
2193
  }
1841
- function DropdownMenuTrigger({ asChild, nativeButton, children, ...props }) {
1842
- if (asChild && React19.isValidElement(children)) {
1843
- return /* @__PURE__ */ jsx(
1844
- Menu.Trigger,
1845
- {
1846
- "data-slot": "dropdown-menu-trigger",
1847
- nativeButton: nativeButton ?? true,
1848
- ...props,
1849
- render: (triggerProps) => {
1850
- const { nativeButton: _, ...rest } = triggerProps;
1851
- return React19.cloneElement(
1852
- children,
1853
- mergePropsWithRef(rest, children)
1854
- );
1855
- }
1856
- }
1857
- );
1858
- }
1859
- return /* @__PURE__ */ jsx(Menu.Trigger, { "data-slot": "dropdown-menu-trigger", nativeButton, ...props, children });
2194
+ function DropdownMenuTrigger({ asChild, children, render, nativeButton, ...props }) {
2195
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
2196
+ return /* @__PURE__ */ jsx(
2197
+ Menu.Trigger,
2198
+ {
2199
+ "data-slot": "dropdown-menu-trigger",
2200
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
2201
+ render: render ?? childRender,
2202
+ ...props,
2203
+ children: childRender ? void 0 : children
2204
+ }
2205
+ );
1860
2206
  }
1861
2207
  function DropdownMenuContent({
1862
2208
  className,
@@ -1875,11 +2221,13 @@ function DropdownMenuContent({
1875
2221
  {
1876
2222
  "data-slot": "dropdown-menu-content",
1877
2223
  className: cn(
1878
- `bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out
1879
- data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95
1880
- data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2
1881
- data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 min-w-40 overflow-hidden
1882
- rounded-md border p-1 shadow-lg`,
2224
+ `bg-popover text-popover-foreground origin-(--transform-origin) min-w-40 overflow-hidden rounded-md border p-1
2225
+ shadow-lg transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
2226
+ data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
2227
+ data-[side=bottom]:data-starting-style:-translate-y-2
2228
+ data-[side=left]:data-starting-style:translate-x-2
2229
+ data-[side=right]:data-starting-style:-translate-x-2
2230
+ data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
1883
2231
  className
1884
2232
  ),
1885
2233
  ...props
@@ -1887,7 +2235,7 @@ function DropdownMenuContent({
1887
2235
  ) }) });
1888
2236
  }
1889
2237
  function DropdownMenuGroup({ ...props }) {
1890
- return /* @__PURE__ */ jsx(Menu.Group, { "data-slot": "dropdown-menu-group", ...props });
2238
+ return /* @__PURE__ */ jsx(DropdownMenuGroupContext.Provider, { value: true, children: /* @__PURE__ */ jsx(Menu.Group, { "data-slot": "dropdown-menu-group", ...props }) });
1891
2239
  }
1892
2240
  function DropdownMenuItem({
1893
2241
  className,
@@ -1895,63 +2243,29 @@ function DropdownMenuItem({
1895
2243
  variant = "default",
1896
2244
  asChild,
1897
2245
  children,
1898
- onClick,
2246
+ render,
1899
2247
  ...props
1900
2248
  }) {
2249
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
1901
2250
  const itemClassName = cn(
1902
2251
  `data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive
1903
2252
  data-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/40
1904
2253
  data-[variant=destructive]:data-[highlighted]:text-destructive
1905
- data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default items-center gap-2
1906
- rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none
1907
- data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,
1908
- className
1909
- );
1910
- if (asChild && React19.isValidElement(children)) {
1911
- return /* @__PURE__ */ jsx(
1912
- Menu.Item,
1913
- {
1914
- "data-slot": "dropdown-menu-item",
1915
- "data-inset": inset,
1916
- "data-variant": variant,
1917
- ...props,
1918
- render: (itemProps) => {
1919
- const childProps = children.props;
1920
- const itemOnClick = itemProps.onClick;
1921
- return React19.cloneElement(children, {
1922
- ...itemProps,
1923
- className: cn(itemClassName, childProps.className),
1924
- onClick: (e) => {
1925
- onClick?.(e);
1926
- itemOnClick?.(e);
1927
- }
1928
- });
1929
- }
1930
- }
1931
- );
1932
- }
2254
+ data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default items-center gap-2 pointer-coarse:min-h-11
2255
+ rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none
2256
+ data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,
2257
+ className
2258
+ );
1933
2259
  return /* @__PURE__ */ jsx(
1934
2260
  Menu.Item,
1935
2261
  {
1936
2262
  "data-slot": "dropdown-menu-item",
1937
2263
  "data-inset": inset,
1938
2264
  "data-variant": variant,
2265
+ className: itemClassName,
2266
+ render: render ?? childRender,
1939
2267
  ...props,
1940
- render: (itemProps) => {
1941
- const itemOnClick = itemProps.onClick;
1942
- return /* @__PURE__ */ jsx(
1943
- "div",
1944
- {
1945
- ...itemProps,
1946
- className: cn(itemClassName, itemProps.className),
1947
- onClick: (e) => {
1948
- onClick?.(e);
1949
- itemOnClick?.(e);
1950
- },
1951
- children
1952
- }
1953
- );
1954
- }
2268
+ children: childRender ? void 0 : children
1955
2269
  }
1956
2270
  );
1957
2271
  }
@@ -1967,14 +2281,21 @@ function DropdownMenuCheckboxItem({
1967
2281
  "data-slot": "dropdown-menu-checkbox-item",
1968
2282
  className: cn(
1969
2283
  `data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5
1970
- pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50
2284
+ pr-2 pl-8 text-sm outline-hidden select-none pointer-coarse:min-h-11 data-[disabled]:pointer-events-none data-[disabled]:opacity-50
1971
2285
  [&_svg]:pointer-events-none [&_svg]:shrink-0`,
1972
2286
  className
1973
2287
  ),
1974
2288
  checked,
1975
2289
  ...props,
1976
2290
  children: [
1977
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { size: 16 }) }) }),
2291
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(
2292
+ Menu.CheckboxItemIndicator,
2293
+ {
2294
+ keepMounted: true,
2295
+ className: "transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] data-unchecked:scale-[0.25] data-unchecked:opacity-0 data-unchecked:blur-[4px] motion-reduce:transition-none",
2296
+ children: /* @__PURE__ */ jsx(CheckIcon, { size: 16 })
2297
+ }
2298
+ ) }),
1978
2299
  children
1979
2300
  ]
1980
2301
  }
@@ -1994,13 +2315,20 @@ function DropdownMenuRadioItem({
1994
2315
  "data-slot": "dropdown-menu-radio-item",
1995
2316
  className: cn(
1996
2317
  `data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5
1997
- pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50
2318
+ pr-2 pl-8 text-sm outline-hidden select-none pointer-coarse:min-h-11 data-[disabled]:pointer-events-none data-[disabled]:opacity-50
1998
2319
  [&_svg]:pointer-events-none [&_svg]:shrink-0`,
1999
2320
  className
2000
2321
  ),
2001
2322
  ...props,
2002
2323
  children: [
2003
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(Menu.RadioItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
2324
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(
2325
+ Menu.RadioItemIndicator,
2326
+ {
2327
+ keepMounted: true,
2328
+ className: "transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] data-unchecked:scale-[0.25] data-unchecked:opacity-0 data-unchecked:blur-[4px] motion-reduce:transition-none",
2329
+ children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" })
2330
+ }
2331
+ ) }),
2004
2332
  children
2005
2333
  ]
2006
2334
  }
@@ -2011,15 +2339,17 @@ function DropdownMenuLabel({
2011
2339
  inset,
2012
2340
  ...props
2013
2341
  }) {
2014
- return /* @__PURE__ */ jsx(
2015
- Menu.GroupLabel,
2016
- {
2017
- "data-slot": "dropdown-menu-label",
2018
- "data-inset": inset,
2019
- className: cn("text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8", className),
2020
- ...props
2021
- }
2022
- );
2342
+ const isGrouped = React21.useContext(DropdownMenuGroupContext);
2343
+ const labelProps = {
2344
+ "data-slot": "dropdown-menu-label",
2345
+ "data-inset": inset,
2346
+ className: cn("text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8", className),
2347
+ ...props
2348
+ };
2349
+ if (isGrouped) {
2350
+ return /* @__PURE__ */ jsx(Menu.GroupLabel, { ...labelProps });
2351
+ }
2352
+ return /* @__PURE__ */ jsx("div", { ...labelProps });
2023
2353
  }
2024
2354
  function DropdownMenuSeparator({ className, ...props }) {
2025
2355
  return /* @__PURE__ */ jsx(
@@ -2061,7 +2391,7 @@ function DropdownMenuSubTrigger({
2061
2391
  "data-inset": inset,
2062
2392
  className: cn(
2063
2393
  `data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[popup-open]:bg-accent
2064
- data-[popup-open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm
2394
+ data-[popup-open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm pointer-coarse:min-h-11
2065
2395
  outline-hidden select-none data-[inset]:pl-8`,
2066
2396
  className
2067
2397
  ),
@@ -2080,69 +2410,73 @@ function DropdownMenuSubContent({ className, ...props }) {
2080
2410
  {
2081
2411
  "data-slot": "dropdown-menu-sub-content",
2082
2412
  className: cn(
2083
- `bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out
2084
- data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95
2085
- data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2
2086
- data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 min-w-40 overflow-hidden
2087
- rounded-md border p-1 shadow-lg`,
2413
+ `bg-popover text-popover-foreground origin-(--transform-origin) min-w-40 overflow-hidden rounded-md border p-1
2414
+ shadow-lg transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
2415
+ data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
2416
+ data-[side=bottom]:data-starting-style:-translate-y-2
2417
+ data-[side=left]:data-starting-style:translate-x-2
2418
+ data-[side=right]:data-starting-style:-translate-x-2
2419
+ data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
2088
2420
  className
2089
2421
  ),
2090
2422
  ...props
2091
2423
  }
2092
2424
  ) }) });
2093
2425
  }
2094
- var SheetStackContext = React19.createContext(void 0);
2426
+ var SheetStackContext = React21.createContext(void 0);
2095
2427
  var SHEET_INDENT = 24;
2096
2428
  var useSheetStack = () => {
2097
- return React19.useContext(SheetStackContext);
2429
+ return React21.useContext(SheetStackContext);
2098
2430
  };
2099
- var SheetNestingContext = React19.createContext({
2431
+ var SheetNestingContext = React21.createContext({
2100
2432
  level: 0,
2101
2433
  parentSheetId: null
2102
2434
  });
2103
- var useSheetNesting = () => React19.useContext(SheetNestingContext);
2104
- var SheetContext = React19.createContext(void 0);
2435
+ var useSheetNesting = () => React21.useContext(SheetNestingContext);
2436
+ var SheetContext = React21.createContext(void 0);
2105
2437
  var useSheet = () => {
2106
- const context = React19.useContext(SheetContext);
2438
+ const context = React21.useContext(SheetContext);
2107
2439
  if (!context) {
2108
2440
  throw new Error("useSheet must be used within a Sheet");
2109
2441
  }
2110
2442
  return context;
2111
2443
  };
2112
- var sheetIdCounter = 0;
2113
- function Sheet({ children, sheetId: providedId, ...props }) {
2114
- const [isOpen, setIsOpen] = React19.useState(props?.open ?? props?.defaultOpen ?? false);
2444
+ function Sheet({
2445
+ children,
2446
+ sheetId: providedId,
2447
+ open: openProp,
2448
+ defaultOpen = false,
2449
+ onOpenChange,
2450
+ modal,
2451
+ ...props
2452
+ }) {
2453
+ const [isOpen, setIsOpen] = useControllableState({
2454
+ prop: openProp,
2455
+ defaultProp: defaultOpen,
2456
+ onChange: onOpenChange
2457
+ });
2115
2458
  const sheetStack = useSheetStack();
2116
2459
  const nesting = useSheetNesting();
2117
- const sheetIdRef = React19.useRef(providedId ?? `sheet-${++sheetIdCounter}`);
2118
- const sheetId = sheetIdRef.current;
2460
+ const generatedId = React21.useId();
2461
+ const sheetId = providedId ?? `sheet-${generatedId.replace(/:/g, "")}`;
2119
2462
  const depth = nesting.level;
2120
- const onOpenChangeRef = React19.useRef(props.onOpenChange);
2121
- onOpenChangeRef.current = props.onOpenChange;
2122
- const close = React19.useCallback(() => {
2463
+ const close = React21.useCallback(() => {
2123
2464
  setIsOpen(false);
2124
- onOpenChangeRef.current?.(false);
2125
- }, []);
2126
- const registerSheetRef = React19.useRef(sheetStack?.registerSheet);
2127
- const unregisterSheetRef = React19.useRef(sheetStack?.unregisterSheet);
2128
- registerSheetRef.current = sheetStack?.registerSheet;
2129
- unregisterSheetRef.current = sheetStack?.unregisterSheet;
2130
- React19.useEffect(() => {
2131
- if (registerSheetRef.current && isOpen) {
2465
+ }, [setIsOpen]);
2466
+ const registerSheet = sheetStack?.registerSheet;
2467
+ const unregisterSheet = sheetStack?.unregisterSheet;
2468
+ React21.useEffect(() => {
2469
+ if (registerSheet && isOpen) {
2132
2470
  if (document.activeElement instanceof HTMLElement) {
2133
2471
  document.activeElement.blur();
2134
2472
  }
2135
- registerSheetRef.current({ id: sheetId, depth, close });
2136
- return () => unregisterSheetRef.current?.(sheetId);
2137
- }
2138
- }, [isOpen, sheetId, depth, close]);
2139
- React19.useEffect(() => {
2140
- if (props?.open !== void 0) setIsOpen(props.open);
2141
- }, [props?.open]);
2142
- const handleOpenChange = React19.useCallback((open, _eventDetails) => {
2473
+ registerSheet({ id: sheetId, depth, close });
2474
+ return () => unregisterSheet?.(sheetId);
2475
+ }
2476
+ }, [isOpen, sheetId, depth, close, registerSheet, unregisterSheet]);
2477
+ const handleOpenChange = React21.useCallback((open, _eventDetails) => {
2143
2478
  setIsOpen(open);
2144
- onOpenChangeRef.current?.(open);
2145
- }, []);
2479
+ }, [setIsOpen]);
2146
2480
  const sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;
2147
2481
  const isTopSheet = sheetStack?.isTopSheet(sheetId) ?? true;
2148
2482
  const isNested = depth > 0;
@@ -2152,54 +2486,41 @@ function Sheet({ children, sheetId: providedId, ...props }) {
2152
2486
  "data-slot": "sheet",
2153
2487
  ...props,
2154
2488
  open: isOpen,
2155
- modal: isNested ? false : props.modal,
2489
+ modal: isNested ? false : modal,
2156
2490
  onOpenChange: handleOpenChange,
2157
2491
  children
2158
2492
  }
2159
2493
  ) }) });
2160
2494
  }
2161
- function SheetTrigger({ asChild, nativeButton, children, ...props }) {
2162
- if (asChild && React19.isValidElement(children)) {
2163
- return /* @__PURE__ */ jsx(
2164
- Dialog$1.Trigger,
2165
- {
2166
- "data-slot": "sheet-trigger",
2167
- nativeButton: nativeButton ?? true,
2168
- ...props,
2169
- render: (triggerProps) => {
2170
- const { nativeButton: _, ...rest } = triggerProps;
2171
- return React19.cloneElement(
2172
- children,
2173
- mergePropsWithRef(rest, children)
2174
- );
2175
- }
2176
- }
2177
- );
2178
- }
2179
- return /* @__PURE__ */ jsx(Dialog$1.Trigger, { "data-slot": "sheet-trigger", nativeButton, ...props, children });
2495
+ function SheetTrigger({ asChild, children, render, nativeButton, ...props }) {
2496
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
2497
+ return /* @__PURE__ */ jsx(
2498
+ Dialog$1.Trigger,
2499
+ {
2500
+ "data-slot": "sheet-trigger",
2501
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
2502
+ render: render ?? childRender,
2503
+ ...props,
2504
+ children: childRender ? void 0 : children
2505
+ }
2506
+ );
2180
2507
  }
2181
- function SheetClose({ asChild, nativeButton, children, ...props }) {
2182
- if (asChild && React19.isValidElement(children)) {
2183
- return /* @__PURE__ */ jsx(
2184
- Dialog$1.Close,
2185
- {
2186
- "data-slot": "sheet-close",
2187
- nativeButton: nativeButton ?? true,
2188
- ...props,
2189
- render: (closeProps) => {
2190
- const { nativeButton: _, ...rest } = closeProps;
2191
- return React19.cloneElement(
2192
- children,
2193
- mergePropsWithRef(rest, children)
2194
- );
2195
- }
2196
- }
2197
- );
2198
- }
2199
- return /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "sheet-close", nativeButton, ...props, children });
2508
+ function SheetClose({ asChild, children, render, nativeButton, ...props }) {
2509
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
2510
+ return /* @__PURE__ */ jsx(
2511
+ Dialog$1.Close,
2512
+ {
2513
+ "data-slot": "sheet-close",
2514
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
2515
+ render: render ?? childRender,
2516
+ ...props,
2517
+ children: childRender ? void 0 : children
2518
+ }
2519
+ );
2200
2520
  }
2201
- function SheetPortal({ forceMount: _forceMount, ...props }) {
2202
- const container = useRootPortalContainer();
2521
+ function SheetPortal({ forceMount: _forceMount, container: containerProp, ...props }) {
2522
+ const rootContainer = useRootPortalContainer();
2523
+ const container = containerProp === void 0 ? rootContainer ?? void 0 : containerProp;
2203
2524
  const style = {
2204
2525
  ...props.style ?? {},
2205
2526
  ["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
@@ -2295,7 +2616,7 @@ function SheetContent({
2295
2616
  onFocusOutside: _onFocusOutside,
2296
2617
  ...props
2297
2618
  }) {
2298
- const { isOpen, depth, sheetId, close } = useSheet();
2619
+ const { isOpen, depth, sheetId } = useSheet();
2299
2620
  const sheetStack = useSheetStack();
2300
2621
  const sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;
2301
2622
  const stackMode = sheetStack?.stackMode ?? "cascade";
@@ -2305,8 +2626,8 @@ function SheetContent({
2305
2626
  const topSheetSize = topSheetId ? sheetStack?.getSheetSize(topSheetId) : void 0;
2306
2627
  const collapseBaseSize = topSheetSize ? resolvedSide === "left" || resolvedSide === "right" ? topSheetSize.width : topSheetSize.height : void 0;
2307
2628
  const pushOffset = getPushOffset(resolvedSide, sheetsAbove, stackMode, collapseBaseSize ?? NESTED_SHEET_WIDTH);
2308
- const contentRef = React19.useRef(null);
2309
- React19.useLayoutEffect(() => {
2629
+ const contentRef = React21.useRef(null);
2630
+ React21.useLayoutEffect(() => {
2310
2631
  if (!isOpen) return;
2311
2632
  if (!sheetStack) return;
2312
2633
  const el = contentRef.current;
@@ -2337,47 +2658,24 @@ function SheetContent({
2337
2658
  duration: durations.normal,
2338
2659
  ease: easings.physicalExit
2339
2660
  };
2340
- const isTargetInsideSheet = React19.useCallback((target) => {
2341
- if (!target || !(target instanceof HTMLElement)) return false;
2342
- return !!target.closest('[data-slot="sheet-content"]');
2343
- }, []);
2344
- const isTargetInsidePopup = React19.useCallback((target) => {
2345
- if (!target || !(target instanceof HTMLElement)) return false;
2346
- return !!target.closest(
2347
- [
2348
- '[data-slot="select-popup"]',
2349
- '[data-slot="autocomplete-popup"]',
2350
- '[data-slot="dropdown-menu-content"]',
2351
- '[data-slot="dropdown-menu-sub-content"]',
2352
- '[data-slot="popover-content"]',
2353
- '[data-slot="tooltip-content"]'
2354
- ].join(", ")
2355
- );
2356
- }, []);
2357
- React19.useEffect(() => {
2358
- if (!isOpen) return;
2359
- const handlePointerDown = (event) => {
2360
- if (sheetsAbove > 0) return;
2361
- const target = event.target;
2362
- if (isTargetInsideSheet(target) || isTargetInsidePopup(target)) return;
2363
- close();
2364
- };
2365
- document.addEventListener("pointerdown", handlePointerDown);
2366
- return () => document.removeEventListener("pointerdown", handlePointerDown);
2367
- }, [isOpen, sheetsAbove, isTargetInsideSheet, isTargetInsidePopup, close]);
2368
- return /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(SheetPortal, { "data-slot": "sheet-portal", children: [
2661
+ return /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isOpen && /* @__PURE__ */ jsxs(SheetPortal, { "data-slot": "sheet-portal", children: [
2369
2662
  overlay && depth === 0 && /* @__PURE__ */ jsx(
2370
- motion.div,
2663
+ Dialog$1.Backdrop,
2371
2664
  {
2372
2665
  "data-slot": "sheet-overlay",
2373
- className: "fixed inset-0 bg-black/80",
2374
- initial: { opacity: 0 },
2375
- animate: { opacity: 1 },
2376
- exit: { opacity: 0 },
2377
- transition: { duration: durations.fast, ease: "easeOut" },
2378
- style: { willChange: "opacity", zIndex: "var(--z-layer-modal-backdrop)" }
2379
- },
2380
- "sheet-overlay"
2666
+ render: /* @__PURE__ */ jsx(
2667
+ motion.div,
2668
+ {
2669
+ className: "fixed inset-0 bg-black/80",
2670
+ initial: { opacity: 0 },
2671
+ animate: { opacity: 1 },
2672
+ exit: { opacity: 0 },
2673
+ transition: { duration: durations.fast, ease: "easeOut" },
2674
+ style: { zIndex: "var(--z-layer-modal-backdrop)" }
2675
+ },
2676
+ "sheet-overlay"
2677
+ )
2678
+ }
2381
2679
  ),
2382
2680
  /* @__PURE__ */ jsxs(
2383
2681
  Dialog$1.Popup,
@@ -2402,10 +2700,7 @@ function SheetContent({
2402
2700
  animate: "animate",
2403
2701
  exit: "exit",
2404
2702
  transition,
2405
- style: {
2406
- zIndex,
2407
- willChange: "transform"
2408
- },
2703
+ style: { zIndex },
2409
2704
  className: cn(sheetVariants({ side: resolvedSide }), className)
2410
2705
  },
2411
2706
  `sheet-content-${sheetId}`
@@ -2474,8 +2769,9 @@ function Drawer({ ...props }) {
2474
2769
  function DrawerTrigger({ ...props }) {
2475
2770
  return /* @__PURE__ */ jsx(Drawer$1.Trigger, { "data-slot": "drawer-trigger", ...props });
2476
2771
  }
2477
- function DrawerPortal({ ...props }) {
2478
- const container = useRootPortalContainer();
2772
+ function DrawerPortal({ container: containerProp, ...props }) {
2773
+ const rootContainer = useRootPortalContainer();
2774
+ const container = containerProp === void 0 ? rootContainer ?? void 0 : containerProp;
2479
2775
  return /* @__PURE__ */ jsx(Drawer$1.Portal, { "data-slot": "drawer-portal", container, ...props });
2480
2776
  }
2481
2777
  function DrawerClose({ ...props }) {
@@ -2487,8 +2783,9 @@ function DrawerOverlay({ className, ...props }) {
2487
2783
  {
2488
2784
  "data-slot": "drawer-overlay",
2489
2785
  className: cn(
2490
- `data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0
2491
- data-[state=open]:fade-in-0 fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/50`,
2786
+ `fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/50
2787
+ data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_150ms_ease-in]
2788
+ motion-reduce:animate-none`,
2492
2789
  className
2493
2790
  ),
2494
2791
  ...props
@@ -2496,6 +2793,7 @@ function DrawerOverlay({ className, ...props }) {
2496
2793
  );
2497
2794
  }
2498
2795
  function DrawerContent({ className, children, ...props }) {
2796
+ const [floatingContainer, setFloatingContainer] = React21.useState(null);
2499
2797
  return /* @__PURE__ */ jsxs(DrawerPortal, { children: [
2500
2798
  /* @__PURE__ */ jsx(DrawerOverlay, {}),
2501
2799
  /* @__PURE__ */ jsxs(
@@ -2525,7 +2823,7 @@ function DrawerContent({ className, children, ...props }) {
2525
2823
  className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full\n group-data-[vaul-drawer-direction=bottom]/drawer-content:block"
2526
2824
  }
2527
2825
  ),
2528
- /* @__PURE__ */ jsx(ModalPortalScope, { floatingPortalStrategy: "root", floatingZIndex: "elevated", children })
2826
+ /* @__PURE__ */ jsx("div", { ref: setFloatingContainer, "data-slot": "drawer-floating-portal", className: "contents", children: /* @__PURE__ */ jsx(ModalPortalScope, { floatingContainer, floatingZIndex: "elevated", children }) })
2529
2827
  ]
2530
2828
  }
2531
2829
  )
@@ -2591,8 +2889,8 @@ function TabsTrigger({ className, ...props }) {
2591
2889
  "data-slot": "tabs-trigger",
2592
2890
  className: cn(
2593
2891
  `hover:text-muted-foreground data-[active]:bg-background data-[active]:text-foreground
2594
- focus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center justify-center rounded-sm px-3
2595
- py-1.5 text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px]
2892
+ focus-visible:border-ring focus-visible:ring-ring/50 inline-flex min-h-10 min-w-10 items-center justify-center rounded-[calc(var(--radius-md)-2px)] px-3
2893
+ text-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow] outline-none pointer-coarse:min-h-11 focus-visible:ring-[3px]
2596
2894
  data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[active]:shadow-xs [&_svg]:shrink-0`,
2597
2895
  className
2598
2896
  ),
@@ -2616,7 +2914,7 @@ function Collapsible({
2616
2914
  }
2617
2915
  );
2618
2916
  }
2619
- var CollapsibleTrigger = React19.forwardRef(({ className, asChild, nativeButton, children, ...props }, ref) => {
2917
+ var CollapsibleTrigger = React21.forwardRef(({ className, asChild, nativeButton, children, render, ...props }, ref) => {
2620
2918
  const triggerClassName = cn(
2621
2919
  "group/trigger flex w-full cursor-pointer items-center justify-between text-sm font-medium outline-none transition-colors",
2622
2920
  "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
@@ -2625,42 +2923,22 @@ var CollapsibleTrigger = React19.forwardRef(({ className, asChild, nativeButton,
2625
2923
  "[&[data-panel-open]_[data-slot=collapsible-icon]]:rotate-180",
2626
2924
  className
2627
2925
  );
2628
- if (asChild && React19.isValidElement(children)) {
2629
- return /* @__PURE__ */ jsx(
2630
- Collapsible$1.Trigger,
2631
- {
2632
- ref,
2633
- "data-slot": "collapsible-trigger",
2634
- nativeButton: nativeButton ?? true,
2635
- ...props,
2636
- render: (triggerProps) => {
2637
- const { nativeButton: _, ...rest } = triggerProps;
2638
- const childProps = children.props;
2639
- return React19.cloneElement(
2640
- children,
2641
- {
2642
- ...rest,
2643
- className: cn(triggerClassName, childProps.className)
2644
- }
2645
- );
2646
- }
2647
- }
2648
- );
2649
- }
2926
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
2650
2927
  return /* @__PURE__ */ jsx(
2651
2928
  Collapsible$1.Trigger,
2652
2929
  {
2653
2930
  ref,
2654
2931
  "data-slot": "collapsible-trigger",
2655
- nativeButton,
2932
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
2656
2933
  className: triggerClassName,
2934
+ render: render ?? childRender,
2657
2935
  ...props,
2658
- children
2936
+ children: childRender ? void 0 : children
2659
2937
  }
2660
2938
  );
2661
2939
  });
2662
2940
  CollapsibleTrigger.displayName = "CollapsibleTrigger";
2663
- var CollapsiblePanel = React19.forwardRef(
2941
+ var CollapsiblePanel = React21.forwardRef(
2664
2942
  ({ className, innerClassName, children, ...props }, ref) => {
2665
2943
  return /* @__PURE__ */ jsx(
2666
2944
  Collapsible$1.Panel,
@@ -2669,8 +2947,8 @@ var CollapsiblePanel = React19.forwardRef(
2669
2947
  "data-slot": "collapsible-panel",
2670
2948
  className: cn(
2671
2949
  "h-[var(--collapsible-panel-height)] overflow-hidden text-sm",
2672
- "transition-[height] duration-200 ease-out",
2673
- "data-[ending-style]:h-0 data-[starting-style]:h-0",
2950
+ "origin-top transition-[opacity,transform] duration-200 ease-out motion-reduce:transition-none",
2951
+ "data-[ending-style]:translate-y-1 data-[ending-style]:opacity-0 data-[starting-style]:translate-y-1 data-[starting-style]:opacity-0",
2674
2952
  className
2675
2953
  ),
2676
2954
  ...props,
@@ -2725,24 +3003,58 @@ function ResizableHandle({
2725
3003
  }
2726
3004
  );
2727
3005
  }
2728
- function Table({
2729
- className,
2730
- ...props
2731
- }) {
2732
- return /* @__PURE__ */ jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props });
3006
+ function Table({ className, containerClassName, containerProps, ...props }) {
3007
+ return /* @__PURE__ */ jsx(
3008
+ "div",
3009
+ {
3010
+ "data-slot": "table-container",
3011
+ ...containerProps,
3012
+ className: cn("relative w-full overflow-x-auto", containerClassName),
3013
+ children: /* @__PURE__ */ jsx(
3014
+ "table",
3015
+ {
3016
+ "data-slot": "table",
3017
+ className: cn("w-full caption-bottom text-sm", className),
3018
+ ...props
3019
+ }
3020
+ )
3021
+ }
3022
+ );
2733
3023
  }
2734
3024
  function TableHeader({ className, ...props }) {
2735
- return /* @__PURE__ */ jsx("thead", { "data-slot": "table-header", className: cn(className), ...props });
3025
+ return /* @__PURE__ */ jsx(
3026
+ "thead",
3027
+ {
3028
+ "data-slot": "table-header",
3029
+ className: cn(
3030
+ // Quiet band under headers; kill row hover on thead
3031
+ "bg-muted/35 [&_tr]:border-b [&_tr]:hover:bg-transparent [&_tr]:data-[state=selected]:bg-transparent",
3032
+ className
3033
+ ),
3034
+ ...props
3035
+ }
3036
+ );
2736
3037
  }
2737
3038
  function TableBody({ className, ...props }) {
2738
- return /* @__PURE__ */ jsx("tbody", { "data-slot": "table-body", className: cn("[&_tr:last-child]:border-0", className), ...props });
3039
+ return /* @__PURE__ */ jsx(
3040
+ "tbody",
3041
+ {
3042
+ "data-slot": "table-body",
3043
+ className: cn("[&_tr:last-child]:border-0", className),
3044
+ ...props
3045
+ }
3046
+ );
2739
3047
  }
2740
3048
  function TableFooter({ className, ...props }) {
2741
3049
  return /* @__PURE__ */ jsx(
2742
3050
  "tfoot",
2743
3051
  {
2744
3052
  "data-slot": "table-footer",
2745
- className: cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className),
3053
+ className: cn(
3054
+ "border-t border-border/60 bg-muted/30 font-medium",
3055
+ "[&>tr]:border-b-0 [&>tr]:hover:bg-transparent",
3056
+ className
3057
+ ),
2746
3058
  ...props
2747
3059
  }
2748
3060
  );
@@ -2752,7 +3064,13 @@ function TableRow({ className, ...props }) {
2752
3064
  "tr",
2753
3065
  {
2754
3066
  "data-slot": "table-row",
2755
- className: cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className),
3067
+ className: cn(
3068
+ "border-b border-border/60",
3069
+ // Specific properties only — interruptible hover/selection
3070
+ "transition-colors duration-150 ease-out",
3071
+ "hover:bg-muted/40 data-[state=selected]:bg-muted",
3072
+ className
3073
+ ),
2756
3074
  ...props
2757
3075
  }
2758
3076
  );
@@ -2763,8 +3081,9 @@ function TableHead({ className, ...props }) {
2763
3081
  {
2764
3082
  "data-slot": "table-head",
2765
3083
  className: cn(
2766
- `text-muted-foreground h-12 px-3 text-left align-middle font-medium has-[role=checkbox]:w-px
2767
- [&:has([role=checkbox])]:pr-0`,
3084
+ "h-11 px-4 text-left align-middle text-xs font-medium tracking-wide text-muted-foreground",
3085
+ "whitespace-nowrap",
3086
+ "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-px",
2768
3087
  className
2769
3088
  ),
2770
3089
  ...props
@@ -2772,10 +3091,28 @@ function TableHead({ className, ...props }) {
2772
3091
  );
2773
3092
  }
2774
3093
  function TableCell({ className, ...props }) {
2775
- return /* @__PURE__ */ jsx("td", { "data-slot": "table-cell", className: cn("p-3 align-middle [&:has([role=checkbox])]:pr-0", className), ...props });
3094
+ return /* @__PURE__ */ jsx(
3095
+ "td",
3096
+ {
3097
+ "data-slot": "table-cell",
3098
+ className: cn(
3099
+ "px-4 py-3 align-middle whitespace-nowrap",
3100
+ "[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-px",
3101
+ className
3102
+ ),
3103
+ ...props
3104
+ }
3105
+ );
2776
3106
  }
2777
3107
  function TableCaption({ className, ...props }) {
2778
- return /* @__PURE__ */ jsx("caption", { "data-slot": "table-caption", className: cn("text-muted-foreground mt-4 text-sm", className), ...props });
3108
+ return /* @__PURE__ */ jsx(
3109
+ "caption",
3110
+ {
3111
+ "data-slot": "table-caption",
3112
+ className: cn("mt-3 text-pretty text-sm text-muted-foreground", className),
3113
+ ...props
3114
+ }
3115
+ );
2779
3116
  }
2780
3117
  function Pagination({ className, ...props }) {
2781
3118
  return /* @__PURE__ */ jsx(
@@ -2790,23 +3127,54 @@ function Pagination({ className, ...props }) {
2790
3127
  );
2791
3128
  }
2792
3129
  function PaginationContent({ className, ...props }) {
2793
- return /* @__PURE__ */ jsx("ul", { "data-slot": "pagination-content", className: cn("flex flex-row items-center gap-1", className), ...props });
3130
+ return /* @__PURE__ */ jsx(
3131
+ "ul",
3132
+ {
3133
+ "data-slot": "pagination-content",
3134
+ className: cn(
3135
+ // flex-wrap keeps the row usable on narrow viewports instead of overflowing
3136
+ "flex flex-row flex-wrap items-center justify-center gap-0.5 sm:gap-1",
3137
+ className
3138
+ ),
3139
+ ...props
3140
+ }
3141
+ );
2794
3142
  }
2795
- function PaginationItem({ ...props }) {
2796
- return /* @__PURE__ */ jsx("li", { "data-slot": "pagination-item", ...props });
3143
+ function PaginationItem({ className, ...props }) {
3144
+ return /* @__PURE__ */ jsx(
3145
+ "li",
3146
+ {
3147
+ "data-slot": "pagination-item",
3148
+ className: cn("inline-flex", className),
3149
+ ...props
3150
+ }
3151
+ );
2797
3152
  }
2798
- function PaginationLink({ className, isActive, size = "icon", ...props }) {
3153
+ function PaginationLink({
3154
+ className,
3155
+ isActive,
3156
+ isDisabled,
3157
+ size = "icon",
3158
+ ...props
3159
+ }) {
2799
3160
  return /* @__PURE__ */ jsx(
2800
3161
  "a",
2801
3162
  {
2802
3163
  "aria-current": isActive ? "page" : void 0,
3164
+ "aria-disabled": isDisabled || void 0,
2803
3165
  "data-slot": "pagination-link",
2804
- "data-active": isActive,
3166
+ "data-active": isActive || void 0,
3167
+ "data-disabled": isDisabled || void 0,
3168
+ tabIndex: isDisabled ? -1 : props.tabIndex,
2805
3169
  className: cn(
2806
3170
  buttonVariants({
2807
3171
  variant: isActive ? "outline" : "ghost",
2808
3172
  size
2809
3173
  }),
3174
+ "tabular-nums",
3175
+ isDisabled && "pointer-events-none opacity-50",
3176
+ // Slightly denser on small screens; full hit target from button variants
3177
+ size === "icon" && "size-8 sm:size-10",
2810
3178
  className
2811
3179
  ),
2812
3180
  ...props
@@ -2819,7 +3187,12 @@ function PaginationPrevious({ className, ...props }) {
2819
3187
  {
2820
3188
  "aria-label": "Go to previous page",
2821
3189
  size: "default",
2822
- className: cn("gap-1 px-2.5 sm:pe-4", className),
3190
+ className: cn(
3191
+ "h-8 gap-1 px-2.5 sm:h-10 sm:pe-4",
3192
+ // Icon-only on the narrowest widths; label from sm up
3193
+ "min-w-8 sm:min-w-10",
3194
+ className
3195
+ ),
2823
3196
  ...props,
2824
3197
  children: [
2825
3198
  /* @__PURE__ */ jsx(ChevronLeftIcon, { size: 16 }),
@@ -2834,7 +3207,7 @@ function PaginationNext({ className, ...props }) {
2834
3207
  {
2835
3208
  "aria-label": "Go to next page",
2836
3209
  size: "default",
2837
- className: cn("gap-1 px-2.5 sm:ps-4", className),
3210
+ className: cn("h-8 gap-1 px-2.5 sm:h-10 sm:ps-4 min-w-8 sm:min-w-10", className),
2838
3211
  ...props,
2839
3212
  children: [
2840
3213
  /* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: "Next" }),
@@ -2849,7 +3222,10 @@ function PaginationEllipsis({ className, ...props }) {
2849
3222
  {
2850
3223
  "aria-hidden": true,
2851
3224
  "data-slot": "pagination-ellipsis",
2852
- className: cn("flex size-9 items-center justify-center", className),
3225
+ className: cn(
3226
+ "flex size-8 items-center justify-center text-muted-foreground sm:size-10",
3227
+ className
3228
+ ),
2853
3229
  ...props,
2854
3230
  children: [
2855
3231
  /* @__PURE__ */ jsx(MoreHorizontalIcon, { size: 16 }),
@@ -2879,18 +3255,26 @@ function BreadcrumbItem({ className, ...props }) {
2879
3255
  }
2880
3256
  function BreadcrumbLink({
2881
3257
  asChild,
3258
+ render,
2882
3259
  className,
3260
+ children,
2883
3261
  ...props
2884
3262
  }) {
2885
- const Comp = asChild ? Slot : "a";
2886
- return /* @__PURE__ */ jsx(
2887
- Comp,
2888
- {
2889
- "data-slot": "breadcrumb-link",
2890
- className: cn("text-muted-foreground/60 hover:text-foreground transition-colors", className),
2891
- ...props
3263
+ const childRender = render === void 0 && asChild && React21.isValidElement(children) ? children : void 0;
3264
+ return useRender({
3265
+ defaultTagName: "a",
3266
+ props: mergeProps$1(
3267
+ {
3268
+ className: cn("text-muted-foreground/60 transition-colors hover:text-foreground", className),
3269
+ children: childRender ? void 0 : children
3270
+ },
3271
+ props
3272
+ ),
3273
+ render: render ?? childRender,
3274
+ state: {
3275
+ slot: "breadcrumb-link"
2892
3276
  }
2893
- );
3277
+ });
2894
3278
  }
2895
3279
  function BreadcrumbPage({ className, ...props }) {
2896
3280
  return /* @__PURE__ */ jsx(
@@ -2935,7 +3319,17 @@ function Avatar({ className, ...props }) {
2935
3319
  );
2936
3320
  }
2937
3321
  function AvatarImage({ className, ...props }) {
2938
- return /* @__PURE__ */ jsx(Avatar$1.Image, { "data-slot": "avatar-image", className: cn("aspect-square size-full", className), ...props });
3322
+ return /* @__PURE__ */ jsx(
3323
+ Avatar$1.Image,
3324
+ {
3325
+ "data-slot": "avatar-image",
3326
+ className: cn(
3327
+ "aspect-square size-full outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10",
3328
+ className
3329
+ ),
3330
+ ...props
3331
+ }
3332
+ );
2939
3333
  }
2940
3334
  function AvatarFallback({ className, delayMs, delay, ...props }) {
2941
3335
  return /* @__PURE__ */ jsx(
@@ -2973,7 +3367,7 @@ function AutocompleteInput({
2973
3367
  {
2974
3368
  className: cn(
2975
3369
  startAddon && "data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=autocomplete-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(8)-1px)]",
2976
- sizeValue === "sm" ? "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-6.5" : "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-7",
3370
+ sizeValue === "sm" ? "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-6.5 pointer-coarse:has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-11" : "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-7 pointer-coarse:has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-11",
2977
3371
  className
2978
3372
  ),
2979
3373
  "data-slot": "autocomplete-input",
@@ -2985,7 +3379,7 @@ function AutocompleteInput({
2985
3379
  AutocompleteTrigger,
2986
3380
  {
2987
3381
  className: cn(
2988
- "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
3382
+ "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:size-11 sm:pointer-coarse:size-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
2989
3383
  sizeValue === "sm" ? "end-0" : "end-0.5"
2990
3384
  ),
2991
3385
  children: /* @__PURE__ */ jsx(ChevronsUpDownIcon, {})
@@ -2995,7 +3389,7 @@ function AutocompleteInput({
2995
3389
  AutocompleteClear,
2996
3390
  {
2997
3391
  className: cn(
2998
- "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
3392
+ "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:size-11 sm:pointer-coarse:size-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
2999
3393
  sizeValue === "sm" ? "end-0" : "end-0.5"
3000
3394
  ),
3001
3395
  children: /* @__PURE__ */ jsx(XIcon, {})
@@ -3046,7 +3440,7 @@ function AutocompleteItem({
3046
3440
  Autocomplete$1.Item,
3047
3441
  {
3048
3442
  className: cn(
3049
- "flex min-h-8 cursor-default select-none items-center rounded-sm px-2 py-1 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm",
3443
+ "flex min-h-8 cursor-default select-none items-center rounded-sm px-2 py-1 text-base outline-none pointer-coarse:min-h-11 sm:pointer-coarse:min-h-11 data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm",
3050
3444
  className
3051
3445
  ),
3052
3446
  "data-slot": "autocomplete-item",
@@ -3092,7 +3486,7 @@ function AutocompleteClear({
3092
3486
  Autocomplete$1.Clear,
3093
3487
  {
3094
3488
  className: cn(
3095
- "-translate-y-1/2 absolute end-0.5 top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-[color,background-color,box-shadow,opacity] pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
3489
+ "-translate-y-1/2 absolute end-0.5 top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-[color,background-color,box-shadow,opacity] pointer-coarse:size-11 sm:pointer-coarse:size-11 hover:opacity-100 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
3096
3490
  className
3097
3491
  ),
3098
3492
  "data-slot": "autocomplete-clear",
@@ -3236,7 +3630,7 @@ function CommandItem({
3236
3630
  Command$1.Item,
3237
3631
  {
3238
3632
  className: cn(
3239
- "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",
3633
+ "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none pointer-coarse:min-h-11 data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",
3240
3634
  className
3241
3635
  ),
3242
3636
  "data-slot": "command-item",
@@ -3244,12 +3638,12 @@ function CommandItem({
3244
3638
  }
3245
3639
  );
3246
3640
  }
3247
- var ComboboxContext = React19.createContext({
3641
+ var ComboboxContext = React21.createContext({
3248
3642
  chipsRef: null,
3249
3643
  multiple: false
3250
3644
  });
3251
3645
  function Combobox(props) {
3252
- const chipsRef = React19.useRef(null);
3646
+ const chipsRef = React21.useRef(null);
3253
3647
  return /* @__PURE__ */ jsx(ComboboxContext.Provider, { value: { chipsRef, multiple: !!props.multiple }, children: /* @__PURE__ */ jsx(
3254
3648
  Combobox$1.Root,
3255
3649
  {
@@ -3265,7 +3659,7 @@ function ComboboxInput({
3265
3659
  size,
3266
3660
  ...props
3267
3661
  }) {
3268
- const { multiple } = React19.useContext(ComboboxContext);
3662
+ const { multiple } = React21.useContext(ComboboxContext);
3269
3663
  const sizeValue = size ?? "default";
3270
3664
  if (multiple) {
3271
3665
  return /* @__PURE__ */ jsx(
@@ -3298,7 +3692,7 @@ function ComboboxInput({
3298
3692
  {
3299
3693
  className: cn(
3300
3694
  startAddon && "data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=combobox-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=combobox-input]:ps-[calc(--spacing(8)-1px)]",
3301
- sizeValue === "sm" ? "has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-6.5" : "has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-7",
3695
+ sizeValue === "sm" ? "has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-6.5 pointer-coarse:has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-11" : "has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-7 pointer-coarse:has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-11",
3302
3696
  className
3303
3697
  ),
3304
3698
  "data-slot": "combobox-input",
@@ -3310,7 +3704,7 @@ function ComboboxInput({
3310
3704
  ComboboxTrigger,
3311
3705
  {
3312
3706
  className: cn(
3313
- "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
3707
+ "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:size-11 sm:pointer-coarse:size-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
3314
3708
  sizeValue === "sm" ? "end-0" : "end-0.5"
3315
3709
  ),
3316
3710
  children: /* @__PURE__ */ jsx(ChevronsUpDownIcon, {})
@@ -3320,7 +3714,7 @@ function ComboboxInput({
3320
3714
  ComboboxClear,
3321
3715
  {
3322
3716
  className: cn(
3323
- "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
3717
+ "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:size-11 sm:pointer-coarse:size-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
3324
3718
  sizeValue === "sm" ? "end-0" : "end-0.5"
3325
3719
  ),
3326
3720
  children: /* @__PURE__ */ jsx(XIcon, {})
@@ -3347,7 +3741,7 @@ function ComboboxPopup({
3347
3741
  sideOffset = 4,
3348
3742
  ...props
3349
3743
  }) {
3350
- const { chipsRef, multiple } = React19.useContext(ComboboxContext);
3744
+ const { chipsRef, multiple } = React21.useContext(ComboboxContext);
3351
3745
  const { container, zIndexClass } = useFloatingOverlayPortalProps();
3352
3746
  return /* @__PURE__ */ jsx(Combobox$1.Portal, { container, children: /* @__PURE__ */ jsx(
3353
3747
  Combobox$1.Positioner,
@@ -3386,27 +3780,37 @@ function ComboboxItem({
3386
3780
  Combobox$1.Item,
3387
3781
  {
3388
3782
  className: cn(
3389
- "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
3783
+ "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none pointer-coarse:min-h-11 sm:pointer-coarse:min-h-11 data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
3390
3784
  className
3391
3785
  ),
3392
3786
  "data-slot": "combobox-item",
3393
3787
  ...props,
3394
3788
  children: [
3395
- /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, { className: "col-start-1", children: /* @__PURE__ */ jsx(
3396
- "svg",
3789
+ /* @__PURE__ */ jsx(
3790
+ Combobox$1.ItemIndicator,
3397
3791
  {
3398
- fill: "none",
3399
- height: "24",
3400
- stroke: "currentColor",
3401
- strokeLinecap: "round",
3402
- strokeLinejoin: "round",
3403
- strokeWidth: "2",
3404
- viewBox: "0 0 24 24",
3405
- width: "24",
3406
- xmlns: "http://www.w3.org/1500/svg",
3407
- children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
3792
+ keepMounted: true,
3793
+ className: (state) => cn(
3794
+ "col-start-1 transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none",
3795
+ state.selected ? "scale-100 opacity-100 blur-0" : "scale-[0.25] opacity-0 blur-[4px]"
3796
+ ),
3797
+ children: /* @__PURE__ */ jsx(
3798
+ "svg",
3799
+ {
3800
+ fill: "none",
3801
+ height: "24",
3802
+ stroke: "currentColor",
3803
+ strokeLinecap: "round",
3804
+ strokeLinejoin: "round",
3805
+ strokeWidth: "2",
3806
+ viewBox: "0 0 24 24",
3807
+ width: "24",
3808
+ xmlns: "http://www.w3.org/1500/svg",
3809
+ children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
3810
+ }
3811
+ )
3408
3812
  }
3409
- ) }),
3813
+ ),
3410
3814
  /* @__PURE__ */ jsx("div", { className: "col-start-2", children })
3411
3815
  ]
3412
3816
  }
@@ -3549,7 +3953,7 @@ function OptionItem({
3549
3953
  }
3550
3954
  );
3551
3955
  }
3552
- var MultiSelect = React19.forwardRef(
3956
+ var MultiSelect = React21.forwardRef(
3553
3957
  ({
3554
3958
  options,
3555
3959
  onValueChange,
@@ -3575,38 +3979,38 @@ var MultiSelect = React19.forwardRef(
3575
3979
  onClick,
3576
3980
  ...props
3577
3981
  }, ref) => {
3578
- const [selectedValues, setSelectedValues] = React19.useState(defaultValue);
3579
- const [isPopoverOpen, setIsPopoverOpen] = React19.useState(false);
3580
- const [searchValue, setSearchValue] = React19.useState("");
3581
- const [highlightedIndex, setHighlightedIndex] = React19.useState(-1);
3582
- const multiSelectId = React19.useId();
3982
+ const [selectedValues, setSelectedValues] = React21.useState(defaultValue);
3983
+ const [isPopoverOpen, setIsPopoverOpen] = React21.useState(false);
3984
+ const [searchValue, setSearchValue] = React21.useState("");
3985
+ const [highlightedIndex, setHighlightedIndex] = React21.useState(-1);
3986
+ const multiSelectId = React21.useId();
3583
3987
  const listboxId = `${multiSelectId}-listbox`;
3584
3988
  const triggerDescriptionId = `${multiSelectId}-description`;
3585
3989
  const selectedCountId = `${multiSelectId}-count`;
3586
3990
  const searchInputId = `${multiSelectId}-search`;
3587
- const searchInputRef = React19.useRef(null);
3588
- const listRef = React19.useRef(null);
3589
- const prevDefaultValueRef = React19.useRef(defaultValue);
3590
- const isGroupedOptions = React19.useCallback(
3991
+ const searchInputRef = React21.useRef(null);
3992
+ const listRef = React21.useRef(null);
3993
+ const prevDefaultValueRef = React21.useRef(defaultValue);
3994
+ const isGroupedOptions = React21.useCallback(
3591
3995
  (opts) => {
3592
3996
  return opts.length > 0 && "heading" in opts[0];
3593
3997
  },
3594
3998
  []
3595
3999
  );
3596
- const arraysEqual = React19.useCallback((a, b) => {
4000
+ const arraysEqual = React21.useCallback((a, b) => {
3597
4001
  if (a.length !== b.length) return false;
3598
4002
  const sortedA = [...a].sort();
3599
4003
  const sortedB = [...b].sort();
3600
4004
  return sortedA.every((val, index) => val === sortedB[index]);
3601
4005
  }, []);
3602
- const resetToDefault = React19.useCallback(() => {
4006
+ const resetToDefault = React21.useCallback(() => {
3603
4007
  setSelectedValues(defaultValue);
3604
4008
  setIsPopoverOpen(false);
3605
4009
  setSearchValue("");
3606
4010
  onValueChange(defaultValue);
3607
4011
  }, [defaultValue, onValueChange]);
3608
- const buttonRef = React19.useRef(null);
3609
- React19.useImperativeHandle(
4012
+ const buttonRef = React21.useRef(null);
4013
+ React21.useImperativeHandle(
3610
4014
  ref,
3611
4015
  () => ({
3612
4016
  reset: resetToDefault,
@@ -3637,8 +4041,8 @@ var MultiSelect = React19.forwardRef(
3637
4041
  }),
3638
4042
  [resetToDefault, selectedValues, onValueChange]
3639
4043
  );
3640
- const [screenSize, setScreenSize] = React19.useState("desktop");
3641
- React19.useEffect(() => {
4044
+ const [screenSize, setScreenSize] = React21.useState("desktop");
4045
+ React21.useEffect(() => {
3642
4046
  if (typeof window === "undefined") return;
3643
4047
  const handleResize = () => {
3644
4048
  const width = window.innerWidth;
@@ -3687,7 +4091,7 @@ var MultiSelect = React19.forwardRef(
3687
4091
  };
3688
4092
  };
3689
4093
  const responsiveSettings = getResponsiveSettings();
3690
- const getAllOptions = React19.useCallback(() => {
4094
+ const getAllOptions = React21.useCallback(() => {
3691
4095
  if (options.length === 0) return [];
3692
4096
  let allOptions;
3693
4097
  if (isGroupedOptions(options)) {
@@ -3717,7 +4121,7 @@ var MultiSelect = React19.forwardRef(
3717
4121
  }
3718
4122
  return deduplicateOptions ? uniqueOptions : allOptions;
3719
4123
  }, [options, deduplicateOptions, isGroupedOptions]);
3720
- const getOptionByValue = React19.useCallback(
4124
+ const getOptionByValue = React21.useCallback(
3721
4125
  (value) => {
3722
4126
  const option = getAllOptions().find((option2) => option2.value === value);
3723
4127
  if (!option && process.env.NODE_ENV === "development") {
@@ -3727,7 +4131,7 @@ var MultiSelect = React19.forwardRef(
3727
4131
  },
3728
4132
  [getAllOptions]
3729
4133
  );
3730
- const filteredOptions = React19.useMemo(() => {
4134
+ const filteredOptions = React21.useMemo(() => {
3731
4135
  if (!searchable || !searchValue) return options;
3732
4136
  if (options.length === 0) return [];
3733
4137
  if (isGroupedOptions(options)) {
@@ -3742,13 +4146,13 @@ var MultiSelect = React19.forwardRef(
3742
4146
  (option) => option.label.toLowerCase().includes(searchValue.toLowerCase()) || option.value.toLowerCase().includes(searchValue.toLowerCase())
3743
4147
  );
3744
4148
  }, [options, searchValue, searchable, isGroupedOptions]);
3745
- const flatFilteredOptions = React19.useMemo(() => {
4149
+ const flatFilteredOptions = React21.useMemo(() => {
3746
4150
  if (isGroupedOptions(filteredOptions)) {
3747
4151
  return filteredOptions.flatMap((group) => group.options);
3748
4152
  }
3749
4153
  return filteredOptions;
3750
4154
  }, [filteredOptions, isGroupedOptions]);
3751
- const toggleOption = React19.useCallback(
4155
+ const toggleOption = React21.useCallback(
3752
4156
  (optionValue) => {
3753
4157
  if (disabled) return;
3754
4158
  const option = getOptionByValue(optionValue);
@@ -3777,7 +4181,7 @@ var MultiSelect = React19.forwardRef(
3777
4181
  setSelectedValues(newSelectedValues);
3778
4182
  onValueChange(newSelectedValues);
3779
4183
  };
3780
- const handleKeyDown = React19.useCallback(
4184
+ const handleKeyDown = React21.useCallback(
3781
4185
  (event) => {
3782
4186
  const optionsCount = flatFilteredOptions.length;
3783
4187
  if (optionsCount === 0) return;
@@ -3815,7 +4219,7 @@ var MultiSelect = React19.forwardRef(
3815
4219
  },
3816
4220
  [flatFilteredOptions, highlightedIndex, toggleOption, searchValue, selectedValues, onValueChange]
3817
4221
  );
3818
- React19.useEffect(() => {
4222
+ React21.useEffect(() => {
3819
4223
  if (!resetOnDefaultValueChange) return;
3820
4224
  const prevDefaultValue = prevDefaultValueRef.current;
3821
4225
  if (!arraysEqual(prevDefaultValue, defaultValue)) {
@@ -3836,17 +4240,17 @@ var MultiSelect = React19.forwardRef(
3836
4240
  };
3837
4241
  };
3838
4242
  const widthConstraints = getWidthConstraints();
3839
- const effectiveDropdownMaxHeight = React19.useMemo(() => {
4243
+ const effectiveDropdownMaxHeight = React21.useMemo(() => {
3840
4244
  if (dropdownMaxHeight) return dropdownMaxHeight;
3841
4245
  return screenSize === "mobile" ? "70vh" : "60vh";
3842
4246
  }, [dropdownMaxHeight, screenSize]);
3843
- React19.useEffect(() => {
4247
+ React21.useEffect(() => {
3844
4248
  if (!isPopoverOpen) {
3845
4249
  setSearchValue("");
3846
4250
  setHighlightedIndex(-1);
3847
4251
  }
3848
4252
  }, [isPopoverOpen]);
3849
- React19.useEffect(() => {
4253
+ React21.useEffect(() => {
3850
4254
  if (isPopoverOpen && searchable && searchInputRef.current) {
3851
4255
  const timer = setTimeout(() => {
3852
4256
  searchInputRef.current?.focus();
@@ -3854,10 +4258,10 @@ var MultiSelect = React19.forwardRef(
3854
4258
  return () => clearTimeout(timer);
3855
4259
  }
3856
4260
  }, [isPopoverOpen, searchable]);
3857
- React19.useEffect(() => {
4261
+ React21.useEffect(() => {
3858
4262
  setHighlightedIndex(flatFilteredOptions.length > 0 ? 0 : -1);
3859
4263
  }, [searchValue, flatFilteredOptions.length]);
3860
- const totalFilteredCount = React19.useMemo(() => {
4264
+ const totalFilteredCount = React21.useMemo(() => {
3861
4265
  if (isGroupedOptions(filteredOptions)) {
3862
4266
  return filteredOptions.reduce((acc, group) => acc + group.options.length, 0);
3863
4267
  }
@@ -3887,8 +4291,9 @@ var MultiSelect = React19.forwardRef(
3887
4291
  "aria-label": `Multi-select: ${selectedValues.length} of ${getAllOptions().length} options selected. ${placeholder}`,
3888
4292
  className: cn(
3889
4293
  `border-input/70 focus-visible:border-primary/60 focus-visible:ring-primary/20 flex items-center
3890
- justify-between rounded-md border bg-transparent pr-1 pl-2 shadow-xs transition-[color,box-shadow]
3891
- outline-none focus-visible:ring-[3px] active:scale-100 disabled:pointer-events-none disabled:opacity-50`,
4294
+ justify-between rounded-md border bg-transparent pr-1 pl-2 shadow-xs transition-[color,box-shadow,scale]
4295
+ duration-150 ease-out outline-none focus-visible:ring-[3px] motion-safe:active:not-disabled:scale-[0.96]
4296
+ motion-reduce:transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50`,
3892
4297
  singleLine ? "h-8 min-h-8 py-0.5 text-xs" : "h-auto min-h-10 py-2 text-sm",
3893
4298
  autoSize && "w-auto",
3894
4299
  !autoSize && "w-full",
@@ -4352,6 +4757,9 @@ function RecordPicker({
4352
4757
  }
4353
4758
  var StepperContext = createContext(void 0);
4354
4759
  var StepItemContext = createContext(void 0);
4760
+ var iconSwapClass = "transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none";
4761
+ var iconSwapVisible = "scale-100 opacity-100 blur-0";
4762
+ var iconSwapHidden = "scale-[0.25] opacity-0 blur-[4px]";
4355
4763
  var useStepper = () => {
4356
4764
  const context = useContext(StepperContext);
4357
4765
  if (!context) {
@@ -4374,8 +4782,8 @@ function Stepper({
4374
4782
  className,
4375
4783
  ...props
4376
4784
  }) {
4377
- const [activeStep, setInternalStep] = React19.useState(defaultValue);
4378
- const setActiveStep = React19.useCallback(
4785
+ const [activeStep, setInternalStep] = React21.useState(defaultValue);
4786
+ const setActiveStep = React21.useCallback(
4379
4787
  (step) => {
4380
4788
  if (value === void 0) {
4381
4789
  setInternalStep(step);
@@ -4437,13 +4845,14 @@ function StepperItem({
4437
4845
  }
4438
4846
  ) });
4439
4847
  }
4440
- function StepperTrigger({ asChild = false, className, children, ...props }) {
4848
+ function StepperTrigger({ asChild = false, static: isStatic, className, children, ...props }) {
4441
4849
  const { setActiveStep } = useStepper();
4442
4850
  const { step, isDisabled } = useStepItem();
4443
4851
  const triggerClassName = cn(
4444
- `focus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center gap-3 rounded-full transition-all
4445
- duration-200 ease-out outline-none hover:scale-105 focus-visible:z-10 focus-visible:ring-[3px] active:scale-95
4852
+ `focus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center gap-3 rounded-full transition-transform
4853
+ duration-150 ease-out outline-none focus-visible:z-10 focus-visible:ring-[3px]
4446
4854
  disabled:pointer-events-none disabled:opacity-50`,
4855
+ !isStatic && "motion-safe:hover:scale-105 motion-safe:active:not-disabled:scale-[0.96]",
4447
4856
  className
4448
4857
  );
4449
4858
  if (asChild) {
@@ -4473,35 +4882,38 @@ function StepperTrigger({ asChild = false, className, children, ...props }) {
4473
4882
  }
4474
4883
  function StepperIndicator({ asChild = false, className, children, ...props }) {
4475
4884
  const { state, step, isLoading } = useStepItem();
4885
+ const showNumber = !isLoading && state !== "completed";
4886
+ const showCheck = !isLoading && state === "completed";
4476
4887
  return /* @__PURE__ */ jsx(
4477
4888
  "span",
4478
4889
  {
4479
4890
  "data-slot": "stepper-indicator",
4480
4891
  className: cn(
4481
4892
  `bg-muted text-muted-foreground data-[state=active]:bg-primary data-[state=completed]:bg-primary
4482
- data-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground relative flex size-6
4483
- shrink-0 items-center justify-center rounded-full text-xs font-medium transition-all duration-300 ease-out`,
4893
+ data-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground relative flex size-6
4894
+ shrink-0 items-center justify-center rounded-full text-xs font-medium transition-[color,background-color] duration-200 ease-out`,
4484
4895
  className
4485
4896
  ),
4486
4897
  "data-state": state,
4487
4898
  ...props,
4488
4899
  children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
4489
- /* @__PURE__ */ jsx(
4490
- "span",
4491
- {
4492
- className: "transition-all duration-200 ease-out group-data-loading/step:scale-75\n group-data-loading/step:opacity-0 group-data-loading/step:transition-none\n group-data-[state=completed]/step:scale-75 group-data-[state=completed]/step:opacity-0",
4493
- children: step
4494
- }
4495
- ),
4900
+ /* @__PURE__ */ jsx("span", { className: cn("absolute", iconSwapClass, showNumber ? iconSwapVisible : iconSwapHidden), children: step }),
4496
4901
  /* @__PURE__ */ jsx(
4497
4902
  CheckIcon,
4498
4903
  {
4499
- className: "absolute scale-75 opacity-0 transition-all duration-200 ease-out\n group-data-[state=completed]/step:scale-100 group-data-[state=completed]/step:opacity-100",
4904
+ className: cn("absolute", iconSwapClass, showCheck ? iconSwapVisible : iconSwapHidden),
4500
4905
  size: 16,
4501
4906
  "aria-hidden": "true"
4502
4907
  }
4503
4908
  ),
4504
- isLoading && /* @__PURE__ */ jsx("span", { className: "absolute transition-all duration-200 ease-out", children: /* @__PURE__ */ jsx(LoaderCircleIcon, { className: "animate-spin", size: 14, "aria-hidden": "true" }) })
4909
+ /* @__PURE__ */ jsx("span", { className: cn("absolute", iconSwapClass, isLoading ? iconSwapVisible : iconSwapHidden), children: /* @__PURE__ */ jsx(
4910
+ LoaderCircleIcon,
4911
+ {
4912
+ className: cn(isLoading && "motion-safe:animate-spin"),
4913
+ size: 14,
4914
+ "aria-hidden": "true"
4915
+ }
4916
+ ) })
4505
4917
  ] })
4506
4918
  }
4507
4919
  );
@@ -4532,7 +4944,7 @@ function StepperSeparator({ className, ...props }) {
4532
4944
  {
4533
4945
  "data-slot": "stepper-separator",
4534
4946
  className: cn(
4535
- `bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-all duration-500 ease-out
4947
+ `bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-colors duration-200 ease-out
4536
4948
  group-data-[orientation=horizontal]/stepper:h-0.5 group-data-[orientation=horizontal]/stepper:w-full
4537
4949
  group-data-[orientation=horizontal]/stepper:flex-1 group-data-[orientation=vertical]/stepper:h-12
4538
4950
  group-data-[orientation=vertical]/stepper:w-0.5`,
@@ -4544,8 +4956,8 @@ function StepperSeparator({ className, ...props }) {
4544
4956
  }
4545
4957
  var MOBILE_BREAKPOINT = 768;
4546
4958
  function useIsMobile() {
4547
- const [isMobile, setIsMobile] = React19.useState(false);
4548
- React19.useEffect(() => {
4959
+ const [isMobile, setIsMobile] = React21.useState(false);
4960
+ React21.useEffect(() => {
4549
4961
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
4550
4962
  const onChange = () => {
4551
4963
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -4558,20 +4970,20 @@ function useIsMobile() {
4558
4970
  }
4559
4971
  var SIDEBAR_COOKIE_NAME = "sidebar_state";
4560
4972
  var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
4561
- var SIDEBAR_WIDTH = "14rem";
4562
- var SIDEBAR_WIDTH_MOBILE = "16rem";
4563
- var SIDEBAR_WIDTH_ICON = "4rem";
4973
+ var SIDEBAR_WIDTH = "16rem";
4974
+ var SIDEBAR_WIDTH_MOBILE = "18rem";
4975
+ var SIDEBAR_WIDTH_ICON = "3rem";
4564
4976
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
4565
- var SidebarContext = React19.createContext(null);
4977
+ var SidebarContext = React21.createContext(null);
4566
4978
  function useSidebar() {
4567
- const context = React19.useContext(SidebarContext);
4979
+ const context = React21.useContext(SidebarContext);
4568
4980
  if (!context) {
4569
4981
  throw new Error("useSidebar must be used within a SidebarProvider.");
4570
4982
  }
4571
4983
  return context;
4572
4984
  }
4573
4985
  function SidebarProvider({
4574
- defaultOpen = false,
4986
+ defaultOpen = true,
4575
4987
  open: openProp,
4576
4988
  onOpenChange: setOpenProp,
4577
4989
  className,
@@ -4580,11 +4992,11 @@ function SidebarProvider({
4580
4992
  ...props
4581
4993
  }) {
4582
4994
  const isMobile = useIsMobile();
4583
- const [openMobile, setOpenMobile] = React19.useState(false);
4584
- const [isHovered, setIsHovered] = React19.useState(false);
4585
- const [_open, _setOpen] = React19.useState(defaultOpen);
4995
+ const sidebarId = React21.useId();
4996
+ const [openMobile, setOpenMobile] = React21.useState(false);
4997
+ const [_open, _setOpen] = React21.useState(defaultOpen);
4586
4998
  const open = openProp ?? _open;
4587
- const setOpen = React19.useCallback(
4999
+ const setOpen = React21.useCallback(
4588
5000
  (value) => {
4589
5001
  const openState = typeof value === "function" ? value(open) : value;
4590
5002
  if (setOpenProp) {
@@ -4594,12 +5006,12 @@ function SidebarProvider({
4594
5006
  }
4595
5007
  document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
4596
5008
  },
4597
- [setOpenProp, open]
5009
+ [open, setOpenProp]
4598
5010
  );
4599
- const toggleSidebar = React19.useCallback(() => {
4600
- return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
4601
- }, [isMobile, setOpen, setOpenMobile]);
4602
- React19.useEffect(() => {
5011
+ const toggleSidebar = React21.useCallback(() => {
5012
+ return isMobile ? setOpenMobile((currentOpen) => !currentOpen) : setOpen((currentOpen) => !currentOpen);
5013
+ }, [isMobile, setOpen]);
5014
+ React21.useEffect(() => {
4603
5015
  const handleKeyDown = (event) => {
4604
5016
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
4605
5017
  event.preventDefault();
@@ -4609,23 +5021,21 @@ function SidebarProvider({
4609
5021
  window.addEventListener("keydown", handleKeyDown);
4610
5022
  return () => window.removeEventListener("keydown", handleKeyDown);
4611
5023
  }, [toggleSidebar]);
4612
- const effectiveOpen = isMobile ? open : isHovered || open;
4613
- const state = effectiveOpen ? "expanded" : "collapsed";
4614
- const contextValue = React19.useMemo(
5024
+ const state = open ? "expanded" : "collapsed";
5025
+ const contextValue = React21.useMemo(
4615
5026
  () => ({
5027
+ sidebarId,
4616
5028
  state,
4617
5029
  open,
4618
5030
  setOpen,
4619
5031
  isMobile,
4620
5032
  openMobile,
4621
5033
  setOpenMobile,
4622
- toggleSidebar,
4623
- isHovered,
4624
- setIsHovered
5034
+ toggleSidebar
4625
5035
  }),
4626
- [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, isHovered, setIsHovered]
5036
+ [sidebarId, state, open, setOpen, isMobile, openMobile, toggleSidebar]
4627
5037
  );
4628
- return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
5038
+ return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delay: 0, children: /* @__PURE__ */ jsx(
4629
5039
  "div",
4630
5040
  {
4631
5041
  "data-slot": "sidebar-wrapper",
@@ -4634,7 +5044,7 @@ function SidebarProvider({
4634
5044
  "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
4635
5045
  ...style
4636
5046
  },
4637
- className: cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", className),
5047
+ className: cn("group/sidebar-wrapper flex min-h-dvh w-full has-data-[variant=inset]:bg-sidebar", className),
4638
5048
  ...props,
4639
5049
  children
4640
5050
  }
@@ -4643,18 +5053,20 @@ function SidebarProvider({
4643
5053
  function Sidebar({
4644
5054
  side = "left",
4645
5055
  variant = "sidebar",
4646
- collapsible = "icon",
5056
+ collapsible = "offcanvas",
4647
5057
  className,
4648
5058
  children,
5059
+ dir,
4649
5060
  ...props
4650
5061
  }) {
4651
- const { isMobile, state, openMobile, setOpenMobile, setIsHovered } = useSidebar();
5062
+ const { isMobile, sidebarId, state, openMobile, setOpenMobile } = useSidebar();
4652
5063
  if (collapsible === "none") {
4653
5064
  return /* @__PURE__ */ jsx(
4654
5065
  "div",
4655
5066
  {
5067
+ id: sidebarId,
4656
5068
  "data-slot": "sidebar",
4657
- className: cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className),
5069
+ className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className),
4658
5070
  ...props,
4659
5071
  children
4660
5072
  }
@@ -4664,10 +5076,18 @@ function Sidebar({
4664
5076
  return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
4665
5077
  SheetContent,
4666
5078
  {
5079
+ id: sidebarId,
5080
+ dir,
4667
5081
  "data-sidebar": "sidebar",
4668
5082
  "data-slot": "sidebar",
4669
5083
  "data-mobile": "true",
4670
- className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
5084
+ className: `w-(--sidebar-width) bg-sidebar pt-[env(safe-area-inset-top)]
5085
+ pb-[env(safe-area-inset-bottom)] text-sidebar-foreground [&_[data-sidebar=header]]:pr-12
5086
+ [&>[data-slot=sheet-close]]:top-[calc(env(safe-area-inset-top)+0.5rem)]
5087
+ [&>[data-slot=sheet-close]]:right-2 [&>[data-slot=sheet-close]]:flex
5088
+ [&>[data-slot=sheet-close]]:size-10 [&>[data-slot=sheet-close]]:items-center
5089
+ [&>[data-slot=sheet-close]]:justify-center [&>[data-slot=sheet-close]]:rounded-lg
5090
+ [&>[data-slot=sheet-close]]:opacity-100 pointer-coarse:[&>[data-slot=sheet-close]]:size-11`,
4671
5091
  style: {
4672
5092
  "--sidebar-width": SIDEBAR_WIDTH_MOBILE
4673
5093
  },
@@ -4685,21 +5105,20 @@ function Sidebar({
4685
5105
  return /* @__PURE__ */ jsxs(
4686
5106
  "div",
4687
5107
  {
4688
- className: "group peer text-sidebar-foreground hidden data-[side=right]:order-last md:block",
5108
+ id: sidebarId,
5109
+ className: "group peer hidden text-sidebar-foreground md:block",
4689
5110
  "data-state": state,
4690
5111
  "data-collapsible": state === "collapsed" ? collapsible : "",
4691
5112
  "data-variant": variant,
4692
5113
  "data-side": side,
4693
5114
  "data-slot": "sidebar",
4694
- onMouseEnter: () => setIsHovered(true),
4695
- onMouseLeave: () => setIsHovered(false),
4696
5115
  children: [
4697
5116
  /* @__PURE__ */ jsx(
4698
5117
  "div",
4699
5118
  {
4700
5119
  "data-slot": "sidebar-gap",
4701
5120
  className: cn(
4702
- "relative w-(--sidebar-width) bg-transparent transition-[width] duration-300 ease-in-out",
5121
+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear motion-reduce:transition-none",
4703
5122
  "group-data-[collapsible=offcanvas]:w-0",
4704
5123
  "group-data-[side=right]:rotate-180",
4705
5124
  variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
@@ -4710,11 +5129,12 @@ function Sidebar({
4710
5129
  "div",
4711
5130
  {
4712
5131
  "data-slot": "sidebar-container",
5132
+ "data-side": side,
4713
5133
  className: cn(
4714
- `fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width,margin]
4715
- duration-[.3s,.3s,.3s,.15s] ease-in-out md:flex`,
4716
- side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
4717
- // Adjust the padding for floating and inset variants.
5134
+ `fixed inset-y-0 z-10 hidden h-dvh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear
5135
+ data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]
5136
+ data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]
5137
+ motion-reduce:transition-none md:flex`,
4718
5138
  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
4719
5139
  group-data-[side=right]:border-l`,
4720
5140
  className
@@ -4725,7 +5145,7 @@ function Sidebar({
4725
5145
  {
4726
5146
  "data-sidebar": "sidebar",
4727
5147
  "data-slot": "sidebar-inner",
4728
- className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border/60 flex h-full w-full flex-col\n group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border\n group-data-[variant=floating]:shadow-sm",
5148
+ className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg\n group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1\n group-data-[variant=floating]:ring-sidebar-border",
4729
5149
  children
4730
5150
  }
4731
5151
  )
@@ -4736,15 +5156,17 @@ function Sidebar({
4736
5156
  );
4737
5157
  }
4738
5158
  function SidebarTrigger({ className, onClick, ...props }) {
4739
- const { toggleSidebar } = useSidebar();
5159
+ const { isMobile, open, openMobile, sidebarId, toggleSidebar } = useSidebar();
4740
5160
  return /* @__PURE__ */ jsxs(
4741
5161
  Button,
4742
5162
  {
5163
+ "aria-controls": sidebarId,
5164
+ "aria-expanded": isMobile ? openMobile : open,
4743
5165
  "data-sidebar": "trigger",
4744
5166
  "data-slot": "sidebar-trigger",
4745
5167
  variant: "ghost",
4746
- size: "icon",
4747
- className: cn("size-7", className),
5168
+ size: "icon-sm",
5169
+ className: cn(className),
4748
5170
  onClick: (event) => {
4749
5171
  onClick?.(event);
4750
5172
  toggleSidebar();
@@ -4757,14 +5179,43 @@ function SidebarTrigger({ className, onClick, ...props }) {
4757
5179
  }
4758
5180
  );
4759
5181
  }
5182
+ function SidebarRail({ className, ...props }) {
5183
+ const { toggleSidebar } = useSidebar();
5184
+ return /* @__PURE__ */ jsx(
5185
+ "button",
5186
+ {
5187
+ type: "button",
5188
+ "data-sidebar": "rail",
5189
+ "data-slot": "sidebar-rail",
5190
+ "aria-label": "Toggle Sidebar",
5191
+ tabIndex: -1,
5192
+ onClick: toggleSidebar,
5193
+ title: "Toggle Sidebar",
5194
+ className: cn(
5195
+ `absolute inset-y-0 z-20 hidden w-4 transition-[transform,background-color] duration-200 ease-linear group-data-[side=left]:-right-4
5196
+ group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-px
5197
+ hover:after:bg-sidebar-border motion-reduce:transition-none sm:flex ltr:-translate-x-1/2 rtl:translate-x-1/2`,
5198
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
5199
+ `[[data-side=left][data-state=collapsed]_&]:cursor-e-resize
5200
+ [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,
5201
+ `group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:start-full
5202
+ hover:group-data-[collapsible=offcanvas]:bg-sidebar`,
5203
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
5204
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
5205
+ className
5206
+ ),
5207
+ ...props
5208
+ }
5209
+ );
5210
+ }
4760
5211
  function SidebarInset({ className, ...props }) {
4761
5212
  return /* @__PURE__ */ jsx(
4762
5213
  "main",
4763
5214
  {
4764
5215
  "data-slot": "sidebar-inset",
4765
5216
  className: cn(
4766
- "bg-background relative flex w-full flex-1 flex-col transition-[margin] duration-300 ease-in-out",
4767
- `md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl
5217
+ `relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2
5218
+ md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl
4768
5219
  md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,
4769
5220
  className
4770
5221
  ),
@@ -4778,7 +5229,7 @@ function SidebarInput({ className, ...props }) {
4778
5229
  {
4779
5230
  "data-slot": "sidebar-input",
4780
5231
  "data-sidebar": "input",
4781
- className: cn("bg-background h-8 w-full shadow-none", className),
5232
+ className: cn("h-8 w-full bg-background shadow-none", className),
4782
5233
  ...props
4783
5234
  }
4784
5235
  );
@@ -4811,7 +5262,7 @@ function SidebarSeparator({ className, ...props }) {
4811
5262
  {
4812
5263
  "data-slot": "sidebar-separator",
4813
5264
  "data-sidebar": "separator",
4814
- className: cn("bg-sidebar-border/60 mx-2 w-auto", className),
5265
+ className: cn("mx-2 w-auto bg-sidebar-border", className),
4815
5266
  ...props
4816
5267
  }
4817
5268
  );
@@ -4823,7 +5274,7 @@ function SidebarContent({ className, ...props }) {
4823
5274
  "data-slot": "sidebar-content",
4824
5275
  "data-sidebar": "content",
4825
5276
  className: cn(
4826
- "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
5277
+ "scrollbar-hide flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
4827
5278
  className
4828
5279
  ),
4829
5280
  ...props
@@ -4843,49 +5294,56 @@ function SidebarGroup({ className, ...props }) {
4843
5294
  }
4844
5295
  function SidebarGroupLabel({
4845
5296
  className,
4846
- asChild = false,
5297
+ render,
4847
5298
  ...props
4848
5299
  }) {
4849
- const Comp = asChild ? Slot : "div";
4850
- return /* @__PURE__ */ jsx(
4851
- Comp,
4852
- {
4853
- "data-slot": "sidebar-group-label",
4854
- "data-sidebar": "group-label",
4855
- className: cn(
4856
- `text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium
4857
- outline-hidden transition-[margin,opacity] duration-300 ease-in-out focus-visible:ring-2 [&>svg]:size-4
4858
- [&>svg]:shrink-0`,
4859
- "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
4860
- className
4861
- ),
4862
- ...props
5300
+ return useRender({
5301
+ defaultTagName: "div",
5302
+ props: mergeProps$1(
5303
+ {
5304
+ className: cn(
5305
+ `flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70
5306
+ ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear
5307
+ group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2
5308
+ motion-reduce:transition-none [&>svg]:size-4 [&>svg]:shrink-0`,
5309
+ className
5310
+ )
5311
+ },
5312
+ props
5313
+ ),
5314
+ render,
5315
+ state: {
5316
+ slot: "sidebar-group-label",
5317
+ sidebar: "group-label"
4863
5318
  }
4864
- );
5319
+ });
4865
5320
  }
4866
5321
  function SidebarGroupAction({
4867
5322
  className,
4868
- asChild = false,
5323
+ render,
4869
5324
  ...props
4870
5325
  }) {
4871
- const Comp = asChild ? Slot : "button";
4872
- return /* @__PURE__ */ jsx(
4873
- Comp,
4874
- {
4875
- "data-slot": "sidebar-group-action",
4876
- "data-sidebar": "group-action",
4877
- className: cn(
4878
- `text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute
4879
- top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden
4880
- transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,
4881
- // Increases the hit area of the button on mobile.
4882
- "after:absolute after:-inset-2 md:after:hidden",
4883
- "group-data-[collapsible=icon]:hidden",
4884
- className
4885
- ),
4886
- ...props
5326
+ return useRender({
5327
+ defaultTagName: "button",
5328
+ props: mergeProps$1(
5329
+ {
5330
+ className: cn(
5331
+ `absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0
5332
+ text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform
5333
+ group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent
5334
+ hover:text-sidebar-accent-foreground focus-visible:ring-2 motion-reduce:transition-none md:after:hidden
5335
+ [&>svg]:size-4 [&>svg]:shrink-0`,
5336
+ className
5337
+ )
5338
+ },
5339
+ props
5340
+ ),
5341
+ render,
5342
+ state: {
5343
+ slot: "sidebar-group-action",
5344
+ sidebar: "group-action"
4887
5345
  }
4888
- );
5346
+ });
4889
5347
  }
4890
5348
  function SidebarGroupContent({ className, ...props }) {
4891
5349
  return /* @__PURE__ */ jsx(
@@ -4904,7 +5362,7 @@ function SidebarMenu({ className, ...props }) {
4904
5362
  {
4905
5363
  "data-slot": "sidebar-menu",
4906
5364
  "data-sidebar": "menu",
4907
- className: cn("flex w-full min-w-0 flex-col gap-1", className),
5365
+ className: cn("flex w-full min-w-0 flex-col gap-0", className),
4908
5366
  ...props
4909
5367
  }
4910
5368
  );
@@ -4921,12 +5379,20 @@ function SidebarMenuItem({ className, ...props }) {
4921
5379
  );
4922
5380
  }
4923
5381
  var sidebarMenuButtonVariants = cva(
4924
- "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,margin,gap] duration-200 ease-[cubic-bezier(0.25,1,0.5,1)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:h-8! group-data-[collapsible=icon]:w-9! group-data-[collapsible=icon]:mx-auto group-data-[collapsible=icon]:gap-0 group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
5382
+ `peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm
5383
+ ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8
5384
+ group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent
5385
+ hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent
5386
+ active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50
5387
+ aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent
5388
+ data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium
5389
+ data-active:text-sidebar-accent-foreground pointer-coarse:min-h-11 motion-reduce:transition-none [&_svg]:size-4 [&_svg]:shrink-0
5390
+ [&>span:last-child]:truncate`,
4925
5391
  {
4926
5392
  variants: {
4927
5393
  variant: {
4928
5394
  default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
4929
- 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))]"
5395
+ outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
4930
5396
  },
4931
5397
  size: {
4932
5398
  default: "h-8 text-sm",
@@ -4941,7 +5407,7 @@ var sidebarMenuButtonVariants = cva(
4941
5407
  }
4942
5408
  );
4943
5409
  function SidebarMenuButton({
4944
- asChild = false,
5410
+ render,
4945
5411
  isActive = false,
4946
5412
  variant = "default",
4947
5413
  size = "default",
@@ -4949,62 +5415,63 @@ function SidebarMenuButton({
4949
5415
  className,
4950
5416
  ...props
4951
5417
  }) {
4952
- const Comp = asChild ? Slot : "button";
4953
5418
  const { isMobile, state } = useSidebar();
4954
- const button = /* @__PURE__ */ jsx(
4955
- Comp,
4956
- {
4957
- "data-slot": "sidebar-menu-button",
4958
- "data-sidebar": "menu-button",
4959
- "data-size": size,
4960
- "data-active": isActive,
4961
- className: cn(sidebarMenuButtonVariants({ variant, size }), className),
4962
- ...props
5419
+ const component = useRender({
5420
+ defaultTagName: "button",
5421
+ props: mergeProps$1(
5422
+ {
5423
+ className: cn(sidebarMenuButtonVariants({ variant, size }), className)
5424
+ },
5425
+ props
5426
+ ),
5427
+ render: !tooltip ? render : /* @__PURE__ */ jsx(TooltipTrigger, { render }),
5428
+ state: {
5429
+ slot: "sidebar-menu-button",
5430
+ sidebar: "menu-button",
5431
+ size,
5432
+ active: isActive
4963
5433
  }
4964
- );
5434
+ });
4965
5435
  if (!tooltip) {
4966
- return button;
4967
- }
4968
- if (typeof tooltip === "string") {
4969
- tooltip = {
4970
- children: tooltip
4971
- };
5436
+ return component;
4972
5437
  }
5438
+ const tooltipProps = typeof tooltip === "string" ? { children: tooltip } : tooltip;
4973
5439
  return /* @__PURE__ */ jsxs(Tooltip, { children: [
4974
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
4975
- /* @__PURE__ */ jsx(TooltipContent, { side: "right", align: "center", hidden: state !== "collapsed" || isMobile, ...tooltip })
5440
+ component,
5441
+ /* @__PURE__ */ jsx(TooltipContent, { side: "right", align: "center", hidden: state !== "collapsed" || isMobile, ...tooltipProps })
4976
5442
  ] });
4977
5443
  }
4978
5444
  function SidebarMenuAction({
4979
5445
  className,
4980
- asChild = false,
5446
+ render,
4981
5447
  showOnHover = false,
4982
5448
  ...props
4983
5449
  }) {
4984
- const Comp = asChild ? Slot : "button";
4985
- return /* @__PURE__ */ jsx(
4986
- Comp,
4987
- {
4988
- "data-slot": "sidebar-menu-action",
4989
- "data-sidebar": "menu-action",
4990
- className: cn(
4991
- `text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground
4992
- peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5
4993
- items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2
4994
- [&>svg]:size-4 [&>svg]:shrink-0`,
4995
- // Increases the hit area of the button on mobile.
4996
- "after:absolute after:-inset-2 md:after:hidden",
4997
- "peer-data-[size=sm]/menu-button:top-1",
4998
- "peer-data-[size=default]/menu-button:top-1.5",
4999
- "peer-data-[size=lg]/menu-button:top-2.5",
5000
- "group-data-[collapsible=icon]:hidden",
5001
- showOnHover && `peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100
5002
- group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0`,
5003
- className
5004
- ),
5005
- ...props
5450
+ return useRender({
5451
+ defaultTagName: "button",
5452
+ props: mergeProps$1(
5453
+ {
5454
+ className: cn(
5455
+ `absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0
5456
+ text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform
5457
+ group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground
5458
+ peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5
5459
+ peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent
5460
+ hover:text-sidebar-accent-foreground focus-visible:ring-2 motion-reduce:transition-none md:after:hidden
5461
+ [&>svg]:size-4 [&>svg]:shrink-0`,
5462
+ showOnHover && `group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100
5463
+ peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,
5464
+ className
5465
+ )
5466
+ },
5467
+ props
5468
+ ),
5469
+ render,
5470
+ state: {
5471
+ slot: "sidebar-menu-action",
5472
+ sidebar: "menu-action"
5006
5473
  }
5007
- );
5474
+ });
5008
5475
  }
5009
5476
  function SidebarMenuBadge({ className, ...props }) {
5010
5477
  return /* @__PURE__ */ jsx(
@@ -5013,14 +5480,11 @@ function SidebarMenuBadge({ className, ...props }) {
5013
5480
  "data-slot": "sidebar-menu-badge",
5014
5481
  "data-sidebar": "menu-badge",
5015
5482
  className: cn(
5016
- `text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center
5017
- rounded-md px-1 text-xs font-medium tabular-nums select-none`,
5018
- `peer-hover/menu-button:text-sidebar-accent-foreground
5019
- peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,
5020
- "peer-data-[size=sm]/menu-button:top-1",
5021
- "peer-data-[size=default]/menu-button:top-1.5",
5022
- "peer-data-[size=lg]/menu-button:top-2.5",
5023
- "group-data-[collapsible=icon]:hidden",
5483
+ `pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1
5484
+ text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden
5485
+ peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5
5486
+ peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1
5487
+ peer-data-active/menu-button:text-sidebar-accent-foreground`,
5024
5488
  className
5025
5489
  ),
5026
5490
  ...props
@@ -5032,9 +5496,14 @@ function SidebarMenuSkeleton({
5032
5496
  showIcon = false,
5033
5497
  ...props
5034
5498
  }) {
5035
- const width = React19.useMemo(() => {
5036
- return `${Math.floor(Math.random() * 40) + 50}%`;
5037
- }, []);
5499
+ const id = React21.useId();
5500
+ const width = React21.useMemo(() => {
5501
+ let hash = 0;
5502
+ for (const character of id) {
5503
+ hash = hash * 31 + character.charCodeAt(0) >>> 0;
5504
+ }
5505
+ return `${50 + hash % 40}%`;
5506
+ }, [id]);
5038
5507
  return /* @__PURE__ */ jsxs(
5039
5508
  "div",
5040
5509
  {
@@ -5065,8 +5534,8 @@ function SidebarMenuSub({ className, ...props }) {
5065
5534
  "data-slot": "sidebar-menu-sub",
5066
5535
  "data-sidebar": "menu-sub",
5067
5536
  className: cn(
5068
- "border-sidebar-border/60 mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
5069
- "group-data-[collapsible=icon]:hidden",
5537
+ `mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5
5538
+ group-data-[collapsible=icon]:hidden`,
5070
5539
  className
5071
5540
  ),
5072
5541
  ...props
@@ -5085,35 +5554,423 @@ function SidebarMenuSubItem({ className, ...props }) {
5085
5554
  );
5086
5555
  }
5087
5556
  function SidebarMenuSubButton({
5088
- asChild = false,
5557
+ render,
5089
5558
  size = "md",
5090
5559
  isActive = false,
5091
5560
  className,
5092
5561
  ...props
5093
5562
  }) {
5094
- const Comp = asChild ? Slot : "a";
5095
- return /* @__PURE__ */ jsx(
5096
- Comp,
5563
+ return useRender({
5564
+ defaultTagName: "a",
5565
+ props: mergeProps$1(
5566
+ {
5567
+ className: cn(
5568
+ `flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2
5569
+ text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden
5570
+ hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent
5571
+ active:text-sidebar-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50
5572
+ data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent
5573
+ data-active:text-sidebar-accent-foreground pointer-coarse:min-h-11 [&>span:last-child]:truncate [&>svg]:size-4
5574
+ [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,
5575
+ className
5576
+ )
5577
+ },
5578
+ props
5579
+ ),
5580
+ render,
5581
+ state: {
5582
+ slot: "sidebar-menu-sub-button",
5583
+ sidebar: "menu-sub-button",
5584
+ size,
5585
+ active: isActive
5586
+ }
5587
+ });
5588
+ }
5589
+ function createAppLink(renderLink, props) {
5590
+ return renderLink ? renderLink(props) : /* @__PURE__ */ jsx("a", { ...props });
5591
+ }
5592
+ function AppBar({
5593
+ breadcrumbs = [],
5594
+ renderLink,
5595
+ leading,
5596
+ search,
5597
+ actions,
5598
+ toggleLabel = "Toggle navigation",
5599
+ className,
5600
+ render,
5601
+ ...props
5602
+ }) {
5603
+ const content = /* @__PURE__ */ jsxs("div", { className: "flex h-[var(--app-bar-height,3.5rem)] w-full min-w-0 items-center gap-2 px-3 sm:px-4", children: [
5604
+ /* @__PURE__ */ jsx(SidebarTrigger, { "aria-label": toggleLabel, className: "-ms-1 shrink-0" }),
5605
+ (leading || breadcrumbs.length > 0) && /* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "mr-1 hidden h-4 self-center sm:block" }),
5606
+ leading,
5607
+ breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Breadcrumb, { className: "min-w-0 flex-1 sm:flex-none", children: /* @__PURE__ */ jsx(BreadcrumbList, { className: "flex-nowrap text-sm text-muted-foreground", children: breadcrumbs.map((item, index) => {
5608
+ const current = item.current ?? index === breadcrumbs.length - 1;
5609
+ const breadcrumbContent = current || !item.href ? /* @__PURE__ */ jsx(
5610
+ BreadcrumbPage,
5611
+ {
5612
+ className: "block max-w-48 truncate font-semibold text-foreground sm:max-w-56",
5613
+ title: typeof item.label === "string" ? item.label : void 0,
5614
+ children: item.label
5615
+ }
5616
+ ) : /* @__PURE__ */ jsx(
5617
+ BreadcrumbLink,
5618
+ {
5619
+ className: "hover:text-foreground",
5620
+ title: typeof item.label === "string" ? item.label : void 0,
5621
+ render: createAppLink(renderLink, {
5622
+ href: item.href,
5623
+ children: item.label
5624
+ })
5625
+ }
5626
+ );
5627
+ return /* @__PURE__ */ jsxs(React21.Fragment, { children: [
5628
+ index > 0 && /* @__PURE__ */ jsx(
5629
+ BreadcrumbSeparator,
5630
+ {
5631
+ className: "text-muted-foreground/70 hidden sm:block"
5632
+ }
5633
+ ),
5634
+ /* @__PURE__ */ jsx(BreadcrumbItem, { className: cn("min-w-0", !current && "hidden sm:flex"), children: breadcrumbContent })
5635
+ ] }, item.id);
5636
+ }) }) }),
5637
+ search && /* @__PURE__ */ jsx("div", { className: "ml-auto min-w-0", children: search }),
5638
+ actions && /* @__PURE__ */ jsx("div", { className: cn("flex shrink-0 items-center gap-2", !search && "ml-auto"), children: actions })
5639
+ ] });
5640
+ return useRender({
5641
+ defaultTagName: "header",
5642
+ props: mergeProps$1(
5643
+ {
5644
+ className: cn("sticky top-0 z-30 flex w-full shrink-0 items-center border-b bg-background", className),
5645
+ children: content
5646
+ },
5647
+ props
5648
+ ),
5649
+ render,
5650
+ state: {
5651
+ slot: "app-bar"
5652
+ }
5653
+ });
5654
+ }
5655
+ function initials(name) {
5656
+ const parts = name.trim().split(/\s+/).filter(Boolean).slice(0, 2);
5657
+ return parts.map((part) => part[0]?.toUpperCase()).join("") || "U";
5658
+ }
5659
+ function navigationLink(renderLink, item, children, onAcceptedNavigation) {
5660
+ return createAppLink(renderLink, {
5661
+ href: item.href,
5662
+ children,
5663
+ "aria-current": item.isActive ? "page" : void 0,
5664
+ "aria-disabled": item.disabled || void 0,
5665
+ tabIndex: item.disabled ? -1 : void 0,
5666
+ onClick: (event) => {
5667
+ if (item.disabled) {
5668
+ event.preventDefault();
5669
+ return;
5670
+ }
5671
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.currentTarget.target && event.currentTarget.target !== "_self") return;
5672
+ onAcceptedNavigation?.();
5673
+ }
5674
+ });
5675
+ }
5676
+ function NavigationGroup({ group, renderLink }) {
5677
+ const { isMobile, setOpenMobile } = useSidebar();
5678
+ const closeMobileNavigation = React21.useCallback(() => {
5679
+ if (isMobile) setOpenMobile(false);
5680
+ }, [isMobile, setOpenMobile]);
5681
+ return /* @__PURE__ */ jsxs(SidebarGroup, { children: [
5682
+ group.label && /* @__PURE__ */ jsx(SidebarGroupLabel, { children: group.label }),
5683
+ /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: group.items.map((item) => {
5684
+ const Icon = item.icon;
5685
+ const itemContent = /* @__PURE__ */ jsxs(Fragment, { children: [
5686
+ Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }),
5687
+ /* @__PURE__ */ jsx("span", { children: item.label })
5688
+ ] });
5689
+ if (!item.children?.length) {
5690
+ return /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [
5691
+ /* @__PURE__ */ jsx(
5692
+ SidebarMenuButton,
5693
+ {
5694
+ isActive: item.isActive,
5695
+ tooltip: typeof item.label === "string" ? item.label : void 0,
5696
+ render: navigationLink(renderLink, item, itemContent, closeMobileNavigation)
5697
+ }
5698
+ ),
5699
+ item.badge && /* @__PURE__ */ jsx(SidebarMenuBadge, { children: item.badge })
5700
+ ] }, item.id);
5701
+ }
5702
+ const hasActiveChild = item.children.some((child) => child.isActive);
5703
+ return /* @__PURE__ */ jsxs(
5704
+ Collapsible,
5705
+ {
5706
+ defaultOpen: item.defaultOpen ?? item.isActive ?? hasActiveChild,
5707
+ render: /* @__PURE__ */ jsx(SidebarMenuItem, {}),
5708
+ children: [
5709
+ /* @__PURE__ */ jsx(
5710
+ SidebarMenuButton,
5711
+ {
5712
+ isActive: item.isActive,
5713
+ tooltip: typeof item.label === "string" ? item.label : void 0,
5714
+ render: navigationLink(renderLink, item, itemContent, closeMobileNavigation)
5715
+ }
5716
+ ),
5717
+ /* @__PURE__ */ jsx(
5718
+ SidebarMenuAction,
5719
+ {
5720
+ render: /* @__PURE__ */ jsx(
5721
+ CollapsibleTrigger,
5722
+ {
5723
+ "aria-label": item.toggleLabel ?? (typeof item.label === "string" ? `Toggle ${item.label}` : "Toggle navigation group")
5724
+ }
5725
+ ),
5726
+ className: "aria-expanded:rotate-90",
5727
+ children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
5728
+ }
5729
+ ),
5730
+ /* @__PURE__ */ jsx(CollapsiblePanel, { innerClassName: "py-0", children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.children.map((child) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(
5731
+ SidebarMenuSubButton,
5732
+ {
5733
+ isActive: child.isActive,
5734
+ render: navigationLink(
5735
+ renderLink,
5736
+ child,
5737
+ child.label,
5738
+ closeMobileNavigation
5739
+ )
5740
+ }
5741
+ ) }, child.id)) }) })
5742
+ ]
5743
+ },
5744
+ item.id
5745
+ );
5746
+ }) }) })
5747
+ ] });
5748
+ }
5749
+ function AccountMenu({ account, renderLink }) {
5750
+ const { isMobile } = useSidebar();
5751
+ return /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
5752
+ /* @__PURE__ */ jsxs(
5753
+ DropdownMenuTrigger,
5754
+ {
5755
+ render: /* @__PURE__ */ jsx(
5756
+ SidebarMenuButton,
5757
+ {
5758
+ size: "lg",
5759
+ className: "aria-expanded:bg-sidebar-accent aria-expanded:text-sidebar-accent-foreground"
5760
+ }
5761
+ ),
5762
+ children: [
5763
+ /* @__PURE__ */ jsxs(Avatar, { children: [
5764
+ account.avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: account.avatarUrl, alt: account.avatarAlt ?? account.name }),
5765
+ /* @__PURE__ */ jsx(AvatarFallback, { children: account.fallback ?? initials(account.name) })
5766
+ ] }),
5767
+ /* @__PURE__ */ jsxs("div", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight", children: [
5768
+ /* @__PURE__ */ jsx("span", { className: "truncate font-medium", title: account.name, children: account.name }),
5769
+ account.secondaryLabel && /* @__PURE__ */ jsx("span", { className: "truncate text-xs", title: account.secondaryLabel, children: account.secondaryLabel })
5770
+ ] }),
5771
+ /* @__PURE__ */ jsx(ChevronsUpDownIcon, { className: "ml-auto" })
5772
+ ]
5773
+ }
5774
+ ),
5775
+ /* @__PURE__ */ jsxs(
5776
+ DropdownMenuContent,
5777
+ {
5778
+ className: "min-w-56 rounded-lg",
5779
+ side: isMobile ? "bottom" : "right",
5780
+ align: "end",
5781
+ sideOffset: 4,
5782
+ children: [
5783
+ /* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
5784
+ /* @__PURE__ */ jsxs(Avatar, { children: [
5785
+ account.avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: account.avatarUrl, alt: account.avatarAlt ?? account.name }),
5786
+ /* @__PURE__ */ jsx(AvatarFallback, { children: account.fallback ?? initials(account.name) })
5787
+ ] }),
5788
+ /* @__PURE__ */ jsxs("div", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight", children: [
5789
+ /* @__PURE__ */ jsx("span", { className: "truncate font-medium", title: account.name, children: account.name }),
5790
+ account.secondaryLabel && /* @__PURE__ */ jsx("span", { className: "truncate text-xs", title: account.secondaryLabel, children: account.secondaryLabel })
5791
+ ] })
5792
+ ] }) }) }),
5793
+ account.actionGroups?.map((group) => /* @__PURE__ */ jsxs(React21.Fragment, { children: [
5794
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
5795
+ /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
5796
+ group.label && /* @__PURE__ */ jsx(DropdownMenuLabel, { children: group.label }),
5797
+ group.actions.map((action) => {
5798
+ const Icon = action.icon;
5799
+ const actionContent = /* @__PURE__ */ jsxs(Fragment, { children: [
5800
+ Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }),
5801
+ /* @__PURE__ */ jsx("span", { children: action.label })
5802
+ ] });
5803
+ if (action.href) {
5804
+ return /* @__PURE__ */ jsx(
5805
+ DropdownMenuItem,
5806
+ {
5807
+ disabled: action.disabled,
5808
+ variant: action.variant,
5809
+ render: createAppLink(renderLink, {
5810
+ href: action.href,
5811
+ children: actionContent
5812
+ })
5813
+ },
5814
+ action.id
5815
+ );
5816
+ }
5817
+ return /* @__PURE__ */ jsx(
5818
+ DropdownMenuItem,
5819
+ {
5820
+ disabled: action.disabled,
5821
+ variant: action.variant,
5822
+ onClick: action.onSelect,
5823
+ children: actionContent
5824
+ },
5825
+ action.id
5826
+ );
5827
+ })
5828
+ ] })
5829
+ ] }, group.id))
5830
+ ]
5831
+ }
5832
+ )
5833
+ ] }) }) });
5834
+ }
5835
+ function Brand({ brand, renderLink }) {
5836
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
5837
+ brand.logo && /* @__PURE__ */ jsx("div", { className: "bg-primary text-primary-foreground flex size-8 shrink-0 items-center justify-center rounded-lg shadow-xs", children: brand.logo }),
5838
+ /* @__PURE__ */ jsxs("div", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight", children: [
5839
+ /* @__PURE__ */ jsx("span", { className: "truncate font-medium", title: typeof brand.name === "string" ? brand.name : void 0, children: brand.name }),
5840
+ brand.description && /* @__PURE__ */ jsx(
5841
+ "span",
5842
+ {
5843
+ className: "text-muted-foreground truncate text-xs",
5844
+ title: typeof brand.description === "string" ? brand.description : void 0,
5845
+ children: brand.description
5846
+ }
5847
+ )
5848
+ ] })
5849
+ ] });
5850
+ return /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(
5851
+ SidebarMenuButton,
5097
5852
  {
5098
- "data-slot": "sidebar-menu-sub-button",
5099
- "data-sidebar": "menu-sub-button",
5100
- "data-size": size,
5101
- "data-active": isActive,
5853
+ size: "lg",
5854
+ render: brand.href ? createAppLink(renderLink, { href: brand.href, children: content }) : /* @__PURE__ */ jsx("div", { children: content })
5855
+ }
5856
+ ) }) });
5857
+ }
5858
+ function AppShell({
5859
+ children,
5860
+ navigation,
5861
+ brand,
5862
+ account,
5863
+ breadcrumbs,
5864
+ renderLink,
5865
+ barLeading,
5866
+ barSearch,
5867
+ barActions,
5868
+ barProps,
5869
+ barPlacement = "top",
5870
+ headerHeight = "3.5rem",
5871
+ sidebarWidth,
5872
+ sidebarProps,
5873
+ sidebarFooter,
5874
+ contentFooter,
5875
+ defaultSidebarOpen = true,
5876
+ sidebarOpen,
5877
+ onSidebarOpenChange,
5878
+ contentClassName,
5879
+ contentProps,
5880
+ className,
5881
+ style,
5882
+ render,
5883
+ ...props
5884
+ }) {
5885
+ const mainGroups = navigation.filter((group) => group.placement !== "footer");
5886
+ const footerGroups = navigation.filter((group) => group.placement === "footer");
5887
+ const hasFooter = footerGroups.length > 0 || Boolean(account) || Boolean(sidebarFooter);
5888
+ const { className: sidebarClassName, collapsible, ...resolvedSidebarProps } = sidebarProps ?? {};
5889
+ const contentBar = barPlacement === "content";
5890
+ const appBar = /* @__PURE__ */ jsx(
5891
+ AppBar,
5892
+ {
5893
+ breadcrumbs,
5894
+ renderLink,
5895
+ leading: barLeading,
5896
+ search: barSearch,
5897
+ actions: barActions,
5898
+ ...barProps
5899
+ }
5900
+ );
5901
+ const sidebar = /* @__PURE__ */ jsxs(
5902
+ Sidebar,
5903
+ {
5904
+ collapsible: collapsible ?? "icon",
5905
+ ...resolvedSidebarProps,
5102
5906
  className: cn(
5103
- `text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground
5104
- active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7
5105
- min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2
5106
- disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50
5107
- [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,
5108
- "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
5109
- size === "sm" && "text-xs",
5110
- size === "md" && "text-sm",
5111
- "group-data-[collapsible=icon]:hidden",
5112
- className
5907
+ contentBar ? "h-dvh!" : "top-(--app-bar-height) h-[calc(100dvh-var(--app-bar-height))]!",
5908
+ sidebarClassName
5113
5909
  ),
5114
- ...props
5910
+ children: [
5911
+ brand && /* @__PURE__ */ jsx(SidebarHeader, { className: contentBar ? "pt-5 pb-2" : void 0, children: /* @__PURE__ */ jsx(Brand, { brand, renderLink }) }),
5912
+ /* @__PURE__ */ jsx(SidebarContent, { className: contentBar ? "px-1" : void 0, children: mainGroups.map((group) => /* @__PURE__ */ jsx(NavigationGroup, { group, renderLink }, group.id)) }),
5913
+ hasFooter && /* @__PURE__ */ jsxs(SidebarFooter, { className: contentBar ? "p-0" : void 0, children: [
5914
+ !contentBar ? /* @__PURE__ */ jsx(SidebarSeparator, {}) : null,
5915
+ footerGroups.map((group) => /* @__PURE__ */ jsx(NavigationGroup, { group, renderLink }, group.id)),
5916
+ sidebarFooter,
5917
+ account && /* @__PURE__ */ jsx("div", { className: contentBar ? "border-t p-2" : void 0, children: /* @__PURE__ */ jsx(AccountMenu, { account, renderLink }) })
5918
+ ] }),
5919
+ /* @__PURE__ */ jsx(SidebarRail, {})
5920
+ ]
5921
+ }
5922
+ );
5923
+ const mainColumn = /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
5924
+ contentBar ? appBar : null,
5925
+ /* @__PURE__ */ jsx(
5926
+ SidebarInset,
5927
+ {
5928
+ ...contentProps,
5929
+ className: cn(
5930
+ "min-w-0 flex-1 overflow-auto",
5931
+ contentFooter && "pb-[calc(4.5rem+env(safe-area-inset-bottom))] md:pb-0",
5932
+ contentClassName
5933
+ ),
5934
+ children
5935
+ }
5936
+ ),
5937
+ contentFooter
5938
+ ] });
5939
+ const content = /* @__PURE__ */ jsxs(
5940
+ SidebarProvider,
5941
+ {
5942
+ className: "min-h-0 flex-1 flex-col",
5943
+ defaultOpen: defaultSidebarOpen,
5944
+ open: sidebarOpen,
5945
+ onOpenChange: onSidebarOpenChange,
5946
+ style: sidebarWidth ? { "--sidebar-width": sidebarWidth } : void 0,
5947
+ children: [
5948
+ !contentBar ? appBar : null,
5949
+ /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1", children: [
5950
+ sidebar,
5951
+ mainColumn
5952
+ ] })
5953
+ ]
5115
5954
  }
5116
5955
  );
5956
+ return useRender({
5957
+ defaultTagName: "div",
5958
+ props: mergeProps$1(
5959
+ {
5960
+ className: cn("flex min-h-dvh w-full flex-col bg-background", className),
5961
+ style: {
5962
+ "--app-bar-height": headerHeight,
5963
+ ...style
5964
+ },
5965
+ children: content
5966
+ },
5967
+ props
5968
+ ),
5969
+ render,
5970
+ state: {
5971
+ slot: "app-shell"
5972
+ }
5973
+ });
5117
5974
  }
5118
5975
  function CalendarHeader() {
5119
5976
  return /* @__PURE__ */ jsxs("header", { className: "flex w-full items-center gap-1 pb-1", children: [
@@ -5182,7 +6039,7 @@ function RangeCalendar({ className, ...props }) {
5182
6039
  /* @__PURE__ */ jsx(CalendarGridComponent, { isRange: true })
5183
6040
  ] });
5184
6041
  }
5185
- var AceEditor = React19.lazy(async () => {
6042
+ var AceEditor = React21.lazy(async () => {
5186
6043
  const ace = await import('react-ace');
5187
6044
  await import('ace-builds/src-noconflict/mode-json');
5188
6045
  await import('ace-builds/src-noconflict/theme-textmate');
@@ -5329,9 +6186,9 @@ var DEFAULT_MAGNIFICATION = 60;
5329
6186
  var DEFAULT_DISTANCE = 140;
5330
6187
  var dockVariants = cva(
5331
6188
  // Solid themed surface (no glass/blur)
5332
- "mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl border bg-card p-2 shadow"
6189
+ "mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl bg-card p-2 shadow-card"
5333
6190
  );
5334
- var Dock = React19__default.forwardRef(
6191
+ var Dock = React21__default.forwardRef(
5335
6192
  ({
5336
6193
  className,
5337
6194
  children,
@@ -5342,10 +6199,11 @@ var Dock = React19__default.forwardRef(
5342
6199
  ...props
5343
6200
  }, ref) => {
5344
6201
  const mouseX = useMotionValue(Infinity);
6202
+ const prefersReducedMotion = useReducedMotion();
5345
6203
  const renderChildren = () => {
5346
- return React19__default.Children.map(children, (child) => {
5347
- if (React19__default.isValidElement(child) && child.type === DockIcon) {
5348
- return React19__default.cloneElement(child, {
6204
+ return React21__default.Children.map(children, (child) => {
6205
+ if (React21__default.isValidElement(child) && child.type === DockIcon) {
6206
+ return React21__default.cloneElement(child, {
5349
6207
  ...child.props,
5350
6208
  mouseX,
5351
6209
  size: iconSize,
@@ -5360,8 +6218,8 @@ var Dock = React19__default.forwardRef(
5360
6218
  motion.div,
5361
6219
  {
5362
6220
  ref,
5363
- onMouseMove: (e) => mouseX.set(e.pageX),
5364
- onMouseLeave: () => mouseX.set(Infinity),
6221
+ onMouseMove: prefersReducedMotion ? void 0 : (event) => mouseX.set(event.pageX),
6222
+ onMouseLeave: prefersReducedMotion ? void 0 : () => mouseX.set(Infinity),
5365
6223
  ...props,
5366
6224
  className: cn(dockVariants({ className }), {
5367
6225
  "items-start": direction === "top",
@@ -5384,6 +6242,7 @@ var DockIcon = ({
5384
6242
  ...props
5385
6243
  }) => {
5386
6244
  const ref = useRef(null);
6245
+ const prefersReducedMotion = useReducedMotion();
5387
6246
  const padding = Math.max(6, size * 0.2);
5388
6247
  const defaultMouseX = useMotionValue(Infinity);
5389
6248
  const distanceCalc = useTransform(mouseX ?? defaultMouseX, (val) => {
@@ -5400,7 +6259,7 @@ var DockIcon = ({
5400
6259
  motion.div,
5401
6260
  {
5402
6261
  ref,
5403
- style: { width: scaleSize, height: scaleSize, padding },
6262
+ style: { width: prefersReducedMotion ? size : scaleSize, height: prefersReducedMotion ? size : scaleSize, padding },
5404
6263
  className: cn(
5405
6264
  // Solid hover target with theme-aware colors
5406
6265
  "flex aspect-square cursor-pointer items-center justify-center rounded-full bg-transparent",
@@ -5423,6 +6282,18 @@ function PageHeader({ title, description, actions }) {
5423
6282
  actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: actions })
5424
6283
  ] }) });
5425
6284
  }
6285
+ var REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
6286
+ function subscribeToReducedMotion(onStoreChange) {
6287
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
6288
+ return () => void 0;
6289
+ }
6290
+ const mediaQuery = window.matchMedia(REDUCED_MOTION_QUERY);
6291
+ mediaQuery.addEventListener("change", onStoreChange);
6292
+ return () => mediaQuery.removeEventListener("change", onStoreChange);
6293
+ }
6294
+ function getReducedMotionSnapshot() {
6295
+ return typeof window === "undefined" || typeof window.matchMedia !== "function" ? true : window.matchMedia(REDUCED_MOTION_QUERY).matches;
6296
+ }
5426
6297
  var FlickeringGrid = ({
5427
6298
  squareSize = 4,
5428
6299
  gridGap = 6,
@@ -5438,6 +6309,11 @@ var FlickeringGrid = ({
5438
6309
  const containerRef = useRef(null);
5439
6310
  const [isInView, setIsInView] = useState(false);
5440
6311
  const [canvasSize, setCanvasSize] = useState({ width: 0, height: 0 });
6312
+ const prefersReducedMotion = React21__default.useSyncExternalStore(
6313
+ subscribeToReducedMotion,
6314
+ getReducedMotionSnapshot,
6315
+ () => true
6316
+ );
5441
6317
  const memoizedColor = useMemo(() => {
5442
6318
  const toRGBA = (color2) => {
5443
6319
  if (typeof window === "undefined") {
@@ -5514,6 +6390,7 @@ var FlickeringGrid = ({
5514
6390
  const newHeight = height || container.clientHeight;
5515
6391
  setCanvasSize({ width: newWidth, height: newHeight });
5516
6392
  gridParams = setupCanvas(canvas, newWidth, newHeight);
6393
+ drawGrid(ctx, canvas.width, canvas.height, gridParams.cols, gridParams.rows, gridParams.squares, gridParams.dpr);
5517
6394
  };
5518
6395
  updateCanvasSize();
5519
6396
  let lastTime = 0;
@@ -5529,6 +6406,11 @@ var FlickeringGrid = ({
5529
6406
  updateCanvasSize();
5530
6407
  });
5531
6408
  resizeObserver.observe(container);
6409
+ if (prefersReducedMotion) {
6410
+ return () => {
6411
+ resizeObserver.disconnect();
6412
+ };
6413
+ }
5532
6414
  const intersectionObserver = new IntersectionObserver(
5533
6415
  ([entry]) => {
5534
6416
  setIsInView(entry.isIntersecting);
@@ -5544,7 +6426,7 @@ var FlickeringGrid = ({
5544
6426
  resizeObserver.disconnect();
5545
6427
  intersectionObserver.disconnect();
5546
6428
  };
5547
- }, [setupCanvas, updateSquares, drawGrid, width, height, isInView]);
6429
+ }, [setupCanvas, updateSquares, drawGrid, width, height, isInView, prefersReducedMotion]);
5548
6430
  return /* @__PURE__ */ jsx("div", { ref: containerRef, className: cn(`h-full w-full ${className}`), ...props, children: /* @__PURE__ */ jsx(
5549
6431
  "canvas",
5550
6432
  {
@@ -5571,13 +6453,18 @@ var MotionGrid = ({
5571
6453
  }) => {
5572
6454
  const [cols, rows] = gridSize;
5573
6455
  const frames = useLoadingFrames(cols, rows);
5574
- const [index, setIndex] = React19.useState(0);
5575
- const intervalRef = React19.useRef(null);
5576
- React19.useEffect(() => {
5577
- if (!animate || frames.length === 0) return;
6456
+ const [index, setIndex] = React21.useState(0);
6457
+ const intervalRef = React21.useRef(null);
6458
+ const prefersReducedMotion = useReducedMotion();
6459
+ const shouldAnimate = animate && !prefersReducedMotion;
6460
+ React21.useEffect(() => {
6461
+ if (!shouldAnimate || frames.length === 0) {
6462
+ setIndex(0);
6463
+ return;
6464
+ }
5578
6465
  intervalRef.current = setInterval(() => setIndex((i) => (i + 1) % frames.length), duration);
5579
6466
  return () => clearInterval(intervalRef.current);
5580
- }, [frames.length, duration, animate]);
6467
+ }, [frames.length, duration, shouldAnimate]);
5581
6468
  const active = new Set(frames[index]?.map(([x, y]) => y * cols + x) ?? []);
5582
6469
  return /* @__PURE__ */ jsx(
5583
6470
  "div",
@@ -5598,7 +6485,7 @@ var MotionGrid = ({
5598
6485
  cellClassName
5599
6486
  ),
5600
6487
  ...cellProps,
5601
- transition: { duration: duration / 1e3, ease: easings.easeInOut }
6488
+ transition: prefersReducedMotion ? { duration: 0 } : { duration: duration / 1e3, ease: easings.easeInOut }
5602
6489
  },
5603
6490
  i
5604
6491
  ))
@@ -5606,7 +6493,7 @@ var MotionGrid = ({
5606
6493
  );
5607
6494
  };
5608
6495
  var useLoadingFrames = (cols = 8, rows = 4) => {
5609
- const loadingFrames = React19.useMemo(() => {
6496
+ const loadingFrames = React21.useMemo(() => {
5610
6497
  const frames = [];
5611
6498
  for (let s = 0; s < cols + rows; s++) {
5612
6499
  const dots = [];
@@ -5931,7 +6818,22 @@ function CardStackProvider({
5931
6818
  defaultPeekOffset = DEFAULT_PEEK_OFFSET,
5932
6819
  defaultWidth = DEFAULT_WIDTH
5933
6820
  }) {
5934
- const [state, dispatch] = useReducer(stackReducer, { cards: initial });
6821
+ const [state, reducerDispatch] = useReducer(stackReducer, { cards: initial });
6822
+ const routesRef = useRef(routes);
6823
+ useEffect(() => {
6824
+ routesRef.current = routes;
6825
+ }, [routes]);
6826
+ const stateRef = useRef(state);
6827
+ useEffect(() => {
6828
+ stateRef.current = state;
6829
+ }, [state]);
6830
+ const dispatch = React21.useCallback(
6831
+ (action) => {
6832
+ stateRef.current = stackReducer(stateRef.current, action);
6833
+ reducerDispatch(action);
6834
+ },
6835
+ [reducerDispatch]
6836
+ );
5935
6837
  const prevCardsRef = useRef(state.cards);
5936
6838
  useEffect(() => {
5937
6839
  if (prevCardsRef.current !== state.cards) {
@@ -5946,10 +6848,6 @@ function CardStackProvider({
5946
6848
  onChange?.(state.cards);
5947
6849
  }
5948
6850
  }, [state.cards, onChange]);
5949
- const routesRef = useRef(routes);
5950
- routesRef.current = routes;
5951
- const stateRef = useRef(state);
5952
- stateRef.current = state;
5953
6851
  const api = useMemo(() => {
5954
6852
  const top = () => {
5955
6853
  const cards = stateRef.current.cards;
@@ -6050,7 +6948,7 @@ function CardStackProvider({
6050
6948
  dismiss,
6051
6949
  insertAt
6052
6950
  };
6053
- }, []);
6951
+ }, [dispatch]);
6054
6952
  useEffect(() => {
6055
6953
  const handleEscape = (event) => {
6056
6954
  if (event.key === "Escape" && stateRef.current.cards.length > 0) {
@@ -6279,7 +7177,7 @@ function StackBackdrop({ className, onClick, config: backdropConfig }) {
6279
7177
  const { config, state } = useStackContext();
6280
7178
  const api = useCardStack();
6281
7179
  const prefersReducedMotion = useReducedMotion();
6282
- const handleClick = React19.useCallback(() => {
7180
+ const handleClick = React21.useCallback(() => {
6283
7181
  if (state.cards.some((c) => c.dismissable === false)) return;
6284
7182
  if (onClick) {
6285
7183
  onClick();
@@ -6298,10 +7196,7 @@ function StackBackdrop({ className, onClick, config: backdropConfig }) {
6298
7196
  animate: "animate",
6299
7197
  exit: "exit",
6300
7198
  onClick: handleClick,
6301
- style: {
6302
- zIndex: config.zIndexBase - 1,
6303
- willChange: "opacity"
6304
- },
7199
+ style: { zIndex: config.zIndexBase - 1 },
6305
7200
  className: cn(
6306
7201
  "fixed inset-0",
6307
7202
  "cursor-pointer",
@@ -6817,7 +7712,6 @@ function StackCardInner({
6817
7712
  height: "100dvh",
6818
7713
  width: cardWidth,
6819
7714
  zIndex,
6820
- willChange: "transform",
6821
7715
  // On mobile, allow vertical pan (scroll) but handle horizontal ourselves
6822
7716
  // This prevents conflict with iOS Safari gestures while allowing content scroll
6823
7717
  touchAction: isMobile ? "pan-y pinch-zoom" : void 0
@@ -7104,7 +7998,7 @@ function CardStackViewport({
7104
7998
  const defaultBackdrop = /* @__PURE__ */ jsx(StackBackdrop, { className: "pointer-events-auto", config: config2 }, "backdrop");
7105
7999
  if (renderBackdrop) {
7106
8000
  const customBackdrop = renderBackdrop();
7107
- return React19.isValidElement(customBackdrop) ? React19.cloneElement(customBackdrop, { key: "backdrop" }) : defaultBackdrop;
8001
+ return React21.isValidElement(customBackdrop) ? React21.cloneElement(customBackdrop, { key: "backdrop" }) : defaultBackdrop;
7108
8002
  }
7109
8003
  return defaultBackdrop;
7110
8004
  };
@@ -7133,7 +8027,7 @@ function CardStackViewport({
7133
8027
  if (!hasCards && exitComplete) {
7134
8028
  return renderEmpty ? renderEmpty() : null;
7135
8029
  }
7136
- const content = /* @__PURE__ */ jsx("div", { "data-slot": "stack-viewport", className: cn("pointer-events-none fixed inset-0", className), children: /* @__PURE__ */ jsxs(AnimatePresence, { mode: "popLayout", onExitComplete: handleExitComplete, children: [
8030
+ const content = /* @__PURE__ */ jsx("div", { "data-slot": "stack-viewport", className: cn("pointer-events-none fixed inset-0", className), children: /* @__PURE__ */ jsxs(AnimatePresence, { initial: false, mode: "popLayout", onExitComplete: handleExitComplete, children: [
7137
8031
  shouldShowBackdrop && hasCards && renderBackdropNode(resolvedBackdrop.config),
7138
8032
  visibleCards.map((card, visibleIndex) => {
7139
8033
  const actualIndex = cards.length - visibleCards.length + visibleIndex;
@@ -7452,481 +8346,6 @@ var toast5 = {
7452
8346
  warning: showWarningToast
7453
8347
  };
7454
8348
 
7455
- // src/components/org-chart/layout.ts
7456
- var NODE_WIDTH = 260;
7457
- var NODE_HEIGHT = 100;
7458
- var RANK_SEP = 80;
7459
- var NODE_SEP = 40;
7460
- var ROOT_KEY = "__root__";
7461
- function computeLayout(edges) {
7462
- const edgeById = /* @__PURE__ */ new Map();
7463
- const childCountMap = /* @__PURE__ */ new Map();
7464
- const childrenMap = /* @__PURE__ */ new Map();
7465
- for (const e of edges) {
7466
- edgeById.set(e.id, e);
7467
- if (e.parentId) {
7468
- childCountMap.set(e.parentId, (childCountMap.get(e.parentId) ?? 0) + 1);
7469
- }
7470
- const parent = e.parentId ?? ROOT_KEY;
7471
- const bucket = childrenMap.get(parent);
7472
- if (bucket) bucket.push(e.id);
7473
- else childrenMap.set(parent, [e.id]);
7474
- }
7475
- for (const children of childrenMap.values()) {
7476
- children.sort((a, b) => {
7477
- const nameA = edgeById.get(a)?.displayName?.toLowerCase() ?? "";
7478
- const nameB = edgeById.get(b)?.displayName?.toLowerCase() ?? "";
7479
- return nameA.localeCompare(nameB);
7480
- });
7481
- }
7482
- const widthCache = /* @__PURE__ */ new Map();
7483
- const subtreeWidth = (nodeId) => {
7484
- if (widthCache.has(nodeId)) return widthCache.get(nodeId);
7485
- const children = childrenMap.get(nodeId);
7486
- if (!children || children.length === 0) {
7487
- widthCache.set(nodeId, NODE_WIDTH);
7488
- return NODE_WIDTH;
7489
- }
7490
- const totalChildWidth = children.reduce((sum, c) => sum + subtreeWidth(c), 0);
7491
- const gaps = (children.length - 1) * NODE_SEP;
7492
- const w = Math.max(NODE_WIDTH, totalChildWidth + gaps);
7493
- widthCache.set(nodeId, w);
7494
- return w;
7495
- };
7496
- const positions = /* @__PURE__ */ new Map();
7497
- const positionSubtree = (nodeId, centerX, y) => {
7498
- positions.set(nodeId, { x: centerX, y });
7499
- const children = childrenMap.get(nodeId);
7500
- if (!children || children.length === 0) return;
7501
- const totalWidth = children.reduce((sum, c) => sum + subtreeWidth(c), 0) + (children.length - 1) * NODE_SEP;
7502
- let currentX = centerX - totalWidth / 2;
7503
- for (const childId of children) {
7504
- const childW = subtreeWidth(childId);
7505
- positionSubtree(childId, currentX + childW / 2, y + NODE_HEIGHT + RANK_SEP);
7506
- currentX += childW + NODE_SEP;
7507
- }
7508
- };
7509
- const roots = childrenMap.get(ROOT_KEY) ?? [];
7510
- if (roots.length === 1) {
7511
- positionSubtree(roots[0], 0, 0);
7512
- } else {
7513
- const totalWidth = roots.reduce((sum, r) => sum + subtreeWidth(r), 0) + (roots.length - 1) * NODE_SEP;
7514
- let currentX = -totalWidth / 2;
7515
- for (const rootId of roots) {
7516
- const w = subtreeWidth(rootId);
7517
- positionSubtree(rootId, currentX + w / 2, 0);
7518
- currentX += w + NODE_SEP;
7519
- }
7520
- }
7521
- const nodes = edges.map((e) => {
7522
- const pos = positions.get(e.id);
7523
- return {
7524
- id: e.id,
7525
- type: "orgChartNode",
7526
- width: NODE_WIDTH,
7527
- height: NODE_HEIGHT,
7528
- position: {
7529
- x: pos.x - NODE_WIDTH / 2,
7530
- y: pos.y
7531
- },
7532
- data: {
7533
- id: e.id,
7534
- displayName: e.displayName,
7535
- avatarUrl: e.avatarUrl,
7536
- positionTitle: e.positionTitle,
7537
- parentId: e.parentId,
7538
- childCount: childCountMap.get(e.id) ?? 0,
7539
- isRoot: !e.parentId
7540
- }
7541
- };
7542
- });
7543
- const flowEdges = edges.filter((e) => e.parentId).map((e) => ({
7544
- id: `edge-${e.parentId}-${e.id}`,
7545
- source: e.parentId,
7546
- target: e.id,
7547
- type: "orgChartEdge"
7548
- }));
7549
- return { nodes, edges: flowEdges };
7550
- }
7551
- var NodeActionsContext = createContext(null);
7552
- var OrgChartContext = createContext(null);
7553
- function OrgChartProvider({ children, editable }) {
7554
- const [selectedNodeId, setSelectedNodeId] = useState(null);
7555
- const [draggedNodeId, setDraggedNodeId] = useState(null);
7556
- const [dropTargetNodeId, setDropTargetNodeId] = useState(null);
7557
- const selectNode = useCallback((nodeId) => setSelectedNodeId(nodeId), []);
7558
- const clearSelection = useCallback(() => setSelectedNodeId(null), []);
7559
- const value = useMemo(
7560
- () => ({
7561
- selectedNodeId,
7562
- selectNode,
7563
- clearSelection,
7564
- editable,
7565
- draggedNodeId,
7566
- setDraggedNodeId,
7567
- dropTargetNodeId,
7568
- setDropTargetNodeId
7569
- }),
7570
- [selectedNodeId, selectNode, clearSelection, editable, draggedNodeId, dropTargetNodeId]
7571
- );
7572
- return /* @__PURE__ */ jsx(OrgChartContext.Provider, { value, children });
7573
- }
7574
- function useOrgChartContext() {
7575
- const ctx = useContext(OrgChartContext);
7576
- if (!ctx) throw new Error("useOrgChartContext must be used within OrgChartProvider");
7577
- return ctx;
7578
- }
7579
- function NodeActionsProvider({
7580
- children,
7581
- onEditNode,
7582
- onRemoveNode
7583
- }) {
7584
- const value = useMemo(() => ({ onEditNode, onRemoveNode }), [onEditNode, onRemoveNode]);
7585
- return /* @__PURE__ */ jsx(NodeActionsContext.Provider, { value, children });
7586
- }
7587
- function useNodeActions() {
7588
- const ctx = useContext(NodeActionsContext);
7589
- if (!ctx) throw new Error("useNodeActions must be used within NodeActionsProvider");
7590
- return ctx;
7591
- }
7592
- function OrgChartEdge({
7593
- sourceX,
7594
- sourceY,
7595
- targetX,
7596
- targetY,
7597
- sourcePosition,
7598
- targetPosition,
7599
- style = {}
7600
- }) {
7601
- const [edgePath] = getSmoothStepPath({
7602
- sourceX,
7603
- sourceY,
7604
- sourcePosition,
7605
- targetX,
7606
- targetY,
7607
- targetPosition,
7608
- borderRadius: 12
7609
- });
7610
- return /* @__PURE__ */ jsx(BaseEdge, { path: edgePath, style });
7611
- }
7612
- function OrgChartEmpty({ editable, onAddRoot }) {
7613
- return /* @__PURE__ */ jsxs("div", { className: "bg-card border-border/60 flex flex-col items-center justify-center rounded-xl border py-16", children: [
7614
- /* @__PURE__ */ jsx("div", { className: "bg-muted mb-4 flex size-14 items-center justify-center rounded-2xl", children: /* @__PURE__ */ jsx(Network, { className: "text-muted-foreground size-7" }) }),
7615
- /* @__PURE__ */ jsx("h3", { className: "text-foreground text-base font-semibold", children: "No Org Chart Yet" }),
7616
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1.5 max-w-sm text-center text-sm", children: "Build your organization hierarchy by adding the first person." }),
7617
- editable && /* @__PURE__ */ jsxs(Button, { className: "mt-5 gap-1.5", onClick: onAddRoot, children: [
7618
- /* @__PURE__ */ jsx(UserPlus, { className: "size-3.5" }),
7619
- "Add First Member"
7620
- ] })
7621
- ] });
7622
- }
7623
-
7624
- // src/components/org-chart/org-chart-utils.ts
7625
- function getInitials(name) {
7626
- if (!name) return "--";
7627
- const parts = name.trim().split(/\s+/).filter(Boolean);
7628
- if (parts.length === 0) return "--";
7629
- if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
7630
- return (parts[0][0] + parts[1][0]).toUpperCase();
7631
- }
7632
- function OrgChartNodeComponent({ id, data }) {
7633
- const { selectedNodeId, dropTargetNodeId, editable } = useOrgChartContext();
7634
- const { onEditNode, onRemoveNode } = useNodeActions();
7635
- const isSelected = selectedNodeId === id;
7636
- const isDropTarget = dropTargetNodeId === id;
7637
- const [isHovered, setIsHovered] = useState(false);
7638
- const [isMenuOpen, setIsMenuOpen] = useState(false);
7639
- return /* @__PURE__ */ jsxs(
7640
- "div",
7641
- {
7642
- style: { width: NODE_WIDTH },
7643
- className: cn(
7644
- "bg-card dark:bg-muted relative rounded-xl border shadow-sm transition-all",
7645
- "border-border/60",
7646
- isSelected && "ring-primary ring-2 ring-offset-2 dark:ring-offset-zinc-900",
7647
- isDropTarget && "ring-primary/50 border-primary scale-105 ring-2"
7648
- ),
7649
- onMouseEnter: () => setIsHovered(true),
7650
- onMouseLeave: () => setIsHovered(false),
7651
- children: [
7652
- !data.isRoot && /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: "!bg-border !size-2 !rounded-full !border-0" }),
7653
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-4 py-3", children: [
7654
- /* @__PURE__ */ jsxs(Avatar, { className: "size-10 shrink-0", children: [
7655
- data.avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: data.avatarUrl, alt: data.displayName ?? "" }),
7656
- /* @__PURE__ */ jsx(AvatarFallback, { className: "bg-primary/10 text-primary text-xs font-medium", children: getInitials(data.displayName) })
7657
- ] }),
7658
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
7659
- /* @__PURE__ */ jsx("p", { className: "text-foreground truncate text-sm font-semibold", children: data.displayName ?? "Unknown" }),
7660
- data.positionTitle && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground truncate text-xs", children: data.positionTitle })
7661
- ] }),
7662
- editable && (isHovered || isMenuOpen) ? /* @__PURE__ */ jsx("div", { className: "nodrag nopan shrink-0", children: /* @__PURE__ */ jsxs(DropdownMenu, { open: isMenuOpen, onOpenChange: setIsMenuOpen, children: [
7663
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
7664
- Button,
7665
- {
7666
- variant: "ghost",
7667
- size: "icon",
7668
- className: "size-7 rounded-full",
7669
- onClick: (e) => e.stopPropagation(),
7670
- children: /* @__PURE__ */ jsx(Ellipsis, { className: "size-4" })
7671
- }
7672
- ) }),
7673
- /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", side: "right", className: "translate-x-1 -translate-y-3.5", children: [
7674
- /* @__PURE__ */ jsxs(
7675
- DropdownMenuItem,
7676
- {
7677
- onClick: (e) => {
7678
- e.stopPropagation();
7679
- setIsMenuOpen(false);
7680
- onEditNode(data);
7681
- },
7682
- children: [
7683
- /* @__PURE__ */ jsx(Pencil, { className: "mr-2 size-3.5" }),
7684
- "Edit Position"
7685
- ]
7686
- }
7687
- ),
7688
- /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
7689
- /* @__PURE__ */ jsxs(
7690
- DropdownMenuItem,
7691
- {
7692
- className: "text-destructive hover:bg-destructive/10 focus:bg-destructive/10 hover:text-destructive\n focus:text-destructive data-[highlighted]:bg-destructive/10 data-[highlighted]:text-destructive",
7693
- onClick: (e) => {
7694
- e.stopPropagation();
7695
- setIsMenuOpen(false);
7696
- onRemoveNode(data);
7697
- },
7698
- children: [
7699
- /* @__PURE__ */ jsx(Trash2, { className: "mr-2 size-3.5" }),
7700
- "Remove from Chart"
7701
- ]
7702
- }
7703
- )
7704
- ] })
7705
- ] }) }) : data.childCount > 0 && /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "shrink-0 text-[10px]", children: data.childCount })
7706
- ] }),
7707
- /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: "!bg-border !size-2 !rounded-full !border-0" })
7708
- ]
7709
- }
7710
- );
7711
- }
7712
- var OrgChartNodeMemo = memo(OrgChartNodeComponent);
7713
- var FIT_VIEW_OPTIONS = { padding: 0.12 };
7714
- function getDescendantIds(nodeId, nodes) {
7715
- const descendants = /* @__PURE__ */ new Set();
7716
- const queue = [nodeId];
7717
- while (queue.length > 0) {
7718
- const current = queue.pop();
7719
- for (const n of nodes) {
7720
- if (n.data.parentId === current && !descendants.has(n.id)) {
7721
- descendants.add(n.id);
7722
- queue.push(n.id);
7723
- }
7724
- }
7725
- }
7726
- return descendants;
7727
- }
7728
- function mergeWithMeasured(prev, layoutNodes) {
7729
- const prevMap = new Map(prev.map((n) => [n.id, n]));
7730
- return layoutNodes.map((n) => {
7731
- const existing = prevMap.get(n.id);
7732
- if (!existing) return n;
7733
- return existing.data.isRoot !== n.data.isRoot ? n : { ...n, measured: existing.measured };
7734
- });
7735
- }
7736
- function OrgChartInner({
7737
- className,
7738
- edges: controlledEdges,
7739
- defaultEdges,
7740
- isLoading = false,
7741
- editable = true,
7742
- onReparent,
7743
- onAddToChart,
7744
- onEditNode,
7745
- onRemoveNode,
7746
- onReparentSuccess,
7747
- onReparentError
7748
- }) {
7749
- const isControlled = controlledEdges !== void 0;
7750
- const {
7751
- selectNode,
7752
- clearSelection,
7753
- setDraggedNodeId,
7754
- setDropTargetNodeId
7755
- } = useOrgChartContext();
7756
- const [internalEdges, setInternalEdges] = useState(defaultEdges ?? []);
7757
- const defaultEdgesHash = useMemo(
7758
- () => defaultEdges?.map((e) => `${e.id}:${e.parentId}:${e.positionTitle ?? ""}:${e.displayName ?? ""}`).join(",") ?? "",
7759
- [defaultEdges]
7760
- );
7761
- useEffect(() => {
7762
- if (!isControlled && defaultEdges) {
7763
- setInternalEdges(defaultEdges);
7764
- }
7765
- }, [defaultEdgesHash]);
7766
- const apiEdges = controlledEdges ?? internalEdges;
7767
- const layout = useMemo(() => apiEdges.length > 0 ? computeLayout(apiEdges) : null, [apiEdges]);
7768
- const layoutNodes = layout?.nodes ?? [];
7769
- const layoutEdges = layout?.edges ?? [];
7770
- const isEmpty = apiEdges.length === 0 && !isLoading;
7771
- const { fitView, getIntersectingNodes } = useReactFlow();
7772
- const [nodes, setNodes, onNodesChange] = useNodesState([]);
7773
- const [rfEdges, setRfEdges, onEdgesChange] = useEdgesState([]);
7774
- const nodesHash = useMemo(
7775
- () => layoutNodes.map((n) => `${n.id}:${n.data.parentId ?? ""}:${n.data.positionTitle ?? ""}:${n.data.displayName ?? ""}`).join(","),
7776
- [layoutNodes]
7777
- );
7778
- const edgesHash = useMemo(() => layoutEdges.map((e) => `${e.id}:${e.source}:${e.target}`).join(","), [layoutEdges]);
7779
- const fitViewRef = useRef(fitView);
7780
- fitViewRef.current = fitView;
7781
- useEffect(() => {
7782
- setNodes((prev) => mergeWithMeasured(prev, layoutNodes));
7783
- setRfEdges(layoutEdges);
7784
- const raf = requestAnimationFrame(() => fitViewRef.current(FIT_VIEW_OPTIONS));
7785
- return () => cancelAnimationFrame(raf);
7786
- }, [nodesHash, edgesHash]);
7787
- const draggedNodeRef = useRef(null);
7788
- const dropTargetIdRef = useRef(null);
7789
- const nodeTypes = useMemo(() => ({ orgChartNode: OrgChartNodeMemo }), []);
7790
- const edgeTypes = useMemo(() => ({ orgChartEdge: OrgChartEdge }), []);
7791
- const onNodeDragStart = useCallback(
7792
- (_, node) => {
7793
- if (!editable) return;
7794
- draggedNodeRef.current = node.id;
7795
- setDraggedNodeId(node.id);
7796
- },
7797
- [editable, setDraggedNodeId]
7798
- );
7799
- const onNodeDrag = useCallback(
7800
- (_, node) => {
7801
- if (!editable || !draggedNodeRef.current) return;
7802
- const intersecting = getIntersectingNodes(node);
7803
- const target = intersecting.find((n) => n.id !== node.id);
7804
- const targetId = target?.id ?? null;
7805
- if (targetId === dropTargetIdRef.current) return;
7806
- dropTargetIdRef.current = targetId;
7807
- setDropTargetNodeId(targetId);
7808
- },
7809
- [editable, getIntersectingNodes, setDropTargetNodeId]
7810
- );
7811
- const applyOptimisticReparent = useCallback((childId, newParentId) => {
7812
- setInternalEdges(
7813
- (prev) => prev.map((e) => e.id === childId ? { ...e, parentId: newParentId } : e)
7814
- );
7815
- }, []);
7816
- const snapBack = useCallback(() => {
7817
- setNodes((prev) => mergeWithMeasured(prev, layoutNodes));
7818
- }, [layoutNodes, setNodes]);
7819
- const onNodeDragStop = useCallback(
7820
- async (_, _node) => {
7821
- if (!editable || !draggedNodeRef.current) return;
7822
- const childId = draggedNodeRef.current;
7823
- const newParentId = dropTargetIdRef.current;
7824
- draggedNodeRef.current = null;
7825
- dropTargetIdRef.current = null;
7826
- setDraggedNodeId(null);
7827
- setDropTargetNodeId(null);
7828
- if (!newParentId || newParentId === childId) {
7829
- snapBack();
7830
- return;
7831
- }
7832
- if (getDescendantIds(childId, layoutNodes).has(newParentId)) {
7833
- onReparentError?.("Cannot create circular reporting chain");
7834
- snapBack();
7835
- return;
7836
- }
7837
- const draggedData = layoutNodes.find((n) => n.id === childId)?.data;
7838
- if (!draggedData || newParentId === draggedData.parentId) {
7839
- snapBack();
7840
- return;
7841
- }
7842
- const targetName = layoutNodes.find((n) => n.id === newParentId)?.data.displayName;
7843
- const preserve = { positionTitle: draggedData.positionTitle };
7844
- if (!isControlled) {
7845
- const snapshotEdges = internalEdges;
7846
- applyOptimisticReparent(childId, newParentId);
7847
- try {
7848
- await onReparent?.(childId, newParentId, preserve);
7849
- onReparentSuccess?.(draggedData.displayName ?? "Member", targetName ?? "new manager");
7850
- } catch (err) {
7851
- console.error("[OrgChart] reparent failed", err);
7852
- setInternalEdges(snapshotEdges);
7853
- onReparentError?.("Failed to update reporting line");
7854
- }
7855
- } else {
7856
- snapBack();
7857
- try {
7858
- await onReparent?.(childId, newParentId, preserve);
7859
- onReparentSuccess?.(draggedData.displayName ?? "Member", targetName ?? "new manager");
7860
- } catch (err) {
7861
- console.error("[OrgChart] reparent failed", err);
7862
- onReparentError?.("Failed to update reporting line");
7863
- }
7864
- }
7865
- },
7866
- [editable, isControlled, internalEdges, layoutNodes, onReparent, onReparentSuccess, onReparentError, applyOptimisticReparent, snapBack, setDraggedNodeId, setDropTargetNodeId]
7867
- );
7868
- const onNodeClick = useCallback((_, node) => selectNode(node.id), [selectNode]);
7869
- const onPaneClick = useCallback(() => clearSelection(), [clearSelection]);
7870
- const handleEditNode = useCallback(
7871
- (nodeData) => onEditNode?.(nodeData),
7872
- [onEditNode]
7873
- );
7874
- const handleRemoveNode = useCallback(
7875
- (nodeData) => onRemoveNode?.(nodeData),
7876
- [onRemoveNode]
7877
- );
7878
- if (isLoading) {
7879
- return /* @__PURE__ */ jsx("div", { className: "bg-card border-border/60 flex items-center justify-center rounded-xl border p-16", children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground size-6 animate-spin" }) });
7880
- }
7881
- if (isEmpty) {
7882
- return /* @__PURE__ */ jsx(OrgChartEmpty, { editable, onAddRoot: onAddToChart ?? (() => {
7883
- }) });
7884
- }
7885
- return /* @__PURE__ */ jsx(NodeActionsProvider, { onEditNode: handleEditNode, onRemoveNode: handleRemoveNode, children: /* @__PURE__ */ jsx("div", { className: cn("border-border/60 h-[600px] overflow-hidden rounded-xl border", className), children: /* @__PURE__ */ jsxs(
7886
- ReactFlow,
7887
- {
7888
- nodes,
7889
- edges: rfEdges,
7890
- onNodesChange,
7891
- onEdgesChange,
7892
- onNodeClick,
7893
- proOptions: { hideAttribution: true },
7894
- onPaneClick,
7895
- onNodeDragStart,
7896
- onNodeDrag,
7897
- onNodeDragStop,
7898
- nodeTypes,
7899
- edgeTypes,
7900
- fitView: true,
7901
- fitViewOptions: FIT_VIEW_OPTIONS,
7902
- minZoom: 0.3,
7903
- maxZoom: 1.5,
7904
- nodesDraggable: editable,
7905
- nodesConnectable: false,
7906
- elementsSelectable: true,
7907
- selectNodesOnDrag: false,
7908
- panOnDrag: true,
7909
- zoomOnScroll: true,
7910
- preventScrolling: true,
7911
- style: {
7912
- "--xy-background-pattern-dots-color-default": "var(--color-border)",
7913
- "--xy-edge-stroke-width-default": 2,
7914
- "--xy-edge-stroke-default": "var(--color-border)",
7915
- "--xy-edge-stroke-selected-default": "var(--color-foreground)",
7916
- "--xy-attribution-background-color-default": "transparent"
7917
- },
7918
- attributionPosition: "bottom-left",
7919
- children: [
7920
- /* @__PURE__ */ jsx(Background, { variant: BackgroundVariant.Dots, gap: 20, size: 2 }),
7921
- /* @__PURE__ */ jsx(FlowZoomPanel, { fitViewOptions: FIT_VIEW_OPTIONS })
7922
- ]
7923
- }
7924
- ) }) });
7925
- }
7926
- function OrgChart(props) {
7927
- return /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(OrgChartProvider, { editable: props.editable ?? true, children: /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(OrgChartInner, { ...props }) }) }) });
7928
- }
7929
-
7930
- export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Autocomplete, AutocompleteEmpty, AutocompleteInput, AutocompleteItem, AutocompletePopup, AutocompleteSeparator, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardStackProvider, CardStackViewport, CardTitle, Checkbox, CheckboxGroup, Collapsible, CollapsiblePanel as CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, DEFAULT_ANIMATION_CONFIG, DeferredCardContent, Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Dock, DockIcon, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Field, FieldRow, FlickeringGrid, FlowZoomPanel, Form, FormControl, FormControl2 as FormControlComponent, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea, JsonEditor, JsonInput, Label, ModalPortalScope, MotionGrid, MultiSelect, OrgChart, PORTAL_ROOT_ID, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortalRoot, Progress, ProgressiveBlur, ProgressiveBlurScrollContainer, Radio, RadioGroup, Radio as RadioGroupItem, RangeCalendar, RecordPicker, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponsiveDiagram, ScrollArea, ScrollBar, Select, SelectPopup as SelectContent, SelectFieldItem, SelectGroup, SelectGroupLabel, SelectItem, SelectGroupLabel as SelectLabel, SelectPopup, SelectRichItem, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarSeparator, SidebarTrigger, Skeleton, Slot, Slottable, StackBackdrop, StackCard, StackHeader, StackHeaderSlot, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tags, TagsContent, TagsEmpty, TagsGroup, TagsInput, TagsItem, TagsList, TagsTrigger, TagsValue, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UnlinkButton, alertVariants, backdropVariants, badgeVariants, buttonVariants, calculateResponsiveOffset, cardVariants, cn, composeRefs, createCardVariants, createOffsetTransition, createReducedMotionVariants, dockVariants, durations, easings, getCardOffset, getCardZIndex, getCascadeOffset, getResponsiveCardOffset, getSideBySideOffset, getVisibleCardIndices, isCardVisible, mergeProps, normalizeWidth, parseWidthToPixels, peekDragSpring, peekHoverSpring, peekSlideSpring, reducedMotionBackdropVariants, showErrorToast, showInfoToast, showSuccessToast, showWarningToast, snapBackSpring, springs, swipeDismissTransition, toast5 as toast, transitions, useCardIndex, useCardInjectedProps, useCardReady, useCardStack, useControllableState, useFloatingOverlayPortalProps, useFormField, useInModalOverlay, useIsMobile2 as useIsMobile, useIsTopCard, usePeekGestures, usePortalContainer, usePortalContext, useRootPortalContainer, useSidebar, useStackCards, useStackContext, useStackGestures, useStackLayoutMode, useStackResponsive, validateJson, variants };
8349
+ export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppBar, AppShell, Autocomplete, AutocompleteEmpty, AutocompleteInput, AutocompleteItem, AutocompletePopup, AutocompleteSeparator, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardStackProvider, CardStackViewport, CardTitle, Checkbox, CheckboxGroup, Collapsible, CollapsiblePanel as CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, DEFAULT_ANIMATION_CONFIG, DeferredCardContent, Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Dock, DockIcon, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldRow, FieldSeparator, FieldSet, FieldTitle, FlickeringGrid, FlowZoomPanel, Form, FormControl, FormControl2 as FormControlComponent, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea, JsonEditor, JsonInput, Label, MotionGrid, MultiSelect, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Progress, ProgressiveBlur, ProgressiveBlurScrollContainer, Radio, RadioGroup, Radio as RadioGroupItem, RangeCalendar, RecordPicker, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponsiveDiagram, ScrollArea, ScrollBar, Select, SelectPopup as SelectContent, SelectFieldItem, SelectGroup, SelectGroupLabel, SelectItem, SelectGroupLabel as SelectLabel, SelectPopup, SelectRichItem, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slot, Slottable, StackBackdrop, StackCard, StackHeader, StackHeaderSlot, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tags, TagsContent, TagsEmpty, TagsGroup, TagsInput, TagsItem, TagsList, TagsTrigger, TagsValue, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UnlinkButton, alertVariants, backdropVariants, badgeVariants, buttonVariants, calculateResponsiveOffset, cardVariants, cn, composeRefs, createAppLink, createCardVariants, createOffsetTransition, createReducedMotionVariants, dockVariants, durations, easings, getCardOffset, getCardZIndex, getCascadeOffset, getResponsiveCardOffset, getSideBySideOffset, getVisibleCardIndices, isCardVisible, mergeProps, normalizeWidth, parseWidthToPixels, peekDragSpring, peekHoverSpring, peekSlideSpring, reducedMotionBackdropVariants, showErrorToast, showInfoToast, showSuccessToast, showWarningToast, snapBackSpring, springs, swipeDismissTransition, toast5 as toast, transitions, useCardIndex, useCardInjectedProps, useCardReady, useCardStack, useControllableState, useFormField, useIsMobile2 as useIsMobile, useIsTopCard, usePeekGestures, useSidebar, useStackCards, useStackContext, useStackGestures, useStackLayoutMode, useStackResponsive, validateJson, variants };
7931
8350
  //# sourceMappingURL=index.js.map
7932
8351
  //# sourceMappingURL=index.js.map