@constructive-io/ui 0.12.0 → 0.14.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 (493) hide show
  1. package/README.md +1 -1
  2. package/dist/{ai-CiaH2sfF.js → ai-4JrVVL3q.js} +1794 -250
  3. package/dist/ai-4JrVVL3q.js.map +1 -0
  4. package/dist/{ai-lAkichk8.cjs → ai-B08ufcbD.cjs} +1888 -248
  5. package/dist/ai-B08ufcbD.cjs.map +1 -0
  6. package/dist/{alert-BXuP0ayz.d.ts → alert-CJ4Qyk6W.d.cts} +4 -2
  7. package/dist/{alert-BXuP0ayz.d.cts → alert-CJ4Qyk6W.d.ts} +4 -2
  8. package/dist/components/accordion.cjs +60 -0
  9. package/dist/components/accordion.cjs.map +1 -0
  10. package/dist/components/accordion.d.cts +14 -0
  11. package/dist/components/accordion.d.ts +14 -0
  12. package/dist/components/accordion.js +54 -0
  13. package/dist/components/accordion.js.map +1 -0
  14. package/dist/components/ai/index.cjs +17 -1
  15. package/dist/components/ai/index.d.cts +2 -2
  16. package/dist/components/ai/index.d.ts +2 -2
  17. package/dist/components/ai/index.js +2 -2
  18. package/dist/components/alert-dialog.cjs +17 -8
  19. package/dist/components/alert-dialog.cjs.map +1 -1
  20. package/dist/components/alert-dialog.d.cts +1 -1
  21. package/dist/components/alert-dialog.d.ts +1 -1
  22. package/dist/components/alert-dialog.js +17 -8
  23. package/dist/components/alert-dialog.js.map +1 -1
  24. package/dist/components/alert.cjs +18 -8
  25. package/dist/components/alert.cjs.map +1 -1
  26. package/dist/components/alert.d.cts +2 -2
  27. package/dist/components/alert.d.ts +2 -2
  28. package/dist/components/alert.js +18 -9
  29. package/dist/components/alert.js.map +1 -1
  30. package/dist/components/autocomplete.cjs +9 -5
  31. package/dist/components/autocomplete.cjs.map +1 -1
  32. package/dist/components/autocomplete.js +9 -5
  33. package/dist/components/autocomplete.js.map +1 -1
  34. package/dist/components/avatar.cjs +9 -3
  35. package/dist/components/avatar.cjs.map +1 -1
  36. package/dist/components/avatar.d.cts +6 -0
  37. package/dist/components/avatar.d.ts +6 -0
  38. package/dist/components/avatar.js +9 -3
  39. package/dist/components/avatar.js.map +1 -1
  40. package/dist/components/badge.cjs +25 -18
  41. package/dist/components/badge.cjs.map +1 -1
  42. package/dist/components/badge.d.cts +2 -2
  43. package/dist/components/badge.d.ts +2 -2
  44. package/dist/components/badge.js +25 -18
  45. package/dist/components/badge.js.map +1 -1
  46. package/dist/components/breadcrumb.cjs +9 -6
  47. package/dist/components/breadcrumb.cjs.map +1 -1
  48. package/dist/components/breadcrumb.js +9 -6
  49. package/dist/components/breadcrumb.js.map +1 -1
  50. package/dist/components/button-group.cjs +57 -0
  51. package/dist/components/button-group.cjs.map +1 -0
  52. package/dist/components/button-group.d.cts +16 -0
  53. package/dist/components/button-group.d.ts +16 -0
  54. package/dist/components/button-group.js +51 -0
  55. package/dist/components/button-group.js.map +1 -0
  56. package/dist/components/button.cjs +62 -18
  57. package/dist/components/button.cjs.map +1 -1
  58. package/dist/components/button.d.cts +32 -2
  59. package/dist/components/button.d.ts +32 -2
  60. package/dist/components/button.js +62 -18
  61. package/dist/components/button.js.map +1 -1
  62. package/dist/components/calendar-rac.cjs +14 -8
  63. package/dist/components/calendar-rac.cjs.map +1 -1
  64. package/dist/components/calendar-rac.js +14 -8
  65. package/dist/components/calendar-rac.js.map +1 -1
  66. package/dist/components/card.cjs +35 -23
  67. package/dist/components/card.cjs.map +1 -1
  68. package/dist/components/card.d.cts +3 -2
  69. package/dist/components/card.d.ts +3 -2
  70. package/dist/components/card.js +35 -23
  71. package/dist/components/card.js.map +1 -1
  72. package/dist/components/checkbox.cjs +5 -5
  73. package/dist/components/checkbox.cjs.map +1 -1
  74. package/dist/components/checkbox.js +5 -5
  75. package/dist/components/checkbox.js.map +1 -1
  76. package/dist/components/collapsible.cjs +3 -3
  77. package/dist/components/collapsible.cjs.map +1 -1
  78. package/dist/components/collapsible.js +3 -3
  79. package/dist/components/collapsible.js.map +1 -1
  80. package/dist/components/combobox.cjs +24 -12
  81. package/dist/components/combobox.cjs.map +1 -1
  82. package/dist/components/combobox.d.cts +2 -1
  83. package/dist/components/combobox.d.ts +2 -1
  84. package/dist/components/combobox.js +24 -12
  85. package/dist/components/combobox.js.map +1 -1
  86. package/dist/components/command.cjs +30 -14
  87. package/dist/components/command.cjs.map +1 -1
  88. package/dist/components/command.d.cts +9 -2
  89. package/dist/components/command.d.ts +9 -2
  90. package/dist/components/command.js +30 -14
  91. package/dist/components/command.js.map +1 -1
  92. package/dist/components/dialog.cjs +22 -12
  93. package/dist/components/dialog.cjs.map +1 -1
  94. package/dist/components/dialog.d.cts +5 -2
  95. package/dist/components/dialog.d.ts +5 -2
  96. package/dist/components/dialog.js +22 -12
  97. package/dist/components/dialog.js.map +1 -1
  98. package/dist/components/dock.cjs +50 -27
  99. package/dist/components/dock.cjs.map +1 -1
  100. package/dist/components/dock.d.cts +1 -1
  101. package/dist/components/dock.d.ts +1 -1
  102. package/dist/components/dock.js +51 -28
  103. package/dist/components/dock.js.map +1 -1
  104. package/dist/components/drawer.cjs +22 -14
  105. package/dist/components/drawer.cjs.map +1 -1
  106. package/dist/components/drawer.js +22 -14
  107. package/dist/components/drawer.js.map +1 -1
  108. package/dist/components/dropdown-menu.cjs +34 -28
  109. package/dist/components/dropdown-menu.cjs.map +1 -1
  110. package/dist/components/dropdown-menu.d.cts +2 -2
  111. package/dist/components/dropdown-menu.d.ts +2 -2
  112. package/dist/components/dropdown-menu.js +52 -46
  113. package/dist/components/dropdown-menu.js.map +1 -1
  114. package/dist/components/empty.cjs +4 -4
  115. package/dist/components/empty.cjs.map +1 -1
  116. package/dist/components/empty.js +4 -4
  117. package/dist/components/empty.js.map +1 -1
  118. package/dist/components/field.cjs +33 -33
  119. package/dist/components/field.cjs.map +1 -1
  120. package/dist/components/field.js +34 -34
  121. package/dist/components/field.js.map +1 -1
  122. package/dist/components/flickering-grid.cjs +1 -1
  123. package/dist/components/flickering-grid.cjs.map +1 -1
  124. package/dist/components/flickering-grid.js +1 -1
  125. package/dist/components/flickering-grid.js.map +1 -1
  126. package/dist/components/flow-zoom-panel.cjs +10 -5
  127. package/dist/components/flow-zoom-panel.cjs.map +1 -1
  128. package/dist/components/flow-zoom-panel.d.cts +8 -1
  129. package/dist/components/flow-zoom-panel.d.ts +8 -1
  130. package/dist/components/flow-zoom-panel.js +10 -5
  131. package/dist/components/flow-zoom-panel.js.map +1 -1
  132. package/dist/components/form-control.cjs +12 -8
  133. package/dist/components/form-control.cjs.map +1 -1
  134. package/dist/components/form-control.js +12 -8
  135. package/dist/components/form-control.js.map +1 -1
  136. package/dist/components/form.cjs +5 -5
  137. package/dist/components/form.cjs.map +1 -1
  138. package/dist/components/form.js +5 -5
  139. package/dist/components/form.js.map +1 -1
  140. package/dist/components/input-group.cjs +13 -7
  141. package/dist/components/input-group.cjs.map +1 -1
  142. package/dist/components/input-group.d.cts +2 -2
  143. package/dist/components/input-group.d.ts +2 -2
  144. package/dist/components/input-group.js +11 -7
  145. package/dist/components/input-group.js.map +1 -1
  146. package/dist/components/input-otp.cjs +252 -0
  147. package/dist/components/input-otp.cjs.map +1 -0
  148. package/dist/components/input-otp.d.cts +44 -0
  149. package/dist/components/input-otp.d.ts +44 -0
  150. package/dist/components/input-otp.js +251 -0
  151. package/dist/components/input-otp.js.map +1 -0
  152. package/dist/components/input.cjs +10 -4
  153. package/dist/components/input.cjs.map +1 -1
  154. package/dist/components/input.d.cts +11 -2
  155. package/dist/components/input.d.ts +11 -2
  156. package/dist/components/input.js +10 -4
  157. package/dist/components/input.js.map +1 -1
  158. package/dist/components/item.cjs +151 -0
  159. package/dist/components/item.cjs.map +1 -0
  160. package/dist/components/item.d.cts +37 -0
  161. package/dist/components/item.d.ts +37 -0
  162. package/dist/components/item.js +137 -0
  163. package/dist/components/item.js.map +1 -0
  164. package/dist/components/json-input.cjs +4 -143
  165. package/dist/components/json-input.d.cts +6 -4
  166. package/dist/components/json-input.d.ts +6 -4
  167. package/dist/components/json-input.js +2 -140
  168. package/dist/components/kbd.cjs +35 -0
  169. package/dist/components/kbd.cjs.map +1 -0
  170. package/dist/components/kbd.d.cts +16 -0
  171. package/dist/components/kbd.d.ts +16 -0
  172. package/dist/components/kbd.js +31 -0
  173. package/dist/components/kbd.js.map +1 -0
  174. package/dist/components/label.cjs +3 -3
  175. package/dist/components/label.cjs.map +1 -1
  176. package/dist/components/label.js +3 -3
  177. package/dist/components/label.js.map +1 -1
  178. package/dist/components/motion-grid.cjs +20 -8
  179. package/dist/components/motion-grid.cjs.map +1 -1
  180. package/dist/components/motion-grid.js +20 -8
  181. package/dist/components/motion-grid.js.map +1 -1
  182. package/dist/components/multi-select.cjs +77 -67
  183. package/dist/components/multi-select.cjs.map +1 -1
  184. package/dist/components/multi-select.js +77 -67
  185. package/dist/components/multi-select.js.map +1 -1
  186. package/dist/components/page-header.cjs +12 -9
  187. package/dist/components/page-header.cjs.map +1 -1
  188. package/dist/components/page-header.js +12 -9
  189. package/dist/components/page-header.js.map +1 -1
  190. package/dist/components/pagination.cjs +10 -4
  191. package/dist/components/pagination.cjs.map +1 -1
  192. package/dist/components/pagination.d.cts +1 -1
  193. package/dist/components/pagination.d.ts +1 -1
  194. package/dist/components/pagination.js +10 -4
  195. package/dist/components/pagination.js.map +1 -1
  196. package/dist/components/phone-input.cjs +228 -0
  197. package/dist/components/phone-input.cjs.map +1 -0
  198. package/dist/components/phone-input.d.cts +42 -0
  199. package/dist/components/phone-input.d.ts +42 -0
  200. package/dist/components/phone-input.js +220 -0
  201. package/dist/components/phone-input.js.map +1 -0
  202. package/dist/components/popover.cjs +12 -4
  203. package/dist/components/popover.cjs.map +1 -1
  204. package/dist/components/popover.d.cts +7 -1
  205. package/dist/components/popover.d.ts +7 -1
  206. package/dist/components/popover.js +12 -5
  207. package/dist/components/popover.js.map +1 -1
  208. package/dist/components/progress.cjs +20 -3
  209. package/dist/components/progress.cjs.map +1 -1
  210. package/dist/components/progress.d.cts +1 -1
  211. package/dist/components/progress.d.ts +1 -1
  212. package/dist/components/progress.js +20 -3
  213. package/dist/components/progress.js.map +1 -1
  214. package/dist/components/progressive-blur-scroll-container.cjs +2 -2
  215. package/dist/components/progressive-blur-scroll-container.cjs.map +1 -1
  216. package/dist/components/progressive-blur-scroll-container.d.cts +1 -1
  217. package/dist/components/progressive-blur-scroll-container.d.ts +1 -1
  218. package/dist/components/progressive-blur-scroll-container.js +2 -2
  219. package/dist/components/progressive-blur-scroll-container.js.map +1 -1
  220. package/dist/components/progressive-blur.cjs +3 -2
  221. package/dist/components/progressive-blur.cjs.map +1 -1
  222. package/dist/components/progressive-blur.js +3 -2
  223. package/dist/components/progressive-blur.js.map +1 -1
  224. package/dist/components/radio-group.cjs +2 -2
  225. package/dist/components/radio-group.cjs.map +1 -1
  226. package/dist/components/radio-group.js +2 -2
  227. package/dist/components/radio-group.js.map +1 -1
  228. package/dist/components/record-picker.cjs +1 -1
  229. package/dist/components/record-picker.js +1 -1
  230. package/dist/components/resizable.cjs +2 -2
  231. package/dist/components/resizable.cjs.map +1 -1
  232. package/dist/components/resizable.js +2 -2
  233. package/dist/components/resizable.js.map +1 -1
  234. package/dist/components/responsive-diagram.cjs +43 -21
  235. package/dist/components/responsive-diagram.cjs.map +1 -1
  236. package/dist/components/responsive-diagram.d.cts +7 -1
  237. package/dist/components/responsive-diagram.d.ts +7 -1
  238. package/dist/components/responsive-diagram.js +43 -21
  239. package/dist/components/responsive-diagram.js.map +1 -1
  240. package/dist/components/scroll-area.cjs +2 -2
  241. package/dist/components/scroll-area.cjs.map +1 -1
  242. package/dist/components/scroll-area.js +2 -2
  243. package/dist/components/scroll-area.js.map +1 -1
  244. package/dist/components/select.cjs +84 -20
  245. package/dist/components/select.cjs.map +1 -1
  246. package/dist/components/select.d.cts +12 -7
  247. package/dist/components/select.d.ts +12 -7
  248. package/dist/components/select.js +84 -20
  249. package/dist/components/select.js.map +1 -1
  250. package/dist/components/separator.cjs +1 -1
  251. package/dist/components/separator.cjs.map +1 -1
  252. package/dist/components/separator.d.cts +11 -2
  253. package/dist/components/separator.d.ts +11 -2
  254. package/dist/components/separator.js +1 -1
  255. package/dist/components/separator.js.map +1 -1
  256. package/dist/components/sheet.cjs +1 -1
  257. package/dist/components/sheet.d.cts +11 -5
  258. package/dist/components/sheet.d.ts +12 -6
  259. package/dist/components/sheet.js +1 -1
  260. package/dist/components/sidebar.cjs +2 -1
  261. package/dist/components/sidebar.d.cts +8 -7
  262. package/dist/components/sidebar.d.ts +8 -7
  263. package/dist/components/sidebar.js +2 -1
  264. package/dist/components/slider.cjs +47 -0
  265. package/dist/components/slider.cjs.map +1 -0
  266. package/dist/components/slider.d.cts +8 -0
  267. package/dist/components/slider.d.ts +8 -0
  268. package/dist/components/slider.js +44 -0
  269. package/dist/components/slider.js.map +1 -0
  270. package/dist/components/sonner.cjs +15 -4
  271. package/dist/components/sonner.cjs.map +1 -1
  272. package/dist/components/sonner.d.cts +10 -1
  273. package/dist/components/sonner.d.ts +10 -1
  274. package/dist/components/sonner.js +16 -5
  275. package/dist/components/sonner.js.map +1 -1
  276. package/dist/components/spinner.cjs +25 -0
  277. package/dist/components/spinner.cjs.map +1 -0
  278. package/dist/components/spinner.d.cts +16 -0
  279. package/dist/components/spinner.d.ts +16 -0
  280. package/dist/components/spinner.js +22 -0
  281. package/dist/components/spinner.js.map +1 -0
  282. package/dist/components/stack/index.cjs +1 -1
  283. package/dist/components/stack/index.d.cts +1 -1
  284. package/dist/components/stack/index.d.ts +1 -1
  285. package/dist/components/stack/index.js +1 -1
  286. package/dist/components/stepper.cjs +23 -17
  287. package/dist/components/stepper.cjs.map +1 -1
  288. package/dist/components/stepper.d.cts +2 -2
  289. package/dist/components/stepper.d.ts +2 -2
  290. package/dist/components/stepper.js +23 -17
  291. package/dist/components/stepper.js.map +1 -1
  292. package/dist/components/switch.cjs +5 -5
  293. package/dist/components/switch.cjs.map +1 -1
  294. package/dist/components/switch.js +5 -5
  295. package/dist/components/switch.js.map +1 -1
  296. package/dist/components/table.cjs +26 -7
  297. package/dist/components/table.cjs.map +1 -1
  298. package/dist/components/table.d.cts +20 -2
  299. package/dist/components/table.d.ts +20 -2
  300. package/dist/components/table.js +26 -8
  301. package/dist/components/table.js.map +1 -1
  302. package/dist/components/tabs.cjs +64 -8
  303. package/dist/components/tabs.cjs.map +1 -1
  304. package/dist/components/tabs.d.cts +13 -2
  305. package/dist/components/tabs.d.ts +13 -2
  306. package/dist/components/tabs.js +66 -11
  307. package/dist/components/tabs.js.map +1 -1
  308. package/dist/components/tags.cjs +10 -5
  309. package/dist/components/tags.cjs.map +1 -1
  310. package/dist/components/tags.d.cts +1 -1
  311. package/dist/components/tags.d.ts +1 -1
  312. package/dist/components/tags.js +10 -5
  313. package/dist/components/tags.js.map +1 -1
  314. package/dist/components/textarea.cjs +5 -4
  315. package/dist/components/textarea.cjs.map +1 -1
  316. package/dist/components/textarea.js +5 -4
  317. package/dist/components/textarea.js.map +1 -1
  318. package/dist/components/toast/index.cjs +1 -1
  319. package/dist/components/toast/index.d.cts +2 -2
  320. package/dist/components/toast/index.d.ts +2 -2
  321. package/dist/components/toast/index.js +1 -1
  322. package/dist/components/toggle-group.cjs +69 -0
  323. package/dist/components/toggle-group.cjs.map +1 -0
  324. package/dist/components/toggle-group.d.cts +27 -0
  325. package/dist/components/toggle-group.d.ts +27 -0
  326. package/dist/components/toggle-group.js +65 -0
  327. package/dist/components/toggle-group.js.map +1 -0
  328. package/dist/components/toggle.cjs +54 -0
  329. package/dist/components/toggle.cjs.map +1 -0
  330. package/dist/components/toggle.d.cts +13 -0
  331. package/dist/components/toggle.d.ts +13 -0
  332. package/dist/components/toggle.js +50 -0
  333. package/dist/components/toggle.js.map +1 -0
  334. package/dist/components/tooltip.cjs +18 -6
  335. package/dist/components/tooltip.cjs.map +1 -1
  336. package/dist/components/tooltip.d.cts +1 -1
  337. package/dist/components/tooltip.d.ts +1 -1
  338. package/dist/components/tooltip.js +18 -6
  339. package/dist/components/tooltip.js.map +1 -1
  340. package/dist/components/unlink-button.cjs +2 -2
  341. package/dist/components/unlink-button.cjs.map +1 -1
  342. package/dist/components/unlink-button.d.cts +1 -0
  343. package/dist/components/unlink-button.d.ts +1 -0
  344. package/dist/components/unlink-button.js +2 -2
  345. package/dist/components/unlink-button.js.map +1 -1
  346. package/dist/components/workspace-kit/index.cjs +1507 -0
  347. package/dist/components/workspace-kit/index.cjs.map +1 -0
  348. package/dist/components/workspace-kit/index.d.cts +728 -0
  349. package/dist/components/workspace-kit/index.d.ts +728 -0
  350. package/dist/components/workspace-kit/index.js +1440 -0
  351. package/dist/components/workspace-kit/index.js.map +1 -0
  352. package/dist/compose-refs-Mbma1O3M.js +47 -0
  353. package/dist/compose-refs-Mbma1O3M.js.map +1 -0
  354. package/dist/compose-refs-uPrvNoiU.cjs +52 -0
  355. package/dist/compose-refs-uPrvNoiU.cjs.map +1 -0
  356. package/dist/fluid-highlight-CNELHV8o.js +134 -0
  357. package/dist/fluid-highlight-CNELHV8o.js.map +1 -0
  358. package/dist/fluid-highlight-YWFRZXsw.cjs +145 -0
  359. package/dist/fluid-highlight-YWFRZXsw.cjs.map +1 -0
  360. package/dist/{index-BzLmDsId.d.cts → index-B7cT7gZU.d.cts} +3 -3
  361. package/dist/{index-BzLmDsId.d.ts → index-B7cT7gZU.d.ts} +3 -3
  362. package/dist/{index-UnM04j0t.d.ts → index-BQZxmMpw.d.cts} +11 -31
  363. package/dist/{index-UnM04j0t.d.cts → index-BQZxmMpw.d.ts} +11 -31
  364. package/dist/{index-CyaFaZe2.d.cts → index-Cluc_xc5.d.ts} +345 -20
  365. package/dist/{index-B0wXxIAb.d.ts → index-DXoG0ghv.d.cts} +345 -20
  366. package/dist/index.cjs +107 -17
  367. package/dist/index.d.cts +64 -14
  368. package/dist/index.d.ts +64 -14
  369. package/dist/index.js +27 -14
  370. package/dist/initial-focus-B8RLtyOZ.cjs +67 -0
  371. package/dist/initial-focus-B8RLtyOZ.cjs.map +1 -0
  372. package/dist/initial-focus-j2E0EnIx.js +61 -0
  373. package/dist/initial-focus-j2E0EnIx.js.map +1 -0
  374. package/dist/initials-DSkWTOb0.cjs +127 -0
  375. package/dist/initials-DSkWTOb0.cjs.map +1 -0
  376. package/dist/initials-kCcHgrSy.js +97 -0
  377. package/dist/initials-kCcHgrSy.js.map +1 -0
  378. package/dist/json-input-CH5aEmoA.js +293 -0
  379. package/dist/json-input-CH5aEmoA.js.map +1 -0
  380. package/dist/json-input-D8yM578l.cjs +311 -0
  381. package/dist/json-input-D8yM578l.cjs.map +1 -0
  382. package/dist/{motion-config-COCFHq1L.cjs → motion-config-DZ7w5Uhq.cjs} +32 -2
  383. package/dist/motion-config-DZ7w5Uhq.cjs.map +1 -0
  384. package/dist/{motion-config-COsZ6azM.js → motion-config-DoFp4I8f.js} +21 -3
  385. package/dist/motion-config-DoFp4I8f.js.map +1 -0
  386. package/dist/{record-picker-Bz4FApxD.cjs → record-picker-BQ1-Vx0g.cjs} +23 -8
  387. package/dist/record-picker-BQ1-Vx0g.cjs.map +1 -0
  388. package/dist/{record-picker-BbxngCeV.js → record-picker-DSRo4RXV.js} +23 -8
  389. package/dist/record-picker-DSRo4RXV.js.map +1 -0
  390. package/dist/{sheet-BdA0rfIz.cjs → sheet-OxWlnT_G.cjs} +25 -32
  391. package/dist/sheet-OxWlnT_G.cjs.map +1 -0
  392. package/dist/{sheet-BLHnhLRH.js → sheet-wPF_l9Cn.js} +25 -32
  393. package/dist/sheet-wPF_l9Cn.js.map +1 -0
  394. package/dist/{sidebar-BavjjJp0.cjs → sidebar-BEEWmJwC.cjs} +74 -57
  395. package/dist/sidebar-BEEWmJwC.cjs.map +1 -0
  396. package/dist/{sidebar-DeoL2ttp.js → sidebar-DWl1Azyv.js} +74 -57
  397. package/dist/sidebar-DWl1Azyv.js.map +1 -0
  398. package/dist/{stack-ci2lkfkr.cjs → stack-CEvmUSwF.cjs} +12 -10
  399. package/dist/stack-CEvmUSwF.cjs.map +1 -0
  400. package/dist/{stack-C9GROTGA.js → stack-Kqu7YaR0.js} +12 -10
  401. package/dist/stack-Kqu7YaR0.js.map +1 -0
  402. package/dist/text-runs-CdmlS5C7.cjs +52 -0
  403. package/dist/text-runs-CdmlS5C7.cjs.map +1 -0
  404. package/dist/text-runs-DqcEO8L_.js +45 -0
  405. package/dist/text-runs-DqcEO8L_.js.map +1 -0
  406. package/dist/theme-CKpIa4Fj.d.cts +536 -0
  407. package/dist/theme-CKpIa4Fj.d.ts +536 -0
  408. package/dist/theme-dials-config.cjs +273 -0
  409. package/dist/theme-dials-config.cjs.map +1 -0
  410. package/dist/theme-dials-config.d.cts +95 -0
  411. package/dist/theme-dials-config.d.ts +95 -0
  412. package/dist/theme-dials-config.js +269 -0
  413. package/dist/theme-dials-config.js.map +1 -0
  414. package/dist/theme-presets.cjs +922 -0
  415. package/dist/theme-presets.cjs.map +1 -0
  416. package/dist/theme-presets.d.cts +89 -0
  417. package/dist/theme-presets.d.ts +89 -0
  418. package/dist/theme-presets.js +912 -0
  419. package/dist/theme-presets.js.map +1 -0
  420. package/dist/theme-tuning-CTOHSrsh.d.cts +158 -0
  421. package/dist/theme-tuning-DOko6Pmy.d.ts +158 -0
  422. package/dist/theme-tuning.cjs +349 -0
  423. package/dist/theme-tuning.cjs.map +1 -0
  424. package/dist/theme-tuning.d.cts +2 -0
  425. package/dist/theme-tuning.d.ts +2 -0
  426. package/dist/theme-tuning.js +333 -0
  427. package/dist/theme-tuning.js.map +1 -0
  428. package/dist/theme.cjs +438 -0
  429. package/dist/theme.cjs.map +1 -0
  430. package/dist/theme.d.cts +2 -0
  431. package/dist/theme.d.ts +2 -0
  432. package/dist/theme.js +436 -0
  433. package/dist/theme.js.map +1 -0
  434. package/dist/toast-08jF1DBQ.cjs +193 -0
  435. package/dist/toast-08jF1DBQ.cjs.map +1 -0
  436. package/dist/toast-CVW5XY4u.js +164 -0
  437. package/dist/toast-CVW5XY4u.js.map +1 -0
  438. package/dist/toast-details-BdxxSLlN.cjs +209 -0
  439. package/dist/toast-details-BdxxSLlN.cjs.map +1 -0
  440. package/dist/toast-details-CfsB1Vxb.js +198 -0
  441. package/dist/toast-details-CfsB1Vxb.js.map +1 -0
  442. package/dist/{tooltip-CTRQoN1A.d.ts → tooltip-Fqb4JK-g.d.cts} +2 -2
  443. package/dist/{tooltip-CTRQoN1A.d.cts → tooltip-Fqb4JK-g.d.ts} +2 -2
  444. package/dist/tuning-BKVFsxLr.js +48 -0
  445. package/dist/tuning-BKVFsxLr.js.map +1 -0
  446. package/dist/tuning-BRPG7U1U.cjs +71 -0
  447. package/dist/tuning-BRPG7U1U.cjs.map +1 -0
  448. package/dist/use-document-theme-BSEuNsEE.cjs +43 -0
  449. package/dist/use-document-theme-BSEuNsEE.cjs.map +1 -0
  450. package/dist/use-document-theme-Ch_PqxZz.js +38 -0
  451. package/dist/use-document-theme-Ch_PqxZz.js.map +1 -0
  452. package/dist/use-scroll-fade-CaHp52u4.cjs +79 -0
  453. package/dist/use-scroll-fade-CaHp52u4.cjs.map +1 -0
  454. package/dist/use-scroll-fade-ilq-o00-.js +72 -0
  455. package/dist/use-scroll-fade-ilq-o00-.js.map +1 -0
  456. package/package.json +166 -27
  457. package/src/styles/globals.css +194 -97
  458. package/dist/ai-CiaH2sfF.js.map +0 -1
  459. package/dist/ai-lAkichk8.cjs.map +0 -1
  460. package/dist/button-Bvh83YGs.d.cts +0 -20
  461. package/dist/button-Bvh83YGs.d.ts +0 -20
  462. package/dist/components/app-bar.cjs +0 -81
  463. package/dist/components/app-bar.cjs.map +0 -1
  464. package/dist/components/app-bar.d.cts +0 -27
  465. package/dist/components/app-bar.d.ts +0 -27
  466. package/dist/components/app-bar.js +0 -77
  467. package/dist/components/app-bar.js.map +0 -1
  468. package/dist/components/app-shell.cjs +0 -267
  469. package/dist/components/app-shell.cjs.map +0 -1
  470. package/dist/components/app-shell.d.cts +0 -98
  471. package/dist/components/app-shell.d.ts +0 -98
  472. package/dist/components/app-shell.js +0 -264
  473. package/dist/components/app-shell.js.map +0 -1
  474. package/dist/components/json-input.cjs.map +0 -1
  475. package/dist/components/json-input.js.map +0 -1
  476. package/dist/input-CBrCuMH8.d.cts +0 -11
  477. package/dist/input-CBrCuMH8.d.ts +0 -11
  478. package/dist/motion-config-COCFHq1L.cjs.map +0 -1
  479. package/dist/motion-config-COsZ6azM.js.map +0 -1
  480. package/dist/record-picker-BbxngCeV.js.map +0 -1
  481. package/dist/record-picker-Bz4FApxD.cjs.map +0 -1
  482. package/dist/separator-BQEsr0Rc.d.cts +0 -11
  483. package/dist/separator-BQEsr0Rc.d.ts +0 -11
  484. package/dist/sheet-BLHnhLRH.js.map +0 -1
  485. package/dist/sheet-BdA0rfIz.cjs.map +0 -1
  486. package/dist/sidebar-BavjjJp0.cjs.map +0 -1
  487. package/dist/sidebar-DeoL2ttp.js.map +0 -1
  488. package/dist/stack-C9GROTGA.js.map +0 -1
  489. package/dist/stack-ci2lkfkr.cjs.map +0 -1
  490. package/dist/toast-D6MqijT2.cjs +0 -316
  491. package/dist/toast-D6MqijT2.cjs.map +0 -1
  492. package/dist/toast-D_BOLzm3.js +0 -287
  493. package/dist/toast-D_BOLzm3.js.map +0 -1
@@ -0,0 +1,220 @@
1
+ 'use client';
2
+
3
+ import { t as cn } from "../utils-BkMLyah9.js";
4
+ import { InputGroup, InputGroupInput } from "./input-group.js";
5
+ import { Combobox, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, ComboboxTrigger, useComboboxFilter } from "./combobox.js";
6
+ import { useMemo, useSyncExternalStore } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { ChevronDownIcon, GlobeIcon } from "lucide-react";
9
+ import * as BasePhoneInput from "react-phone-number-input";
10
+
11
+ //#region src/components/phone-input.tsx
12
+ const FALLBACK_COUNTRY = "US";
13
+ const E164 = /^\+[1-9]\d{6,14}$/;
14
+ const defaultLabels = {
15
+ country: "Country: {{country}}",
16
+ countryFallback: "Country",
17
+ search: "Search countries",
18
+ empty: "No country found."
19
+ };
20
+ /**
21
+ * The user's region from their browser's language preferences, e.g. `en-GB` → GB, or `de` → DE by likely
22
+ * subtags. The first one the picker supports wins. There is no browser API from a timezone to a country, and a
23
+ * locale's region is the signal the browser does carry.
24
+ */
25
+ function detectCountry(languages = typeof navigator === "undefined" ? [] : navigator.languages ?? [navigator.language]) {
26
+ for (const tag of languages) try {
27
+ const region = new Intl.Locale(tag).maximize().region;
28
+ if (region && BasePhoneInput.isSupportedCountry(region)) return region;
29
+ } catch {}
30
+ }
31
+ function subscribeToLanguage(onChange) {
32
+ window.addEventListener("languagechange", onChange);
33
+ return () => window.removeEventListener("languagechange", onChange);
34
+ }
35
+ let detected;
36
+ function detectedCountrySnapshot() {
37
+ const languages = navigator.languages ?? [navigator.language];
38
+ const key = languages.join();
39
+ if (detected?.languages !== key) detected = {
40
+ languages: key,
41
+ country: detectCountry(languages) ?? FALLBACK_COUNTRY
42
+ };
43
+ return detected.country;
44
+ }
45
+ /**
46
+ * The server renders the fallback so hydration matches; the client then reports the detected country, which the
47
+ * phone field adopts only while the user has not typed a number or picked a country.
48
+ */
49
+ function useDetectedCountry() {
50
+ return useSyncExternalStore(subscribeToLanguage, detectedCountrySnapshot, () => FALLBACK_COUNTRY);
51
+ }
52
+ let flagComponents;
53
+ let flagsRequest;
54
+ const flagListeners = /* @__PURE__ */ new Set();
55
+ function subscribeToFlags(onChange) {
56
+ flagListeners.add(onChange);
57
+ flagsRequest ??= import("react-phone-number-input/flags").then((module) => {
58
+ flagComponents = module.default;
59
+ for (const listener of flagListeners) listener();
60
+ });
61
+ return () => flagListeners.delete(onChange);
62
+ }
63
+ function useFlagComponents() {
64
+ return useSyncExternalStore(subscribeToFlags, () => flagComponents, () => void 0);
65
+ }
66
+ /** Returns the number in E.164 form, or null when it is not a possible number for its country. */
67
+ function normalizePhoneNumber(raw) {
68
+ const digits = raw.replace(/[\s().-]/g, "");
69
+ const candidate = digits.startsWith("00") ? `+${digits.slice(2)}` : digits;
70
+ return E164.test(candidate) && BasePhoneInput.isPossiblePhoneNumber(candidate) ? candidate : null;
71
+ }
72
+ /** International grouping for reading, e.g. +1 202 555 0143; unparseable input is returned as-is. */
73
+ function formatPhoneNumber(e164) {
74
+ return BasePhoneInput.formatPhoneNumberIntl(e164) || e164;
75
+ }
76
+ /** The country calling code a number carries, e.g. +1, +44, +353; '' when it cannot be parsed. */
77
+ function phoneCallingCode(e164) {
78
+ const code = BasePhoneInput.parsePhoneNumber(e164)?.countryCallingCode;
79
+ return code ? `+${code}` : "";
80
+ }
81
+ /** Country picker + national-format number field; digits only, emits E.164. Defaults to the user's region. */
82
+ function PhoneInput({ className, value, onChange, defaultCountry, invalid, disabled, labels: labelOverrides, ...props }) {
83
+ const detected = useDetectedCountry();
84
+ const labels = {
85
+ ...defaultLabels,
86
+ ...labelOverrides
87
+ };
88
+ return /* @__PURE__ */ jsx(BasePhoneInput.default, {
89
+ className,
90
+ value: value || void 0,
91
+ onChange: (next) => onChange(next ?? ""),
92
+ defaultCountry: defaultCountry ?? detected,
93
+ initialValueFormat: "national",
94
+ disabled,
95
+ addInternationalOption: false,
96
+ limitMaxLength: true,
97
+ focusInputOnCountrySelection: true,
98
+ containerComponent: PhoneInputGroup,
99
+ countrySelectComponent: CountrySelect,
100
+ countrySelectProps: { labels },
101
+ inputComponent: NumberInput,
102
+ flagComponent: PhoneFlag,
103
+ "aria-invalid": invalid || void 0,
104
+ "data-slot": "phone-input",
105
+ ...props
106
+ });
107
+ }
108
+ function PhoneInputGroup({ className, children, ...props }) {
109
+ return /* @__PURE__ */ jsx(InputGroup, {
110
+ className: cn("overflow-hidden", className),
111
+ ...props,
112
+ children
113
+ });
114
+ }
115
+ function NumberInput({ className, ...props }) {
116
+ return /* @__PURE__ */ jsx(InputGroupInput, {
117
+ className: cn("tabular-nums", className),
118
+ ...props
119
+ });
120
+ }
121
+ function CountrySelect({ value, onChange, options, disabled, labels }) {
122
+ const items = useMemo(() => options.flatMap((option) => option.value ? [{
123
+ value: option.value,
124
+ label: option.label,
125
+ code: `+${BasePhoneInput.getCountryCallingCode(option.value)}`
126
+ }] : []), [options]);
127
+ const selected = items.find((item) => item.value === value) ?? null;
128
+ const { contains } = useComboboxFilter();
129
+ const matches = (item, query) => contains(item, query, (country) => `${country.label} ${country.code}`);
130
+ return /* @__PURE__ */ jsxs(Combobox, {
131
+ items,
132
+ value: selected,
133
+ filter: matches,
134
+ onValueChange: (next) => next && onChange(next.value),
135
+ disabled,
136
+ children: [/* @__PURE__ */ jsxs(ComboboxTrigger, {
137
+ "aria-label": selected ? labels.country.replace("{{country}}", selected.label) : labels.countryFallback,
138
+ "data-slot": "phone-input-country",
139
+ className: "flex shrink-0 cursor-pointer items-center gap-2 self-stretch border-e border-input ps-3 pe-2 text-sm tabular-nums text-foreground outline-none hover:bg-accent/60 focus-visible:bg-accent/60 disabled:cursor-not-allowed data-popup-open:bg-accent/60",
140
+ children: [
141
+ selected && /* @__PURE__ */ jsx(PhoneFlag, {
142
+ country: selected.value,
143
+ countryName: selected.label
144
+ }),
145
+ /* @__PURE__ */ jsx("span", {
146
+ dir: "ltr",
147
+ className: "[unicode-bidi:isolate]",
148
+ children: selected?.code
149
+ }),
150
+ /* @__PURE__ */ jsx(ChevronDownIcon, {
151
+ className: "size-3.5 text-muted-foreground",
152
+ "aria-hidden": true
153
+ })
154
+ ]
155
+ }), /* @__PURE__ */ jsxs(ComboboxPopup, {
156
+ style: { width: "17rem" },
157
+ align: "start",
158
+ children: [
159
+ /* @__PURE__ */ jsx("div", {
160
+ className: "border-b p-1",
161
+ children: /* @__PURE__ */ jsx(ComboboxInput, {
162
+ placeholder: labels.search,
163
+ showTrigger: false,
164
+ size: "sm"
165
+ })
166
+ }),
167
+ /* @__PURE__ */ jsx(ComboboxEmpty, { children: labels.empty }),
168
+ /* @__PURE__ */ jsx(ComboboxList, { children: (item) => /* @__PURE__ */ jsx(ComboboxItem, {
169
+ value: item,
170
+ children: /* @__PURE__ */ jsxs("span", {
171
+ className: "flex items-center gap-2",
172
+ children: [
173
+ /* @__PURE__ */ jsx(PhoneFlag, {
174
+ country: item.value,
175
+ countryName: item.label
176
+ }),
177
+ /* @__PURE__ */ jsx("span", {
178
+ className: "min-w-0 flex-1 truncate",
179
+ title: item.label,
180
+ children: item.label
181
+ }),
182
+ /* @__PURE__ */ jsx("span", {
183
+ dir: "ltr",
184
+ className: "text-xs tabular-nums text-muted-foreground [unicode-bidi:isolate]",
185
+ children: item.code
186
+ })
187
+ ]
188
+ })
189
+ }, item.value) })
190
+ ]
191
+ })]
192
+ });
193
+ }
194
+ /** 3:2 flag with a faint inset edge so white-heavy flags keep their shape on any surface. */
195
+ function PhoneFlag({ country, countryName }) {
196
+ const Svg = useFlagComponents()?.[country];
197
+ return /* @__PURE__ */ jsx("span", {
198
+ "data-slot": "phone-flag",
199
+ className: "relative flex h-3 w-4.5 shrink-0 overflow-hidden rounded-[2px] bg-muted after:absolute after:inset-0 after:rounded-[inherit] after:outline after:-outline-offset-1 after:outline-black/10 dark:after:outline-white/10 [&_svg]:size-full",
200
+ children: Svg && /* @__PURE__ */ jsx(Svg, { title: countryName })
201
+ });
202
+ }
203
+ /** The flag of the country an E.164 number belongs to; a neutral globe when the number cannot be placed. */
204
+ function CountryFlag({ number, className }) {
205
+ const country = BasePhoneInput.parsePhoneNumber(number)?.country;
206
+ return /* @__PURE__ */ jsx("span", {
207
+ className: cn("flex h-3 w-4.5 shrink-0 items-center justify-center", className),
208
+ children: country ? /* @__PURE__ */ jsx(PhoneFlag, {
209
+ country,
210
+ countryName: country
211
+ }) : /* @__PURE__ */ jsx(GlobeIcon, {
212
+ className: "size-3.5 text-muted-foreground",
213
+ "aria-hidden": true
214
+ })
215
+ });
216
+ }
217
+
218
+ //#endregion
219
+ export { CountryFlag, PhoneInput, detectCountry, formatPhoneNumber, normalizePhoneNumber, phoneCallingCode };
220
+ //# sourceMappingURL=phone-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-input.js","names":[],"sources":["../../src/components/phone-input.tsx"],"sourcesContent":["'use client';\n\n// Adapted from ReUI Phone Input (MIT), https://reui.io/docs/components/phone-input, rebuilt on the Constructive\n// Combobox and InputGroup so it shares their focus, invalid and popup styling.\n\nimport { useMemo, useSyncExternalStore } from 'react';\nimport type * as React from 'react';\nimport { ChevronDownIcon, GlobeIcon } from 'lucide-react';\nimport * as BasePhoneInput from 'react-phone-number-input';\n\nimport { cn } from '../lib/utils';\nimport {\n\tCombobox,\n\tComboboxEmpty,\n\tComboboxInput,\n\tComboboxItem,\n\tComboboxList,\n\tComboboxPopup,\n\tComboboxTrigger,\n\tuseComboboxFilter,\n} from './combobox';\nimport { InputGroup, InputGroupInput } from './input-group';\n\ntype PhoneCountry = BasePhoneInput.Country;\n\ntype PhoneInputLabels = {\n\t/** Accessible name of the country picker; `{{country}}` is replaced with the selected country's name. */\n\tcountry: string;\n\tcountryFallback: string;\n\tsearch: string;\n\tempty: string;\n};\n\ntype PhoneInputProps = Omit<React.ComponentProps<'input'>, 'onChange' | 'value' | 'ref' | 'size' | 'defaultValue'> & {\n\t/** E.164, or '' when empty. */\n\tvalue: string;\n\tonChange: (value: string) => void;\n\t/** Overrides the country detected from the browser's language preferences. */\n\tdefaultCountry?: PhoneCountry;\n\tinvalid?: boolean;\n\tlabels?: Partial<PhoneInputLabels>;\n};\n\nconst FALLBACK_COUNTRY: PhoneCountry = 'US';\nconst E164 = /^\\+[1-9]\\d{6,14}$/;\n\nconst defaultLabels: PhoneInputLabels = {\n\tcountry: 'Country: {{country}}',\n\tcountryFallback: 'Country',\n\tsearch: 'Search countries',\n\tempty: 'No country found.',\n};\n\n/**\n * The user's region from their browser's language preferences, e.g. `en-GB` → GB, or `de` → DE by likely\n * subtags. The first one the picker supports wins. There is no browser API from a timezone to a country, and a\n * locale's region is the signal the browser does carry.\n */\nfunction detectCountry(\n\tlanguages: readonly string[] = typeof navigator === 'undefined' ? [] : (navigator.languages ?? [navigator.language]),\n): PhoneCountry | undefined {\n\tfor (const tag of languages) {\n\t\ttry {\n\t\t\tconst region = new Intl.Locale(tag).maximize().region;\n\t\t\tif (region && BasePhoneInput.isSupportedCountry(region)) return region;\n\t\t} catch {\n\t\t\t// A malformed tag says nothing about the region; the next preference might.\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction subscribeToLanguage(onChange: () => void) {\n\twindow.addEventListener('languagechange', onChange);\n\treturn () => window.removeEventListener('languagechange', onChange);\n}\n\n// getSnapshot runs on every render, so the Intl work only reruns when the language list itself changes.\nlet detected: { languages: string; country: PhoneCountry } | undefined;\nfunction detectedCountrySnapshot(): PhoneCountry {\n\tconst languages = navigator.languages ?? [navigator.language];\n\tconst key = languages.join();\n\tif (detected?.languages !== key) detected = { languages: key, country: detectCountry(languages) ?? FALLBACK_COUNTRY };\n\treturn detected.country;\n}\n\n/**\n * The server renders the fallback so hydration matches; the client then reports the detected country, which the\n * phone field adopts only while the user has not typed a number or picked a country.\n */\nfunction useDetectedCountry() {\n\treturn useSyncExternalStore(subscribeToLanguage, detectedCountrySnapshot, () => FALLBACK_COUNTRY);\n}\n\n// The full flag set is about as large as the phone metadata itself (~50 kB gzipped), so it loads in its own chunk\n// the first time a flag renders. Until then, flags show their muted 18×12 tile, so nothing shifts when they arrive.\nlet flagComponents: BasePhoneInput.Flags | undefined;\nlet flagsRequest: Promise<void> | undefined;\nconst flagListeners = new Set<() => void>();\n\nfunction subscribeToFlags(onChange: () => void) {\n\tflagListeners.add(onChange);\n\tflagsRequest ??= import('react-phone-number-input/flags').then((module) => {\n\t\tflagComponents = module.default;\n\t\tfor (const listener of flagListeners) listener();\n\t});\n\treturn () => flagListeners.delete(onChange);\n}\n\nfunction useFlagComponents() {\n\treturn useSyncExternalStore<BasePhoneInput.Flags | undefined>(\n\t\tsubscribeToFlags,\n\t\t() => flagComponents,\n\t\t() => undefined,\n\t);\n}\n\n/** Returns the number in E.164 form, or null when it is not a possible number for its country. */\nfunction normalizePhoneNumber(raw: string): string | null {\n\tconst digits = raw.replace(/[\\s().-]/g, '');\n\tconst candidate = digits.startsWith('00') ? `+${digits.slice(2)}` : digits;\n\treturn E164.test(candidate) && BasePhoneInput.isPossiblePhoneNumber(candidate) ? candidate : null;\n}\n\n/** International grouping for reading, e.g. +1 202 555 0143; unparseable input is returned as-is. */\nfunction formatPhoneNumber(e164: string): string {\n\treturn BasePhoneInput.formatPhoneNumberIntl(e164) || e164;\n}\n\n/** The country calling code a number carries, e.g. +1, +44, +353; '' when it cannot be parsed. */\nfunction phoneCallingCode(e164: string): string {\n\tconst code = BasePhoneInput.parsePhoneNumber(e164)?.countryCallingCode;\n\treturn code ? `+${code}` : '';\n}\n\n/** Country picker + national-format number field; digits only, emits E.164. Defaults to the user's region. */\nfunction PhoneInput({\n\tclassName,\n\tvalue,\n\tonChange,\n\tdefaultCountry,\n\tinvalid,\n\tdisabled,\n\tlabels: labelOverrides,\n\t...props\n}: PhoneInputProps) {\n\tconst detected = useDetectedCountry();\n\tconst labels = { ...defaultLabels, ...labelOverrides };\n\treturn (\n\t\t<BasePhoneInput.default\n\t\t\tclassName={className}\n\t\t\tvalue={value || undefined}\n\t\t\tonChange={(next) => onChange(next ?? '')}\n\t\t\tdefaultCountry={defaultCountry ?? detected}\n\t\t\t// The picker already shows the calling code, so a stored E.164 value renders in national form.\n\t\t\tinitialValueFormat=\"national\"\n\t\t\tdisabled={disabled}\n\t\t\taddInternationalOption={false}\n\t\t\t// A number past the country's longest valid length is not E.164; stop accepting digits there.\n\t\t\tlimitMaxLength\n\t\t\tfocusInputOnCountrySelection\n\t\t\tcontainerComponent={PhoneInputGroup}\n\t\t\tcountrySelectComponent={CountrySelect}\n\t\t\tcountrySelectProps={{ labels }}\n\t\t\tinputComponent={NumberInput}\n\t\t\tflagComponent={PhoneFlag}\n\t\t\taria-invalid={invalid || undefined}\n\t\t\tdata-slot=\"phone-input\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction PhoneInputGroup({ className, children, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<InputGroup className={cn('overflow-hidden', className)} {...props}>\n\t\t\t{children}\n\t\t</InputGroup>\n\t);\n}\n\nfunction NumberInput({ className, ...props }: React.ComponentProps<typeof InputGroupInput>) {\n\treturn <InputGroupInput className={cn('tabular-nums', className)} {...props} />;\n}\n\ntype CountryOption = { value?: PhoneCountry; label: string };\ntype CountryItem = { value: PhoneCountry; label: string; code: string };\n\nfunction CountrySelect({\n\tvalue,\n\tonChange,\n\toptions,\n\tdisabled,\n\tlabels,\n}: {\n\tvalue?: PhoneCountry;\n\tonChange: (country?: PhoneCountry) => void;\n\toptions: CountryOption[];\n\tdisabled?: boolean;\n\tlabels: PhoneInputLabels;\n}) {\n\tconst items = useMemo<CountryItem[]>(\n\t\t() =>\n\t\t\toptions.flatMap((option) =>\n\t\t\t\toption.value\n\t\t\t\t\t? [{ value: option.value, label: option.label, code: `+${BasePhoneInput.getCountryCallingCode(option.value)}` }]\n\t\t\t\t\t: [],\n\t\t\t),\n\t\t[options],\n\t);\n\tconst selected = items.find((item) => item.value === value) ?? null;\n\t// Rows show their calling code, so the picker matches on it as well as on the name (\"+44\", \"44\", \"kingdom\").\n\tconst { contains } = useComboboxFilter();\n\tconst matches = (item: CountryItem, query: string) => contains(item, query, (country) => `${country.label} ${country.code}`);\n\n\treturn (\n\t\t<Combobox\n\t\t\titems={items}\n\t\t\tvalue={selected}\n\t\t\tfilter={matches}\n\t\t\tonValueChange={(next) => next && onChange(next.value)}\n\t\t\tdisabled={disabled}\n\t\t>\n\t\t\t<ComboboxTrigger\n\t\t\t\taria-label={selected ? labels.country.replace('{{country}}', selected.label) : labels.countryFallback}\n\t\t\t\tdata-slot=\"phone-input-country\"\n\t\t\t\tclassName=\"flex shrink-0 cursor-pointer items-center gap-2 self-stretch border-e border-input ps-3 pe-2 text-sm tabular-nums text-foreground outline-none hover:bg-accent/60 focus-visible:bg-accent/60 disabled:cursor-not-allowed data-popup-open:bg-accent/60\"\n\t\t\t>\n\t\t\t\t{selected && <PhoneFlag country={selected.value} countryName={selected.label} />}\n\t\t\t\t<span dir=\"ltr\" className=\"[unicode-bidi:isolate]\">\n\t\t\t\t\t{selected?.code}\n\t\t\t\t</span>\n\t\t\t\t<ChevronDownIcon className=\"size-3.5 text-muted-foreground\" aria-hidden />\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxPopup style={{ width: '17rem' }} align=\"start\">\n\t\t\t\t<div className=\"border-b p-1\">\n\t\t\t\t\t<ComboboxInput placeholder={labels.search} showTrigger={false} size=\"sm\" />\n\t\t\t\t</div>\n\t\t\t\t<ComboboxEmpty>{labels.empty}</ComboboxEmpty>\n\t\t\t\t<ComboboxList>\n\t\t\t\t\t{(item: CountryItem) => (\n\t\t\t\t\t\t<ComboboxItem key={item.value} value={item}>\n\t\t\t\t\t\t\t<span className=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<PhoneFlag country={item.value} countryName={item.label} />\n\t\t\t\t\t\t\t\t<span className=\"min-w-0 flex-1 truncate\" title={item.label}>\n\t\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span dir=\"ltr\" className=\"text-xs tabular-nums text-muted-foreground [unicode-bidi:isolate]\">\n\t\t\t\t\t\t\t\t\t{item.code}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</ComboboxItem>\n\t\t\t\t\t)}\n\t\t\t\t</ComboboxList>\n\t\t\t</ComboboxPopup>\n\t\t</Combobox>\n\t);\n}\n\n/** 3:2 flag with a faint inset edge so white-heavy flags keep their shape on any surface. */\nfunction PhoneFlag({ country, countryName }: { country: PhoneCountry; countryName: string }) {\n\tconst Svg = useFlagComponents()?.[country];\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"phone-flag\"\n\t\t\tclassName=\"relative flex h-3 w-4.5 shrink-0 overflow-hidden rounded-[2px] bg-muted after:absolute after:inset-0 after:rounded-[inherit] after:outline after:-outline-offset-1 after:outline-black/10 dark:after:outline-white/10 [&_svg]:size-full\"\n\t\t>\n\t\t\t{Svg && <Svg title={countryName} />}\n\t\t</span>\n\t);\n}\n\n/** The flag of the country an E.164 number belongs to; a neutral globe when the number cannot be placed. */\nfunction CountryFlag({ number, className }: { number: string; className?: string }) {\n\tconst country = BasePhoneInput.parsePhoneNumber(number)?.country;\n\treturn (\n\t\t<span className={cn('flex h-3 w-4.5 shrink-0 items-center justify-center', className)}>\n\t\t\t{country ? (\n\t\t\t\t<PhoneFlag country={country} countryName={country} />\n\t\t\t) : (\n\t\t\t\t<GlobeIcon className=\"size-3.5 text-muted-foreground\" aria-hidden />\n\t\t\t)}\n\t\t</span>\n\t);\n}\n\nexport { CountryFlag, detectCountry, formatPhoneNumber, normalizePhoneNumber, PhoneInput, phoneCallingCode };\nexport type { PhoneCountry, PhoneInputLabels, PhoneInputProps };\n"],"mappings":";;;;;;;;;;;AA2CA,MAAM,mBAAiC;AACvC,MAAM,OAAO;AAEb,MAAM,gBAAkC;CACvC,SAAS;CACT,iBAAiB;CACjB,QAAQ;CACR,OAAO;AACR;;;;;;AAOA,SAAS,cACR,YAA+B,OAAO,cAAc,cAAc,CAAC,IAAK,UAAU,aAAa,CAAC,UAAU,QAAQ,GACvF;CAC3B,KAAK,MAAM,OAAO,WACjB,IAAI;EACH,MAAM,SAAS,IAAI,KAAK,OAAO,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;EAC/C,IAAI,UAAU,eAAe,mBAAmB,MAAM,GAAG,OAAO;CACjE,QAAQ,CAER;AAGF;AAEA,SAAS,oBAAoB,UAAsB;CAClD,OAAO,iBAAiB,kBAAkB,QAAQ;CAClD,aAAa,OAAO,oBAAoB,kBAAkB,QAAQ;AACnE;AAGA,IAAI;AACJ,SAAS,0BAAwC;CAChD,MAAM,YAAY,UAAU,aAAa,CAAC,UAAU,QAAQ;CAC5D,MAAM,MAAM,UAAU,KAAK;CAC3B,IAAI,UAAU,cAAc,KAAK,WAAW;EAAE,WAAW;EAAK,SAAS,cAAc,SAAS,KAAK;CAAiB;CACpH,OAAO,SAAS;AACjB;;;;;AAMA,SAAS,qBAAqB;CAC7B,OAAO,qBAAqB,qBAAqB,+BAA+B,gBAAgB;AACjG;AAIA,IAAI;AACJ,IAAI;AACJ,MAAM,gCAAgB,IAAI,IAAgB;AAE1C,SAAS,iBAAiB,UAAsB;CAC/C,cAAc,IAAI,QAAQ;CAC1B,iBAAiB,OAAO,iCAAiC,CAAC,MAAM,WAAW;EAC1E,iBAAiB,OAAO;EACxB,KAAK,MAAM,YAAY,eAAe,SAAS;CAChD,CAAC;CACD,aAAa,cAAc,OAAO,QAAQ;AAC3C;AAEA,SAAS,oBAAoB;CAC5B,OAAO,qBACN,wBACM,sBACA,MACP;AACD;;AAGA,SAAS,qBAAqB,KAA4B;CACzD,MAAM,SAAS,IAAI,QAAQ,aAAa,EAAE;CAC1C,MAAM,YAAY,OAAO,WAAW,IAAI,IAAI,IAAI,OAAO,MAAM,CAAC,MAAM;CACpE,OAAO,KAAK,KAAK,SAAS,KAAK,eAAe,sBAAsB,SAAS,IAAI,YAAY;AAC9F;;AAGA,SAAS,kBAAkB,MAAsB;CAChD,OAAO,eAAe,sBAAsB,IAAI,KAAK;AACtD;;AAGA,SAAS,iBAAiB,MAAsB;CAC/C,MAAM,OAAO,eAAe,iBAAiB,IAAI,CAAC,EAAE;CACpD,OAAO,OAAO,IAAI,SAAS;AAC5B;;AAGA,SAAS,WAAW,EACnB,WACA,OACA,UACA,gBACA,SACA,UACA,QAAQ,gBACR,GAAG,SACgB;CACnB,MAAM,WAAW,mBAAmB;CACpC,MAAM,SAAS;EAAE,GAAG;EAAe,GAAG;CAAe;CACrD,OACC,oBAAC,eAAe,SAAhB;EACY;EACX,OAAO,SAAS;EAChB,WAAW,SAAS,SAAS,QAAQ,EAAE;EACvC,gBAAgB,kBAAkB;EAElC,oBAAmB;EACT;EACV,wBAAwB;EAExB;EACA;EACA,oBAAoB;EACpB,wBAAwB;EACxB,oBAAoB,EAAE,OAAO;EAC7B,gBAAgB;EAChB,eAAe;EACf,gBAAc,WAAW;EACzB,aAAU;EACV,GAAI;CACJ;AAEH;AAEA,SAAS,gBAAgB,EAAE,WAAW,UAAU,GAAG,SAAsC;CACxF,OACC,oBAAC,YAAD;EAAY,WAAW,GAAG,mBAAmB,SAAS;EAAG,GAAI;EAC3D;CACU;AAEd;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAuD;CAC3F,OAAO,oBAAC,iBAAD;EAAiB,WAAW,GAAG,gBAAgB,SAAS;EAAG,GAAI;CAAQ;AAC/E;AAKA,SAAS,cAAc,EACtB,OACA,UACA,SACA,UACA,UAOE;CACF,MAAM,QAAQ,cAEZ,QAAQ,SAAS,WAChB,OAAO,QACJ,CAAC;EAAE,OAAO,OAAO;EAAO,OAAO,OAAO;EAAO,MAAM,IAAI,eAAe,sBAAsB,OAAO,KAAK;CAAI,CAAC,IAC7G,CAAC,CACL,GACD,CAAC,OAAO,CACT;CACA,MAAM,WAAW,MAAM,MAAM,SAAS,KAAK,UAAU,KAAK,KAAK;CAE/D,MAAM,EAAE,aAAa,kBAAkB;CACvC,MAAM,WAAW,MAAmB,UAAkB,SAAS,MAAM,QAAQ,YAAY,GAAG,QAAQ,MAAM,GAAG,QAAQ,MAAM;CAE3H,OACC,qBAAC,UAAD;EACQ;EACP,OAAO;EACP,QAAQ;EACR,gBAAgB,SAAS,QAAQ,SAAS,KAAK,KAAK;EAC1C;YALX,CAOC,qBAAC,iBAAD;GACC,cAAY,WAAW,OAAO,QAAQ,QAAQ,eAAe,SAAS,KAAK,IAAI,OAAO;GACtF,aAAU;GACV,WAAU;aAHX;IAKE,YAAY,oBAAC,WAAD;KAAW,SAAS,SAAS;KAAO,aAAa,SAAS;IAAQ;IAC/E,oBAAC,QAAD;KAAM,KAAI;KAAM,WAAU;eACxB,UAAU;IACN;IACN,oBAAC,iBAAD;KAAiB,WAAU;KAAiC;IAAa;GACzD;MACjB,qBAAC,eAAD;GAAe,OAAO,EAAE,OAAO,QAAQ;GAAG,OAAM;aAAhD;IACC,oBAAC,OAAD;KAAK,WAAU;eACd,oBAAC,eAAD;MAAe,aAAa,OAAO;MAAQ,aAAa;MAAO,MAAK;KAAM;IACtE;IACL,oBAAC,eAAD,YAAgB,OAAO,MAAqB;IAC5C,oBAAC,cAAD,aACG,SACD,oBAAC,cAAD;KAA+B,OAAO;eACrC,qBAAC,QAAD;MAAM,WAAU;gBAAhB;OACC,oBAAC,WAAD;QAAW,SAAS,KAAK;QAAO,aAAa,KAAK;OAAQ;OAC1D,oBAAC,QAAD;QAAM,WAAU;QAA0B,OAAO,KAAK;kBACpD,KAAK;OACD;OACN,oBAAC,QAAD;QAAM,KAAI;QAAM,WAAU;kBACxB,KAAK;OACD;MACD;;IACO,GAVK,KAAK,KAUV,EAEF;GACA;IACN;;AAEZ;;AAGA,SAAS,UAAU,EAAE,SAAS,eAA+D;CAC5F,MAAM,MAAM,kBAAkB,CAAC,GAAG;CAClC,OACC,oBAAC,QAAD;EACC,aAAU;EACV,WAAU;YAET,OAAO,oBAAC,KAAD,EAAK,OAAO,YAAc;CAC7B;AAER;;AAGA,SAAS,YAAY,EAAE,QAAQ,aAAqD;CACnF,MAAM,UAAU,eAAe,iBAAiB,MAAM,CAAC,EAAE;CACzD,OACC,oBAAC,QAAD;EAAM,WAAW,GAAG,uDAAuD,SAAS;YAClF,UACA,oBAAC,WAAD;GAAoB;GAAS,aAAa;EAAU,KAEpD,oBAAC,WAAD;GAAW,WAAU;GAAiC;EAAa;CAE/D;AAER"}
@@ -36,6 +36,12 @@ function PopoverClose({ asChild, children, render, nativeButton, ...props }) {
36
36
  children: childRender ? void 0 : children
37
37
  });
38
38
  }
39
+ /**
40
+ * A lighter edge for compact menus that float over busy content: a hairline ring and a soft drop shadow in place of
41
+ * the border, on a 10px corner whose 4px inset gives rows a concentric 6px corner. Works on `PopoverContent` and on
42
+ * any panel that hangs beside one.
43
+ */
44
+ const popoverSurfaceClass = "rounded-lg border-0 bg-popover text-popover-foreground shadow-[0_0_0_1px_oklch(0_0_0/0.08),0_4px_16px_-4px_oklch(0_0_0/0.14)] dark:shadow-[0_0_0_1px_oklch(1_0_0/0.12),0_4px_16px_-4px_oklch(0_0_0/0.45)]";
39
45
  function PopoverContent({ className, align = "center", sideOffset = 4, showArrow = false, side = "bottom", children, onOpenAutoFocus: _onOpenAutoFocus, onCloseAutoFocus: _onCloseAutoFocus, onFocusOutside: _onFocusOutside, onEscapeKeyDown: _onEscapeKeyDown, ...props }) {
40
46
  const { container, zIndexClass } = (0, _constructive_io_ui_portal.useFloatingOverlayPortalProps)();
41
47
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_popover.Popover.Portal, {
@@ -47,13 +53,14 @@ function PopoverContent({ className, align = "center", sideOffset = 4, showArrow
47
53
  className: zIndexClass,
48
54
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_popover.Popover.Popup, {
49
55
  "data-slot": "popover-content",
50
- className: require_utils.cn(`bg-popover text-popover-foreground origin-(--transform-origin) w-72 rounded-md border p-4 shadow-md outline-hidden
51
- transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
56
+ className: require_utils.cn(`bg-popover text-popover-foreground origin-(--transform-origin) max-h-(--available-height) w-72 max-w-(--available-width)
57
+ rounded-lg border p-4 shadow-lg outline-hidden [overflow-wrap:break-word]
58
+ transition-[scale,opacity,translate] duration-(--duration-moderate) ease-out data-starting-style:scale-95
52
59
  data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
53
60
  data-[side=bottom]:data-starting-style:-translate-y-2
54
61
  data-[side=left]:data-starting-style:translate-x-2
55
62
  data-[side=right]:data-starting-style:-translate-x-2
56
- data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`, className),
63
+ data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`, !showArrow && "overflow-y-auto overscroll-contain", className),
57
64
  ...props,
58
65
  children: [children, showArrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_popover.Popover.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_var(--border)]" })]
59
66
  })
@@ -74,7 +81,7 @@ function PopoverAnchor({ ...props }) {
74
81
  function PopoverTitle({ className, ...props }) {
75
82
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_popover.Popover.Title, {
76
83
  "data-slot": "popover-title",
77
- className: require_utils.cn("font-medium leading-none", className),
84
+ className: require_utils.cn("font-medium leading-tight", className),
78
85
  ...props
79
86
  });
80
87
  }
@@ -94,4 +101,5 @@ exports.PopoverContent = PopoverContent;
94
101
  exports.PopoverDescription = PopoverDescription;
95
102
  exports.PopoverTitle = PopoverTitle;
96
103
  exports.PopoverTrigger = PopoverTrigger;
104
+ exports.popoverSurfaceClass = popoverSurfaceClass;
97
105
  //# sourceMappingURL=popover.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover.cjs","names":["PopoverPrimitive","React","cn"],"sources":["../../src/components/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\n\nimport { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n\treturn <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\ntype PopoverTriggerProps = React.ComponentProps<typeof PopoverPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction PopoverTrigger({ asChild, children, render, nativeButton, ...props }: PopoverTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<PopoverPrimitive.Trigger\n\t\t\tdata-slot=\"popover-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</PopoverPrimitive.Trigger>\n\t);\n}\n\ntype PopoverCloseProps = React.ComponentProps<typeof PopoverPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction PopoverClose({ asChild, children, render, nativeButton, ...props }: PopoverCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<PopoverPrimitive.Close\n\t\t\tdata-slot=\"popover-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</PopoverPrimitive.Close>\n\t);\n}\n\ntype PopoverContentProps = React.ComponentProps<typeof PopoverPrimitive.Popup> & {\n\talign?: 'start' | 'center' | 'end';\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\t/** @deprecated Base UI uses different focus management */\n\tonOpenAutoFocus?: (e: Event) => void;\n\t/** @deprecated Base UI uses different focus management */\n\tonCloseAutoFocus?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonFocusOutside?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonEscapeKeyDown?: () => void;\n};\n\nfunction PopoverContent({\n\tclassName,\n\talign = 'center',\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'bottom',\n\tchildren,\n\tonOpenAutoFocus: _onOpenAutoFocus,\n\tonCloseAutoFocus: _onCloseAutoFocus,\n\tonFocusOutside: _onFocusOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\t...props\n}: PopoverContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<PopoverPrimitive.Portal container={container}>\n\t\t\t<PopoverPrimitive.Positioner\n\t\t\t\tside={side}\n\t\t\t\talign={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={zIndexClass}\n\t\t\t>\n\t\t\t\t<PopoverPrimitive.Popup\n\t\t\t\t\tdata-slot=\"popover-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground origin-(--transform-origin) w-72 rounded-md border p-4 shadow-md outline-hidden\n\t\t\t\t\t\ttransition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95\n\t\t\t\t\t\tdata-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0\n\t\t\t\t\t\tdata-[side=bottom]:data-starting-style:-translate-y-2\n\t\t\t\t\t\tdata-[side=left]:data-starting-style:translate-x-2\n\t\t\t\t\t\tdata-[side=right]:data-starting-style:-translate-x-2\n\t\t\t\t\t\tdata-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<PopoverPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_var(--border)]' />\n\t\t\t\t\t)}\n\t\t\t\t</PopoverPrimitive.Popup>\n\t\t\t</PopoverPrimitive.Positioner>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n\n/**\n * PopoverAnchor - placeholder for positioning anchor.\n * @deprecated Base UI Popover positions relative to Trigger by default.\n * For custom anchoring, use Popover.Positioner with anchor prop.\n */\nfunction PopoverAnchor({ ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn <div data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverTitle({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Title>) {\n\treturn (\n\t\t<PopoverPrimitive.Title\n\t\t\tdata-slot=\"popover-title\"\n\t\t\tclassName={cn('font-medium leading-none', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction PopoverDescription({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Description>) {\n\treturn (\n\t\t<PopoverPrimitive.Description\n\t\t\tdata-slot=\"popover-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverClose,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;;;;AAQA,SAAS,QAAQ,EAAE,GAAG,SAA6D;CAClF,OAAO,2CAACA,+BAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ;AAC/D;AAOA,SAAS,eAAe,EAAE,SAAS,UAAU,QAAQ,cAAc,GAAG,SAA8B;CACnG,MAAM,cAAc,WAAW,UAAa,WAAWC,MAAM,eAAe,QAAQ,IAAI,WAAW;CAEnG,OACC,2CAACD,+BAAiB,SAAlB;EACC,aAAU;EACV,cAAc,iBAAiB,cAAc,OAAO;EACpD,QAAQ,UAAU;EAClB,GAAI;YAEH,cAAc,SAAY;CACF;AAE5B;AAOA,SAAS,aAAa,EAAE,SAAS,UAAU,QAAQ,cAAc,GAAG,SAA4B;CAC/F,MAAM,cAAc,WAAW,UAAa,WAAWC,MAAM,eAAe,QAAQ,IAAI,WAAW;CAEnG,OACC,2CAACD,+BAAiB,OAAlB;EACC,aAAU;EACV,cAAc,iBAAiB,cAAc,OAAO;EACpD,QAAQ,UAAU;EAClB,GAAI;YAEH,cAAc,SAAY;CACJ;AAE1B;AAiBA,SAAS,eAAe,EACvB,WACA,QAAQ,UACR,aAAa,GACb,YAAY,OACZ,OAAO,UACP,UACA,iBAAiB,kBACjB,kBAAkB,mBAClB,gBAAgB,iBAChB,iBAAiB,kBACjB,GAAG,SACoB;CACvB,MAAM,EAAE,WAAW,8EAA8C;CAEjE,OACC,2CAACA,+BAAiB,QAAlB;EAAoC;YACnC,2CAACA,+BAAiB,YAAlB;GACO;GACC;GACK;GACZ,WAAW;aAEX,4CAACA,+BAAiB,OAAlB;IACC,aAAU;IACV,WAAWE,iBACV;;;;;;wFAOA,SACD;IACA,GAAI;cAZL,CAcE,UACA,aACA,2CAACF,+BAAiB,OAAlB,EAAwB,WAAU,0DAA2D,EAEvE;;EACI;CACL;AAE3B;;;;;;AAOA,SAAS,cAAc,EAAE,GAAG,SAA+C;CAC1E,OAAO,2CAAC,OAAD;EAAK,aAAU;EAAiB,GAAI;CAAQ;AACpD;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAA8D;CACnG,OACC,2CAACA,+BAAiB,OAAlB;EACC,aAAU;EACV,WAAWE,iBAAG,4BAA4B,SAAS;EACnD,GAAI;CACJ;AAEH;AAEA,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAoE;CAC/G,OACC,2CAACF,+BAAiB,aAAlB;EACC,aAAU;EACV,WAAWE,iBAAG,iCAAiC,SAAS;EACxD,GAAI;CACJ;AAEH"}
1
+ {"version":3,"file":"popover.cjs","names":["PopoverPrimitive","React","cn"],"sources":["../../src/components/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\n\nimport { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n\treturn <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\ntype PopoverTriggerProps = React.ComponentProps<typeof PopoverPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction PopoverTrigger({ asChild, children, render, nativeButton, ...props }: PopoverTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<PopoverPrimitive.Trigger\n\t\t\tdata-slot=\"popover-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</PopoverPrimitive.Trigger>\n\t);\n}\n\ntype PopoverCloseProps = React.ComponentProps<typeof PopoverPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction PopoverClose({ asChild, children, render, nativeButton, ...props }: PopoverCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<PopoverPrimitive.Close\n\t\t\tdata-slot=\"popover-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</PopoverPrimitive.Close>\n\t);\n}\n\n/**\n * A lighter edge for compact menus that float over busy content: a hairline ring and a soft drop shadow in place of\n * the border, on a 10px corner whose 4px inset gives rows a concentric 6px corner. Works on `PopoverContent` and on\n * any panel that hangs beside one.\n */\nconst popoverSurfaceClass =\n\t'rounded-lg border-0 bg-popover text-popover-foreground shadow-[0_0_0_1px_oklch(0_0_0/0.08),0_4px_16px_-4px_oklch(0_0_0/0.14)] dark:shadow-[0_0_0_1px_oklch(1_0_0/0.12),0_4px_16px_-4px_oklch(0_0_0/0.45)]';\n\ntype PopoverContentProps = React.ComponentProps<typeof PopoverPrimitive.Popup> & {\n\talign?: 'start' | 'center' | 'end';\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\t/** @deprecated Base UI uses different focus management */\n\tonOpenAutoFocus?: (e: Event) => void;\n\t/** @deprecated Base UI uses different focus management */\n\tonCloseAutoFocus?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonFocusOutside?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonEscapeKeyDown?: () => void;\n};\n\nfunction PopoverContent({\n\tclassName,\n\talign = 'center',\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'bottom',\n\tchildren,\n\tonOpenAutoFocus: _onOpenAutoFocus,\n\tonCloseAutoFocus: _onCloseAutoFocus,\n\tonFocusOutside: _onFocusOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\t...props\n}: PopoverContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<PopoverPrimitive.Portal container={container}>\n\t\t\t<PopoverPrimitive.Positioner\n\t\t\t\tside={side}\n\t\t\t\talign={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={zIndexClass}\n\t\t\t>\n\t\t\t\t<PopoverPrimitive.Popup\n\t\t\t\t\tdata-slot=\"popover-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground origin-(--transform-origin) max-h-(--available-height) w-72 max-w-(--available-width)\n\t\t\t\t\t\trounded-lg border p-4 shadow-lg outline-hidden [overflow-wrap:break-word]\n\t\t\t\t\t\ttransition-[scale,opacity,translate] duration-(--duration-moderate) ease-out data-starting-style:scale-95\n\t\t\t\t\t\tdata-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0\n\t\t\t\t\t\tdata-[side=bottom]:data-starting-style:-translate-y-2\n\t\t\t\t\t\tdata-[side=left]:data-starting-style:translate-x-2\n\t\t\t\t\t\tdata-[side=right]:data-starting-style:-translate-x-2\n\t\t\t\t\t\tdata-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,\n\t\t\t\t\t\t// Capped to the room Base UI measured and scrolled inside. The arrow sits outside the box, so an arrowed popover keeps `overflow: visible`.\n\t\t\t\t\t\t!showArrow && 'overflow-y-auto overscroll-contain',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<PopoverPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_var(--border)]' />\n\t\t\t\t\t)}\n\t\t\t\t</PopoverPrimitive.Popup>\n\t\t\t</PopoverPrimitive.Positioner>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n\n/**\n * PopoverAnchor - placeholder for positioning anchor.\n * @deprecated Base UI Popover positions relative to Trigger by default.\n * For custom anchoring, use Popover.Positioner with anchor prop.\n */\nfunction PopoverAnchor({ ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn <div data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverTitle({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Title>) {\n\treturn (\n\t\t<PopoverPrimitive.Title\n\t\t\tdata-slot=\"popover-title\"\n\t\t\tclassName={cn('font-medium leading-tight', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction PopoverDescription({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Description>) {\n\treturn (\n\t\t<PopoverPrimitive.Description\n\t\t\tdata-slot=\"popover-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverClose,\n\tPopoverContent,\n\tPopoverDescription,\n\tpopoverSurfaceClass,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;;;;AAQA,SAAS,QAAQ,EAAE,GAAG,SAA6D;CAClF,OAAO,2CAACA,+BAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ;AAC/D;AAOA,SAAS,eAAe,EAAE,SAAS,UAAU,QAAQ,cAAc,GAAG,SAA8B;CACnG,MAAM,cAAc,WAAW,UAAa,WAAWC,MAAM,eAAe,QAAQ,IAAI,WAAW;CAEnG,OACC,2CAACD,+BAAiB,SAAlB;EACC,aAAU;EACV,cAAc,iBAAiB,cAAc,OAAO;EACpD,QAAQ,UAAU;EAClB,GAAI;YAEH,cAAc,SAAY;CACF;AAE5B;AAOA,SAAS,aAAa,EAAE,SAAS,UAAU,QAAQ,cAAc,GAAG,SAA4B;CAC/F,MAAM,cAAc,WAAW,UAAa,WAAWC,MAAM,eAAe,QAAQ,IAAI,WAAW;CAEnG,OACC,2CAACD,+BAAiB,OAAlB;EACC,aAAU;EACV,cAAc,iBAAiB,cAAc,OAAO;EACpD,QAAQ,UAAU;EAClB,GAAI;YAEH,cAAc,SAAY;CACJ;AAE1B;;;;;;AAOA,MAAM,sBACL;AAiBD,SAAS,eAAe,EACvB,WACA,QAAQ,UACR,aAAa,GACb,YAAY,OACZ,OAAO,UACP,UACA,iBAAiB,kBACjB,kBAAkB,mBAClB,gBAAgB,iBAChB,iBAAiB,kBACjB,GAAG,SACoB;CACvB,MAAM,EAAE,WAAW,8EAA8C;CAEjE,OACC,2CAACA,+BAAiB,QAAlB;EAAoC;YACnC,2CAACA,+BAAiB,YAAlB;GACO;GACC;GACK;GACZ,WAAW;aAEX,4CAACA,+BAAiB,OAAlB;IACC,aAAU;IACV,WAAWE,iBACV;;;;;;;wFASA,CAAC,aAAa,sCACd,SACD;IACA,GAAI;cAfL,CAiBE,UACA,aACA,2CAACF,+BAAiB,OAAlB,EAAwB,WAAU,0DAA2D,EAEvE;;EACI;CACL;AAE3B;;;;;;AAOA,SAAS,cAAc,EAAE,GAAG,SAA+C;CAC1E,OAAO,2CAAC,OAAD;EAAK,aAAU;EAAiB,GAAI;CAAQ;AACpD;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAA8D;CACnG,OACC,2CAACA,+BAAiB,OAAlB;EACC,aAAU;EACV,WAAWE,iBAAG,6BAA6B,SAAS;EACpD,GAAI;CACJ;AAEH;AAEA,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAoE;CAC/G,OACC,2CAACF,+BAAiB,aAAlB;EACC,aAAU;EACV,WAAWE,iBAAG,iCAAiC,SAAS;EACxD,GAAI;CACJ;AAEH"}
@@ -12,6 +12,12 @@ type PopoverCloseProps = React$1.ComponentProps<typeof Popover$1.Close> & {
12
12
  asChild?: boolean;
13
13
  };
14
14
  declare function PopoverClose({ asChild, children, render, nativeButton, ...props }: PopoverCloseProps): React$1.JSX.Element;
15
+ /**
16
+ * A lighter edge for compact menus that float over busy content: a hairline ring and a soft drop shadow in place of
17
+ * the border, on a 10px corner whose 4px inset gives rows a concentric 6px corner. Works on `PopoverContent` and on
18
+ * any panel that hangs beside one.
19
+ */
20
+ declare const popoverSurfaceClass = "rounded-lg border-0 bg-popover text-popover-foreground shadow-[0_0_0_1px_oklch(0_0_0/0.08),0_4px_16px_-4px_oklch(0_0_0/0.14)] dark:shadow-[0_0_0_1px_oklch(1_0_0/0.12),0_4px_16px_-4px_oklch(0_0_0/0.45)]";
15
21
  type PopoverContentProps = React$1.ComponentProps<typeof Popover$1.Popup> & {
16
22
  align?: 'start' | 'center' | 'end';
17
23
  sideOffset?: number;
@@ -36,5 +42,5 @@ declare function PopoverAnchor({ ...props }: React$1.HTMLAttributes<HTMLDivEleme
36
42
  declare function PopoverTitle({ className, ...props }: React$1.ComponentProps<typeof Popover$1.Title>): React$1.JSX.Element;
37
43
  declare function PopoverDescription({ className, ...props }: React$1.ComponentProps<typeof Popover$1.Description>): React$1.JSX.Element;
38
44
  //#endregion
39
- export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
45
+ export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, popoverSurfaceClass };
40
46
  //# sourceMappingURL=popover.d.cts.map
@@ -12,6 +12,12 @@ type PopoverCloseProps = React$1.ComponentProps<typeof Popover$1.Close> & {
12
12
  asChild?: boolean;
13
13
  };
14
14
  declare function PopoverClose({ asChild, children, render, nativeButton, ...props }: PopoverCloseProps): React$1.JSX.Element;
15
+ /**
16
+ * A lighter edge for compact menus that float over busy content: a hairline ring and a soft drop shadow in place of
17
+ * the border, on a 10px corner whose 4px inset gives rows a concentric 6px corner. Works on `PopoverContent` and on
18
+ * any panel that hangs beside one.
19
+ */
20
+ declare const popoverSurfaceClass = "rounded-lg border-0 bg-popover text-popover-foreground shadow-[0_0_0_1px_oklch(0_0_0/0.08),0_4px_16px_-4px_oklch(0_0_0/0.14)] dark:shadow-[0_0_0_1px_oklch(1_0_0/0.12),0_4px_16px_-4px_oklch(0_0_0/0.45)]";
15
21
  type PopoverContentProps = React$1.ComponentProps<typeof Popover$1.Popup> & {
16
22
  align?: 'start' | 'center' | 'end';
17
23
  sideOffset?: number;
@@ -36,5 +42,5 @@ declare function PopoverAnchor({ ...props }: React$1.HTMLAttributes<HTMLDivEleme
36
42
  declare function PopoverTitle({ className, ...props }: React$1.ComponentProps<typeof Popover$1.Title>): React$1.JSX.Element;
37
43
  declare function PopoverDescription({ className, ...props }: React$1.ComponentProps<typeof Popover$1.Description>): React$1.JSX.Element;
38
44
  //#endregion
39
- export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
45
+ export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, popoverSurfaceClass };
40
46
  //# sourceMappingURL=popover.d.ts.map
@@ -33,6 +33,12 @@ function PopoverClose({ asChild, children, render, nativeButton, ...props }) {
33
33
  children: childRender ? void 0 : children
34
34
  });
35
35
  }
36
+ /**
37
+ * A lighter edge for compact menus that float over busy content: a hairline ring and a soft drop shadow in place of
38
+ * the border, on a 10px corner whose 4px inset gives rows a concentric 6px corner. Works on `PopoverContent` and on
39
+ * any panel that hangs beside one.
40
+ */
41
+ const popoverSurfaceClass = "rounded-lg border-0 bg-popover text-popover-foreground shadow-[0_0_0_1px_oklch(0_0_0/0.08),0_4px_16px_-4px_oklch(0_0_0/0.14)] dark:shadow-[0_0_0_1px_oklch(1_0_0/0.12),0_4px_16px_-4px_oklch(0_0_0/0.45)]";
36
42
  function PopoverContent({ className, align = "center", sideOffset = 4, showArrow = false, side = "bottom", children, onOpenAutoFocus: _onOpenAutoFocus, onCloseAutoFocus: _onCloseAutoFocus, onFocusOutside: _onFocusOutside, onEscapeKeyDown: _onEscapeKeyDown, ...props }) {
37
43
  const { container, zIndexClass } = useFloatingOverlayPortalProps();
38
44
  return /* @__PURE__ */ jsx(Popover$1.Portal, {
@@ -44,13 +50,14 @@ function PopoverContent({ className, align = "center", sideOffset = 4, showArrow
44
50
  className: zIndexClass,
45
51
  children: /* @__PURE__ */ jsxs(Popover$1.Popup, {
46
52
  "data-slot": "popover-content",
47
- className: cn(`bg-popover text-popover-foreground origin-(--transform-origin) w-72 rounded-md border p-4 shadow-md outline-hidden
48
- transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
53
+ className: cn(`bg-popover text-popover-foreground origin-(--transform-origin) max-h-(--available-height) w-72 max-w-(--available-width)
54
+ rounded-lg border p-4 shadow-lg outline-hidden [overflow-wrap:break-word]
55
+ transition-[scale,opacity,translate] duration-(--duration-moderate) ease-out data-starting-style:scale-95
49
56
  data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
50
57
  data-[side=bottom]:data-starting-style:-translate-y-2
51
58
  data-[side=left]:data-starting-style:translate-x-2
52
59
  data-[side=right]:data-starting-style:-translate-x-2
53
- data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`, className),
60
+ data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`, !showArrow && "overflow-y-auto overscroll-contain", className),
54
61
  ...props,
55
62
  children: [children, showArrow && /* @__PURE__ */ jsx(Popover$1.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_var(--border)]" })]
56
63
  })
@@ -71,7 +78,7 @@ function PopoverAnchor({ ...props }) {
71
78
  function PopoverTitle({ className, ...props }) {
72
79
  return /* @__PURE__ */ jsx(Popover$1.Title, {
73
80
  "data-slot": "popover-title",
74
- className: cn("font-medium leading-none", className),
81
+ className: cn("font-medium leading-tight", className),
75
82
  ...props
76
83
  });
77
84
  }
@@ -84,5 +91,5 @@ function PopoverDescription({ className, ...props }) {
84
91
  }
85
92
 
86
93
  //#endregion
87
- export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
94
+ export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, popoverSurfaceClass };
88
95
  //# sourceMappingURL=popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","names":["PopoverPrimitive","React"],"sources":["../../src/components/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\n\nimport { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n\treturn <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\ntype PopoverTriggerProps = React.ComponentProps<typeof PopoverPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction PopoverTrigger({ asChild, children, render, nativeButton, ...props }: PopoverTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<PopoverPrimitive.Trigger\n\t\t\tdata-slot=\"popover-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</PopoverPrimitive.Trigger>\n\t);\n}\n\ntype PopoverCloseProps = React.ComponentProps<typeof PopoverPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction PopoverClose({ asChild, children, render, nativeButton, ...props }: PopoverCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<PopoverPrimitive.Close\n\t\t\tdata-slot=\"popover-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</PopoverPrimitive.Close>\n\t);\n}\n\ntype PopoverContentProps = React.ComponentProps<typeof PopoverPrimitive.Popup> & {\n\talign?: 'start' | 'center' | 'end';\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\t/** @deprecated Base UI uses different focus management */\n\tonOpenAutoFocus?: (e: Event) => void;\n\t/** @deprecated Base UI uses different focus management */\n\tonCloseAutoFocus?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonFocusOutside?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonEscapeKeyDown?: () => void;\n};\n\nfunction PopoverContent({\n\tclassName,\n\talign = 'center',\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'bottom',\n\tchildren,\n\tonOpenAutoFocus: _onOpenAutoFocus,\n\tonCloseAutoFocus: _onCloseAutoFocus,\n\tonFocusOutside: _onFocusOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\t...props\n}: PopoverContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<PopoverPrimitive.Portal container={container}>\n\t\t\t<PopoverPrimitive.Positioner\n\t\t\t\tside={side}\n\t\t\t\talign={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={zIndexClass}\n\t\t\t>\n\t\t\t\t<PopoverPrimitive.Popup\n\t\t\t\t\tdata-slot=\"popover-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground origin-(--transform-origin) w-72 rounded-md border p-4 shadow-md outline-hidden\n\t\t\t\t\t\ttransition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95\n\t\t\t\t\t\tdata-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0\n\t\t\t\t\t\tdata-[side=bottom]:data-starting-style:-translate-y-2\n\t\t\t\t\t\tdata-[side=left]:data-starting-style:translate-x-2\n\t\t\t\t\t\tdata-[side=right]:data-starting-style:-translate-x-2\n\t\t\t\t\t\tdata-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<PopoverPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_var(--border)]' />\n\t\t\t\t\t)}\n\t\t\t\t</PopoverPrimitive.Popup>\n\t\t\t</PopoverPrimitive.Positioner>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n\n/**\n * PopoverAnchor - placeholder for positioning anchor.\n * @deprecated Base UI Popover positions relative to Trigger by default.\n * For custom anchoring, use Popover.Positioner with anchor prop.\n */\nfunction PopoverAnchor({ ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn <div data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverTitle({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Title>) {\n\treturn (\n\t\t<PopoverPrimitive.Title\n\t\t\tdata-slot=\"popover-title\"\n\t\t\tclassName={cn('font-medium leading-none', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction PopoverDescription({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Description>) {\n\treturn (\n\t\t<PopoverPrimitive.Description\n\t\t\tdata-slot=\"popover-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverClose,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;AAQA,SAAS,QAAQ,EAAE,GAAG,SAA6D;CAClF,OAAO,oBAACA,UAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ;AAC/D;AAOA,SAAS,eAAe,EAAE,SAAS,UAAU,QAAQ,cAAc,GAAG,SAA8B;CACnG,MAAM,cAAc,WAAW,UAAa,WAAWC,QAAM,eAAe,QAAQ,IAAI,WAAW;CAEnG,OACC,oBAACD,UAAiB,SAAlB;EACC,aAAU;EACV,cAAc,iBAAiB,cAAc,OAAO;EACpD,QAAQ,UAAU;EAClB,GAAI;YAEH,cAAc,SAAY;CACF;AAE5B;AAOA,SAAS,aAAa,EAAE,SAAS,UAAU,QAAQ,cAAc,GAAG,SAA4B;CAC/F,MAAM,cAAc,WAAW,UAAa,WAAWC,QAAM,eAAe,QAAQ,IAAI,WAAW;CAEnG,OACC,oBAACD,UAAiB,OAAlB;EACC,aAAU;EACV,cAAc,iBAAiB,cAAc,OAAO;EACpD,QAAQ,UAAU;EAClB,GAAI;YAEH,cAAc,SAAY;CACJ;AAE1B;AAiBA,SAAS,eAAe,EACvB,WACA,QAAQ,UACR,aAAa,GACb,YAAY,OACZ,OAAO,UACP,UACA,iBAAiB,kBACjB,kBAAkB,mBAClB,gBAAgB,iBAChB,iBAAiB,kBACjB,GAAG,SACoB;CACvB,MAAM,EAAE,WAAW,gBAAgB,8BAA8B;CAEjE,OACC,oBAACA,UAAiB,QAAlB;EAAoC;YACnC,oBAACA,UAAiB,YAAlB;GACO;GACC;GACK;GACZ,WAAW;aAEX,qBAACA,UAAiB,OAAlB;IACC,aAAU;IACV,WAAW,GACV;;;;;;wFAOA,SACD;IACA,GAAI;cAZL,CAcE,UACA,aACA,oBAACA,UAAiB,OAAlB,EAAwB,WAAU,0DAA2D,EAEvE;;EACI;CACL;AAE3B;;;;;;AAOA,SAAS,cAAc,EAAE,GAAG,SAA+C;CAC1E,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAiB,GAAI;CAAQ;AACpD;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAA8D;CACnG,OACC,oBAACA,UAAiB,OAAlB;EACC,aAAU;EACV,WAAW,GAAG,4BAA4B,SAAS;EACnD,GAAI;CACJ;AAEH;AAEA,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAoE;CAC/G,OACC,oBAACA,UAAiB,aAAlB;EACC,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACJ;AAEH"}
1
+ {"version":3,"file":"popover.js","names":["PopoverPrimitive","React"],"sources":["../../src/components/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\n\nimport { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n\treturn <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\ntype PopoverTriggerProps = React.ComponentProps<typeof PopoverPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction PopoverTrigger({ asChild, children, render, nativeButton, ...props }: PopoverTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<PopoverPrimitive.Trigger\n\t\t\tdata-slot=\"popover-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</PopoverPrimitive.Trigger>\n\t);\n}\n\ntype PopoverCloseProps = React.ComponentProps<typeof PopoverPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction PopoverClose({ asChild, children, render, nativeButton, ...props }: PopoverCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<PopoverPrimitive.Close\n\t\t\tdata-slot=\"popover-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</PopoverPrimitive.Close>\n\t);\n}\n\n/**\n * A lighter edge for compact menus that float over busy content: a hairline ring and a soft drop shadow in place of\n * the border, on a 10px corner whose 4px inset gives rows a concentric 6px corner. Works on `PopoverContent` and on\n * any panel that hangs beside one.\n */\nconst popoverSurfaceClass =\n\t'rounded-lg border-0 bg-popover text-popover-foreground shadow-[0_0_0_1px_oklch(0_0_0/0.08),0_4px_16px_-4px_oklch(0_0_0/0.14)] dark:shadow-[0_0_0_1px_oklch(1_0_0/0.12),0_4px_16px_-4px_oklch(0_0_0/0.45)]';\n\ntype PopoverContentProps = React.ComponentProps<typeof PopoverPrimitive.Popup> & {\n\talign?: 'start' | 'center' | 'end';\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\t/** @deprecated Base UI uses different focus management */\n\tonOpenAutoFocus?: (e: Event) => void;\n\t/** @deprecated Base UI uses different focus management */\n\tonCloseAutoFocus?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonFocusOutside?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonEscapeKeyDown?: () => void;\n};\n\nfunction PopoverContent({\n\tclassName,\n\talign = 'center',\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'bottom',\n\tchildren,\n\tonOpenAutoFocus: _onOpenAutoFocus,\n\tonCloseAutoFocus: _onCloseAutoFocus,\n\tonFocusOutside: _onFocusOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\t...props\n}: PopoverContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<PopoverPrimitive.Portal container={container}>\n\t\t\t<PopoverPrimitive.Positioner\n\t\t\t\tside={side}\n\t\t\t\talign={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={zIndexClass}\n\t\t\t>\n\t\t\t\t<PopoverPrimitive.Popup\n\t\t\t\t\tdata-slot=\"popover-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground origin-(--transform-origin) max-h-(--available-height) w-72 max-w-(--available-width)\n\t\t\t\t\t\trounded-lg border p-4 shadow-lg outline-hidden [overflow-wrap:break-word]\n\t\t\t\t\t\ttransition-[scale,opacity,translate] duration-(--duration-moderate) ease-out data-starting-style:scale-95\n\t\t\t\t\t\tdata-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0\n\t\t\t\t\t\tdata-[side=bottom]:data-starting-style:-translate-y-2\n\t\t\t\t\t\tdata-[side=left]:data-starting-style:translate-x-2\n\t\t\t\t\t\tdata-[side=right]:data-starting-style:-translate-x-2\n\t\t\t\t\t\tdata-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,\n\t\t\t\t\t\t// Capped to the room Base UI measured and scrolled inside. The arrow sits outside the box, so an arrowed popover keeps `overflow: visible`.\n\t\t\t\t\t\t!showArrow && 'overflow-y-auto overscroll-contain',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<PopoverPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_var(--border)]' />\n\t\t\t\t\t)}\n\t\t\t\t</PopoverPrimitive.Popup>\n\t\t\t</PopoverPrimitive.Positioner>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n\n/**\n * PopoverAnchor - placeholder for positioning anchor.\n * @deprecated Base UI Popover positions relative to Trigger by default.\n * For custom anchoring, use Popover.Positioner with anchor prop.\n */\nfunction PopoverAnchor({ ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn <div data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverTitle({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Title>) {\n\treturn (\n\t\t<PopoverPrimitive.Title\n\t\t\tdata-slot=\"popover-title\"\n\t\t\tclassName={cn('font-medium leading-tight', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction PopoverDescription({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Description>) {\n\treturn (\n\t\t<PopoverPrimitive.Description\n\t\t\tdata-slot=\"popover-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverClose,\n\tPopoverContent,\n\tPopoverDescription,\n\tpopoverSurfaceClass,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;AAQA,SAAS,QAAQ,EAAE,GAAG,SAA6D;CAClF,OAAO,oBAACA,UAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ;AAC/D;AAOA,SAAS,eAAe,EAAE,SAAS,UAAU,QAAQ,cAAc,GAAG,SAA8B;CACnG,MAAM,cAAc,WAAW,UAAa,WAAWC,QAAM,eAAe,QAAQ,IAAI,WAAW;CAEnG,OACC,oBAACD,UAAiB,SAAlB;EACC,aAAU;EACV,cAAc,iBAAiB,cAAc,OAAO;EACpD,QAAQ,UAAU;EAClB,GAAI;YAEH,cAAc,SAAY;CACF;AAE5B;AAOA,SAAS,aAAa,EAAE,SAAS,UAAU,QAAQ,cAAc,GAAG,SAA4B;CAC/F,MAAM,cAAc,WAAW,UAAa,WAAWC,QAAM,eAAe,QAAQ,IAAI,WAAW;CAEnG,OACC,oBAACD,UAAiB,OAAlB;EACC,aAAU;EACV,cAAc,iBAAiB,cAAc,OAAO;EACpD,QAAQ,UAAU;EAClB,GAAI;YAEH,cAAc,SAAY;CACJ;AAE1B;;;;;;AAOA,MAAM,sBACL;AAiBD,SAAS,eAAe,EACvB,WACA,QAAQ,UACR,aAAa,GACb,YAAY,OACZ,OAAO,UACP,UACA,iBAAiB,kBACjB,kBAAkB,mBAClB,gBAAgB,iBAChB,iBAAiB,kBACjB,GAAG,SACoB;CACvB,MAAM,EAAE,WAAW,gBAAgB,8BAA8B;CAEjE,OACC,oBAACA,UAAiB,QAAlB;EAAoC;YACnC,oBAACA,UAAiB,YAAlB;GACO;GACC;GACK;GACZ,WAAW;aAEX,qBAACA,UAAiB,OAAlB;IACC,aAAU;IACV,WAAW,GACV;;;;;;;wFASA,CAAC,aAAa,sCACd,SACD;IACA,GAAI;cAfL,CAiBE,UACA,aACA,oBAACA,UAAiB,OAAlB,EAAwB,WAAU,0DAA2D,EAEvE;;EACI;CACL;AAE3B;;;;;;AAOA,SAAS,cAAc,EAAE,GAAG,SAA+C;CAC1E,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAiB,GAAI;CAAQ;AACpD;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAA8D;CACnG,OACC,oBAACA,UAAiB,OAAlB;EACC,aAAU;EACV,WAAW,GAAG,6BAA6B,SAAS;EACpD,GAAI;CACJ;AAEH;AAEA,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAoE;CAC/G,OACC,oBAACA,UAAiB,aAAlB;EACC,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACJ;AAEH"}
@@ -9,17 +9,34 @@ let react_jsx_runtime = require("react/jsx-runtime");
9
9
  let _base_ui_react_progress = require("@base-ui/react/progress");
10
10
 
11
11
  //#region src/components/progress.tsx
12
- function Progress({ className, value, ...props }) {
12
+ /**
13
+ * Keeps the bar honest for values a calculation can really produce: finite
14
+ * values clamp into `[min, max]`; `null`, `undefined`, `NaN`, `Infinity` and
15
+ * unusable bounds are indeterminate. Without this Base UI drops the indicator
16
+ * width for them and the block fills the track, which reads as 100%.
17
+ */
18
+ function normalizeProgressValue(value, min, max) {
19
+ if (value == null || !Number.isFinite(value)) return null;
20
+ if (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) return null;
21
+ return Math.min(Math.max(value, min), max);
22
+ }
23
+ function Progress({ className, value, min = 0, max = 100, ...props }) {
24
+ const normalized = normalizeProgressValue(value, min, max);
25
+ const overflowAttribute = normalized !== null && typeof value === "number" && value > max ? { "data-overflow": "" } : void 0;
13
26
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_progress.Progress.Root, {
14
27
  "data-slot": "progress",
15
- value,
28
+ value: normalized,
29
+ min,
30
+ max,
31
+ ...overflowAttribute,
16
32
  ...props,
17
33
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_progress.Progress.Track, {
18
34
  "data-slot": "progress-track",
19
35
  className: require_utils.cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className),
20
36
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_progress.Progress.Indicator, {
21
37
  "data-slot": "progress-indicator",
22
- className: "bg-primary h-full transition-[width] duration-200 ease-out motion-reduce:transition-none"
38
+ ...overflowAttribute,
39
+ className: require_utils.cn("bg-primary h-full transition-[width] duration-(--duration-slow) ease-out motion-reduce:transition-none", "data-indeterminate:bg-transparent data-indeterminate:[background-image:linear-gradient(90deg,transparent_0%,var(--primary)_50%,transparent_100%)] data-indeterminate:bg-[length:200%_100%] data-indeterminate:animate-[shimmer_1.6s_linear_infinite]", "motion-reduce:data-indeterminate:animate-none motion-reduce:data-indeterminate:[background-position:50%_0]")
23
40
  })
24
41
  })
25
42
  });
@@ -1 +1 @@
1
- {"version":3,"file":"progress.cjs","names":["ProgressPrimitive","cn"],"sources":["../../src/components/progress.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress';\n\nimport { cn } from '../lib/utils';\n\ntype ProgressProps = Omit<React.ComponentProps<typeof ProgressPrimitive.Root>, 'children'> & {\n\tclassName?: string;\n};\n\nfunction Progress({ className, value, ...props }: ProgressProps) {\n\treturn (\n\t\t<ProgressPrimitive.Root data-slot=\"progress\" value={value} {...props}>\n\t\t\t<ProgressPrimitive.Track\n\t\t\t\tdata-slot=\"progress-track\"\n\t\t\t\tclassName={cn('bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', className)}\n\t\t\t>\n\t\t\t\t<ProgressPrimitive.Indicator\n\t\t\t\t\tdata-slot=\"progress-indicator\"\n\t\t\t\t\tclassName=\"bg-primary h-full transition-[width] duration-200 ease-out motion-reduce:transition-none\"\n\t\t\t\t/>\n\t\t\t</ProgressPrimitive.Track>\n\t\t</ProgressPrimitive.Root>\n\t);\n}\n\nexport { Progress };\nexport type { ProgressProps };\n"],"mappings":";;;;;;;;;;;AAWA,SAAS,SAAS,EAAE,WAAW,OAAO,GAAG,SAAwB;CAChE,OACC,2CAACA,iCAAkB,MAAnB;EAAwB,aAAU;EAAkB;EAAO,GAAI;YAC9D,2CAACA,iCAAkB,OAAnB;GACC,aAAU;GACV,WAAWC,iBAAG,kEAAkE,SAAS;aAEzF,2CAACD,iCAAkB,WAAnB;IACC,aAAU;IACV,WAAU;GACV;EACuB;CACF;AAE1B"}
1
+ {"version":3,"file":"progress.cjs","names":["ProgressPrimitive","cn"],"sources":["../../src/components/progress.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress';\n\nimport { cn } from '../lib/utils';\n\ntype ProgressProps = Omit<React.ComponentProps<typeof ProgressPrimitive.Root>, 'children'> & {\n\tclassName?: string;\n};\n\n/**\n * Keeps the bar honest for values a calculation can really produce: finite\n * values clamp into `[min, max]`; `null`, `undefined`, `NaN`, `Infinity` and\n * unusable bounds are indeterminate. Without this Base UI drops the indicator\n * width for them and the block fills the track, which reads as 100%.\n */\nfunction normalizeProgressValue(value: number | null | undefined, min: number, max: number): number | null {\n\tif (value == null || !Number.isFinite(value)) return null;\n\tif (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) return null;\n\treturn Math.min(Math.max(value, min), max);\n}\n\nfunction Progress({ className, value, min = 0, max = 100, ...props }: ProgressProps) {\n\tconst normalized = normalizeProgressValue(value, min, max);\n\t// Over the maximum the bar stays full; `data-overflow` lets apps colour it.\n\tconst overflow = normalized !== null && typeof value === 'number' && value > max;\n\tconst overflowAttribute = overflow ? { 'data-overflow': '' } : undefined;\n\n\treturn (\n\t\t<ProgressPrimitive.Root data-slot=\"progress\" value={normalized} min={min} max={max} {...overflowAttribute} {...props}>\n\t\t\t<ProgressPrimitive.Track\n\t\t\t\tdata-slot=\"progress-track\"\n\t\t\t\tclassName={cn('bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', className)}\n\t\t\t>\n\t\t\t\t<ProgressPrimitive.Indicator\n\t\t\t\t\tdata-slot=\"progress-indicator\"\n\t\t\t\t\t{...overflowAttribute}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'bg-primary h-full transition-[width] duration-(--duration-slow) ease-out motion-reduce:transition-none',\n\t\t\t\t\t\t// Indeterminate: a band sweeps the track instead of a solid bar that reads as complete.\n\t\t\t\t\t\t'data-indeterminate:bg-transparent data-indeterminate:[background-image:linear-gradient(90deg,transparent_0%,var(--primary)_50%,transparent_100%)] data-indeterminate:bg-[length:200%_100%] data-indeterminate:animate-[shimmer_1.6s_linear_infinite]',\n\t\t\t\t\t\t'motion-reduce:data-indeterminate:animate-none motion-reduce:data-indeterminate:[background-position:50%_0]',\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t</ProgressPrimitive.Track>\n\t\t</ProgressPrimitive.Root>\n\t);\n}\n\nexport { Progress };\nexport type { ProgressProps };\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,uBAAuB,OAAkC,KAAa,KAA4B;CAC1G,IAAI,SAAS,QAAQ,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACrD,IAAI,CAAC,OAAO,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,GAAG,KAAK,OAAO,KAAK,OAAO;CACzE,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAAG;AAC1C;AAEA,SAAS,SAAS,EAAE,WAAW,OAAO,MAAM,GAAG,MAAM,KAAK,GAAG,SAAwB;CACpF,MAAM,aAAa,uBAAuB,OAAO,KAAK,GAAG;CAGzD,MAAM,oBADW,eAAe,QAAQ,OAAO,UAAU,YAAY,QAAQ,MACxC,EAAE,iBAAiB,GAAG,IAAI;CAE/D,OACC,2CAACA,iCAAkB,MAAnB;EAAwB,aAAU;EAAW,OAAO;EAAiB;EAAU;EAAK,GAAI;EAAmB,GAAI;YAC9G,2CAACA,iCAAkB,OAAnB;GACC,aAAU;GACV,WAAWC,iBAAG,kEAAkE,SAAS;aAEzF,2CAACD,iCAAkB,WAAnB;IACC,aAAU;IACV,GAAI;IACJ,WAAWC,iBACV,0GAEA,wPACA,4GACD;GACA;EACuB;CACF;AAE1B"}
@@ -4,7 +4,7 @@ import { Progress as Progress$1 } from "@base-ui/react/progress";
4
4
  type ProgressProps = Omit<React$1.ComponentProps<typeof Progress$1.Root>, 'children'> & {
5
5
  className?: string;
6
6
  };
7
- declare function Progress({ className, value, ...props }: ProgressProps): React$1.JSX.Element;
7
+ declare function Progress({ className, value, min, max, ...props }: ProgressProps): React$1.JSX.Element;
8
8
  //#endregion
9
9
  export { Progress, type ProgressProps };
10
10
  //# sourceMappingURL=progress.d.cts.map
@@ -4,7 +4,7 @@ import { Progress as Progress$1 } from "@base-ui/react/progress";
4
4
  type ProgressProps = Omit<React$1.ComponentProps<typeof Progress$1.Root>, 'children'> & {
5
5
  className?: string;
6
6
  };
7
- declare function Progress({ className, value, ...props }: ProgressProps): React$1.JSX.Element;
7
+ declare function Progress({ className, value, min, max, ...props }: ProgressProps): React$1.JSX.Element;
8
8
  //#endregion
9
9
  export { Progress, type ProgressProps };
10
10
  //# sourceMappingURL=progress.d.ts.map
@@ -6,17 +6,34 @@ import { jsx } from "react/jsx-runtime";
6
6
  import { Progress as Progress$1 } from "@base-ui/react/progress";
7
7
 
8
8
  //#region src/components/progress.tsx
9
- function Progress({ className, value, ...props }) {
9
+ /**
10
+ * Keeps the bar honest for values a calculation can really produce: finite
11
+ * values clamp into `[min, max]`; `null`, `undefined`, `NaN`, `Infinity` and
12
+ * unusable bounds are indeterminate. Without this Base UI drops the indicator
13
+ * width for them and the block fills the track, which reads as 100%.
14
+ */
15
+ function normalizeProgressValue(value, min, max) {
16
+ if (value == null || !Number.isFinite(value)) return null;
17
+ if (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) return null;
18
+ return Math.min(Math.max(value, min), max);
19
+ }
20
+ function Progress({ className, value, min = 0, max = 100, ...props }) {
21
+ const normalized = normalizeProgressValue(value, min, max);
22
+ const overflowAttribute = normalized !== null && typeof value === "number" && value > max ? { "data-overflow": "" } : void 0;
10
23
  return /* @__PURE__ */ jsx(Progress$1.Root, {
11
24
  "data-slot": "progress",
12
- value,
25
+ value: normalized,
26
+ min,
27
+ max,
28
+ ...overflowAttribute,
13
29
  ...props,
14
30
  children: /* @__PURE__ */ jsx(Progress$1.Track, {
15
31
  "data-slot": "progress-track",
16
32
  className: cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className),
17
33
  children: /* @__PURE__ */ jsx(Progress$1.Indicator, {
18
34
  "data-slot": "progress-indicator",
19
- className: "bg-primary h-full transition-[width] duration-200 ease-out motion-reduce:transition-none"
35
+ ...overflowAttribute,
36
+ className: cn("bg-primary h-full transition-[width] duration-(--duration-slow) ease-out motion-reduce:transition-none", "data-indeterminate:bg-transparent data-indeterminate:[background-image:linear-gradient(90deg,transparent_0%,var(--primary)_50%,transparent_100%)] data-indeterminate:bg-[length:200%_100%] data-indeterminate:animate-[shimmer_1.6s_linear_infinite]", "motion-reduce:data-indeterminate:animate-none motion-reduce:data-indeterminate:[background-position:50%_0]")
20
37
  })
21
38
  })
22
39
  });
@@ -1 +1 @@
1
- {"version":3,"file":"progress.js","names":["ProgressPrimitive"],"sources":["../../src/components/progress.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress';\n\nimport { cn } from '../lib/utils';\n\ntype ProgressProps = Omit<React.ComponentProps<typeof ProgressPrimitive.Root>, 'children'> & {\n\tclassName?: string;\n};\n\nfunction Progress({ className, value, ...props }: ProgressProps) {\n\treturn (\n\t\t<ProgressPrimitive.Root data-slot=\"progress\" value={value} {...props}>\n\t\t\t<ProgressPrimitive.Track\n\t\t\t\tdata-slot=\"progress-track\"\n\t\t\t\tclassName={cn('bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', className)}\n\t\t\t>\n\t\t\t\t<ProgressPrimitive.Indicator\n\t\t\t\t\tdata-slot=\"progress-indicator\"\n\t\t\t\t\tclassName=\"bg-primary h-full transition-[width] duration-200 ease-out motion-reduce:transition-none\"\n\t\t\t\t/>\n\t\t\t</ProgressPrimitive.Track>\n\t\t</ProgressPrimitive.Root>\n\t);\n}\n\nexport { Progress };\nexport type { ProgressProps };\n"],"mappings":";;;;;;;;AAWA,SAAS,SAAS,EAAE,WAAW,OAAO,GAAG,SAAwB;CAChE,OACC,oBAACA,WAAkB,MAAnB;EAAwB,aAAU;EAAkB;EAAO,GAAI;YAC9D,oBAACA,WAAkB,OAAnB;GACC,aAAU;GACV,WAAW,GAAG,kEAAkE,SAAS;aAEzF,oBAACA,WAAkB,WAAnB;IACC,aAAU;IACV,WAAU;GACV;EACuB;CACF;AAE1B"}
1
+ {"version":3,"file":"progress.js","names":["ProgressPrimitive"],"sources":["../../src/components/progress.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress';\n\nimport { cn } from '../lib/utils';\n\ntype ProgressProps = Omit<React.ComponentProps<typeof ProgressPrimitive.Root>, 'children'> & {\n\tclassName?: string;\n};\n\n/**\n * Keeps the bar honest for values a calculation can really produce: finite\n * values clamp into `[min, max]`; `null`, `undefined`, `NaN`, `Infinity` and\n * unusable bounds are indeterminate. Without this Base UI drops the indicator\n * width for them and the block fills the track, which reads as 100%.\n */\nfunction normalizeProgressValue(value: number | null | undefined, min: number, max: number): number | null {\n\tif (value == null || !Number.isFinite(value)) return null;\n\tif (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) return null;\n\treturn Math.min(Math.max(value, min), max);\n}\n\nfunction Progress({ className, value, min = 0, max = 100, ...props }: ProgressProps) {\n\tconst normalized = normalizeProgressValue(value, min, max);\n\t// Over the maximum the bar stays full; `data-overflow` lets apps colour it.\n\tconst overflow = normalized !== null && typeof value === 'number' && value > max;\n\tconst overflowAttribute = overflow ? { 'data-overflow': '' } : undefined;\n\n\treturn (\n\t\t<ProgressPrimitive.Root data-slot=\"progress\" value={normalized} min={min} max={max} {...overflowAttribute} {...props}>\n\t\t\t<ProgressPrimitive.Track\n\t\t\t\tdata-slot=\"progress-track\"\n\t\t\t\tclassName={cn('bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', className)}\n\t\t\t>\n\t\t\t\t<ProgressPrimitive.Indicator\n\t\t\t\t\tdata-slot=\"progress-indicator\"\n\t\t\t\t\t{...overflowAttribute}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'bg-primary h-full transition-[width] duration-(--duration-slow) ease-out motion-reduce:transition-none',\n\t\t\t\t\t\t// Indeterminate: a band sweeps the track instead of a solid bar that reads as complete.\n\t\t\t\t\t\t'data-indeterminate:bg-transparent data-indeterminate:[background-image:linear-gradient(90deg,transparent_0%,var(--primary)_50%,transparent_100%)] data-indeterminate:bg-[length:200%_100%] data-indeterminate:animate-[shimmer_1.6s_linear_infinite]',\n\t\t\t\t\t\t'motion-reduce:data-indeterminate:animate-none motion-reduce:data-indeterminate:[background-position:50%_0]',\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t</ProgressPrimitive.Track>\n\t\t</ProgressPrimitive.Root>\n\t);\n}\n\nexport { Progress };\nexport type { ProgressProps };\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAS,uBAAuB,OAAkC,KAAa,KAA4B;CAC1G,IAAI,SAAS,QAAQ,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACrD,IAAI,CAAC,OAAO,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,GAAG,KAAK,OAAO,KAAK,OAAO;CACzE,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAAG;AAC1C;AAEA,SAAS,SAAS,EAAE,WAAW,OAAO,MAAM,GAAG,MAAM,KAAK,GAAG,SAAwB;CACpF,MAAM,aAAa,uBAAuB,OAAO,KAAK,GAAG;CAGzD,MAAM,oBADW,eAAe,QAAQ,OAAO,UAAU,YAAY,QAAQ,MACxC,EAAE,iBAAiB,GAAG,IAAI;CAE/D,OACC,oBAACA,WAAkB,MAAnB;EAAwB,aAAU;EAAW,OAAO;EAAiB;EAAU;EAAK,GAAI;EAAmB,GAAI;YAC9G,oBAACA,WAAkB,OAAnB;GACC,aAAU;GACV,WAAW,GAAG,kEAAkE,SAAS;aAEzF,oBAACA,WAAkB,WAAnB;IACC,aAAU;IACV,GAAI;IACJ,WAAW,GACV,0GAEA,wPACA,4GACD;GACA;EACuB;CACF;AAE1B"}
@@ -11,7 +11,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
11
11
  * A scrollable container that shows progressive blur effects at the top and bottom
12
12
  * when content overflows. Top blur appears when scrolled, bottom blur when more content below.
13
13
  */
14
- function ProgressiveBlurScrollContainer({ children, className, scrollClassName, minItemsForBlur = 0, itemCount = 0, blurProps, showBlur = true }) {
14
+ function ProgressiveBlurScrollContainer({ children, className, scrollClassName, minItemsForBlur = 0, itemCount, blurProps, showBlur = true }) {
15
15
  const [hasOverflow, setHasOverflow] = (0, react.useState)(false);
16
16
  const [isScrolledFromTop, setIsScrolledFromTop] = (0, react.useState)(false);
17
17
  const [isScrolledFromBottom, setIsScrolledFromBottom] = (0, react.useState)(true);
@@ -44,7 +44,7 @@ function ProgressiveBlurScrollContainer({ children, className, scrollClassName,
44
44
  el.addEventListener("scroll", checkScrollPosition, { passive: true });
45
45
  return () => el.removeEventListener("scroll", checkScrollPosition);
46
46
  }, [checkScrollPosition]);
47
- const canShowBlur = showBlur && hasOverflow && (minItemsForBlur === 0 || itemCount > minItemsForBlur);
47
+ const canShowBlur = showBlur && hasOverflow && (minItemsForBlur === 0 || itemCount === void 0 || itemCount > minItemsForBlur);
48
48
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
49
49
  className: require_utils.cn("relative min-h-0 flex-1", className),
50
50
  children: [