@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
@@ -1,18 +1,19 @@
1
1
  "use client";
2
- import * as React5 from 'react';
2
+ import * as React3 from 'react';
3
3
  import { cva } from 'class-variance-authority';
4
4
  import { XCircle, XIcon, ChevronDown, SearchIcon, CheckIcon } from 'lucide-react';
5
5
  import { clsx } from 'clsx';
6
6
  import { twMerge } from 'tailwind-merge';
7
7
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
8
8
  import { Popover as Popover$1 } from '@base-ui/react/popover';
9
+ import { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';
9
10
  import { Separator as Separator$1 } from '@base-ui/react/separator';
10
11
 
11
12
  function cn(...inputs) {
12
13
  return twMerge(clsx(inputs));
13
14
  }
14
15
  var badgeVariants = cva(
15
- "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",
16
+ "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",
16
17
  {
17
18
  defaultVariants: {
18
19
  size: "default",
@@ -37,135 +38,23 @@ var badgeVariants = cva(
37
38
  }
38
39
  }
39
40
  );
40
- var Badge = React5.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx("span", { ref, "data-slot": "badge", className: cn(badgeVariants({ variant, size }), className), ...props }));
41
+ var Badge = React3.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx("span", { ref, "data-slot": "badge", className: cn(badgeVariants({ variant, size }), className), ...props }));
41
42
  Badge.displayName = "Badge";
42
- var PORTAL_ROOT_ID = "portal-root";
43
- var PortalContext = React5.createContext({
44
- layer: "base",
45
- depth: 0,
46
- floatingPortalStrategy: "root",
47
- floatingZIndex: "default"
48
- });
49
- function useRootPortalContainer() {
50
- const [container, setContainer] = React5.useState(null);
51
- React5.useLayoutEffect(() => {
52
- const el = document.getElementById(PORTAL_ROOT_ID);
53
- setContainer(el);
54
- }, []);
55
- return container;
56
- }
57
- function useFloatingOverlayPortalProps() {
58
- const rootContainer = useRootPortalContainer();
59
- const { floatingPortalStrategy, floatingZIndex } = React5.useContext(PortalContext);
60
- const container = floatingPortalStrategy === "nested" ? void 0 : rootContainer ?? null;
61
- const zIndexClass = floatingZIndex === "elevated" ? "z-[var(--z-layer-floating-elevated)]" : "z-[var(--z-layer-floating)]";
62
- return { container, zIndexClass };
63
- }
64
- function composeRefs(...refs) {
65
- return (node) => {
66
- refs.forEach((ref) => {
67
- if (typeof ref === "function") {
68
- ref(node);
69
- } else if (ref != null) {
70
- ref.current = node;
71
- }
72
- });
73
- };
74
- }
75
- function mergeProps(slotProps, childProps) {
76
- const overrideProps = { ...childProps };
77
- for (const propName in childProps) {
78
- if (propName === "ref") continue;
79
- const slotPropValue = slotProps[propName];
80
- const childPropValue = childProps[propName];
81
- if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
82
- overrideProps[propName] = (...args) => {
83
- childPropValue(...args);
84
- slotPropValue(...args);
85
- };
86
- } else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
87
- overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
88
- } else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
89
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
90
- }
91
- }
92
- return { ...slotProps, ...overrideProps };
93
- }
94
- function mergePropsWithRef(parentProps, childElement) {
95
- const childProps = childElement.props;
96
- const parentRef = parentProps.ref;
97
- const childRef = childProps.ref;
98
- const mergedProps = mergeProps(parentProps, childProps);
99
- if (parentRef || childRef) {
100
- mergedProps.ref = composeRefs(parentRef, childRef);
101
- }
102
- return mergedProps;
103
- }
104
- function isSlottable(child) {
105
- return React5.isValidElement(child);
106
- }
107
- var Slot = React5.forwardRef((props, forwardedRef) => {
108
- const { children, ...slotProps } = props;
109
- if (isSlottable(children)) {
110
- const childProps = children.props;
111
- const childRef = childProps.ref;
112
- return React5.cloneElement(children, {
113
- ...mergeProps(slotProps, childProps),
114
- ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
115
- });
116
- }
117
- if (React5.Children.count(children) > 1) {
118
- const childrenArray = React5.Children.toArray(children);
119
- const slottableChild = childrenArray.find(
120
- (child) => React5.isValidElement(child) && child.type === Slottable
121
- );
122
- if (slottableChild) {
123
- const newElement = slottableChild.props.children;
124
- if (isSlottable(newElement)) {
125
- const newElementProps = newElement.props;
126
- const newChildren = childrenArray.map((child) => {
127
- if (child === slottableChild) {
128
- return React5.Children.count(newElementProps.children) > 1 ? React5.Children.only(null) : newElementProps.children;
129
- }
130
- return child;
131
- });
132
- const childRef = newElementProps.ref;
133
- return React5.cloneElement(newElement, {
134
- ...mergeProps(slotProps, newElementProps),
135
- ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
136
- children: newChildren
137
- });
138
- }
139
- }
140
- }
141
- return /* @__PURE__ */ jsx(Fragment, { children });
142
- });
143
- Slot.displayName = "Slot";
144
- function Slottable({ children }) {
145
- return /* @__PURE__ */ jsx(Fragment, { children });
146
- }
147
43
  function Popover({ ...props }) {
148
44
  return /* @__PURE__ */ jsx(Popover$1.Root, { "data-slot": "popover", ...props });
149
45
  }
150
- function PopoverTrigger({ asChild, nativeButton, children, ...props }) {
151
- if (asChild && React5.isValidElement(children)) {
152
- return /* @__PURE__ */ jsx(
153
- Popover$1.Trigger,
154
- {
155
- "data-slot": "popover-trigger",
156
- nativeButton: nativeButton ?? true,
157
- ...props,
158
- render: (triggerProps) => {
159
- const { nativeButton: _, ...rest } = triggerProps;
160
- return React5.cloneElement(
161
- children,
162
- mergePropsWithRef(rest, children)
163
- );
164
- }
165
- }
166
- );
167
- }
168
- return /* @__PURE__ */ jsx(Popover$1.Trigger, { "data-slot": "popover-trigger", nativeButton, ...props, children });
46
+ function PopoverTrigger({ asChild, children, render, nativeButton, ...props }) {
47
+ const childRender = render === void 0 && asChild && React3.isValidElement(children) ? children : void 0;
48
+ return /* @__PURE__ */ jsx(
49
+ Popover$1.Trigger,
50
+ {
51
+ "data-slot": "popover-trigger",
52
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
53
+ render: render ?? childRender,
54
+ ...props,
55
+ children: childRender ? void 0 : children
56
+ }
57
+ );
169
58
  }
170
59
  function PopoverContent({
171
60
  className,
@@ -193,11 +82,13 @@ function PopoverContent({
193
82
  {
194
83
  "data-slot": "popover-content",
195
84
  className: cn(
196
- `bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out
197
- data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95
198
- data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2
199
- data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 w-72 rounded-md border p-4
200
- shadow-md outline-hidden`,
85
+ `bg-popover text-popover-foreground origin-(--transform-origin) w-72 rounded-md border p-4 shadow-md outline-hidden
86
+ transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
87
+ data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
88
+ data-[side=bottom]:data-starting-style:-translate-y-2
89
+ data-[side=left]:data-starting-style:translate-x-2
90
+ data-[side=right]:data-starting-style:-translate-x-2
91
+ data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
201
92
  className
202
93
  ),
203
94
  ...props,
@@ -285,7 +176,7 @@ function OptionItem({
285
176
  }
286
177
  );
287
178
  }
288
- var MultiSelect = React5.forwardRef(
179
+ var MultiSelect = React3.forwardRef(
289
180
  ({
290
181
  options,
291
182
  onValueChange,
@@ -311,38 +202,38 @@ var MultiSelect = React5.forwardRef(
311
202
  onClick,
312
203
  ...props
313
204
  }, ref) => {
314
- const [selectedValues, setSelectedValues] = React5.useState(defaultValue);
315
- const [isPopoverOpen, setIsPopoverOpen] = React5.useState(false);
316
- const [searchValue, setSearchValue] = React5.useState("");
317
- const [highlightedIndex, setHighlightedIndex] = React5.useState(-1);
318
- const multiSelectId = React5.useId();
205
+ const [selectedValues, setSelectedValues] = React3.useState(defaultValue);
206
+ const [isPopoverOpen, setIsPopoverOpen] = React3.useState(false);
207
+ const [searchValue, setSearchValue] = React3.useState("");
208
+ const [highlightedIndex, setHighlightedIndex] = React3.useState(-1);
209
+ const multiSelectId = React3.useId();
319
210
  const listboxId = `${multiSelectId}-listbox`;
320
211
  const triggerDescriptionId = `${multiSelectId}-description`;
321
212
  const selectedCountId = `${multiSelectId}-count`;
322
213
  const searchInputId = `${multiSelectId}-search`;
323
- const searchInputRef = React5.useRef(null);
324
- const listRef = React5.useRef(null);
325
- const prevDefaultValueRef = React5.useRef(defaultValue);
326
- const isGroupedOptions = React5.useCallback(
214
+ const searchInputRef = React3.useRef(null);
215
+ const listRef = React3.useRef(null);
216
+ const prevDefaultValueRef = React3.useRef(defaultValue);
217
+ const isGroupedOptions = React3.useCallback(
327
218
  (opts) => {
328
219
  return opts.length > 0 && "heading" in opts[0];
329
220
  },
330
221
  []
331
222
  );
332
- const arraysEqual = React5.useCallback((a, b) => {
223
+ const arraysEqual = React3.useCallback((a, b) => {
333
224
  if (a.length !== b.length) return false;
334
225
  const sortedA = [...a].sort();
335
226
  const sortedB = [...b].sort();
336
227
  return sortedA.every((val, index) => val === sortedB[index]);
337
228
  }, []);
338
- const resetToDefault = React5.useCallback(() => {
229
+ const resetToDefault = React3.useCallback(() => {
339
230
  setSelectedValues(defaultValue);
340
231
  setIsPopoverOpen(false);
341
232
  setSearchValue("");
342
233
  onValueChange(defaultValue);
343
234
  }, [defaultValue, onValueChange]);
344
- const buttonRef = React5.useRef(null);
345
- React5.useImperativeHandle(
235
+ const buttonRef = React3.useRef(null);
236
+ React3.useImperativeHandle(
346
237
  ref,
347
238
  () => ({
348
239
  reset: resetToDefault,
@@ -373,8 +264,8 @@ var MultiSelect = React5.forwardRef(
373
264
  }),
374
265
  [resetToDefault, selectedValues, onValueChange]
375
266
  );
376
- const [screenSize, setScreenSize] = React5.useState("desktop");
377
- React5.useEffect(() => {
267
+ const [screenSize, setScreenSize] = React3.useState("desktop");
268
+ React3.useEffect(() => {
378
269
  if (typeof window === "undefined") return;
379
270
  const handleResize = () => {
380
271
  const width = window.innerWidth;
@@ -423,7 +314,7 @@ var MultiSelect = React5.forwardRef(
423
314
  };
424
315
  };
425
316
  const responsiveSettings = getResponsiveSettings();
426
- const getAllOptions = React5.useCallback(() => {
317
+ const getAllOptions = React3.useCallback(() => {
427
318
  if (options.length === 0) return [];
428
319
  let allOptions;
429
320
  if (isGroupedOptions(options)) {
@@ -453,7 +344,7 @@ var MultiSelect = React5.forwardRef(
453
344
  }
454
345
  return deduplicateOptions ? uniqueOptions : allOptions;
455
346
  }, [options, deduplicateOptions, isGroupedOptions]);
456
- const getOptionByValue = React5.useCallback(
347
+ const getOptionByValue = React3.useCallback(
457
348
  (value) => {
458
349
  const option = getAllOptions().find((option2) => option2.value === value);
459
350
  if (!option && process.env.NODE_ENV === "development") {
@@ -463,7 +354,7 @@ var MultiSelect = React5.forwardRef(
463
354
  },
464
355
  [getAllOptions]
465
356
  );
466
- const filteredOptions = React5.useMemo(() => {
357
+ const filteredOptions = React3.useMemo(() => {
467
358
  if (!searchable || !searchValue) return options;
468
359
  if (options.length === 0) return [];
469
360
  if (isGroupedOptions(options)) {
@@ -478,13 +369,13 @@ var MultiSelect = React5.forwardRef(
478
369
  (option) => option.label.toLowerCase().includes(searchValue.toLowerCase()) || option.value.toLowerCase().includes(searchValue.toLowerCase())
479
370
  );
480
371
  }, [options, searchValue, searchable, isGroupedOptions]);
481
- const flatFilteredOptions = React5.useMemo(() => {
372
+ const flatFilteredOptions = React3.useMemo(() => {
482
373
  if (isGroupedOptions(filteredOptions)) {
483
374
  return filteredOptions.flatMap((group) => group.options);
484
375
  }
485
376
  return filteredOptions;
486
377
  }, [filteredOptions, isGroupedOptions]);
487
- const toggleOption = React5.useCallback(
378
+ const toggleOption = React3.useCallback(
488
379
  (optionValue) => {
489
380
  if (disabled) return;
490
381
  const option = getOptionByValue(optionValue);
@@ -513,7 +404,7 @@ var MultiSelect = React5.forwardRef(
513
404
  setSelectedValues(newSelectedValues);
514
405
  onValueChange(newSelectedValues);
515
406
  };
516
- const handleKeyDown = React5.useCallback(
407
+ const handleKeyDown = React3.useCallback(
517
408
  (event) => {
518
409
  const optionsCount = flatFilteredOptions.length;
519
410
  if (optionsCount === 0) return;
@@ -551,7 +442,7 @@ var MultiSelect = React5.forwardRef(
551
442
  },
552
443
  [flatFilteredOptions, highlightedIndex, toggleOption, searchValue, selectedValues, onValueChange]
553
444
  );
554
- React5.useEffect(() => {
445
+ React3.useEffect(() => {
555
446
  if (!resetOnDefaultValueChange) return;
556
447
  const prevDefaultValue = prevDefaultValueRef.current;
557
448
  if (!arraysEqual(prevDefaultValue, defaultValue)) {
@@ -572,17 +463,17 @@ var MultiSelect = React5.forwardRef(
572
463
  };
573
464
  };
574
465
  const widthConstraints = getWidthConstraints();
575
- const effectiveDropdownMaxHeight = React5.useMemo(() => {
466
+ const effectiveDropdownMaxHeight = React3.useMemo(() => {
576
467
  if (dropdownMaxHeight) return dropdownMaxHeight;
577
468
  return screenSize === "mobile" ? "70vh" : "60vh";
578
469
  }, [dropdownMaxHeight, screenSize]);
579
- React5.useEffect(() => {
470
+ React3.useEffect(() => {
580
471
  if (!isPopoverOpen) {
581
472
  setSearchValue("");
582
473
  setHighlightedIndex(-1);
583
474
  }
584
475
  }, [isPopoverOpen]);
585
- React5.useEffect(() => {
476
+ React3.useEffect(() => {
586
477
  if (isPopoverOpen && searchable && searchInputRef.current) {
587
478
  const timer = setTimeout(() => {
588
479
  searchInputRef.current?.focus();
@@ -590,10 +481,10 @@ var MultiSelect = React5.forwardRef(
590
481
  return () => clearTimeout(timer);
591
482
  }
592
483
  }, [isPopoverOpen, searchable]);
593
- React5.useEffect(() => {
484
+ React3.useEffect(() => {
594
485
  setHighlightedIndex(flatFilteredOptions.length > 0 ? 0 : -1);
595
486
  }, [searchValue, flatFilteredOptions.length]);
596
- const totalFilteredCount = React5.useMemo(() => {
487
+ const totalFilteredCount = React3.useMemo(() => {
597
488
  if (isGroupedOptions(filteredOptions)) {
598
489
  return filteredOptions.reduce((acc, group) => acc + group.options.length, 0);
599
490
  }
@@ -623,8 +514,9 @@ var MultiSelect = React5.forwardRef(
623
514
  "aria-label": `Multi-select: ${selectedValues.length} of ${getAllOptions().length} options selected. ${placeholder}`,
624
515
  className: cn(
625
516
  `border-input/70 focus-visible:border-primary/60 focus-visible:ring-primary/20 flex items-center
626
- justify-between rounded-md border bg-transparent pr-1 pl-2 shadow-xs transition-[color,box-shadow]
627
- outline-none focus-visible:ring-[3px] active:scale-100 disabled:pointer-events-none disabled:opacity-50`,
517
+ justify-between rounded-md border bg-transparent pr-1 pl-2 shadow-xs transition-[color,box-shadow,scale]
518
+ duration-150 ease-out outline-none focus-visible:ring-[3px] motion-safe:active:not-disabled:scale-[0.96]
519
+ motion-reduce:transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50`,
628
520
  singleLine ? "h-8 min-h-8 py-0.5 text-xs" : "h-auto min-h-10 py-2 text-sm",
629
521
  autoSize && "w-auto",
630
522
  !autoSize && "w-full",