@gv-tech/design-system 2.28.0 → 2.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (470) hide show
  1. package/README.md +4 -2
  2. package/dist/accordion.cjs +1 -1
  3. package/dist/accordion.cjs.map +1 -1
  4. package/dist/accordion.d.ts +1 -1
  5. package/dist/accordion.mjs +22 -23
  6. package/dist/accordion.mjs.map +1 -1
  7. package/dist/alert-dialog.cjs +1 -1
  8. package/dist/alert-dialog.cjs.map +1 -1
  9. package/dist/alert-dialog.d.ts +1 -1
  10. package/dist/alert-dialog.mjs +27 -28
  11. package/dist/alert-dialog.mjs.map +1 -1
  12. package/dist/alert.cjs +1 -1
  13. package/dist/alert.cjs.map +1 -1
  14. package/dist/alert.d.ts +1 -1
  15. package/dist/alert.mjs +4 -5
  16. package/dist/alert.mjs.map +1 -1
  17. package/dist/aspect-ratio.cjs +1 -1
  18. package/dist/aspect-ratio.cjs.map +1 -1
  19. package/dist/aspect-ratio.d.ts +1 -1
  20. package/dist/aspect-ratio.mjs +1 -1
  21. package/dist/aspect-ratio.mjs.map +1 -1
  22. package/dist/attachment.cjs +2 -0
  23. package/dist/attachment.cjs.map +1 -0
  24. package/dist/attachment.d.ts +2 -0
  25. package/dist/attachment.mjs +100 -0
  26. package/dist/attachment.mjs.map +1 -0
  27. package/dist/avatar.cjs +1 -1
  28. package/dist/avatar.cjs.map +1 -1
  29. package/dist/avatar.d.ts +1 -1
  30. package/dist/avatar.mjs +11 -11
  31. package/dist/avatar.mjs.map +1 -1
  32. package/dist/badge.cjs +1 -1
  33. package/dist/badge.cjs.map +1 -1
  34. package/dist/badge.d.ts +1 -1
  35. package/dist/badge.mjs +3 -3
  36. package/dist/badge.mjs.map +1 -1
  37. package/dist/breadcrumb.cjs +1 -1
  38. package/dist/breadcrumb.cjs.map +1 -1
  39. package/dist/breadcrumb.d.ts +1 -1
  40. package/dist/breadcrumb.mjs +17 -20
  41. package/dist/breadcrumb.mjs.map +1 -1
  42. package/dist/bubble.cjs +2 -0
  43. package/dist/bubble.cjs.map +1 -0
  44. package/dist/bubble.d.ts +2 -0
  45. package/dist/bubble.mjs +72 -0
  46. package/dist/bubble.mjs.map +1 -0
  47. package/dist/button-group.cjs +1 -1
  48. package/dist/button-group.cjs.map +1 -1
  49. package/dist/button-group.d.ts +1 -1
  50. package/dist/button-group.mjs +11 -13
  51. package/dist/button-group.mjs.map +1 -1
  52. package/dist/button.cjs +1 -1
  53. package/dist/button.cjs.map +1 -1
  54. package/dist/button.d.ts +1 -1
  55. package/dist/button.mjs +8 -9
  56. package/dist/button.mjs.map +1 -1
  57. package/dist/calendar.cjs +1 -1
  58. package/dist/calendar.cjs.map +1 -1
  59. package/dist/calendar.d.ts +1 -1
  60. package/dist/calendar.mjs +29 -29
  61. package/dist/calendar.mjs.map +1 -1
  62. package/dist/card.cjs +1 -1
  63. package/dist/card.cjs.map +1 -1
  64. package/dist/card.d.ts +1 -1
  65. package/dist/card.mjs +5 -6
  66. package/dist/card.mjs.map +1 -1
  67. package/dist/carousel.cjs +1 -1
  68. package/dist/carousel.cjs.map +1 -1
  69. package/dist/carousel.d.ts +1 -1
  70. package/dist/carousel.mjs +25 -28
  71. package/dist/carousel.mjs.map +1 -1
  72. package/dist/chart.cjs +2 -2
  73. package/dist/chart.cjs.map +1 -1
  74. package/dist/chart.d.ts +1 -1
  75. package/dist/chart.mjs +1 -2
  76. package/dist/chart.mjs.map +1 -1
  77. package/dist/checkbox.cjs +1 -1
  78. package/dist/checkbox.cjs.map +1 -1
  79. package/dist/checkbox.d.ts +1 -1
  80. package/dist/checkbox.mjs +4 -5
  81. package/dist/checkbox.mjs.map +1 -1
  82. package/dist/collapsible.cjs +1 -1
  83. package/dist/collapsible.cjs.map +1 -1
  84. package/dist/collapsible.d.ts +1 -1
  85. package/dist/collapsible.mjs +7 -7
  86. package/dist/collapsible.mjs.map +1 -1
  87. package/dist/combobox.cjs +1 -1
  88. package/dist/combobox.cjs.map +1 -1
  89. package/dist/combobox.d.ts +1 -1
  90. package/dist/combobox.mjs +44 -45
  91. package/dist/combobox.mjs.map +1 -1
  92. package/dist/command.cjs +1 -1
  93. package/dist/command.cjs.map +1 -1
  94. package/dist/command.d.ts +1 -1
  95. package/dist/command.mjs +25 -26
  96. package/dist/command.mjs.map +1 -1
  97. package/dist/context-menu.cjs +1 -1
  98. package/dist/context-menu.cjs.map +1 -1
  99. package/dist/context-menu.d.ts +1 -1
  100. package/dist/context-menu.mjs +40 -41
  101. package/dist/context-menu.mjs.map +1 -1
  102. package/dist/design-system.css +1 -1
  103. package/dist/dialog.cjs +1 -1
  104. package/dist/dialog.cjs.map +1 -1
  105. package/dist/dialog.d.ts +1 -1
  106. package/dist/dialog.mjs +23 -24
  107. package/dist/dialog.mjs.map +1 -1
  108. package/dist/direction.cjs +1 -1
  109. package/dist/direction.cjs.map +1 -1
  110. package/dist/direction.d.ts +1 -1
  111. package/dist/direction.mjs +6 -6
  112. package/dist/direction.mjs.map +1 -1
  113. package/dist/drawer.cjs +1 -1
  114. package/dist/drawer.cjs.map +1 -1
  115. package/dist/drawer.d.ts +1 -1
  116. package/dist/drawer.mjs +2 -3
  117. package/dist/drawer.mjs.map +1 -1
  118. package/dist/dropdown-menu.cjs +1 -1
  119. package/dist/dropdown-menu.cjs.map +1 -1
  120. package/dist/dropdown-menu.d.ts +1 -1
  121. package/dist/dropdown-menu.mjs +39 -40
  122. package/dist/dropdown-menu.mjs.map +1 -1
  123. package/dist/empty.cjs +1 -1
  124. package/dist/empty.cjs.map +1 -1
  125. package/dist/empty.d.ts +1 -1
  126. package/dist/empty.mjs +2 -3
  127. package/dist/empty.mjs.map +1 -1
  128. package/dist/field.cjs +1 -1
  129. package/dist/field.cjs.map +1 -1
  130. package/dist/field.d.ts +1 -1
  131. package/dist/field.mjs +4 -6
  132. package/dist/field.mjs.map +1 -1
  133. package/dist/form.cjs +1 -1
  134. package/dist/form.cjs.map +1 -1
  135. package/dist/form.d.ts +1 -1
  136. package/dist/form.mjs +6 -6
  137. package/dist/form.mjs.map +1 -1
  138. package/dist/hover-card.cjs +1 -1
  139. package/dist/hover-card.cjs.map +1 -1
  140. package/dist/hover-card.d.ts +1 -1
  141. package/dist/hover-card.mjs +11 -12
  142. package/dist/hover-card.mjs.map +1 -1
  143. package/dist/index.cjs +1 -1
  144. package/dist/index.d.ts +1 -1
  145. package/dist/index.mjs +74 -67
  146. package/dist/input-group.cjs +1 -1
  147. package/dist/input-group.cjs.map +1 -1
  148. package/dist/input-group.d.ts +1 -1
  149. package/dist/input-group.mjs +6 -12
  150. package/dist/input-group.mjs.map +1 -1
  151. package/dist/input-otp.cjs +1 -1
  152. package/dist/input-otp.cjs.map +1 -1
  153. package/dist/input-otp.d.ts +1 -1
  154. package/dist/input-otp.mjs +12 -13
  155. package/dist/input-otp.mjs.map +1 -1
  156. package/dist/input.cjs +1 -1
  157. package/dist/input.cjs.map +1 -1
  158. package/dist/input.d.ts +1 -1
  159. package/dist/input.mjs +1 -2
  160. package/dist/input.mjs.map +1 -1
  161. package/dist/item.cjs +1 -1
  162. package/dist/item.cjs.map +1 -1
  163. package/dist/item.d.ts +1 -1
  164. package/dist/item.mjs +18 -20
  165. package/dist/item.mjs.map +1 -1
  166. package/dist/kbd.cjs +1 -1
  167. package/dist/kbd.cjs.map +1 -1
  168. package/dist/kbd.d.ts +1 -1
  169. package/dist/kbd.mjs +2 -3
  170. package/dist/kbd.mjs.map +1 -1
  171. package/dist/label.cjs +1 -1
  172. package/dist/label.cjs.map +1 -1
  173. package/dist/label.d.ts +1 -1
  174. package/dist/label.mjs +1 -2
  175. package/dist/label.mjs.map +1 -1
  176. package/dist/marker.cjs +2 -0
  177. package/dist/marker.cjs.map +1 -0
  178. package/dist/marker.d.ts +2 -0
  179. package/dist/marker.mjs +39 -0
  180. package/dist/marker.mjs.map +1 -0
  181. package/dist/menubar.cjs +1 -1
  182. package/dist/menubar.cjs.map +1 -1
  183. package/dist/menubar.d.ts +1 -1
  184. package/dist/menubar.mjs +43 -44
  185. package/dist/menubar.mjs.map +1 -1
  186. package/dist/message-scroller.cjs +2 -0
  187. package/dist/message-scroller.cjs.map +1 -0
  188. package/dist/message-scroller.d.ts +2 -0
  189. package/dist/message-scroller.mjs +61 -0
  190. package/dist/message-scroller.mjs.map +1 -0
  191. package/dist/message.cjs +2 -0
  192. package/dist/message.cjs.map +1 -0
  193. package/dist/message.d.ts +2 -0
  194. package/dist/message.mjs +52 -0
  195. package/dist/message.mjs.map +1 -0
  196. package/dist/native-select.cjs +1 -1
  197. package/dist/native-select.cjs.map +1 -1
  198. package/dist/native-select.d.ts +1 -1
  199. package/dist/native-select.mjs +1 -2
  200. package/dist/native-select.mjs.map +1 -1
  201. package/dist/navigation-menu.cjs +1 -1
  202. package/dist/navigation-menu.cjs.map +1 -1
  203. package/dist/navigation-menu.d.ts +1 -1
  204. package/dist/navigation-menu.mjs +23 -24
  205. package/dist/navigation-menu.mjs.map +1 -1
  206. package/dist/packages/ui-core/src/contracts/attachment.d.ts +47 -0
  207. package/dist/packages/ui-core/src/contracts/bubble.d.ts +27 -0
  208. package/dist/packages/ui-core/src/contracts/marker.d.ts +16 -0
  209. package/dist/packages/ui-core/src/contracts/message-scroller.d.ts +31 -0
  210. package/dist/packages/ui-core/src/contracts/message.d.ts +28 -0
  211. package/dist/packages/ui-core/src/contracts/questionnaire.d.ts +72 -0
  212. package/dist/packages/ui-core/src/contracts/scroll-to-top.d.ts +1 -2
  213. package/dist/packages/ui-core/src/contracts/table-of-contents.d.ts +5 -18
  214. package/dist/packages/ui-core/src/index.d.ts +6 -0
  215. package/dist/packages/ui-web/src/__contracts.d.ts +44 -2
  216. package/dist/packages/ui-web/src/accordion.d.ts +5 -5
  217. package/dist/packages/ui-web/src/alert-dialog.d.ts +13 -13
  218. package/dist/packages/ui-web/src/alert.d.ts +5 -5
  219. package/dist/packages/ui-web/src/aspect-ratio.d.ts +2 -2
  220. package/dist/packages/ui-web/src/attachment.d.ts +23 -0
  221. package/dist/packages/ui-web/src/attachment.test.d.ts +1 -0
  222. package/dist/packages/ui-web/src/avatar.d.ts +7 -7
  223. package/dist/packages/ui-web/src/badge.d.ts +2 -2
  224. package/dist/packages/ui-web/src/breadcrumb.d.ts +7 -7
  225. package/dist/packages/ui-web/src/bubble.d.ts +13 -0
  226. package/dist/packages/ui-web/src/bubble.test.d.ts +1 -0
  227. package/dist/packages/ui-web/src/button-group.d.ts +3 -3
  228. package/dist/packages/ui-web/src/button.d.ts +2 -2
  229. package/dist/packages/ui-web/src/calendar.d.ts +3 -3
  230. package/dist/packages/ui-web/src/card.d.ts +7 -7
  231. package/dist/packages/ui-web/src/carousel.d.ts +6 -6
  232. package/dist/packages/ui-web/src/chart.d.ts +4 -4
  233. package/dist/packages/ui-web/src/checkbox.d.ts +2 -2
  234. package/dist/packages/ui-web/src/collapsible.d.ts +4 -4
  235. package/dist/packages/ui-web/src/combobox.d.ts +14 -14
  236. package/dist/packages/ui-web/src/command.d.ts +10 -10
  237. package/dist/packages/ui-web/src/context-menu.d.ts +16 -16
  238. package/dist/packages/ui-web/src/dialog.d.ts +11 -11
  239. package/dist/packages/ui-web/src/direction.d.ts +2 -2
  240. package/dist/packages/ui-web/src/drawer.d.ts +11 -11
  241. package/dist/packages/ui-web/src/dropdown-menu.d.ts +16 -16
  242. package/dist/packages/ui-web/src/empty.d.ts +7 -7
  243. package/dist/packages/ui-web/src/field.d.ts +11 -11
  244. package/dist/packages/ui-web/src/form.d.ts +8 -7
  245. package/dist/packages/ui-web/src/hover-card.d.ts +4 -4
  246. package/dist/packages/ui-web/src/index.d.ts +6 -0
  247. package/dist/packages/ui-web/src/input-group.d.ts +7 -7
  248. package/dist/packages/ui-web/src/input-otp.d.ts +5 -5
  249. package/dist/packages/ui-web/src/input.d.ts +1 -1
  250. package/dist/packages/ui-web/src/item.d.ts +11 -11
  251. package/dist/packages/ui-web/src/kbd.d.ts +2 -2
  252. package/dist/packages/ui-web/src/label.d.ts +2 -2
  253. package/dist/packages/ui-web/src/marker.d.ts +12 -0
  254. package/dist/packages/ui-web/src/marker.test.d.ts +1 -0
  255. package/dist/packages/ui-web/src/menubar.d.ts +17 -17
  256. package/dist/packages/ui-web/src/message-scroller.d.ts +12 -0
  257. package/dist/packages/ui-web/src/message-scroller.test.d.ts +1 -0
  258. package/dist/packages/ui-web/src/message.d.ts +10 -0
  259. package/dist/packages/ui-web/src/message.test.d.ts +1 -0
  260. package/dist/packages/ui-web/src/native-select.d.ts +3 -3
  261. package/dist/packages/ui-web/src/navigation-menu.d.ts +9 -9
  262. package/dist/packages/ui-web/src/pagination.d.ts +8 -8
  263. package/dist/packages/ui-web/src/popover.d.ts +8 -8
  264. package/dist/packages/ui-web/src/progress.d.ts +2 -2
  265. package/dist/packages/ui-web/src/questionnaire.d.ts +21 -0
  266. package/dist/packages/ui-web/src/questionnaire.test.d.ts +1 -0
  267. package/dist/packages/ui-web/src/radio-group.d.ts +2 -2
  268. package/dist/packages/ui-web/src/resizable.d.ts +3 -3
  269. package/dist/packages/ui-web/src/scroll-area.d.ts +3 -3
  270. package/dist/packages/ui-web/src/scroll-to-top.d.ts +1 -1
  271. package/dist/packages/ui-web/src/search.d.ts +1 -1
  272. package/dist/packages/ui-web/src/select.d.ts +11 -11
  273. package/dist/packages/ui-web/src/separator.d.ts +2 -2
  274. package/dist/packages/ui-web/src/sheet.d.ts +9 -9
  275. package/dist/packages/ui-web/src/sidebar.d.ts +24 -24
  276. package/dist/packages/ui-web/src/skeleton.d.ts +1 -1
  277. package/dist/packages/ui-web/src/slider.d.ts +2 -2
  278. package/dist/packages/ui-web/src/sonner.d.ts +2 -4
  279. package/dist/packages/ui-web/src/spinner.d.ts +2 -1
  280. package/dist/packages/ui-web/src/support-fab.d.ts +1 -1
  281. package/dist/packages/ui-web/src/switch.d.ts +2 -2
  282. package/dist/packages/ui-web/src/table-of-contents.d.ts +9 -13
  283. package/dist/packages/ui-web/src/table.d.ts +8 -8
  284. package/dist/packages/ui-web/src/tabs.d.ts +5 -5
  285. package/dist/packages/ui-web/src/text.d.ts +1 -1
  286. package/dist/packages/ui-web/src/textarea.d.ts +1 -1
  287. package/dist/packages/ui-web/src/theme-provider.d.ts +1 -1
  288. package/dist/packages/ui-web/src/theme-toggle.d.ts +1 -1
  289. package/dist/packages/ui-web/src/toast.d.ts +1 -1
  290. package/dist/packages/ui-web/src/toaster.d.ts +1 -1
  291. package/dist/packages/ui-web/src/toggle-group.d.ts +3 -3
  292. package/dist/packages/ui-web/src/toggle.d.ts +2 -2
  293. package/dist/packages/ui-web/src/tooltip.d.ts +5 -5
  294. package/dist/pagination.cjs +1 -1
  295. package/dist/pagination.cjs.map +1 -1
  296. package/dist/pagination.d.ts +1 -1
  297. package/dist/pagination.mjs +21 -15
  298. package/dist/pagination.mjs.map +1 -1
  299. package/dist/popover.cjs +1 -1
  300. package/dist/popover.cjs.map +1 -1
  301. package/dist/popover.d.ts +1 -1
  302. package/dist/popover.mjs +10 -11
  303. package/dist/popover.mjs.map +1 -1
  304. package/dist/progress.cjs +1 -1
  305. package/dist/progress.cjs.map +1 -1
  306. package/dist/progress.d.ts +1 -1
  307. package/dist/progress.mjs +3 -4
  308. package/dist/progress.mjs.map +1 -1
  309. package/dist/questionnaire.cjs +2 -0
  310. package/dist/questionnaire.cjs.map +1 -0
  311. package/dist/questionnaire.d.ts +2 -0
  312. package/dist/questionnaire.mjs +171 -0
  313. package/dist/questionnaire.mjs.map +1 -0
  314. package/dist/radio-group.cjs +1 -1
  315. package/dist/radio-group.cjs.map +1 -1
  316. package/dist/radio-group.d.ts +1 -1
  317. package/dist/radio-group.mjs +10 -11
  318. package/dist/radio-group.mjs.map +1 -1
  319. package/dist/resizable.cjs +1 -1
  320. package/dist/resizable.cjs.map +1 -1
  321. package/dist/resizable.d.ts +1 -1
  322. package/dist/resizable.mjs +10 -11
  323. package/dist/resizable.mjs.map +1 -1
  324. package/dist/scroll-area.cjs +1 -1
  325. package/dist/scroll-area.cjs.map +1 -1
  326. package/dist/scroll-area.d.ts +1 -1
  327. package/dist/scroll-area.mjs +9 -10
  328. package/dist/scroll-area.mjs.map +1 -1
  329. package/dist/scroll-to-top.cjs +1 -1
  330. package/dist/scroll-to-top.cjs.map +1 -1
  331. package/dist/scroll-to-top.d.ts +1 -1
  332. package/dist/scroll-to-top.mjs +9 -7
  333. package/dist/scroll-to-top.mjs.map +1 -1
  334. package/dist/search.cjs +1 -1
  335. package/dist/search.cjs.map +1 -1
  336. package/dist/search.d.ts +1 -1
  337. package/dist/search.mjs +2 -2
  338. package/dist/search.mjs.map +1 -1
  339. package/dist/select.cjs +1 -1
  340. package/dist/select.cjs.map +1 -1
  341. package/dist/select.d.ts +1 -1
  342. package/dist/select.mjs +32 -33
  343. package/dist/select.mjs.map +1 -1
  344. package/dist/separator.cjs +1 -1
  345. package/dist/separator.cjs.map +1 -1
  346. package/dist/separator.d.ts +1 -1
  347. package/dist/separator.mjs +3 -4
  348. package/dist/separator.mjs.map +1 -1
  349. package/dist/sheet.cjs +1 -1
  350. package/dist/sheet.cjs.map +1 -1
  351. package/dist/sheet.d.ts +1 -1
  352. package/dist/sheet.mjs +22 -23
  353. package/dist/sheet.mjs.map +1 -1
  354. package/dist/{sidebar-BnEmNYS2.mjs → sidebar-Cl3zXgaX.mjs} +42 -43
  355. package/dist/sidebar-Cl3zXgaX.mjs.map +1 -0
  356. package/dist/sidebar-DQzY8XPP.js +2 -0
  357. package/dist/sidebar-DQzY8XPP.js.map +1 -0
  358. package/dist/sidebar.cjs +1 -1
  359. package/dist/sidebar.d.ts +1 -1
  360. package/dist/sidebar.mjs +1 -1
  361. package/dist/skeleton.cjs +1 -1
  362. package/dist/skeleton.cjs.map +1 -1
  363. package/dist/skeleton.d.ts +1 -1
  364. package/dist/skeleton.mjs +1 -2
  365. package/dist/skeleton.mjs.map +1 -1
  366. package/dist/slider.cjs +1 -1
  367. package/dist/slider.cjs.map +1 -1
  368. package/dist/slider.d.ts +1 -1
  369. package/dist/slider.mjs +11 -12
  370. package/dist/slider.mjs.map +1 -1
  371. package/dist/sonner.cjs +1 -1
  372. package/dist/sonner.cjs.map +1 -1
  373. package/dist/sonner.d.ts +1 -1
  374. package/dist/sonner.mjs +9 -9
  375. package/dist/sonner.mjs.map +1 -1
  376. package/dist/spinner.cjs +1 -1
  377. package/dist/spinner.cjs.map +1 -1
  378. package/dist/spinner.d.ts +1 -1
  379. package/dist/spinner.mjs +12 -8
  380. package/dist/spinner.mjs.map +1 -1
  381. package/dist/support-fab.cjs +1 -1
  382. package/dist/support-fab.cjs.map +1 -1
  383. package/dist/support-fab.d.ts +1 -1
  384. package/dist/support-fab.mjs +2 -2
  385. package/dist/support-fab.mjs.map +1 -1
  386. package/dist/switch.cjs +1 -1
  387. package/dist/switch.cjs.map +1 -1
  388. package/dist/switch.d.ts +1 -1
  389. package/dist/switch.mjs +7 -8
  390. package/dist/switch.mjs.map +1 -1
  391. package/dist/table-of-contents.cjs +1 -1
  392. package/dist/table-of-contents.cjs.map +1 -1
  393. package/dist/table-of-contents.d.ts +1 -1
  394. package/dist/table-of-contents.mjs +5 -4
  395. package/dist/table-of-contents.mjs.map +1 -1
  396. package/dist/table.cjs +1 -1
  397. package/dist/table.cjs.map +1 -1
  398. package/dist/table.d.ts +1 -1
  399. package/dist/table.mjs +1 -2
  400. package/dist/table.mjs.map +1 -1
  401. package/dist/tabs.cjs +1 -1
  402. package/dist/tabs.cjs.map +1 -1
  403. package/dist/tabs.d.ts +1 -1
  404. package/dist/tabs.mjs +17 -18
  405. package/dist/tabs.mjs.map +1 -1
  406. package/dist/text.cjs +1 -1
  407. package/dist/text.cjs.map +1 -1
  408. package/dist/text.d.ts +1 -1
  409. package/dist/text.mjs +5 -5
  410. package/dist/text.mjs.map +1 -1
  411. package/dist/textarea.cjs +1 -1
  412. package/dist/textarea.cjs.map +1 -1
  413. package/dist/textarea.d.ts +1 -1
  414. package/dist/textarea.mjs +1 -2
  415. package/dist/textarea.mjs.map +1 -1
  416. package/dist/theme-provider.cjs +1 -1
  417. package/dist/theme-provider.cjs.map +1 -1
  418. package/dist/theme-provider.d.ts +1 -1
  419. package/dist/theme-provider.mjs +1 -1
  420. package/dist/theme-provider.mjs.map +1 -1
  421. package/dist/{theme-toggle-CgEJLId-.mjs → theme-toggle-ldAbIn1Q.mjs} +27 -18
  422. package/dist/{theme-toggle-CgEJLId-.mjs.map → theme-toggle-ldAbIn1Q.mjs.map} +1 -1
  423. package/dist/{theme-toggle-CNDBFa9t.js → theme-toggle-nNtzABo6.js} +2 -2
  424. package/dist/{theme-toggle-CNDBFa9t.js.map → theme-toggle-nNtzABo6.js.map} +1 -1
  425. package/dist/theme-toggle.cjs +1 -1
  426. package/dist/theme-toggle.d.ts +1 -1
  427. package/dist/theme-toggle.mjs +1 -1
  428. package/dist/toast.cjs +1 -1
  429. package/dist/toast.cjs.map +1 -1
  430. package/dist/toast.d.ts +1 -1
  431. package/dist/toast.mjs +21 -21
  432. package/dist/toast.mjs.map +1 -1
  433. package/dist/{toaster-C3UZyPzU.js → toaster-BRNNfjp9.js} +2 -2
  434. package/dist/{toaster-C3UZyPzU.js.map → toaster-BRNNfjp9.js.map} +1 -1
  435. package/dist/{toaster-DH0UX0nD.mjs → toaster-_FgrA-3c.mjs} +2 -2
  436. package/dist/{toaster-DH0UX0nD.mjs.map → toaster-_FgrA-3c.mjs.map} +1 -1
  437. package/dist/toaster.cjs +1 -1
  438. package/dist/toaster.d.ts +1 -1
  439. package/dist/toaster.mjs +1 -1
  440. package/dist/toggle-group.cjs +1 -1
  441. package/dist/toggle-group.cjs.map +1 -1
  442. package/dist/toggle-group.d.ts +1 -1
  443. package/dist/toggle-group.mjs +3 -4
  444. package/dist/toggle-group.mjs.map +1 -1
  445. package/dist/toggle.cjs +1 -1
  446. package/dist/toggle.cjs.map +1 -1
  447. package/dist/toggle.d.ts +1 -1
  448. package/dist/toggle.mjs +4 -5
  449. package/dist/toggle.mjs.map +1 -1
  450. package/dist/tooltip.cjs +1 -1
  451. package/dist/tooltip.cjs.map +1 -1
  452. package/dist/tooltip.d.ts +1 -1
  453. package/dist/tooltip.mjs +8 -9
  454. package/dist/tooltip.mjs.map +1 -1
  455. package/dist/{utils-D7tt_q-u.js → utils-BROwqSso.js} +2 -2
  456. package/dist/{utils-D7tt_q-u.js.map → utils-BROwqSso.js.map} +1 -1
  457. package/dist/{utils-IYJAOUsw.mjs → utils-BurmJD8d.mjs} +2 -2
  458. package/dist/{utils-IYJAOUsw.mjs.map → utils-BurmJD8d.mjs.map} +1 -1
  459. package/dist/vendor-0E4gGRxj.mjs +39103 -0
  460. package/dist/vendor-0E4gGRxj.mjs.map +1 -0
  461. package/dist/vendor-Bz5F_va8.js +101 -0
  462. package/dist/vendor-Bz5F_va8.js.map +1 -0
  463. package/package.json +55 -59
  464. package/dist/sidebar-BnEmNYS2.mjs.map +0 -1
  465. package/dist/sidebar-BnuanaZN.js +0 -2
  466. package/dist/sidebar-BnuanaZN.js.map +0 -1
  467. package/dist/vendor-B6CFfDyk.mjs +0 -33960
  468. package/dist/vendor-B6CFfDyk.mjs.map +0 -1
  469. package/dist/vendor-UfQavLF9.js +0 -111
  470. package/dist/vendor-UfQavLF9.js.map +0 -1
package/dist/card.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"card.mjs","names":[],"sources":["../packages/ui-web/src/card.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { CardBaseProps } from '@gv-tech/ui-core';\nimport { cn } from './lib/utils';\n\nfunction Card({ className, size = 'default', ...props }: React.ComponentProps<'div'> & { size?: 'default' | 'sm' }) {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n 'group/card bg-card text-card-foreground ring-foreground/10 flex flex-col gap-4 overflow-hidden rounded-xl py-4 text-sm ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('text-base leading-snug font-medium group-data-[size=sm]/card:text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-description\" className={cn('text-muted-foreground text-sm', className)} {...props} />;\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-content\" className={cn('px-4 group-data-[size=sm]/card:px-3', className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('bg-muted/50 flex items-center rounded-b-xl border-t p-4 group-data-[size=sm]/card:p-3', className)}\n {...props}\n />\n );\n}\n\nexport { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };\nexport type ___verifyContract = React.ComponentProps<typeof Card> extends CardBaseProps ? true : false;\n"],"mappings":";;;;;;AAKA,SAAS,EAAK,EAAE,cAAW,UAAO,WAAW,GAAG,KAAoE;CAClH,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EACE,aAAU;EACV,aAAW;EACX,WAAW,EACT,wVACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAsC;CACxE,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,sSACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAU,EAAE,cAAW,GAAG,KAAsC;CACvE,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,EAAG,wEAAwE,CAAS;EAC/F,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAgB,EAAE,cAAW,GAAG,KAAsC;CAC7E,OAAO,iBAAA,GAAA,EAAA,KAAC,OAAD;EAAK,aAAU;EAAmB,WAAW,EAAG,iCAAiC,CAAS;EAAG,GAAI;CAAQ,CAAA;AAClH;AAEA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAsC;CACxE,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,EAAG,kEAAkE,CAAS;EACzF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAY,EAAE,cAAW,GAAG,KAAsC;CACzE,OAAO,iBAAA,GAAA,EAAA,KAAC,OAAD;EAAK,aAAU;EAAe,WAAW,EAAG,uCAAuC,CAAS;EAAG,GAAI;CAAQ,CAAA;AACpH;AAEA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAsC;CACxE,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,EAAG,yFAAyF,CAAS;EAChH,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"card.mjs","names":[],"sources":["../packages/ui-web/src/card.tsx"],"sourcesContent":["import type { CardBaseProps } from '@gv-tech/ui-core';\nimport { cn } from 'cn';\nimport * as React from 'react';\n\nfunction Card({ className, size = 'default', ...props }: React.ComponentProps<'div'> & { size?: 'default' | 'sm' }) {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n 'group/card bg-card text-card-foreground ring-foreground/10 flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl py-(--card-spacing) text-sm ring-1 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('text-base leading-snug font-medium group-data-[size=sm]/card:text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-description\" className={cn('text-muted-foreground text-sm', className)} {...props} />;\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-content\" className={cn('px-(--card-spacing)', className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('bg-muted/50 flex items-center rounded-b-xl border-t p-(--card-spacing)', className)}\n {...props}\n />\n );\n}\n\nexport { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };\nexport type ___verifyContract = React.ComponentProps<typeof Card> extends CardBaseProps ? true : false;\n"],"mappings":";;;;;AAIA,SAAS,EAAK,EAAE,cAAW,UAAO,WAAW,GAAG,KAAoE;CAClH,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EACE,aAAU;EACV,aAAW;EACX,WAAW,EACT,wZACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAsC;CACxE,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,0PACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAU,EAAE,cAAW,GAAG,KAAsC;CACvE,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,EAAG,wEAAwE,CAAS;EAC/F,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAgB,EAAE,cAAW,GAAG,KAAsC;CAC7E,OAAO,iBAAA,GAAA,EAAA,KAAC,OAAD;EAAK,aAAU;EAAmB,WAAW,EAAG,iCAAiC,CAAS;EAAG,GAAI;CAAQ,CAAA;AAClH;AAEA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAsC;CACxE,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,EAAG,kEAAkE,CAAS;EACzF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAY,EAAE,cAAW,GAAG,KAAsC;CACzE,OAAO,iBAAA,GAAA,EAAA,KAAC,OAAD;EAAK,aAAU;EAAe,WAAW,EAAG,uBAAuB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACpG;AAEA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAsC;CACxE,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,EAAG,0EAA0E,CAAS;EACjG,GAAI;CACL,CAAA;AAEL"}
package/dist/carousel.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.js"),t=require("./vendor-UfQavLF9.js"),n=require("./utils-D7tt_q-u.js"),r=require("./button.cjs");let i=require("react");i=e.r(i);var a=t.Jr(),o=i.createContext(null);function s(){let e=i.useContext(o);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function c({orientation:e=`horizontal`,opts:r,setApi:s,plugins:c,className:l,children:u,...d}){let[f,p]=t.F({...r,axis:e===`horizontal`?`x`:`y`},c),[m,h]=i.useState(!1),[g,_]=i.useState(!1),v=i.useCallback(e=>{e&&(h(e.canScrollPrev()),_(e.canScrollNext()))},[]),y=i.useCallback(()=>{p?.scrollPrev()},[p]),b=i.useCallback(()=>{p?.scrollNext()},[p]),x=i.useCallback(e=>{e.key===`ArrowLeft`?(e.preventDefault(),y()):e.key===`ArrowRight`&&(e.preventDefault(),b())},[y,b]);return i.useEffect(()=>{!p||!s||s(p)},[p,s]),i.useEffect(()=>{if(p)return v(p),p.on(`reInit`,v),p.on(`select`,v),()=>{p?.off(`select`,v)}},[p,v]),(0,a.jsx)(o.Provider,{value:{carouselRef:f,api:p,opts:r,orientation:e||(r?.axis===`y`?`vertical`:`horizontal`),scrollPrev:y,scrollNext:b,canScrollPrev:m,canScrollNext:g},children:(0,a.jsx)(`div`,{onKeyDownCapture:x,className:n.t(`relative`,l),role:`region`,"aria-roledescription":`carousel`,"data-slot":`carousel`,...d,children:u})})}function l({className:e,...t}){let{carouselRef:r,orientation:i}=s();return(0,a.jsx)(`div`,{ref:r,className:`overflow-hidden`,"data-slot":`carousel-content`,children:(0,a.jsx)(`div`,{className:n.t(`flex`,i===`horizontal`?`-ms-4`:`-mt-4 flex-col`,e),...t})})}function u({className:e,...t}){let{orientation:r}=s();return(0,a.jsx)(`div`,{role:`group`,"aria-roledescription":`slide`,"data-slot":`carousel-item`,className:n.t(`min-w-0 shrink-0 grow-0 basis-full`,r===`horizontal`?`ps-4`:`pt-4`,e),...t})}function d({className:e,variant:i=`outline`,size:o=`icon-sm`,...c}){let{orientation:l,scrollPrev:u,canScrollPrev:d}=s();return(0,a.jsxs)(r.Button,{"data-slot":`carousel-previous`,variant:i,size:o,className:n.t(`absolute touch-manipulation rounded-full`,l===`horizontal`?`-start-12 top-1/2 -translate-y-1/2`:`start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2`,e),disabled:!d,onClick:u,...c,children:[(0,a.jsx)(t.nt,{}),(0,a.jsx)(`span`,{className:`sr-only`,children:`Previous slide`})]})}function f({className:e,variant:i=`outline`,size:o=`icon-sm`,...c}){let{orientation:l,scrollNext:u,canScrollNext:d}=s();return(0,a.jsxs)(r.Button,{"data-slot":`carousel-next`,variant:i,size:o,className:n.t(`absolute touch-manipulation rounded-full`,l===`horizontal`?`-end-12 top-1/2 -translate-y-1/2`:`start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2`,e),disabled:!d,onClick:u,...c,children:[(0,a.jsx)(t.tt,{}),(0,a.jsx)(`span`,{className:`sr-only`,children:`Next slide`})]})}exports.Carousel=c,exports.CarouselContent=l,exports.CarouselItem=u,exports.CarouselNext=f,exports.CarouselPrevious=d,exports.useCarousel=s;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.js"),t=require("./vendor-Bz5F_va8.js"),n=require("./button.cjs");let r=require("react");r=e.r(r);var i=t.Ar(),a=r.createContext(null);function o(){let e=r.useContext(a);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function s({orientation:e=`horizontal`,opts:n,setApi:o,plugins:s,className:c,children:l,...u}){let[d,f]=t.z({...n,axis:e===`horizontal`?`x`:`y`},s),[p,m]=r.useState(!1),[h,g]=r.useState(!1),_=r.useCallback(e=>{e&&(m(e.canScrollPrev()),g(e.canScrollNext()))},[]),v=r.useCallback(()=>{f?.scrollPrev()},[f]),y=r.useCallback(()=>{f?.scrollNext()},[f]),b=r.useCallback(e=>{e.key===`ArrowLeft`?(e.preventDefault(),v()):e.key===`ArrowRight`&&(e.preventDefault(),y())},[v,y]);return r.useEffect(()=>{!f||!o||o(f)},[f,o]),r.useEffect(()=>{if(f)return _(f),f.on(`reInit`,_),f.on(`select`,_),()=>{f?.off(`select`,_)}},[f,_]),(0,i.jsx)(a.Provider,{value:{carouselRef:d,api:f,opts:n,orientation:e||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:v,scrollNext:y,canScrollPrev:p,canScrollNext:h},children:(0,i.jsx)(`section`,{onKeyDownCapture:b,className:t.ei(`relative`,c),"aria-roledescription":`carousel`,"data-slot":`carousel`,...u,children:l})})}function c({className:e,...n}){let{carouselRef:r,orientation:a}=o();return(0,i.jsx)(`div`,{ref:r,className:`overflow-hidden`,"data-slot":`carousel-content`,children:(0,i.jsx)(`div`,{className:t.ei(`flex`,a===`horizontal`?`-ms-4`:`-mt-4 flex-col`,e),...n})})}function l({className:e,...n}){let{orientation:r}=o();return(0,i.jsx)(`fieldset`,{"aria-roledescription":`slide`,"data-slot":`carousel-item`,className:t.ei(`min-w-0 shrink-0 grow-0 basis-full`,r===`horizontal`?`ps-4`:`pt-4`,e),...n})}function u({className:e,variant:r=`outline`,size:a=`icon-sm`,...s}){let{orientation:c,scrollPrev:l,canScrollPrev:u}=o();return(0,i.jsxs)(n.Button,{"data-slot":`carousel-previous`,variant:r,size:a,className:t.ei(`absolute touch-manipulation rounded-full`,c===`horizontal`?`inset-y-0 -start-12 my-auto`:`start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2`,e),disabled:!u,onClick:l,...s,children:[(0,i.jsx)(t.Yr,{className:`rtl:rotate-180`}),(0,i.jsx)(`span`,{className:`sr-only`,children:`Previous slide`})]})}function d({className:e,variant:r=`outline`,size:a=`icon-sm`,...s}){let{orientation:c,scrollNext:l,canScrollNext:u}=o();return(0,i.jsxs)(n.Button,{"data-slot":`carousel-next`,variant:r,size:a,className:t.ei(`absolute touch-manipulation rounded-full`,c===`horizontal`?`inset-y-0 -end-12 my-auto`:`start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2`,e),disabled:!u,onClick:l,...s,children:[(0,i.jsx)(t.Jr,{className:`rtl:rotate-180`}),(0,i.jsx)(`span`,{className:`sr-only`,children:`Next slide`})]})}exports.Carousel=s,exports.CarouselContent=c,exports.CarouselItem=l,exports.CarouselNext=d,exports.CarouselPrevious=u,exports.useCarousel=o;
2
2
  //# sourceMappingURL=carousel.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.cjs","names":[],"sources":["../packages/ui-web/src/carousel.tsx"],"sourcesContent":["import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport * as React from 'react';\n\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport { Button } from './button';\nimport { cn } from './lib/utils';\n\nimport type { CarouselBaseProps } from '@gv-tech/ui-core';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api?.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ms-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'ps-4' : 'pt-4', className)}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-start-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-end-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ChevronRightIcon />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel, type CarouselApi };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCarouselContract = React.ComponentProps<typeof Carousel> extends CarouselBaseProps ? true : false;\n"],"mappings":"4QA8BM,EAAkB,EAAM,cAA2C,IAAI,EAE7E,SAAS,GAAc,CACrB,IAAM,EAAU,EAAM,WAAW,CAAe,EAEhD,GAA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UAAW,EAAA,EACT,2CACA,IAAgB,aACZ,mCACA,sEACJ,CACF,EACA,SAAU,CAAC,EACX,QAAS,EACT,GAAI,WAbN,EAeE,EAAA,EAAA,KAAC,EAAA,GAAD,CAAmB,CAAA,GACnB,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,mBAAU,YAAgB,CAAA,CACpC,GAEZ"}
1
+ {"version":3,"file":"carousel.cjs","names":[],"sources":["../packages/ui-web/src/carousel.tsx"],"sourcesContent":["import type { CarouselBaseProps } from '@gv-tech/ui-core';\nimport { cn } from 'cn';\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Button } from '@/./button';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'section'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n // Sync parent with the initial selection on subscribe (external store sync)\n // eslint-disable-next-line react/set-state-in-effect\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api?.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <section\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </section>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ms-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<'fieldset'>) {\n const { orientation } = useCarousel();\n\n return (\n <fieldset\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'ps-4' : 'pt-4', className)}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'inset-y-0 -start-12 my-auto'\n : 'start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ChevronLeftIcon className=\"rtl:rotate-180\" />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'inset-y-0 -end-12 my-auto'\n : 'start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ChevronRightIcon className=\"rtl:rotate-180\" />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel, type CarouselApi };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCarouselContract = React.ComponentProps<typeof Carousel> extends CarouselBaseProps ? true : false;\n"],"mappings":"2OA6BM,EAAkB,EAAM,cAA2C,IAAI,EAE7E,SAAS,GAAc,CACrB,IAAM,EAAU,EAAM,WAAW,CAAe,EAE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AW,EAAA,GACT,2CACA,IAAgB,aACZ,4BACA,sEACJ,CACF,EACA,SAAU,CAAC,EACX,QAAS,EACT,GAAI,WAbN,EAeE,EAAA,EAAA,KAAC,EAAA,GAAD,CAAkB,UAAU,gBAAkB,CAAA,GAC9C,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,mBAAU,YAAgB,CAAA,CACpC,GAEZ"}
@@ -1,2 +1,2 @@
1
- export * from './packages/ui-web/src/carousel'
1
+ export * from './packages/ui-web/src/carousel.js'
2
2
  export {}
package/dist/carousel.mjs CHANGED
@@ -1,19 +1,18 @@
1
1
  "use client";
2
- import { F as e, Jr as t, nt as n, tt as r } from "./vendor-B6CFfDyk.mjs";
3
- import { t as i } from "./utils-IYJAOUsw.mjs";
2
+ import { Ar as e, Jr as t, Yr as n, ei as r, z as i } from "./vendor-0E4gGRxj.mjs";
4
3
  import { Button as a } from "./button.mjs";
5
4
  import * as o from "react";
6
5
  //#region packages/ui-web/src/carousel.tsx
7
- var s = t(), c = o.createContext(null);
6
+ var s = e(), c = o.createContext(null);
8
7
  function l() {
9
8
  let e = o.useContext(c);
10
9
  if (!e) throw Error("useCarousel must be used within a <Carousel />");
11
10
  return e;
12
11
  }
13
- function u({ orientation: t = "horizontal", opts: n, setApi: r, plugins: a, className: l, children: u, ...d }) {
14
- let [f, p] = e({
15
- ...n,
16
- axis: t === "horizontal" ? "x" : "y"
12
+ function u({ orientation: e = "horizontal", opts: t, setApi: n, plugins: a, className: l, children: u, ...d }) {
13
+ let [f, p] = i({
14
+ ...t,
15
+ axis: e === "horizontal" ? "x" : "y"
17
16
  }, a), [m, h] = o.useState(!1), [g, _] = o.useState(!1), v = o.useCallback((e) => {
18
17
  e && (h(e.canScrollPrev()), _(e.canScrollNext()));
19
18
  }, []), y = o.useCallback(() => {
@@ -24,8 +23,8 @@ function u({ orientation: t = "horizontal", opts: n, setApi: r, plugins: a, clas
24
23
  e.key === "ArrowLeft" ? (e.preventDefault(), y()) : e.key === "ArrowRight" && (e.preventDefault(), b());
25
24
  }, [y, b]);
26
25
  return o.useEffect(() => {
27
- !p || !r || r(p);
28
- }, [p, r]), o.useEffect(() => {
26
+ !p || !n || n(p);
27
+ }, [p, n]), o.useEffect(() => {
29
28
  if (p) return v(p), p.on("reInit", v), p.on("select", v), () => {
30
29
  p?.off("select", v);
31
30
  };
@@ -33,17 +32,16 @@ function u({ orientation: t = "horizontal", opts: n, setApi: r, plugins: a, clas
33
32
  value: {
34
33
  carouselRef: f,
35
34
  api: p,
36
- opts: n,
37
- orientation: t || (n?.axis === "y" ? "vertical" : "horizontal"),
35
+ opts: t,
36
+ orientation: e || (t?.axis === "y" ? "vertical" : "horizontal"),
38
37
  scrollPrev: y,
39
38
  scrollNext: b,
40
39
  canScrollPrev: m,
41
40
  canScrollNext: g
42
41
  },
43
- children: /* @__PURE__ */ (0, s.jsx)("div", {
42
+ children: /* @__PURE__ */ (0, s.jsx)("section", {
44
43
  onKeyDownCapture: x,
45
- className: i("relative", l),
46
- role: "region",
44
+ className: r("relative", l),
47
45
  "aria-roledescription": "carousel",
48
46
  "data-slot": "carousel",
49
47
  ...d,
@@ -52,54 +50,53 @@ function u({ orientation: t = "horizontal", opts: n, setApi: r, plugins: a, clas
52
50
  });
53
51
  }
54
52
  function d({ className: e, ...t }) {
55
- let { carouselRef: n, orientation: r } = l();
53
+ let { carouselRef: n, orientation: i } = l();
56
54
  return /* @__PURE__ */ (0, s.jsx)("div", {
57
55
  ref: n,
58
56
  className: "overflow-hidden",
59
57
  "data-slot": "carousel-content",
60
58
  children: /* @__PURE__ */ (0, s.jsx)("div", {
61
- className: i("flex", r === "horizontal" ? "-ms-4" : "-mt-4 flex-col", e),
59
+ className: r("flex", i === "horizontal" ? "-ms-4" : "-mt-4 flex-col", e),
62
60
  ...t
63
61
  })
64
62
  });
65
63
  }
66
64
  function f({ className: e, ...t }) {
67
65
  let { orientation: n } = l();
68
- return /* @__PURE__ */ (0, s.jsx)("div", {
69
- role: "group",
66
+ return /* @__PURE__ */ (0, s.jsx)("fieldset", {
70
67
  "aria-roledescription": "slide",
71
68
  "data-slot": "carousel-item",
72
- className: i("min-w-0 shrink-0 grow-0 basis-full", n === "horizontal" ? "ps-4" : "pt-4", e),
69
+ className: r("min-w-0 shrink-0 grow-0 basis-full", n === "horizontal" ? "ps-4" : "pt-4", e),
73
70
  ...t
74
71
  });
75
72
  }
76
- function p({ className: e, variant: t = "outline", size: r = "icon-sm", ...o }) {
73
+ function p({ className: e, variant: t = "outline", size: i = "icon-sm", ...o }) {
77
74
  let { orientation: c, scrollPrev: u, canScrollPrev: d } = l();
78
75
  return /* @__PURE__ */ (0, s.jsxs)(a, {
79
76
  "data-slot": "carousel-previous",
80
77
  variant: t,
81
- size: r,
82
- className: i("absolute touch-manipulation rounded-full", c === "horizontal" ? "-start-12 top-1/2 -translate-y-1/2" : "start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2", e),
78
+ size: i,
79
+ className: r("absolute touch-manipulation rounded-full", c === "horizontal" ? "inset-y-0 -start-12 my-auto" : "start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2", e),
83
80
  disabled: !d,
84
81
  onClick: u,
85
82
  ...o,
86
- children: [/* @__PURE__ */ (0, s.jsx)(n, {}), /* @__PURE__ */ (0, s.jsx)("span", {
83
+ children: [/* @__PURE__ */ (0, s.jsx)(n, { className: "rtl:rotate-180" }), /* @__PURE__ */ (0, s.jsx)("span", {
87
84
  className: "sr-only",
88
85
  children: "Previous slide"
89
86
  })]
90
87
  });
91
88
  }
92
- function m({ className: e, variant: t = "outline", size: n = "icon-sm", ...o }) {
89
+ function m({ className: e, variant: n = "outline", size: i = "icon-sm", ...o }) {
93
90
  let { orientation: c, scrollNext: u, canScrollNext: d } = l();
94
91
  return /* @__PURE__ */ (0, s.jsxs)(a, {
95
92
  "data-slot": "carousel-next",
96
- variant: t,
97
- size: n,
98
- className: i("absolute touch-manipulation rounded-full", c === "horizontal" ? "-end-12 top-1/2 -translate-y-1/2" : "start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2", e),
93
+ variant: n,
94
+ size: i,
95
+ className: r("absolute touch-manipulation rounded-full", c === "horizontal" ? "inset-y-0 -end-12 my-auto" : "start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2", e),
99
96
  disabled: !d,
100
97
  onClick: u,
101
98
  ...o,
102
- children: [/* @__PURE__ */ (0, s.jsx)(r, {}), /* @__PURE__ */ (0, s.jsx)("span", {
99
+ children: [/* @__PURE__ */ (0, s.jsx)(t, { className: "rtl:rotate-180" }), /* @__PURE__ */ (0, s.jsx)("span", {
103
100
  className: "sr-only",
104
101
  children: "Next slide"
105
102
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.mjs","names":[],"sources":["../packages/ui-web/src/carousel.tsx"],"sourcesContent":["import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport * as React from 'react';\n\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport { Button } from './button';\nimport { cn } from './lib/utils';\n\nimport type { CarouselBaseProps } from '@gv-tech/ui-core';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api?.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ms-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'ps-4' : 'pt-4', className)}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-start-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-end-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ChevronRightIcon />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel, type CarouselApi };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCarouselContract = React.ComponentProps<typeof Carousel> extends CarouselBaseProps ? true : false;\n"],"mappings":";;;;;;aA8BM,IAAkB,EAAM,cAA2C,IAAI;AAE7E,SAAS,IAAc;CACrB,IAAM,IAAU,EAAM,WAAW,CAAe;CAEhD,IAAI,CAAC,GACH,MAAU,MAAM,gDAAgD;CAGlE,OAAO;AACT;AAEA,SAAS,EAAS,EAChB,iBAAc,cACd,SACA,WACA,YACA,cACA,aACA,GAAG,KAC2C;CAC9C,IAAM,CAAC,GAAa,KAAO,EACzB;EACE,GAAG;EACH,MAAM,MAAgB,eAAe,MAAM;CAC7C,GACA,CACF,GACM,CAAC,GAAe,KAAoB,EAAM,SAAS,EAAK,GACxD,CAAC,GAAe,KAAoB,EAAM,SAAS,EAAK,GAExD,IAAW,EAAM,aAAa,MAAqB;EAClD,MAGL,EAAiB,EAAI,cAAc,CAAC,GACpC,EAAiB,EAAI,cAAc,CAAC;CACtC,GAAG,CAAC,CAAC,GAEC,IAAa,EAAM,kBAAkB;EACzC,GAAK,WAAW;CAClB,GAAG,CAAC,CAAG,CAAC,GAEF,IAAa,EAAM,kBAAkB;EACzC,GAAK,WAAW;CAClB,GAAG,CAAC,CAAG,CAAC,GAEF,IAAgB,EAAM,aACzB,MAA+C;EAC9C,AAAI,EAAM,QAAQ,eAChB,EAAM,eAAe,GACrB,EAAW,KACF,EAAM,QAAQ,iBACvB,EAAM,eAAe,GACrB,EAAW;CAEf,GACA,CAAC,GAAY,CAAU,CACzB;CAsBA,OApBA,EAAM,gBAAgB;EAChB,CAAC,KAAO,CAAC,KAGb,EAAO,CAAG;CACZ,GAAG,CAAC,GAAK,CAAM,CAAC,GAEhB,EAAM,gBAAgB;EACf,OAOL,OAJA,EAAS,CAAG,GACZ,EAAI,GAAG,UAAU,CAAQ,GACzB,EAAI,GAAG,UAAU,CAAQ,SAEZ;GACX,GAAK,IAAI,UAAU,CAAQ;EAC7B;CACF,GAAG,CAAC,GAAK,CAAQ,CAAC,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;EAAoB,CAAA,CACxC;;AAEZ;AAEA,SAAS,EAAa,EACpB,cACA,aAAU,WACV,UAAO,WACP,GAAG,KACmC;CACtC,IAAM,EAAE,gBAAa,eAAY,qBAAkB,EAAY;CAE/D,OACE,iBAAA,GAAA,EAAA,MAAC,GAAD;EACE,aAAU;EACD;EACH;EACN,WAAW,EACT,4CACA,MAAgB,eACZ,qCACA,uEACJ,CACF;EACA,UAAU,CAAC;EACX,SAAS;EACT,GAAI;YAbN,CAeE,iBAAA,GAAA,EAAA,KAAC,GAAD,CAAmB,CAAA,GACnB,iBAAA,GAAA,EAAA,KAAC,QAAD;GAAM,WAAU;aAAU;EAAgB,CAAA,CACpC;;AAEZ"}
1
+ {"version":3,"file":"carousel.mjs","names":[],"sources":["../packages/ui-web/src/carousel.tsx"],"sourcesContent":["import type { CarouselBaseProps } from '@gv-tech/ui-core';\nimport { cn } from 'cn';\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Button } from '@/./button';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'section'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n // Sync parent with the initial selection on subscribe (external store sync)\n // eslint-disable-next-line react/set-state-in-effect\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api?.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <section\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </section>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ms-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<'fieldset'>) {\n const { orientation } = useCarousel();\n\n return (\n <fieldset\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'ps-4' : 'pt-4', className)}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'inset-y-0 -start-12 my-auto'\n : 'start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ChevronLeftIcon className=\"rtl:rotate-180\" />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'inset-y-0 -end-12 my-auto'\n : 'start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ChevronRightIcon className=\"rtl:rotate-180\" />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel, type CarouselApi };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCarouselContract = React.ComponentProps<typeof Carousel> extends CarouselBaseProps ? true : false;\n"],"mappings":";;;;;aA6BM,IAAkB,EAAM,cAA2C,IAAI;AAE7E,SAAS,IAAc;CACrB,IAAM,IAAU,EAAM,WAAW,CAAe;CAEhD,IAAI,CAAC,GACH,MAAU,MAAM,gDAAgD;CAGlE,OAAO;AACT;AAEA,SAAS,EAAS,EAChB,iBAAc,cACd,SACA,WACA,YACA,cACA,aACA,GAAG,KAC+C;CAClD,IAAM,CAAC,GAAa,KAAO,EACzB;EACE,GAAG;EACH,MAAM,MAAgB,eAAe,MAAM;CAC7C,GACA,CACF,GACM,CAAC,GAAe,KAAoB,EAAM,SAAS,EAAK,GACxD,CAAC,GAAe,KAAoB,EAAM,SAAS,EAAK,GAExD,IAAW,EAAM,aAAa,MAAqB;EAClD,MAGL,EAAiB,EAAI,cAAc,CAAC,GACpC,EAAiB,EAAI,cAAc,CAAC;CACtC,GAAG,CAAC,CAAC,GAEC,IAAa,EAAM,kBAAkB;EACzC,GAAK,WAAW;CAClB,GAAG,CAAC,CAAG,CAAC,GAEF,IAAa,EAAM,kBAAkB;EACzC,GAAK,WAAW;CAClB,GAAG,CAAC,CAAG,CAAC,GAEF,IAAgB,EAAM,aACzB,MAA4C;EAC3C,AAAI,EAAM,QAAQ,eAChB,EAAM,eAAe,GACrB,EAAW,KACF,EAAM,QAAQ,iBACvB,EAAM,eAAe,GACrB,EAAW;CAEf,GACA,CAAC,GAAY,CAAU,CACzB;CAwBA,OAtBA,EAAM,gBAAgB;EAChB,CAAC,KAAO,CAAC,KAGb,EAAO,CAAG;CACZ,GAAG,CAAC,GAAK,CAAM,CAAC,GAEhB,EAAM,gBAAgB;EACf,OASL,OAJA,EAAS,CAAG,GACZ,EAAI,GAAG,UAAU,CAAQ,GACzB,EAAI,GAAG,UAAU,CAAQ,SAEZ;GACX,GAAK,IAAI,UAAU,CAAQ;EAC7B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,KAAC,QAAD;GAAM,WAAU;aAAU;EAAoB,CAAA,CACxC;;AAEZ;AAEA,SAAS,EAAa,EACpB,cACA,aAAU,WACV,UAAO,WACP,GAAG,KACmC;CACtC,IAAM,EAAE,gBAAa,eAAY,qBAAkB,EAAY;CAE/D,OACE,iBAAA,GAAA,EAAA,MAAC,GAAD;EACE,aAAU;EACD;EACH;EACN,WAAW,EACT,4CACA,MAAgB,eACZ,8BACA,uEACJ,CACF;EACA,UAAU,CAAC;EACX,SAAS;EACT,GAAI;YAbN,CAeE,iBAAA,GAAA,EAAA,KAAC,GAAD,EAAkB,WAAU,iBAAkB,CAAA,GAC9C,iBAAA,GAAA,EAAA,KAAC,QAAD;GAAM,WAAU;aAAU;EAAgB,CAAA,CACpC;;AAEZ"}
package/dist/chart.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.js"),t=require("./vendor-UfQavLF9.js"),n=require("./utils-D7tt_q-u.js");let r=require("react");r=e.r(r);var i=t.Jr(),a={light:``,dark:`.dark`},o={width:320,height:200},s=r.createContext(null);function c(){let e=r.useContext(s);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function l({id:e,className:a,children:c,config:l,initialDimension:d=o,...f}){let p=r.useId(),m=`chart-${e??p.replace(/:/g,``)}`;return(0,i.jsx)(s.Provider,{value:{config:l},children:(0,i.jsxs)(`div`,{"data-slot":`chart`,"data-chart":m,className:n.t(`[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,a),...f,children:[(0,i.jsx)(u,{id:m,config:l}),(0,i.jsx)(t.P,{initialDimension:d,children:c})]})})}var u=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme??e.color);return n.length?(0,i.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(a).map(([t,r])=>`
1
+ "use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.js"),t=require("./vendor-Bz5F_va8.js");let n=require("react");n=e.r(n);var r=t.Ar(),i={light:``,dark:`.dark`},a={width:320,height:200},o=n.createContext(null);function s(){let e=n.useContext(o);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function c({id:e,className:i,children:s,config:c,initialDimension:u=a,...d}){let f=n.useId(),p=`chart-${e??f.replace(/:/g,``)}`;return(0,r.jsx)(o.Provider,{value:{config:c},children:(0,r.jsxs)(`div`,{"data-slot":`chart`,"data-chart":p,className:t.ei(`[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,i),...d,children:[(0,r.jsx)(l,{id:p,config:c}),(0,r.jsx)(t.R,{initialDimension:u,children:s})]})})}var l=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme??e.color);return n.length?(0,r.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(i).map(([t,r])=>`
2
2
  ${r} [data-chart=${e}] {
3
3
  ${n.map(([e,n])=>{let r=n.theme?.[t]??n.color;return r?` --color-${e}: ${r};`:null}).join(`
4
4
  `)}
5
5
  }
6
6
  `).join(`
7
- `)}}):null},d=t.M;function f({active:e,payload:t,className:a,indicator:o=`dot`,hideLabel:s=!1,hideIndicator:l=!1,label:u,labelFormatter:d,labelClassName:f,formatter:p,color:m,nameKey:g,labelKey:_}){let{config:v}=c(),y=r.useMemo(()=>{if(s||!t?.length)return null;let[e]=t,r=h(v,e,`${_??e?.dataKey??e?.name??`value`}`),a=!_&&typeof u==`string`?v[u]?.label??u:r?.label;return d?(0,i.jsx)(`div`,{className:n.t(`font-medium`,f),children:d(a,t)}):a?(0,i.jsx)(`div`,{className:n.t(`font-medium`,f),children:a}):null},[u,d,t,s,f,v,_]);if(!e||!t?.length)return null;let b=t.length===1&&o!==`dot`;return(0,i.jsxs)(`div`,{className:n.t(`border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl`,a),children:[b?null:y,(0,i.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let r=h(v,e,`${g??e.name??e.dataKey??`value`}`),a=m??e.payload?.fill??e.color;return(0,i.jsx)(`div`,{className:n.t(`[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5`,o===`dot`&&`items-center`),children:p&&e?.value!==void 0&&e.name?p(e.value,e.name,e,t,e.payload):(0,i.jsxs)(i.Fragment,{children:[r?.icon?(0,i.jsx)(r.icon,{}):!l&&(0,i.jsx)(`div`,{className:n.t(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":o===`dot`,"w-1":o===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":o===`dashed`,"my-0.5":b&&o===`dashed`}),style:{"--color-bg":a,"--color-border":a}}),(0,i.jsxs)(`div`,{className:n.t(`flex flex-1 justify-between leading-none`,b?`items-end`:`items-center`),children:[(0,i.jsxs)(`div`,{className:`grid gap-1.5`,children:[b?y:null,(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:r?.label??e.name})]}),e.value!=null&&(0,i.jsx)(`span`,{className:`text-foreground font-mono font-medium tabular-nums`,children:typeof e.value==`number`?e.value.toLocaleString():String(e.value)})]})]})},t)})})]})}var p=t.N;function m({className:e,hideIcon:t=!1,payload:r,verticalAlign:a=`bottom`,nameKey:o}){let{config:s}=c();return r?.length?(0,i.jsx)(`div`,{className:n.t(`flex items-center justify-center gap-4`,a===`top`?`pb-3`:`pt-3`,e),children:r.filter(e=>e.type!==`none`).map((e,r)=>{let a=h(s,e,`${o??e.dataKey??`value`}`);return(0,i.jsxs)(`div`,{className:n.t(`[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3`),children:[a?.icon&&!t?(0,i.jsx)(a.icon,{}):(0,i.jsx)(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:e.color}}),a?.label]},r)})}):null}function h(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}exports.ChartContainer=l,exports.ChartLegend=p,exports.ChartLegendContent=m,exports.ChartStyle=u,exports.ChartTooltip=d,exports.ChartTooltipContent=f;
7
+ `)}}):null},u=t.I;function d({active:e,payload:i,className:a,indicator:o=`dot`,hideLabel:c=!1,hideIndicator:l=!1,label:u,labelFormatter:d,labelClassName:f,formatter:p,color:h,nameKey:g,labelKey:_}){let{config:v}=s(),y=n.useMemo(()=>{if(c||!i?.length)return null;let[e]=i,n=m(v,e,`${_??e?.dataKey??e?.name??`value`}`),a=!_&&typeof u==`string`?v[u]?.label??u:n?.label;return d?(0,r.jsx)(`div`,{className:t.ei(`font-medium`,f),children:d(a,i)}):a?(0,r.jsx)(`div`,{className:t.ei(`font-medium`,f),children:a}):null},[u,d,i,c,f,v,_]);if(!e||!i?.length)return null;let b=i.length===1&&o!==`dot`;return(0,r.jsxs)(`div`,{className:t.ei(`border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl`,a),children:[b?null:y,(0,r.jsx)(`div`,{className:`grid gap-1.5`,children:i.filter(e=>e.type!==`none`).map((e,n)=>{let i=m(v,e,`${g??e.name??e.dataKey??`value`}`),a=h??e.payload?.fill??e.color;return(0,r.jsx)(`div`,{className:t.ei(`[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5`,o===`dot`&&`items-center`),children:p&&e?.value!==void 0&&e.name?p(e.value,e.name,e,n,e.payload):(0,r.jsxs)(r.Fragment,{children:[i?.icon?(0,r.jsx)(i.icon,{}):!l&&(0,r.jsx)(`div`,{className:t.ei(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":o===`dot`,"w-1":o===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":o===`dashed`,"my-0.5":b&&o===`dashed`}),style:{"--color-bg":a,"--color-border":a}}),(0,r.jsxs)(`div`,{className:t.ei(`flex flex-1 justify-between leading-none`,b?`items-end`:`items-center`),children:[(0,r.jsxs)(`div`,{className:`grid gap-1.5`,children:[b?y:null,(0,r.jsx)(`span`,{className:`text-muted-foreground`,children:i?.label??e.name})]}),e.value!=null&&(0,r.jsx)(`span`,{className:`text-foreground font-mono font-medium tabular-nums`,children:typeof e.value==`number`?e.value.toLocaleString():String(e.value)})]})]})},n)})})]})}var f=t.L;function p({className:e,hideIcon:n=!1,payload:i,verticalAlign:a=`bottom`,nameKey:o}){let{config:c}=s();return i?.length?(0,r.jsx)(`div`,{className:t.ei(`flex items-center justify-center gap-4`,a===`top`?`pb-3`:`pt-3`,e),children:i.filter(e=>e.type!==`none`).map((e,i)=>{let a=m(c,e,`${o??e.dataKey??`value`}`);return(0,r.jsxs)(`div`,{className:t.ei(`[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3`),children:[a?.icon&&!n?(0,r.jsx)(a.icon,{}):(0,r.jsx)(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:e.color}}),a?.label]},i)})}):null}function m(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}exports.ChartContainer=c,exports.ChartLegend=f,exports.ChartLegendContent=p,exports.ChartStyle=l,exports.ChartTooltip=u,exports.ChartTooltipContent=d;
8
8
  //# sourceMappingURL=chart.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart.cjs","names":[],"sources":["../packages/ui-web/src/chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { TooltipValueType } from 'recharts';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { cn } from './lib/utils';\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const;\n\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const;\ntype TooltipNameType = number | string;\n\nexport type ChartConfig = Record<\n string,\n {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n>;\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n initialDimension = INITIAL_DIMENSION,\n ...props\n}: React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n initialDimension?: {\n width: number;\n height: number;\n };\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id ?? uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer initialDimension={initialDimension}>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ?? itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, 'accessibilityLayer'>) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey ?? item?.dataKey ?? item?.name ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === 'string' ? (config[label]?.label ?? label) : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n className={cn(\n 'border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.name ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color ?? item.payload?.fill ?? item.color;\n\n return (\n <div\n key={index}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label ?? item.name}</span>\n </div>\n {item.value != null && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === 'number' ? item.value.toLocaleString() : String(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey,\n}: React.ComponentProps<'div'> & {\n hideIcon?: boolean;\n nameKey?: string;\n} & RechartsPrimitive.DefaultLegendContentProps) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={index}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string;\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\nexport { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };\n\n// The script was manually reverted here\n"],"mappings":"+PASM,EAAS,CAAE,MAAO,GAAI,KAAM,OAAQ,EAEpC,EAAoB,CAAE,MAAO,IAAK,OAAQ,GAAI,EAe9C,EAAe,EAAM,cAAwC,IAAI,EAEvE,SAAS,GAAW,CAClB,IAAM,EAAU,EAAM,WAAW,CAAY,EAE7C,GAAI,CAAC,EACH,MAAU,MAAM,mDAAmD,EAGrE,OAAO,CACT,CAEA,SAAS,EAAe,CACtB,KACA,YACA,WACA,SACA,mBAAmB,EACnB,GAAG,GAQF,CACD,IAAM,EAAW,EAAM,MAAM,EACvB,EAAU,SAAS,GAAM,EAAS,QAAQ,KAAM,EAAE,IAExD,OACE,EAAA,EAAA,KAAC,EAAa,SAAd,CAAuB,MAAO,CAAE,QAAO,YACrC,EAAA,EAAA,MAAC,MAAD,CAC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AO,EAAQ,IAAiC,SACpE,EAAiB,EAAQ,GAEzB,GACA,KAAO,GACP,OAAO,EAAe,IAAwC,WAE9D,EAAiB,EAAe,IAG3B,KAAkB,EAAS,EAAO,GAAkB,EAAO,EACpE"}
1
+ {"version":3,"file":"chart.cjs","names":[],"sources":["../packages/ui-web/src/chart.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from 'cn';\nimport * as React from 'react';\nimport type { TooltipValueType } from 'recharts';\nimport * as RechartsPrimitive from 'recharts';\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const;\n\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const;\ntype TooltipNameType = number | string;\n\nexport type ChartConfig = Record<\n string,\n {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n>;\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n initialDimension = INITIAL_DIMENSION,\n ...props\n}: React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n initialDimension?: {\n width: number;\n height: number;\n };\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id ?? uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer initialDimension={initialDimension}>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ?? itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, 'accessibilityLayer'>) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey ?? item?.dataKey ?? item?.name ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === 'string' ? (config[label]?.label ?? label) : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n className={cn(\n 'border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.name ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color ?? item.payload?.fill ?? item.color;\n\n return (\n <div\n key={index}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label ?? item.name}</span>\n </div>\n {item.value != null && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === 'number' ? item.value.toLocaleString() : String(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey,\n}: React.ComponentProps<'div'> & {\n hideIcon?: boolean;\n nameKey?: string;\n} & RechartsPrimitive.DefaultLegendContentProps) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={index}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string;\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\nexport { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };\n"],"mappings":"8NAQM,EAAS,CAAE,MAAO,GAAI,KAAM,OAAQ,EAEpC,EAAoB,CAAE,MAAO,IAAK,OAAQ,GAAI,EAe9C,EAAe,EAAM,cAAwC,IAAI,EAEvE,SAAS,GAAW,CAClB,IAAM,EAAU,EAAM,WAAW,CAAY,EAE7C,GAAI,CAAC,EACH,MAAU,MAAM,mDAAmD,EAGrE,OAAO,CACT,CAEA,SAAS,EAAe,CACtB,KACA,YACA,WACA,SACA,mBAAmB,EACnB,GAAG,GAQF,CACD,IAAM,EAAW,EAAM,MAAM,EACvB,EAAU,SAAS,GAAM,EAAS,QAAQ,KAAM,EAAE,IAExD,OACE,EAAA,EAAA,KAAC,EAAa,SAAd,CAAuB,MAAO,CAAE,QAAO,YACrC,EAAA,EAAA,MAAC,MAAD,CACE,YAAU,QACV,aAAY,EACZ,UAAW,EAAA,GACT,8pBACA,CACF,EACA,GAAI,WAPN,EASE,EAAA,EAAA,KAAC,EAAD,CAAY,GAAI,EAAiB,QAAS,CAAA,GAC1C,EAAA,EAAA,KAAA,EAAA,EAAA,CAAyD,mBACtD,UACoC,CAAA,CACpC,GACgB,CAAA,CAE3B,CAEA,IAAM,GAAc,CAAE,KAAI,YAAkD,CAC1E,IAAM,EAAc,OAAO,QAAQ,CAAM,EAAE,QAAQ,EAAG,KAAY,EAAO,OAAS,EAAO,KAAK,EAM9F,OAJK,EAAY,QAKf,EAAA,EAAA,KAAC,QAAD,CACE,wBAAyB,CACvB,OAAQ,OAAO,QAAQ,CAAM,EAC1B,KACE,CAAC,EAAO,KAAY;EAC/B,EAAO,eAAe,EAAG;EACzB,EACC,KAAK,CAAC,EAAK,KAAgB,C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G,yCAA0C,IAAkB,MAAQ,OAAS,OAAQ,CAAS,WAC9G,EACE,OAAQ,GAAS,EAAK,OAAS,MAAM,EACrC,KAAK,EAAM,IAAU,CAEpB,IAAM,EAAa,EAA4B,EAAQ,EAAM,GAD9C,GAAW,EAAK,SAAW,SACsB,EAEhE,OACE,EAAA,EAAA,MAAC,MAAD,CAEE,UAAW,EAAA,GAAG,iFAAiF,WAFjG,CAIG,GAAY,MAAQ,CAAC,GACpB,EAAA,EAAA,KAAC,EAAW,KAAZ,CAAkB,CAAA,GAElB,EAAA,EAAA,KAAC,MAAD,CACE,UAAU,iCACV,MAAO,CACL,gBAAiB,EAAK,KACxB,CACD,CAAA,EAEF,GAAY,KACV,GAdE,CAcF,CAET,CAAC,CACA,CAAA,EA9BE,IAgCX,CAEA,SAAS,EAA4B,EAAqB,EAAkB,EAAa,CACvF,GAAI,OAAO,GAAY,WAAY,EACjC,OAGF,IAAM,EACJ,YAAa,GAAW,OAAO,EAAQ,SAAY,UAAY,EAAQ,UAAY,KAC/E,EAAQ,QACR,IAAA,GAEF,EAAyB,EAY7B,OAVI,KAAO,GAAW,OAAO,EAAQ,IAAiC,SACpE,EAAiB,EAAQ,GAEzB,GACA,KAAO,GACP,OAAO,EAAe,IAAwC,WAE9D,EAAiB,EAAe,IAG3B,KAAkB,EAAS,EAAO,GAAkB,EAAO,EACpE"}
package/dist/chart.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './packages/ui-web/src/chart'
1
+ export * from './packages/ui-web/src/chart.js'
2
2
  export {}
package/dist/chart.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
  "use client";
3
- import { Jr as e, M as t, N as n, P as r } from "./vendor-B6CFfDyk.mjs";
4
- import { t as i } from "./utils-IYJAOUsw.mjs";
3
+ import { Ar as e, I as t, L as n, R as r, ei as i } from "./vendor-0E4gGRxj.mjs";
5
4
  import * as a from "react";
6
5
  //#region packages/ui-web/src/chart.tsx
7
6
  var o = e(), s = {
@@ -1 +1 @@
1
- {"version":3,"file":"chart.mjs","names":[],"sources":["../packages/ui-web/src/chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { TooltipValueType } from 'recharts';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { cn } from './lib/utils';\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const;\n\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const;\ntype TooltipNameType = number | string;\n\nexport type ChartConfig = Record<\n string,\n {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n>;\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n initialDimension = INITIAL_DIMENSION,\n ...props\n}: React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n initialDimension?: {\n width: number;\n height: number;\n };\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id ?? uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer initialDimension={initialDimension}>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ?? itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, 'accessibilityLayer'>) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey ?? item?.dataKey ?? item?.name ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === 'string' ? (config[label]?.label ?? label) : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n className={cn(\n 'border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.name ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color ?? item.payload?.fill ?? item.color;\n\n return (\n <div\n key={index}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label ?? item.name}</span>\n </div>\n {item.value != null && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === 'number' ? item.value.toLocaleString() : String(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey,\n}: React.ComponentProps<'div'> & {\n hideIcon?: boolean;\n nameKey?: string;\n} & RechartsPrimitive.DefaultLegendContentProps) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={index}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string;\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\nexport { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };\n\n// The script was manually reverted here\n"],"mappings":";;;;;;aASM,IAAS;CAAE,OAAO;CAAI,MAAM;AAAQ,GAEpC,IAAoB;CAAE,OAAO;CAAK,QAAQ;AAAI,GAe9C,IAAe,EAAM,cAAwC,IAAI;AAEvE,SAAS,IAAW;CAClB,IAAM,IAAU,EAAM,WAAW,CAAY;CAE7C,IAAI,CAAC,GACH,MAAU,MAAM,mDAAmD;CAGrE,OAAO;AACT;AAEA,SAAS,EAAe,EACtB,OACA,cACA,aACA,WACA,sBAAmB,GACnB,GAAG,KAQF;CACD,IAAM,IAAW,EAAM,MAAM,GACvB,IAAU,SAAS,KAAM,EAAS,QAAQ,MAAM,EAAE;CAExD,OACE,iBAAA,GAAA,EAAA,KAAC,EAAa,UAAd;EAAuB,OAAO,EAAE,UAAO;YACrC,iBAAA,GAAA,EAAA,MAAC,OAAD;GACE,aAAU;GACV,cAAY;GACZ,WAAW,EACT,+pBACA,CACF;GACA,GAAI;aAPN,CASE,iBAAA,GAAA,EAAA,KAAC,GAAD;IAAY,IAAI;IAAiB;GAAS,CAAA,GAC1C,iBAAA,GAAA,EAAA,KAAC,GAAD;IAAyD;IACtD;GACoC,CAAA,CACpC;;CACgB,CAAA;AAE3B;AAEA,IAAM,KAAc,EAAE,OAAI,gBAAkD;CAC1E,IAAM,IAAc,OAAO,QAAQ,CAAM,EAAE,QAAQ,GAAG,OAAY,EAAO,SAAS,EAAO,KAAK;CAM9F,OAJK,EAAY,SAKf,iBAAA,GAAA,EAAA,KAAC,SAAD,EACE,yBAAyB,EACvB,QAAQ,OAAO,QAAQ,CAAM,EAC1B,KACE,CAAC,GAAO,OAAY;EAC/B,EAAO,eAAe,EAAG;EACzB,EACC,KAAK,CAAC,GAAK,OAAgB;EAC1B,IAAM,IAAQ,EAAW,QAAQ,MAA2C,EAAW;EACvF,OAAO,IAAQ,aAAa,EAAI,IAAI,EAA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YAC9G,EACE,QAAQ,MAAS,EAAK,SAAS,MAAM,EACrC,KAAK,GAAM,MAAU;GAEpB,IAAM,IAAa,EAA4B,GAAQ,GAAM,GAD9C,KAAW,EAAK,WAAW,SACsB;GAEhE,OACE,iBAAA,GAAA,EAAA,MAAC,OAAD;IAEE,WAAW,EAAG,iFAAiF;cAFjG,CAIG,GAAY,QAAQ,CAAC,IACpB,iBAAA,GAAA,EAAA,KAAC,EAAW,MAAZ,CAAkB,CAAA,IAElB,iBAAA,GAAA,EAAA,KAAC,OAAD;KACE,WAAU;KACV,OAAO,EACL,iBAAiB,EAAK,MACxB;IACD,CAAA,GAEF,GAAY,KACV;MAdE,CAcF;EAET,CAAC;CACA,CAAA,IA9BE;AAgCX;AAEA,SAAS,EAA4B,GAAqB,GAAkB,GAAa;CACvF,IAAI,OAAO,KAAY,aAAY,GACjC;CAGF,IAAM,IACJ,aAAa,KAAW,OAAO,EAAQ,WAAY,YAAY,EAAQ,YAAY,OAC/E,EAAQ,UACR,KAAA,GAEF,IAAyB;CAY7B,OAVI,KAAO,KAAW,OAAO,EAAQ,MAAiC,WACpE,IAAiB,EAAQ,KAEzB,KACA,KAAO,KACP,OAAO,EAAe,MAAwC,aAE9D,IAAiB,EAAe,KAG3B,KAAkB,IAAS,EAAO,KAAkB,EAAO;AACpE"}
1
+ {"version":3,"file":"chart.mjs","names":[],"sources":["../packages/ui-web/src/chart.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from 'cn';\nimport * as React from 'react';\nimport type { TooltipValueType } from 'recharts';\nimport * as RechartsPrimitive from 'recharts';\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const;\n\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const;\ntype TooltipNameType = number | string;\n\nexport type ChartConfig = Record<\n string,\n {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n>;\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n initialDimension = INITIAL_DIMENSION,\n ...props\n}: React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n initialDimension?: {\n width: number;\n height: number;\n };\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id ?? uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer initialDimension={initialDimension}>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ?? itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, 'accessibilityLayer'>) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey ?? item?.dataKey ?? item?.name ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === 'string' ? (config[label]?.label ?? label) : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n className={cn(\n 'border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.name ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color ?? item.payload?.fill ?? item.color;\n\n return (\n <div\n key={index}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label ?? item.name}</span>\n </div>\n {item.value != null && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === 'number' ? item.value.toLocaleString() : String(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey,\n}: React.ComponentProps<'div'> & {\n hideIcon?: boolean;\n nameKey?: string;\n} & RechartsPrimitive.DefaultLegendContentProps) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={index}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string;\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\nexport { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };\n"],"mappings":";;;;;aAQM,IAAS;CAAE,OAAO;CAAI,MAAM;AAAQ,GAEpC,IAAoB;CAAE,OAAO;CAAK,QAAQ;AAAI,GAe9C,IAAe,EAAM,cAAwC,IAAI;AAEvE,SAAS,IAAW;CAClB,IAAM,IAAU,EAAM,WAAW,CAAY;CAE7C,IAAI,CAAC,GACH,MAAU,MAAM,mDAAmD;CAGrE,OAAO;AACT;AAEA,SAAS,EAAe,EACtB,OACA,cACA,aACA,WACA,sBAAmB,GACnB,GAAG,KAQF;CACD,IAAM,IAAW,EAAM,MAAM,GACvB,IA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BE;AAgCX;AAEA,SAAS,EAA4B,GAAqB,GAAkB,GAAa;CACvF,IAAI,OAAO,KAAY,aAAY,GACjC;CAGF,IAAM,IACJ,aAAa,KAAW,OAAO,EAAQ,WAAY,YAAY,EAAQ,YAAY,OAC/E,EAAQ,UACR,KAAA,GAEF,IAAyB;CAY7B,OAVI,KAAO,KAAW,OAAO,EAAQ,MAAiC,WACpE,IAAiB,EAAQ,KAEzB,KACA,KAAO,KACP,OAAO,EAAe,MAAwC,aAE9D,IAAiB,EAAe,KAG3B,KAAkB,IAAS,EAAO,KAAkB,EAAO;AACpE"}
package/dist/checkbox.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.js"),t=require("./vendor-UfQavLF9.js"),n=require("./utils-D7tt_q-u.js");let r=require("react");r=e.r(r);var i=t.Jr();function a({className:e,...r}){return(0,i.jsx)(t.mr,{"data-slot":`checkbox`,className:n.t(`peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3`,e),...r,children:(0,i.jsx)(t.hr,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,i.jsx)(t.it,{})})})}exports.Checkbox=a;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.js"),t=require("./vendor-Bz5F_va8.js");let n=require("react");n=e.r(n);var r=t.Ar();function i({className:e,...n}){return(0,r.jsx)(t.Zn,{"data-slot":`checkbox`,className:t.ei(`peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3`,e),...n,children:(0,r.jsx)(t.Qn,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,r.jsx)(t.Zr,{})})})}exports.Checkbox=i;
2
2
  //# sourceMappingURL=checkbox.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.cjs","names":[],"sources":["../packages/ui-web/src/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { CheckIcon } from 'lucide-react';\nimport { cn } from './lib/utils';\n\nimport type { CheckboxBaseProps } from '@gv-tech/ui-core';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCheckboxContract = React.ComponentProps<typeof Checkbox> extends CheckboxBaseProps ? true : false;\n"],"mappings":"kPAQA,SAAS,EAAS,CAAE,YAAW,GAAG,GAA8D,CAC9F,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,WACV,UAAW,EAAA,EACT,osBACA,CACF,EACA,GAAI,YAEJ,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,qBACV,UAAU,oFAEV,EAAA,EAAA,KAAC,EAAA,GAAD,CAAY,CAAA,CACe,CAAA,CACP,CAAA,CAE5B"}
1
+ {"version":3,"file":"checkbox.cjs","names":[],"sources":["../packages/ui-web/src/checkbox.tsx"],"sourcesContent":["import type { CheckboxBaseProps } from '@gv-tech/ui-core';\nimport { cn } from 'cn';\nimport { CheckIcon } from 'lucide-react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCheckboxContract = React.ComponentProps<typeof Checkbox> extends CheckboxBaseProps ? true : false;\n"],"mappings":"iNAMA,SAAS,EAAS,CAAE,YAAW,GAAG,GAA8D,CAC9F,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,WACV,UAAW,EAAA,GACT,01BACA,CACF,EACA,GAAI,YAEJ,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,qBACV,UAAU,oFAEV,EAAA,EAAA,KAAC,EAAA,GAAD,CAAY,CAAA,CACe,CAAA,CACP,CAAA,CAE5B"}
@@ -1,2 +1,2 @@
1
- export * from './packages/ui-web/src/checkbox'
1
+ export * from './packages/ui-web/src/checkbox.js'
2
2
  export {}
package/dist/checkbox.mjs CHANGED
@@ -1,18 +1,17 @@
1
1
  "use client";
2
- import { Jr as e, hr as t, it as n, mr as r } from "./vendor-B6CFfDyk.mjs";
3
- import { t as i } from "./utils-IYJAOUsw.mjs";
2
+ import { Ar as e, Qn as t, Zn as n, Zr as r, ei as i } from "./vendor-0E4gGRxj.mjs";
4
3
  import "react";
5
4
  //#region packages/ui-web/src/checkbox.tsx
6
5
  var a = e();
7
6
  function o({ className: e, ...o }) {
8
- return /* @__PURE__ */ (0, a.jsx)(r, {
7
+ return /* @__PURE__ */ (0, a.jsx)(n, {
9
8
  "data-slot": "checkbox",
10
- className: i("peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3", e),
9
+ className: i("peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3", e),
11
10
  ...o,
12
11
  children: /* @__PURE__ */ (0, a.jsx)(t, {
13
12
  "data-slot": "checkbox-indicator",
14
13
  className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
15
- children: /* @__PURE__ */ (0, a.jsx)(n, {})
14
+ children: /* @__PURE__ */ (0, a.jsx)(r, {})
16
15
  })
17
16
  });
18
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.mjs","names":[],"sources":["../packages/ui-web/src/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { CheckIcon } from 'lucide-react';\nimport { cn } from './lib/utils';\n\nimport type { CheckboxBaseProps } from '@gv-tech/ui-core';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCheckboxContract = React.ComponentProps<typeof Checkbox> extends CheckboxBaseProps ? true : false;\n"],"mappings":";;;;;;AAQA,SAAS,EAAS,EAAE,cAAW,GAAG,KAA8D;CAC9F,OACE,iBAAA,GAAA,EAAA,KAAC,GAAD;EACE,aAAU;EACV,WAAW,EACT,qsBACA,CACF;EACA,GAAI;YAEJ,iBAAA,GAAA,EAAA,KAAC,GAAD;GACE,aAAU;GACV,WAAU;aAEV,iBAAA,GAAA,EAAA,KAAC,GAAD,CAAY,CAAA;EACe,CAAA;CACP,CAAA;AAE5B"}
1
+ {"version":3,"file":"checkbox.mjs","names":[],"sources":["../packages/ui-web/src/checkbox.tsx"],"sourcesContent":["import type { CheckboxBaseProps } from '@gv-tech/ui-core';\nimport { cn } from 'cn';\nimport { CheckIcon } from 'lucide-react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCheckboxContract = React.ComponentProps<typeof Checkbox> extends CheckboxBaseProps ? true : false;\n"],"mappings":";;;;;AAMA,SAAS,EAAS,EAAE,cAAW,GAAG,KAA8D;CAC9F,OACE,iBAAA,GAAA,EAAA,KAAC,GAAD;EACE,aAAU;EACV,WAAW,EACT,21BACA,CACF;EACA,GAAI;YAEJ,iBAAA,GAAA,EAAA,KAAC,GAAD;GACE,aAAU;GACV,WAAU;aAEV,iBAAA,GAAA,EAAA,KAAC,GAAD,CAAY,CAAA;EACe,CAAA;CACP,CAAA;AAE5B"}
@@ -1,2 +1,2 @@
1
- "use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./vendor-UfQavLF9.js");var t=e.Jr();function n({...n}){return(0,t.jsx)(e.Kr,{"data-slot":`collapsible`,...n})}function r({...n}){return(0,t.jsx)(e.Gr,{"data-slot":`collapsible-trigger`,...n})}function i({...n}){return(0,t.jsx)(e.Wr,{"data-slot":`collapsible-content`,...n})}exports.Collapsible=n,exports.CollapsibleContent=i,exports.CollapsibleTrigger=r;
1
+ "use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./vendor-Bz5F_va8.js");var t=e.Ar();function n({...n}){return(0,t.jsx)(e.Dr,{"data-slot":`collapsible`,...n})}function r({...n}){return(0,t.jsx)(e.kr,{"data-slot":`collapsible-trigger`,...n})}function i({...n}){return(0,t.jsx)(e.Or,{"data-slot":`collapsible-content`,...n})}exports.Collapsible=n,exports.CollapsibleContent=i,exports.CollapsibleTrigger=r;
2
2
  //# sourceMappingURL=collapsible.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.cjs","names":[],"sources":["../packages/ui-web/src/collapsible.tsx"],"sourcesContent":["'use client';\n\nimport { Collapsible as CollapsiblePrimitive } from 'radix-ui';\n\nimport type { CollapsibleBaseProps } from '@gv-tech/ui-core';\n\nfunction Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nfunction CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />;\n}\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCollapsibleContract =\n React.ComponentProps<typeof Collapsible> extends CollapsibleBaseProps ? true : false;\n"],"mappings":"kJAMA,SAAS,EAAY,CAAE,GAAG,GAAiE,CACzF,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA2B,YAAU,cAAc,GAAI,CAAQ,CAAA,CACxE,CAEA,SAAS,EAAmB,CAAE,GAAG,GAA+E,CAC9G,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F,CAEA,SAAS,EAAmB,CAAE,GAAG,GAA+E,CAC9G,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F"}
1
+ {"version":3,"file":"collapsible.cjs","names":[],"sources":["../packages/ui-web/src/collapsible.tsx"],"sourcesContent":["'use client';\n\nimport type { CollapsibleBaseProps } from '@gv-tech/ui-core';\nimport { Collapsible as CollapsiblePrimitive } from 'radix-ui';\n\nfunction Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nfunction CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />;\n}\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCollapsibleContract =\n React.ComponentProps<typeof Collapsible> extends CollapsibleBaseProps ? true : false;\n"],"mappings":"kJAKA,SAAS,EAAY,CAAE,GAAG,GAAiE,CACzF,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA2B,YAAU,cAAc,GAAI,CAAQ,CAAA,CACxE,CAEA,SAAS,EAAmB,CAAE,GAAG,GAA+E,CAC9G,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F,CAEA,SAAS,EAAmB,CAAE,GAAG,GAA+E,CAC9G,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F"}
@@ -1,2 +1,2 @@
1
- export * from './packages/ui-web/src/collapsible'
1
+ export * from './packages/ui-web/src/collapsible.js'
2
2
  export {}