@gv-tech/design-system 2.28.0 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) 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 +17 -18
  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 +2 -3
  16. package/dist/alert.mjs.map +1 -1
  17. package/dist/aspect-ratio.cjs +1 -1
  18. package/dist/aspect-ratio.d.ts +1 -1
  19. package/dist/aspect-ratio.mjs +1 -1
  20. package/dist/attachment.cjs +2 -0
  21. package/dist/attachment.cjs.map +1 -0
  22. package/dist/attachment.d.ts +2 -0
  23. package/dist/attachment.mjs +100 -0
  24. package/dist/attachment.mjs.map +1 -0
  25. package/dist/avatar.cjs +1 -1
  26. package/dist/avatar.d.ts +1 -1
  27. package/dist/avatar.mjs +11 -11
  28. package/dist/badge.cjs +1 -1
  29. package/dist/badge.d.ts +1 -1
  30. package/dist/badge.mjs +2 -2
  31. package/dist/breadcrumb.cjs +1 -1
  32. package/dist/breadcrumb.cjs.map +1 -1
  33. package/dist/breadcrumb.d.ts +1 -1
  34. package/dist/breadcrumb.mjs +17 -18
  35. package/dist/breadcrumb.mjs.map +1 -1
  36. package/dist/bubble.cjs +2 -0
  37. package/dist/bubble.cjs.map +1 -0
  38. package/dist/bubble.d.ts +2 -0
  39. package/dist/bubble.mjs +72 -0
  40. package/dist/bubble.mjs.map +1 -0
  41. package/dist/button-group.cjs +1 -1
  42. package/dist/button-group.cjs.map +1 -1
  43. package/dist/button-group.d.ts +1 -1
  44. package/dist/button-group.mjs +10 -11
  45. package/dist/button-group.mjs.map +1 -1
  46. package/dist/button.cjs +1 -1
  47. package/dist/button.cjs.map +1 -1
  48. package/dist/button.d.ts +1 -1
  49. package/dist/button.mjs +7 -8
  50. package/dist/button.mjs.map +1 -1
  51. package/dist/calendar.cjs +1 -1
  52. package/dist/calendar.cjs.map +1 -1
  53. package/dist/calendar.d.ts +1 -1
  54. package/dist/calendar.mjs +22 -22
  55. package/dist/calendar.mjs.map +1 -1
  56. package/dist/card.cjs +1 -1
  57. package/dist/card.cjs.map +1 -1
  58. package/dist/card.d.ts +1 -1
  59. package/dist/card.mjs +5 -6
  60. package/dist/card.mjs.map +1 -1
  61. package/dist/carousel.cjs +1 -1
  62. package/dist/carousel.cjs.map +1 -1
  63. package/dist/carousel.d.ts +1 -1
  64. package/dist/carousel.mjs +23 -24
  65. package/dist/carousel.mjs.map +1 -1
  66. package/dist/chart.cjs +2 -2
  67. package/dist/chart.cjs.map +1 -1
  68. package/dist/chart.d.ts +1 -1
  69. package/dist/chart.mjs +1 -2
  70. package/dist/chart.mjs.map +1 -1
  71. package/dist/checkbox.cjs +1 -1
  72. package/dist/checkbox.cjs.map +1 -1
  73. package/dist/checkbox.d.ts +1 -1
  74. package/dist/checkbox.mjs +4 -5
  75. package/dist/checkbox.mjs.map +1 -1
  76. package/dist/collapsible.cjs +1 -1
  77. package/dist/collapsible.d.ts +1 -1
  78. package/dist/collapsible.mjs +7 -7
  79. package/dist/combobox.cjs +1 -1
  80. package/dist/combobox.cjs.map +1 -1
  81. package/dist/combobox.d.ts +1 -1
  82. package/dist/combobox.mjs +44 -45
  83. package/dist/combobox.mjs.map +1 -1
  84. package/dist/command.cjs +1 -1
  85. package/dist/command.cjs.map +1 -1
  86. package/dist/command.d.ts +1 -1
  87. package/dist/command.mjs +25 -26
  88. package/dist/command.mjs.map +1 -1
  89. package/dist/context-menu.cjs +1 -1
  90. package/dist/context-menu.cjs.map +1 -1
  91. package/dist/context-menu.d.ts +1 -1
  92. package/dist/context-menu.mjs +35 -36
  93. package/dist/context-menu.mjs.map +1 -1
  94. package/dist/design-system.css +1 -1
  95. package/dist/dialog.cjs +1 -1
  96. package/dist/dialog.cjs.map +1 -1
  97. package/dist/dialog.d.ts +1 -1
  98. package/dist/dialog.mjs +23 -24
  99. package/dist/dialog.mjs.map +1 -1
  100. package/dist/direction.cjs +1 -1
  101. package/dist/direction.d.ts +1 -1
  102. package/dist/direction.mjs +6 -6
  103. package/dist/drawer.cjs +1 -1
  104. package/dist/drawer.cjs.map +1 -1
  105. package/dist/drawer.d.ts +1 -1
  106. package/dist/drawer.mjs +2 -3
  107. package/dist/drawer.mjs.map +1 -1
  108. package/dist/dropdown-menu.cjs +1 -1
  109. package/dist/dropdown-menu.cjs.map +1 -1
  110. package/dist/dropdown-menu.d.ts +1 -1
  111. package/dist/dropdown-menu.mjs +41 -42
  112. package/dist/dropdown-menu.mjs.map +1 -1
  113. package/dist/empty.cjs +1 -1
  114. package/dist/empty.cjs.map +1 -1
  115. package/dist/empty.d.ts +1 -1
  116. package/dist/empty.mjs +2 -3
  117. package/dist/empty.mjs.map +1 -1
  118. package/dist/field.cjs +1 -1
  119. package/dist/field.cjs.map +1 -1
  120. package/dist/field.d.ts +1 -1
  121. package/dist/field.mjs +2 -3
  122. package/dist/field.mjs.map +1 -1
  123. package/dist/form.cjs +1 -1
  124. package/dist/form.cjs.map +1 -1
  125. package/dist/form.d.ts +1 -1
  126. package/dist/form.mjs +6 -6
  127. package/dist/hover-card.cjs +1 -1
  128. package/dist/hover-card.cjs.map +1 -1
  129. package/dist/hover-card.d.ts +1 -1
  130. package/dist/hover-card.mjs +11 -12
  131. package/dist/hover-card.mjs.map +1 -1
  132. package/dist/index.cjs +1 -1
  133. package/dist/index.d.ts +1 -1
  134. package/dist/index.mjs +74 -67
  135. package/dist/input-group.cjs +1 -1
  136. package/dist/input-group.cjs.map +1 -1
  137. package/dist/input-group.d.ts +1 -1
  138. package/dist/input-group.mjs +4 -5
  139. package/dist/input-group.mjs.map +1 -1
  140. package/dist/input-otp.cjs +1 -1
  141. package/dist/input-otp.cjs.map +1 -1
  142. package/dist/input-otp.d.ts +1 -1
  143. package/dist/input-otp.mjs +11 -12
  144. package/dist/input-otp.mjs.map +1 -1
  145. package/dist/input.cjs +1 -1
  146. package/dist/input.cjs.map +1 -1
  147. package/dist/input.d.ts +1 -1
  148. package/dist/input.mjs +1 -2
  149. package/dist/input.mjs.map +1 -1
  150. package/dist/item.cjs +1 -1
  151. package/dist/item.cjs.map +1 -1
  152. package/dist/item.d.ts +1 -1
  153. package/dist/item.mjs +15 -16
  154. package/dist/item.mjs.map +1 -1
  155. package/dist/kbd.cjs +1 -1
  156. package/dist/kbd.cjs.map +1 -1
  157. package/dist/kbd.d.ts +1 -1
  158. package/dist/kbd.mjs +2 -3
  159. package/dist/kbd.mjs.map +1 -1
  160. package/dist/label.cjs +1 -1
  161. package/dist/label.cjs.map +1 -1
  162. package/dist/label.d.ts +1 -1
  163. package/dist/label.mjs +1 -2
  164. package/dist/label.mjs.map +1 -1
  165. package/dist/marker.cjs +2 -0
  166. package/dist/marker.cjs.map +1 -0
  167. package/dist/marker.d.ts +2 -0
  168. package/dist/marker.mjs +39 -0
  169. package/dist/marker.mjs.map +1 -0
  170. package/dist/menubar.cjs +1 -1
  171. package/dist/menubar.cjs.map +1 -1
  172. package/dist/menubar.d.ts +1 -1
  173. package/dist/menubar.mjs +43 -44
  174. package/dist/menubar.mjs.map +1 -1
  175. package/dist/message-scroller.cjs +2 -0
  176. package/dist/message-scroller.cjs.map +1 -0
  177. package/dist/message-scroller.d.ts +2 -0
  178. package/dist/message-scroller.mjs +61 -0
  179. package/dist/message-scroller.mjs.map +1 -0
  180. package/dist/message.cjs +2 -0
  181. package/dist/message.cjs.map +1 -0
  182. package/dist/message.d.ts +2 -0
  183. package/dist/message.mjs +52 -0
  184. package/dist/message.mjs.map +1 -0
  185. package/dist/native-select.cjs +1 -1
  186. package/dist/native-select.cjs.map +1 -1
  187. package/dist/native-select.d.ts +1 -1
  188. package/dist/native-select.mjs +1 -2
  189. package/dist/native-select.mjs.map +1 -1
  190. package/dist/navigation-menu.cjs +1 -1
  191. package/dist/navigation-menu.cjs.map +1 -1
  192. package/dist/navigation-menu.d.ts +1 -1
  193. package/dist/navigation-menu.mjs +23 -24
  194. package/dist/navigation-menu.mjs.map +1 -1
  195. package/dist/packages/ui-core/src/contracts/attachment.d.ts +47 -0
  196. package/dist/packages/ui-core/src/contracts/bubble.d.ts +27 -0
  197. package/dist/packages/ui-core/src/contracts/marker.d.ts +16 -0
  198. package/dist/packages/ui-core/src/contracts/message-scroller.d.ts +31 -0
  199. package/dist/packages/ui-core/src/contracts/message.d.ts +28 -0
  200. package/dist/packages/ui-core/src/contracts/questionnaire.d.ts +72 -0
  201. package/dist/packages/ui-core/src/index.d.ts +6 -0
  202. package/dist/packages/ui-web/src/__contracts.d.ts +44 -1
  203. package/dist/packages/ui-web/src/accordion.d.ts +4 -4
  204. package/dist/packages/ui-web/src/alert-dialog.d.ts +12 -12
  205. package/dist/packages/ui-web/src/alert.d.ts +4 -4
  206. package/dist/packages/ui-web/src/aspect-ratio.d.ts +1 -1
  207. package/dist/packages/ui-web/src/attachment.d.ts +23 -0
  208. package/dist/packages/ui-web/src/attachment.test.d.ts +1 -0
  209. package/dist/packages/ui-web/src/avatar.d.ts +6 -6
  210. package/dist/packages/ui-web/src/badge.d.ts +1 -1
  211. package/dist/packages/ui-web/src/breadcrumb.d.ts +7 -7
  212. package/dist/packages/ui-web/src/bubble.d.ts +13 -0
  213. package/dist/packages/ui-web/src/bubble.test.d.ts +1 -0
  214. package/dist/packages/ui-web/src/button-group.d.ts +3 -3
  215. package/dist/packages/ui-web/src/button.d.ts +1 -1
  216. package/dist/packages/ui-web/src/calendar.d.ts +2 -2
  217. package/dist/packages/ui-web/src/card.d.ts +7 -7
  218. package/dist/packages/ui-web/src/carousel.d.ts +5 -5
  219. package/dist/packages/ui-web/src/chart.d.ts +4 -4
  220. package/dist/packages/ui-web/src/checkbox.d.ts +1 -1
  221. package/dist/packages/ui-web/src/collapsible.d.ts +3 -3
  222. package/dist/packages/ui-web/src/combobox.d.ts +14 -14
  223. package/dist/packages/ui-web/src/command.d.ts +9 -9
  224. package/dist/packages/ui-web/src/context-menu.d.ts +15 -15
  225. package/dist/packages/ui-web/src/dialog.d.ts +10 -10
  226. package/dist/packages/ui-web/src/direction.d.ts +1 -1
  227. package/dist/packages/ui-web/src/drawer.d.ts +10 -10
  228. package/dist/packages/ui-web/src/dropdown-menu.d.ts +15 -15
  229. package/dist/packages/ui-web/src/empty.d.ts +6 -6
  230. package/dist/packages/ui-web/src/field.d.ts +11 -11
  231. package/dist/packages/ui-web/src/form.d.ts +6 -5
  232. package/dist/packages/ui-web/src/hover-card.d.ts +3 -3
  233. package/dist/packages/ui-web/src/index.d.ts +6 -0
  234. package/dist/packages/ui-web/src/input-group.d.ts +7 -7
  235. package/dist/packages/ui-web/src/input-otp.d.ts +4 -4
  236. package/dist/packages/ui-web/src/input.d.ts +1 -1
  237. package/dist/packages/ui-web/src/item.d.ts +11 -11
  238. package/dist/packages/ui-web/src/kbd.d.ts +2 -2
  239. package/dist/packages/ui-web/src/label.d.ts +1 -1
  240. package/dist/packages/ui-web/src/marker.d.ts +12 -0
  241. package/dist/packages/ui-web/src/marker.test.d.ts +1 -0
  242. package/dist/packages/ui-web/src/menubar.d.ts +16 -16
  243. package/dist/packages/ui-web/src/message-scroller.d.ts +12 -0
  244. package/dist/packages/ui-web/src/message-scroller.test.d.ts +1 -0
  245. package/dist/packages/ui-web/src/message.d.ts +10 -0
  246. package/dist/packages/ui-web/src/message.test.d.ts +1 -0
  247. package/dist/packages/ui-web/src/native-select.d.ts +3 -3
  248. package/dist/packages/ui-web/src/navigation-menu.d.ts +8 -8
  249. package/dist/packages/ui-web/src/pagination.d.ts +7 -7
  250. package/dist/packages/ui-web/src/popover.d.ts +7 -7
  251. package/dist/packages/ui-web/src/progress.d.ts +1 -1
  252. package/dist/packages/ui-web/src/questionnaire.d.ts +21 -0
  253. package/dist/packages/ui-web/src/questionnaire.test.d.ts +1 -0
  254. package/dist/packages/ui-web/src/radio-group.d.ts +2 -2
  255. package/dist/packages/ui-web/src/resizable.d.ts +3 -3
  256. package/dist/packages/ui-web/src/scroll-area.d.ts +2 -2
  257. package/dist/packages/ui-web/src/scroll-to-top.d.ts +1 -1
  258. package/dist/packages/ui-web/src/search.d.ts +1 -1
  259. package/dist/packages/ui-web/src/select.d.ts +10 -10
  260. package/dist/packages/ui-web/src/separator.d.ts +1 -1
  261. package/dist/packages/ui-web/src/sheet.d.ts +8 -8
  262. package/dist/packages/ui-web/src/sidebar.d.ts +24 -24
  263. package/dist/packages/ui-web/src/skeleton.d.ts +1 -1
  264. package/dist/packages/ui-web/src/slider.d.ts +1 -1
  265. package/dist/packages/ui-web/src/sonner.d.ts +2 -4
  266. package/dist/packages/ui-web/src/spinner.d.ts +1 -1
  267. package/dist/packages/ui-web/src/support-fab.d.ts +1 -1
  268. package/dist/packages/ui-web/src/switch.d.ts +1 -1
  269. package/dist/packages/ui-web/src/table-of-contents.d.ts +4 -3
  270. package/dist/packages/ui-web/src/table.d.ts +8 -8
  271. package/dist/packages/ui-web/src/tabs.d.ts +4 -4
  272. package/dist/packages/ui-web/src/textarea.d.ts +1 -1
  273. package/dist/packages/ui-web/src/theme-provider.d.ts +1 -1
  274. package/dist/packages/ui-web/src/theme-toggle.d.ts +1 -1
  275. package/dist/packages/ui-web/src/toaster.d.ts +1 -1
  276. package/dist/packages/ui-web/src/toggle-group.d.ts +2 -2
  277. package/dist/packages/ui-web/src/toggle.d.ts +1 -1
  278. package/dist/packages/ui-web/src/tooltip.d.ts +4 -4
  279. package/dist/pagination.cjs +1 -1
  280. package/dist/pagination.cjs.map +1 -1
  281. package/dist/pagination.d.ts +1 -1
  282. package/dist/pagination.mjs +18 -13
  283. package/dist/pagination.mjs.map +1 -1
  284. package/dist/popover.cjs +1 -1
  285. package/dist/popover.cjs.map +1 -1
  286. package/dist/popover.d.ts +1 -1
  287. package/dist/popover.mjs +8 -9
  288. package/dist/popover.mjs.map +1 -1
  289. package/dist/progress.cjs +1 -1
  290. package/dist/progress.cjs.map +1 -1
  291. package/dist/progress.d.ts +1 -1
  292. package/dist/progress.mjs +4 -5
  293. package/dist/progress.mjs.map +1 -1
  294. package/dist/questionnaire.cjs +2 -0
  295. package/dist/questionnaire.cjs.map +1 -0
  296. package/dist/questionnaire.d.ts +2 -0
  297. package/dist/questionnaire.mjs +171 -0
  298. package/dist/questionnaire.mjs.map +1 -0
  299. package/dist/radio-group.cjs +1 -1
  300. package/dist/radio-group.cjs.map +1 -1
  301. package/dist/radio-group.d.ts +1 -1
  302. package/dist/radio-group.mjs +10 -11
  303. package/dist/radio-group.mjs.map +1 -1
  304. package/dist/resizable.cjs +1 -1
  305. package/dist/resizable.cjs.map +1 -1
  306. package/dist/resizable.d.ts +1 -1
  307. package/dist/resizable.mjs +10 -11
  308. package/dist/resizable.mjs.map +1 -1
  309. package/dist/scroll-area.cjs +1 -1
  310. package/dist/scroll-area.cjs.map +1 -1
  311. package/dist/scroll-area.d.ts +1 -1
  312. package/dist/scroll-area.mjs +9 -10
  313. package/dist/scroll-area.mjs.map +1 -1
  314. package/dist/scroll-to-top.cjs +1 -1
  315. package/dist/scroll-to-top.d.ts +1 -1
  316. package/dist/scroll-to-top.mjs +2 -2
  317. package/dist/search.cjs +1 -1
  318. package/dist/search.cjs.map +1 -1
  319. package/dist/search.d.ts +1 -1
  320. package/dist/search.mjs +2 -2
  321. package/dist/select.cjs +1 -1
  322. package/dist/select.cjs.map +1 -1
  323. package/dist/select.d.ts +1 -1
  324. package/dist/select.mjs +32 -33
  325. package/dist/select.mjs.map +1 -1
  326. package/dist/separator.cjs +1 -1
  327. package/dist/separator.cjs.map +1 -1
  328. package/dist/separator.d.ts +1 -1
  329. package/dist/separator.mjs +3 -4
  330. package/dist/separator.mjs.map +1 -1
  331. package/dist/sheet.cjs +1 -1
  332. package/dist/sheet.cjs.map +1 -1
  333. package/dist/sheet.d.ts +1 -1
  334. package/dist/sheet.mjs +22 -23
  335. package/dist/sheet.mjs.map +1 -1
  336. package/dist/{sidebar-BnEmNYS2.mjs → sidebar-C5ukZKYH.mjs} +40 -41
  337. package/dist/sidebar-C5ukZKYH.mjs.map +1 -0
  338. package/dist/sidebar-DyP2Q-Ru.js +2 -0
  339. package/dist/sidebar-DyP2Q-Ru.js.map +1 -0
  340. package/dist/sidebar.cjs +1 -1
  341. package/dist/sidebar.d.ts +1 -1
  342. package/dist/sidebar.mjs +1 -1
  343. package/dist/skeleton.cjs +1 -1
  344. package/dist/skeleton.cjs.map +1 -1
  345. package/dist/skeleton.d.ts +1 -1
  346. package/dist/skeleton.mjs +1 -2
  347. package/dist/skeleton.mjs.map +1 -1
  348. package/dist/slider.cjs +1 -1
  349. package/dist/slider.cjs.map +1 -1
  350. package/dist/slider.d.ts +1 -1
  351. package/dist/slider.mjs +11 -12
  352. package/dist/slider.mjs.map +1 -1
  353. package/dist/sonner.cjs +1 -1
  354. package/dist/sonner.cjs.map +1 -1
  355. package/dist/sonner.d.ts +1 -1
  356. package/dist/sonner.mjs +9 -9
  357. package/dist/sonner.mjs.map +1 -1
  358. package/dist/spinner.cjs +1 -1
  359. package/dist/spinner.cjs.map +1 -1
  360. package/dist/spinner.d.ts +1 -1
  361. package/dist/spinner.mjs +6 -6
  362. package/dist/spinner.mjs.map +1 -1
  363. package/dist/support-fab.cjs +1 -1
  364. package/dist/support-fab.cjs.map +1 -1
  365. package/dist/support-fab.d.ts +1 -1
  366. package/dist/support-fab.mjs +2 -2
  367. package/dist/switch.cjs +1 -1
  368. package/dist/switch.cjs.map +1 -1
  369. package/dist/switch.d.ts +1 -1
  370. package/dist/switch.mjs +7 -8
  371. package/dist/switch.mjs.map +1 -1
  372. package/dist/table-of-contents.cjs +1 -1
  373. package/dist/table-of-contents.cjs.map +1 -1
  374. package/dist/table-of-contents.d.ts +1 -1
  375. package/dist/table-of-contents.mjs +4 -4
  376. package/dist/table-of-contents.mjs.map +1 -1
  377. package/dist/table.cjs +1 -1
  378. package/dist/table.cjs.map +1 -1
  379. package/dist/table.d.ts +1 -1
  380. package/dist/table.mjs +1 -2
  381. package/dist/table.mjs.map +1 -1
  382. package/dist/tabs.cjs +1 -1
  383. package/dist/tabs.cjs.map +1 -1
  384. package/dist/tabs.d.ts +1 -1
  385. package/dist/tabs.mjs +15 -16
  386. package/dist/tabs.mjs.map +1 -1
  387. package/dist/text.cjs +1 -1
  388. package/dist/text.d.ts +1 -1
  389. package/dist/text.mjs +2 -2
  390. package/dist/textarea.cjs +1 -1
  391. package/dist/textarea.cjs.map +1 -1
  392. package/dist/textarea.d.ts +1 -1
  393. package/dist/textarea.mjs +1 -2
  394. package/dist/textarea.mjs.map +1 -1
  395. package/dist/theme-provider.cjs +1 -1
  396. package/dist/theme-provider.d.ts +1 -1
  397. package/dist/theme-provider.mjs +1 -1
  398. package/dist/{theme-toggle-CgEJLId-.mjs → theme-toggle-BGVdrh4J.mjs} +12 -12
  399. package/dist/{theme-toggle-CgEJLId-.mjs.map → theme-toggle-BGVdrh4J.mjs.map} +1 -1
  400. package/dist/{theme-toggle-CNDBFa9t.js → theme-toggle-CMdzi7Y8.js} +2 -2
  401. package/dist/{theme-toggle-CNDBFa9t.js.map → theme-toggle-CMdzi7Y8.js.map} +1 -1
  402. package/dist/theme-toggle.cjs +1 -1
  403. package/dist/theme-toggle.d.ts +1 -1
  404. package/dist/theme-toggle.mjs +1 -1
  405. package/dist/toast.cjs +1 -1
  406. package/dist/toast.cjs.map +1 -1
  407. package/dist/toast.d.ts +1 -1
  408. package/dist/toast.mjs +20 -20
  409. package/dist/{toaster-DH0UX0nD.mjs → toaster-CfNd-vsx.mjs} +2 -2
  410. package/dist/{toaster-DH0UX0nD.mjs.map → toaster-CfNd-vsx.mjs.map} +1 -1
  411. package/dist/{toaster-C3UZyPzU.js → toaster-D9OZF7hL.js} +2 -2
  412. package/dist/{toaster-C3UZyPzU.js.map → toaster-D9OZF7hL.js.map} +1 -1
  413. package/dist/toaster.cjs +1 -1
  414. package/dist/toaster.d.ts +1 -1
  415. package/dist/toaster.mjs +1 -1
  416. package/dist/toggle-group.cjs +1 -1
  417. package/dist/toggle-group.cjs.map +1 -1
  418. package/dist/toggle-group.d.ts +1 -1
  419. package/dist/toggle-group.mjs +3 -4
  420. package/dist/toggle-group.mjs.map +1 -1
  421. package/dist/toggle.cjs +1 -1
  422. package/dist/toggle.cjs.map +1 -1
  423. package/dist/toggle.d.ts +1 -1
  424. package/dist/toggle.mjs +3 -4
  425. package/dist/toggle.mjs.map +1 -1
  426. package/dist/tooltip.cjs +1 -1
  427. package/dist/tooltip.cjs.map +1 -1
  428. package/dist/tooltip.d.ts +1 -1
  429. package/dist/tooltip.mjs +5 -6
  430. package/dist/tooltip.mjs.map +1 -1
  431. package/dist/{utils-IYJAOUsw.mjs → utils-BtHTUEvP.mjs} +2 -2
  432. package/dist/{utils-IYJAOUsw.mjs.map → utils-BtHTUEvP.mjs.map} +1 -1
  433. package/dist/{utils-D7tt_q-u.js → utils-CnOgTvBJ.js} +2 -2
  434. package/dist/{utils-D7tt_q-u.js.map → utils-CnOgTvBJ.js.map} +1 -1
  435. package/dist/{vendor-B6CFfDyk.mjs → vendor-D9rWr_E8.mjs} +19011 -15688
  436. package/dist/vendor-D9rWr_E8.mjs.map +1 -0
  437. package/dist/vendor-i1KCLryV.js +101 -0
  438. package/dist/vendor-i1KCLryV.js.map +1 -0
  439. package/package.json +15 -14
  440. package/dist/sidebar-BnEmNYS2.mjs.map +0 -1
  441. package/dist/sidebar-BnuanaZN.js +0 -2
  442. package/dist/sidebar-BnuanaZN.js.map +0 -1
  443. package/dist/vendor-B6CFfDyk.mjs.map +0 -1
  444. package/dist/vendor-UfQavLF9.js +0 -111
  445. package/dist/vendor-UfQavLF9.js.map +0 -1
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-D9rWr_E8.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,8 +32,8 @@ 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,
@@ -42,7 +41,7 @@ function u({ orientation: t = "horizontal", opts: n, setApi: r, plugins: a, clas
42
41
  },
43
42
  children: /* @__PURE__ */ (0, s.jsx)("div", {
44
43
  onKeyDownCapture: x,
45
- className: i("relative", l),
44
+ className: r("relative", l),
46
45
  role: "region",
47
46
  "aria-roledescription": "carousel",
48
47
  "data-slot": "carousel",
@@ -52,13 +51,13 @@ function u({ orientation: t = "horizontal", opts: n, setApi: r, plugins: a, clas
52
51
  });
53
52
  }
54
53
  function d({ className: e, ...t }) {
55
- let { carouselRef: n, orientation: r } = l();
54
+ let { carouselRef: n, orientation: i } = l();
56
55
  return /* @__PURE__ */ (0, s.jsx)("div", {
57
56
  ref: n,
58
57
  className: "overflow-hidden",
59
58
  "data-slot": "carousel-content",
60
59
  children: /* @__PURE__ */ (0, s.jsx)("div", {
61
- className: i("flex", r === "horizontal" ? "-ms-4" : "-mt-4 flex-col", e),
60
+ className: r("flex", i === "horizontal" ? "-ms-4" : "-mt-4 flex-col", e),
62
61
  ...t
63
62
  })
64
63
  });
@@ -69,37 +68,37 @@ function f({ className: e, ...t }) {
69
68
  role: "group",
70
69
  "aria-roledescription": "slide",
71
70
  "data-slot": "carousel-item",
72
- className: i("min-w-0 shrink-0 grow-0 basis-full", n === "horizontal" ? "ps-4" : "pt-4", e),
71
+ className: r("min-w-0 shrink-0 grow-0 basis-full", n === "horizontal" ? "ps-4" : "pt-4", e),
73
72
  ...t
74
73
  });
75
74
  }
76
- function p({ className: e, variant: t = "outline", size: r = "icon-sm", ...o }) {
75
+ function p({ className: e, variant: t = "outline", size: i = "icon-sm", ...o }) {
77
76
  let { orientation: c, scrollPrev: u, canScrollPrev: d } = l();
78
77
  return /* @__PURE__ */ (0, s.jsxs)(a, {
79
78
  "data-slot": "carousel-previous",
80
79
  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),
80
+ size: i,
81
+ 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
82
  disabled: !d,
84
83
  onClick: u,
85
84
  ...o,
86
- children: [/* @__PURE__ */ (0, s.jsx)(n, {}), /* @__PURE__ */ (0, s.jsx)("span", {
85
+ children: [/* @__PURE__ */ (0, s.jsx)(n, { className: "rtl:rotate-180" }), /* @__PURE__ */ (0, s.jsx)("span", {
87
86
  className: "sr-only",
88
87
  children: "Previous slide"
89
88
  })]
90
89
  });
91
90
  }
92
- function m({ className: e, variant: t = "outline", size: n = "icon-sm", ...o }) {
91
+ function m({ className: e, variant: n = "outline", size: i = "icon-sm", ...o }) {
93
92
  let { orientation: c, scrollNext: u, canScrollNext: d } = l();
94
93
  return /* @__PURE__ */ (0, s.jsxs)(a, {
95
94
  "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),
95
+ variant: n,
96
+ size: i,
97
+ 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
98
  disabled: !d,
100
99
  onClick: u,
101
100
  ...o,
102
- children: [/* @__PURE__ */ (0, s.jsx)(r, {}), /* @__PURE__ */ (0, s.jsx)("span", {
101
+ children: [/* @__PURE__ */ (0, s.jsx)(t, { className: "rtl:rotate-180" }), /* @__PURE__ */ (0, s.jsx)("span", {
103
102
  className: "sr-only",
104
103
  children: "Next slide"
105
104
  })]
@@ -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,KAAo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;;AAEZ"}
1
+ {"version":3,"file":"carousel.mjs","names":[],"sources":["../packages/ui-web/src/carousel.tsx"],"sourcesContent":["import { 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\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 ? '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":";;;;;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,KAAo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,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-i1KCLryV.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,CACE,YAAU,QACV,aAAY,EACZ,UAAW,EAAA,EACT,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,CAA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AAM,CAAE,UAAW,EAAS,EAM5B,OAJK,GAAS,QAKZ,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,EAAG,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,EAAG,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"}
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,EAG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V,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-D9rWr_E8.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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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,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,OAA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bol.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-i1KCLryV.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 { cn } from 'cn';\nimport { CheckIcon } from 'lucide-react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\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 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":"iNAOA,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-D9rWr_E8.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 { cn } from 'cn';\nimport { CheckIcon } from 'lucide-react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\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 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":";;;;;AAOA,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-i1KCLryV.js");var t=e.Ar();function n({...n}){return(0,t.jsx)(e.kr,{"data-slot":`collapsible`,...n})}function r({...n}){return(0,t.jsx)(e.Or,{"data-slot":`collapsible-trigger`,...n})}function i({...n}){return(0,t.jsx)(e.Dr,{"data-slot":`collapsible-content`,...n})}exports.Collapsible=n,exports.CollapsibleContent=i,exports.CollapsibleTrigger=r;
2
2
  //# sourceMappingURL=collapsible.cjs.map
@@ -1,2 +1,2 @@
1
- export * from './packages/ui-web/src/collapsible'
1
+ export * from './packages/ui-web/src/collapsible.js'
2
2
  export {}
@@ -1,22 +1,22 @@
1
1
  "use client";
2
2
  "use client";
3
- import { Gr as e, Jr as t, Kr as n, Wr as r } from "./vendor-B6CFfDyk.mjs";
3
+ import { Ar as e, Dr as t, Or as n, kr as r } from "./vendor-D9rWr_E8.mjs";
4
4
  //#region packages/ui-web/src/collapsible.tsx
5
- var i = t();
5
+ var i = e();
6
6
  function a({ ...e }) {
7
- return /* @__PURE__ */ (0, i.jsx)(n, {
7
+ return /* @__PURE__ */ (0, i.jsx)(r, {
8
8
  "data-slot": "collapsible",
9
9
  ...e
10
10
  });
11
11
  }
12
- function o({ ...t }) {
13
- return /* @__PURE__ */ (0, i.jsx)(e, {
12
+ function o({ ...e }) {
13
+ return /* @__PURE__ */ (0, i.jsx)(n, {
14
14
  "data-slot": "collapsible-trigger",
15
- ...t
15
+ ...e
16
16
  });
17
17
  }
18
18
  function s({ ...e }) {
19
- return /* @__PURE__ */ (0, i.jsx)(r, {
19
+ return /* @__PURE__ */ (0, i.jsx)(t, {
20
20
  "data-slot": "collapsible-content",
21
21
  ...e
22
22
  });
package/dist/combobox.cjs CHANGED
@@ -1,2 +1,2 @@
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"),r=require("./button.cjs"),i=require("./input-group.cjs");let a=require("react");a=e.r(a);var o=t.Jr(),s=t.c;function c({...e}){return(0,o.jsx)(t.s,{"data-slot":`combobox-value`,...e})}function l({className:e,children:r,...i}){return(0,o.jsxs)(t.x,{"data-slot":`combobox-trigger`,className:n.t(`[&_svg:not([class*=size-])]:size-4`,e),...i,children:[r,(0,o.jsx)(t.rt,{className:`text-muted-foreground pointer-events-none size-4`})]})}function u({className:e,...r}){return(0,o.jsx)(t.y,{"data-slot":`combobox-clear`,render:(0,o.jsx)(i.InputGroupButton,{variant:`ghost`,size:`icon-xs`}),className:n.t(e),...r,children:(0,o.jsx)(t.z,{className:`pointer-events-none`})})}function d({className:e,children:r,disabled:a=!1,showTrigger:s=!0,showClear:c=!1,...d}){return(0,o.jsxs)(i.InputGroup,{className:n.t(`w-auto`,e),children:[(0,o.jsx)(t.b,{render:(0,o.jsx)(i.InputGroupInput,{disabled:a}),...d}),(0,o.jsxs)(i.InputGroupAddon,{align:`inline-end`,children:[s&&(0,o.jsx)(i.InputGroupButton,{size:`icon-xs`,variant:`ghost`,asChild:!0,"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:a,children:(0,o.jsx)(l,{})}),c&&(0,o.jsx)(u,{disabled:a})]}),r]})}function f({className:e,side:r=`bottom`,sideOffset:i=6,align:a=`start`,alignOffset:s=0,anchor:c,...l}){return(0,o.jsx)(t.g,{children:(0,o.jsx)(t.h,{side:r,sideOffset:i,align:a,alignOffset:s,anchor:c,className:`isolate z-50`,children:(0,o.jsx)(t.m,{"data-slot":`combobox-content`,"data-chips":!!c,className:n.t(`group/combobox-content bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg shadow-md ring-1 duration-100 data-[chips=true]:min-w-(--anchor-width) *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none`,e),...l})})})}function p({className:e,...r}){return(0,o.jsx)(t._,{"data-slot":`combobox-list`,className:n.t(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,e),...r})}function m({className:e,children:r,...i}){return(0,o.jsxs)(t.d,{"data-slot":`combobox-item`,className:n.t(`data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4`,e),...i,children:[r,(0,o.jsx)(t.o,{render:(0,o.jsx)(`span`,{className:`pointer-events-none absolute end-2 flex size-4 items-center justify-center`}),children:(0,o.jsx)(t.it,{className:`pointer-events-none`})})]})}function h({className:e,...r}){return(0,o.jsx)(t.p,{"data-slot":`combobox-group`,className:n.t(e),...r})}function g({className:e,...r}){return(0,o.jsx)(t.f,{"data-slot":`combobox-label`,className:n.t(`text-muted-foreground px-2 py-1.5 text-xs`,e),...r})}function _({...e}){return(0,o.jsx)(t.v,{"data-slot":`combobox-collection`,...e})}function v({className:e,...r}){return(0,o.jsx)(t.u,{"data-slot":`combobox-empty`,className:n.t(`text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex`,e),...r})}function y({className:e,...r}){return(0,o.jsx)(t.l,{"data-slot":`combobox-separator`,className:n.t(`bg-border -mx-1 my-1 h-px`,e),...r})}function b({className:e,...r}){return(0,o.jsx)(t.a,{"data-slot":`combobox-chips`,className:n.t(`border-input focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-destructive/20 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40 flex min-h-8 flex-wrap items-center gap-1 rounded-lg border bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:ring-3 has-aria-invalid:ring-3 has-data-[slot=combobox-chip]:px-1`,e),...r})}function x({className:e,children:i,showRemove:a=!0,...s}){return(0,o.jsxs)(t.i,{"data-slot":`combobox-chip`,className:n.t(`bg-muted text-foreground flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm px-1.5 text-xs font-medium whitespace-nowrap has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-0`,e),...s,children:[i,a&&(0,o.jsx)(t.r,{render:(0,o.jsx)(r.Button,{variant:`ghost`,size:`icon-xs`}),className:`-ms-1 opacity-50 hover:opacity-100`,"data-slot":`combobox-chip-remove`,children:(0,o.jsx)(t.z,{className:`pointer-events-none`})})]})}function S({className:e,...r}){return(0,o.jsx)(t.b,{"data-slot":`combobox-chip-input`,className:n.t(`min-w-16 flex-1 outline-none`,e),...r})}function C(){return a.useRef(null)}exports.Combobox=s,exports.ComboboxChip=x,exports.ComboboxChips=b,exports.ComboboxChipsInput=S,exports.ComboboxCollection=_,exports.ComboboxContent=f,exports.ComboboxEmpty=v,exports.ComboboxGroup=h,exports.ComboboxInput=d,exports.ComboboxItem=m,exports.ComboboxLabel=g,exports.ComboboxList=p,exports.ComboboxSeparator=y,exports.ComboboxTrigger=l,exports.ComboboxValue=c,exports.useComboboxAnchor=C;
1
+ "use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.js"),t=require("./vendor-i1KCLryV.js"),n=require("./button.cjs"),r=require("./input-group.cjs");let i=require("react");i=e.r(i);var a=t.Ar(),o=t.m;function s({...e}){return(0,a.jsx)(t.p,{"data-slot":`combobox-value`,...e})}function c({className:e,children:n,...r}){return(0,a.jsxs)(t.E,{"data-slot":`combobox-trigger`,className:t.ei(`[&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,a.jsx)(t.Xr,{className:`text-muted-foreground pointer-events-none size-4`})]})}function l({className:e,...n}){return(0,a.jsx)(t.w,{"data-slot":`combobox-clear`,render:(0,a.jsx)(r.InputGroupButton,{variant:`ghost`,size:`icon-xs`}),className:t.ei(e),...n,children:(0,a.jsx)(t.Mr,{className:`pointer-events-none`})})}function u({className:e,children:n,disabled:i=!1,showTrigger:o=!0,showClear:s=!1,...u}){return(0,a.jsxs)(r.InputGroup,{className:t.ei(`w-auto`,e),children:[(0,a.jsx)(t.T,{render:(0,a.jsx)(r.InputGroupInput,{disabled:i}),...u}),(0,a.jsxs)(r.InputGroupAddon,{align:`inline-end`,children:[o&&(0,a.jsx)(r.InputGroupButton,{size:`icon-xs`,variant:`ghost`,asChild:!0,"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:i,children:(0,a.jsx)(c,{})}),s&&(0,a.jsx)(l,{disabled:i})]}),n]})}function d({className:e,side:n=`bottom`,sideOffset:r=6,align:i=`start`,alignOffset:o=0,anchor:s,...c}){return(0,a.jsx)(t.x,{children:(0,a.jsx)(t.b,{side:n,sideOffset:r,align:i,alignOffset:o,anchor:s,className:`isolate z-50`,children:(0,a.jsx)(t.y,{"data-slot":`combobox-content`,"data-chips":!!s,className:t.ei(`group/combobox-content bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg shadow-md ring-1 duration-100 data-[chips=true]:min-w-(--anchor-width) *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none`,e),...c})})})}function f({className:e,...n}){return(0,a.jsx)(t.S,{"data-slot":`combobox-list`,className:t.ei(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,e),...n})}function p({className:e,children:n,...r}){return(0,a.jsxs)(t.g,{"data-slot":`combobox-item`,className:t.ei(`data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,a.jsx)(t.f,{render:(0,a.jsx)(`span`,{className:`pointer-events-none absolute end-2 flex size-4 items-center justify-center`}),children:(0,a.jsx)(t.Zr,{className:`pointer-events-none`})})]})}function m({className:e,...n}){return(0,a.jsx)(t.v,{"data-slot":`combobox-group`,className:t.ei(e),...n})}function h({className:e,...n}){return(0,a.jsx)(t._,{"data-slot":`combobox-label`,className:t.ei(`text-muted-foreground px-2 py-1.5 text-xs`,e),...n})}function g({...e}){return(0,a.jsx)(t.C,{"data-slot":`combobox-collection`,...e})}function _({className:e,...n}){return(0,a.jsx)(t.h,{"data-slot":`combobox-empty`,className:t.ei(`text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex`,e),...n})}function v({className:e,...n}){return(0,a.jsx)(t.c,{"data-slot":`combobox-separator`,className:t.ei(`bg-border -mx-1 my-1 h-px`,e),...n})}function y({className:e,...n}){return(0,a.jsx)(t.d,{"data-slot":`combobox-chips`,className:t.ei(`border-input focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-destructive/20 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40 flex min-h-8 flex-wrap items-center gap-1 rounded-lg border bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:ring-3 has-aria-invalid:ring-3 has-data-[slot=combobox-chip]:px-1`,e),...n})}function b({className:e,children:r,showRemove:i=!0,...o}){return(0,a.jsxs)(t.u,{"data-slot":`combobox-chip`,className:t.ei(`bg-muted text-foreground flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm px-1.5 text-xs font-medium whitespace-nowrap has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-0`,e),...o,children:[r,i&&(0,a.jsx)(t.l,{render:(0,a.jsx)(n.Button,{variant:`ghost`,size:`icon-xs`}),className:`-ms-1 opacity-50 hover:opacity-100`,"data-slot":`combobox-chip-remove`,children:(0,a.jsx)(t.Mr,{className:`pointer-events-none`})})]})}function x({className:e,...n}){return(0,a.jsx)(t.T,{"data-slot":`combobox-chip-input`,className:t.ei(`min-w-16 flex-1 outline-none`,e),...n})}function S(){return i.useRef(null)}exports.Combobox=o,exports.ComboboxChip=b,exports.ComboboxChips=y,exports.ComboboxChipsInput=x,exports.ComboboxCollection=g,exports.ComboboxContent=d,exports.ComboboxEmpty=_,exports.ComboboxGroup=m,exports.ComboboxInput=u,exports.ComboboxItem=p,exports.ComboboxLabel=h,exports.ComboboxList=f,exports.ComboboxSeparator=v,exports.ComboboxTrigger=c,exports.ComboboxValue=s,exports.useComboboxAnchor=S;
2
2
  //# sourceMappingURL=combobox.cjs.map