@synertech/ui 0.43.0 → 0.45.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 (442) hide show
  1. package/.claude/skills/use-synertech-ui/SKILL.md +178 -5
  2. package/README.md +36 -8
  3. package/dist/components/accordion/Accordion.cjs +1 -0
  4. package/dist/components/accordion/Accordion.js +1 -0
  5. package/dist/components/accordion/index.cjs +1 -0
  6. package/dist/components/accordion/index.js +1 -0
  7. package/dist/components/advance-detachable/AdvanceDetachable.cjs +1 -0
  8. package/dist/components/advance-detachable/AdvanceDetachable.js +1 -0
  9. package/dist/components/advance-detachable/index.cjs +1 -0
  10. package/dist/components/advance-detachable/index.js +1 -0
  11. package/dist/components/area-chart/AreaChart.cjs +1 -0
  12. package/dist/components/area-chart/AreaChart.js +1 -0
  13. package/dist/components/area-chart/index.cjs +1 -0
  14. package/dist/components/area-chart/index.js +1 -0
  15. package/dist/components/avatar/Avatar.cjs +1 -0
  16. package/dist/components/avatar/Avatar.js +1 -0
  17. package/dist/components/avatar/index.cjs +1 -0
  18. package/dist/components/avatar/index.js +1 -0
  19. package/dist/components/badge/Badge.cjs +1 -0
  20. package/dist/components/badge/Badge.js +1 -0
  21. package/dist/components/badge/index.cjs +1 -0
  22. package/dist/components/badge/index.js +1 -0
  23. package/dist/components/banner/Banner.cjs +1 -0
  24. package/dist/components/banner/Banner.js +1 -0
  25. package/dist/components/banner/index.cjs +1 -0
  26. package/dist/components/banner/index.js +1 -0
  27. package/dist/components/bar-chart/BarChart.cjs +1 -0
  28. package/dist/components/bar-chart/BarChart.js +1 -0
  29. package/dist/components/bar-chart/index.cjs +1 -0
  30. package/dist/components/bar-chart/index.js +1 -0
  31. package/dist/components/box-plot/BoxPlot.cjs +1 -0
  32. package/dist/components/box-plot/BoxPlot.js +1 -0
  33. package/dist/components/box-plot/index.cjs +1 -0
  34. package/dist/components/box-plot/index.js +1 -0
  35. package/dist/components/breadcrumb/Breadcrumb.cjs +1 -0
  36. package/dist/components/breadcrumb/Breadcrumb.js +1 -0
  37. package/dist/components/breadcrumb/index.cjs +1 -0
  38. package/dist/components/breadcrumb/index.js +1 -0
  39. package/dist/components/bullet-chart/BulletChart.cjs +1 -0
  40. package/dist/components/bullet-chart/BulletChart.js +1 -0
  41. package/dist/components/bullet-chart/index.cjs +1 -0
  42. package/dist/components/bullet-chart/index.js +1 -0
  43. package/dist/components/button/Button.cjs +1 -0
  44. package/dist/components/button/Button.js +1 -0
  45. package/dist/components/button/index.cjs +1 -0
  46. package/dist/components/button/index.js +1 -0
  47. package/dist/components/button-group/ButtonGroup.cjs +1 -0
  48. package/dist/components/button-group/ButtonGroup.js +1 -0
  49. package/dist/components/button-group/index.cjs +1 -0
  50. package/dist/components/button-group/index.js +1 -0
  51. package/dist/components/calendar/Calendar.cjs +1 -0
  52. package/dist/components/calendar/Calendar.js +1 -0
  53. package/dist/components/calendar/index.cjs +1 -0
  54. package/dist/components/calendar/index.js +1 -0
  55. package/dist/components/candlestick-chart/CandlestickChart.cjs +1 -0
  56. package/dist/components/candlestick-chart/CandlestickChart.js +1 -0
  57. package/dist/components/candlestick-chart/index.cjs +1 -0
  58. package/dist/components/candlestick-chart/index.js +1 -0
  59. package/dist/components/card/Card.cjs +1 -0
  60. package/dist/components/card/Card.js +1 -0
  61. package/dist/components/card/CardBody.cjs +1 -0
  62. package/dist/components/card/CardBody.js +1 -0
  63. package/dist/components/card/CardDescription.cjs +1 -0
  64. package/dist/components/card/CardDescription.js +1 -0
  65. package/dist/components/card/CardFooter.cjs +1 -0
  66. package/dist/components/card/CardFooter.js +1 -0
  67. package/dist/components/card/CardHeader.cjs +1 -0
  68. package/dist/components/card/CardHeader.js +1 -0
  69. package/dist/components/card/CardImage.cjs +1 -0
  70. package/dist/components/card/CardImage.js +1 -0
  71. package/dist/components/card/CardTitle.cjs +1 -0
  72. package/dist/components/card/CardTitle.js +1 -0
  73. package/dist/components/card/index.cjs +1 -0
  74. package/dist/components/card/index.js +1 -0
  75. package/dist/components/chart/ChartAnnotations.cjs +1 -0
  76. package/dist/components/chart/ChartAnnotations.js +1 -0
  77. package/dist/components/chart/ChartAxis.cjs +1 -0
  78. package/dist/components/chart/ChartAxis.js +1 -0
  79. package/dist/components/chart/ChartBrush.cjs +1 -0
  80. package/dist/components/chart/ChartBrush.js +1 -0
  81. package/dist/components/chart/ChartContainer.cjs +1 -0
  82. package/dist/components/chart/ChartContainer.js +1 -0
  83. package/dist/components/chart/ChartExportButton.cjs +1 -0
  84. package/dist/components/chart/ChartExportButton.js +1 -0
  85. package/dist/components/chart/ChartFacets.cjs +1 -0
  86. package/dist/components/chart/ChartFacets.js +1 -0
  87. package/dist/components/chart/ChartFilterBar.cjs +1 -0
  88. package/dist/components/chart/ChartFilterBar.js +1 -0
  89. package/dist/components/chart/ChartGrid.cjs +1 -0
  90. package/dist/components/chart/ChartGrid.js +1 -0
  91. package/dist/components/chart/ChartLegend.cjs +1 -0
  92. package/dist/components/chart/ChartLegend.js +1 -0
  93. package/dist/components/chart/ChartPatterns.cjs +1 -0
  94. package/dist/components/chart/ChartPatterns.js +1 -0
  95. package/dist/components/chart/ChartPeriodPicker.cjs +1 -0
  96. package/dist/components/chart/ChartPeriodPicker.js +1 -0
  97. package/dist/components/chart/ChartScaleLegend.cjs +1 -0
  98. package/dist/components/chart/ChartScaleLegend.js +1 -0
  99. package/dist/components/chart/ChartSync.cjs +1 -0
  100. package/dist/components/chart/ChartSync.js +1 -0
  101. package/dist/components/chart/ChartTableView.cjs +1 -0
  102. package/dist/components/chart/ChartTableView.js +1 -0
  103. package/dist/components/chart/ChartTooltip.cjs +1 -0
  104. package/dist/components/chart/ChartTooltip.js +1 -0
  105. package/dist/components/chart/chart.types.cjs +1 -0
  106. package/dist/components/chart/chart.types.js +0 -0
  107. package/dist/components/chart/index.cjs +1 -0
  108. package/dist/components/chart/index.js +1 -0
  109. package/dist/components/chart/palette.cjs +1 -0
  110. package/dist/components/chart/palette.js +1 -0
  111. package/dist/components/chart/useChartSize.cjs +1 -0
  112. package/dist/components/chart/useChartSize.js +1 -0
  113. package/dist/components/chart/utils/bins.cjs +1 -0
  114. package/dist/components/chart/utils/bins.js +1 -0
  115. package/dist/components/chart/utils/cartesian.cjs +1 -0
  116. package/dist/components/chart/utils/cartesian.js +1 -0
  117. package/dist/components/chart/utils/data.cjs +1 -0
  118. package/dist/components/chart/utils/data.js +1 -0
  119. package/dist/components/chart/utils/decimate.cjs +1 -0
  120. package/dist/components/chart/utils/decimate.js +1 -0
  121. package/dist/components/chart/utils/export.cjs +2 -0
  122. package/dist/components/chart/utils/export.js +2 -0
  123. package/dist/components/chart/utils/format.cjs +1 -0
  124. package/dist/components/chart/utils/format.js +1 -0
  125. package/dist/components/chart/utils/path.cjs +1 -0
  126. package/dist/components/chart/utils/path.js +1 -0
  127. package/dist/components/chart/utils/period.cjs +1 -0
  128. package/dist/components/chart/utils/period.js +1 -0
  129. package/dist/components/chart/utils/quantile.cjs +1 -0
  130. package/dist/components/chart/utils/quantile.js +1 -0
  131. package/dist/components/chart/utils/scales.cjs +1 -0
  132. package/dist/components/chart/utils/scales.js +1 -0
  133. package/dist/components/chart/utils/stack.cjs +1 -0
  134. package/dist/components/chart/utils/stack.js +1 -0
  135. package/dist/components/chart/utils/text.cjs +1 -0
  136. package/dist/components/chart/utils/text.js +1 -0
  137. package/dist/components/chart/utils/ticks.cjs +1 -0
  138. package/dist/components/chart/utils/ticks.js +1 -0
  139. package/dist/components/chart/utils/time.cjs +1 -0
  140. package/dist/components/chart/utils/time.js +1 -0
  141. package/dist/components/checkbox/Checkbox.cjs +1 -0
  142. package/dist/components/checkbox/Checkbox.js +1 -0
  143. package/dist/components/checkbox/CheckboxGroup.cjs +1 -0
  144. package/dist/components/checkbox/CheckboxGroup.js +1 -0
  145. package/dist/components/checkbox/index.cjs +1 -0
  146. package/dist/components/checkbox/index.js +1 -0
  147. package/dist/components/chip/Chip.cjs +1 -0
  148. package/dist/components/chip/Chip.js +1 -0
  149. package/dist/components/chip/index.cjs +1 -0
  150. package/dist/components/chip/index.js +1 -0
  151. package/dist/components/circular-progress/CircularProgress.cjs +1 -0
  152. package/dist/components/circular-progress/CircularProgress.js +1 -0
  153. package/dist/components/circular-progress/index.cjs +1 -0
  154. package/dist/components/circular-progress/index.js +1 -0
  155. package/dist/components/datagrid/DataGrid.cjs +2 -0
  156. package/dist/components/datagrid/DataGrid.js +2 -0
  157. package/dist/components/datagrid/index.cjs +1 -0
  158. package/dist/components/datagrid/index.js +1 -0
  159. package/dist/components/detachable/Detachable.cjs +1 -0
  160. package/dist/components/detachable/Detachable.js +1 -0
  161. package/dist/components/detachable/index.cjs +1 -0
  162. package/dist/components/detachable/index.js +1 -0
  163. package/dist/components/device-mockup/DeviceMockup.cjs +1 -0
  164. package/dist/components/device-mockup/DeviceMockup.js +1 -0
  165. package/dist/components/device-mockup/index.cjs +1 -0
  166. package/dist/components/device-mockup/index.js +1 -0
  167. package/dist/components/divider/Divider.cjs +1 -0
  168. package/dist/components/divider/Divider.js +1 -0
  169. package/dist/components/divider/index.cjs +1 -0
  170. package/dist/components/divider/index.js +1 -0
  171. package/dist/components/drawer/Drawer.cjs +1 -0
  172. package/dist/components/drawer/Drawer.js +1 -0
  173. package/dist/components/drawer/index.cjs +1 -0
  174. package/dist/components/drawer/index.js +1 -0
  175. package/dist/components/dropdown/Dropdown.cjs +1 -0
  176. package/dist/components/dropdown/Dropdown.js +1 -0
  177. package/dist/components/dropdown/DropdownCheckboxItem.cjs +1 -0
  178. package/dist/components/dropdown/DropdownCheckboxItem.js +1 -0
  179. package/dist/components/dropdown/DropdownContent.cjs +1 -0
  180. package/dist/components/dropdown/DropdownContent.js +1 -0
  181. package/dist/components/dropdown/DropdownItem.cjs +1 -0
  182. package/dist/components/dropdown/DropdownItem.js +1 -0
  183. package/dist/components/dropdown/DropdownRadio.cjs +1 -0
  184. package/dist/components/dropdown/DropdownRadio.js +1 -0
  185. package/dist/components/dropdown/DropdownSeparator.cjs +1 -0
  186. package/dist/components/dropdown/DropdownSeparator.js +1 -0
  187. package/dist/components/dropdown/DropdownSubMenu.cjs +1 -0
  188. package/dist/components/dropdown/DropdownSubMenu.js +1 -0
  189. package/dist/components/dropdown/DropdownTrigger.cjs +1 -0
  190. package/dist/components/dropdown/DropdownTrigger.js +1 -0
  191. package/dist/components/dropdown/hooks/index.cjs +1 -0
  192. package/dist/components/dropdown/hooks/index.js +1 -0
  193. package/dist/components/dropdown/hooks/useClickOutside.cjs +1 -0
  194. package/dist/components/dropdown/hooks/useClickOutside.js +1 -0
  195. package/dist/components/dropdown/hooks/useKeyboardNavigation.cjs +1 -0
  196. package/dist/components/dropdown/hooks/useKeyboardNavigation.js +1 -0
  197. package/dist/components/dropdown/hooks/useLatest.cjs +1 -0
  198. package/dist/components/dropdown/hooks/useLatest.js +1 -0
  199. package/dist/components/dropdown/hooks/usePositioning.cjs +1 -0
  200. package/dist/components/dropdown/hooks/usePositioning.js +1 -0
  201. package/dist/components/dropdown/index.cjs +1 -0
  202. package/dist/components/dropdown/index.js +1 -0
  203. package/dist/components/dumbbell-chart/DumbbellChart.cjs +1 -0
  204. package/dist/components/dumbbell-chart/DumbbellChart.js +1 -0
  205. package/dist/components/dumbbell-chart/index.cjs +1 -0
  206. package/dist/components/dumbbell-chart/index.js +1 -0
  207. package/dist/components/file-selector/FileSelector.cjs +1 -0
  208. package/dist/components/file-selector/FileSelector.js +1 -0
  209. package/dist/components/file-selector/index.cjs +1 -0
  210. package/dist/components/file-selector/index.js +1 -0
  211. package/dist/components/footer/Footer.cjs +1 -0
  212. package/dist/components/footer/Footer.js +1 -0
  213. package/dist/components/footer/FooterBottom.cjs +1 -0
  214. package/dist/components/footer/FooterBottom.js +1 -0
  215. package/dist/components/footer/FooterColumn.cjs +1 -0
  216. package/dist/components/footer/FooterColumn.js +1 -0
  217. package/dist/components/footer/FooterLink.cjs +1 -0
  218. package/dist/components/footer/FooterLink.js +1 -0
  219. package/dist/components/footer/FooterSection.cjs +1 -0
  220. package/dist/components/footer/FooterSection.js +1 -0
  221. package/dist/components/footer/FooterSocial.cjs +1 -0
  222. package/dist/components/footer/FooterSocial.js +1 -0
  223. package/dist/components/footer/index.cjs +1 -0
  224. package/dist/components/footer/index.js +1 -0
  225. package/dist/components/form/index.cjs +1 -0
  226. package/dist/components/form/index.js +1 -0
  227. package/dist/components/form/input/Input.cjs +1 -0
  228. package/dist/components/form/input/Input.js +1 -0
  229. package/dist/components/form/input/index.cjs +1 -0
  230. package/dist/components/form/input/index.js +1 -0
  231. package/dist/components/form/mention-input/MentionInput.cjs +1 -0
  232. package/dist/components/form/mention-input/MentionInput.js +1 -0
  233. package/dist/components/form/mention-input/index.cjs +1 -0
  234. package/dist/components/form/mention-input/index.js +1 -0
  235. package/dist/components/form/number-input/NumberInput.cjs +1 -0
  236. package/dist/components/form/number-input/NumberInput.js +1 -0
  237. package/dist/components/form/number-input/index.cjs +1 -0
  238. package/dist/components/form/number-input/index.js +1 -0
  239. package/dist/components/form/shared/InputWrapper.cjs +1 -0
  240. package/dist/components/form/shared/InputWrapper.js +1 -0
  241. package/dist/components/form/shared/inputStyles.cjs +1 -0
  242. package/dist/components/form/shared/inputStyles.js +1 -0
  243. package/dist/components/form/types/mention.cjs +1 -0
  244. package/dist/components/form/types/mention.js +0 -0
  245. package/dist/components/funnel-chart/FunnelChart.cjs +1 -0
  246. package/dist/components/funnel-chart/FunnelChart.js +1 -0
  247. package/dist/components/funnel-chart/index.cjs +1 -0
  248. package/dist/components/funnel-chart/index.js +1 -0
  249. package/dist/components/gantt-chart/GanttChart.cjs +1 -0
  250. package/dist/components/gantt-chart/GanttChart.js +1 -0
  251. package/dist/components/gantt-chart/index.cjs +1 -0
  252. package/dist/components/gantt-chart/index.js +1 -0
  253. package/dist/components/header/Header.cjs +1 -0
  254. package/dist/components/header/Header.js +1 -0
  255. package/dist/components/header/index.cjs +1 -0
  256. package/dist/components/header/index.js +1 -0
  257. package/dist/components/heat-map/Heatmap.cjs +1 -0
  258. package/dist/components/heat-map/Heatmap.js +1 -0
  259. package/dist/components/heat-map/index.cjs +1 -0
  260. package/dist/components/heat-map/index.js +1 -0
  261. package/dist/components/help-button/HelpButton.cjs +22 -0
  262. package/dist/components/help-button/HelpButton.js +22 -0
  263. package/dist/components/help-button/MarkdownEditor.cjs +1 -0
  264. package/dist/components/help-button/MarkdownEditor.js +1 -0
  265. package/dist/components/help-button/index.cjs +1 -0
  266. package/dist/components/help-button/index.js +1 -0
  267. package/dist/components/help-button/types.cjs +1 -0
  268. package/dist/components/help-button/types.js +0 -0
  269. package/dist/components/image-uploader/ImageUploader.cjs +1 -0
  270. package/dist/components/image-uploader/ImageUploader.js +1 -0
  271. package/dist/components/image-uploader/index.cjs +1 -0
  272. package/dist/components/image-uploader/index.js +1 -0
  273. package/dist/components/index.cjs +1 -0
  274. package/dist/components/index.js +1 -0
  275. package/dist/components/indicator/Indicator.cjs +1 -0
  276. package/dist/components/indicator/Indicator.js +1 -0
  277. package/dist/components/indicator/index.cjs +1 -0
  278. package/dist/components/indicator/index.js +1 -0
  279. package/dist/components/label/Label.cjs +1 -0
  280. package/dist/components/label/Label.js +1 -0
  281. package/dist/components/label/index.cjs +1 -0
  282. package/dist/components/label/index.js +1 -0
  283. package/dist/components/line-chart/LineChart.cjs +1 -0
  284. package/dist/components/line-chart/LineChart.js +1 -0
  285. package/dist/components/line-chart/index.cjs +1 -0
  286. package/dist/components/line-chart/index.js +1 -0
  287. package/dist/components/modal/Modal.cjs +1 -0
  288. package/dist/components/modal/Modal.js +1 -0
  289. package/dist/components/modal/index.cjs +1 -0
  290. package/dist/components/modal/index.js +1 -0
  291. package/dist/components/pagination/Pagination.cjs +1 -0
  292. package/dist/components/pagination/Pagination.js +1 -0
  293. package/dist/components/pagination/index.cjs +1 -0
  294. package/dist/components/pagination/index.js +1 -0
  295. package/dist/components/pie-chart/PieChart.cjs +1 -0
  296. package/dist/components/pie-chart/PieChart.js +1 -0
  297. package/dist/components/pie-chart/index.cjs +1 -0
  298. package/dist/components/pie-chart/index.js +1 -0
  299. package/dist/components/progress-bar/ProgressBar.cjs +1 -0
  300. package/dist/components/progress-bar/ProgressBar.js +1 -0
  301. package/dist/components/progress-bar/index.cjs +1 -0
  302. package/dist/components/progress-bar/index.js +1 -0
  303. package/dist/components/radio-button/RadioButton.cjs +1 -0
  304. package/dist/components/radio-button/RadioButton.js +1 -0
  305. package/dist/components/radio-button/index.cjs +1 -0
  306. package/dist/components/radio-button/index.js +1 -0
  307. package/dist/components/scatter-chart/ScatterChart.cjs +1 -0
  308. package/dist/components/scatter-chart/ScatterChart.js +1 -0
  309. package/dist/components/scatter-chart/index.cjs +1 -0
  310. package/dist/components/scatter-chart/index.js +1 -0
  311. package/dist/components/schema-editor/SchemaEditor.cjs +1 -0
  312. package/dist/components/schema-editor/SchemaEditor.js +1 -0
  313. package/dist/components/schema-editor/SchemaEditor.types.cjs +1 -0
  314. package/dist/components/schema-editor/SchemaEditor.types.js +0 -0
  315. package/dist/components/schema-editor/canvas/GridLayer.cjs +1 -0
  316. package/dist/components/schema-editor/canvas/GridLayer.js +1 -0
  317. package/dist/components/schema-editor/index.cjs +1 -0
  318. package/dist/components/schema-editor/index.js +1 -0
  319. package/dist/components/schema-editor/legend/SchemaLegend.cjs +1 -0
  320. package/dist/components/schema-editor/legend/SchemaLegend.js +1 -0
  321. package/dist/components/schema-editor/minimap/SchemaMinimap.cjs +1 -0
  322. package/dist/components/schema-editor/minimap/SchemaMinimap.js +1 -0
  323. package/dist/components/schema-editor/relations/SchemaRelationRenderer.cjs +1 -0
  324. package/dist/components/schema-editor/relations/SchemaRelationRenderer.js +1 -0
  325. package/dist/components/schema-editor/tables/SchemaTableRenderer.cjs +1 -0
  326. package/dist/components/schema-editor/tables/SchemaTableRenderer.js +1 -0
  327. package/dist/components/schema-editor/toolbar/SchemaToolbar.cjs +1 -0
  328. package/dist/components/schema-editor/toolbar/SchemaToolbar.js +1 -0
  329. package/dist/components/schema-editor/utils/auto-layout.cjs +1 -0
  330. package/dist/components/schema-editor/utils/auto-layout.js +1 -0
  331. package/dist/components/schema-editor/utils/geometry.cjs +1 -0
  332. package/dist/components/schema-editor/utils/geometry.js +1 -0
  333. package/dist/components/schema-editor/utils/schema-helpers.cjs +1 -0
  334. package/dist/components/schema-editor/utils/schema-helpers.js +1 -0
  335. package/dist/components/schema-editor/utils/sql-export.cjs +9 -0
  336. package/dist/components/schema-editor/utils/sql-export.js +9 -0
  337. package/dist/components/select/Select.cjs +1 -0
  338. package/dist/components/select/Select.js +1 -0
  339. package/dist/components/select/index.cjs +1 -0
  340. package/dist/components/select/index.js +1 -0
  341. package/dist/components/sidebar/Sidebar.cjs +1 -0
  342. package/dist/components/sidebar/Sidebar.js +1 -0
  343. package/dist/components/sidebar/index.cjs +1 -0
  344. package/dist/components/sidebar/index.js +1 -0
  345. package/dist/components/skeleton/Skeleton.cjs +1 -0
  346. package/dist/components/skeleton/Skeleton.js +1 -0
  347. package/dist/components/skeleton/index.cjs +1 -0
  348. package/dist/components/skeleton/index.js +1 -0
  349. package/dist/components/slider/Slider.cjs +1 -0
  350. package/dist/components/slider/Slider.js +1 -0
  351. package/dist/components/slider/index.cjs +1 -0
  352. package/dist/components/slider/index.js +1 -0
  353. package/dist/components/sparkline/Sparkline.cjs +1 -0
  354. package/dist/components/sparkline/Sparkline.js +1 -0
  355. package/dist/components/sparkline/index.cjs +1 -0
  356. package/dist/components/sparkline/index.js +1 -0
  357. package/dist/components/stat-card/StatCard.cjs +1 -0
  358. package/dist/components/stat-card/StatCard.js +1 -0
  359. package/dist/components/stat-card/StatCardGroup.cjs +1 -0
  360. package/dist/components/stat-card/StatCardGroup.js +1 -0
  361. package/dist/components/stat-card/index.cjs +1 -0
  362. package/dist/components/stat-card/index.js +1 -0
  363. package/dist/components/table/Table.cjs +1 -0
  364. package/dist/components/table/Table.js +1 -0
  365. package/dist/components/table/TableBody.cjs +1 -0
  366. package/dist/components/table/TableBody.js +1 -0
  367. package/dist/components/table/TableCell.cjs +1 -0
  368. package/dist/components/table/TableCell.js +1 -0
  369. package/dist/components/table/TableHeader.cjs +1 -0
  370. package/dist/components/table/TableHeader.js +1 -0
  371. package/dist/components/table/TableHeaderCell.cjs +1 -0
  372. package/dist/components/table/TableHeaderCell.js +1 -0
  373. package/dist/components/table/TableRow.cjs +1 -0
  374. package/dist/components/table/TableRow.js +1 -0
  375. package/dist/components/table/index.cjs +1 -0
  376. package/dist/components/table/index.js +1 -0
  377. package/dist/components/tabs/Tabs.cjs +1 -0
  378. package/dist/components/tabs/Tabs.js +1 -0
  379. package/dist/components/tabs/TabsContent.cjs +1 -0
  380. package/dist/components/tabs/TabsContent.js +1 -0
  381. package/dist/components/tabs/TabsContext.cjs +1 -0
  382. package/dist/components/tabs/TabsContext.js +1 -0
  383. package/dist/components/tabs/TabsList.cjs +1 -0
  384. package/dist/components/tabs/TabsList.js +1 -0
  385. package/dist/components/tabs/TabsTrigger.cjs +1 -0
  386. package/dist/components/tabs/TabsTrigger.js +1 -0
  387. package/dist/components/tabs/index.cjs +1 -0
  388. package/dist/components/tabs/index.js +1 -0
  389. package/dist/components/toast/Toast.cjs +1 -0
  390. package/dist/components/toast/Toast.js +1 -0
  391. package/dist/components/toast/index.cjs +1 -0
  392. package/dist/components/toast/index.js +1 -0
  393. package/dist/components/tooltip/Tooltip.cjs +1 -0
  394. package/dist/components/tooltip/Tooltip.js +1 -0
  395. package/dist/components/tooltip/index.cjs +1 -0
  396. package/dist/components/tooltip/index.js +1 -0
  397. package/dist/components/waterfall-chart/WaterfallChart.cjs +1 -0
  398. package/dist/components/waterfall-chart/WaterfallChart.js +1 -0
  399. package/dist/components/waterfall-chart/index.cjs +1 -0
  400. package/dist/components/waterfall-chart/index.js +1 -0
  401. package/dist/components/wizard/Wizard.cjs +1 -0
  402. package/dist/components/wizard/Wizard.js +1 -0
  403. package/dist/components/wizard/index.cjs +1 -0
  404. package/dist/components/wizard/index.js +1 -0
  405. package/dist/components/workflow-editor/WorkflowEditor.cjs +1 -0
  406. package/dist/components/workflow-editor/WorkflowEditor.js +1 -0
  407. package/dist/components/workflow-editor/WorkflowEditor.types.cjs +1 -0
  408. package/dist/components/workflow-editor/WorkflowEditor.types.js +0 -0
  409. package/dist/components/workflow-editor/canvas/GridLayer.cjs +1 -0
  410. package/dist/components/workflow-editor/canvas/GridLayer.js +1 -0
  411. package/dist/components/workflow-editor/edges/WorkflowEdgeRenderer.cjs +1 -0
  412. package/dist/components/workflow-editor/edges/WorkflowEdgeRenderer.js +1 -0
  413. package/dist/components/workflow-editor/index.cjs +1 -0
  414. package/dist/components/workflow-editor/index.js +1 -0
  415. package/dist/components/workflow-editor/nodes/WorkflowNodeRenderer.cjs +1 -0
  416. package/dist/components/workflow-editor/nodes/WorkflowNodeRenderer.js +1 -0
  417. package/dist/components/workflow-editor/toolbar/WorkflowToolbar.cjs +1 -0
  418. package/dist/components/workflow-editor/toolbar/WorkflowToolbar.js +1 -0
  419. package/dist/components/workflow-editor/utils/geometry.cjs +1 -0
  420. package/dist/components/workflow-editor/utils/geometry.js +1 -0
  421. package/dist/hooks/index.cjs +1 -0
  422. package/dist/hooks/index.js +1 -0
  423. package/dist/hooks/useDialogA11y.cjs +1 -0
  424. package/dist/hooks/useDialogA11y.js +1 -0
  425. package/dist/index.cjs +1 -31
  426. package/dist/index.d.cts +778 -106
  427. package/dist/index.d.ts +778 -106
  428. package/dist/index.js +1 -31
  429. package/dist/lib/aria-hide.cjs +1 -0
  430. package/dist/lib/aria-hide.js +1 -0
  431. package/dist/lib/cn.cjs +1 -0
  432. package/dist/lib/cn.js +1 -0
  433. package/dist/lib/dialog-stack.cjs +1 -0
  434. package/dist/lib/dialog-stack.js +1 -0
  435. package/dist/lib/focus.cjs +1 -0
  436. package/dist/lib/focus.js +1 -0
  437. package/dist/lib/i18n.cjs +1 -0
  438. package/dist/lib/i18n.js +1 -0
  439. package/dist/markdown-editor.cjs +1 -1
  440. package/dist/markdown-editor.js +1 -1
  441. package/dist/styles.css +139 -0
  442. package/package.json +1 -1
@@ -75,6 +75,30 @@ style de l'éditeur est incluse. Sans cette prop, le mode édition affiche un me
75
75
  **Anti-pattern** : ne jamais importer `@synertech/ui/markdown-editor` dans une application
76
76
  qui n'installe pas `@mdxeditor/editor` — son build échouerait sur un module introuvable.
77
77
 
78
+ ### 4. Next.js avec webpack : `optimizePackageImports`
79
+
80
+ Next.js 16 construit avec Turbopack par défaut : rien à régler. Avec webpack — ce
81
+ qu'utilise `next build` avant Next.js 16, ou `next build --webpack` depuis — ajouter le
82
+ package à `optimizePackageImports` :
83
+
84
+ ```js
85
+ // next.config.mjs
86
+ export default {
87
+ experimental: {
88
+ optimizePackageImports: ["@synertech/ui"],
89
+ },
90
+ };
91
+ ```
92
+
93
+ Sans ce réglage, un Server Component qui importe quoi que ce soit depuis `@synertech/ui`
94
+ (un `UILabelsProvider` dans le layout racine suffit) fait envoyer par webpack tous les
95
+ composants clients de la librairie au navigateur, sur chaque page. Mesuré sur une page
96
+ serveur minimale avec Next.js 14.2 : 275 Ko de JavaScript au premier chargement sans le
97
+ réglage, 90 Ko avec.
98
+
99
+ **Anti-pattern** : dans une application Next.js sous webpack, importer `@synertech/ui`
100
+ depuis un Server Component sans avoir ajouté ce réglage.
101
+
78
102
  ---
79
103
 
80
104
  ## Imports
@@ -168,6 +192,9 @@ import { cn } from "@synertech/ui";
168
192
  - `BoxPlot` - Médiane, quartiles, moustaches et valeurs aberrantes
169
193
  - `CandlestickChart` - Ouverture, haut, bas, clôture (couleurs de statut)
170
194
  - `GanttChart` - Des tâches dans le temps, avec dépendances et jalons
195
+ - `ChartSyncProvider` - Plusieurs panneaux qui se lisent comme un seul objet :
196
+ survol partagé et fenêtre brossée en commun
197
+ - `ChartExportButton` - Le tableau du graphique en CSV ou JSON
171
198
 
172
199
  ### Feedback & Overlays
173
200
 
@@ -552,7 +579,10 @@ Tous les graphiques partagent la même forme de données : un tableau de lignes
552
579
  et des séries qui pointent un champ, exactement comme `DataGrid`.
553
580
 
554
581
  ```tsx
555
- import { LineChart, AreaChart, BarChart, PieChart, ScatterChart } from "@synertech/ui";
582
+ import {
583
+ LineChart, AreaChart, BarChart, PieChart, ScatterChart,
584
+ ChartSyncProvider, ChartExportButton, brushToPeriod,
585
+ } from "@synertech/ui";
556
586
 
557
587
  const data = [
558
588
  { month: "Jan", revenue: 18400, cost: 12200 },
@@ -758,6 +788,75 @@ const data = [
758
788
  <Select size="sm" options={regions} value={region} onValueChange={setRegion} />
759
789
  </ChartFilterBar>
760
790
 
791
+ // L'état d'erreur — distinct de l'état vide, sur TOUS les graphiques du kit
792
+ // (« il n'y a rien » et « on n'a pas réussi à charger » sont deux affirmations
793
+ // différentes ; seule la seconde appelle une reprise)
794
+ <LineChart
795
+ data={rows}
796
+ series={series}
797
+ x={{ key: "month" }}
798
+ loading={query.isFetching}
799
+ error={query.isError}
800
+ onRetry={() => query.refetch()}
801
+ />
802
+
803
+ // L'export — le tableau exact du graphique, dans la fente `actions`
804
+ <LineChart
805
+ data={rows}
806
+ series={series}
807
+ x={{ key: "month", label: "Mois" }}
808
+ actions={
809
+ <ChartExportButton
810
+ data={rows}
811
+ series={series}
812
+ xKey="month"
813
+ xLabel="Mois"
814
+ filename="revenus"
815
+ size="sm"
816
+ />
817
+ }
818
+ />
819
+
820
+ // La trappe d'évasion — dessiner DANS le tracé, avec les échelles du graphique
821
+ // (Line, Area, Bar, Scatter. Une fonction dessine par-dessus les marques ;
822
+ // `{ under, over }` atteint aussi le dessous. Coordonnées relatives à la zone
823
+ // de dessin, et sans clip : la marge est à la charge de l'appelant)
824
+ <LineChart
825
+ data={rows}
826
+ series={series}
827
+ x={{ key: "month" }}
828
+ y={{ domain: [100, 230] }} // ← réserver la place de l'annotation
829
+ overlay={({ xAt, yAt, dimensions }) => (
830
+ <rect
831
+ x={0}
832
+ y={yAt(200)}
833
+ width={dimensions.innerWidth}
834
+ height={Math.abs(yAt(160) - yAt(200))}
835
+ className="fill-green-500"
836
+ opacity={0.1}
837
+ />
838
+ )}
839
+ />
840
+
841
+ // La volumétrie — allège le TRACÉ, jamais les données
842
+ // (LTTB sur Line/Area, échantillon régulier sur Scatter. Le tableau, l'infobulle
843
+ // et la droite de tendance continuent de lire chaque ligne)
844
+ <LineChart data={fiftyThousandRows} series={series} x={{ key: "t", scale: "linear" }} maxPoints={400} />
845
+
846
+ // Le tableau de bord synchronisé — un pointeur, une infobulle ; une plage, toutes
847
+ // les cartes. `brushToPeriod` rend la fenêtre au `ChartPeriodPicker`
848
+ <ChartSyncProvider brush={null} onBrushChange={(range) => {
849
+ const next = range && brushToPeriod(range);
850
+ if (next) setPeriod(next);
851
+ }}>
852
+ <ChartFilterBar>
853
+ <ChartPeriodPicker size="sm" value={period} onChange={setPeriod} />
854
+ </ChartFilterBar>
855
+
856
+ <LineChart data={rows} series={series} x={xAxis} brush />
857
+ <BarChart data={rows} series={series} x={{ key: "day" }} />
858
+ </ChartSyncProvider>
859
+
761
860
  // Petits multiples — le domaine est calculé sur l'ensemble et imposé à chaque panneau
762
861
  <ChartFacets data={rows} by="region" values={["revenue"]} columns={3}>
763
862
  {({ data, domain, label }) => (
@@ -822,6 +921,33 @@ const data = [
822
921
  - **Les annotations se lisent sur l'axe des catégories.** Un `BarChart`
823
922
  horizontal les ignore, avec un avertissement : un moment placé sur une liste
824
923
  de noms n'en est plus un.
924
+ - **`error` n'est jamais `empty`.** Un panneau qui affiche « Aucune donnée »
925
+ après une requête échouée affirme quelque chose de faux, et ne propose aucune
926
+ sortie. `loading` l'emporte sur les deux : une reprise remplace le message par
927
+ le voyant.
928
+ - **Rien n'est décimé tout seul.** Un graphique qui dessinerait en douce une
929
+ autre forme que celle qu'on lui a remise serait pire qu'un graphique lent :
930
+ au-delà de 2 000 points il avertit, et `maxPoints` est à vous. Il n'allège
931
+ que le tracé — le tableau garde chaque ligne.
932
+ - **`BarChart` n'a pas de `maxPoints`.** Décimer des barres, c'est supprimer des
933
+ catégories : `bins` est la réponse là-bas.
934
+ - **`ScatterChart` échantillonne régulièrement, pas en LTTB.** Un nuage se lit à
935
+ sa densité ; garder les plus grands triangles en découperait l'enveloppe et
936
+ jetterait précisément ce qu'on regarde.
937
+ - **`overlay` n'est pas `children`.** Les graphiques restent des objets fermés ;
938
+ la trappe remet la géométrie résolue et rien d'autre. C'est elle qui rend
939
+ défendable chaque refus de cette liste — « prenez un `BarChart` groupé » ne
940
+ tient que si l'application peut dessiner ce qu'elle n'obtiendra jamais du kit.
941
+ - **Un `ScatterChart` ne se brosse pas.** Ses deux axes sont des mesures, et une
942
+ fenêtre sur l'une d'elles n'est pas le geste qu'un nuage appelle.
943
+ - **Une plage se pose aussi au clavier.** Maj + flèches l'étend, Échap la retire :
944
+ un filtre qui ne s'atteint qu'à la souris est inaccessible à la moitié des
945
+ lecteurs.
946
+ - **Une fenêtre qui a déjà recadré le tableau de bord n'a plus à être teintée.**
947
+ Les panneaux SONT la fenêtre ; la bande lave alors chaque tracé de bord à bord
948
+ et n'énonce rien. Repassez `brush={null}` après l'avoir appliquée.
949
+ - **L'export écrit les mesures brutes.** Ce qui ouvre le fichier va calculer
950
+ dessus, et `1 234,5 $` est une chaîne. Seule la catégorie est formatée.
825
951
 
826
952
  ### Cartes KPI
827
953
 
@@ -1616,7 +1742,14 @@ const [value, setValue] = useState("");
1616
1742
 
1617
1743
  ### 3. Composants dans Server Components (Next.js)
1618
1744
 
1619
- Les composants **server-compatible** (sans `"use client"`) peuvent etre utilises directement dans les Server Components :
1745
+ Tous les composants s'importent directement depuis un Server Component. La
1746
+ librairie porte elle-même ses directives `"use client"` : l'application n'a pas
1747
+ à en écrire pour s'en servir, et rien ne change dans une application React sans
1748
+ Next.js.
1749
+
1750
+ Les composants **d'affichage** (`Card`, `Button`, `Avatar`, `Badge`, `Divider`,
1751
+ `Skeleton`, `Table`, `StatCard`, `Sparkline`...) n'ont pas de directive : ils
1752
+ sont rendus sur le serveur et n'envoient aucun JavaScript au navigateur.
1620
1753
 
1621
1754
  ```tsx
1622
1755
  // app/page.tsx (Server Component)
@@ -1635,19 +1768,59 @@ export default function Page() {
1635
1768
  }
1636
1769
  ```
1637
1770
 
1638
- Les composants **non server-compatible** doivent etre utilises dans un Client Component :
1771
+ Les composants **interactifs** (`Tabs`, `Accordion`, `Dropdown`, `Select`,
1772
+ `Input`, `Chip`, les graphiques...) sont des Client Components. Ils se placent
1773
+ eux aussi dans un Server Component, tant que leurs props sont sérialisables :
1774
+ texte, nombres, objets, tableaux, JSX.
1775
+
1776
+ ```tsx
1777
+ // app/dashboard/page.tsx (Server Component, aucune directive)
1778
+ import { Tabs, TabsList, TabsTrigger, TabsContent, LineChart } from "@synertech/ui";
1779
+
1780
+ export default async function Page() {
1781
+ const revenue = await getRevenue(); // lu sur le serveur
1782
+
1783
+ return (
1784
+ <Tabs defaultValue="chart">
1785
+ <TabsList>
1786
+ <TabsTrigger value="chart">Graphique</TabsTrigger>
1787
+ <TabsTrigger value="notes">Notes</TabsTrigger>
1788
+ </TabsList>
1789
+ <TabsContent value="chart">
1790
+ {/* `locale` : sans elle, le serveur et le navigateur formatent chacun dans leur langue */}
1791
+ <LineChart
1792
+ data={revenue}
1793
+ x={{ key: "month" }}
1794
+ series={[{ key: "revenue", label: "Revenu" }]}
1795
+ locale="fr-CA"
1796
+ />
1797
+ </TabsContent>
1798
+ <TabsContent value="notes">...</TabsContent>
1799
+ </Tabs>
1800
+ );
1801
+ }
1802
+ ```
1803
+
1804
+ Avec webpack, pensez à `optimizePackageImports` (voir Installation) : sans lui, ces imports
1805
+ depuis un Server Component embarquent tous les composants clients de la librairie.
1806
+
1807
+ `"use client"` reste nécessaire dans **votre** fichier dès qu'il tient un état ou
1808
+ passe une fonction à un composant (`onClick`, `onValueChange`, une fonction
1809
+ `render`, un formateur) : React ne fait pas passer une fonction du serveur au
1810
+ client, quelle que soit la librairie.
1639
1811
 
1640
1812
  ```tsx
1641
1813
  // components/UserForm.tsx
1642
1814
  "use client";
1815
+ import { useState } from "react";
1643
1816
  import { Select, Input, Checkbox } from "@synertech/ui";
1644
1817
 
1645
1818
  export function UserForm() {
1646
- // ... useState, handlers, etc.
1819
+ const [country, setCountry] = useState("ca");
1647
1820
  return (
1648
1821
  <form>
1649
1822
  <Input label="Nom" />
1650
- <Select options={countries} />
1823
+ <Select options={countries} value={country} onValueChange={setCountry} />
1651
1824
  <Checkbox label="Accepter" />
1652
1825
  </form>
1653
1826
  );
package/README.md CHANGED
@@ -45,7 +45,27 @@ module.exports = {
45
45
 
46
46
  </details>
47
47
 
48
- ### 3. Optional: Markdown editing
48
+ ### 3. Next.js with webpack: optimize the package imports
49
+
50
+ Next.js 16 builds with Turbopack by default and needs nothing more. With webpack — what
51
+ `next build` uses before Next.js 16, or `next build --webpack` since — add the package to
52
+ `optimizePackageImports`:
53
+
54
+ ```js
55
+ // next.config.mjs
56
+ export default {
57
+ experimental: {
58
+ optimizePackageImports: ["@synertech/ui"],
59
+ },
60
+ };
61
+ ```
62
+
63
+ Without it, a Server Component that imports anything from `@synertech/ui` — a
64
+ `UILabelsProvider` in the root layout is enough — makes webpack send every client
65
+ component of the library to the browser, on every page. Measured on a minimal server page
66
+ with Next.js 14.2: 275 kB of first-load JavaScript without the setting, 90 kB with it.
67
+
68
+ ### 4. Optional: Markdown editing
49
69
 
50
70
  `<HelpButton markdown editable>` uses [MDXEditor](https://mdxeditor.dev/), which is an
51
71
  **optional** peer dependency — it pulls in a large dependency tree, so it is not
@@ -198,7 +218,7 @@ import {
198
218
  ### Adding a new component
199
219
 
200
220
  1. Create the component in the appropriate category: `src/components/<category>/<Component>.tsx`
201
- 2. Add `"use client"` directive if using React hooks
221
+ 2. Add `"use client"` directive if the module needs it (see [Conventions](#use-client-directive))
202
222
  3. Export the component and its props type
203
223
  4. Add export in `src/components/<category>/index.ts`
204
224
  5. Verify: `pnpm typecheck && pnpm build`
@@ -211,7 +231,7 @@ import {
211
231
  - **No compiled CSS** – Tailwind classes are applied, not compiled
212
232
  - **React as peer dependency** – Don't bundle React
213
233
  - **Next.js compatible** – Proper ESM/CJS exports
214
- - **Use `"use client"`** – Only for components using hooks
234
+ - **Use `"use client"`** – Only for modules using client-only React APIs or their own event handlers
215
235
  - **Accept `className`** – All components should allow style overrides
216
236
  - **Export types** – Each component exports its props type
217
237
 
@@ -280,11 +300,19 @@ This project uses [Changesets](https://github.com/changesets/changesets) for ver
280
300
 
281
301
  ### `"use client"` directive
282
302
 
283
- Only add `"use client"` to components that use React hooks (`useState`, `useEffect`, etc.). Currently:
284
- - ✅ `Header` – uses `useState` for mobile menu
285
- - ✅ `Modal` / `Drawer` / `Sidebar` – use `useId` / `forwardRef` and `useDialogA11y`
286
- - ✅ `UILabelsProvider` – uses React context
287
- - ❌ All other components – no hooks, no directive needed
303
+ An application never has to write `"use client"` just to import a component: the
304
+ library's own modules carry the directive, and each one is published as its own file so
305
+ the directive survives the build. A module gets it when it:
306
+
307
+ - uses a client-only React API: state, effects, refs, context (`useId`, `useMemo`,
308
+ `useCallback`, `forwardRef` and `memo` also exist on the server);
309
+ - or attaches an event handler of its own to what it renders (`Chip` has no hook, but
310
+ always wires `onClick`).
311
+
312
+ Display components (`Card`, `Button`, `Avatar`, `Table`, `StatCard`, `Sparkline`…) have no
313
+ directive and render as Server Components. `pnpm build` runs
314
+ `scripts/check-bundle-boundary.mjs`, which fails when a directive is lost or when a module
315
+ without one uses a client-only API.
288
316
 
289
317
  ### `className` prop
290
318
 
@@ -0,0 +1 @@
1
+ "use strict";"use client";var y=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var S=(e,r)=>{for(var i in r)y(e,i,{get:r[i],enumerable:!0})},V=(e,r,i,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of E(r))!D.call(e,t)&&t!==i&&y(e,t,{get:()=>r[t],enumerable:!(n=T(r,t))||n.enumerable});return e};var H=e=>V(y({},"__esModule",{value:!0}),e);var G={};S(G,{Accordion:()=>$,AccordionContent:()=>F,AccordionItem:()=>q,AccordionTrigger:()=>B});module.exports=H(G);var o=require("react"),b=require("../../lib/cn.cjs"),d=require("react/jsx-runtime"),v=(0,o.createContext)(null),I=(0,o.createContext)(null);function A(){let e=(0,o.useContext)(v);if(!e)throw new Error("Accordion sub-components must be used within <Accordion>");return e}function C(){let e=(0,o.useContext)(I);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within <AccordionItem>");return e}var N={sm:{trigger:"px-3 py-2",content:"px-3 pb-2",text:"text-sm",icon:"w-3.5 h-3.5"},md:{trigger:"px-4 py-3",content:"px-4 pb-3",text:"text-base",icon:"w-4 h-4"},lg:{trigger:"px-5 py-4",content:"px-5 pb-4",text:"text-lg",icon:"w-5 h-5"}},M=({className:e})=>(0,d.jsx)("svg",{className:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,d.jsx)("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})}),K={default:"border border-gray-200 dark:border-gray-700 rounded-lg divide-y divide-gray-200 dark:divide-gray-700",bordered:"border-2 border-gray-300 dark:border-gray-600 rounded-lg divide-y divide-gray-300 dark:divide-gray-600",separated:"space-y-2",ghost:""},L={default:"",bordered:"",separated:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",ghost:"border-b border-gray-200 dark:border-gray-700 last:border-b-0"};function $({type:e="single",value:r,defaultValue:i,onValueChange:n,collapsible:t=!1,variant:c="default",size:l="md",disabled:a=!1,iconPosition:g="right",icon:s,hideIcon:u=!1,className:k,children:w}){let[R,P]=(0,o.useState)(()=>i?Array.isArray(i)?i:[i]:[]),m=r!==void 0,p=m?Array.isArray(r)?r:[r]:R,h=(0,o.useCallback)(x=>{let f;e==="single"?p.includes(x)?f=t?[]:[x]:f=[x]:f=p.includes(x)?p.filter(O=>O!==x):[...p,x],m||P(f),n?.(e==="single"?f[0]??"":f)},[e,p,t,m,n]),z=(0,o.useMemo)(()=>({openItems:p,toggle:h,variant:c,size:l,disabled:a,iconPosition:g,icon:s??null,hideIcon:u}),[p,h,c,l,a,g,s,u]);return(0,d.jsx)(v.Provider,{value:z,children:(0,d.jsx)("div",{className:(0,b.cn)(K[c],k),"data-testid":"accordion",children:w})})}function q({value:e,disabled:r,className:i,children:n}){let t=A(),c=t.openItems.includes(e),l=r??t.disabled,a=(0,o.useId)(),g=`accordion-trigger-${a}`,s=`accordion-content-${a}`,u=(0,o.useMemo)(()=>({value:e,isOpen:c,disabled:l,triggerId:g,contentId:s}),[e,c,l,g,s]);return(0,d.jsx)(I.Provider,{value:u,children:(0,d.jsx)("div",{className:(0,b.cn)(L[t.variant],i),"data-state":c?"open":"closed","data-testid":"accordion-item",children:n})})}function B({className:e,icon:r,children:i}){let n=A(),t=C(),c=N[n.size],l=()=>{t.disabled||n.toggle(t.value)},a=u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),l())},g=r??n.icon??(0,d.jsx)(M,{className:c.icon}),s=!n.hideIcon&&(0,d.jsx)("span",{className:(0,b.cn)("shrink-0 text-gray-500 dark:text-gray-400 transition-transform duration-200",t.isOpen&&"rotate-180"),"data-testid":"accordion-icon",children:g});return(0,d.jsxs)("button",{type:"button",id:t.triggerId,"aria-expanded":t.isOpen,"aria-controls":t.contentId,disabled:t.disabled,onClick:l,onKeyDown:a,className:(0,b.cn)("flex items-center w-full text-left font-medium transition-colors cursor-pointer",c.trigger,c.text,"text-gray-900 dark:text-gray-100",!t.disabled&&"hover:bg-gray-50 dark:hover:bg-gray-800/50",t.disabled&&"opacity-50 cursor-not-allowed",e),"data-testid":"accordion-trigger",children:[n.iconPosition==="left"&&s,(0,d.jsx)("span",{className:"flex-1",children:i}),n.iconPosition==="right"&&s]})}function F({className:e,children:r}){let i=A(),n=C(),t=N[i.size],c=(0,o.useRef)(null),[l,a]=(0,o.useState)(n.isOpen?void 0:0),g=(0,o.useRef)(!0);return(0,o.useEffect)(()=>{if(g.current){g.current=!1,a(n.isOpen?void 0:0);return}if(n.isOpen){let s=c.current;if(s){a(s.scrollHeight);let u=setTimeout(()=>a(void 0),200);return()=>clearTimeout(u)}}else{let s=c.current;s&&(a(s.scrollHeight),requestAnimationFrame(()=>a(0)))}},[n.isOpen]),(0,d.jsx)("div",{id:n.contentId,role:"region","aria-labelledby":n.triggerId,className:"overflow-hidden transition-[height] duration-200 ease-in-out",style:{height:l===void 0?"auto":l},"data-testid":"accordion-content","data-state":n.isOpen?"open":"closed",children:(0,d.jsx)("div",{ref:c,className:(0,b.cn)(t.content,"text-gray-600 dark:text-gray-400",t.text==="text-lg"?"text-base":"text-sm",e),children:r})})}0&&(module.exports={Accordion,AccordionContent,AccordionItem,AccordionTrigger});
@@ -0,0 +1 @@
1
+ "use client";import{createContext as h,useContext as v,useState as I,useCallback as S,useMemo as C,useRef as A,useEffect as V,useId as H}from"react";import{cn as f}from"../../lib/cn.js";import{jsx as s,jsxs as $}from"react/jsx-runtime";var N=h(null),k=h(null);function m(){let e=v(N);if(!e)throw new Error("Accordion sub-components must be used within <Accordion>");return e}function w(){let e=v(k);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within <AccordionItem>");return e}var R={sm:{trigger:"px-3 py-2",content:"px-3 pb-2",text:"text-sm",icon:"w-3.5 h-3.5"},md:{trigger:"px-4 py-3",content:"px-4 pb-3",text:"text-base",icon:"w-4 h-4"},lg:{trigger:"px-5 py-4",content:"px-5 pb-4",text:"text-lg",icon:"w-5 h-5"}},M=({className:e})=>s("svg",{className:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:s("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})}),K={default:"border border-gray-200 dark:border-gray-700 rounded-lg divide-y divide-gray-200 dark:divide-gray-700",bordered:"border-2 border-gray-300 dark:border-gray-600 rounded-lg divide-y divide-gray-300 dark:divide-gray-600",separated:"space-y-2",ghost:""},L={default:"",bordered:"",separated:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",ghost:"border-b border-gray-200 dark:border-gray-700 last:border-b-0"};function F({type:e="single",value:d,defaultValue:a,onValueChange:t,collapsible:n=!1,variant:o="default",size:c="md",disabled:i=!1,iconPosition:l="right",icon:r,hideIcon:g=!1,className:P,children:z}){let[O,T]=I(()=>a?Array.isArray(a)?a:[a]:[]),b=d!==void 0,u=b?Array.isArray(d)?d:[d]:O,y=S(p=>{let x;e==="single"?u.includes(p)?x=n?[]:[p]:x=[p]:x=u.includes(p)?u.filter(D=>D!==p):[...u,p],b||T(x),t?.(e==="single"?x[0]??"":x)},[e,u,n,b,t]),E=C(()=>({openItems:u,toggle:y,variant:o,size:c,disabled:i,iconPosition:l,icon:r??null,hideIcon:g}),[u,y,o,c,i,l,r,g]);return s(N.Provider,{value:E,children:s("div",{className:f(K[o],P),"data-testid":"accordion",children:z})})}function G({value:e,disabled:d,className:a,children:t}){let n=m(),o=n.openItems.includes(e),c=d??n.disabled,i=H(),l=`accordion-trigger-${i}`,r=`accordion-content-${i}`,g=C(()=>({value:e,isOpen:o,disabled:c,triggerId:l,contentId:r}),[e,o,c,l,r]);return s(k.Provider,{value:g,children:s("div",{className:f(L[n.variant],a),"data-state":o?"open":"closed","data-testid":"accordion-item",children:t})})}function J({className:e,icon:d,children:a}){let t=m(),n=w(),o=R[t.size],c=()=>{n.disabled||t.toggle(n.value)},i=g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),c())},l=d??t.icon??s(M,{className:o.icon}),r=!t.hideIcon&&s("span",{className:f("shrink-0 text-gray-500 dark:text-gray-400 transition-transform duration-200",n.isOpen&&"rotate-180"),"data-testid":"accordion-icon",children:l});return $("button",{type:"button",id:n.triggerId,"aria-expanded":n.isOpen,"aria-controls":n.contentId,disabled:n.disabled,onClick:c,onKeyDown:i,className:f("flex items-center w-full text-left font-medium transition-colors cursor-pointer",o.trigger,o.text,"text-gray-900 dark:text-gray-100",!n.disabled&&"hover:bg-gray-50 dark:hover:bg-gray-800/50",n.disabled&&"opacity-50 cursor-not-allowed",e),"data-testid":"accordion-trigger",children:[t.iconPosition==="left"&&r,s("span",{className:"flex-1",children:a}),t.iconPosition==="right"&&r]})}function Q({className:e,children:d}){let a=m(),t=w(),n=R[a.size],o=A(null),[c,i]=I(t.isOpen?void 0:0),l=A(!0);return V(()=>{if(l.current){l.current=!1,i(t.isOpen?void 0:0);return}if(t.isOpen){let r=o.current;if(r){i(r.scrollHeight);let g=setTimeout(()=>i(void 0),200);return()=>clearTimeout(g)}}else{let r=o.current;r&&(i(r.scrollHeight),requestAnimationFrame(()=>i(0)))}},[t.isOpen]),s("div",{id:t.contentId,role:"region","aria-labelledby":t.triggerId,className:"overflow-hidden transition-[height] duration-200 ease-in-out",style:{height:c===void 0?"auto":c},"data-testid":"accordion-content","data-state":t.isOpen?"open":"closed",children:s("div",{ref:o,className:f(n.content,"text-gray-600 dark:text-gray-400",n.text==="text-lg"?"text-base":"text-sm",e),children:d})})}export{F as Accordion,Q as AccordionContent,G as AccordionItem,J as AccordionTrigger};
@@ -0,0 +1 @@
1
+ "use strict";var d=Object.defineProperty;var e=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var g=(c,o)=>{for(var i in o)d(c,i,{get:o[i],enumerable:!0})},m=(c,o,i,A)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of t(o))!p.call(c,n)&&n!==i&&d(c,n,{get:()=>o[n],enumerable:!(A=e(o,n))||A.enumerable});return c};var s=c=>m(d({},"__esModule",{value:!0}),c);var P={};g(P,{Accordion:()=>r.Accordion,AccordionContent:()=>r.AccordionContent,AccordionItem:()=>r.AccordionItem,AccordionTrigger:()=>r.AccordionTrigger});module.exports=s(P);var r=require("./Accordion.cjs");0&&(module.exports={Accordion,AccordionContent,AccordionItem,AccordionTrigger});
@@ -0,0 +1 @@
1
+ import{Accordion as c,AccordionItem as n,AccordionTrigger as i,AccordionContent as d}from"./Accordion.js";export{c as Accordion,d as AccordionContent,n as AccordionItem,i as AccordionTrigger};
@@ -0,0 +1 @@
1
+ "use strict";"use client";var V=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var Ce=(t,r)=>{for(var a in r)V(t,a,{get:r[a],enumerable:!0})},Ee=(t,r,a,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Re(r))!De.call(t,l)&&l!==a&&V(t,l,{get:()=>r[l],enumerable:!(s=we(r,l))||s.enumerable});return t};var Te=t=>Ee(V({},"__esModule",{value:!0}),t);var He={};Ce(He,{AdvanceDetachable:()=>de});module.exports=Te(He);var e=require("react"),ie=require("react-dom"),g=require("react/jsx-runtime");function Ae(...t){return t.filter(Boolean).join(" ")}var Ne="@synertech/ui/AdvanceDetachable",Me=300,Se="width=800,height=600,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes",Le=0;function Ie(){return`${Date.now()}-${++Le}-${Math.random().toString(36).slice(2,8)}`}function le(t){try{return JSON.stringify(t)}catch{return String(t)}}function ue(t){try{return JSON.parse(t)}catch{return t}}function xe(t,r){t.querySelectorAll("style").forEach(a=>{let s=r.createElement("style");s.textContent=a.textContent,r.head.appendChild(s)}),t.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{let s=a,l=r.createElement("link");l.rel="stylesheet",l.href=s.href,s.crossOrigin&&(l.crossOrigin=s.crossOrigin),r.head.appendChild(l)}),t.documentElement.className&&(r.documentElement.className=t.documentElement.className),t.body.className&&(r.body.className=t.body.className)}function Oe(t,r){let a=new MutationObserver(s=>{for(let l of s)for(let f of Array.from(l.addedNodes))if(f instanceof HTMLStyleElement){let u=r.createElement("style");u.textContent=f.textContent,r.head.appendChild(u)}else if(f instanceof HTMLLinkElement&&f.rel==="stylesheet"){let u=r.createElement("link");u.rel="stylesheet",u.href=f.href,r.head.appendChild(u)}});return a.observe(t.head,{childList:!0}),a}function ke(){return typeof BroadcastChannel<"u"}function Pe({mode:t,id:r,title:a="",children:s,value:l,defaultValue:f,onValueChange:u,isDetached:B,defaultDetached:fe=!1,onDetachedChange:z,features:$,target:F,autoFocus:W=!0,className:pe,detachedBodyClassName:U,disabled:_=!1,readOnly:q=!1,closeOnMainWindowUnload:J=!0,name:X,serialize:j,deserialize:G},he){let i=B!==void 0,[me,w]=(0,e.useState)(fe),p=i?B:me,M=l!==void 0,[ge,ye]=(0,e.useState)(f),v=M?l:ge,[K,Q]=(0,e.useState)(null),c=(0,e.useRef)(null),y=(0,e.useRef)(null),R=(0,e.useRef)(null),D=(0,e.useRef)(null),C=(0,e.useRef)(!1),E=(0,e.useRef)(null),S=(0,e.useRef)(null),Y=(0,e.useRef)(null),[T]=(0,e.useState)(()=>`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`),d=(0,e.useRef)({title:a,features:$,target:F,autoFocus:W,detachedBodyClassName:U,closeOnMainWindowUnload:J,disabled:_,readOnly:q,mode:t,id:r});d.current={title:a,features:$,target:F,autoFocus:W,detachedBodyClassName:U,closeOnMainWindowUnload:J,disabled:_,readOnly:q,mode:t,id:r};let L=(0,e.useRef)(j??le);L.current=j??le;let Z=(0,e.useRef)(G??ue);Z.current=G??ue;let ee=(0,e.useRef)(u);ee.current=u;let b=(0,e.useRef)(z);b.current=z;let I=(0,e.useRef)(p);I.current=p;let h=`${Ne}/${r}`,A=(0,e.useCallback)(()=>{R.current&&(clearInterval(R.current),R.current=null),D.current&&(D.current.disconnect(),D.current=null),Q(null)},[]),N=(0,e.useCallback)(()=>{y.current&&(y.current.close(),y.current=null),E.current&&typeof window<"u"&&(window.removeEventListener("message",E.current),E.current=null)},[]),x=(0,e.useCallback)(n=>{if(!(!n||n.channel!==h)&&n.instanceId!==T&&!d.current.readOnly&&n.type==="value-sync"&&n.payload!==void 0){S.current=n.payload;let o=Z.current(n.payload);M||ye(o),ee.current?.(o)}},[h,T,M]),ne=(0,e.useCallback)(()=>{if(N(),!(typeof window>"u"))if(ke()){let n=new BroadcastChannel(h),o=m=>x(m.data);n.addEventListener("message",o),y.current=n}else{let n=o=>{o.data?.channel===h&&x(o.data)};window.addEventListener("message",n),E.current=n}},[h,N,x]),te=(0,e.useCallback)(n=>{if(d.current.readOnly)return;let o=L.current(n);if(o===Y.current)return;if(o===S.current){S.current=null;return}Y.current=o;let m={channel:h,instanceId:T,messageId:Ie(),origin:"main",timestamp:Date.now(),type:"value-sync",payload:o};y.current?y.current.postMessage(m):c.current&&!c.current.closed&&c.current.postMessage(m,"*")},[h,T]),re=(0,e.useCallback)(()=>{if(typeof window>"u"||d.current.disabled||C.current||c.current&&!c.current.closed)return;C.current=!0;let n=d.current,o=window.open("",n.target||"",n.features||Se);if(!o){C.current=!1;return}c.current=o,o.document.title=n.title||document.title,n.detachedBodyClassName&&(o.document.body.className=n.detachedBodyClassName);let m=o.document.createElement("div");o.document.body.appendChild(m),Q(m),xe(document,o.document),D.current=Oe(document,o.document),R.current=setInterval(()=>{o.closed&&(A(),c.current=null,i||w(!1),b.current?.(!1))},Me),n.autoFocus&&o.focus(),C.current=!1},[i,A]),ce=(0,e.useCallback)(()=>{c.current&&!c.current.closed&&c.current.close(),c.current=null,A()},[A]),oe=(0,e.useRef)(re);oe.current=re;let O=(0,e.useRef)(ce);O.current=ce;let ae=(0,e.useRef)(te);ae.current=te;let k=(0,e.useCallback)(()=>{d.current.disabled||(i||w(!0),b.current?.(!0))},[i]),P=(0,e.useCallback)(()=>{i||w(!1),b.current?.(!1)},[i]),H=(0,e.useCallback)(()=>{let n=!I.current;n&&d.current.disabled||(i||w(n),b.current?.(n))},[i]);(0,e.useImperativeHandle)(he,()=>({open:k,close:P,toggle:H,get isDetached(){return I.current},get window(){return c.current}}),[k,P,H]),(0,e.useEffect)(()=>(ne(),()=>N()),[ne,N]),(0,e.useEffect)(()=>{if(p)return oe.current(),()=>O.current();O.current()},[p]),(0,e.useEffect)(()=>{v!==void 0&&ae.current(v)},[v]),(0,e.useEffect)(()=>{c.current&&!c.current.closed&&a&&(c.current.document.title=a)},[a]),(0,e.useEffect)(()=>{if(typeof window>"u")return;let n=()=>{d.current.closeOnMainWindowUnload&&c.current&&!c.current.closed&&c.current.close()};return window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n),c.current&&!c.current.closed&&c.current.close(),c.current=null}},[]);let se=typeof s=="function"?s({open:k,close:P,toggle:H,detached:p,windowRef:c.current}):s,ve=t==="clone"||!p,be=p&&K!==null;return(0,g.jsxs)(g.Fragment,{children:[X&&v!==void 0&&(0,g.jsx)("input",{type:"hidden",name:X,value:L.current(v)}),ve&&(0,g.jsx)("div",{className:Ae(pe),children:se}),be&&(0,ie.createPortal)(se,K)]})}var de=(0,e.forwardRef)(Pe);de.displayName="AdvanceDetachable";0&&(module.exports={AdvanceDetachable});
@@ -0,0 +1 @@
1
+ "use client";import{useState as S,useRef as c,useEffect as w,useCallback as l,useImperativeHandle as we,forwardRef as Re}from"react";import{createPortal as De}from"react-dom";import{Fragment as ke,jsx as de,jsxs as Pe}from"react/jsx-runtime";function Ce(...r){return r.filter(Boolean).join(" ")}var Ee="@synertech/ui/AdvanceDetachable",Te=300,Ae="width=800,height=600,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes",Ne=0;function Me(){return`${Date.now()}-${++Ne}-${Math.random().toString(36).slice(2,8)}`}function ue(r){try{return JSON.stringify(r)}catch{return String(r)}}function ie(r){try{return JSON.parse(r)}catch{return r}}function Se(r,o){r.querySelectorAll("style").forEach(a=>{let s=o.createElement("style");s.textContent=a.textContent,o.head.appendChild(s)}),r.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{let s=a,u=o.createElement("link");u.rel="stylesheet",u.href=s.href,s.crossOrigin&&(u.crossOrigin=s.crossOrigin),o.head.appendChild(u)}),r.documentElement.className&&(o.documentElement.className=r.documentElement.className),r.body.className&&(o.body.className=r.body.className)}function Le(r,o){let a=new MutationObserver(s=>{for(let u of s)for(let p of Array.from(u.addedNodes))if(p instanceof HTMLStyleElement){let i=o.createElement("style");i.textContent=p.textContent,o.head.appendChild(i)}else if(p instanceof HTMLLinkElement&&p.rel==="stylesheet"){let i=o.createElement("link");i.rel="stylesheet",i.href=p.href,o.head.appendChild(i)}});return a.observe(r.head,{childList:!0}),a}function Ie(){return typeof BroadcastChannel<"u"}function xe({mode:r,id:o,title:a="",children:s,value:u,defaultValue:p,onValueChange:i,isDetached:z,defaultDetached:fe=!1,onDetachedChange:$,features:F,target:W,autoFocus:U=!0,className:pe,detachedBodyClassName:_,disabled:q=!1,readOnly:J=!1,closeOnMainWindowUnload:X=!0,name:j,serialize:G,deserialize:K},he){let d=z!==void 0,[me,R]=S(fe),h=d?z:me,L=u!==void 0,[ge,ye]=S(p),v=L?u:ge,[Q,Y]=S(null),n=c(null),y=c(null),D=c(null),C=c(null),E=c(!1),T=c(null),I=c(null),Z=c(null),[A]=S(()=>`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`),f=c({title:a,features:F,target:W,autoFocus:U,detachedBodyClassName:_,closeOnMainWindowUnload:X,disabled:q,readOnly:J,mode:r,id:o});f.current={title:a,features:F,target:W,autoFocus:U,detachedBodyClassName:_,closeOnMainWindowUnload:X,disabled:q,readOnly:J,mode:r,id:o};let x=c(G??ue);x.current=G??ue;let ee=c(K??ie);ee.current=K??ie;let ne=c(i);ne.current=i;let b=c($);b.current=$;let O=c(h);O.current=h;let m=`${Ee}/${o}`,N=l(()=>{D.current&&(clearInterval(D.current),D.current=null),C.current&&(C.current.disconnect(),C.current=null),Y(null)},[]),M=l(()=>{y.current&&(y.current.close(),y.current=null),T.current&&typeof window<"u"&&(window.removeEventListener("message",T.current),T.current=null)},[]),k=l(e=>{if(!(!e||e.channel!==m)&&e.instanceId!==A&&!f.current.readOnly&&e.type==="value-sync"&&e.payload!==void 0){I.current=e.payload;let t=ee.current(e.payload);L||ye(t),ne.current?.(t)}},[m,A,L]),te=l(()=>{if(M(),!(typeof window>"u"))if(Ie()){let e=new BroadcastChannel(m),t=g=>k(g.data);e.addEventListener("message",t),y.current=e}else{let e=t=>{t.data?.channel===m&&k(t.data)};window.addEventListener("message",e),T.current=e}},[m,M,k]),re=l(e=>{if(f.current.readOnly)return;let t=x.current(e);if(t===Z.current)return;if(t===I.current){I.current=null;return}Z.current=t;let g={channel:m,instanceId:A,messageId:Me(),origin:"main",timestamp:Date.now(),type:"value-sync",payload:t};y.current?y.current.postMessage(g):n.current&&!n.current.closed&&n.current.postMessage(g,"*")},[m,A]),ce=l(()=>{if(typeof window>"u"||f.current.disabled||E.current||n.current&&!n.current.closed)return;E.current=!0;let e=f.current,t=window.open("",e.target||"",e.features||Ae);if(!t){E.current=!1;return}n.current=t,t.document.title=e.title||document.title,e.detachedBodyClassName&&(t.document.body.className=e.detachedBodyClassName);let g=t.document.createElement("div");t.document.body.appendChild(g),Y(g),Se(document,t.document),C.current=Le(document,t.document),D.current=setInterval(()=>{t.closed&&(N(),n.current=null,d||R(!1),b.current?.(!1))},Te),e.autoFocus&&t.focus(),E.current=!1},[d,N]),oe=l(()=>{n.current&&!n.current.closed&&n.current.close(),n.current=null,N()},[N]),ae=c(ce);ae.current=ce;let P=c(oe);P.current=oe;let se=c(re);se.current=re;let H=l(()=>{f.current.disabled||(d||R(!0),b.current?.(!0))},[d]),V=l(()=>{d||R(!1),b.current?.(!1)},[d]),B=l(()=>{let e=!O.current;e&&f.current.disabled||(d||R(e),b.current?.(e))},[d]);we(he,()=>({open:H,close:V,toggle:B,get isDetached(){return O.current},get window(){return n.current}}),[H,V,B]),w(()=>(te(),()=>M()),[te,M]),w(()=>{if(h)return ae.current(),()=>P.current();P.current()},[h]),w(()=>{v!==void 0&&se.current(v)},[v]),w(()=>{n.current&&!n.current.closed&&a&&(n.current.document.title=a)},[a]),w(()=>{if(typeof window>"u")return;let e=()=>{f.current.closeOnMainWindowUnload&&n.current&&!n.current.closed&&n.current.close()};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e),n.current&&!n.current.closed&&n.current.close(),n.current=null}},[]);let le=typeof s=="function"?s({open:H,close:V,toggle:B,detached:h,windowRef:n.current}):s,ve=r==="clone"||!h,be=h&&Q!==null;return Pe(ke,{children:[j&&v!==void 0&&de("input",{type:"hidden",name:j,value:x.current(v)}),ve&&de("div",{className:Ce(pe),children:le}),be&&De(le,Q)]})}var Oe=Re(xe);Oe.displayName="AdvanceDetachable";export{Oe as AdvanceDetachable};
@@ -0,0 +1 @@
1
+ "use strict";var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var l=(a,e)=>{for(var t in e)n(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of b(e))!h.call(a,c)&&c!==t&&n(a,c,{get:()=>e[c],enumerable:!(d=r(e,c))||d.enumerable});return a};var A=a=>v(n({},"__esModule",{value:!0}),a);var D={};l(D,{AdvanceDetachable:()=>o.AdvanceDetachable});module.exports=A(D);var o=require("./AdvanceDetachable.cjs");0&&(module.exports={AdvanceDetachable});
@@ -0,0 +1 @@
1
+ import{AdvanceDetachable as c}from"./AdvanceDetachable.js";export{c as AdvanceDetachable};
@@ -0,0 +1 @@
1
+ "use strict";"use client";var Ee=Object.defineProperty;var Ye=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var Fe=(h,i)=>{for(var r in i)Ee(h,r,{get:i[r],enumerable:!0})},je=(h,i,r,g)=>{if(i&&typeof i=="object"||typeof i=="function")for(let m of _e(i))!Ue.call(h,m)&&m!==r&&Ee(h,m,{get:()=>i[m],enumerable:!(g=Ye(i,m))||g.enumerable});return h};var Ze=h=>je(Ee({},"__esModule",{value:!0}),h);var rt={};Fe(rt,{AreaChart:()=>nt});module.exports=Ze(rt);var s=require("react"),He=require("../../lib/cn.cjs"),We=require("../../lib/i18n.cjs"),Q=require("../chart/ChartAnnotations.cjs"),Te=require("../chart/ChartAxis.cjs"),de=require("../chart/ChartBrush.cjs"),De=require("../chart/ChartContainer.cjs"),Me=require("../chart/ChartGrid.cjs"),Ke=require("../chart/ChartLegend.cjs"),ge=require("../chart/ChartPatterns.cjs"),$e=require("../chart/ChartSync.cjs"),Xe=require("../chart/ChartTableView.cjs"),fe=require("../chart/ChartTooltip.cjs"),E=require("../chart/palette.cjs"),P=require("../chart/utils/cartesian.cjs"),pe=require("../chart/utils/data.cjs"),be=require("../chart/utils/decimate.cjs"),x=require("../chart/utils/format.cjs"),M=require("../chart/utils/path.cjs"),T=require("../chart/utils/scales.cjs"),Ce=require("../chart/utils/stack.cjs"),Ge=require("../chart/utils/ticks.cjs"),n=require("react/jsx-runtime"),qe=.12,Je=.9,Qe=10,et=(0,s.memo)(function({bands:i,stacked:r,patterns:g,patternBaseId:m}){return(0,n.jsx)("g",{children:i.map(d=>(0,n.jsxs)("g",{children:[(0,n.jsx)("path",{d:d.area,fill:(0,ge.patternFill)(g,m,d.slot,d.color),fillOpacity:r?Je:qe,stroke:"none"}),d.gap?(0,n.jsx)("path",{d:d.gap,fill:"none",strokeWidth:2,className:"stroke-white dark:stroke-gray-800"}):null,(0,n.jsx)("path",{d:d.edge,fill:"none",stroke:d.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]},d.key))})});function tt({width:h,height:i,data:r,resolvedSeries:g,x:m,y:d,grid:C,size:ee,curve:b,stack:L,baseline:A,connectNulls:N,referenceLines:K,annotations:S,annotationsLabel:ye,patterns:te,patternBaseId:ne,overlay:ke,maxPoints:y,brush:re,onBrush:oe,brushLabel:ve,syncEnabled:$,margin:ae,tooltip:B,onPointClick:X,plotLabel:xe,formatValue:k,formatRaw:G,formatX:I}){let[O,z]=(0,s.useState)(null),u=O!==null&&O<r.length?O:null,[Pe,Le]=(0,s.useState)(null),Ae=(0,$e.useChartSync)(),l=$?Ae:null,t=(0,s.useMemo)(()=>{let e=g.filter(w=>!w.hidden),o=e.map(w=>w.key),a=L!=="none",c=(0,Ce.stackSeries)(r,o,L),ue=a?(0,Ce.stackExtent)(c):(0,Ge.extent)([...(0,pe.collectAllValues)(r,o),A]),p=(0,P.buildCartesianGeometry)({width:h,height:i,data:r,x:m,y:d,bounds:ue,margin:ae,placement:"point",formatValue:k,formatX:I,defaultIncludeZero:!0}),Re=p.categoryCenters,ce=p.valueScale,Oe=ce(a?0:A),ze=e.map((w,we)=>{let Z=r.map((q,J)=>{let V=c[J].segments[we];return{x:Re[J],y:V.value===null?Number.NaN:ce(V.end),defined:V.value!==null}}),Ne=r.map((q,J)=>{let V=c[J].segments[we];return{x:Re[J],y:V.value===null?Number.NaN:ce(a?V.start:A),defined:V.value!==null}}),he={connectNulls:N},me=y&&y>0&&Z.length>y?(0,be.decimateIndices)(Z,y):null,Ve=me?me.map(q=>Z[q]):Z,Ie=me?me.map(q=>Ne[q]):Ne;return y||(0,be.warnPointBudget)("AreaChart",Z.length),{key:w.key,color:w.color,slot:w.slot,area:a?(0,M.buildAreaPath)(Ve,Ie,b,he):(0,M.buildAreaPath)(Ve,Oe,b,he),edge:(0,M.buildLinePath)(Ve,b,he),gap:a&&we>0?(0,M.buildLinePath)(Ie,b,he):""}});return{visible:e,locate:(0,P.createCategoryLocator)(p),plot:(0,P.createPlotContext)({geometry:p,width:h,height:i,data:r,series:e,formatValue:k,formatX:I}),rows:c,stacked:a,xValues:p.xValues,positions:Re,xTicks:p.categoryTicks,yTicks:p.valueTicks,valueScale:ce,innerWidth:p.innerWidth,innerHeight:p.innerHeight,margin:p.margin,bands:ze}},[r,g,m,d,h,i,ae,b,L,A,N,y,k,I]),Y=(0,s.useCallback)(e=>t.visible.map((o,a)=>{let c=(0,pe.readNumber)(r[e],o.key),ue=t.rows[e].segments[a],p=c===null?"\u2014":L==="percent"?`${G(c)} (${k(ue.end-ue.start)})`:k(c);return{seriesKey:o.key,seriesLabel:(0,E.getSeriesLabel)(o),color:o.color,value:c,formattedValue:p,datum:r[e]}}),[r,t.visible,t.rows,L,k,G]),se=l?l.brush:Pe,le=(0,s.useCallback)(e=>{Le(e),l?.setBrush(e),oe?.(e)},[l,oe]),f=(0,de.useChartBrush)({enabled:re,active:se!==null,centers:t.positions,xValues:t.xValues,offset:t.margin.left,orientation:"vertical",onCommit:le}),Se=(0,s.useCallback)(e=>{if(f.onPointerMove(e),B===!1||r.length===0)return;let o=e.currentTarget.getBoundingClientRect(),a=e.clientX-o.left-t.margin.left,c=(0,T.nearestIndex)(t.positions,a);z(c>=0?c:null),l?.setHovered(c>=0?t.xValues[c]:null)},[f,B,r.length,t.margin.left,t.positions,t.xValues,l]),ie=(0,s.useCallback)(()=>{z(null),l?.setHovered(null)},[l]),H=(0,s.useCallback)(e=>{if(r.length===0)return;f.onKeyDown(e,u);let o=r.length-1,a=u??0,c=e.key==="ArrowRight"?Math.min(o,a+1):e.key==="ArrowLeft"?Math.max(0,a-1):e.key==="Home"?0:e.key==="End"?o:e.key==="Escape"?null:void 0;c!==void 0&&(e.preventDefault(),z(c),l?.setHovered(c===null?null:t.xValues[c]))},[r.length,u,f,l,t.xValues]),W=(0,s.useCallback)(()=>{if(f.consumedClick()||!X||u===null)return;let[e]=Y(u);e&&X({...e,index:u,x:t.xValues[u]})},[f,X,u,Y,t.xValues]),Be=u!==null||!l?.hovered?null:(()=>{let e=(0,T.toKey)(l.hovered),o=t.xValues.findIndex(a=>(0,T.toKey)(a)===e);return o<0?null:o})(),v=u??Be,_=u===null?null:Y(u),D=v===null?[]:t.visible.map((e,o)=>{let a=t.rows[v].segments[o];return a.value===null?null:{key:e.key,color:e.color,y:t.valueScale(a.end)}}).filter(e=>e!==null),U=f.dragging??se,F=(()=>{if(!U)return null;let e=t.locate(U.from),o=t.locate(U.to);return e===null||o===null?null:{from:e,to:o}})(),j=(0,P.splitOverlay)(ke),R=u===null||_===null?null:{x:t.xValues[u],xLabel:I(t.xValues[u],u),index:u,points:_};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{width:h,height:i,role:"img","aria-label":xe??[t.visible.map(e=>(0,E.getSeriesLabel)(e)).join(", "),(0,Q.describeAnnotations)(S,ye)].filter(Boolean).join(". "),tabIndex:0,className:(0,He.cn)("touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",re&&"select-none"),onPointerDown:f.onPointerDown,onPointerMove:Se,onPointerUp:f.onPointerUp,onPointerCancel:f.onPointerUp,onPointerLeave:ie,onKeyDown:H,onBlur:ie,onClick:W,children:[te?(0,n.jsx)(ge.ChartPatternDefs,{id:ne,entries:g.map(e=>({slot:e.slot,color:e.color}))}):null,(0,n.jsxs)("g",{transform:`translate(${t.margin.left}, ${t.margin.top})`,children:[(0,n.jsx)(Me.ChartGrid,{width:t.innerWidth,height:t.innerHeight,horizontal:C==="y"||C==="both"?t.yTicks.map(e=>e.offset):void 0,vertical:C==="x"||C==="both"?t.xTicks.map(e=>e.offset):void 0}),S?(0,n.jsx)(Q.ChartAnnotationLayer,{layer:"under",annotations:S,xAt:t.locate,yAt:t.valueScale,width:t.innerWidth,height:t.innerHeight}):null,F?(0,n.jsx)(de.ChartBrushLayer,{from:F.from,to:F.to,width:t.innerWidth,height:t.innerHeight,live:f.dragging!==null,label:ve}):null,j.under?.(t.plot),(0,n.jsx)(et,{bands:t.bands,stacked:t.stacked,patterns:te&&t.stacked,patternBaseId:ne}),S?(0,n.jsx)(Q.ChartAnnotationLayer,{annotations:S,xAt:t.locate,yAt:t.valueScale,width:t.innerWidth,height:t.innerHeight}):null,K?.map(e=>{let o=t.valueScale(e.value),a=o<Qe?o+12:o-4;return(0,n.jsxs)("g",{children:[(0,n.jsx)("line",{x1:0,y1:o,x2:t.innerWidth,y2:o,stroke:e.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:e.dashed===!1?void 0:"4 4"}),e.label?(0,n.jsx)("text",{x:t.innerWidth,y:a,textAnchor:"end",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:e.label}):null]},`${e.value}-${e.label??""}`)}),j.over?.(t.plot),v!==null?(0,n.jsxs)("g",{"aria-hidden":"true",children:[(0,n.jsx)("line",{x1:t.positions[v],y1:0,x2:t.positions[v],y2:t.innerHeight,className:"stroke-gray-400 dark:stroke-gray-500",strokeWidth:1,strokeDasharray:u===null?"3 3":void 0}),D.map(e=>(0,n.jsx)("circle",{cx:t.positions[v],cy:e.y,r:4,fill:e.color,strokeWidth:2,className:"stroke-white dark:stroke-gray-800"},e.key))]}):null]}),(0,n.jsx)("g",{transform:`translate(${t.margin.left}, ${t.margin.top+t.innerHeight})`,children:m.hidden?null:(0,n.jsx)(Te.ChartAxis,{orientation:"bottom",ticks:t.xTicks,length:t.innerWidth,label:m.label,size:ee})}),(0,n.jsx)("g",{transform:`translate(${t.margin.left}, ${t.margin.top})`,children:d?.hidden?null:(0,n.jsx)(Te.ChartAxis,{orientation:"left",ticks:t.yTicks,length:t.innerHeight,showLine:!1,label:d?.label,size:ee})})]}),R&&B!==!1?(0,n.jsx)(fe.ChartTooltip,{x:t.margin.left+t.positions[R.index],y:t.margin.top+(D.length>0?Math.min(...D.map(e=>e.y)):t.innerHeight/2),containerWidth:h,children:typeof B=="function"?B(R):(0,n.jsx)(fe.ChartTooltipContent,{title:R.xLabel,points:R.points})}):null]})}function nt({data:h,series:i,x:r,y:g,height:m=240,width:d,size:C="md",grid:ee="y",legend:b,tooltip:L=!0,tableView:A=!1,emphasis:N,title:K,description:S,loading:ye=!1,emptyState:te,error:ne=!1,errorState:ke,onRetry:y,actions:re,onPointClick:oe,curve:ve="monotone",stack:$="none",baseline:ae=0,connectNulls:B=!1,referenceLines:X,annotations:xe,overlay:k,patterns:G=!1,legendToggle:I=!0,maxPoints:O,brush:z=!1,onBrush:u,brushLabel:Pe,sync:Le=!0,margin:Ae,locale:l,plotLabel:t,className:Y,...se}){let le=(0,We.useUILabels)(),[f,Se]=(0,s.useState)(()=>new Set),ie=(0,s.useId)(),H=(0,s.useMemo)(()=>i.map((e,o)=>({...e,slot:o,hidden:e.hidden||f.has(e.key),color:(0,E.resolveSeriesColor)(e,o,N)})),[i,f,N]),W=$==="percent",Be=(0,s.useMemo)(()=>W?{domain:[0,100],...g}:g,[W,g]),v=(0,s.useMemo)(()=>g?.format??(W?e=>(0,x.formatPercent)(e,{locale:l,alreadyScaled:!0,maximumFractionDigits:0}):e=>(0,x.formatAuto)(e,l)),[g?.format,W,l]),_=(0,s.useMemo)(()=>e=>(0,x.formatAuto)(e,l),[l]),D=(0,s.useMemo)(()=>r.format??(e=>r.scale==="time"?(0,x.formatXValue)(e instanceof Date?e:new Date((0,T.toNumber)(e)),l):(0,x.formatXValue)(e,l)),[r.format,r.scale,l]),U=(0,s.useCallback)(e=>{Se(o=>{let a=new Set(o);return a.has(e)?a.delete(e):a.add(e),a})},[]),F=b===void 0?i.length>=2:b!==!1,j=typeof b=="string"?b:"bottom",R=H.filter(e=>!e.hidden).length;return(0,n.jsx)(De.ChartContainer,{title:K,description:S,height:m,width:d,size:C,loading:ye,empty:h.length===0||R===0,emptyState:te,error:ne,errorState:ke,onRetry:y,actions:re,tableView:A,legendPosition:j,legend:F?(0,n.jsx)(Ke.ChartLegend,{items:(0,E.toLegendItems)(H,N,G&&$!=="none"),position:j,marker:"rect",size:C,onToggle:I?U:void 0}):void 0,table:A?(0,n.jsx)(Xe.ChartTableView,{data:h,series:H,xKey:r.key,xLabel:r.label??r.key,formatX:D,formatValue:_,caption:typeof K=="string"?K:void 0}):void 0,className:Y,...se,children:({width:e})=>(0,n.jsx)(tt,{width:e,height:m,data:h,resolvedSeries:H,x:r,y:Be,grid:ee,size:C,curve:ve,stack:$,baseline:ae,connectNulls:B,referenceLines:X,annotations:xe,annotationsLabel:le.chartAnnotations,patterns:G,patternBaseId:ie,overlay:k,maxPoints:O,brush:z,onBrush:u,brushLabel:Pe??le.chartBrush,syncEnabled:Le,margin:Ae,tooltip:L,onPointClick:oe,plotLabel:t,formatValue:v,formatRaw:_,formatX:D})})}0&&(module.exports={AreaChart});
@@ -0,0 +1 @@
1
+ "use client";import{memo as Ie,useCallback as R,useId as He,useMemo as I,useState as ve}from"react";import{cn as We}from"../../lib/cn.js";import{useUILabels as De}from"../../lib/i18n.js";import{ChartAnnotationLayer as Le,describeAnnotations as Me}from"../chart/ChartAnnotations.js";import{ChartAxis as Ae}from"../chart/ChartAxis.js";import{ChartBrushLayer as Ke,useChartBrush as $e}from"../chart/ChartBrush.js";import{ChartContainer as Xe}from"../chart/ChartContainer.js";import{ChartGrid as Ge}from"../chart/ChartGrid.js";import{ChartLegend as Oe}from"../chart/ChartLegend.js";import{ChartPatternDefs as ze,patternFill as Ye}from"../chart/ChartPatterns.js";import{useChartSync as _e}from"../chart/ChartSync.js";import{ChartTableView as Ue}from"../chart/ChartTableView.js";import{ChartTooltip as Fe,ChartTooltipContent as je}from"../chart/ChartTooltip.js";import{getSeriesLabel as Se,resolveSeriesColor as Ze,toLegendItems as qe}from"../chart/palette.js";import{buildCartesianGeometry as Je,createCategoryLocator as Qe,createPlotContext as et,splitOverlay as tt}from"../chart/utils/cartesian.js";import{collectAllValues as nt,readNumber as rt}from"../chart/utils/data.js";import{decimateIndices as ot,warnPointBudget as at}from"../chart/utils/decimate.js";import{formatAuto as Be,formatPercent as st,formatXValue as Re}from"../chart/utils/format.js";import{buildAreaPath as we,buildLinePath as Ve}from"../chart/utils/path.js";import{nearestIndex as lt,toKey as Ee,toNumber as it}from"../chart/utils/scales.js";import{stackExtent as ut,stackSeries as ct}from"../chart/utils/stack.js";import{extent as ht}from"../chart/utils/ticks.js";import{Fragment as bt,jsx as a,jsxs as H}from"react/jsx-runtime";var mt=.12,dt=.9,gt=10,ft=Ie(function({bands:g,stacked:r,patterns:m,patternBaseId:p}){return a("g",{children:g.map(u=>H("g",{children:[a("path",{d:u.area,fill:Ye(m,p,u.slot,u.color),fillOpacity:r?dt:mt,stroke:"none"}),u.gap?a("path",{d:u.gap,fill:"none",strokeWidth:2,className:"stroke-white dark:stroke-gray-800"}):null,a("path",{d:u.edge,fill:"none",stroke:u.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]},u.key))})});function pt({width:d,height:g,data:r,resolvedSeries:m,x:p,y:u,grid:b,size:Z,curve:f,stack:v,baseline:x,connectNulls:w,referenceLines:W,annotations:P,annotationsLabel:ue,patterns:q,patternBaseId:J,overlay:ce,maxPoints:C,brush:Q,onBrush:ee,brushLabel:he,syncEnabled:D,margin:te,tooltip:L,onPointClick:M,plotLabel:me,formatValue:y,formatRaw:K,formatX:V}){let[$,X]=ve(null),l=$!==null&&$<r.length?$:null,[de,ge]=ve(null),fe=_e(),s=D?fe:null,t=I(()=>{let e=m.filter(S=>!S.hidden),n=e.map(S=>S.key),o=v!=="none",i=ct(r,n,v),ae=o?ut(i):ht([...nt(r,n),x]),h=Je({width:d,height:g,data:r,x:p,y:u,bounds:ae,margin:te,placement:"point",formatValue:y,formatX:V,defaultIncludeZero:!0}),Ce=h.categoryCenters,se=h.valueScale,Te=se(o?0:x),Ne=e.map((S,ye)=>{let U=r.map((F,j)=>{let B=i[j].segments[ye];return{x:Ce[j],y:B.value===null?Number.NaN:se(B.end),defined:B.value!==null}}),xe=r.map((F,j)=>{let B=i[j].segments[ye];return{x:Ce[j],y:B.value===null?Number.NaN:se(o?B.start:x),defined:B.value!==null}}),le={connectNulls:w},ie=C&&C>0&&U.length>C?ot(U,C):null,ke=ie?ie.map(F=>U[F]):U,Pe=ie?ie.map(F=>xe[F]):xe;return C||at("AreaChart",U.length),{key:S.key,color:S.color,slot:S.slot,area:o?we(ke,Pe,f,le):we(ke,Te,f,le),edge:Ve(ke,f,le),gap:o&&ye>0?Ve(Pe,f,le):""}});return{visible:e,locate:Qe(h),plot:et({geometry:h,width:d,height:g,data:r,series:e,formatValue:y,formatX:V}),rows:i,stacked:o,xValues:h.xValues,positions:Ce,xTicks:h.categoryTicks,yTicks:h.valueTicks,valueScale:se,innerWidth:h.innerWidth,innerHeight:h.innerHeight,margin:h.margin,bands:Ne}},[r,m,p,u,d,g,te,f,v,x,w,C,y,V]),G=R(e=>t.visible.map((n,o)=>{let i=rt(r[e],n.key),ae=t.rows[e].segments[o],h=i===null?"\u2014":v==="percent"?`${K(i)} (${y(ae.end-ae.start)})`:y(i);return{seriesKey:n.key,seriesLabel:Se(n),color:n.color,value:i,formattedValue:h,datum:r[e]}}),[r,t.visible,t.rows,v,y,K]),ne=s?s.brush:de,re=R(e=>{ge(e),s?.setBrush(e),ee?.(e)},[s,ee]),c=$e({enabled:Q,active:ne!==null,centers:t.positions,xValues:t.xValues,offset:t.margin.left,orientation:"vertical",onCommit:re}),pe=R(e=>{if(c.onPointerMove(e),L===!1||r.length===0)return;let n=e.currentTarget.getBoundingClientRect(),o=e.clientX-n.left-t.margin.left,i=lt(t.positions,o);X(i>=0?i:null),s?.setHovered(i>=0?t.xValues[i]:null)},[c,L,r.length,t.margin.left,t.positions,t.xValues,s]),oe=R(()=>{X(null),s?.setHovered(null)},[s]),E=R(e=>{if(r.length===0)return;c.onKeyDown(e,l);let n=r.length-1,o=l??0,i=e.key==="ArrowRight"?Math.min(n,o+1):e.key==="ArrowLeft"?Math.max(0,o-1):e.key==="Home"?0:e.key==="End"?n:e.key==="Escape"?null:void 0;i!==void 0&&(e.preventDefault(),X(i),s?.setHovered(i===null?null:t.xValues[i]))},[r.length,l,c,s,t.xValues]),T=R(()=>{if(c.consumedClick()||!M||l===null)return;let[e]=G(l);e&&M({...e,index:l,x:t.xValues[l]})},[c,M,l,G,t.xValues]),be=l!==null||!s?.hovered?null:(()=>{let e=Ee(s.hovered),n=t.xValues.findIndex(o=>Ee(o)===e);return n<0?null:n})(),k=l??be,O=l===null?null:G(l),N=k===null?[]:t.visible.map((e,n)=>{let o=t.rows[k].segments[n];return o.value===null?null:{key:e.key,color:e.color,y:t.valueScale(o.end)}}).filter(e=>e!==null),z=c.dragging??ne,Y=(()=>{if(!z)return null;let e=t.locate(z.from),n=t.locate(z.to);return e===null||n===null?null:{from:e,to:n}})(),_=tt(ce),A=l===null||O===null?null:{x:t.xValues[l],xLabel:V(t.xValues[l],l),index:l,points:O};return H(bt,{children:[H("svg",{width:d,height:g,role:"img","aria-label":me??[t.visible.map(e=>Se(e)).join(", "),Me(P,ue)].filter(Boolean).join(". "),tabIndex:0,className:We("touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",Q&&"select-none"),onPointerDown:c.onPointerDown,onPointerMove:pe,onPointerUp:c.onPointerUp,onPointerCancel:c.onPointerUp,onPointerLeave:oe,onKeyDown:E,onBlur:oe,onClick:T,children:[q?a(ze,{id:J,entries:m.map(e=>({slot:e.slot,color:e.color}))}):null,H("g",{transform:`translate(${t.margin.left}, ${t.margin.top})`,children:[a(Ge,{width:t.innerWidth,height:t.innerHeight,horizontal:b==="y"||b==="both"?t.yTicks.map(e=>e.offset):void 0,vertical:b==="x"||b==="both"?t.xTicks.map(e=>e.offset):void 0}),P?a(Le,{layer:"under",annotations:P,xAt:t.locate,yAt:t.valueScale,width:t.innerWidth,height:t.innerHeight}):null,Y?a(Ke,{from:Y.from,to:Y.to,width:t.innerWidth,height:t.innerHeight,live:c.dragging!==null,label:he}):null,_.under?.(t.plot),a(ft,{bands:t.bands,stacked:t.stacked,patterns:q&&t.stacked,patternBaseId:J}),P?a(Le,{annotations:P,xAt:t.locate,yAt:t.valueScale,width:t.innerWidth,height:t.innerHeight}):null,W?.map(e=>{let n=t.valueScale(e.value),o=n<gt?n+12:n-4;return H("g",{children:[a("line",{x1:0,y1:n,x2:t.innerWidth,y2:n,stroke:e.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:e.dashed===!1?void 0:"4 4"}),e.label?a("text",{x:t.innerWidth,y:o,textAnchor:"end",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:e.label}):null]},`${e.value}-${e.label??""}`)}),_.over?.(t.plot),k!==null?H("g",{"aria-hidden":"true",children:[a("line",{x1:t.positions[k],y1:0,x2:t.positions[k],y2:t.innerHeight,className:"stroke-gray-400 dark:stroke-gray-500",strokeWidth:1,strokeDasharray:l===null?"3 3":void 0}),N.map(e=>a("circle",{cx:t.positions[k],cy:e.y,r:4,fill:e.color,strokeWidth:2,className:"stroke-white dark:stroke-gray-800"},e.key))]}):null]}),a("g",{transform:`translate(${t.margin.left}, ${t.margin.top+t.innerHeight})`,children:p.hidden?null:a(Ae,{orientation:"bottom",ticks:t.xTicks,length:t.innerWidth,label:p.label,size:Z})}),a("g",{transform:`translate(${t.margin.left}, ${t.margin.top})`,children:u?.hidden?null:a(Ae,{orientation:"left",ticks:t.yTicks,length:t.innerHeight,showLine:!1,label:u?.label,size:Z})})]}),A&&L!==!1?a(Fe,{x:t.margin.left+t.positions[A.index],y:t.margin.top+(N.length>0?Math.min(...N.map(e=>e.y)):t.innerHeight/2),containerWidth:d,children:typeof L=="function"?L(A):a(je,{title:A.xLabel,points:A.points})}):null]})}function $t({data:d,series:g,x:r,y:m,height:p=240,width:u,size:b="md",grid:Z="y",legend:f,tooltip:v=!0,tableView:x=!1,emphasis:w,title:W,description:P,loading:ue=!1,emptyState:q,error:J=!1,errorState:ce,onRetry:C,actions:Q,onPointClick:ee,curve:he="monotone",stack:D="none",baseline:te=0,connectNulls:L=!1,referenceLines:M,annotations:me,overlay:y,patterns:K=!1,legendToggle:V=!0,maxPoints:$,brush:X=!1,onBrush:l,brushLabel:de,sync:ge=!0,margin:fe,locale:s,plotLabel:t,className:G,...ne}){let re=De(),[c,pe]=ve(()=>new Set),oe=He(),E=I(()=>g.map((e,n)=>({...e,slot:n,hidden:e.hidden||c.has(e.key),color:Ze(e,n,w)})),[g,c,w]),T=D==="percent",be=I(()=>T?{domain:[0,100],...m}:m,[T,m]),k=I(()=>m?.format??(T?e=>st(e,{locale:s,alreadyScaled:!0,maximumFractionDigits:0}):e=>Be(e,s)),[m?.format,T,s]),O=I(()=>e=>Be(e,s),[s]),N=I(()=>r.format??(e=>r.scale==="time"?Re(e instanceof Date?e:new Date(it(e)),s):Re(e,s)),[r.format,r.scale,s]),z=R(e=>{pe(n=>{let o=new Set(n);return o.has(e)?o.delete(e):o.add(e),o})},[]),Y=f===void 0?g.length>=2:f!==!1,_=typeof f=="string"?f:"bottom",A=E.filter(e=>!e.hidden).length;return a(Xe,{title:W,description:P,height:p,width:u,size:b,loading:ue,empty:d.length===0||A===0,emptyState:q,error:J,errorState:ce,onRetry:C,actions:Q,tableView:x,legendPosition:_,legend:Y?a(Oe,{items:qe(E,w,K&&D!=="none"),position:_,marker:"rect",size:b,onToggle:V?z:void 0}):void 0,table:x?a(Ue,{data:d,series:E,xKey:r.key,xLabel:r.label??r.key,formatX:N,formatValue:O,caption:typeof W=="string"?W:void 0}):void 0,className:G,...ne,children:({width:e})=>a(pt,{width:e,height:p,data:d,resolvedSeries:E,x:r,y:be,grid:Z,size:b,curve:he,stack:D,baseline:te,connectNulls:L,referenceLines:M,annotations:me,annotationsLabel:re.chartAnnotations,patterns:K,patternBaseId:oe,overlay:y,maxPoints:$,brush:X,onBrush:l,brushLabel:de??re.chartBrush,syncEnabled:ge,margin:fe,tooltip:v,onPointClick:ee,plotLabel:t,formatValue:k,formatRaw:O,formatX:N})})}export{$t as AreaChart};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var m=(a,r)=>{for(var t in r)o(a,t,{get:r[t],enumerable:!0})},x=(a,r,t,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of C(r))!f.call(a,e)&&e!==t&&o(a,e,{get:()=>r[e],enumerable:!(p=A(r,e))||p.enumerable});return a};var s=a=>x(o({},"__esModule",{value:!0}),a);var y={};m(y,{AreaChart:()=>h.AreaChart});module.exports=s(y);var h=require("./AreaChart.cjs");0&&(module.exports={AreaChart});
@@ -0,0 +1 @@
1
+ import{AreaChart as e}from"./AreaChart.js";export{e as AreaChart};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var f=(r,e)=>{for(var a in e)o(r,a,{get:e[a],enumerable:!0})},p=(r,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of g(e))!x.call(r,t)&&t!==a&&o(r,t,{get:()=>e[t],enumerable:!(s=m(e,t))||s.enumerable});return r};var u=r=>p(o({},"__esModule",{value:!0}),r);var b={};f(b,{Avatar:()=>w});module.exports=u(b);var i=require("../../lib/cn.cjs"),n=require("react/jsx-runtime"),h={xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-16 w-16 text-xl"},v={circle:"rounded-full",square:"rounded-none",rounded:"rounded-md"};function w({src:r,alt:e="Avatar",fallback:a,size:s="md",variant:t="circle",border:l=!1,className:d,...c}){return(0,n.jsx)("div",{className:(0,i.cn)("inline-flex items-center justify-center overflow-hidden bg-gray-200 font-medium text-gray-600 dark:bg-gray-700 dark:text-gray-300",h[s],v[t],l&&"ring-2 ring-white dark:ring-gray-900",d),...c,children:r?(0,n.jsx)("img",{src:r,alt:e,className:"h-full w-full object-cover"}):(0,n.jsx)("span",{children:a||e.charAt(0).toUpperCase()})})}0&&(module.exports={Avatar});
@@ -0,0 +1 @@
1
+ import{cn as d}from"../../lib/cn.js";import{jsx as e}from"react/jsx-runtime";var c={xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-16 w-16 text-xl"},m={circle:"rounded-full",square:"rounded-none",rounded:"rounded-md"};function x({src:r,alt:t="Avatar",fallback:a,size:s="md",variant:n="circle",border:o=!1,className:i,...l}){return e("div",{className:d("inline-flex items-center justify-center overflow-hidden bg-gray-200 font-medium text-gray-600 dark:bg-gray-700 dark:text-gray-300",c[s],m[n],o&&"ring-2 ring-white dark:ring-gray-900",i),...l,children:r?e("img",{src:r,alt:t,className:"h-full w-full object-cover"}):e("span",{children:a||t.charAt(0).toUpperCase()})})}export{x as Avatar};
@@ -0,0 +1 @@
1
+ "use strict";var p=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var x=(a,r)=>{for(var o in r)p(a,o,{get:r[o],enumerable:!0})},s=(a,r,o,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of f(r))!m.call(a,t)&&t!==o&&p(a,t,{get:()=>r[t],enumerable:!(e=A(r,t))||e.enumerable});return a};var y=a=>s(p({},"__esModule",{value:!0}),a);var P={};x(P,{Avatar:()=>v.Avatar});module.exports=y(P);var v=require("./Avatar.cjs");0&&(module.exports={Avatar});
@@ -0,0 +1 @@
1
+ import{Avatar as t}from"./Avatar.js";export{t as Avatar};
@@ -0,0 +1 @@
1
+ "use strict";var g=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var y=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of u(e))!k.call(t,d)&&d!==r&&g(t,d,{get:()=>e[d],enumerable:!(o=p(e,d))||o.enumerable});return t};var w=t=>c(g({},"__esModule",{value:!0}),t);var C={};y(C,{Badge:()=>n});module.exports=w(C);var l=require("../../lib/cn.cjs"),a=require("react/jsx-runtime"),f={default:{solid:"bg-gray-500 text-white",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",outlined:"border border-gray-300 text-gray-600 dark:border-gray-600 dark:text-gray-400",subtle:"bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-400"},primary:{solid:"bg-blue-600 text-white",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",outlined:"border border-blue-500 text-blue-600 dark:border-blue-400 dark:text-blue-400",subtle:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"},success:{solid:"bg-green-600 text-white",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",outlined:"border border-green-500 text-green-600 dark:border-green-400 dark:text-green-400",subtle:"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400"},warning:{solid:"bg-yellow-500 text-white",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",outlined:"border border-yellow-400 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400",subtle:"bg-yellow-50 text-yellow-600 dark:bg-yellow-900/30 dark:text-yellow-400"},error:{solid:"bg-red-600 text-white",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",outlined:"border border-red-500 text-red-600 dark:border-red-400 dark:text-red-400",subtle:"bg-red-50 text-red-600 dark:bg-red-900/30 dark:text-red-400"},info:{solid:"bg-cyan-600 text-white",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",outlined:"border border-cyan-500 text-cyan-600 dark:border-cyan-400 dark:text-cyan-400",subtle:"bg-cyan-50 text-cyan-600 dark:bg-cyan-900/30 dark:text-cyan-400"},purple:{solid:"bg-purple-600 text-white",soft:"bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300",outlined:"border border-purple-500 text-purple-600 dark:border-purple-400 dark:text-purple-400",subtle:"bg-purple-50 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400"},indigo:{solid:"bg-indigo-600 text-white",soft:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",outlined:"border border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400",subtle:"bg-indigo-50 text-indigo-600 dark:bg-indigo-900/30 dark:text-indigo-400"},teal:{solid:"bg-teal-600 text-white",soft:"bg-teal-100 text-teal-700 dark:bg-teal-900/50 dark:text-teal-300",outlined:"border border-teal-500 text-teal-600 dark:border-teal-400 dark:text-teal-400",subtle:"bg-teal-50 text-teal-600 dark:bg-teal-900/30 dark:text-teal-400"}},m={default:"bg-gray-500",primary:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",purple:"bg-purple-500",indigo:"bg-indigo-500",teal:"bg-teal-500"},h={sm:"text-[10px] px-1.5 py-0.5 gap-1",md:"text-xs px-2 py-0.5 gap-1",lg:"text-sm px-2.5 py-1 gap-1.5"},B={sm:"w-1.5 h-1.5",md:"w-1.5 h-1.5",lg:"w-2 h-2"},R={sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5"};function n({children:t,color:e="default",size:r="md",variant:o="soft",dot:d=!1,icon:i,pill:b=!0,className:s,...x}){return(0,a.jsxs)("span",{className:(0,l.cn)("inline-flex items-center font-medium",h[r],b?"rounded-full":"rounded",f[e][o],s),...x,children:[d&&(0,a.jsx)("span",{className:(0,l.cn)("shrink-0 rounded-full",B[r],m[e]),"aria-hidden":"true"}),i&&!d&&(0,a.jsx)("span",{className:(0,l.cn)("shrink-0",R[r]),"aria-hidden":"true",children:i}),t]})}n.displayName="Badge";0&&(module.exports={Badge});
@@ -0,0 +1 @@
1
+ import{cn as t}from"../../lib/cn.js";import{jsx as o,jsxs as c}from"react/jsx-runtime";var s={default:{solid:"bg-gray-500 text-white",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",outlined:"border border-gray-300 text-gray-600 dark:border-gray-600 dark:text-gray-400",subtle:"bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-400"},primary:{solid:"bg-blue-600 text-white",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",outlined:"border border-blue-500 text-blue-600 dark:border-blue-400 dark:text-blue-400",subtle:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"},success:{solid:"bg-green-600 text-white",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",outlined:"border border-green-500 text-green-600 dark:border-green-400 dark:text-green-400",subtle:"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400"},warning:{solid:"bg-yellow-500 text-white",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",outlined:"border border-yellow-400 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400",subtle:"bg-yellow-50 text-yellow-600 dark:bg-yellow-900/30 dark:text-yellow-400"},error:{solid:"bg-red-600 text-white",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",outlined:"border border-red-500 text-red-600 dark:border-red-400 dark:text-red-400",subtle:"bg-red-50 text-red-600 dark:bg-red-900/30 dark:text-red-400"},info:{solid:"bg-cyan-600 text-white",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",outlined:"border border-cyan-500 text-cyan-600 dark:border-cyan-400 dark:text-cyan-400",subtle:"bg-cyan-50 text-cyan-600 dark:bg-cyan-900/30 dark:text-cyan-400"},purple:{solid:"bg-purple-600 text-white",soft:"bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300",outlined:"border border-purple-500 text-purple-600 dark:border-purple-400 dark:text-purple-400",subtle:"bg-purple-50 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400"},indigo:{solid:"bg-indigo-600 text-white",soft:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",outlined:"border border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400",subtle:"bg-indigo-50 text-indigo-600 dark:bg-indigo-900/30 dark:text-indigo-400"},teal:{solid:"bg-teal-600 text-white",soft:"bg-teal-100 text-teal-700 dark:bg-teal-900/50 dark:text-teal-300",outlined:"border border-teal-500 text-teal-600 dark:border-teal-400 dark:text-teal-400",subtle:"bg-teal-50 text-teal-600 dark:bg-teal-900/30 dark:text-teal-400"}},x={default:"bg-gray-500",primary:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",purple:"bg-purple-500",indigo:"bg-indigo-500",teal:"bg-teal-500"},p={sm:"text-[10px] px-1.5 py-0.5 gap-1",md:"text-xs px-2 py-0.5 gap-1",lg:"text-sm px-2.5 py-1 gap-1.5"},u={sm:"w-1.5 h-1.5",md:"w-1.5 h-1.5",lg:"w-2 h-2"},k={sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5"};function y({children:l,color:r="default",size:e="md",variant:g="soft",dot:d=!1,icon:a,pill:i=!0,className:n,...b}){return c("span",{className:t("inline-flex items-center font-medium",p[e],i?"rounded-full":"rounded",s[r][g],n),...b,children:[d&&o("span",{className:t("shrink-0 rounded-full",u[e],x[r]),"aria-hidden":"true"}),a&&!d&&o("span",{className:t("shrink-0",k[e]),"aria-hidden":"true",children:a}),l]})}y.displayName="Badge";export{y as Badge};
@@ -0,0 +1 @@
1
+ "use strict";var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var i=(a,e)=>{for(var r in e)d(a,r,{get:e[r],enumerable:!0})},m=(a,e,r,g)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of t(e))!f.call(a,o)&&o!==r&&d(a,o,{get:()=>e[o],enumerable:!(g=p(e,o))||g.enumerable});return a};var x=a=>m(d({},"__esModule",{value:!0}),a);var l={};i(l,{Badge:()=>B.Badge});module.exports=x(l);var B=require("./Badge.cjs");0&&(module.exports={Badge});
@@ -0,0 +1 @@
1
+ import{Badge as o}from"./Badge.js";export{o as Badge};
@@ -0,0 +1 @@
1
+ "use strict";"use client";var x=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var L=(t,r)=>{for(var o in r)x(t,o,{get:r[o],enumerable:!0})},M=(t,r,o,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of y(r))!B.call(t,n)&&n!==o&&x(t,n,{get:()=>r[n],enumerable:!(s=N(r,n))||s.enumerable});return t};var R=t=>M(x({},"__esModule",{value:!0}),t);var z={};L(z,{Banner:()=>C});module.exports=R(z);var v=require("react"),a=require("../../lib/cn.cjs"),e=require("react/jsx-runtime");function k({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M13 16H12V12H11M12 8H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function I({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M9 12L11 14L15 10M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function P({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M12 9V13M12 17H12.01M10.29 3.86L1.82 18C1.65 18.3 1.55 18.65 1.55 18.99C1.55 19.34 1.64 19.69 1.81 19.99C1.99 20.29 2.24 20.55 2.54 20.72C2.84 20.901 3.18 20.99 3.53 21H20.47C20.82 20.99 21.16 20.901 21.46 20.72C21.76 20.55 22.01 20.29 22.19 19.99C22.36 19.69 22.449 19.34 22.448 18.99C22.447 18.65 22.35 18.3 22.18 18L13.71 3.86C13.53 3.57 13.28 3.32 12.98 3.15C12.68 2.99 12.34 2.9 12 2.9C11.66 2.9 11.32 2.99 11.02 3.15C10.72 3.32 10.47 3.57 10.29 3.86Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function W({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M12 8V12M12 16H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function h({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var V={info:k,success:I,warning:P,error:W,default:k},H={info:"bg-blue-50 text-blue-800 border-blue-200 dark:bg-blue-900/20 dark:text-blue-300 dark:border-blue-800",success:"bg-green-50 text-green-800 border-green-200 dark:bg-green-900/20 dark:text-green-300 dark:border-green-800",warning:"bg-yellow-50 text-yellow-800 border-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-300 dark:border-yellow-800",error:"bg-red-50 text-red-800 border-red-200 dark:bg-red-900/20 dark:text-red-300 dark:border-red-800",default:"bg-gray-50 text-gray-800 border-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-700"},T={info:"text-blue-600 dark:text-blue-400",success:"text-green-600 dark:text-green-400",warning:"text-yellow-600 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",default:"text-gray-600 dark:text-gray-400"};function j({type:t="default",title:r,description:o,children:s,icon:n,action:i,closable:d=!1,onClose:c,fullWidth:u=!1,className:g,...f}){let[m,b]=(0,v.useState)(!0);if(!m)return null;let l=()=>{b(!1),c?.()},p=V[t],w=s??o;return(0,e.jsxs)("div",{role:"alert",className:(0,a.cn)("flex items-start gap-3 border px-4 py-3",u?"w-full":"rounded-lg",H[t],g),...f,children:[(0,e.jsx)("div",{className:(0,a.cn)("shrink-0 mt-0.5",T[t]),children:n??(0,e.jsx)(p,{className:"w-5 h-5"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[r&&(0,e.jsx)("div",{className:"font-semibold text-sm",children:r}),w&&(0,e.jsx)("div",{className:(0,a.cn)("text-sm",r?"mt-1 opacity-90":!1),children:w}),i&&(0,e.jsx)("div",{className:"mt-3",children:i})]}),d&&(0,e.jsx)("button",{type:"button",onClick:l,className:(0,a.cn)("shrink-0 rounded-md p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-current"),"aria-label":"Close banner",children:(0,e.jsx)(h,{className:"w-4 h-4"})})]})}function O({title:t,description:r,children:o,action:s,backgroundImage:n,closable:i=!1,onClose:d,fullWidth:c=!1,className:u,...g}){let[f,m]=(0,v.useState)(!0);if(!f)return null;let b=()=>{m(!1),d?.()},l=o??r;return(0,e.jsxs)("div",{className:(0,a.cn)("relative overflow-hidden bg-gray-900 text-white",c?"w-full":"rounded-xl","py-12 px-6 sm:px-12",u),style:n?{backgroundImage:`url(${n})`,backgroundSize:"cover",backgroundPosition:"center"}:void 0,...g,children:[n&&(0,e.jsx)("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"relative z-10 max-w-3xl mx-auto text-center",children:[t&&(0,e.jsx)("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold tracking-tight",children:t}),l&&(0,e.jsx)("div",{className:(0,a.cn)("text-base sm:text-lg opacity-90",t?"mt-4":!1),children:l}),s&&(0,e.jsx)("div",{className:"mt-6",children:s})]}),i&&(0,e.jsx)("button",{type:"button",onClick:b,className:(0,a.cn)("absolute top-4 right-4 z-10 rounded-md p-1.5 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":"Close banner",children:(0,e.jsx)(h,{className:"w-5 h-5"})})]})}function Z({title:t,description:r,children:o,icon:s,action:n,badge:i,closable:d=!1,onClose:c,fullWidth:u=!1,className:g,...f}){let[m,b]=(0,v.useState)(!0);if(!m)return null;let l=()=>{b(!1),c?.()},p=o??r;return(0,e.jsxs)("div",{className:(0,a.cn)("relative flex items-center gap-4 bg-linear-to-r from-indigo-600 to-purple-600 text-white px-4 py-3",u?"w-full":"rounded-lg",g),...f,children:[s&&(0,e.jsx)("div",{className:"shrink-0",children:s}),i&&(0,e.jsx)("span",{className:"shrink-0 inline-flex items-center rounded-full bg-white/20 px-2.5 py-0.5 text-xs font-semibold uppercase tracking-wide",children:i}),(0,e.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-x-4 gap-y-1",children:[t&&(0,e.jsx)("span",{className:"font-semibold text-sm",children:t}),p&&(0,e.jsx)("span",{className:"text-sm opacity-90",children:p})]}),n&&(0,e.jsx)("div",{className:"shrink-0",children:n}),d&&(0,e.jsx)("button",{type:"button",onClick:l,className:(0,a.cn)("shrink-0 rounded-md p-1 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":"Close banner",children:(0,e.jsx)(h,{className:"w-4 h-4"})})]})}function C({variant:t="notification",...r}){switch(t){case"hero":return(0,e.jsx)(O,{...r});case"promotion":return(0,e.jsx)(Z,{...r});default:return(0,e.jsx)(j,{...r})}}C.displayName="Banner";0&&(module.exports={Banner});
@@ -0,0 +1 @@
1
+ "use client";import{useState as x}from"react";import{cn as n}from"../../lib/cn.js";import{jsx as e,jsxs as l}from"react/jsx-runtime";function k({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M13 16H12V12H11M12 8H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function C({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M9 12L11 14L15 10M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function N({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M12 9V13M12 17H12.01M10.29 3.86L1.82 18C1.65 18.3 1.55 18.65 1.55 18.99C1.55 19.34 1.64 19.69 1.81 19.99C1.99 20.29 2.24 20.55 2.54 20.72C2.84 20.901 3.18 20.99 3.53 21H20.47C20.82 20.99 21.16 20.901 21.46 20.72C21.76 20.55 22.01 20.29 22.19 19.99C22.36 19.69 22.449 19.34 22.448 18.99C22.447 18.65 22.35 18.3 22.18 18L13.71 3.86C13.53 3.57 13.28 3.32 12.98 3.15C12.68 2.99 12.34 2.9 12 2.9C11.66 2.9 11.32 2.99 11.02 3.15C10.72 3.32 10.47 3.57 10.29 3.86Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function y({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M12 8V12M12 16H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function h({className:t}){return e("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var B={info:k,success:C,warning:N,error:y,default:k},L={info:"bg-blue-50 text-blue-800 border-blue-200 dark:bg-blue-900/20 dark:text-blue-300 dark:border-blue-800",success:"bg-green-50 text-green-800 border-green-200 dark:bg-green-900/20 dark:text-green-300 dark:border-green-800",warning:"bg-yellow-50 text-yellow-800 border-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-300 dark:border-yellow-800",error:"bg-red-50 text-red-800 border-red-200 dark:bg-red-900/20 dark:text-red-300 dark:border-red-800",default:"bg-gray-50 text-gray-800 border-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-700"},M={info:"text-blue-600 dark:text-blue-400",success:"text-green-600 dark:text-green-400",warning:"text-yellow-600 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",default:"text-gray-600 dark:text-gray-400"};function R({type:t="default",title:r,description:d,children:s,icon:o,action:a,closable:c=!1,onClose:u,fullWidth:g=!1,className:f,...m}){let[b,p]=x(!0);if(!b)return null;let i=()=>{p(!1),u?.()},v=B[t],w=s??d;return l("div",{role:"alert",className:n("flex items-start gap-3 border px-4 py-3",g?"w-full":"rounded-lg",L[t],f),...m,children:[e("div",{className:n("shrink-0 mt-0.5",M[t]),children:o??e(v,{className:"w-5 h-5"})}),l("div",{className:"flex-1 min-w-0",children:[r&&e("div",{className:"font-semibold text-sm",children:r}),w&&e("div",{className:n("text-sm",r?"mt-1 opacity-90":!1),children:w}),a&&e("div",{className:"mt-3",children:a})]}),c&&e("button",{type:"button",onClick:i,className:n("shrink-0 rounded-md p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-current"),"aria-label":"Close banner",children:e(h,{className:"w-4 h-4"})})]})}function I({title:t,description:r,children:d,action:s,backgroundImage:o,closable:a=!1,onClose:c,fullWidth:u=!1,className:g,...f}){let[m,b]=x(!0);if(!m)return null;let p=()=>{b(!1),c?.()},i=d??r;return l("div",{className:n("relative overflow-hidden bg-gray-900 text-white",u?"w-full":"rounded-xl","py-12 px-6 sm:px-12",g),style:o?{backgroundImage:`url(${o})`,backgroundSize:"cover",backgroundPosition:"center"}:void 0,...f,children:[o&&e("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),l("div",{className:"relative z-10 max-w-3xl mx-auto text-center",children:[t&&e("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold tracking-tight",children:t}),i&&e("div",{className:n("text-base sm:text-lg opacity-90",t?"mt-4":!1),children:i}),s&&e("div",{className:"mt-6",children:s})]}),a&&e("button",{type:"button",onClick:p,className:n("absolute top-4 right-4 z-10 rounded-md p-1.5 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":"Close banner",children:e(h,{className:"w-5 h-5"})})]})}function P({title:t,description:r,children:d,icon:s,action:o,badge:a,closable:c=!1,onClose:u,fullWidth:g=!1,className:f,...m}){let[b,p]=x(!0);if(!b)return null;let i=()=>{p(!1),u?.()},v=d??r;return l("div",{className:n("relative flex items-center gap-4 bg-linear-to-r from-indigo-600 to-purple-600 text-white px-4 py-3",g?"w-full":"rounded-lg",f),...m,children:[s&&e("div",{className:"shrink-0",children:s}),a&&e("span",{className:"shrink-0 inline-flex items-center rounded-full bg-white/20 px-2.5 py-0.5 text-xs font-semibold uppercase tracking-wide",children:a}),l("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-x-4 gap-y-1",children:[t&&e("span",{className:"font-semibold text-sm",children:t}),v&&e("span",{className:"text-sm opacity-90",children:v})]}),o&&e("div",{className:"shrink-0",children:o}),c&&e("button",{type:"button",onClick:i,className:n("shrink-0 rounded-md p-1 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":"Close banner",children:e(h,{className:"w-4 h-4"})})]})}function W({variant:t="notification",...r}){switch(t){case"hero":return e(I,{...r});case"promotion":return e(P,{...r});default:return e(R,{...r})}}W.displayName="Banner";export{W as Banner};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var x=(r,n)=>{for(var a in n)o(r,a,{get:n[a],enumerable:!0})},y=(r,n,a,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of f(n))!m.call(r,e)&&e!==a&&o(r,e,{get:()=>n[e],enumerable:!(p=t(n,e))||p.enumerable});return r};var i=r=>y(o({},"__esModule",{value:!0}),r);var s={};x(s,{Banner:()=>B.Banner});module.exports=i(s);var B=require("./Banner.cjs");0&&(module.exports={Banner});
@@ -0,0 +1 @@
1
+ import{Banner as e}from"./Banner.js";export{e as Banner};
@@ -0,0 +1 @@
1
+ "use strict";"use client";var Qe=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var Tt=Object.prototype.hasOwnProperty;var It=(g,c)=>{for(var n in c)Qe(g,n,{get:c[n],enumerable:!0})},Dt=(g,c,n,m)=>{if(c&&typeof c=="object"||typeof c=="function")for(let d of Vt(c))!Tt.call(g,d)&&d!==n&&Qe(g,d,{get:()=>c[d],enumerable:!(m=Mt(c,d))||m.enumerable});return g};var Wt=g=>Dt(Qe({},"__esModule",{value:!0}),g);var Gt={};It(Gt,{BarChart:()=>zt,resetBarChartWarnings:()=>Ot});module.exports=Wt(Gt);var s=require("react"),dt=require("../../lib/cn.cjs"),mt=require("../../lib/i18n.cjs"),we=require("../chart/ChartAnnotations.cjs"),et=require("../chart/ChartAxis.cjs"),$e=require("../chart/ChartBrush.cjs"),ft=require("../chart/ChartContainer.cjs"),gt=require("../chart/ChartGrid.cjs"),bt=require("../chart/ChartLegend.cjs"),Oe=require("../chart/ChartPatterns.cjs"),pt=require("../chart/ChartScaleLegend.cjs"),yt=require("../chart/ChartSync.cjs"),Ct=require("../chart/ChartTableView.cjs"),Ke=require("../chart/ChartTooltip.cjs"),L=require("../chart/palette.cjs"),X=require("../chart/utils/cartesian.cjs"),T=require("../chart/utils/data.cjs"),de=require("../chart/utils/format.cjs"),vt=require("../chart/utils/bins.cjs"),_e=require("../chart/utils/path.cjs"),Se=require("../chart/utils/scales.cjs"),me=require("../chart/utils/stack.cjs"),xt=require("../chart/utils/text.cjs"),Be=require("../chart/utils/ticks.cjs"),r=require("react/jsx-runtime"),Ht=24,ne=2,Nt=4,he=6,$t=10,tt=!1,nt=!1;function Ot(){tt=!1,nt=!1}var Kt=(0,s.memo)(function({bars:c,patterns:n,patternBaseId:m}){return(0,r.jsx)("g",{children:c.map((d,A)=>(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:d.d,fill:(0,Oe.patternFill)(n,m,d.slot,d.color)}),d.label?(0,r.jsx)("text",{x:d.label.x,y:d.label.y,textAnchor:d.label.anchor,dominantBaseline:"middle",className:"fill-gray-600 text-[10px] [font-variant-numeric:tabular-nums] dark:fill-gray-300",children:d.label.text}):null]},`${d.key}-${A}`))})}),_t=(0,s.memo)(function({lines:c}){return(0,r.jsx)("g",{children:c.map(n=>(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:n.d,fill:"none",stroke:n.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:n.dashed?"5 4":void 0}),n.markers.map(m=>(0,r.jsx)("circle",{cx:m.x,cy:m.y,r:3,fill:n.color,strokeWidth:2,className:"stroke-white dark:stroke-gray-800"},`${m.x}-${m.y}`))]},n.key))})});function Xt({width:g,height:c,data:n,resolvedSeries:m,x:d,y:A,grid:I,size:Pe,orientation:R,stack:N,center:E,centerKey:D,valueColors:z,binned:re,curve:Le,barSize:Ae,showValues:Re,referenceLines:Xe,annotations:G,annotationsLabel:ze,patterns:Ee,patternBaseId:oe,overlay:Me,brush:M,onBrush:U,brushLabel:Ge,syncEnabled:Ue,margin:ae,tooltip:F,onPointClick:fe,plotLabel:Ve,formatValue:$,formatRaw:Y,formatX:le}){let[ge,be]=(0,s.useState)(null),f=ge!==null&&ge<n.length?ge:null,[Fe,Ye]=(0,s.useState)(null),W=(0,yt.useChartSync)(),C=Ue?W:null,e=(0,s.useMemo)(()=>{let t=R==="vertical",o=m.filter(p=>!p.hidden),l=o.filter(p=>p.type!=="line"),y=o.filter(p=>p.type==="line"),w=l.map(p=>p.key),b=D!==null||N!=="none",K=D!==null?(0,me.stackDiverging)(n,w,{centerKey:D,percent:N==="percent"}):(0,me.stackSeries)(n,w,N),i=b?(0,me.stackExtent)(K):(0,Be.extent)((0,T.collectAllValues)(n,w)),a=(0,Be.extent)((0,T.collectAllValues)(n,y.map(p=>p.key))),u=i===null?a:a===null?i:[Math.min(i[0],a[0]),Math.max(i[1],a[1])],h=(0,X.buildCartesianGeometry)({width:g,height:c,data:n,x:d,y:A,bounds:u===null?null:[Math.min(u[0],E),Math.max(u[1],E)],margin:ae,orientation:R,placement:"band",bandPaddingInner:re?0:void 0,formatValue:$,formatX:le,defaultIncludeZero:E===0}),{valueScale:J,bandwidth:ve,categoryPositions:rt,innerWidth:ot,innerHeight:at}=h,kt=J(E),De=Math.max(1,l.length),wt=b?ve:ve/De,_=Math.min(Ae??(re?Number.POSITIVE_INFINITY:Ht),Math.max(1,wt-(b&&!re?0:ne))),St=b?_:De*_+(De-1)*ne,lt=(ve-St)/2,it=[],st=p=>b?p.end>=p.start:p.end>=E;K.forEach((p,We)=>{let Q=-1,He=-1;p.segments.forEach((P,ce)=>{P.value!==null&&P.outer!==!1&&(st(P)?Q=ce:He=ce)});let se=0,xe=0;p.segments.forEach((P,ce)=>{if(P.value===null)return;let je=l[ce],v=st(P),ct=J(b?P.start:E),ut=J(P.end),ee=Math.min(ct,ut),ue=Math.abs(ut-ct),Pt=P.base??(v?se===0:xe===0),Lt=t?!v:v;b&&!Pt&&ue>ne&&(ue-=ne,Lt&&(ee+=ne)),v?se+=1:xe+=1;let Ne=rt[We]+(b?lt:lt+ce*(_+ne)),At=ce===(v?Q:He)?t?v?"top":"bottom":v?"right":"left":"none",Rt=t?{x:Ne,y:ee,width:_,height:ue}:{x:ee,y:Ne,width:ue,height:_},qe=null;if(Re&&!b){let Je=Y(P.value),ht=(0,xt.estimateTextWidth)(Je,10);if(t){let te=v?ee:ee+ue,ke=v?te-he:te+he,Et=De>1?_+ne:ve;ht<=Et&&(v?ke>8:ke<at-4)&&(qe={x:Ne+_/2,y:ke,anchor:"middle",text:Je})}else{let te=v?ee+ue:ee,ke=v?ot-te-he:te-he;ht<=ke&&(qe={x:v?te+he:te-he,y:Ne+_/2,anchor:v?"start":"end",text:Je})}}it.push({key:je.key,slot:je.slot,color:z&&P.value!==null?z(P.value):je.color,d:(0,_e.buildBarPath)({...Rt,radius:Nt,round:At}),label:qe})})});let Bt=y.map(p=>{let We=h.categoryCenters.map((Q,He)=>{let se=(0,T.readNumber)(n[He],p.key),xe=se===null?Number.NaN:J(se);return{x:t?Q:xe,y:t?xe:Q,defined:se!==null}});return{key:p.key,color:p.color,dashed:p.dashed,d:(0,_e.buildLinePath)(We,Le),markers:We.filter(Q=>Q.defined!==!1)}});return{vertical:t,visible:o,locate:(0,X.createCategoryLocator)(h),barSeries:l,rows:K,stacked:b,plot:(0,X.createPlotContext)({geometry:h,width:g,height:c,data:n,series:o,formatValue:$,formatX:le}),xValues:h.xValues,categoryPositions:rt,categoryCenters:h.categoryCenters,bandwidth:ve,categoryTicks:h.categoryTicks,valueTicks:h.valueTicks,valueScale:J,baseline:kt,innerWidth:ot,innerHeight:at,margin:h.margin,bars:it,lines:Bt}},[n,m,d,A,g,c,ae,R,N,E,D,z,re,Le,Ae,Re,$,Y,le]),pe=(0,s.useCallback)(t=>e.visible.map(o=>{let l=(0,T.readNumber)(n[t],o.key),y=e.barSeries.indexOf(o),w=y===-1?null:e.rows[t].segments[y],b=l===null?"\u2014":N==="percent"&&w!==null?`${Y(l)} (${$(w.end-w.start)})`:$(l);return{seriesKey:o.key,seriesLabel:(0,L.getSeriesLabel)(o),color:o.color,value:l,formattedValue:b,datum:n[t]}}),[n,e.visible,e.barSeries,e.rows,N,$,Y]),ye=C?C.brush:Fe,Te=(0,s.useCallback)(t=>{Ye(t),C?.setBrush(t),U?.(t)},[C,U]),x=(0,$e.useChartBrush)({enabled:M,active:ye!==null,centers:e.categoryCenters,xValues:e.xValues,offset:e.vertical?e.margin.left:e.margin.top,orientation:R,onCommit:Te}),Ze=(0,s.useCallback)(t=>{if(x.onPointerMove(t),F===!1||n.length===0)return;let o=t.currentTarget.getBoundingClientRect(),l=e.vertical?t.clientX-o.left-e.margin.left:t.clientY-o.top-e.margin.top,y=(0,Se.nearestIndex)(e.categoryCenters,l);be(y>=0?y:null),C?.setHovered(y>=0?e.xValues[y]:null)},[x,F,n.length,e.vertical,e.margin,e.categoryCenters,e.xValues,C]),S=(0,s.useCallback)(()=>{be(null),C?.setHovered(null)},[C]),k=(0,s.useCallback)(t=>{if(n.length===0)return;x.onKeyDown(t,f);let o=n.length-1,l=f??0,y=e.vertical?"ArrowRight":"ArrowDown",w=e.vertical?"ArrowLeft":"ArrowUp",b=t.key===y?Math.min(o,l+1):t.key===w?Math.max(0,l-1):t.key==="Home"?0:t.key==="End"?o:t.key==="Escape"?null:void 0;b!==void 0&&(t.preventDefault(),be(b),C?.setHovered(b===null?null:e.xValues[b]))},[n.length,f,e.vertical,x,C,e.xValues]),Z=(0,s.useCallback)(()=>{if(x.consumedClick()||!fe||f===null)return;let[t]=pe(f);t&&fe({...t,index:f,x:e.xValues[f]})},[x,fe,f,pe,e.xValues]),O=f!==null||!C?.hovered?null:(()=>{let t=(0,Se.toKey)(C.hovered),o=e.xValues.findIndex(l=>(0,Se.toKey)(l)===t);return o<0?null:o})(),V=f??O,B=x.dragging??ye,H=(()=>{if(!B)return null;let t=e.locate(B.from),o=e.locate(B.to);if(t===null||o===null)return null;let l=e.bandwidth/2;return{from:Math.min(t,o)-l,to:Math.max(t,o)+l}})(),j=(0,X.splitOverlay)(Me),Ie=f===null?null:pe(f),q=f===null||Ie===null?null:{x:e.xValues[f],xLabel:le(e.xValues[f],f),index:f,points:Ie},Ce=t=>{let o=e.rows[t].segments.filter(l=>l.value!==null).map(l=>e.valueScale(l.end));for(let l of e.lines){let y=(0,T.readNumber)(n[t],l.key);y!==null&&o.push(e.valueScale(y))}return o},ie=f===null?null:e.vertical?{x:e.margin.left+e.categoryCenters[f],y:e.margin.top+Math.min(...Ce(f),e.baseline)}:{x:e.margin.left+Math.max(...Ce(f),e.baseline),y:e.margin.top+e.categoryCenters[f]};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{width:g,height:c,role:"img","aria-label":Ve??[e.visible.map(t=>(0,L.getSeriesLabel)(t)).join(", "),(0,we.describeAnnotations)(G,ze)].filter(Boolean).join(". "),tabIndex:0,className:(0,dt.cn)("touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",M&&"select-none"),onPointerDown:x.onPointerDown,onPointerMove:Ze,onPointerUp:x.onPointerUp,onPointerCancel:x.onPointerUp,onPointerLeave:S,onKeyDown:k,onBlur:S,onClick:Z,children:[Ee?(0,r.jsx)(Oe.ChartPatternDefs,{id:oe,entries:m.map(t=>({slot:t.slot,color:t.color}))}):null,(0,r.jsxs)("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[(0,r.jsx)(gt.ChartGrid,{width:e.innerWidth,height:e.innerHeight,horizontal:e.vertical&&(I==="y"||I==="both")?e.valueTicks.map(t=>t.offset):void 0,vertical:!e.vertical&&(I==="y"||I==="both")?e.valueTicks.map(t=>t.offset):void 0}),G?(0,r.jsx)(we.ChartAnnotationLayer,{layer:"under",annotations:G,xAt:e.locate,yAt:e.valueScale,width:e.innerWidth,height:e.innerHeight,bandwidth:e.bandwidth}):null,H?(0,r.jsx)($e.ChartBrushLayer,{from:H.from,to:H.to,width:e.innerWidth,height:e.innerHeight,orientation:R,live:x.dragging!==null,label:Ge}):null,V!==null?(0,r.jsx)("rect",{x:e.vertical?e.categoryPositions[V]:0,y:e.vertical?0:e.categoryPositions[V],width:e.vertical?e.bandwidth:e.innerWidth,height:e.vertical?e.innerHeight:e.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,j.under?.(e.plot),(0,r.jsx)(Kt,{bars:e.bars,patterns:Ee,patternBaseId:oe}),e.lines.length>0?(0,r.jsx)(_t,{lines:e.lines}):null,(0,r.jsx)("line",{x1:e.vertical?0:e.baseline,y1:e.vertical?e.baseline:0,x2:e.vertical?e.innerWidth:e.baseline,y2:e.vertical?e.baseline:e.innerHeight,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges"}),G?(0,r.jsx)(we.ChartAnnotationLayer,{annotations:G,xAt:e.locate,yAt:e.valueScale,width:e.innerWidth,height:e.innerHeight,bandwidth:e.bandwidth}):null,j.over?.(e.plot),Xe?.map(t=>{let o=e.valueScale(t.value),l=o<$t?o+12:o-4;return(0,r.jsxs)("g",{children:[(0,r.jsx)("line",{x1:e.vertical?0:o,y1:e.vertical?o:0,x2:e.vertical?e.innerWidth:o,y2:e.vertical?o:e.innerHeight,stroke:t.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:t.dashed===!1?void 0:"4 4"}),t.label?(0,r.jsx)("text",{x:e.vertical?e.innerWidth:o+4,y:e.vertical?l:8,textAnchor:e.vertical?"end":"start",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:t.label}):null]},`${t.value}-${t.label??""}`)})]}),(0,r.jsx)("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:(e.vertical?d.hidden:A?.hidden)?null:(0,r.jsx)(et.ChartAxis,{orientation:"bottom",ticks:e.vertical?e.categoryTicks:e.valueTicks,length:e.innerWidth,label:e.vertical?d.label:A?.label,size:Pe})}),(0,r.jsx)("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:(e.vertical?A?.hidden:d.hidden)?null:(0,r.jsx)(et.ChartAxis,{orientation:"left",ticks:e.vertical?e.valueTicks:e.categoryTicks,length:e.innerHeight,showLine:!1,label:e.vertical?A?.label:d.label,size:Pe})})]}),q&&ie&&F!==!1?(0,r.jsx)(Ke.ChartTooltip,{x:ie.x,y:ie.y,containerWidth:g,children:typeof F=="function"?F(q):(0,r.jsx)(Ke.ChartTooltipContent,{title:q.xLabel,points:q.points})}):null]})}function zt({data:g,series:c,x:n,y:m,height:d=260,width:A,size:I="md",grid:Pe="y",legend:R,tooltip:N=!0,tableView:E=!1,emphasis:D,title:z,description:re,loading:Le=!1,emptyState:Ae,error:Re=!1,errorState:Xe,onRetry:G,actions:ze,onPointClick:Ee,orientation:oe="vertical",stack:Me="none",diverging:M,bins:U,curve:Ge="linear",barSize:Ue,sort:ae="none",showValues:F=!1,referenceLines:fe,annotations:Ve,overlay:$,patterns:Y=!1,legendToggle:le=!0,brush:ge=!1,onBrush:be,brushLabel:f,sync:Fe=!0,margin:Ye,locale:W,plotLabel:C,className:e,...pe}){let ye=(0,mt.useUILabels)(),[Te,x]=(0,s.useState)(()=>new Set),Ze=(0,s.useId)(),S=U!==void 0&&U!==!1,k=S||typeof M!="string"?null:M,Z=!S&&typeof M=="number"?M:0,O=(0,s.useMemo)(()=>{let i=k===null?null:(0,L.createDivergingScale)([0,Math.max(1,c.length-1)],{center:Math.max(0,c.findIndex(a=>a.key===k)),symmetric:!1});return c.map((a,u)=>({...a,slot:u,hidden:a.hidden||Te.has(a.key),color:i&&!a.color&&!D?a.key===k?L.CHART_MUTED_COLOR:i(u):(0,L.resolveSeriesColor)(a,u,D)}))},[c,Te,D,k]),V=(0,s.useMemo)(()=>i=>(0,de.formatAuto)(i,W),[W]),B=(0,s.useMemo)(()=>{if(!S)return null;c.length>1&&!tt&&(tt=!0,console.warn("[@synertech/ui] BarChart was given `bins` and more than one series. A histogram counts a single field \u2014 the extra series are ignored. Facet the chart, or draw the distributions side by side."));let i=c[0]?.key??"count",a=n.format?h=>n.format(h,0):h=>V(h),u=(0,vt.binValues)(g.map(h=>(0,T.readNumber)(h,n.key)),U);return{rows:u.map(h=>({[n.key]:h.from,[i]:h.count})),labels:u.map(h=>`${a(h.from)}\u2013${a(h.to)}`)}},[S,U,g,n.key,n.format,c,V]),H=(0,s.useMemo)(()=>{if(B)return B.rows;if(ae==="none")return g;let i=O.filter(u=>!u.hidden).map(u=>u.key),a=u=>i.reduce((h,J)=>h+((0,T.readNumber)(u,J)??0),0);return[...g].sort((u,h)=>ae==="asc"?a(u)-a(h):a(h)-a(u))},[B,g,ae,O]),j=!S&&Me==="percent",Ie=(0,s.useMemo)(()=>j?{domain:k===null?[0,100]:[-100,100],...m}:m,[j,k,m]),q=(0,s.useMemo)(()=>{let i=m?.format??(j?a=>(0,de.formatPercent)(a,{locale:W,alreadyScaled:!0,maximumFractionDigits:0}):V);return k===null?i:a=>i(Math.abs(a))},[m?.format,j,W,V,k]),Ce=(0,s.useMemo)(()=>B?(i,a)=>B.labels[a]??"":n.format??(i=>(0,de.formatXValue)(i,W)),[B,n.format,W]),ie=(0,s.useMemo)(()=>B?{...n,scale:"category"}:n,[B,n]),t=(0,s.useCallback)(i=>{x(a=>{let u=new Set(a);return u.has(i)?u.delete(i):u.add(i),u})},[]),o=oe==="vertical"?Ve:void 0;Ve&&oe!=="vertical"&&!nt&&(nt=!0,console.warn("[@synertech/ui] BarChart was given `annotations` and a horizontal orientation. Annotations are read on the category axis, which runs up the side there: they are ignored. Use `referenceLines` for a threshold on the value axis."));let l=R===void 0?c.length>=2:R!==!1,y=typeof R=="string"?R:"bottom",w=O.filter(i=>!i.hidden),b=w.length,K=(0,s.useMemo)(()=>{if(S||M===void 0||M===!1||k!==null||b!==1)return null;let i=(0,T.collectAllValues)(H,w.map(u=>u.key)),a=(0,Be.resolveDomain)([...i,Z],{domain:m?.domain,includeZero:m?.includeZero??Z===0,ticks:m?.ticks??5});return(0,L.createDivergingScale)(a,{center:Z})},[S,M,k,b,w,H,Z,m]);return(0,r.jsx)(ft.ChartContainer,{title:z,description:re,height:d,width:A,size:I,loading:Le,empty:H.length===0||b===0,emptyState:Ae,error:Re,errorState:Xe,onRetry:G,actions:ze,tableView:E,legendPosition:y,legend:K?(0,r.jsx)(pt.ChartScaleLegend,{scale:K,label:m?.label,format:q,size:I,locale:W}):l?(0,r.jsx)(bt.ChartLegend,{items:(0,L.toLegendItems)(O,D,Y),position:y,marker:"rect",size:I,onToggle:le?t:void 0}):void 0,table:E?(0,r.jsx)(Ct.ChartTableView,{data:H,series:O,xKey:ie.key,xLabel:n.label??n.key,formatX:Ce,formatValue:V,caption:typeof z=="string"?z:void 0}):void 0,className:e,...pe,children:({width:i})=>(0,r.jsx)(Xt,{width:i,height:d,data:H,resolvedSeries:O,x:ie,y:Ie,grid:Pe,size:I,orientation:oe,stack:S?"none":Me,center:Z,centerKey:k,valueColors:K,binned:S,curve:Ge,barSize:Ue,showValues:F,referenceLines:fe,annotations:o,annotationsLabel:ye.chartAnnotations,patterns:Y&&K===null,patternBaseId:Ze,overlay:$,brush:ge,onBrush:be,brushLabel:f??ye.chartBrush,syncEnabled:Fe,margin:Ye,tooltip:N,onPointClick:Ee,plotLabel:C,formatValue:q,formatRaw:V,formatX:Ce})})}0&&(module.exports={BarChart,resetBarChartWarnings});