@constructive-io/ui 0.4.1 → 0.6.1

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 (415) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -22
  3. package/dist/button-D4vqTxhp.d.cts +20 -0
  4. package/dist/button-D4vqTxhp.d.ts +20 -0
  5. package/dist/components/alert-dialog.cjs +129 -0
  6. package/dist/components/alert-dialog.cjs.map +1 -0
  7. package/dist/components/alert-dialog.d.cts +33 -0
  8. package/dist/components/alert-dialog.d.ts +23 -21
  9. package/dist/components/alert-dialog.js +98 -296
  10. package/dist/components/alert-dialog.js.map +1 -1
  11. package/dist/components/alert.cjs +62 -0
  12. package/dist/components/alert.cjs.map +1 -0
  13. package/dist/components/alert.d.cts +19 -0
  14. package/dist/components/alert.d.ts +18 -13
  15. package/dist/components/alert.js +49 -31
  16. package/dist/components/alert.js.map +1 -1
  17. package/dist/components/app-bar.cjs +81 -0
  18. package/dist/components/app-bar.cjs.map +1 -0
  19. package/dist/components/app-bar.d.cts +27 -0
  20. package/dist/components/app-bar.d.ts +27 -0
  21. package/dist/components/app-bar.js +77 -0
  22. package/dist/components/app-bar.js.map +1 -0
  23. package/dist/components/app-shell.cjs +267 -0
  24. package/dist/components/app-shell.cjs.map +1 -0
  25. package/dist/components/app-shell.d.cts +98 -0
  26. package/dist/components/app-shell.d.ts +98 -0
  27. package/dist/components/app-shell.js +264 -0
  28. package/dist/components/app-shell.js.map +1 -0
  29. package/dist/components/autocomplete.cjs +167 -0
  30. package/dist/components/autocomplete.cjs.map +1 -0
  31. package/dist/components/autocomplete.d.cts +28 -0
  32. package/dist/components/autocomplete.d.ts +24 -24
  33. package/dist/components/autocomplete.js +146 -397
  34. package/dist/components/autocomplete.js.map +1 -1
  35. package/dist/components/avatar.cjs +39 -0
  36. package/dist/components/avatar.cjs.map +1 -0
  37. package/dist/components/avatar.d.cts +13 -0
  38. package/dist/components/avatar.d.ts +11 -11
  39. package/dist/components/avatar.js +24 -27
  40. package/dist/components/avatar.js.map +1 -1
  41. package/dist/components/badge.cjs +48 -0
  42. package/dist/components/badge.cjs.map +1 -0
  43. package/dist/components/badge.d.cts +15 -0
  44. package/dist/components/badge.d.ts +13 -13
  45. package/dist/components/badge.js +39 -38
  46. package/dist/components/badge.js.map +1 -1
  47. package/dist/components/breadcrumb.cjs +89 -0
  48. package/dist/components/breadcrumb.cjs.map +1 -0
  49. package/dist/components/breadcrumb.d.cts +15 -0
  50. package/dist/components/breadcrumb.d.ts +14 -13
  51. package/dist/components/breadcrumb.js +63 -137
  52. package/dist/components/breadcrumb.js.map +1 -1
  53. package/dist/components/button.cjs +75 -0
  54. package/dist/components/button.cjs.map +1 -0
  55. package/dist/components/button.d.cts +2 -0
  56. package/dist/components/button.d.ts +2 -17
  57. package/dist/components/button.js +66 -57
  58. package/dist/components/button.js.map +1 -1
  59. package/dist/components/calendar-rac.cjs +72 -0
  60. package/dist/components/calendar-rac.cjs.map +1 -0
  61. package/dist/components/calendar-rac.d.cts +13 -0
  62. package/dist/components/calendar-rac.d.ts +8 -8
  63. package/dist/components/calendar-rac.js +49 -61
  64. package/dist/components/calendar-rac.js.map +1 -1
  65. package/dist/components/card.cjs +86 -0
  66. package/dist/components/card.cjs.map +1 -0
  67. package/dist/components/card.d.cts +17 -0
  68. package/dist/components/card.d.ts +15 -17
  69. package/dist/components/card.js +58 -57
  70. package/dist/components/card.js.map +1 -1
  71. package/dist/components/checkbox-group.cjs +19 -0
  72. package/dist/components/checkbox-group.cjs.map +1 -0
  73. package/dist/components/checkbox-group.d.cts +7 -0
  74. package/dist/components/checkbox-group.d.ts +5 -5
  75. package/dist/components/checkbox-group.js +12 -10
  76. package/dist/components/checkbox-group.js.map +1 -1
  77. package/dist/components/checkbox.cjs +67 -0
  78. package/dist/components/checkbox.cjs.map +1 -0
  79. package/dist/components/checkbox.d.cts +8 -0
  80. package/dist/components/checkbox.d.ts +6 -6
  81. package/dist/components/checkbox.js +58 -61
  82. package/dist/components/checkbox.js.map +1 -1
  83. package/dist/components/collapsible.cjs +90 -0
  84. package/dist/components/collapsible.cjs.map +1 -0
  85. package/dist/components/collapsible.d.cts +45 -0
  86. package/dist/components/collapsible.d.ts +19 -28
  87. package/dist/components/collapsible.js +74 -112
  88. package/dist/components/collapsible.js.map +1 -1
  89. package/dist/components/combobox.cjs +257 -0
  90. package/dist/components/combobox.cjs.map +1 -0
  91. package/dist/components/combobox.d.cts +44 -0
  92. package/dist/components/combobox.d.ts +36 -36
  93. package/dist/components/combobox.js +229 -515
  94. package/dist/components/combobox.js.map +1 -1
  95. package/dist/components/command.cjs +139 -0
  96. package/dist/components/command.cjs.map +1 -0
  97. package/dist/components/command.d.cts +24 -0
  98. package/dist/components/command.d.ts +22 -22
  99. package/dist/components/command.js +109 -240
  100. package/dist/components/command.js.map +1 -1
  101. package/dist/components/dialog.cjs +139 -0
  102. package/dist/components/dialog.cjs.map +1 -0
  103. package/dist/components/dialog.d.cts +31 -0
  104. package/dist/components/dialog.d.ts +27 -31
  105. package/dist/components/dialog.js +112 -429
  106. package/dist/components/dialog.js.map +1 -1
  107. package/dist/components/dock.cjs +90 -0
  108. package/dist/components/dock.cjs.map +1 -0
  109. package/dist/components/dock.d.cts +30 -0
  110. package/dist/components/dock.d.ts +25 -26
  111. package/dist/components/dock.js +78 -104
  112. package/dist/components/dock.js.map +1 -1
  113. package/dist/components/drawer.cjs +115 -0
  114. package/dist/components/drawer.cjs.map +1 -0
  115. package/dist/components/drawer.d.cts +16 -0
  116. package/dist/components/drawer.d.ts +15 -15
  117. package/dist/components/drawer.js +77 -121
  118. package/dist/components/drawer.js.map +1 -1
  119. package/dist/components/dropdown-menu.cjs +217 -0
  120. package/dist/components/dropdown-menu.cjs.map +1 -0
  121. package/dist/components/dropdown-menu.d.cts +53 -0
  122. package/dist/components/dropdown-menu.d.ts +49 -46
  123. package/dist/components/dropdown-menu.js +177 -357
  124. package/dist/components/dropdown-menu.js.map +1 -1
  125. package/dist/components/empty.cjs +72 -0
  126. package/dist/components/empty.cjs.map +1 -0
  127. package/dist/components/empty.d.cts +15 -0
  128. package/dist/components/empty.d.ts +15 -0
  129. package/dist/components/empty.js +64 -0
  130. package/dist/components/empty.js.map +1 -0
  131. package/dist/components/field.cjs +186 -0
  132. package/dist/components/field.cjs.map +1 -0
  133. package/dist/components/field.d.cts +46 -0
  134. package/dist/components/field.d.ts +44 -49
  135. package/dist/components/field.js +166 -108
  136. package/dist/components/field.js.map +1 -1
  137. package/dist/components/flickering-grid.cjs +153 -0
  138. package/dist/components/flickering-grid.cjs.map +1 -0
  139. package/dist/components/flickering-grid.d.cts +16 -0
  140. package/dist/components/flickering-grid.d.ts +14 -13
  141. package/dist/components/flickering-grid.js +144 -141
  142. package/dist/components/flickering-grid.js.map +1 -1
  143. package/dist/components/flow-zoom-panel.cjs +62 -0
  144. package/dist/components/flow-zoom-panel.cjs.map +1 -0
  145. package/dist/components/flow-zoom-panel.d.cts +12 -0
  146. package/dist/components/flow-zoom-panel.d.ts +12 -0
  147. package/dist/components/flow-zoom-panel.js +61 -0
  148. package/dist/components/flow-zoom-panel.js.map +1 -0
  149. package/dist/components/form-control.cjs +65 -0
  150. package/dist/components/form-control.cjs.map +1 -0
  151. package/dist/components/form-control.d.cts +15 -0
  152. package/dist/components/form-control.d.ts +11 -11
  153. package/dist/components/form-control.js +56 -167
  154. package/dist/components/form-control.js.map +1 -1
  155. package/dist/components/form.cjs +102 -0
  156. package/dist/components/form.cjs.map +1 -0
  157. package/dist/components/form.d.cts +2 -0
  158. package/dist/components/form.d.ts +2 -37
  159. package/dist/components/form.js +76 -163
  160. package/dist/components/form.js.map +1 -1
  161. package/dist/components/input-group.cjs +70 -0
  162. package/dist/components/input-group.cjs.map +1 -0
  163. package/dist/components/input-group.d.cts +16 -0
  164. package/dist/components/input-group.d.ts +14 -16
  165. package/dist/components/input-group.js +51 -163
  166. package/dist/components/input-group.js.map +1 -1
  167. package/dist/components/input.cjs +37 -0
  168. package/dist/components/input.cjs.map +1 -0
  169. package/dist/components/input.d.cts +2 -0
  170. package/dist/components/input.d.ts +2 -11
  171. package/dist/components/input.js +30 -54
  172. package/dist/components/input.js.map +1 -1
  173. package/dist/components/json-input.cjs +147 -0
  174. package/dist/components/json-input.cjs.map +1 -0
  175. package/dist/components/json-input.d.cts +26 -0
  176. package/dist/components/json-input.d.ts +20 -19
  177. package/dist/components/json-input.js +132 -340
  178. package/dist/components/json-input.js.map +1 -1
  179. package/dist/components/label.cjs +27 -0
  180. package/dist/components/label.cjs.map +1 -0
  181. package/dist/components/label.d.cts +11 -0
  182. package/dist/components/label.d.ts +6 -6
  183. package/dist/components/label.js +17 -20
  184. package/dist/components/label.js.map +1 -1
  185. package/dist/components/motion-grid.cjs +68 -0
  186. package/dist/components/motion-grid.cjs.map +1 -0
  187. package/dist/components/motion-grid.d.cts +20 -0
  188. package/dist/components/motion-grid.d.ts +15 -15
  189. package/dist/components/motion-grid.js +59 -75
  190. package/dist/components/motion-grid.js.map +1 -1
  191. package/dist/components/multi-select.cjs +573 -0
  192. package/dist/components/multi-select.cjs.map +1 -0
  193. package/dist/components/multi-select.d.cts +198 -0
  194. package/dist/components/multi-select.d.ts +173 -173
  195. package/dist/components/multi-select.js +562 -874
  196. package/dist/components/multi-select.js.map +1 -1
  197. package/dist/components/page-header.cjs +30 -0
  198. package/dist/components/page-header.cjs.map +1 -0
  199. package/dist/components/page-header.d.cts +17 -0
  200. package/dist/components/page-header.d.ts +11 -11
  201. package/dist/components/page-header.js +23 -11
  202. package/dist/components/page-header.js.map +1 -1
  203. package/dist/components/pagination.cjs +95 -0
  204. package/dist/components/pagination.cjs.map +1 -0
  205. package/dist/components/pagination.d.cts +17 -0
  206. package/dist/components/pagination.d.ts +15 -17
  207. package/dist/components/pagination.js +70 -128
  208. package/dist/components/pagination.js.map +1 -1
  209. package/dist/components/popover.cjs +97 -0
  210. package/dist/components/popover.cjs.map +1 -0
  211. package/dist/components/popover.d.cts +40 -0
  212. package/dist/components/popover.d.ts +33 -28
  213. package/dist/components/popover.js +78 -178
  214. package/dist/components/popover.js.map +1 -1
  215. package/dist/components/portal.cjs +156 -0
  216. package/dist/components/portal.cjs.map +1 -0
  217. package/dist/components/portal.d.cts +118 -0
  218. package/dist/components/portal.d.ts +33 -23
  219. package/dist/components/portal.js +128 -57
  220. package/dist/components/portal.js.map +1 -1
  221. package/dist/components/progress.cjs +30 -0
  222. package/dist/components/progress.cjs.map +1 -0
  223. package/dist/components/progress.d.cts +10 -0
  224. package/dist/components/progress.d.ts +8 -8
  225. package/dist/components/progress.js +21 -24
  226. package/dist/components/progress.js.map +1 -1
  227. package/dist/components/progressive-blur-scroll-container.cjs +76 -0
  228. package/dist/components/progressive-blur-scroll-container.cjs.map +1 -0
  229. package/dist/components/progressive-blur-scroll-container.d.cts +25 -0
  230. package/dist/components/progressive-blur-scroll-container.d.ts +19 -19
  231. package/dist/components/progressive-blur-scroll-container.js +70 -137
  232. package/dist/components/progressive-blur-scroll-container.js.map +1 -1
  233. package/dist/components/progressive-blur.cjs +46 -0
  234. package/dist/components/progressive-blur.cjs.map +1 -0
  235. package/dist/components/progressive-blur.d.cts +17 -0
  236. package/dist/components/progressive-blur.d.ts +15 -14
  237. package/dist/components/progressive-blur.js +38 -63
  238. package/dist/components/progressive-blur.js.map +1 -1
  239. package/dist/components/radio-group.cjs +38 -0
  240. package/dist/components/radio-group.cjs.map +1 -0
  241. package/dist/components/radio-group.d.cts +10 -0
  242. package/dist/components/radio-group.d.ts +8 -8
  243. package/dist/components/radio-group.js +28 -30
  244. package/dist/components/radio-group.js.map +1 -1
  245. package/dist/components/record-picker.cjs +8 -0
  246. package/dist/components/record-picker.d.cts +16 -0
  247. package/dist/components/record-picker.d.ts +13 -13
  248. package/dist/components/record-picker.js +5 -364
  249. package/dist/components/resizable.cjs +50 -0
  250. package/dist/components/resizable.cjs.map +1 -0
  251. package/dist/components/resizable.d.cts +11 -0
  252. package/dist/components/resizable.d.ts +10 -10
  253. package/dist/components/resizable.js +29 -37
  254. package/dist/components/resizable.js.map +1 -1
  255. package/dist/components/responsive-diagram.cjs +56 -0
  256. package/dist/components/responsive-diagram.cjs.map +1 -0
  257. package/dist/components/responsive-diagram.d.cts +10 -0
  258. package/dist/components/responsive-diagram.d.ts +7 -7
  259. package/dist/components/responsive-diagram.js +50 -60
  260. package/dist/components/responsive-diagram.js.map +1 -1
  261. package/dist/components/scroll-area.cjs +46 -0
  262. package/dist/components/scroll-area.cjs.map +1 -0
  263. package/dist/components/scroll-area.d.cts +12 -0
  264. package/dist/components/scroll-area.d.ts +11 -11
  265. package/dist/components/scroll-area.js +35 -62
  266. package/dist/components/scroll-area.js.map +1 -1
  267. package/dist/components/select.cjs +204 -0
  268. package/dist/components/select.cjs.map +1 -0
  269. package/dist/components/select.d.cts +47 -0
  270. package/dist/components/select.d.ts +38 -38
  271. package/dist/components/select.js +172 -269
  272. package/dist/components/select.js.map +1 -1
  273. package/dist/components/separator.cjs +23 -0
  274. package/dist/components/separator.cjs.map +1 -0
  275. package/dist/components/separator.d.cts +2 -0
  276. package/dist/components/separator.d.ts +2 -11
  277. package/dist/components/separator.js +14 -18
  278. package/dist/components/separator.js.map +1 -1
  279. package/dist/components/sheet.cjs +19 -0
  280. package/dist/components/sheet.d.cts +107 -0
  281. package/dist/components/sheet.d.ts +85 -90
  282. package/dist/components/sheet.js +3 -598
  283. package/dist/components/sidebar.cjs +29 -0
  284. package/dist/components/sidebar.d.cts +67 -0
  285. package/dist/components/sidebar.d.ts +63 -73
  286. package/dist/components/sidebar.js +3 -1215
  287. package/dist/components/skeleton.cjs +24 -0
  288. package/dist/components/skeleton.cjs.map +1 -0
  289. package/dist/components/skeleton.d.cts +11 -0
  290. package/dist/components/skeleton.d.ts +10 -6
  291. package/dist/components/skeleton.js +15 -10
  292. package/dist/components/skeleton.js.map +1 -1
  293. package/dist/components/sonner.cjs +23 -0
  294. package/dist/components/sonner.cjs.map +1 -0
  295. package/dist/components/sonner.d.cts +10 -0
  296. package/dist/components/sonner.d.ts +7 -7
  297. package/dist/components/sonner.js +17 -18
  298. package/dist/components/sonner.js.map +1 -1
  299. package/dist/components/stack/index.cjs +44 -0
  300. package/dist/components/stack/index.d.cts +2 -0
  301. package/dist/components/stack/index.d.ts +2 -674
  302. package/dist/components/stack/index.js +3 -1444
  303. package/dist/components/stepper.cjs +160 -0
  304. package/dist/components/stepper.cjs.map +1 -0
  305. package/dist/components/stepper.d.cts +32 -0
  306. package/dist/components/stepper.d.ts +27 -25
  307. package/dist/components/stepper.js +133 -261
  308. package/dist/components/stepper.js.map +1 -1
  309. package/dist/components/switch.cjs +35 -0
  310. package/dist/components/switch.cjs.map +1 -0
  311. package/dist/components/switch.d.cts +8 -0
  312. package/dist/components/switch.d.ts +7 -7
  313. package/dist/components/switch.js +26 -34
  314. package/dist/components/switch.js.map +1 -1
  315. package/dist/components/table.cjs +85 -0
  316. package/dist/components/table.cjs.map +1 -0
  317. package/dist/components/table.d.cts +23 -0
  318. package/dist/components/table.d.ts +23 -15
  319. package/dist/components/table.js +56 -46
  320. package/dist/components/table.js.map +1 -1
  321. package/dist/components/tabs.cjs +49 -0
  322. package/dist/components/tabs.cjs.map +1 -0
  323. package/dist/components/tabs.d.cts +10 -0
  324. package/dist/components/tabs.d.ts +9 -9
  325. package/dist/components/tabs.js +31 -36
  326. package/dist/components/tabs.js.map +1 -1
  327. package/dist/components/tags.cjs +132 -0
  328. package/dist/components/tags.cjs.map +1 -0
  329. package/dist/components/tags.d.cts +36 -0
  330. package/dist/components/tags.d.ts +24 -28
  331. package/dist/components/tags.js +114 -438
  332. package/dist/components/tags.js.map +1 -1
  333. package/dist/components/textarea.cjs +34 -0
  334. package/dist/components/textarea.cjs.map +1 -0
  335. package/dist/components/textarea.d.cts +10 -0
  336. package/dist/components/textarea.d.ts +8 -8
  337. package/dist/components/textarea.js +27 -48
  338. package/dist/components/textarea.js.map +1 -1
  339. package/dist/components/toast/index.cjs +9 -0
  340. package/dist/components/toast/index.d.cts +2 -0
  341. package/dist/components/toast/index.d.ts +2 -52
  342. package/dist/components/toast/index.js +3 -623
  343. package/dist/components/tooltip.cjs +67 -0
  344. package/dist/components/tooltip.cjs.map +1 -0
  345. package/dist/components/tooltip.d.cts +2 -0
  346. package/dist/components/tooltip.d.ts +2 -29
  347. package/dist/components/tooltip.js +53 -166
  348. package/dist/components/tooltip.js.map +1 -1
  349. package/dist/components/unlink-button.cjs +24 -0
  350. package/dist/components/unlink-button.cjs.map +1 -0
  351. package/dist/components/unlink-button.d.cts +14 -0
  352. package/dist/components/unlink-button.d.ts +11 -11
  353. package/dist/components/unlink-button.js +18 -86
  354. package/dist/components/unlink-button.js.map +1 -1
  355. package/dist/form-DgRTv7O7.d.ts +54 -0
  356. package/dist/form-DoZEWSzb.d.cts +54 -0
  357. package/dist/index-CjA4CENl.d.cts +684 -0
  358. package/dist/index-CjA4CENl.d.ts +684 -0
  359. package/dist/index-UnM04j0t.d.cts +58 -0
  360. package/dist/index-UnM04j0t.d.ts +58 -0
  361. package/dist/index.cjs +408 -9346
  362. package/dist/index.d.cts +224 -2548
  363. package/dist/index.d.ts +224 -2548
  364. package/dist/index.js +65 -9022
  365. package/dist/input-CBrCuMH8.d.cts +11 -0
  366. package/dist/input-CBrCuMH8.d.ts +11 -0
  367. package/dist/motion-config-COCFHq1L.cjs +271 -0
  368. package/dist/motion-config-COCFHq1L.cjs.map +1 -0
  369. package/dist/motion-config-COsZ6azM.js +241 -0
  370. package/dist/motion-config-COsZ6azM.js.map +1 -0
  371. package/dist/record-picker-BbxngCeV.js +162 -0
  372. package/dist/record-picker-BbxngCeV.js.map +1 -0
  373. package/dist/record-picker-Bz4FApxD.cjs +167 -0
  374. package/dist/record-picker-Bz4FApxD.cjs.map +1 -0
  375. package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
  376. package/dist/separator-BQEsr0Rc.d.cts +11 -0
  377. package/dist/separator-BQEsr0Rc.d.ts +11 -0
  378. package/dist/sheet-BLHnhLRH.js +425 -0
  379. package/dist/sheet-BLHnhLRH.js.map +1 -0
  380. package/dist/sheet-BdA0rfIz.cjs +515 -0
  381. package/dist/sheet-BdA0rfIz.cjs.map +1 -0
  382. package/dist/sidebar-CPy_fibW.cjs +608 -0
  383. package/dist/sidebar-CPy_fibW.cjs.map +1 -0
  384. package/dist/sidebar-Cfax0g0_.js +463 -0
  385. package/dist/sidebar-Cfax0g0_.js.map +1 -0
  386. package/dist/slot-C-jEfihz.cjs +122 -0
  387. package/dist/slot-C-jEfihz.cjs.map +1 -0
  388. package/dist/slot-EL8zfLG0.js +97 -0
  389. package/dist/slot-EL8zfLG0.js.map +1 -0
  390. package/dist/stack-DKdvlOM6.cjs +1771 -0
  391. package/dist/stack-DKdvlOM6.cjs.map +1 -0
  392. package/dist/stack-jMdxDrex.js +1531 -0
  393. package/dist/stack-jMdxDrex.js.map +1 -0
  394. package/dist/toast-D6MqijT2.cjs +316 -0
  395. package/dist/toast-D6MqijT2.cjs.map +1 -0
  396. package/dist/toast-D_BOLzm3.js +287 -0
  397. package/dist/toast-D_BOLzm3.js.map +1 -0
  398. package/dist/tooltip-CTRQoN1A.d.cts +29 -0
  399. package/dist/tooltip-CTRQoN1A.d.ts +29 -0
  400. package/dist/utils-BkMLyah9.js +12 -0
  401. package/dist/utils-BkMLyah9.js.map +1 -0
  402. package/dist/utils-CzTQ3-VI.cjs +17 -0
  403. package/dist/utils-CzTQ3-VI.cjs.map +1 -0
  404. package/package.json +288 -47
  405. package/src/styles/globals.css +155 -203
  406. package/dist/components/org-chart/index.d.ts +0 -54
  407. package/dist/components/org-chart/index.js +0 -861
  408. package/dist/components/org-chart/index.js.map +0 -1
  409. package/dist/components/record-picker.js.map +0 -1
  410. package/dist/components/sheet.js.map +0 -1
  411. package/dist/components/sidebar.js.map +0 -1
  412. package/dist/components/stack/index.js.map +0 -1
  413. package/dist/components/toast/index.js.map +0 -1
  414. package/dist/index.cjs.map +0 -1
  415. package/dist/index.js.map +0 -1
@@ -1,35 +1,31 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
- import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
4
-
1
+ import * as React$1 from "react";
2
+ import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
3
+ //#region src/components/dialog.d.ts
5
4
  declare const Dialog: typeof Dialog$1.Root;
6
- declare function DialogPortal({ keepMounted, ...props }: Dialog$1.Portal.Props): react_jsx_runtime.JSX.Element;
7
- type DialogTriggerProps = Omit<React.ComponentProps<typeof Dialog$1.Trigger>, "render" | "nativeButton"> & {
8
- /** When true, merges props onto the child element instead of rendering a button */
9
- asChild?: boolean;
10
- /** Whether the child renders a native button. Defaults to true when asChild is used. */
11
- nativeButton?: boolean;
5
+ declare function DialogPortal({ container: containerProp, ...props }: Dialog$1.Portal.Props): React$1.JSX.Element;
6
+ type DialogTriggerProps = React$1.ComponentProps<typeof Dialog$1.Trigger> & {
7
+ /** When true, merges props onto the child element instead of rendering a button */
8
+ asChild?: boolean;
12
9
  };
13
- declare function DialogTrigger({ asChild, nativeButton, children, ...props }: DialogTriggerProps): react_jsx_runtime.JSX.Element;
14
- type DialogCloseProps = Omit<React.ComponentProps<typeof Dialog$1.Close>, "render" | "nativeButton"> & {
15
- /** When true, merges props onto the child element instead of rendering a button */
16
- asChild?: boolean;
17
- /** Whether the child renders a native button. Defaults to true when asChild is used. */
18
- nativeButton?: boolean;
10
+ declare function DialogTrigger({ asChild, children, render, nativeButton, ...props }: DialogTriggerProps): React$1.JSX.Element;
11
+ type DialogCloseProps = React$1.ComponentProps<typeof Dialog$1.Close> & {
12
+ /** When true, merges props onto the child element instead of rendering a button */
13
+ asChild?: boolean;
19
14
  };
20
- declare function DialogClose({ asChild, nativeButton, children, ...props }: DialogCloseProps): react_jsx_runtime.JSX.Element;
21
- declare function DialogBackdrop({ className, ...props }: Dialog$1.Backdrop.Props): react_jsx_runtime.JSX.Element;
22
- declare function DialogViewport({ className, ...props }: Dialog$1.Viewport.Props): react_jsx_runtime.JSX.Element;
15
+ declare function DialogClose({ asChild, children, render, nativeButton, ...props }: DialogCloseProps): React$1.JSX.Element;
16
+ declare function DialogBackdrop({ className, ...props }: Dialog$1.Backdrop.Props): React$1.JSX.Element;
17
+ declare function DialogViewport({ className, ...props }: Dialog$1.Viewport.Props): React$1.JSX.Element;
23
18
  declare function DialogPopup({ className, children, showCloseButton, bottomStickOnMobile, ...props }: Dialog$1.Popup.Props & {
24
- showCloseButton?: boolean;
25
- bottomStickOnMobile?: boolean;
26
- }): react_jsx_runtime.JSX.Element;
27
- declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
28
- declare function DialogFooter({ className, variant, ...props }: React.ComponentProps<"div"> & {
29
- variant?: "default" | "bare";
30
- }): react_jsx_runtime.JSX.Element;
31
- declare function DialogTitle({ className, ...props }: Dialog$1.Title.Props): react_jsx_runtime.JSX.Element;
32
- declare function DialogDescription({ className, ...props }: Dialog$1.Description.Props): react_jsx_runtime.JSX.Element;
33
- declare function DialogPanel({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
34
-
35
- export { Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogBackdrop as DialogOverlay, DialogPanel, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, DialogViewport };
19
+ showCloseButton?: boolean;
20
+ bottomStickOnMobile?: boolean;
21
+ }): React$1.JSX.Element;
22
+ declare function DialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
23
+ declare function DialogFooter({ className, variant, ...props }: React$1.ComponentProps<"div"> & {
24
+ variant?: "default" | "bare";
25
+ }): React$1.JSX.Element;
26
+ declare function DialogTitle({ className, ...props }: Dialog$1.Title.Props): React$1.JSX.Element;
27
+ declare function DialogDescription({ className, ...props }: Dialog$1.Description.Props): React$1.JSX.Element;
28
+ declare function DialogPanel({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
29
+ //#endregion
30
+ export { Dialog, DialogBackdrop, DialogBackdrop as DialogOverlay, DialogClose, DialogPopup as DialogContent, DialogPopup, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPortal, DialogTitle, DialogTrigger, DialogViewport };
31
+ //# sourceMappingURL=dialog.d.ts.map
@@ -1,440 +1,123 @@
1
1
  "use client";
2
- import * as React2 from 'react';
3
- import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
4
- import { XIcon } from 'lucide-react';
5
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
6
- import { clsx } from 'clsx';
7
- import { twMerge } from 'tailwind-merge';
8
- import { cva } from 'class-variance-authority';
9
- import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
10
2
 
11
- var PORTAL_ROOT_ID = "portal-root";
12
- var PortalContext = React2.createContext({
13
- layer: "base",
14
- depth: 0,
15
- floatingPortalStrategy: "root",
16
- floatingZIndex: "default"
17
- });
18
- function ModalPortalScope({
19
- children,
20
- floatingPortalStrategy = "nested",
21
- floatingZIndex = "default"
22
- }) {
23
- const parentContext = React2.useContext(PortalContext);
24
- const depth = parentContext.layer === "modal" ? parentContext.depth + 1 : 0;
25
- const value = React2.useMemo(
26
- () => ({
27
- layer: "modal",
28
- depth,
29
- floatingPortalStrategy,
30
- floatingZIndex
31
- }),
32
- [depth, floatingPortalStrategy, floatingZIndex]
33
- );
34
- return /* @__PURE__ */ jsx(PortalContext.Provider, { value, children });
35
- }
36
- function useRootPortalContainer() {
37
- const [container, setContainer] = React2.useState(null);
38
- React2.useLayoutEffect(() => {
39
- const el = document.getElementById(PORTAL_ROOT_ID);
40
- setContainer(el);
41
- }, []);
42
- return container;
43
- }
44
- function composeRefs(...refs) {
45
- return (node) => {
46
- refs.forEach((ref) => {
47
- if (typeof ref === "function") {
48
- ref(node);
49
- } else if (ref != null) {
50
- ref.current = node;
51
- }
52
- });
53
- };
54
- }
55
- function mergeProps(slotProps, childProps) {
56
- const overrideProps = { ...childProps };
57
- for (const propName in childProps) {
58
- if (propName === "ref") continue;
59
- const slotPropValue = slotProps[propName];
60
- const childPropValue = childProps[propName];
61
- if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
62
- overrideProps[propName] = (...args) => {
63
- childPropValue(...args);
64
- slotPropValue(...args);
65
- };
66
- } else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
67
- overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
68
- } else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
69
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
70
- }
71
- }
72
- return { ...slotProps, ...overrideProps };
73
- }
74
- function mergePropsWithRef(parentProps, childElement) {
75
- const childProps = childElement.props;
76
- const parentRef = parentProps.ref;
77
- const childRef = childProps.ref;
78
- const mergedProps = mergeProps(parentProps, childProps);
79
- if (parentRef || childRef) {
80
- mergedProps.ref = composeRefs(parentRef, childRef);
81
- }
82
- return mergedProps;
83
- }
84
- function isSlottable(child) {
85
- return React2.isValidElement(child);
86
- }
87
- var Slot = React2.forwardRef((props, forwardedRef) => {
88
- const { children, ...slotProps } = props;
89
- if (isSlottable(children)) {
90
- const childProps = children.props;
91
- const childRef = childProps.ref;
92
- return React2.cloneElement(children, {
93
- ...mergeProps(slotProps, childProps),
94
- ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
95
- });
96
- }
97
- if (React2.Children.count(children) > 1) {
98
- const childrenArray = React2.Children.toArray(children);
99
- const slottableChild = childrenArray.find(
100
- (child) => React2.isValidElement(child) && child.type === Slottable
101
- );
102
- if (slottableChild) {
103
- const newElement = slottableChild.props.children;
104
- if (isSlottable(newElement)) {
105
- const newElementProps = newElement.props;
106
- const newChildren = childrenArray.map((child) => {
107
- if (child === slottableChild) {
108
- return React2.Children.count(newElementProps.children) > 1 ? React2.Children.only(null) : newElementProps.children;
109
- }
110
- return child;
111
- });
112
- const childRef = newElementProps.ref;
113
- return React2.cloneElement(newElement, {
114
- ...mergeProps(slotProps, newElementProps),
115
- ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
116
- children: newChildren
117
- });
118
- }
119
- }
120
- }
121
- return /* @__PURE__ */ jsx(Fragment, { children });
122
- });
123
- Slot.displayName = "Slot";
124
- function Slottable({ children }) {
125
- return /* @__PURE__ */ jsx(Fragment, { children });
126
- }
127
- function cn(...inputs) {
128
- return twMerge(clsx(inputs));
129
- }
130
- var buttonVariants = cva(
131
- "[&_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",
132
- {
133
- defaultVariants: {
134
- size: "default",
135
- variant: "default"
136
- },
137
- variants: {
138
- size: {
139
- default: "h-9 px-[calc(--spacing(3)-1px)] sm:h-8",
140
- icon: "size-9 sm:size-8",
141
- "icon-lg": "size-10 sm:size-9",
142
- "icon-sm": "size-8 sm:size-7",
143
- "icon-xl": 'size-11 sm:size-10 [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
144
- "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',
145
- lg: "h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9",
146
- sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7",
147
- 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',
148
- 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'
149
- },
150
- variant: {
151
- 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",
152
- destructive: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
153
- "destructive-outline": "border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8",
154
- ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
155
- link: "border-transparent underline-offset-4 hover:underline",
156
- outline: "border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64",
157
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
158
- }
159
- }
160
- }
161
- );
162
- var Button = React2.forwardRef(
163
- ({ className, variant, size, asChild, children, type = "button", ...props }, ref) => {
164
- const buttonClasses = cn(buttonVariants({ className, size, variant }));
165
- if (asChild && React2.isValidElement(children)) {
166
- const childProps = children.props;
167
- return React2.cloneElement(children, {
168
- ...props,
169
- className: cn(buttonClasses, childProps.className),
170
- "data-slot": "button"
171
- });
172
- }
173
- return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
174
- }
175
- );
176
- Button.displayName = "Button";
177
- var ScrollArea = React2.forwardRef(
178
- ({ className, children, scrollFade = false, scrollbarGutter = false, ...props }, ref) => {
179
- return /* @__PURE__ */ jsxs(
180
- ScrollArea$1.Root,
181
- {
182
- ref,
183
- className: cn("size-full min-h-0", className),
184
- ...props,
185
- children: [
186
- /* @__PURE__ */ jsx(
187
- ScrollArea$1.Viewport,
188
- {
189
- className: cn(
190
- "h-full overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
191
- scrollFade && "mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]",
192
- scrollbarGutter && "data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5"
193
- ),
194
- "data-slot": "scroll-area-viewport",
195
- children
196
- }
197
- ),
198
- /* @__PURE__ */ jsx(ScrollBar, { orientation: "vertical" }),
199
- /* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" }),
200
- /* @__PURE__ */ jsx(ScrollArea$1.Corner, { "data-slot": "scroll-area-corner" })
201
- ]
202
- }
203
- );
204
- }
205
- );
206
- ScrollArea.displayName = "ScrollArea";
207
- function ScrollBar({
208
- className,
209
- orientation = "vertical",
210
- ...props
211
- }) {
212
- return /* @__PURE__ */ jsx(
213
- ScrollArea$1.Scrollbar,
214
- {
215
- className: cn(
216
- "m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100",
217
- className
218
- ),
219
- "data-slot": "scroll-area-scrollbar",
220
- orientation,
221
- ...props,
222
- children: /* @__PURE__ */ jsx(
223
- ScrollArea$1.Thumb,
224
- {
225
- className: "relative flex-1 rounded-full bg-foreground/20",
226
- "data-slot": "scroll-area-thumb"
227
- }
228
- )
229
- }
230
- );
231
- }
232
- var Dialog = Dialog$1.Root;
233
- function DialogPortal({ keepMounted = true, ...props }) {
234
- const container = useRootPortalContainer();
235
- const style = {
236
- ...props.style ?? {},
237
- // Ensure floating overlays inside dialogs (select/menu/popover/tooltip) stack above the dialog.
238
- // Nested Base UI portals inherit this var via Base UI portal nesting.
239
- ["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
240
- };
241
- return /* @__PURE__ */ jsx(Dialog$1.Portal, { keepMounted, container, ...props, style });
242
- }
243
- function DialogTrigger({ asChild, nativeButton, children, ...props }) {
244
- if (asChild && React2.isValidElement(children)) {
245
- return /* @__PURE__ */ jsx(
246
- Dialog$1.Trigger,
247
- {
248
- "data-slot": "dialog-trigger",
249
- nativeButton: nativeButton ?? true,
250
- ...props,
251
- render: (triggerProps) => {
252
- const { nativeButton: _, ...rest } = triggerProps;
253
- return React2.cloneElement(
254
- children,
255
- mergePropsWithRef(rest, children)
256
- );
257
- }
258
- }
259
- );
260
- }
261
- return /* @__PURE__ */ jsx(Dialog$1.Trigger, { "data-slot": "dialog-trigger", nativeButton, ...props, children });
262
- }
263
- function DialogClose({ asChild, nativeButton, children, ...props }) {
264
- if (asChild && React2.isValidElement(children)) {
265
- return /* @__PURE__ */ jsx(
266
- Dialog$1.Close,
267
- {
268
- "data-slot": "dialog-close",
269
- nativeButton: nativeButton ?? true,
270
- ...props,
271
- render: (closeProps) => {
272
- const { nativeButton: _, ...rest } = closeProps;
273
- return React2.cloneElement(
274
- children,
275
- mergePropsWithRef(rest, children)
276
- );
277
- }
278
- }
279
- );
280
- }
281
- return /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "dialog-close", nativeButton, ...props, children });
282
- }
283
- function DialogBackdrop({
284
- className,
285
- ...props
286
- }) {
287
- return /* @__PURE__ */ jsx(
288
- Dialog$1.Backdrop,
289
- {
290
- className: cn(
291
- "fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/32 backdrop-blur-sm transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0",
292
- className
293
- ),
294
- "data-slot": "dialog-backdrop",
295
- ...props
296
- }
297
- );
298
- }
299
- function DialogViewport({
300
- className,
301
- ...props
302
- }) {
303
- return /* @__PURE__ */ jsx(
304
- Dialog$1.Viewport,
305
- {
306
- className: cn(
307
- "fixed inset-0 z-[var(--z-layer-modal-content)] grid grid-rows-[1fr_auto_3fr] justify-items-center p-4",
308
- className
309
- ),
310
- "data-slot": "dialog-viewport",
311
- ...props
312
- }
313
- );
314
- }
315
- function DialogPopup({
316
- className,
317
- children,
318
- showCloseButton = true,
319
- bottomStickOnMobile = true,
320
- ...props
321
- }) {
322
- return /* @__PURE__ */ jsxs(DialogPortal, { children: [
323
- /* @__PURE__ */ jsx(DialogBackdrop, {}),
324
- /* @__PURE__ */ jsx(
325
- DialogViewport,
326
- {
327
- className: cn(
328
- bottomStickOnMobile && "max-sm:grid-rows-[1fr_auto] max-sm:pt-12"
329
- ),
330
- children: /* @__PURE__ */ jsxs(
331
- Dialog$1.Popup,
332
- {
333
- className: cn(
334
- "-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%)]",
335
- 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",
336
- className
337
- ),
338
- "data-slot": "dialog-popup",
339
- ...props,
340
- children: [
341
- /* @__PURE__ */ jsx(ModalPortalScope, { children }),
342
- showCloseButton && /* @__PURE__ */ jsx(
343
- Dialog$1.Close,
344
- {
345
- "aria-label": "Close",
346
- nativeButton: true,
347
- render: (closeProps) => {
348
- const { nativeButton: _, ...rest } = closeProps;
349
- return /* @__PURE__ */ jsx(
350
- Button,
351
- {
352
- ...rest,
353
- className: "absolute end-2 top-2",
354
- size: "icon",
355
- variant: "ghost",
356
- children: /* @__PURE__ */ jsx(XIcon, {})
357
- }
358
- );
359
- }
360
- }
361
- )
362
- ]
363
- }
364
- )
365
- }
366
- )
367
- ] });
3
+ import { t as cn } from "../utils-BkMLyah9.js";
4
+ import { Button } from "./button.js";
5
+ import { ScrollArea } from "./scroll-area.js";
6
+ import * as React$1 from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { XIcon } from "lucide-react";
9
+ import { ModalPortalScope, useRootPortalContainer } from "@constructive-io/ui/portal";
10
+ import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
11
+
12
+ //#region src/components/dialog.tsx
13
+ const Dialog = Dialog$1.Root;
14
+ function DialogPortal({ container: containerProp, ...props }) {
15
+ const rootContainer = useRootPortalContainer();
16
+ const container = containerProp === void 0 ? rootContainer ?? void 0 : containerProp;
17
+ const style = {
18
+ ...props.style ?? {},
19
+ ["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
20
+ };
21
+ return /* @__PURE__ */ jsx(Dialog$1.Portal, {
22
+ container,
23
+ ...props,
24
+ style
25
+ });
26
+ }
27
+ function DialogTrigger({ asChild, children, render, nativeButton, ...props }) {
28
+ const childRender = render === void 0 && asChild && React$1.isValidElement(children) ? children : void 0;
29
+ return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
30
+ "data-slot": "dialog-trigger",
31
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
32
+ render: render ?? childRender,
33
+ ...props,
34
+ children: childRender ? void 0 : children
35
+ });
36
+ }
37
+ function DialogClose({ asChild, children, render, nativeButton, ...props }) {
38
+ const childRender = render === void 0 && asChild && React$1.isValidElement(children) ? children : void 0;
39
+ return /* @__PURE__ */ jsx(Dialog$1.Close, {
40
+ "data-slot": "dialog-close",
41
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
42
+ render: render ?? childRender,
43
+ ...props,
44
+ children: childRender ? void 0 : children
45
+ });
46
+ }
47
+ function DialogBackdrop({ className, ...props }) {
48
+ return /* @__PURE__ */ jsx(Dialog$1.Backdrop, {
49
+ className: cn("fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/32 backdrop-blur-sm transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0", className),
50
+ "data-slot": "dialog-backdrop",
51
+ ...props
52
+ });
53
+ }
54
+ function DialogViewport({ className, ...props }) {
55
+ return /* @__PURE__ */ jsx(Dialog$1.Viewport, {
56
+ className: cn("fixed inset-0 z-[var(--z-layer-modal-content)] grid grid-rows-[1fr_auto_3fr] justify-items-center p-4", className),
57
+ "data-slot": "dialog-viewport",
58
+ ...props
59
+ });
60
+ }
61
+ function DialogPopup({ className, children, showCloseButton = true, bottomStickOnMobile = true, ...props }) {
62
+ return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogBackdrop, {}), /* @__PURE__ */ jsx(DialogViewport, {
63
+ className: cn(bottomStickOnMobile && "max-sm:grid-rows-[1fr_auto] max-sm:pt-12"),
64
+ children: /* @__PURE__ */ jsxs(Dialog$1.Popup, {
65
+ className: cn("-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%)]", 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", className),
66
+ "data-slot": "dialog-popup",
67
+ ...props,
68
+ children: [/* @__PURE__ */ jsx(ModalPortalScope, { children }), showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
69
+ "aria-label": "Close",
70
+ nativeButton: true,
71
+ render: (closeProps) => {
72
+ const { nativeButton: _, ...rest } = closeProps;
73
+ return /* @__PURE__ */ jsx(Button, {
74
+ ...rest,
75
+ className: "absolute end-2 top-2",
76
+ size: "icon",
77
+ variant: "ghost",
78
+ children: /* @__PURE__ */ jsx(XIcon, {})
79
+ });
80
+ }
81
+ })]
82
+ })
83
+ })] });
368
84
  }
369
85
  function DialogHeader({ className, ...props }) {
370
- return /* @__PURE__ */ jsx(
371
- "div",
372
- {
373
- className: cn(
374
- "flex flex-col gap-2 p-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pb-3 max-sm:pb-4",
375
- className
376
- ),
377
- "data-slot": "dialog-header",
378
- ...props
379
- }
380
- );
381
- }
382
- function DialogFooter({
383
- className,
384
- variant = "default",
385
- ...props
386
- }) {
387
- return /* @__PURE__ */ jsx(
388
- "div",
389
- {
390
- className: cn(
391
- "flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]",
392
- variant === "default" && "border-t bg-muted/50 py-4",
393
- variant === "bare" && "in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pt-3 pt-4 pb-6",
394
- className
395
- ),
396
- "data-slot": "dialog-footer",
397
- ...props
398
- }
399
- );
86
+ return /* @__PURE__ */ jsx("div", {
87
+ className: cn("flex flex-col gap-2 p-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pb-3 max-sm:pb-4", className),
88
+ "data-slot": "dialog-header",
89
+ ...props
90
+ });
91
+ }
92
+ function DialogFooter({ className, variant = "default", ...props }) {
93
+ return /* @__PURE__ */ jsx("div", {
94
+ className: cn("flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]", variant === "default" && "border-t bg-muted/50 py-4", variant === "bare" && "in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pt-3 pt-4 pb-6", className),
95
+ "data-slot": "dialog-footer",
96
+ ...props
97
+ });
400
98
  }
401
99
  function DialogTitle({ className, ...props }) {
402
- return /* @__PURE__ */ jsx(
403
- Dialog$1.Title,
404
- {
405
- className: cn("font-heading text-xl leading-none", className),
406
- "data-slot": "dialog-title",
407
- ...props
408
- }
409
- );
410
- }
411
- function DialogDescription({
412
- className,
413
- ...props
414
- }) {
415
- return /* @__PURE__ */ jsx(
416
- Dialog$1.Description,
417
- {
418
- className: cn("text-muted-foreground text-sm", className),
419
- "data-slot": "dialog-description",
420
- ...props
421
- }
422
- );
100
+ return /* @__PURE__ */ jsx(Dialog$1.Title, {
101
+ className: cn("font-heading text-xl leading-none", className),
102
+ "data-slot": "dialog-title",
103
+ ...props
104
+ });
105
+ }
106
+ function DialogDescription({ className, ...props }) {
107
+ return /* @__PURE__ */ jsx(Dialog$1.Description, {
108
+ className: cn("text-muted-foreground text-sm", className),
109
+ "data-slot": "dialog-description",
110
+ ...props
111
+ });
423
112
  }
424
113
  function DialogPanel({ className, ...props }) {
425
- return /* @__PURE__ */ jsx(ScrollArea, { children: /* @__PURE__ */ jsx(
426
- "div",
427
- {
428
- className: cn(
429
- "px-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-header])]:pt-1 in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-header]))]:pt-6 in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-footer]))]:pb-6! in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-footer].border-t))]:pb-1 pb-6",
430
- className
431
- ),
432
- "data-slot": "dialog-panel",
433
- ...props
434
- }
435
- ) });
114
+ return /* @__PURE__ */ jsx(ScrollArea, { children: /* @__PURE__ */ jsx("div", {
115
+ className: cn("px-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-header])]:pt-1 in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-header]))]:pt-6 in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-footer]))]:pb-6! in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-footer].border-t))]:pb-1 pb-6", className),
116
+ "data-slot": "dialog-panel",
117
+ ...props
118
+ }) });
436
119
  }
437
120
 
438
- export { Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogBackdrop as DialogOverlay, DialogPanel, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, DialogViewport };
439
- //# sourceMappingURL=dialog.js.map
121
+ //#endregion
122
+ export { Dialog, DialogBackdrop, DialogBackdrop as DialogOverlay, DialogClose, DialogPopup as DialogContent, DialogPopup, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPortal, DialogTitle, DialogTrigger, DialogViewport };
440
123
  //# sourceMappingURL=dialog.js.map