@cloudflare/kumo 1.19.0 → 2.0.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 (289) hide show
  1. package/CHANGELOG.md +239 -0
  2. package/ai/component-registry.json +758 -118
  3. package/ai/component-registry.md +1151 -153
  4. package/ai/schemas.ts +42 -14
  5. package/dist/.build-complete +1 -1
  6. package/dist/ai/schemas.d.ts +153 -21
  7. package/dist/ai/schemas.d.ts.map +1 -1
  8. package/dist/ai/schemas.js +1994 -1956
  9. package/dist/ai/schemas.js.map +1 -1
  10. package/dist/chunks/Legend-ibjxhfm9pn2vrb6f.js +430 -0
  11. package/dist/chunks/Legend-ibjxhfm9pn2vrb6f.js.map +1 -0
  12. package/dist/chunks/autocomplete-cs3fwy6lwzlyirpq.js +174 -0
  13. package/dist/chunks/autocomplete-cs3fwy6lwzlyirpq.js.map +1 -0
  14. package/dist/chunks/{breadcrumbs-ge20hcb3o5spswrk.js → breadcrumbs-cxcwf2l1ki3ffg5d.js} +2 -2
  15. package/dist/chunks/{breadcrumbs-ge20hcb3o5spswrk.js.map → breadcrumbs-cxcwf2l1ki3ffg5d.js.map} +1 -1
  16. package/dist/chunks/{button-oaqi7ykdisyskoos.js → button-6by9ntsa3nj553mq.js} +23 -24
  17. package/dist/chunks/button-6by9ntsa3nj553mq.js.map +1 -0
  18. package/dist/chunks/checkbox-eren6w2csum1xghg.js +210 -0
  19. package/dist/chunks/checkbox-eren6w2csum1xghg.js.map +1 -0
  20. package/dist/chunks/{clipboard-text-dxczqon3d27xp6f0.js → clipboard-text-f9q753udny1uyxr5.js} +45 -41
  21. package/dist/chunks/{clipboard-text-dxczqon3d27xp6f0.js.map → clipboard-text-f9q753udny1uyxr5.js.map} +1 -1
  22. package/dist/chunks/collapsible-k8urhi16pg90jvxa.js +71 -0
  23. package/dist/chunks/collapsible-k8urhi16pg90jvxa.js.map +1 -0
  24. package/dist/chunks/{combobox-eaowwt1xr4d23gsn.js → combobox-n9qht9h9ag6kh5sn.js} +86 -74
  25. package/dist/chunks/combobox-n9qht9h9ag6kh5sn.js.map +1 -0
  26. package/dist/chunks/{command-palette-maqtbmpfev9mysqd.js → command-palette-gk9m34ymp2b3hfc5.js} +126 -126
  27. package/dist/chunks/command-palette-gk9m34ymp2b3hfc5.js.map +1 -0
  28. package/dist/chunks/{date-range-picker-j318zxjyqz4o3dak.js → date-range-picker-c9wnx9tbwohai7jy.js} +26 -26
  29. package/dist/chunks/{date-range-picker-j318zxjyqz4o3dak.js.map → date-range-picker-c9wnx9tbwohai7jy.js.map} +1 -1
  30. package/dist/chunks/{dialog-e3m5bhs7fds26p9y.js → dialog-94v7wiz7j3in6528.js} +3 -3
  31. package/dist/chunks/{dialog-e3m5bhs7fds26p9y.js.map → dialog-94v7wiz7j3in6528.js.map} +1 -1
  32. package/dist/chunks/{dropdown-ewte287db3vyt8t5.js → dropdown-zbax0zowy6m9zhmt.js} +87 -87
  33. package/dist/chunks/dropdown-zbax0zowy6m9zhmt.js.map +1 -0
  34. package/dist/chunks/{empty-dr1eckm2z40euns6.js → empty-kpymw59thjf2ip8g.js} +9 -9
  35. package/dist/chunks/{empty-dr1eckm2z40euns6.js.map → empty-kpymw59thjf2ip8g.js.map} +1 -1
  36. package/dist/chunks/{field-bo5gmna16odrrb1q.js → field-lnj619xpe8zjd26r.js} +7 -7
  37. package/dist/chunks/{field-bo5gmna16odrrb1q.js.map → field-lnj619xpe8zjd26r.js.map} +1 -1
  38. package/dist/chunks/{input-area-jkkkjej6luumrqpa.js → input-area-h8xbqturegdfm1mi.js} +4 -4
  39. package/dist/chunks/{input-area-jkkkjej6luumrqpa.js.map → input-area-h8xbqturegdfm1mi.js.map} +1 -1
  40. package/dist/chunks/input-group-dh4pg8p20rh4mdi0.js +505 -0
  41. package/dist/chunks/input-group-dh4pg8p20rh4mdi0.js.map +1 -0
  42. package/dist/chunks/{input-cw05pbqdburghkus.js → input-lpa5fc75tgrraafv.js} +46 -46
  43. package/dist/chunks/input-lpa5fc75tgrraafv.js.map +1 -0
  44. package/dist/chunks/{label-cvyvbqmt4mt757ff.js → label-be8m7qzlakzig2sl.js} +3 -3
  45. package/dist/chunks/{label-cvyvbqmt4mt757ff.js.map → label-be8m7qzlakzig2sl.js.map} +1 -1
  46. package/dist/chunks/{layer-card-ljqth3yxgnk04v2o.js → layer-card-hvivdirwwnyq88wa.js} +5 -5
  47. package/dist/chunks/{layer-card-ljqth3yxgnk04v2o.js.map → layer-card-hvivdirwwnyq88wa.js.map} +1 -1
  48. package/dist/chunks/{link-fjnhtxvfe5ieamjf.js → link-kt74pxkud4olmcer.js} +4 -4
  49. package/dist/chunks/{link-fjnhtxvfe5ieamjf.js.map → link-kt74pxkud4olmcer.js.map} +1 -1
  50. package/dist/chunks/menubar-hwev159bm4rw9ixk.js +96 -0
  51. package/dist/chunks/menubar-hwev159bm4rw9ixk.js.map +1 -0
  52. package/dist/chunks/{meter-duj3micor1lqj3y2.js → meter-bqetlujwg8gm2u7m.js} +2 -2
  53. package/dist/chunks/{meter-duj3micor1lqj3y2.js.map → meter-bqetlujwg8gm2u7m.js.map} +1 -1
  54. package/dist/chunks/{pagination-olaypvwr8swsmn8m.js → pagination-ho8zesqfyp6ckmrl.js} +21 -21
  55. package/dist/chunks/pagination-ho8zesqfyp6ckmrl.js.map +1 -0
  56. package/dist/chunks/{popover-nv9cmzbo7mf6bky0.js → popover-iayd9ya5yhujz6ve.js} +5 -5
  57. package/dist/chunks/{popover-nv9cmzbo7mf6bky0.js.map → popover-iayd9ya5yhujz6ve.js.map} +1 -1
  58. package/dist/chunks/{radio-ihxbe37us2jnqtzf.js → radio-datzh3pilz8ojak1.js} +86 -74
  59. package/dist/chunks/radio-datzh3pilz8ojak1.js.map +1 -0
  60. package/dist/chunks/{select-nx6ded5swra74iar.js → select-kpfbib9l8xrrmzpz.js} +64 -62
  61. package/dist/chunks/select-kpfbib9l8xrrmzpz.js.map +1 -0
  62. package/dist/chunks/{sensitive-input-00fujb510rrn61v9.js → sensitive-input-i1upqytzaw2pus8v.js} +42 -42
  63. package/dist/chunks/sensitive-input-i1upqytzaw2pus8v.js.map +1 -0
  64. package/dist/chunks/{sidebar-ltbfius1eolkl8tb.js → sidebar-kh37grvfxto14ek6.js} +129 -126
  65. package/dist/chunks/sidebar-kh37grvfxto14ek6.js.map +1 -0
  66. package/dist/chunks/{surface-dfgurg5eu3et4vw1.js → surface-o63tktyrifcjejyb.js} +2 -2
  67. package/dist/chunks/{surface-dfgurg5eu3et4vw1.js.map → surface-o63tktyrifcjejyb.js.map} +1 -1
  68. package/dist/chunks/{switch-fbv3iawqo3o3jgap.js → switch-lclhiplr9zqf73tj.js} +86 -78
  69. package/dist/chunks/switch-lclhiplr9zqf73tj.js.map +1 -0
  70. package/dist/chunks/{table-olwwulga2l3hdwlx.js → table-fyy8gl875yyevqs3.js} +89 -71
  71. package/dist/chunks/table-fyy8gl875yyevqs3.js.map +1 -0
  72. package/dist/chunks/table-of-contents-fzyv7uhnnyr13dqu.js +102 -0
  73. package/dist/chunks/table-of-contents-fzyv7uhnnyr13dqu.js.map +1 -0
  74. package/dist/chunks/{tabs-lohcglgppp6gj0hp.js → tabs-jywwt8ebjqjkux75.js} +19 -19
  75. package/dist/chunks/{tabs-lohcglgppp6gj0hp.js.map → tabs-jywwt8ebjqjkux75.js.map} +1 -1
  76. package/dist/chunks/{text-nmyi1rkwdj37f30f.js → text-f7t467waymhb30sx.js} +8 -8
  77. package/dist/chunks/text-f7t467waymhb30sx.js.map +1 -0
  78. package/dist/chunks/{toast-dg52x89yd231mxhe.js → toast-h573o0tc7tefivk2.js} +11 -11
  79. package/dist/chunks/{toast-dg52x89yd231mxhe.js.map → toast-h573o0tc7tefivk2.js.map} +1 -1
  80. package/dist/chunks/{tooltip-hikjvdbg3xghnq1x.js → tooltip-odudhkxe282wxinq.js} +5 -5
  81. package/dist/chunks/{tooltip-hikjvdbg3xghnq1x.js.map → tooltip-odudhkxe282wxinq.js.map} +1 -1
  82. package/dist/chunks/vendor-base-ui-ie71jahf0czyf58j.js +24638 -0
  83. package/dist/chunks/vendor-base-ui-ie71jahf0czyf58j.js.map +1 -0
  84. package/dist/chunks/vendor-floating-ui-dwag5e88viikh2zs.js +1311 -0
  85. package/dist/chunks/vendor-floating-ui-dwag5e88viikh2zs.js.map +1 -0
  86. package/dist/chunks/vendor-utils-ixnhxmehwihk5tr7.js +534 -0
  87. package/dist/chunks/vendor-utils-ixnhxmehwihk5tr7.js.map +1 -0
  88. package/dist/code.js +1 -1
  89. package/dist/components/autocomplete.js +9 -0
  90. package/dist/components/autocomplete.js.map +1 -0
  91. package/dist/components/breadcrumbs.js +1 -1
  92. package/dist/components/button.js +1 -1
  93. package/dist/components/chart.js +1 -1
  94. package/dist/components/checkbox.js +1 -1
  95. package/dist/components/clipboard-text.js +1 -1
  96. package/dist/components/collapsible.js +1 -1
  97. package/dist/components/combobox.js +1 -1
  98. package/dist/components/command-palette.js +1 -1
  99. package/dist/components/date-range-picker.js +1 -1
  100. package/dist/components/dialog.js +1 -1
  101. package/dist/components/dropdown.js +1 -1
  102. package/dist/components/empty.js +1 -1
  103. package/dist/components/field.js +1 -1
  104. package/dist/components/input-group.js +8 -0
  105. package/dist/components/input-group.js.map +1 -0
  106. package/dist/components/input.js +9 -7
  107. package/dist/components/label.js +1 -1
  108. package/dist/components/layer-card.js +1 -1
  109. package/dist/components/link.js +1 -1
  110. package/dist/components/menubar.js +1 -1
  111. package/dist/components/meter.js +1 -1
  112. package/dist/components/pagination.js +1 -1
  113. package/dist/components/popover.js +1 -1
  114. package/dist/components/radio.js +1 -1
  115. package/dist/components/select.js +1 -1
  116. package/dist/components/sensitive-input.js +1 -1
  117. package/dist/components/sidebar.js +1 -1
  118. package/dist/components/surface.js +1 -1
  119. package/dist/components/switch.js +1 -1
  120. package/dist/components/table-of-contents.js +1 -1
  121. package/dist/components/table.js +1 -1
  122. package/dist/components/tabs.js +1 -1
  123. package/dist/components/text.js +1 -1
  124. package/dist/components/toast.js +2 -2
  125. package/dist/components/tooltip.js +1 -1
  126. package/dist/index.js +148 -143
  127. package/dist/index.js.map +1 -1
  128. package/dist/primitives/accordion.js +1 -1
  129. package/dist/primitives/alert-dialog.js +1 -1
  130. package/dist/primitives/autocomplete.js +1 -1
  131. package/dist/primitives/avatar.js +1 -1
  132. package/dist/primitives/button.js +1 -1
  133. package/dist/primitives/checkbox-group.js +1 -1
  134. package/dist/primitives/checkbox.js +1 -1
  135. package/dist/primitives/collapsible.js +1 -1
  136. package/dist/primitives/combobox.js +1 -1
  137. package/dist/primitives/context-menu.js +1 -1
  138. package/dist/primitives/csp-provider.js +1 -1
  139. package/dist/primitives/dialog.js +1 -1
  140. package/dist/primitives/direction-provider.js +1 -1
  141. package/dist/primitives/drawer.js +2 -2
  142. package/dist/primitives/field.js +1 -1
  143. package/dist/primitives/fieldset.js +1 -1
  144. package/dist/primitives/form.js +1 -1
  145. package/dist/primitives/input.js +1 -1
  146. package/dist/primitives/menu.js +1 -1
  147. package/dist/primitives/menubar.js +1 -1
  148. package/dist/primitives/meter.js +1 -1
  149. package/dist/primitives/navigation-menu.js +1 -1
  150. package/dist/primitives/number-field.js +1 -1
  151. package/dist/primitives/otp-field.js +6 -0
  152. package/dist/primitives/otp-field.js.map +1 -0
  153. package/dist/primitives/popover.js +1 -1
  154. package/dist/primitives/preview-card.js +2 -2
  155. package/dist/primitives/progress.js +1 -1
  156. package/dist/primitives/radio-group.js +1 -1
  157. package/dist/primitives/radio.js +1 -1
  158. package/dist/primitives/scroll-area.js +1 -1
  159. package/dist/primitives/select.js +1 -1
  160. package/dist/primitives/separator.js +1 -1
  161. package/dist/primitives/slider.js +1 -1
  162. package/dist/primitives/switch.js +1 -1
  163. package/dist/primitives/tabs.js +1 -1
  164. package/dist/primitives/toast.js +1 -1
  165. package/dist/primitives/toggle-group.js +1 -1
  166. package/dist/primitives/toggle.js +1 -1
  167. package/dist/primitives/toolbar.js +1 -1
  168. package/dist/primitives/tooltip.js +1 -1
  169. package/dist/primitives.js +22 -21
  170. package/dist/scripts/theme-generator/config.d.ts.map +1 -1
  171. package/dist/scripts/theme-generator/config.js +10 -0
  172. package/dist/scripts/theme-generator/config.js.map +1 -1
  173. package/dist/src/components/autocomplete/autocomplete.d.ts +180 -0
  174. package/dist/src/components/autocomplete/autocomplete.d.ts.map +1 -0
  175. package/dist/src/components/autocomplete/index.d.ts +2 -0
  176. package/dist/src/components/autocomplete/index.d.ts.map +1 -0
  177. package/dist/src/components/button/button.d.ts +3 -3
  178. package/dist/src/components/button/button.d.ts.map +1 -1
  179. package/dist/src/components/chart/Color.d.ts +36 -52
  180. package/dist/src/components/chart/Color.d.ts.map +1 -1
  181. package/dist/src/components/checkbox/checkbox.d.ts +37 -14
  182. package/dist/src/components/checkbox/checkbox.d.ts.map +1 -1
  183. package/dist/src/components/checkbox/index.d.ts +1 -1
  184. package/dist/src/components/checkbox/index.d.ts.map +1 -1
  185. package/dist/src/components/clipboard-text/clipboard-text.d.ts.map +1 -1
  186. package/dist/src/components/collapsible/collapsible.d.ts +77 -40
  187. package/dist/src/components/collapsible/collapsible.d.ts.map +1 -1
  188. package/dist/src/components/collapsible/index.d.ts +1 -1
  189. package/dist/src/components/collapsible/index.d.ts.map +1 -1
  190. package/dist/src/components/combobox/combobox.d.ts +3 -1
  191. package/dist/src/components/combobox/combobox.d.ts.map +1 -1
  192. package/dist/src/components/command-palette/command-palette.d.ts +2 -11
  193. package/dist/src/components/command-palette/command-palette.d.ts.map +1 -1
  194. package/dist/src/components/command-palette/index.d.ts +1 -1
  195. package/dist/src/components/command-palette/index.d.ts.map +1 -1
  196. package/dist/src/components/command-palette/types.d.ts +13 -1
  197. package/dist/src/components/command-palette/types.d.ts.map +1 -1
  198. package/dist/src/components/input/index.d.ts +16 -1
  199. package/dist/src/components/input/index.d.ts.map +1 -1
  200. package/dist/src/components/input/input.d.ts +2 -2
  201. package/dist/src/components/input/input.d.ts.map +1 -1
  202. package/dist/src/components/input-group/context.d.ts +96 -0
  203. package/dist/src/components/input-group/context.d.ts.map +1 -0
  204. package/dist/src/components/input-group/index.d.ts +2 -0
  205. package/dist/src/components/input-group/index.d.ts.map +1 -0
  206. package/dist/src/components/input-group/input-group-addon.d.ts +15 -0
  207. package/dist/src/components/input-group/input-group-addon.d.ts.map +1 -0
  208. package/dist/src/components/input-group/input-group-button.d.ts +36 -0
  209. package/dist/src/components/input-group/input-group-button.d.ts.map +1 -0
  210. package/dist/src/components/input-group/input-group-input.d.ts +9 -0
  211. package/dist/src/components/input-group/input-group-input.d.ts.map +1 -0
  212. package/dist/src/components/input-group/input-group-suffix.d.ts +13 -0
  213. package/dist/src/components/input-group/input-group-suffix.d.ts.map +1 -0
  214. package/dist/src/components/input-group/input-group.d.ts +43 -0
  215. package/dist/src/components/input-group/input-group.d.ts.map +1 -0
  216. package/dist/src/components/menubar/menubar.d.ts.map +1 -1
  217. package/dist/src/components/radio/index.d.ts +1 -1
  218. package/dist/src/components/radio/index.d.ts.map +1 -1
  219. package/dist/src/components/radio/radio.d.ts +43 -7
  220. package/dist/src/components/radio/radio.d.ts.map +1 -1
  221. package/dist/src/components/select/select.d.ts +3 -3
  222. package/dist/src/components/select/select.d.ts.map +1 -1
  223. package/dist/src/components/sensitive-input/sensitive-input.d.ts +2 -2
  224. package/dist/src/components/sidebar/sidebar.d.ts.map +1 -1
  225. package/dist/src/components/switch/index.d.ts +1 -1
  226. package/dist/src/components/switch/index.d.ts.map +1 -1
  227. package/dist/src/components/switch/switch.d.ts +31 -3
  228. package/dist/src/components/switch/switch.d.ts.map +1 -1
  229. package/dist/src/components/table/table.d.ts +17 -2
  230. package/dist/src/components/table/table.d.ts.map +1 -1
  231. package/dist/src/components/table-of-contents/table-of-contents.d.ts +9 -7
  232. package/dist/src/components/table-of-contents/table-of-contents.d.ts.map +1 -1
  233. package/dist/src/components/text/text.d.ts +34 -6
  234. package/dist/src/components/text/text.d.ts.map +1 -1
  235. package/dist/src/components/text/text.type-spec.d.ts +44 -0
  236. package/dist/src/components/text/text.type-spec.d.ts.map +1 -0
  237. package/dist/src/components/toast/toast.d.ts +1 -1
  238. package/dist/src/components/toast/toast.d.ts.map +1 -1
  239. package/dist/src/index.d.ts +8 -6
  240. package/dist/src/index.d.ts.map +1 -1
  241. package/dist/src/primitives/index.d.ts +1 -0
  242. package/dist/src/primitives/index.d.ts.map +1 -1
  243. package/dist/src/primitives/otp-field.d.ts +13 -0
  244. package/dist/src/primitives/otp-field.d.ts.map +1 -0
  245. package/dist/styles/kumo-binding.css +18 -0
  246. package/dist/styles/kumo-standalone.css +1 -1
  247. package/dist/styles/kumo.css +2 -2
  248. package/dist/styles/theme-kumo.css +7 -0
  249. package/package.json +14 -2
  250. package/scripts/component-registry/discovery.ts +1 -0
  251. package/scripts/component-registry/index.test.ts +265 -0
  252. package/scripts/component-registry/index.ts +14 -0
  253. package/scripts/component-registry/metadata.ts +55 -7
  254. package/scripts/component-registry/sub-components.ts +81 -50
  255. package/scripts/component-registry/types.ts +2 -0
  256. package/scripts/theme-generator/config.ts +10 -0
  257. package/dist/chunks/Legend-ks7se6149vsa3tze.js +0 -430
  258. package/dist/chunks/Legend-ks7se6149vsa3tze.js.map +0 -1
  259. package/dist/chunks/button-oaqi7ykdisyskoos.js.map +0 -1
  260. package/dist/chunks/checkbox-mwgmohffm22ut13s.js +0 -211
  261. package/dist/chunks/checkbox-mwgmohffm22ut13s.js.map +0 -1
  262. package/dist/chunks/collapsible-jhzee3ks51d3xowb.js +0 -58
  263. package/dist/chunks/collapsible-jhzee3ks51d3xowb.js.map +0 -1
  264. package/dist/chunks/combobox-eaowwt1xr4d23gsn.js.map +0 -1
  265. package/dist/chunks/command-palette-maqtbmpfev9mysqd.js.map +0 -1
  266. package/dist/chunks/dropdown-ewte287db3vyt8t5.js.map +0 -1
  267. package/dist/chunks/input-cw05pbqdburghkus.js.map +0 -1
  268. package/dist/chunks/input-group-lfugneuz71g42n0w.js +0 -111
  269. package/dist/chunks/input-group-lfugneuz71g42n0w.js.map +0 -1
  270. package/dist/chunks/menubar-e5e4zwfagr0wx023.js +0 -96
  271. package/dist/chunks/menubar-e5e4zwfagr0wx023.js.map +0 -1
  272. package/dist/chunks/pagination-olaypvwr8swsmn8m.js.map +0 -1
  273. package/dist/chunks/radio-ihxbe37us2jnqtzf.js.map +0 -1
  274. package/dist/chunks/select-nx6ded5swra74iar.js.map +0 -1
  275. package/dist/chunks/sensitive-input-00fujb510rrn61v9.js.map +0 -1
  276. package/dist/chunks/sidebar-ltbfius1eolkl8tb.js.map +0 -1
  277. package/dist/chunks/switch-fbv3iawqo3o3jgap.js.map +0 -1
  278. package/dist/chunks/table-of-contents-f813ivi7ta23vqdm.js +0 -88
  279. package/dist/chunks/table-of-contents-f813ivi7ta23vqdm.js.map +0 -1
  280. package/dist/chunks/table-olwwulga2l3hdwlx.js.map +0 -1
  281. package/dist/chunks/text-nmyi1rkwdj37f30f.js.map +0 -1
  282. package/dist/chunks/vendor-base-ui-m5pz3e8c4grg5qmj.js +0 -22813
  283. package/dist/chunks/vendor-base-ui-m5pz3e8c4grg5qmj.js.map +0 -1
  284. package/dist/chunks/vendor-floating-ui-gr9m6tsa1cpqwn99.js +0 -1286
  285. package/dist/chunks/vendor-floating-ui-gr9m6tsa1cpqwn99.js.map +0 -1
  286. package/dist/chunks/vendor-utils-fxk97j6xi1g42z2v.js +0 -740
  287. package/dist/chunks/vendor-utils-fxk97j6xi1g42z2v.js.map +0 -1
  288. package/dist/src/components/input/input-group.d.ts +0 -39
  289. package/dist/src/components/input/input-group.d.ts.map +0 -1
@@ -1,430 +0,0 @@
1
- "use client";
2
- import { jsx as f, jsxs as H } from "react/jsx-runtime";
3
- import { forwardRef as Z, useRef as N, useEffect as L, useMemo as z } from "react";
4
- import { c as w } from "./cn-ct4n7r74mh8y0f48.js";
5
- var K = /* @__PURE__ */ ((e) => (e.Attention = "#FC574A", e.Warning = "#F8A054", e.Neutral = "#82B6FF", e.NeutralLight = "#B9D6FF", e.Disabled = "#B6B6B6", e.DisabledLight = "#D9D9D9", e))(K || {}), V = /* @__PURE__ */ ((e) => (e.Attention = "#FC574AE6", e.Warning = "#F8A054E6", e.Neutral = "#82B6FFE6", e.NeutralLight = "#B9D6FFE6", e.Disabled = "#B6B6B6E6", e.DisabledLight = "#D9D9D9E6", e))(V || {});
6
- const C = [
7
- "#086FFF",
8
- "#CF7EE9",
9
- "#73CEE6",
10
- "#5B5FEF",
11
- "#82B6FF",
12
- "#F5609F",
13
- "#C2BDF3",
14
- "#8D1EB1",
15
- "#EBCAF6",
16
- "#7366E4"
17
- /* Indigo2 */
18
- ], G = [
19
- "#086FFFE6",
20
- "#CF7EE9E6",
21
- "#73CEE6E6",
22
- "#5B5FEFE6",
23
- "#82B6FFE6",
24
- "#F5609FE6",
25
- "#C2BDF3E6",
26
- "#8D1EB1E6",
27
- "#EBCAF6E6",
28
- "#7366E4E6"
29
- /* Indigo2 */
30
- ];
31
- var _;
32
- ((e) => {
33
- function n(r, t = !1) {
34
- return t ? V[r] : K[r];
35
- }
36
- e.semantic = n;
37
- function o(r, t = !1) {
38
- return t ? G[r % G.length] : C[r % C.length];
39
- }
40
- e.color = o;
41
- })(_ || (_ = {}));
42
- const k = (e) => {
43
- const { dangerousHtmlFormatter: n, ...o } = e;
44
- return {
45
- ...o,
46
- formatter: n
47
- };
48
- }, ee = (e) => e.tooltip ? {
49
- ...e,
50
- tooltip: Array.isArray(e.tooltip) ? e.tooltip.map(k) : k(e.tooltip)
51
- } : e, Y = Z(function({
52
- echarts: n,
53
- options: o,
54
- optionUpdateBehavior: r,
55
- className: t,
56
- isDarkMode: c,
57
- height: h = 350,
58
- onEvents: p
59
- }, i) {
60
- const u = N(null), b = N(null), y = N({}), F = N({}), E = N(/* @__PURE__ */ new Set());
61
- return L(() => {
62
- if (!u.current) return;
63
- const l = n.init(
64
- u.current,
65
- c ? "dark" : {
66
- color: c ? G : C
67
- }
68
- );
69
- return b.current = l, typeof i == "function" ? i(l) : i && (i.current = l), () => {
70
- for (const d of E.current) {
71
- const s = F.current[d];
72
- s && l.off(d, s);
73
- }
74
- E.current.clear(), typeof i == "function" ? i(null) : i && (i.current = null), b.current = null, l.dispose();
75
- };
76
- }, [u, c]), L(() => {
77
- const l = b.current;
78
- l && l.setOption(ee(o), {
79
- notMerge: !1,
80
- lazyUpdate: !0,
81
- ...r
82
- });
83
- }, [c, r, o]), L(() => {
84
- y.current = p ?? {};
85
- }, [p]), L(() => {
86
- const l = b.current;
87
- if (!l) return;
88
- const d = /* @__PURE__ */ new Set();
89
- for (const [s, m] of Object.entries(p ?? {}))
90
- typeof m == "function" && (d.add(s), F.current[s] || (F.current[s] = (v) => {
91
- y.current[s]?.(v);
92
- }), E.current.has(s) || l.on(s, F.current[s]));
93
- for (const s of E.current) {
94
- if (d.has(s)) continue;
95
- const m = F.current[s];
96
- m && l.off(s, m);
97
- }
98
- E.current = d;
99
- }, [n, c, p]), L(() => {
100
- const l = b.current, d = u.current;
101
- if (!l || !d) return;
102
- let s = !0;
103
- const m = new ResizeObserver(() => {
104
- if (s) {
105
- s = !1;
106
- return;
107
- }
108
- l.resize();
109
- });
110
- return m.observe(d), () => m.disconnect();
111
- }, []), /* @__PURE__ */ f(
112
- "div",
113
- {
114
- ref: u,
115
- className: w("w-full", t),
116
- style: { height: h },
117
- tabIndex: o.aria?.enabled ? 0 : void 0,
118
- role: o.aria?.enabled ? "img" : void 0
119
- }
120
- );
121
- });
122
- Y.displayName = "Chart";
123
- function ce({
124
- echarts: e,
125
- type: n = "line",
126
- data: o,
127
- xAxisName: r,
128
- xAxisTickCount: t,
129
- xAxisTickFormat: c,
130
- yAxisTickFormat: h,
131
- yAxisTickLabelFormat: p,
132
- yAxisName: i,
133
- yAxisTickCount: u,
134
- tooltipValueFormat: b,
135
- onTimeRangeChange: y,
136
- height: F = 350,
137
- incomplete: E,
138
- isDarkMode: l,
139
- gradient: d,
140
- loading: s,
141
- ariaDescription: m
142
- }) {
143
- const v = N(null), I = E?.before, D = E?.after, q = z(() => {
144
- const g = [], S = n === "bar" ? { type: "bar", stack: "total" } : { type: "line", showSymbol: !1 };
145
- for (const a of o) {
146
- const $ = I && n === "line" ? a.data.filter((O) => O[0] <= I) : [], x = D && n === "line" ? a.data.filter((O) => O[0] >= D) : [], T = $.length > 0 || x.length > 0 ? a.data.slice(
147
- Math.max(0, $.length - 1),
148
- Math.max(0, a.data.length - x.length + 1)
149
- ) : a.data, A = d && n === "line" ? {
150
- color: new e.graphic.LinearGradient(0, 0, 0, 1, [
151
- { offset: 0, color: X(a.color, 0.4) },
152
- { offset: 1, color: X(a.color, 0) }
153
- ])
154
- } : void 0;
155
- g.push({
156
- data: T,
157
- color: a.color,
158
- name: a.name,
159
- emphasis: { focus: "series" },
160
- ...A ? { areaStyle: A } : {},
161
- ...S
162
- });
163
- const M = {
164
- color: a.color,
165
- name: a.name,
166
- type: "line",
167
- lineStyle: { type: "dashed" },
168
- showSymbol: !1,
169
- emphasis: { focus: "series" }
170
- };
171
- $.length > 0 && g.push({
172
- ...M,
173
- data: $
174
- }), x.length > 0 && g.push({
175
- ...M,
176
- data: x
177
- });
178
- }
179
- return {
180
- aria: {
181
- enabled: !0,
182
- ...m && { label: { description: m } }
183
- },
184
- brush: {
185
- xAxisIndex: "all",
186
- brushType: "lineX",
187
- brushMode: "single",
188
- outOfBrush: {
189
- colorAlpha: 0.3
190
- },
191
- brushStyle: {
192
- borderWidth: 1,
193
- color: "rgba(120,140,180,0.3)",
194
- borderColor: "rgba(120,140,180,0.8)"
195
- }
196
- },
197
- tooltip: {
198
- trigger: "axis",
199
- appendTo: "body",
200
- axisPointer: { type: "shadow" },
201
- dangerousHtmlFormatter: (a) => {
202
- const $ = Array.isArray(a) ? a : [a], x = /* @__PURE__ */ new Set(), T = $.filter((B) => x.has(B.seriesName) ? !1 : (x.add(B.seriesName), !0)), A = T[0], M = A?.value?.[0] ?? A?.axisValue, O = M != null ? `<div style="font-weight:600;margin-bottom:4px;">${e.format.encodeHTML(ne(M))}</div>` : "", Q = T.map((B) => {
203
- const W = B?.value?.[1], j = b ?? p, U = j ? e.format.encodeHTML(String(j(W))) : e.format.encodeHTML(String(W));
204
- return `${B.marker} ${e.format.encodeHTML(B.seriesName)}: <strong>${U}</strong>`;
205
- }).join("<br/>");
206
- return `${O}${Q}`;
207
- }
208
- },
209
- backgroundColor: "transparent",
210
- toolbox: { show: !1 },
211
- xAxis: {
212
- name: r,
213
- nameLocation: "middle",
214
- nameGap: 30,
215
- type: "time",
216
- splitLine: {
217
- show: !1
218
- },
219
- axisLine: { show: !1 },
220
- splitNumber: t ?? 5,
221
- ...c && {
222
- axisLabel: {
223
- formatter: (a) => c(a)
224
- }
225
- }
226
- },
227
- yAxis: {
228
- name: i,
229
- nameLocation: "middle",
230
- nameGap: 40,
231
- type: "value",
232
- axisTick: { show: !0 },
233
- axisLabel: {
234
- margin: 15,
235
- ...h && {
236
- formatter: (a) => h(a)
237
- }
238
- },
239
- splitLine: {
240
- show: !0,
241
- lineStyle: { type: "dashed", width: 1 }
242
- },
243
- splitNumber: u
244
- },
245
- grid: {
246
- left: i ? 30 : 24,
247
- right: 24,
248
- top: 24,
249
- bottom: r ? 30 : 24
250
- },
251
- series: g
252
- };
253
- }, [
254
- o,
255
- r,
256
- t,
257
- c,
258
- h,
259
- p,
260
- i,
261
- u,
262
- b,
263
- I,
264
- D,
265
- n,
266
- d,
267
- e,
268
- m
269
- ]), J = z(() => y ? {
270
- brushend: (g) => {
271
- const S = g.areas[0].coordRange;
272
- y(S[0], S[1]), v.current?.dispatchAction({ type: "brush", areas: [] });
273
- }
274
- } : {}, [y]), P = !!y;
275
- return L(() => {
276
- const g = v.current;
277
- if (g && P)
278
- return g.dispatchAction({
279
- type: "takeGlobalCursor",
280
- key: "brush",
281
- brushOption: {
282
- brushType: "lineX",
283
- brushMode: "single"
284
- }
285
- }), () => {
286
- g.dispatchAction({
287
- type: "takeGlobalCursor",
288
- key: "brush",
289
- brushOption: {
290
- brushType: !1
291
- }
292
- });
293
- };
294
- }, [v, P, s]), /* @__PURE__ */ H("div", { className: "relative w-full", style: { height: F }, children: [
295
- s && /* @__PURE__ */ f(te, { height: F, isDarkMode: l }),
296
- !s && /* @__PURE__ */ f(
297
- Y,
298
- {
299
- echarts: e,
300
- ref: v,
301
- options: q,
302
- height: F,
303
- isDarkMode: l,
304
- onEvents: J
305
- }
306
- )
307
- ] });
308
- }
309
- function te({
310
- height: e,
311
- isDarkMode: n
312
- }) {
313
- const o = e / 2, r = Math.min(e * 0.12, 28), t = 400, c = 120, h = [];
314
- for (let u = 0; u <= c; u++) {
315
- const b = -t + u / c * t * 3, y = o + Math.sin(u / c * 2 * Math.PI * 3) * r;
316
- h.push(`${u === 0 ? "M" : "L"}${b.toFixed(2)},${y.toFixed(2)}`);
317
- }
318
- const p = h.join(" "), i = n ? "rgba(255,255,255,0.5)" : "rgba(0,0,0,0.2)";
319
- return /* @__PURE__ */ f(
320
- "div",
321
- {
322
- "aria-hidden": "true",
323
- className: "absolute inset-0 overflow-hidden",
324
- style: { height: e },
325
- children: /* @__PURE__ */ f(
326
- "svg",
327
- {
328
- width: "100%",
329
- height: e,
330
- viewBox: `0 0 ${t} ${e}`,
331
- preserveAspectRatio: "none",
332
- className: "w-full animate-pulse",
333
- children: /* @__PURE__ */ f(
334
- "path",
335
- {
336
- d: p,
337
- fill: "none",
338
- stroke: i,
339
- strokeWidth: "2",
340
- style: {
341
- animation: "kumo-chart-wave 2.4s linear infinite",
342
- transformOrigin: "0 0"
343
- }
344
- }
345
- )
346
- }
347
- )
348
- }
349
- );
350
- }
351
- function X(e, n) {
352
- const o = Math.max(0, Math.min(1, n)), r = e.match(
353
- /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
354
- );
355
- if (r)
356
- return `rgba(${r[1]}, ${r[2]}, ${r[3]}, ${o})`;
357
- let t = e.replace(/^#/, "");
358
- t.length === 3 && (t = t[0] + t[0] + t[1] + t[1] + t[2] + t[2]), t.length === 8 && (t = t.slice(0, 6));
359
- const c = parseInt(t.slice(0, 2), 16), h = parseInt(t.slice(2, 4), 16), p = parseInt(t.slice(4, 6), 16);
360
- return `rgba(${c}, ${h}, ${p}, ${o})`;
361
- }
362
- function R(e) {
363
- return e.toString().padStart(2, "0");
364
- }
365
- function ne(e) {
366
- const n = new Date(e);
367
- return `${n.getFullYear()}-${R(n.getMonth() + 1)}-${R(n.getDate())} ${R(n.getHours())}:${R(n.getMinutes())}:${R(n.getSeconds())}`;
368
- }
369
- function re({ color: e, value: n, name: o, unit: r, inactive: t }) {
370
- return /* @__PURE__ */ H("div", { className: "inline-flex flex-col gap-2 min-w-42 py-2", children: [
371
- /* @__PURE__ */ H("div", { className: "flex items-center gap-2", children: [
372
- /* @__PURE__ */ f(
373
- "span",
374
- {
375
- className: w("size-2 rounded-full inline-block", {
376
- "opacity-50": t
377
- }),
378
- style: { backgroundColor: e }
379
- }
380
- ),
381
- /* @__PURE__ */ f("span", { className: w("text-xs", { "opacity-50": t }), children: o })
382
- ] }),
383
- /* @__PURE__ */ H("div", { className: "flex items-baseline gap-0.5", children: [
384
- /* @__PURE__ */ f(
385
- "span",
386
- {
387
- className: w("text-lg font-medium leading-none", {
388
- "opacity-50": t
389
- }),
390
- children: n
391
- }
392
- ),
393
- r && /* @__PURE__ */ f(
394
- "span",
395
- {
396
- className: w("text-xs text-kumo-subtle leading-none", {
397
- "opacity-50": t
398
- }),
399
- children: r
400
- }
401
- )
402
- ] })
403
- ] });
404
- }
405
- function se({ color: e, value: n, name: o, inactive: r }) {
406
- return /* @__PURE__ */ H("div", { className: "inline-flex items-center gap-2", children: [
407
- /* @__PURE__ */ f(
408
- "span",
409
- {
410
- className: w("size-2 rounded-full inline-block", {
411
- "opacity-50": r
412
- }),
413
- style: { backgroundColor: e }
414
- }
415
- ),
416
- /* @__PURE__ */ f("span", { className: w("text-xs", { "opacity-50": r }), children: o }),
417
- /* @__PURE__ */ f("span", { className: w("text-xs font-medium", { "opacity-50": r }), children: n })
418
- ] });
419
- }
420
- const ie = {
421
- SmallItem: se,
422
- LargeItem: re
423
- };
424
- export {
425
- Y as C,
426
- ce as T,
427
- ie as a,
428
- _ as b
429
- };
430
- //# sourceMappingURL=Legend-ks7se6149vsa3tze.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Legend-ks7se6149vsa3tze.js","sources":["../../src/components/chart/Color.ts","../../src/components/chart/EChart.tsx","../../src/components/chart/TimeseriesChart.tsx","../../src/components/chart/Legend.tsx"],"sourcesContent":["/**\n * Categorical colors for light mode — used when assigning colors to data series\n * by index (e.g. the first series gets Blue, the second gets Violet, etc.).\n */\nenum ChartCategoricalLightColors {\n Blue = \"#086FFF\",\n Violet = \"#CF7EE9\",\n Cyan = \"#73CEE6\",\n Indigo = \"#5B5FEF\",\n LightBlue = \"#82B6FF\",\n Pink = \"#F5609F\",\n Indigo3 = \"#C2BDF3\",\n Violet2 = \"#8D1EB1\",\n Violet3 = \"#EBCAF6\",\n Indigo2 = \"#7366E4\",\n}\n\n/**\n * Categorical colors for dark mode — same hues as the light palette but with\n * `E6` alpha (90% opacity) appended to soften contrast on dark backgrounds.\n */\nenum ChartCategoricalDarkColors {\n Blue = \"#086FFFE6\",\n Violet = \"#CF7EE9E6\",\n Cyan = \"#73CEE6E6\",\n Indigo = \"#5B5FEFE6\",\n LightBlue = \"#82B6FFE6\",\n Pink = \"#F5609FE6\",\n Indigo3 = \"#C2BDF3E6\",\n Violet2 = \"#8D1EB1E6\",\n Violet3 = \"#EBCAF6E6\",\n Indigo2 = \"#7366E4E6\",\n}\n\n/**\n * Semantic colors for light mode — used to convey meaning (status, severity)\n * rather than just distinguishing series. Use via `ChartPalette.semantic()`.\n */\nenum ChartSemanticLightColors {\n Attention = \"#FC574A\",\n Warning = \"#F8A054\",\n Neutral = \"#82B6FF\",\n NeutralLight = \"#B9D6FF\",\n Disabled = \"#B6B6B6\",\n DisabledLight = \"#D9D9D9\",\n}\n\n/**\n * Semantic colors for dark mode — same meanings as the light palette but with\n * `E6` alpha (90% opacity) for dark backgrounds.\n */\nenum ChartSemanticDarkColors {\n Attention = \"#FC574AE6\",\n Warning = \"#F8A054E6\",\n Neutral = \"#82B6FFE6\",\n NeutralLight = \"#B9D6FFE6\",\n Disabled = \"#B6B6B6E6\",\n DisabledLight = \"#D9D9D9E6\",\n}\n\n/**\n * Ordered list of categorical colors for light mode, indexed by series position.\n * Used as the default ECharts color palette when `isDarkMode` is `false`.\n */\nexport const CHART_LIGHT_COLORS = [\n ChartCategoricalLightColors.Blue,\n ChartCategoricalLightColors.Violet,\n ChartCategoricalLightColors.Cyan,\n ChartCategoricalLightColors.Indigo,\n ChartCategoricalLightColors.LightBlue,\n ChartCategoricalLightColors.Pink,\n ChartCategoricalLightColors.Indigo3,\n ChartCategoricalLightColors.Violet2,\n ChartCategoricalLightColors.Violet3,\n ChartCategoricalLightColors.Indigo2,\n];\n\n/**\n * Ordered list of categorical colors for dark mode, indexed by series position.\n * Used as the default ECharts color palette when `isDarkMode` is `true`.\n */\nexport const CHART_DARK_COLORS = [\n ChartCategoricalDarkColors.Blue,\n ChartCategoricalDarkColors.Violet,\n ChartCategoricalDarkColors.Cyan,\n ChartCategoricalDarkColors.Indigo,\n ChartCategoricalDarkColors.LightBlue,\n ChartCategoricalDarkColors.Pink,\n ChartCategoricalDarkColors.Indigo3,\n ChartCategoricalDarkColors.Violet2,\n ChartCategoricalDarkColors.Violet3,\n ChartCategoricalDarkColors.Indigo2,\n];\n\n/**\n * Utilities for resolving Kumo chart colors by semantic name or series index.\n * Both functions accept an `isDarkMode` flag and return the appropriate hex color.\n */\nexport namespace ChartPalette {\n /**\n * Returns the hex color for a named semantic value (status, severity, etc.).\n *\n * @example\n * ```ts\n * ChartPalette.semantic(\"Attention\") // \"#FC574A\" (light)\n * ChartPalette.semantic(\"Warning\", true) // \"#F8A054E6\" (dark)\n * ```\n */\n export function semantic(\n name:\n | \"Attention\"\n | \"Warning\"\n | \"Neutral\"\n | \"NeutralLight\"\n | \"Disabled\"\n | \"DisabledLight\",\n isDarkMode = false,\n ) {\n return isDarkMode\n ? ChartSemanticDarkColors[name]\n : ChartSemanticLightColors[name];\n }\n\n /**\n * Returns the categorical color for a given series index.\n * Wraps around via modulo when `index` exceeds the palette length (10 colors).\n *\n * @example\n * ```ts\n * ChartPalette.color(0) // Blue (light)\n * ChartPalette.color(0, true) // Blue with E6 alpha (dark)\n * ChartPalette.color(10) // wraps back to Blue\n * ```\n */\n export function color(index: number, isDarkMode = false) {\n return isDarkMode\n ? CHART_DARK_COLORS[index % CHART_DARK_COLORS.length]\n : CHART_LIGHT_COLORS[index % CHART_LIGHT_COLORS.length];\n }\n}\n","import type * as echarts from \"echarts/core\";\nimport type {\n EChartsOption,\n SetOptionOpts,\n TooltipComponentOption,\n} from \"echarts\";\nimport { forwardRef, useEffect, useRef } from \"react\";\nimport { cn } from \"../../utils\";\nimport { CHART_DARK_COLORS, CHART_LIGHT_COLORS } from \"./Color\";\n\n/** Parameters passed to mouse event handlers on chart elements */\ntype EChartsMouseEventParams = {\n /** The type of component that triggered the event (e.g. \"series\", \"markPoint\") */\n componentType: string;\n /** Series type (e.g. \"line\", \"bar\") — present when componentType is \"series\" */\n seriesType?: string;\n /** Zero-based index of the series in the option.series array */\n seriesIndex?: number;\n /** Name of the series */\n seriesName?: string;\n /** Name of the data item */\n name?: string;\n /** Zero-based index of the data item within its series */\n dataIndex?: number;\n /** Raw data item value */\n data?: any;\n /** Sub-type of data (e.g. \"node\", \"edge\" for graph series) */\n dataType?: string;\n /** Numeric or array value of the data item */\n value?: number | any[];\n /** Resolved color of the series or data item */\n color?: string;\n};\n\n/**\n * Tooltip options with the `formatter` property removed and replaced with\n * `dangerousHtmlFormatter` to make the security implications more explicit.\n */\nexport type SafeTooltipOption = Omit<TooltipComponentOption, \"formatter\"> & {\n /**\n * USE WITH CAUTION: Use this only for trusted HTML content.\n * When building tooltip HTML with user-provided data, always sanitize\n * the input to prevent XSS vulnerabilities. Recommended: use\n * `encodeHTML` from `echarts/format` to escape HTML special characters.\n */\n dangerousHtmlFormatter?: TooltipComponentOption[\"formatter\"];\n};\n\nexport type KumoChartOption = {\n [K in keyof EChartsOption]: K extends \"tooltip\"\n ? SafeTooltipOption | SafeTooltipOption[] | undefined\n : EChartsOption[K];\n};\n\n/**\n * ECharts event handlers that can be attached to a `Chart`.\n * Pass a subset via the `onEvents` prop; handlers are registered lazily and\n * cleaned up automatically when removed or when the chart is unmounted.\n */\nexport interface ChartEvents {\n // Mouse events — fired on chart elements (series, marks, etc.)\n click: (params: EChartsMouseEventParams) => void;\n dblclick: (params: EChartsMouseEventParams) => void;\n mousedown: (params: EChartsMouseEventParams) => void;\n mousemove: (params: EChartsMouseEventParams) => void;\n mouseup: (params: EChartsMouseEventParams) => void;\n mouseover: (params: EChartsMouseEventParams) => void;\n mouseout: (params: EChartsMouseEventParams) => void;\n /** Fired when the pointer leaves the chart canvas entirely */\n globalout: (params: any) => void;\n contextmenu: (params: any) => void;\n\n // Legend events\n /** Fired when any legend item's selected state changes */\n legendselectchanged: (params: {\n name: string;\n /** Map of series name → selected state for all legend items */\n selected: Record<string, boolean>;\n }) => void;\n legendselected: (params: any) => void;\n legendunselected: (params: any) => void;\n legendscroll: (params: any) => void;\n\n // Data zoom / timeline events\n datazoom: (params: any) => void;\n datarangeselected: (params: any) => void;\n timelinechanged: (params: any) => void;\n timelineplaychanged: (params: any) => void;\n\n // Toolbox events\n restore: (params: any) => void;\n dataviewchanged: (params: any) => void;\n magictypechanged: (params: any) => void;\n\n // Pie chart selection events\n pieselectchanged: (params: any) => void;\n pieselected: (params: any) => void;\n pieunselected: (params: any) => void;\n\n // Map / geo selection events\n mapselectchanged: (params: any) => void;\n mapselected: (params: any) => void;\n mapunselected: (params: any) => void;\n geoselectchanged: (params: any) => void;\n geoselected: (params: any) => void;\n geounselected: (params: any) => void;\n\n axisareaselected: (params: any) => void;\n\n // Brush / selection events\n brush: (params: any) => void;\n brushselected: (params: any) => void;\n /** Fired when the user finishes drawing a brush selection */\n brushend: (params: {\n areas: Array<{\n /** Coordinate range covered by the brush — interpretation depends on axis type */\n coordRange: any;\n brushType?: string;\n panelId?: string;\n range?: any;\n }>;\n }) => void;\n}\n\n/** Props for the low-level `Chart` wrapper around Apache ECharts */\nexport interface ChartProps {\n /**\n * The ECharts core instance imported by the consumer.\n * Passed in rather than imported directly so the consumer controls which\n * ECharts modules are bundled (tree-shaking).\n */\n echarts: typeof echarts;\n /** ECharts option object — passed through to `chart.setOption()` */\n options: KumoChartOption;\n /**\n * Additional options passed as the second argument to `chart.setOption()`.\n * Defaults to `{ notMerge: false, lazyUpdate: true }`.\n */\n optionUpdateBehavior?: SetOptionOpts;\n /** Additional CSS classes applied to the chart container `<div>` */\n className?: string;\n /**\n * When `true`, initialises ECharts with its built-in dark theme.\n * Changing this value after mount destroys and re-creates the chart instance.\n */\n isDarkMode?: boolean;\n /** Height of the chart container in pixels. Defaults to `350`. */\n height?: number;\n /** Subset of ECharts events to listen for. Handlers are bound/unbound reactively. */\n onEvents?: Partial<ChartEvents>;\n}\n\nconst transformTooltip = (tooltipObj: SafeTooltipOption) => {\n const { dangerousHtmlFormatter, ...restOfTooltip } = tooltipObj;\n return {\n ...restOfTooltip,\n formatter: dangerousHtmlFormatter,\n };\n};\n\nconst prepareChartOptions = (options: KumoChartOption): EChartsOption => {\n if (!options.tooltip) return options;\n\n return {\n ...options,\n tooltip: Array.isArray(options.tooltip)\n ? options.tooltip.map(transformTooltip)\n : transformTooltip(options.tooltip),\n };\n};\n\n/**\n * Chart — a low-level wrapper around [Apache ECharts](https://echarts.apache.org).\n *\n * Manages the ECharts instance lifecycle (init, option updates, event binding,\n * resize observation, and disposal). Exposes the raw `echarts.ECharts` instance\n * via `ref` for imperative access when needed.\n *\n * Prefer `TimeseriesChart` for time-series data; use this component when you\n * need full control over the ECharts option object.\n *\n * @example\n * ```tsx\n * import * as echarts from \"echarts/core\";\n * import { BarChart } from \"echarts/charts\";\n * import { GridComponent } from \"echarts/components\";\n * import { CanvasRenderer } from \"echarts/renderers\";\n *\n * echarts.use([BarChart, GridComponent, CanvasRenderer]);\n *\n * <Chart\n * echarts={echarts}\n * options={{ xAxis: { data: [\"A\", \"B\"] }, yAxis: {}, series: [{ type: \"bar\", data: [1, 2] }] }}\n * />\n * ```\n */\nexport const Chart = forwardRef<echarts.ECharts, ChartProps>(function Chart(\n {\n echarts,\n options,\n optionUpdateBehavior,\n className,\n isDarkMode,\n height = 350,\n onEvents,\n }: ChartProps,\n ref,\n) {\n // Ref to the container DOM node that ECharts renders into\n const elRef = useRef<HTMLDivElement | null>(null);\n // Ref to the active ECharts instance\n const chartRef = useRef<echarts.ECharts | null>(null);\n // Keeps the latest onEvents object without triggering re-binding on every render\n const handlersRef = useRef<Partial<ChartEvents>>({});\n // Stable wrapper functions per event name — avoids creating new closures on re-render\n const wrappersRef = useRef<Record<string, (params: any) => void>>({});\n // Tracks which event names are currently bound to the chart instance\n const boundEventsRef = useRef<Set<string>>(new Set());\n\n // Init and cleanup\n useEffect(() => {\n if (!elRef.current) return;\n\n const chart = echarts.init(\n elRef.current,\n isDarkMode\n ? \"dark\"\n : {\n color: isDarkMode ? CHART_DARK_COLORS : CHART_LIGHT_COLORS,\n },\n );\n chartRef.current = chart;\n\n if (typeof ref === \"function\") ref(chart);\n else if (ref) ref.current = chart;\n\n return () => {\n for (const event of boundEventsRef.current) {\n const wrapper = wrappersRef.current[event];\n if (wrapper) chart.off(event, wrapper);\n }\n boundEventsRef.current.clear();\n if (typeof ref === \"function\") ref(null);\n else if (ref) ref.current = null;\n chartRef.current = null;\n chart.dispose();\n };\n }, [elRef, isDarkMode]);\n\n // Update options\n useEffect(() => {\n const chart = chartRef.current;\n if (!chart) return;\n\n chart.setOption(prepareChartOptions(options), {\n notMerge: false,\n lazyUpdate: true,\n ...optionUpdateBehavior,\n });\n }, [isDarkMode, optionUpdateBehavior, options]);\n\n // Keep handlersRef in sync so wrapper closures always call the latest handler\n // without needing to re-bind listeners on every render\n useEffect(() => {\n handlersRef.current = onEvents ?? {};\n }, [onEvents]);\n\n // Reactively bind and unbind event listeners when onEvents changes.\n // Uses stable wrapper functions (wrappersRef) so the same function reference\n // is passed to both chart.on() and chart.off(), which ECharts requires.\n useEffect(() => {\n const chart = chartRef.current;\n if (!chart) return;\n\n const nextBound = new Set<string>();\n\n for (const [event, handler] of Object.entries(onEvents ?? {})) {\n if (typeof handler !== \"function\") continue;\n nextBound.add(event);\n\n if (!wrappersRef.current[event]) {\n wrappersRef.current[event] = (params: any) => {\n const current = handlersRef.current as Record<\n string,\n ((p: any) => void) | undefined\n >;\n current[event]?.(params);\n };\n }\n\n if (!boundEventsRef.current.has(event)) {\n chart.on(event, wrappersRef.current[event]);\n }\n }\n\n for (const event of boundEventsRef.current) {\n if (nextBound.has(event)) continue;\n const wrapper = wrappersRef.current[event];\n if (wrapper) {\n chart.off(event, wrapper);\n }\n }\n\n boundEventsRef.current = nextBound;\n }, [echarts, isDarkMode, onEvents]);\n\n // Resize handling\n useEffect(() => {\n const chart = chartRef.current;\n const el = elRef.current;\n if (!chart || !el) return;\n\n // Flag to skip the very first trigger\n let isInitial = true;\n\n const ro = new ResizeObserver(() => {\n if (isInitial) {\n isInitial = false;\n return; // Skip the first resize to let the animation play\n }\n chart.resize();\n });\n\n ro.observe(el);\n\n return () => ro.disconnect();\n }, []);\n\n return (\n <div\n ref={elRef}\n className={cn(\"w-full\", className)}\n style={{ height }}\n tabIndex={options.aria?.enabled ? 0 : undefined}\n role={options.aria?.enabled ? \"img\" : undefined}\n />\n );\n});\n\nChart.displayName = \"Chart\";\n","import type * as echarts from \"echarts/core\";\nimport type { LineSeriesOption, BarSeriesOption } from \"echarts/charts\";\nimport type { EChartsOption, SeriesOption } from \"echarts\";\nimport { useEffect, useMemo, useRef } from \"react\";\nimport { Chart, ChartEvents, KumoChartOption } from \"./EChart\";\n\n/** A single data series rendered on a `TimeseriesChart` */\nexport interface TimeseriesData {\n /** Display name shown in tooltips and legends */\n name: string;\n /** Array of `[timestamp_ms, value]` tuples ordered by time */\n data: [number, number][];\n /** Hex color string used for this series' line, bars, and legend dot */\n color: string;\n}\n\n/** Props for `TimeseriesChart` */\nexport interface TimeseriesChartProps {\n /**\n * The ECharts core instance imported by the consumer.\n * Passed in rather than imported directly so the consumer controls which\n * ECharts modules are bundled (tree-shaking).\n */\n echarts: typeof echarts;\n /** Visual style of each series. Defaults to `\"line\"`. */\n type?: \"line\" | \"bar\";\n /** Array of time series data to display on the chart */\n data: TimeseriesData[];\n /** Label for the x-axis (time axis) */\n xAxisName?: string;\n /** Number of ticks to display on the x-axis */\n xAxisTickCount?: number;\n /**\n * Custom formatter for x-axis tick labels.\n * Receives the raw timestamp in milliseconds and returns a display string,\n * overriding ECharts' built-in time formatting.\n */\n xAxisTickFormat?: (value: number) => string;\n /**\n * Custom formatter for y-axis tick labels.\n * Receives the raw value and returns a display string.\n * When omitted, ECharts' built-in formatter is used.\n */\n yAxisTickFormat?: (value: number) => string;\n /**\n * @deprecated Use `tooltipValueFormat` instead. This prop formats tooltip\n * values, not y-axis tick labels. It will be removed in a future major version.\n */\n yAxisTickLabelFormat?: (value: number) => string;\n /** Label for the y-axis (value axis) */\n yAxisName?: string;\n /** Number of ticks to display on the y-axis */\n yAxisTickCount?: number;\n /**\n * Custom formatter for tooltip values.\n * Receives the raw y-value and returns a display string.\n * When omitted, the raw value is shown. Takes precedence over the\n * deprecated `yAxisTickLabelFormat` prop.\n */\n tooltipValueFormat?: (value: number) => string;\n /** Indicates incomplete data periods with optional before/after timestamps in ms */\n incomplete?: { before?: number; after?: number };\n /** Height of the chart in pixels. Defaults to `350`. */\n height?: number;\n /** Callback fired when user selects a time range via brush selection */\n onTimeRangeChange?: (from: number, to: number) => void;\n /** When `true`, switches the chart to ECharts' built-in dark theme */\n isDarkMode?: boolean;\n /**\n * When `true`, renders a vertical gradient fill beneath each line series.\n * The gradient fades from the series' color at the top to transparent at the bottom.\n * Has no effect when `type` is `\"bar\"`.\n */\n gradient?: boolean;\n /**\n * When `true`, hides the chart and displays an animated sine-wave skeleton\n * that oscillates back and forth to indicate that data is being fetched.\n */\n loading?: boolean;\n /**\n * Accessible description for screen readers. When provided, it is passed to\n * ECharts' `aria.label.description` and announced when the chart receives\n * focus. Consumers are responsible for writing a meaningful description —\n * see the W3C guidance on complex images for recommendations.\n *\n * @see https://www.w3.org/WAI/tutorials/images/complex/\n * @see https://echarts.apache.org/handbook/en/best-practices/aria/\n */\n ariaDescription?: string;\n}\n\n/**\n * TimeseriesChart — a time-series line or bar chart.\n *\n * Built on `Chart` (Apache ECharts) with opinionated defaults for time-series data:\n * a time-typed x-axis, dashed lines for incomplete data periods, brush-based\n * time range selection, and automatic tooltip deduplication.\n *\n * @example\n * ```tsx\n * import * as echarts from \"echarts/core\";\n * import { LineChart } from \"echarts/charts\";\n * import { GridComponent, TooltipComponent, BrushComponent, ToolboxComponent } from \"echarts/components\";\n * import { CanvasRenderer } from \"echarts/renderers\";\n *\n * echarts.use([LineChart, GridComponent, TooltipComponent, BrushComponent, ToolboxComponent, CanvasRenderer]);\n *\n * const [range, setRange] = useState<[number, number]>();\n *\n * <TimeseriesChart\n * echarts={echarts}\n * data={[{ name: \"Requests\", data: [[Date.now(), 42]], color: \"#086FFF\" }]}\n * xAxisName=\"Time\"\n * xAxisTickFormat={(ts) => new Date(ts).toLocaleTimeString()}\n * yAxisName=\"Count\"\n * yAxisTickFormat={(value) => `${value / 1000}k`}\n * tooltipValueFormat={(value) => `${value.toFixed(2)} req/s`}\n * onTimeRangeChange={(from, to) => setRange([from, to])}\n * />\n * ```\n */\nexport function TimeseriesChart({\n echarts,\n type = \"line\",\n data,\n xAxisName,\n xAxisTickCount,\n xAxisTickFormat,\n yAxisTickFormat,\n yAxisTickLabelFormat,\n yAxisName,\n yAxisTickCount,\n tooltipValueFormat,\n onTimeRangeChange,\n height = 350,\n incomplete,\n isDarkMode,\n gradient,\n loading,\n ariaDescription,\n}: TimeseriesChartProps) {\n const chartRef = useRef<echarts.ECharts | null>(null);\n const incompleteBefore = incomplete?.before;\n const incompleteAfter = incomplete?.after;\n\n const options = useMemo(() => {\n const transformSeries: Array<LineSeriesOption | BarSeriesOption> = [];\n\n const seriesType =\n type === \"bar\"\n ? ({ type: \"bar\", stack: \"total\" } as const)\n : ({ type: \"line\", showSymbol: false } as const);\n\n for (const s of data) {\n const incompleteBeforePoints =\n incompleteBefore && type === \"line\"\n ? s.data.filter((point) => point[0] <= incompleteBefore)\n : [];\n\n const incompleteAfterPoints =\n incompleteAfter && type === \"line\"\n ? s.data.filter((point) => point[0] >= incompleteAfter)\n : [];\n\n const completePoints =\n incompleteBeforePoints.length > 0 || incompleteAfterPoints.length > 0\n ? s.data.slice(\n Math.max(0, incompleteBeforePoints.length - 1),\n Math.max(0, s.data.length - incompleteAfterPoints.length + 1),\n )\n : s.data;\n\n // Main complete data series\n const areaStyle =\n gradient && type === \"line\"\n ? {\n color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [\n { offset: 0, color: colorWithOpacity(s.color, 0.4) },\n { offset: 1, color: colorWithOpacity(s.color, 0) },\n ]),\n }\n : undefined;\n\n transformSeries.push({\n data: completePoints,\n color: s.color,\n name: s.name,\n emphasis: { focus: \"series\" },\n ...(areaStyle ? { areaStyle } : {}),\n ...seriesType,\n });\n\n // Incomplete data series with dashed lines\n const incompleteSeriesConfig = {\n color: s.color,\n name: s.name,\n type: \"line\" as const,\n lineStyle: { type: \"dashed\" as const },\n showSymbol: false,\n emphasis: { focus: \"series\" as const },\n };\n\n if (incompleteBeforePoints.length > 0) {\n transformSeries.push({\n ...incompleteSeriesConfig,\n data: incompleteBeforePoints,\n });\n }\n\n if (incompleteAfterPoints.length > 0) {\n transformSeries.push({\n ...incompleteSeriesConfig,\n data: incompleteAfterPoints,\n });\n }\n }\n\n return {\n aria: {\n enabled: true,\n ...(ariaDescription && { label: { description: ariaDescription } }),\n },\n brush: {\n xAxisIndex: \"all\" as const,\n brushType: \"lineX\" as const,\n brushMode: \"single\" as const,\n outOfBrush: {\n colorAlpha: 0.3,\n },\n brushStyle: {\n borderWidth: 1,\n color: \"rgba(120,140,180,0.3)\",\n borderColor: \"rgba(120,140,180,0.8)\",\n },\n },\n tooltip: {\n trigger: \"axis\" as const,\n appendTo: \"body\",\n axisPointer: { type: \"shadow\" as const },\n dangerousHtmlFormatter: (params) => {\n const items = Array.isArray(params) ? params : [params];\n\n // Track seen series names to avoid duplicates in tooltip\n // This is needed because incomplete data series (dashed lines) and complete data series\n // can overlap at the same timestamp, causing duplicate entries in the tooltip\n const seenNames = new Set<string>();\n const filteredParams = items.filter((param: any) => {\n if (seenNames.has(param.seriesName)) return false;\n seenNames.add(param.seriesName);\n return true;\n });\n\n const first = filteredParams[0] as {\n value?: [number, number];\n axisValue?: number;\n };\n\n const ts = first?.value?.[0] ?? first?.axisValue;\n\n const header =\n ts != null\n ? `<div style=\"font-weight:600;margin-bottom:4px;\">${echarts.format.encodeHTML(formatTimestamp(ts))}</div>`\n : \"\";\n\n const rows = filteredParams\n .map((param: any) => {\n const value = param?.value?.[1];\n const formatFn = tooltipValueFormat ?? yAxisTickLabelFormat;\n const formattedValue = formatFn\n ? echarts.format.encodeHTML(String(formatFn(value)))\n : echarts.format.encodeHTML(String(value));\n\n return `${param.marker} ${echarts.format.encodeHTML(param.seriesName)}: <strong>${formattedValue}</strong>`;\n })\n .join(\"<br/>\");\n\n return `${header}${rows}`;\n },\n },\n backgroundColor: \"transparent\",\n toolbox: { show: false },\n xAxis: {\n name: xAxisName,\n nameLocation: \"middle\" as const,\n nameGap: 30,\n type: \"time\" as const,\n splitLine: {\n show: false,\n },\n axisLine: { show: false },\n splitNumber: xAxisTickCount ?? 5,\n ...(xAxisTickFormat && {\n axisLabel: {\n formatter: (value: number) => xAxisTickFormat(value),\n },\n }),\n },\n yAxis: {\n name: yAxisName,\n nameLocation: \"middle\" as const,\n nameGap: 40,\n type: \"value\" as const,\n axisTick: { show: true },\n axisLabel: {\n margin: 15,\n ...(yAxisTickFormat && {\n formatter: (value: number) => yAxisTickFormat(value),\n }),\n },\n splitLine: {\n show: true,\n lineStyle: { type: \"dashed\" as const, width: 1 },\n },\n splitNumber: yAxisTickCount,\n },\n grid: {\n left: yAxisName ? 30 : 24,\n right: 24,\n top: 24,\n bottom: xAxisName ? 30 : 24,\n },\n series: transformSeries as SeriesOption[],\n } satisfies KumoChartOption;\n }, [\n data,\n xAxisName,\n xAxisTickCount,\n xAxisTickFormat,\n yAxisTickFormat,\n yAxisTickLabelFormat,\n yAxisName,\n yAxisTickCount,\n tooltipValueFormat,\n incompleteBefore,\n incompleteAfter,\n type,\n gradient,\n echarts,\n ariaDescription,\n ]);\n\n const events = useMemo<Partial<ChartEvents>>(() => {\n if (!onTimeRangeChange) return {};\n\n return {\n brushend: (params) => {\n const range = params.areas[0].coordRange;\n onTimeRangeChange(range[0], range[1]);\n chartRef.current?.dispatchAction({ type: \"brush\", areas: [] });\n },\n };\n }, [onTimeRangeChange]);\n\n // Activate the lineX brush cursor when a time-range callback is provided,\n // and deactivate it on cleanup so the cursor resets when the prop is removed.\n const hasTimeRangeCallback = !!onTimeRangeChange;\n useEffect(() => {\n const chart = chartRef.current;\n if (chart && hasTimeRangeCallback) {\n chart.dispatchAction({\n type: \"takeGlobalCursor\",\n key: \"brush\",\n brushOption: {\n brushType: \"lineX\" as const,\n brushMode: \"single\" as const,\n },\n });\n\n return () => {\n chart.dispatchAction({\n type: \"takeGlobalCursor\",\n key: \"brush\",\n brushOption: {\n brushType: false,\n },\n });\n };\n }\n // `loading` controls whether <Chart> is mounted. When it flips to false,\n // chartRef.current becomes available and the brush cursor must be activated.\n // Without this dep, the effect won't re-run after Chart mounts.\n }, [chartRef, hasTimeRangeCallback, loading]);\n\n return (\n <div className=\"relative w-full\" style={{ height }}>\n {loading && <ChartWaveLoader height={height} isDarkMode={isDarkMode} />}\n {!loading && (\n <Chart\n echarts={echarts}\n ref={chartRef}\n options={options as EChartsOption}\n height={height}\n isDarkMode={isDarkMode}\n onEvents={events}\n />\n )}\n </div>\n );\n}\n\n/**\n * Animated sine-wave skeleton shown while `TimeseriesChart` is in `loading` state.\n * Renders multiple staggered wave paths that sweep continuously left-to-right,\n * mimicking the motion of live time-series data being drawn.\n */\nfunction ChartWaveLoader({\n height,\n isDarkMode,\n}: {\n height: number;\n isDarkMode?: boolean;\n}) {\n const mid = height / 2;\n const amp = Math.min(height * 0.12, 28);\n const period = 400;\n const steps = 120;\n\n const points: string[] = [];\n for (let i = 0; i <= steps; i++) {\n const x = -period + (i / steps) * period * 3;\n const y = mid + Math.sin((i / steps) * 2 * Math.PI * 3) * amp;\n points.push(`${i === 0 ? \"M\" : \"L\"}${x.toFixed(2)},${y.toFixed(2)}`);\n }\n const d = points.join(\" \");\n\n const strokeColor = isDarkMode ? \"rgba(255,255,255,0.5)\" : \"rgba(0,0,0,0.2)\";\n\n return (\n <div\n aria-hidden=\"true\"\n className=\"absolute inset-0 overflow-hidden\"\n style={{ height }}\n >\n <svg\n width=\"100%\"\n height={height}\n viewBox={`0 0 ${period} ${height}`}\n preserveAspectRatio=\"none\"\n className=\"w-full animate-pulse\"\n >\n <path\n d={d}\n fill=\"none\"\n stroke={strokeColor}\n strokeWidth=\"2\"\n style={{\n animation: `kumo-chart-wave 2.4s linear infinite`,\n transformOrigin: \"0 0\",\n }}\n />\n </svg>\n </div>\n );\n}\n\n/**\n * Returns an `rgba(r, g, b, alpha)` string for any hex or rgb(a) color input,\n * replacing whatever opacity was already present with the given `alpha` (0–1).\n *\n * Handles:\n * - 6-digit hex: `#RRGGBB`\n * - 8-digit hex: `#RRGGBBAA` ← strips existing alpha\n * - 3-digit hex: `#RGB`\n * - `rgb(r, g, b)`\n * - `rgba(r, g, b, a)` ← replaces existing alpha\n */\nfunction colorWithOpacity(color: string, alpha: number): string {\n const a = Math.max(0, Math.min(1, alpha));\n\n // rgb / rgba\n const rgbMatch = color.match(\n /rgba?\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)/i,\n );\n if (rgbMatch) {\n return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${a})`;\n }\n\n // hex — strip leading #\n let hex = color.replace(/^#/, \"\");\n\n // expand 3-digit → 6-digit\n if (hex.length === 3) {\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n }\n\n // strip 8-digit alpha → keep only 6\n if (hex.length === 8) {\n hex = hex.slice(0, 6);\n }\n\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n}\n\n/** Zero-pads a number to two digits (e.g. `5` → `\"05\"`) */\nfunction pad(n: number) {\n return n.toString().padStart(2, \"0\");\n}\n\n/**\n * Formats a timestamp as `\"YYYY-MM-DD HH:mm:ss\"` for use in chart tooltips.\n * Accepts a Unix timestamp in milliseconds, an ISO date string, or a `Date` object.\n */\nfunction formatTimestamp(ts: number | string | Date): string {\n const d = new Date(ts);\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;\n}\n","import { cn } from \"../../utils\";\n\n/** Shared props for both legend item variants */\ninterface LegendItemProps {\n /** Series name shown as a label */\n name: string;\n /** Hex color string for the series indicator dot */\n color: string;\n /** Formatted value string to display */\n value: string;\n /** Optional unit label shown after the value (e.g. `\"ms\"`, `\"%\"`) */\n unit?: string;\n /** When `true`, renders the item at 50% opacity to indicate a deselected state */\n inactive?: boolean;\n}\n\n/**\n * Large legend item — stacked layout with a colored dot + series name on top\n * and a large value with an optional small unit below. Use for prominent\n * single-metric displays such as dashboard cards.\n */\nfunction LargeItem({ color, value, name, unit, inactive }: LegendItemProps) {\n return (\n <div className=\"inline-flex flex-col gap-2 min-w-42 py-2\">\n <div className=\"flex items-center gap-2\">\n <span\n className={cn(\"size-2 rounded-full inline-block\", {\n \"opacity-50\": inactive,\n })}\n style={{ backgroundColor: color }}\n />\n <span className={cn(\"text-xs\", { \"opacity-50\": inactive })}>\n {name}\n </span>\n </div>\n <div className=\"flex items-baseline gap-0.5\">\n <span\n className={cn(\"text-lg font-medium leading-none\", {\n \"opacity-50\": inactive,\n })}\n >\n {value}\n </span>\n {unit && (\n <span\n className={cn(\"text-xs text-kumo-subtle leading-none\", {\n \"opacity-50\": inactive,\n })}\n >\n {unit}\n </span>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Small legend item — inline layout with a colored dot, series name, and value\n * on a single row. Use for compact legends below or beside a chart.\n */\nfunction SmallItem({ color, value, name, inactive }: LegendItemProps) {\n return (\n <div className=\"inline-flex items-center gap-2\">\n <span\n className={cn(\"size-2 rounded-full inline-block\", {\n \"opacity-50\": inactive,\n })}\n style={{ backgroundColor: color }}\n />\n <span className={cn(\"text-xs\", { \"opacity-50\": inactive })}>{name}</span>\n <span className={cn(\"text-xs font-medium\", { \"opacity-50\": inactive })}>\n {value}\n </span>\n </div>\n );\n}\n\n/**\n * ChartLegend — pre-built legend item components for use alongside a chart.\n *\n * - `ChartLegend.SmallItem` — compact inline layout; suited for multi-series legends\n * - `ChartLegend.LargeItem` — stacked layout with a large value; suited for single-metric cards\n *\n * @example\n * ```tsx\n * <ChartLegend.SmallItem name=\"Requests\" color=\"#086FFF\" value=\"1,234\" />\n * <ChartLegend.LargeItem name=\"Latency\" color=\"#CF7EE9\" value=\"42\" unit=\"ms\" inactive />\n * ```\n */\nexport const ChartLegend = {\n SmallItem,\n LargeItem,\n};\n"],"names":["ChartSemanticLightColors","ChartSemanticDarkColors","CHART_LIGHT_COLORS","CHART_DARK_COLORS","ChartPalette","semantic","name","isDarkMode","color","index","transformTooltip","tooltipObj","dangerousHtmlFormatter","restOfTooltip","prepareChartOptions","options","Chart","forwardRef","echarts","optionUpdateBehavior","className","height","onEvents","ref","elRef","useRef","chartRef","handlersRef","wrappersRef","boundEventsRef","useEffect","chart","event","wrapper","nextBound","handler","params","el","isInitial","ro","jsx","cn","TimeseriesChart","type","data","xAxisName","xAxisTickCount","xAxisTickFormat","yAxisTickFormat","yAxisTickLabelFormat","yAxisName","yAxisTickCount","tooltipValueFormat","onTimeRangeChange","incomplete","gradient","loading","ariaDescription","incompleteBefore","incompleteAfter","useMemo","transformSeries","seriesType","s","incompleteBeforePoints","point","incompleteAfterPoints","completePoints","areaStyle","colorWithOpacity","incompleteSeriesConfig","items","seenNames","filteredParams","param","first","ts","header","formatTimestamp","rows","value","formatFn","formattedValue","events","range","hasTimeRangeCallback","ChartWaveLoader","mid","amp","period","steps","points","i","x","d","strokeColor","alpha","a","rgbMatch","hex","r","g","b","pad","n","LargeItem","unit","inactive","jsxs","SmallItem","ChartLegend"],"mappings":";;;;AAsCA,IAAKA,sBAAAA,OACHA,EAAA,YAAY,WACZA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,eAAe,WACfA,EAAA,WAAW,WACXA,EAAA,gBAAgB,WANbA,IAAAA,KAAA,CAAA,CAAA,GAaAC,sBAAAA,OACHA,EAAA,YAAY,aACZA,EAAA,UAAU,aACVA,EAAA,UAAU,aACVA,EAAA,eAAe,aACfA,EAAA,WAAW,aACXA,EAAA,gBAAgB,aANbA,IAAAA,KAAA,CAAA,CAAA;AAaE,MAAMC,IAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AACF,GAMaC,IAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AACF;AAMO,IAAUC;AAAA,CAAV,CAAUA,MAAV;AAUE,WAASC,EACdC,GAOAC,IAAa,IACb;AACA,WAAOA,IACHN,EAAwBK,CAAI,IAC5BN,EAAyBM,CAAI;AAAA,EACnC;AAbOF,EAAAA,EAAS,WAAAC;AA0BT,WAASG,E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AK,WAAWC,EAAG,uBAAuB,EAAE,cAAckE,EAAA,CAAU,GAClE,UAAA3B,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;AAcO,MAAM8B,KAAc;AAAA,EACzB,WAAAD;AAAA,EACA,WAAAJ;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"button-oaqi7ykdisyskoos.js","sources":["../../src/components/button/button.tsx"],"sourcesContent":["import React from \"react\";\nimport { ArrowsClockwise, type Icon } from \"@phosphor-icons/react\";\nimport { Loader } from \"../loader/loader\";\nimport { Tooltip } from \"../tooltip/tooltip\";\nimport { cn } from \"../../utils/cn\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\n\n/** Button variant definitions mapping shape, size, and variant names to their Tailwind classes. */\nexport const KUMO_BUTTON_VARIANTS = {\n shape: {\n base: {\n classes: \"\",\n description: \"Default rectangular button shape\",\n },\n square: {\n classes: \"items-center justify-center p-0\",\n description: \"Square button for icon-only actions\",\n },\n circle: {\n classes: \"items-center justify-center p-0 rounded-full\",\n description: \"Circular button for icon-only actions\",\n },\n },\n size: {\n xs: {\n classes: \"h-5 gap-1 rounded-sm px-1.5 text-xs\",\n description: \"Extra small button for compact UIs\",\n },\n sm: {\n classes: \"h-6.5 gap-1 rounded-md px-2 text-xs\",\n description: \"Small button for secondary actions\",\n },\n base: {\n classes: \"h-9 gap-1.5 rounded-lg px-3 text-base\",\n description: \"Default button size\",\n },\n lg: {\n classes: \"h-10 gap-2 rounded-lg px-4 text-base\",\n description: \"Large button for primary CTAs\",\n },\n },\n compactSize: {\n xs: { classes: \"size-3.5\" },\n sm: { classes: \"size-6.5\" },\n base: { classes: \"size-9\" },\n lg: { classes: \"size-10\" },\n },\n variant: {\n primary: {\n classes:\n \"bg-kumo-brand !text-white hover:bg-kumo-brand-hover focus:bg-kumo-brand-hover disabled:bg-kumo-brand/50\",\n description: \"High-emphasis button for primary actions\",\n },\n secondary: {\n classes:\n \"bg-kumo-base !text-kumo-default ring not-disabled:hover:border-secondary! not-disabled:hover:bg-kumo-tint disabled:bg-kumo-base/50 disabled:!text-kumo-default/70 ring-kumo-hairline data-[state=open]:bg-kumo-base\",\n description: \"Default button style for most actions\",\n },\n ghost: {\n classes: \"text-kumo-default hover:bg-kumo-tint shadow-none bg-inherit\",\n description: \"Minimal button with no background\",\n },\n destructive: {\n classes: \"bg-kumo-danger !text-white hover:bg-kumo-danger/70\",\n description: \"Danger button for destructive actions like delete\",\n },\n \"secondary-destructive\": {\n classes:\n \"bg-kumo-base !text-kumo-danger ring not-disabled:hover:border-secondary! not-disabled:hover:bg-kumo-base disabled:bg-kumo-base/50 disabled:!text-kumo-danger/70 ring-kumo-hairline data-[state=open]:bg-kumo-base\",\n description:\n \"Secondary button with destructive text for less prominent dangerous actions\",\n },\n outline: {\n classes: \"bg-transparent text-kumo-default ring ring-kumo-hairline\",\n description: \"Bordered button with transparent background\",\n },\n },\n} as const;\n\nexport const KUMO_BUTTON_DEFAULT_VARIANTS = {\n shape: \"base\",\n size: \"base\",\n variant: \"secondary\",\n} as const;\n\n// Derived types from KUMO_BUTTON_VARIANTS\nexport type KumoButtonShape = keyof typeof KUMO_BUTTON_VARIANTS.shape;\nexport type KumoButtonSize = keyof typeof KUMO_BUTTON_VARIANTS.size;\nexport type KumoButtonVariant = keyof typeof KUMO_BUTTON_VARIANTS.variant;\n\nexport interface KumoButtonVariantsProps {\n /**\n * Button shape.\n * - `\"base\"` — Default rectangular button\n * - `\"square\"` — Square button for icon-only actions\n * - `\"circle\"` — Circular button for icon-only actions\n * @default \"base\"\n */\n shape?: KumoButtonShape;\n /**\n * Button size.\n * - `\"xs\"` — Extra small for compact UIs\n * - `\"sm\"` — Small for secondary actions\n * - `\"base\"` — Default size\n * - `\"lg\"` — Large for primary CTAs\n * @default \"base\"\n */\n size?: KumoButtonSize;\n /**\n * Visual style of the button.\n * - `\"primary\"` — High-emphasis, brand-colored for primary actions\n * - `\"secondary\"` — Default style with border for most actions\n * - `\"ghost\"` — Minimal, no background for tertiary actions\n * - `\"destructive\"` — Danger button for destructive actions\n * - `\"secondary-destructive\"` — Secondary style with destructive text\n * - `\"outline\"` — Bordered with transparent background\n * @default \"secondary\"\n */\n variant?: KumoButtonVariant;\n}\n\nexport function buttonVariants({\n variant = KUMO_BUTTON_DEFAULT_VARIANTS.variant,\n size = KUMO_BUTTON_DEFAULT_VARIANTS.size,\n shape = KUMO_BUTTON_DEFAULT_VARIANTS.shape,\n}: KumoButtonVariantsProps = {}) {\n const isCompactShape = shape === \"square\" || shape === \"circle\";\n\n return cn(\n // Base styles\n \"group flex w-max shrink-0 items-center font-medium select-none\",\n \"border-0 shadow-xs\",\n \"cursor-pointer\",\n // Disabled state\n \"disabled:cursor-not-allowed disabled:text-kumo-subtle\",\n // Apply variant, size, shape styles from KUMO_BUTTON_VARIANTS\n KUMO_BUTTON_VARIANTS.variant[variant].classes,\n KUMO_BUTTON_VARIANTS.size[size].classes,\n KUMO_BUTTON_VARIANTS.shape[shape].classes,\n isCompactShape && KUMO_BUTTON_VARIANTS.compactSize[size].classes,\n );\n}\n\n// Normalize icon prop to support both React elements and component types\nconst renderIconNode = (IconComponent?: Icon | React.ReactNode) => {\n if (!IconComponent) return null;\n if (React.isValidElement(IconComponent)) return IconComponent;\n const Comp = IconComponent as React.ComponentType<Record<string, unknown>>;\n return <Comp />;\n};\n\n/**\n * Button component props.\n *\n * Uses a discriminated union on `shape` so that icon-only buttons\n * (`shape=\"square\"` or `shape=\"circle\"`) require an `aria-label`.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\">Save</Button>\n * <Button variant=\"secondary\" shape=\"square\" icon={PlusIcon} aria-label=\"Add\" />\n * <Button variant=\"destructive\" loading>Deleting...</Button>\n * ```\n */\ntype ButtonBaseProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n /** Content rendered inside the button. */\n children?: React.ReactNode;\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n /** Icon from `@phosphor-icons/react` or a React element. Rendered before children. */\n icon?: Icon | React.ReactNode;\n /** Shows a loading spinner and disables interaction. */\n loading?: boolean;\n /** When set, wraps the button in a Tooltip with this content. */\n title?: React.ReactNode;\n};\n\ntype ButtonWithTextProps = ButtonBaseProps & {\n shape?: \"base\";\n size?: KumoButtonSize;\n variant?: KumoButtonVariant;\n};\n\ntype IconOnlyButtonProps = ButtonBaseProps & {\n shape: \"square\" | \"circle\";\n size?: KumoButtonSize;\n variant?: KumoButtonVariant;\n /** Required for icon-only buttons to provide accessible label for screen readers */\n \"aria-label\": string;\n};\n\nexport type ButtonProps = ButtonWithTextProps | IconOnlyButtonProps;\n\n/**\n * LinkButton component props — renders an anchor styled as a button.\n *\n * @example\n * ```tsx\n * <LinkButton href=\"/docs\" variant=\"ghost\" icon={BookIcon}>Docs</LinkButton>\n * <LinkButton href=\"https://example.com\" external>Visit Site</LinkButton>\n * ```\n */\nexport type LinkButtonProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &\n KumoButtonVariantsProps & {\n /** Content rendered inside the link button. */\n children?: React.ReactNode;\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n /** Icon from `@phosphor-icons/react` or a React element. Rendered before children. */\n icon?: Icon | React.ReactNode;\n /** When `true`, opens in a new tab with `rel=\"noopener noreferrer\"`. */\n external?: boolean;\n linksExternal?: boolean;\n };\n\n/**\n * Primary action trigger. Supports multiple variants, sizes, shapes, icons, and loading state.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\">Save</Button>\n * <Button variant=\"secondary\" icon={PlusIcon}>Create Worker</Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n children,\n className,\n disabled,\n loading,\n shape = \"base\",\n size = \"base\",\n variant = \"secondary\",\n icon: IconComponent,\n title,\n ...props\n },\n ref,\n ) => {\n const { type, ...restProps } = props;\n const button = (\n <button\n ref={ref}\n className={cn(\n buttonVariants({ variant, size, shape }),\n \"focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-hairline *:in-focus:opacity-100\", // Focus styles\n disabled && \"cursor-not-allowed opacity-50\",\n className,\n )}\n disabled={loading || disabled}\n type={type ?? \"button\"}\n {...restProps}\n >\n {loading && <Loader size={size === \"lg\" ? 16 : 14} />}\n {!loading && renderIconNode(IconComponent)}\n\n {children}\n </button>\n );\n\n if (title) {\n return <Tooltip content={title} render={button} />;\n }\n\n return button;\n },\n);\n\nButton.displayName = \"Button\";\n\n/**\n * Square button with a rotating arrows icon, used to trigger data refresh actions.\n *\n * @example\n * ```tsx\n * <RefreshButton loading={isRefreshing} onClick={refresh} />\n * ```\n */\nexport const RefreshButton = ({\n \"aria-label\": ariaLabel = \"Refresh\",\n loading,\n ...props\n}: ButtonProps) => (\n <Button shape=\"square\" aria-label={ariaLabel} {...props}>\n <ArrowsClockwise\n className={cn({\n \"animate-refresh\": loading,\n \"size-4.5\": props.size === \"base\" || !props.size,\n \"size-4\": props.size === \"sm\",\n \"size-5\": props.size === \"lg\",\n })}\n />\n </Button>\n);\n\n/**\n * Anchor element styled as a button. Integrates with `LinkProvider` for framework routing.\n *\n * @example\n * ```tsx\n * <LinkButton href=\"/settings\" variant=\"ghost\">Settings</LinkButton>\n * ```\n */\nexport const LinkButton = React.forwardRef<HTMLAnchorElement, LinkButtonProps>(\n (\n {\n children,\n className,\n external,\n href,\n shape = \"base\",\n size = \"base\",\n variant = \"ghost\",\n icon: IconComponent,\n // linksExternal = false,\n ...props\n },\n ref,\n ) => {\n const LinkComponent = useLinkComponent();\n const externalProps = external\n ? { target: \"_blank\", rel: \"noopener noreferrer\" }\n : {};\n\n return (\n <LinkComponent\n ref={ref}\n className={cn(\n buttonVariants({ variant, size, shape }),\n \"flex items-center no-underline!\",\n className,\n )}\n href={href}\n to={typeof href === \"string\" ? href : undefined}\n {...externalProps}\n {...props}\n >\n {renderIconNode(IconComponent)}\n {children}\n </LinkComponent>\n );\n },\n);\n\nLinkButton.displayName = \"LinkButton\";\n"],"names":["KUMO_BUTTON_VARIANTS","KUMO_BUTTON_DEFAULT_VARIANTS","buttonVariants","variant","size","shape","isCompactShape","cn","renderIconNode","IconComponent","React","Button","children","className","disabled","loading","title","props","ref","type","restProps","button","jsxs","Loader","jsx","Tooltip","RefreshButton","ariaLabel","ArrowsClockwise","LinkButton","external","href","LinkComponent","useLinkComponent","externalProps"],"mappings":";;;;;;;;AAQO,MAAMA,IAAuB;AAAA,EAClC,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAAA,EAEF,MAAM;AAAA,IACJ,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAAA,EAEF,aAAa;AAAA,IACX,IAAI,EAAE,SAAS,WAAA;AAAA,IACf,IAAI,EAAE,SAAS,WAAA;AAAA,IACf,MAAM,EAAE,SAAS,SAAA;AAAA,IACjB,IAAI,EAAE,SAAS,UAAA;AAAA,EAAU;AAAA,EAE3B,SAAS;AAAA,IACP,SAAS;AAAA,MACP,SACE;AAAA,MACF,aAAa;AAAA,IAAA;AAAA,IAEf,WAAW;AAAA,MACT,SACE;AAAA,MACF,aAAa;AAAA,IAAA;AAAA,IAEf,OAAO;AAAA,MACL,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,aAAa;AAAA,MACX,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,yBAAyB;AAAA,MACvB,SACE;AAAA,MACF,aACE;AAAA,IAAA;AAA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