@cloudflare/kumo 2.6.0 → 2.8.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 (264) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/ai/component-registry.json +1182 -163
  3. package/ai/component-registry.md +1425 -119
  4. package/ai/schemas.ts +137 -8
  5. package/dist/.build-complete +1 -1
  6. package/dist/ai/schemas.d.ts +259 -22
  7. package/dist/ai/schemas.d.ts.map +1 -1
  8. package/dist/ai/schemas.js +1516 -1299
  9. package/dist/ai/schemas.js.map +1 -1
  10. package/dist/chunks/Maps-imwfwgb7do9lr3i5.js +2448 -0
  11. package/dist/chunks/Maps-imwfwgb7do9lr3i5.js.map +1 -0
  12. package/dist/chunks/{autocomplete-hgprlcuf0ixbbo6d.js → autocomplete-a4gvspveibfuod24.js} +5 -5
  13. package/dist/chunks/{autocomplete-hgprlcuf0ixbbo6d.js.map → autocomplete-a4gvspveibfuod24.js.map} +1 -1
  14. package/dist/chunks/{badge-c1th6h6ahz7eu49q.js → badge-dfc1r37osagi3rs4.js} +9 -9
  15. package/dist/chunks/{badge-c1th6h6ahz7eu49q.js.map → badge-dfc1r37osagi3rs4.js.map} +1 -1
  16. package/dist/chunks/{banner-es5iwuk4pf25e29e.js → banner-j52y8l13puk7dybi.js} +2 -2
  17. package/dist/chunks/{banner-es5iwuk4pf25e29e.js.map → banner-j52y8l13puk7dybi.js.map} +1 -1
  18. package/dist/chunks/{breadcrumbs-lyj8ljudrm2owx5y.js → breadcrumbs-js59m7m57bdsveew.js} +4 -4
  19. package/dist/chunks/{breadcrumbs-lyj8ljudrm2owx5y.js.map → breadcrumbs-js59m7m57bdsveew.js.map} +1 -1
  20. package/dist/chunks/{button-gtdhvogt5rlrf1is.js → button-ebfdg9mkhojue36n.js} +80 -80
  21. package/dist/chunks/button-ebfdg9mkhojue36n.js.map +1 -0
  22. package/dist/chunks/{checkbox-byg8t8r9vbmif696.js → checkbox-k355pnfisqt0h4eg.js} +4 -4
  23. package/dist/chunks/{checkbox-byg8t8r9vbmif696.js.map → checkbox-k355pnfisqt0h4eg.js.map} +1 -1
  24. package/dist/chunks/{clipboard-text-lf909phvldd8rfk8.js → clipboard-text-isb05zkg2aox0tp6.js} +5 -5
  25. package/dist/chunks/{clipboard-text-lf909phvldd8rfk8.js.map → clipboard-text-isb05zkg2aox0tp6.js.map} +1 -1
  26. package/dist/chunks/{cloudflare-logo-fya2cd2ljozkzjh8.js → cloudflare-logo-fiuocxdxqrxawjfv.js} +2 -2
  27. package/dist/chunks/{cloudflare-logo-fya2cd2ljozkzjh8.js.map → cloudflare-logo-fiuocxdxqrxawjfv.js.map} +1 -1
  28. package/dist/chunks/{cn-ct4n7r74mh8y0f48.js → cn-bo7ya7641lkickbt.js} +6 -10
  29. package/dist/chunks/cn-bo7ya7641lkickbt.js.map +1 -0
  30. package/dist/chunks/{code-bbnjm8vk9hxl129r.js → code-pbkfdfat0yilg6dx.js} +2 -2
  31. package/dist/chunks/{code-bbnjm8vk9hxl129r.js.map → code-pbkfdfat0yilg6dx.js.map} +1 -1
  32. package/dist/chunks/{collapsible-dl61f8gd4j897hmv.js → collapsible-f9hgtc1u6xvqrgt8.js} +3 -3
  33. package/dist/chunks/{collapsible-dl61f8gd4j897hmv.js.map → collapsible-f9hgtc1u6xvqrgt8.js.map} +1 -1
  34. package/dist/chunks/{combobox-dxff22zxzq846nec.js → combobox-hc9wi9nwsyyli8ur.js} +5 -5
  35. package/dist/chunks/{combobox-dxff22zxzq846nec.js.map → combobox-hc9wi9nwsyyli8ur.js.map} +1 -1
  36. package/dist/chunks/{command-palette-i4r0402b838wiy0j.js → command-palette-c03zze4ayuytwxjg.js} +4 -4
  37. package/dist/chunks/{command-palette-i4r0402b838wiy0j.js.map → command-palette-c03zze4ayuytwxjg.js.map} +1 -1
  38. package/dist/chunks/{date-picker-mjocqqbggb76n8rt.js → date-picker-bffp889exjixmgz3.js} +8 -8
  39. package/dist/chunks/{date-picker-mjocqqbggb76n8rt.js.map → date-picker-bffp889exjixmgz3.js.map} +1 -1
  40. package/dist/chunks/{date-range-picker-o8uyril1kogvhoei.js → date-range-picker-oks2r14lbbukd545.js} +2 -2
  41. package/dist/chunks/{date-range-picker-o8uyril1kogvhoei.js.map → date-range-picker-oks2r14lbbukd545.js.map} +1 -1
  42. package/dist/chunks/{dialog-g1b8161nbyixdit0.js → dialog-ovhmzfuppr5xix0e.js} +15 -15
  43. package/dist/chunks/dialog-ovhmzfuppr5xix0e.js.map +1 -0
  44. package/dist/chunks/{dropdown-irp18txvgz8590e9.js → dropdown-iey8f344rd5dgahz.js} +24 -16
  45. package/dist/chunks/dropdown-iey8f344rd5dgahz.js.map +1 -0
  46. package/dist/chunks/{empty-daa6d7u9oleaw24a.js → empty-k83r53jh5utqvv7w.js} +3 -3
  47. package/dist/chunks/{empty-daa6d7u9oleaw24a.js.map → empty-k83r53jh5utqvv7w.js.map} +1 -1
  48. package/dist/chunks/{field-f1hy08um3jf9jos6.js → field-bmglk138wa8bf3ei.js} +4 -4
  49. package/dist/chunks/{field-f1hy08um3jf9jos6.js.map → field-bmglk138wa8bf3ei.js.map} +1 -1
  50. package/dist/chunks/{grid-do93dv1rjggqxx7p.js → grid-jze04557ljywg3uc.js} +2 -2
  51. package/dist/chunks/{grid-do93dv1rjggqxx7p.js.map → grid-jze04557ljywg3uc.js.map} +1 -1
  52. package/dist/chunks/input-area-sg518xu4pyg4m0km.js +144 -0
  53. package/dist/chunks/input-area-sg518xu4pyg4m0km.js.map +1 -0
  54. package/dist/chunks/{input-f2ct7obgdzypjmp2.js → input-ckl5misj0jd9cu5r.js} +4 -4
  55. package/dist/chunks/{input-f2ct7obgdzypjmp2.js.map → input-ckl5misj0jd9cu5r.js.map} +1 -1
  56. package/dist/chunks/{input-group-kcd3jin5pbdijmw8.js → input-group-bflx1m6ki55e99vf.js} +6 -6
  57. package/dist/chunks/{input-group-kcd3jin5pbdijmw8.js.map → input-group-bflx1m6ki55e99vf.js.map} +1 -1
  58. package/dist/chunks/{label-himqjkdhh0hgfdsa.js → label-i1xbmg8y1n0tbtkx.js} +4 -4
  59. package/dist/chunks/{label-himqjkdhh0hgfdsa.js.map → label-i1xbmg8y1n0tbtkx.js.map} +1 -1
  60. package/dist/chunks/{layer-card-cshi5vydqg3phyfx.js → layer-card-m6h85dpadvee39h2.js} +3 -3
  61. package/dist/chunks/{layer-card-cshi5vydqg3phyfx.js.map → layer-card-m6h85dpadvee39h2.js.map} +1 -1
  62. package/dist/chunks/{link-bw21ofmgg58igq5n.js → link-j93fl5m8zrcfivsr.js} +3 -3
  63. package/dist/chunks/{link-bw21ofmgg58igq5n.js.map → link-j93fl5m8zrcfivsr.js.map} +1 -1
  64. package/dist/chunks/{menubar-m12wcbbucuszspw4.js → menubar-opzxfzylaatfz4nv.js} +8 -8
  65. package/dist/chunks/{menubar-m12wcbbucuszspw4.js.map → menubar-opzxfzylaatfz4nv.js.map} +1 -1
  66. package/dist/chunks/{meter-dn8vgc0smpk0du75.js → meter-6br6z5ekw41trxeh.js} +3 -3
  67. package/dist/chunks/{meter-dn8vgc0smpk0du75.js.map → meter-6br6z5ekw41trxeh.js.map} +1 -1
  68. package/dist/chunks/{pagination-oafyxvdndm9m8250.js → pagination-j33ntwqmm9qskfgv.js} +4 -4
  69. package/dist/chunks/{pagination-oafyxvdndm9m8250.js.map → pagination-j33ntwqmm9qskfgv.js.map} +1 -1
  70. package/dist/chunks/{popover-bbxr39l1lx175hum.js → popover-cqdmpp8i4hg8gzzx.js} +3 -3
  71. package/dist/chunks/{popover-bbxr39l1lx175hum.js.map → popover-cqdmpp8i4hg8gzzx.js.map} +1 -1
  72. package/dist/chunks/{radio-ffx05ih9nc764evh.js → radio-ejey7i6r4tq314av.js} +3 -3
  73. package/dist/chunks/{radio-ffx05ih9nc764evh.js.map → radio-ejey7i6r4tq314av.js.map} +1 -1
  74. package/dist/chunks/{select-kl1skfh3pmwc33rp.js → select-p8adn2tnpom25hpl.js} +8 -8
  75. package/dist/chunks/{select-kl1skfh3pmwc33rp.js.map → select-p8adn2tnpom25hpl.js.map} +1 -1
  76. package/dist/chunks/{sensitive-input-izmbyk1t7r56ciiq.js → sensitive-input-it1hsswlccq3u7g6.js} +5 -5
  77. package/dist/chunks/{sensitive-input-izmbyk1t7r56ciiq.js.map → sensitive-input-it1hsswlccq3u7g6.js.map} +1 -1
  78. package/dist/chunks/{sidebar-ior8rnhsd7gy5am5.js → sidebar-7whsl7qwrw5b6ip8.js} +307 -307
  79. package/dist/chunks/sidebar-7whsl7qwrw5b6ip8.js.map +1 -0
  80. package/dist/chunks/{skeleton-line-epxenksfesr2fkcv.js → skeleton-line-omxgxia23vpav94x.js} +2 -2
  81. package/dist/chunks/{skeleton-line-epxenksfesr2fkcv.js.map → skeleton-line-omxgxia23vpav94x.js.map} +1 -1
  82. package/dist/chunks/{surface-g5a1buofz4erjov2.js → surface-gc2gblserrxcb1eg.js} +5 -5
  83. package/dist/chunks/{surface-g5a1buofz4erjov2.js.map → surface-gc2gblserrxcb1eg.js.map} +1 -1
  84. package/dist/chunks/{switch-kh8a6l3l0hszm9h4.js → switch-ljsq915e0l1a5mjd.js} +4 -4
  85. package/dist/chunks/{switch-kh8a6l3l0hszm9h4.js.map → switch-ljsq915e0l1a5mjd.js.map} +1 -1
  86. package/dist/chunks/{table-of-contents-jco9kvt48d34dwsw.js → table-of-contents-cghjqyk43nj5zmlw.js} +2 -2
  87. package/dist/chunks/{table-of-contents-jco9kvt48d34dwsw.js.map → table-of-contents-cghjqyk43nj5zmlw.js.map} +1 -1
  88. package/dist/chunks/{table-dz2k55oab66h2vi9.js → table-ojjjeqszmt9jgnug.js} +3 -3
  89. package/dist/chunks/{table-dz2k55oab66h2vi9.js.map → table-ojjjeqszmt9jgnug.js.map} +1 -1
  90. package/dist/chunks/{tabs-kcw98wibdz4mhpkc.js → tabs-kemdy19kfesj2xjr.js} +3 -3
  91. package/dist/chunks/{tabs-kcw98wibdz4mhpkc.js.map → tabs-kemdy19kfesj2xjr.js.map} +1 -1
  92. package/dist/chunks/{text-be7ehenoyldhyjma.js → text-oqp48b9m5u6t62b4.js} +2 -2
  93. package/dist/chunks/{text-be7ehenoyldhyjma.js.map → text-oqp48b9m5u6t62b4.js.map} +1 -1
  94. package/dist/chunks/{toast-dkdo1lu72tnefya6.js → toast-ldj9zi940w83ub90.js} +97 -81
  95. package/dist/chunks/toast-ldj9zi940w83ub90.js.map +1 -0
  96. package/dist/chunks/{toolbar-o7xe6pd189evdd53.js → toolbar-lmylyrod70sn0q4i.js} +6 -6
  97. package/dist/chunks/{toolbar-o7xe6pd189evdd53.js.map → toolbar-lmylyrod70sn0q4i.js.map} +1 -1
  98. package/dist/chunks/{tooltip-eqnhjdbvwapy8gj4.js → tooltip-mooldq78tg77ekvv.js} +4 -4
  99. package/dist/chunks/tooltip-mooldq78tg77ekvv.js.map +1 -0
  100. package/dist/chunks/vendor-base-ui-elpbzr8xeffrz4h2.js +25027 -0
  101. package/dist/chunks/vendor-base-ui-elpbzr8xeffrz4h2.js.map +1 -0
  102. package/dist/chunks/{vendor-floating-ui-c4mwmh0xmfzevy9l.js → vendor-floating-ui-k1zjlb8fkwtcw4k5.js} +22 -23
  103. package/dist/chunks/{vendor-floating-ui-c4mwmh0xmfzevy9l.js.map → vendor-floating-ui-k1zjlb8fkwtcw4k5.js.map} +1 -1
  104. package/dist/chunks/vendor-styling-ofvnbcuht98q88oo.js +3252 -0
  105. package/dist/chunks/vendor-styling-ofvnbcuht98q88oo.js.map +1 -0
  106. package/dist/code.js +2 -2
  107. package/dist/components/autocomplete.js +1 -1
  108. package/dist/components/badge.js +1 -1
  109. package/dist/components/banner.js +1 -1
  110. package/dist/components/breadcrumbs.js +1 -1
  111. package/dist/components/button.js +1 -1
  112. package/dist/components/chart.js +6 -4
  113. package/dist/components/checkbox.js +1 -1
  114. package/dist/components/clipboard-text.js +1 -1
  115. package/dist/components/cloudflare-logo.js +1 -1
  116. package/dist/components/code.js +1 -1
  117. package/dist/components/collapsible.js +1 -1
  118. package/dist/components/combobox.js +1 -1
  119. package/dist/components/command-palette.js +1 -1
  120. package/dist/components/date-picker.js +1 -1
  121. package/dist/components/date-range-picker.js +1 -1
  122. package/dist/components/dialog.js +1 -1
  123. package/dist/components/dropdown.js +1 -1
  124. package/dist/components/empty.js +1 -1
  125. package/dist/components/field.js +1 -1
  126. package/dist/components/flow.js +2277 -2312
  127. package/dist/components/flow.js.map +1 -1
  128. package/dist/components/grid.js +1 -1
  129. package/dist/components/input-group.js +1 -1
  130. package/dist/components/input.js +3 -3
  131. package/dist/components/label.js +1 -1
  132. package/dist/components/layer-card.js +1 -1
  133. package/dist/components/link.js +1 -1
  134. package/dist/components/loader.js +1 -1
  135. package/dist/components/menubar.js +1 -1
  136. package/dist/components/meter.js +1 -1
  137. package/dist/components/pagination.js +1 -1
  138. package/dist/components/popover.js +1 -1
  139. package/dist/components/radio.js +1 -1
  140. package/dist/components/select.js +1 -1
  141. package/dist/components/sensitive-input.js +1 -1
  142. package/dist/components/sidebar.js +1 -1
  143. package/dist/components/surface.js +1 -1
  144. package/dist/components/switch.js +1 -1
  145. package/dist/components/table-of-contents.js +1 -1
  146. package/dist/components/table.js +1 -1
  147. package/dist/components/tabs.js +1 -1
  148. package/dist/components/text.js +1 -1
  149. package/dist/components/toast.js +2 -2
  150. package/dist/components/toolbar.js +1 -1
  151. package/dist/components/tooltip.js +1 -1
  152. package/dist/index.js +128 -126
  153. package/dist/primitives/accordion.js +1 -1
  154. package/dist/primitives/alert-dialog.js +1 -1
  155. package/dist/primitives/autocomplete.js +1 -1
  156. package/dist/primitives/avatar.js +1 -1
  157. package/dist/primitives/button.js +1 -1
  158. package/dist/primitives/checkbox-group.js +1 -1
  159. package/dist/primitives/checkbox.js +1 -1
  160. package/dist/primitives/collapsible.js +1 -1
  161. package/dist/primitives/combobox.js +1 -1
  162. package/dist/primitives/context-menu.js +1 -1
  163. package/dist/primitives/csp-provider.js +1 -1
  164. package/dist/primitives/dialog.js +1 -1
  165. package/dist/primitives/direction-provider.js +1 -1
  166. package/dist/primitives/drawer.js +1 -1
  167. package/dist/primitives/field.js +1 -1
  168. package/dist/primitives/fieldset.js +1 -1
  169. package/dist/primitives/form.js +1 -1
  170. package/dist/primitives/input.js +1 -1
  171. package/dist/primitives/menu.js +1 -1
  172. package/dist/primitives/menubar.js +1 -1
  173. package/dist/primitives/meter.js +1 -1
  174. package/dist/primitives/navigation-menu.js +1 -1
  175. package/dist/primitives/number-field.js +1 -1
  176. package/dist/primitives/otp-field.js +3 -2
  177. package/dist/primitives/popover.js +1 -1
  178. package/dist/primitives/preview-card.js +1 -1
  179. package/dist/primitives/progress.js +1 -1
  180. package/dist/primitives/radio-group.js +1 -1
  181. package/dist/primitives/radio.js +1 -1
  182. package/dist/primitives/scroll-area.js +1 -1
  183. package/dist/primitives/select.js +1 -1
  184. package/dist/primitives/separator.js +1 -1
  185. package/dist/primitives/slider.js +1 -1
  186. package/dist/primitives/switch.js +1 -1
  187. package/dist/primitives/tabs.js +1 -1
  188. package/dist/primitives/toast.js +1 -1
  189. package/dist/primitives/toggle-group.js +1 -1
  190. package/dist/primitives/toggle.js +1 -1
  191. package/dist/primitives/toolbar.js +1 -1
  192. package/dist/primitives/tooltip.js +1 -1
  193. package/dist/primitives.js +27 -26
  194. package/dist/src/components/button/button.d.ts +2 -2
  195. package/dist/src/components/chart/Color.d.ts +16 -0
  196. package/dist/src/components/chart/Color.d.ts.map +1 -1
  197. package/dist/src/components/chart/EChart.d.ts +7 -0
  198. package/dist/src/components/chart/EChart.d.ts.map +1 -1
  199. package/dist/src/components/chart/Maps.d.ts +211 -0
  200. package/dist/src/components/chart/Maps.d.ts.map +1 -0
  201. package/dist/src/components/chart/SankeyChart.d.ts.map +1 -1
  202. package/dist/src/components/chart/TimeseriesChart.d.ts +8 -0
  203. package/dist/src/components/chart/TimeseriesChart.d.ts.map +1 -1
  204. package/dist/src/components/chart/index.d.ts +2 -1
  205. package/dist/src/components/chart/index.d.ts.map +1 -1
  206. package/dist/src/components/chart/timeseries-markers.d.ts +107 -0
  207. package/dist/src/components/chart/timeseries-markers.d.ts.map +1 -0
  208. package/dist/src/components/chart/timeseries-thresholds.d.ts +61 -0
  209. package/dist/src/components/chart/timeseries-thresholds.d.ts.map +1 -0
  210. package/dist/src/components/chart/timeseries-tooltip.d.ts +28 -0
  211. package/dist/src/components/chart/timeseries-tooltip.d.ts.map +1 -0
  212. package/dist/src/components/chart/tooltip-utils.d.ts +4 -0
  213. package/dist/src/components/chart/tooltip-utils.d.ts.map +1 -0
  214. package/dist/src/components/dialog/dialog.d.ts +12 -12
  215. package/dist/src/components/dropdown/dropdown.d.ts.map +1 -1
  216. package/dist/src/components/flow/connectors.d.ts +18 -0
  217. package/dist/src/components/flow/connectors.d.ts.map +1 -1
  218. package/dist/src/components/flow/diagram.d.ts +48 -39
  219. package/dist/src/components/flow/diagram.d.ts.map +1 -1
  220. package/dist/src/components/flow/flow-layout.d.ts +77 -0
  221. package/dist/src/components/flow/flow-layout.d.ts.map +1 -0
  222. package/dist/src/components/flow/node.d.ts.map +1 -1
  223. package/dist/src/components/flow/parallel.d.ts +3 -7
  224. package/dist/src/components/flow/parallel.d.ts.map +1 -1
  225. package/dist/src/components/flow/use-children.d.ts +0 -60
  226. package/dist/src/components/flow/use-children.d.ts.map +1 -1
  227. package/dist/src/components/input/input-area.d.ts +18 -0
  228. package/dist/src/components/input/input-area.d.ts.map +1 -1
  229. package/dist/src/components/sidebar/sidebar.d.ts +2 -0
  230. package/dist/src/components/sidebar/sidebar.d.ts.map +1 -1
  231. package/dist/src/components/toast/toast.d.ts +2 -2
  232. package/dist/src/components/toast/toast.d.ts.map +1 -1
  233. package/dist/src/index.d.ts +1 -1
  234. package/dist/src/index.d.ts.map +1 -1
  235. package/dist/src/primitives/index.d.ts +1 -0
  236. package/dist/src/primitives/index.d.ts.map +1 -1
  237. package/dist/src/primitives/otp-field.d.ts +1 -0
  238. package/dist/src/primitives/otp-field.d.ts.map +1 -1
  239. package/dist/src/utils/cn.d.ts +1 -2
  240. package/dist/src/utils/cn.d.ts.map +1 -1
  241. package/dist/styles/kumo-standalone.css +1 -1
  242. package/dist/utils.js +8 -7
  243. package/dist/utils.js.map +1 -1
  244. package/package.json +6 -5
  245. package/scripts/component-registry/discovery.ts +87 -0
  246. package/scripts/component-registry/index.test.ts +89 -1
  247. package/scripts/component-registry/index.ts +27 -2
  248. package/scripts/component-registry/sub-components.ts +34 -21
  249. package/scripts/generate-primitives.ts +9 -0
  250. package/dist/chunks/SankeyChart-g1tng405ml2e0qg2.js +0 -890
  251. package/dist/chunks/SankeyChart-g1tng405ml2e0qg2.js.map +0 -1
  252. package/dist/chunks/button-gtdhvogt5rlrf1is.js.map +0 -1
  253. package/dist/chunks/cn-ct4n7r74mh8y0f48.js.map +0 -1
  254. package/dist/chunks/dialog-g1b8161nbyixdit0.js.map +0 -1
  255. package/dist/chunks/dropdown-irp18txvgz8590e9.js.map +0 -1
  256. package/dist/chunks/input-area-bwyujceeulpfkpxv.js +0 -78
  257. package/dist/chunks/input-area-bwyujceeulpfkpxv.js.map +0 -1
  258. package/dist/chunks/sidebar-ior8rnhsd7gy5am5.js.map +0 -1
  259. package/dist/chunks/toast-dkdo1lu72tnefya6.js.map +0 -1
  260. package/dist/chunks/tooltip-eqnhjdbvwapy8gj4.js.map +0 -1
  261. package/dist/chunks/vendor-base-ui-f9z44m829vvptrg0.js +0 -24712
  262. package/dist/chunks/vendor-base-ui-f9z44m829vvptrg0.js.map +0 -1
  263. package/dist/chunks/vendor-styling-gobnkhsy0rva4qd3.js +0 -2775
  264. package/dist/chunks/vendor-styling-gobnkhsy0rva4qd3.js.map +0 -1
@@ -1,890 +0,0 @@
1
- "use client";
2
- import { jsx as d, jsxs as k, Fragment as we } from "react/jsx-runtime";
3
- import { forwardRef as he, useRef as A, useEffect as P, useCallback as be, useState as Ne, useMemo as ee, memo as $e } from "react";
4
- import { W as Se, X as Fe, Y as Te, Z as Ie, _ as Re } from "./vendor-base-ui-f9z44m829vvptrg0.js";
5
- import { c as B } from "./cn-ct4n7r74mh8y0f48.js";
6
- var ye = /* @__PURE__ */ ((e) => (e.Attention = "#FC574A", e.Warning = "#F8A054", e.Success = "#00A63E", e.Neutral = "#B9D6FF", e.Disabled = "#CBCBCB", e.Skeleton = "#DDDDDD", e))(ye || {}), xe = /* @__PURE__ */ ((e) => (e.Attention = "#FC574A", e.Warning = "#F8A054", e.Success = "#00A63E", e.Neutral = "#8EC5FF", e.Disabled = "#878787", e.Skeleton = "#5C5C5C", e))(xe || {});
7
- const Ae = {
8
- blues: ["#E1EAF4", "#8EBCF6", "#4290F0", "#0E58B4", "#03254F"]
9
- }, Ce = {
10
- blues: ["#03254F", "#0E58B4", "#4290F0", "#A6BFDD", "#E1EAF4"]
11
- }, le = [
12
- "#4290F0",
13
- "#F5B647",
14
- "#E8649D",
15
- "#8D58EE",
16
- "#50C3B6",
17
- "#D37536"
18
- /* Orange */
19
- ], ie = [
20
- "#4290F0",
21
- "#EEB720",
22
- "#E8649D",
23
- "#8D58EE",
24
- "#50C3B6",
25
- "#D37536"
26
- /* Orange */
27
- ];
28
- var Y;
29
- ((e) => {
30
- function n(o, s = !1) {
31
- return s ? xe[o] : ye[o];
32
- }
33
- e.semantic = n;
34
- function t(o, s = !1) {
35
- return s ? ie[o % ie.length] : le[o % le.length];
36
- }
37
- e.categorical = t;
38
- function a(o, s = !1) {
39
- return s ? [...Ce[o]] : [...Ae[o]];
40
- }
41
- e.sequential = a;
42
- function r(o, s = !1) {
43
- const c = {
44
- light: { primary: "#6B7280", secondary: "#9CA3AF" },
45
- dark: { primary: "#9CA3AF", secondary: "#6B7280" }
46
- };
47
- return s ? c.dark[o] : c.light[o];
48
- }
49
- e.text = r;
50
- })(Y || (Y = {}));
51
- const me = (e) => {
52
- const { dangerousHtmlFormatter: n, ...t } = e;
53
- return {
54
- ...t,
55
- formatter: n
56
- };
57
- }, Ee = ({
58
- options: e,
59
- isDarkMode: n
60
- }) => {
61
- const t = {
62
- backgroundColor: "transparent",
63
- color: n ? ie : le,
64
- ...e
65
- };
66
- return t.tooltip ? {
67
- ...t,
68
- tooltip: Array.isArray(t.tooltip) ? t.tooltip.map(me) : me(t.tooltip)
69
- } : t;
70
- }, ce = he(function({
71
- echarts: n,
72
- options: t,
73
- optionUpdateBehavior: a,
74
- className: r,
75
- isDarkMode: o,
76
- height: s = 350,
77
- onEvents: c
78
- }, x) {
79
- const b = A(null), v = A(null), D = A({}), T = A({}), I = A(/* @__PURE__ */ new Set());
80
- return P(() => {
81
- if (!b.current) return;
82
- const f = n.init(b.current, o ? "dark" : void 0);
83
- return v.current = f, typeof x == "function" ? x(f) : x && (x.current = f), () => {
84
- for (const w of I.current) {
85
- const u = T.current[w];
86
- u && f.off(w, u);
87
- }
88
- I.current.clear(), typeof x == "function" ? x(null) : x && (x.current = null), v.current = null, f.dispose();
89
- };
90
- }, [b, o]), P(() => {
91
- const f = v.current;
92
- f && f.setOption(Ee({ options: t, isDarkMode: o }), {
93
- notMerge: !1,
94
- lazyUpdate: !0,
95
- ...a
96
- });
97
- }, [o, a, t]), P(() => {
98
- D.current = c ?? {};
99
- }, [c]), P(() => {
100
- const f = v.current;
101
- if (!f) return;
102
- const w = /* @__PURE__ */ new Set();
103
- for (const [u, N] of Object.entries(c ?? {}))
104
- typeof N == "function" && (w.add(u), T.current[u] || (T.current[u] = (O) => {
105
- D.current[u]?.(O);
106
- }), I.current.has(u) || f.on(u, T.current[u]));
107
- for (const u of I.current) {
108
- if (w.has(u)) continue;
109
- const N = T.current[u];
110
- N && f.off(u, N);
111
- }
112
- I.current = w;
113
- }, [n, o, c]), P(() => {
114
- const f = v.current, w = b.current;
115
- if (!f || !w) return;
116
- let u = !0;
117
- const N = new ResizeObserver(() => {
118
- if (u) {
119
- u = !1;
120
- return;
121
- }
122
- f.resize();
123
- });
124
- return N.observe(w), () => N.disconnect();
125
- }, []), /* @__PURE__ */ d(
126
- "div",
127
- {
128
- ref: b,
129
- className: B("w-full", r),
130
- style: { height: s },
131
- tabIndex: t.aria?.enabled ? 0 : void 0,
132
- role: t.aria?.enabled ? "img" : void 0
133
- }
134
- );
135
- });
136
- ce.displayName = "Chart";
137
- const Be = he(function({
138
- echarts: n,
139
- type: t = "line",
140
- data: a,
141
- xAxisName: r,
142
- xAxisTickCount: o,
143
- xAxisTickFormat: s,
144
- yAxisTickFormat: c,
145
- yAxisTickLabelFormat: x,
146
- yAxisName: b,
147
- yAxisTickCount: v,
148
- tooltipValueFormat: D,
149
- onTimeRangeChange: T,
150
- height: I = 350,
151
- incomplete: f,
152
- enableLegendSelection: w = !1,
153
- isDarkMode: u,
154
- gradient: N,
155
- loading: O,
156
- ariaDescription: L,
157
- optionUpdateBehavior: te,
158
- tooltipMode: q = "all",
159
- tooltipMaxItems: V = 10,
160
- tooltipFollowCursor: ne = "both",
161
- tooltipBoundary: Z
162
- }, G) {
163
- const h = A(null), $ = A(null), H = be(
164
- (i) => {
165
- h.current = i, typeof G == "function" ? G(i) : G && (G.current = i);
166
- },
167
- [G]
168
- ), C = A(a);
169
- C.current = a;
170
- const R = A(null);
171
- P(() => {
172
- R.current = null;
173
- }, [w, u]);
174
- const z = A(q);
175
- z.current = q;
176
- const l = A(V);
177
- l.current = V;
178
- const [m, S] = Ne(null), y = A({ x: 0, y: 0 });
179
- P(() => {
180
- const i = $.current;
181
- if (!i) return;
182
- const E = (p) => {
183
- const F = i.getBoundingClientRect();
184
- y.current = {
185
- x: p.clientX - F.left,
186
- y: p.clientY - F.top
187
- };
188
- };
189
- return i.addEventListener("mousemove", E), () => i.removeEventListener("mousemove", E);
190
- }, []);
191
- const M = f?.before, K = f?.after, re = ee(() => {
192
- const i = [], E = t === "bar" ? { type: "bar", stack: "total" } : { type: "line", showSymbol: !1 };
193
- for (const p of a) {
194
- const F = M && t === "line" ? p.data.filter((g) => g[0] <= M) : [], W = K && t === "line" ? p.data.filter((g) => g[0] >= K) : [], _ = F.length > 0 || W.length > 0 ? p.data.slice(
195
- Math.max(0, F.length - 1),
196
- Math.max(0, p.data.length - W.length + 1)
197
- ) : p.data, X = N && t === "line" ? {
198
- color: new n.graphic.LinearGradient(0, 0, 0, 1, [
199
- { offset: 0, color: pe(p.color, 0.4) },
200
- { offset: 1, color: pe(p.color, 0) }
201
- ])
202
- } : void 0;
203
- i.push({
204
- data: _,
205
- color: p.color,
206
- name: p.name,
207
- emphasis: { focus: "series" },
208
- ...X ? { areaStyle: X } : {},
209
- ...E
210
- });
211
- const U = {
212
- color: p.color,
213
- name: p.name,
214
- type: "line",
215
- lineStyle: { type: "dashed" },
216
- showSymbol: !1,
217
- emphasis: { focus: "series" }
218
- };
219
- F.length > 0 && i.push({
220
- ...U,
221
- data: F
222
- }), W.length > 0 && i.push({
223
- ...U,
224
- data: W
225
- });
226
- }
227
- return {
228
- aria: {
229
- enabled: !0,
230
- ...L && { label: { description: L } }
231
- },
232
- brush: {
233
- xAxisIndex: "all",
234
- brushType: "lineX",
235
- brushMode: "single",
236
- outOfBrush: {
237
- colorAlpha: 0.3
238
- },
239
- brushStyle: {
240
- borderWidth: 1,
241
- color: "rgba(120,140,180,0.3)",
242
- borderColor: "rgba(120,140,180,0.8)"
243
- }
244
- },
245
- tooltip: {
246
- trigger: "axis",
247
- showContent: !1,
248
- axisPointer: { type: "shadow" }
249
- },
250
- backgroundColor: "transparent",
251
- toolbox: { show: !1 },
252
- ...w ? { legend: { show: !1 } } : {},
253
- xAxis: {
254
- name: r,
255
- nameLocation: "middle",
256
- nameGap: 30,
257
- type: "time",
258
- splitLine: {
259
- show: !1
260
- },
261
- axisLine: { show: !1 },
262
- splitNumber: o ?? 5,
263
- ...s && {
264
- axisLabel: {
265
- formatter: (p) => s(p)
266
- }
267
- }
268
- },
269
- yAxis: {
270
- name: b,
271
- nameLocation: "middle",
272
- nameGap: 40,
273
- type: "value",
274
- axisTick: { show: !0 },
275
- axisLabel: {
276
- margin: 15,
277
- ...c && {
278
- formatter: (p) => c(p)
279
- }
280
- },
281
- splitLine: {
282
- show: !0,
283
- lineStyle: { type: "dashed", width: 1 }
284
- },
285
- splitNumber: v
286
- },
287
- grid: {
288
- left: b ? 30 : 24,
289
- right: 24,
290
- top: 24,
291
- bottom: r ? 30 : 24
292
- },
293
- series: i
294
- };
295
- }, [
296
- a,
297
- r,
298
- o,
299
- s,
300
- c,
301
- b,
302
- v,
303
- M,
304
- K,
305
- t,
306
- N,
307
- w,
308
- n,
309
- L
310
- ]), oe = ee(() => ({
311
- updateaxispointer: (i) => {
312
- const E = i?.axesInfo?.[0]?.value;
313
- if (E == null) return;
314
- const p = /* @__PURE__ */ new Set(), F = [], W = R.current;
315
- for (const g of C.current) {
316
- if (p.has(g.name) || W && W[g.name] === !1) continue;
317
- p.add(g.name);
318
- const j = De(g.data, E);
319
- j != null && F.push({ name: g.name, value: j, color: g.color });
320
- }
321
- F.sort((g, j) => j.value - g.value);
322
- let _, X = 0;
323
- if (z.current === "single") {
324
- const g = h.current, j = g ? g.convertFromPixel("grid", [0, y.current.y])?.[1] : null;
325
- j != null && F.length > 0 ? _ = [F.reduce(
326
- (de, fe) => Math.abs(fe.value - j) < Math.abs(de.value - j) ? fe : de
327
- )] : _ = F.slice(0, 1);
328
- } else {
329
- const g = l.current;
330
- _ = F.slice(0, g), X = Math.max(0, F.length - g);
331
- }
332
- const U = { ts: E, rows: _, hiddenCount: X };
333
- S((g) => Oe(g, U) ? g : U);
334
- },
335
- globalout: () => {
336
- S(null);
337
- },
338
- // Keep the tooltip in sync with legend selection. Each action fires a
339
- // different event — `legendToggleSelect` → `legendselectchanged`,
340
- // `legendSelect` → `legendselected`, `legendUnSelect` → `legendunselected`
341
- // — and all three carry the full `selected` map, so we listen to all of
342
- // them (params type inferred from `ChartEvents`).
343
- legendselectchanged: (i) => {
344
- R.current = i.selected;
345
- },
346
- legendselected: (i) => {
347
- R.current = i.selected;
348
- },
349
- legendunselected: (i) => {
350
- R.current = i.selected;
351
- },
352
- ...T && {
353
- brushend: (i) => {
354
- const E = i.areas[0].coordRange;
355
- T(E[0], E[1]), h.current?.dispatchAction({ type: "brush", areas: [] });
356
- }
357
- }
358
- }), [T]), J = !!T;
359
- P(() => {
360
- const i = h.current;
361
- if (i && J)
362
- return i.dispatchAction({
363
- type: "takeGlobalCursor",
364
- key: "brush",
365
- brushOption: {
366
- brushType: "lineX",
367
- brushMode: "single"
368
- }
369
- }), () => {
370
- i.dispatchAction({
371
- type: "takeGlobalCursor",
372
- key: "brush",
373
- brushOption: {
374
- brushType: !1
375
- }
376
- });
377
- };
378
- }, [h, J, O]);
379
- const se = D ?? x, ue = m !== null;
380
- return /* @__PURE__ */ k(
381
- Se,
382
- {
383
- open: ue,
384
- trackCursorAxis: ne,
385
- children: [
386
- /* @__PURE__ */ k(
387
- Fe,
388
- {
389
- render: /* @__PURE__ */ d(
390
- "div",
391
- {
392
- ref: $,
393
- className: "relative w-full",
394
- style: { height: I }
395
- }
396
- ),
397
- children: [
398
- O && /* @__PURE__ */ d(Me, { height: I, isDarkMode: u }),
399
- !O && /* @__PURE__ */ d(
400
- ce,
401
- {
402
- echarts: n,
403
- ref: H,
404
- options: re,
405
- height: I,
406
- isDarkMode: u,
407
- onEvents: oe,
408
- optionUpdateBehavior: te
409
- }
410
- )
411
- ]
412
- }
413
- ),
414
- ue && /* @__PURE__ */ d(Te, { children: /* @__PURE__ */ d(
415
- Ie,
416
- {
417
- side: "right",
418
- align: "start",
419
- sideOffset: 12,
420
- collisionAvoidance: { side: "flip", align: "shift" },
421
- collisionBoundary: Z,
422
- collisionPadding: 8,
423
- children: /* @__PURE__ */ d(
424
- Re,
425
- {
426
- "data-mode": u ? "dark" : "light",
427
- className: "bg-kumo-base rounded-lg shadow-lg shadow-kumo-tip-shadow outline outline-1 outline-kumo-fill p-2 min-w-[150px] max-w-xs",
428
- children: /* @__PURE__ */ d(ke, { state: m, formatValue: se })
429
- }
430
- )
431
- }
432
- ) })
433
- ]
434
- }
435
- );
436
- });
437
- Be.displayName = "TimeseriesChart";
438
- const ke = $e(function({
439
- state: n,
440
- formatValue: t
441
- }) {
442
- const { ts: a, rows: r, hiddenCount: o } = n;
443
- return /* @__PURE__ */ k(we, { children: [
444
- /* @__PURE__ */ d("div", { className: "text-xs font-semibold text-kumo-default mb-1", children: Pe(a) }),
445
- r.map((s) => /* @__PURE__ */ k(
446
- "div",
447
- {
448
- className: "flex items-center justify-between gap-4 py-0.5",
449
- children: [
450
- /* @__PURE__ */ k("div", { className: "flex items-center gap-2 min-w-0", children: [
451
- /* @__PURE__ */ d(
452
- "span",
453
- {
454
- className: "w-3 h-3 rounded-full shrink-0",
455
- style: { backgroundColor: s.color }
456
- }
457
- ),
458
- /* @__PURE__ */ d(
459
- "span",
460
- {
461
- className: "text-xs font-medium text-kumo-default truncate",
462
- title: s.name,
463
- children: s.name
464
- }
465
- )
466
- ] }),
467
- /* @__PURE__ */ d("span", { className: "text-xs font-semibold text-kumo-default shrink-0", children: t ? t(s.value) : ze(s.value) })
468
- ]
469
- },
470
- s.name
471
- )),
472
- o > 0 && /* @__PURE__ */ k("div", { className: "text-xs text-kumo-subtle mt-1", children: [
473
- "+",
474
- o,
475
- " more"
476
- ] })
477
- ] });
478
- });
479
- function De(e, n) {
480
- if (e.length === 0) return null;
481
- let t = 0, a = e.length - 1;
482
- for (; t < a; ) {
483
- const r = t + a >> 1;
484
- e[r][0] < n ? t = r + 1 : a = r;
485
- }
486
- return t > 0 && Math.abs(e[t - 1][0] - n) < Math.abs(e[t][0] - n) && t--, e[t][1];
487
- }
488
- function Oe(e, n) {
489
- return !e || e.ts !== n.ts || e.hiddenCount !== n.hiddenCount || e.rows.length !== n.rows.length ? !1 : e.rows.every((t, a) => {
490
- const r = n.rows[a];
491
- return t.name === r.name && t.value === r.value && t.color === r.color;
492
- });
493
- }
494
- const Le = new Intl.NumberFormat(void 0, {
495
- maximumFractionDigits: 3
496
- });
497
- function ze(e) {
498
- return Number.isInteger(e) ? String(e) : Le.format(e);
499
- }
500
- function Me({
501
- height: e,
502
- isDarkMode: n
503
- }) {
504
- const t = e / 2, a = Math.min(e * 0.12, 28), r = 400, o = 120, s = [];
505
- for (let b = 0; b <= o; b++) {
506
- const v = -r + b / o * r * 3, D = t + Math.sin(b / o * 2 * Math.PI * 3) * a;
507
- s.push(`${b === 0 ? "M" : "L"}${v.toFixed(2)},${D.toFixed(2)}`);
508
- }
509
- const c = s.join(" "), x = n ? "rgba(255,255,255,0.5)" : "rgba(0,0,0,0.2)";
510
- return /* @__PURE__ */ d(
511
- "div",
512
- {
513
- "aria-hidden": "true",
514
- className: "absolute inset-0 overflow-hidden",
515
- style: { height: e },
516
- children: /* @__PURE__ */ d(
517
- "svg",
518
- {
519
- width: "100%",
520
- height: e,
521
- viewBox: `0 0 ${r} ${e}`,
522
- preserveAspectRatio: "none",
523
- className: "w-full animate-pulse",
524
- children: /* @__PURE__ */ d(
525
- "path",
526
- {
527
- d: c,
528
- fill: "none",
529
- stroke: x,
530
- strokeWidth: "2",
531
- style: {
532
- animation: "kumo-chart-wave 2.4s linear infinite",
533
- transformOrigin: "0 0"
534
- }
535
- }
536
- )
537
- }
538
- )
539
- }
540
- );
541
- }
542
- function pe(e, n) {
543
- const t = Math.max(0, Math.min(1, n)), a = e.match(
544
- /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
545
- );
546
- if (a)
547
- return `rgba(${a[1]}, ${a[2]}, ${a[3]}, ${t})`;
548
- let r = e.replace(/^#/, "");
549
- r.length === 3 && (r = r[0] + r[0] + r[1] + r[1] + r[2] + r[2]), r.length === 8 && (r = r.slice(0, 6));
550
- const o = parseInt(r.slice(0, 2), 16), s = parseInt(r.slice(2, 4), 16), c = parseInt(r.slice(4, 6), 16);
551
- return `rgba(${o}, ${s}, ${c}, ${t})`;
552
- }
553
- const je = new Intl.DateTimeFormat(void 0, {
554
- month: "short",
555
- day: "numeric",
556
- hour: "2-digit",
557
- minute: "2-digit",
558
- second: "2-digit",
559
- hour12: !1
560
- });
561
- function Pe(e) {
562
- return je.format(new Date(e));
563
- }
564
- const ve = (e) => {
565
- e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.currentTarget.click());
566
- };
567
- function Ge({
568
- color: e,
569
- value: n,
570
- name: t,
571
- unit: a,
572
- inactive: r,
573
- onPointerEnter: o,
574
- onPointerLeave: s,
575
- onClick: c,
576
- className: x
577
- }) {
578
- return /* @__PURE__ */ k(
579
- "div",
580
- {
581
- role: "button",
582
- tabIndex: c ? 0 : -1,
583
- className: B(
584
- "inline-flex flex-col gap-2 min-w-42 py-2",
585
- { "cursor-pointer": !!c },
586
- x
587
- ),
588
- onPointerEnter: o,
589
- onPointerLeave: s,
590
- onClick: c,
591
- onKeyDown: c ? ve : void 0,
592
- children: [
593
- /* @__PURE__ */ k("div", { className: "flex items-center gap-2", children: [
594
- /* @__PURE__ */ d(
595
- "span",
596
- {
597
- className: B("size-2 rounded-full inline-block", {
598
- "opacity-50": r
599
- }),
600
- style: { backgroundColor: e }
601
- }
602
- ),
603
- /* @__PURE__ */ d("span", { className: B("text-xs", { "opacity-50": r }), children: t })
604
- ] }),
605
- /* @__PURE__ */ k("div", { className: "flex items-baseline gap-0.5", children: [
606
- /* @__PURE__ */ d(
607
- "span",
608
- {
609
- className: B("text-lg font-medium leading-none", {
610
- "opacity-50": r
611
- }),
612
- children: n
613
- }
614
- ),
615
- a && /* @__PURE__ */ d(
616
- "span",
617
- {
618
- className: B("text-xs text-kumo-subtle leading-none", {
619
- "opacity-50": r
620
- }),
621
- children: a
622
- }
623
- )
624
- ] })
625
- ]
626
- }
627
- );
628
- }
629
- function He({
630
- color: e,
631
- value: n,
632
- name: t,
633
- inactive: a,
634
- onPointerEnter: r,
635
- onPointerLeave: o,
636
- onClick: s,
637
- className: c
638
- }) {
639
- return /* @__PURE__ */ k(
640
- "div",
641
- {
642
- role: "button",
643
- tabIndex: s ? 0 : -1,
644
- className: B(
645
- "inline-flex items-center gap-2",
646
- { "cursor-pointer": !!s },
647
- c
648
- ),
649
- onPointerEnter: r,
650
- onPointerLeave: o,
651
- onClick: s,
652
- onKeyDown: s ? ve : void 0,
653
- children: [
654
- /* @__PURE__ */ d(
655
- "span",
656
- {
657
- className: B("size-2 rounded-full inline-block", {
658
- "opacity-50": a
659
- }),
660
- style: { backgroundColor: e }
661
- }
662
- ),
663
- /* @__PURE__ */ d("span", { className: B("text-xs", { "opacity-50": a }), children: t }),
664
- /* @__PURE__ */ d("span", { className: B("text-xs font-medium", { "opacity-50": a }), children: n })
665
- ]
666
- }
667
- );
668
- }
669
- const Ze = {
670
- SmallItem: He,
671
- LargeItem: Ge
672
- }, We = (e) => e.toLocaleString();
673
- function qe(e) {
674
- return typeof e == "object" && e !== null;
675
- }
676
- const Q = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), ge = (e) => e.replace(/[{}|]/g, (n) => `\\${n}`), ae = (e) => {
677
- const n = "#666";
678
- return !e || typeof e != "string" ? n : /^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e) || /^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(?:,\s*[\d.]+\s*)?\)$/i.test(
679
- e
680
- ) || /^hsla?\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*(?:,\s*[\d.]+\s*)?\)$/i.test(
681
- e
682
- ) || /^[a-z]{3,20}$/i.test(e) ? e : n;
683
- };
684
- function Ve({
685
- echarts: e,
686
- nodes: n,
687
- links: t,
688
- height: a = 400,
689
- nodeWidth: r = 8,
690
- nodePadding: o = 10,
691
- showTooltip: s = !0,
692
- showNodeValues: c,
693
- nodeLabelLayout: x = "stacked",
694
- formatValue: b = We,
695
- tooltipFormatter: v,
696
- defaultNodeColor: D,
697
- left: T,
698
- right: I,
699
- linkColor: f = "gradient",
700
- linkOpacity: w = 0.5,
701
- className: u,
702
- isDarkMode: N,
703
- onNodeClick: O,
704
- onLinkClick: L
705
- }) {
706
- const te = n.some((h) => h.value !== void 0), q = c ?? te, V = x === "inline", ne = ee(() => {
707
- const h = Y.text("primary", N), $ = Y.text("secondary", N), H = n.map(
708
- (l, m) => l.color ?? D ?? Y.categorical(m, N)
709
- ), C = new Map(
710
- n.map((l, m) => [l.name, { ...l, computedColor: H[m] }])
711
- ), R = n.map((l, m) => ({
712
- name: l.name,
713
- value: l.value,
714
- itemStyle: {
715
- color: H[m]
716
- }
717
- })), z = t.map((l) => ({
718
- source: n[l.source]?.name ?? "",
719
- target: n[l.target]?.name ?? "",
720
- value: l.value
721
- }));
722
- return {
723
- backgroundColor: "transparent",
724
- animation: !0,
725
- animationDuration: 500,
726
- animationDurationUpdate: 300,
727
- animationEasingUpdate: "cubicInOut",
728
- tooltip: s ? {
729
- trigger: "item",
730
- triggerOn: "mousemove",
731
- dangerousHtmlFormatter: (l) => {
732
- if (!qe(l)) return "";
733
- if (l.dataType === "node" && l.name) {
734
- const m = C.get(l.name), S = ae(
735
- m?.computedColor ?? l.color ?? "#666"
736
- );
737
- if (v)
738
- return v({
739
- type: "node",
740
- name: l.name,
741
- node: m,
742
- color: S
743
- });
744
- const y = Q(l.name);
745
- return `<div style="display:flex;align-items:center;gap:6px;"><span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${S}"></span><strong>${y}</strong></div>`;
746
- }
747
- if (l.dataType === "edge" && l.data) {
748
- const { source: m, target: S, value: y } = l.data;
749
- if (v)
750
- return v({
751
- type: "link",
752
- name: `${m} → ${S}`,
753
- link: {
754
- source: m ?? "",
755
- target: S ?? "",
756
- value: y ?? 0
757
- }
758
- });
759
- const M = C.get(m ?? ""), K = C.get(S ?? ""), re = ae(
760
- M?.computedColor ?? "#666"
761
- ), oe = ae(
762
- K?.computedColor ?? "#666"
763
- ), J = Q(m ?? ""), se = Q(S ?? "");
764
- return `<div style="display:flex;align-items:center;gap:6px;margin-bottom:4px;">
765
- <span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${re}"></span>
766
- <strong>${J}</strong>
767
- <span style="color:${$}">→</span>
768
- <span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${oe}"></span>
769
- <strong>${se}</strong>
770
- </div>
771
- <strong>${y !== void 0 ? Q(b(y)) : ""}</strong>`;
772
- }
773
- return "";
774
- }
775
- } : void 0,
776
- series: [
777
- {
778
- type: "sankey",
779
- ...T !== void 0 && { left: T },
780
- ...I !== void 0 && { right: I },
781
- data: R,
782
- links: z,
783
- draggable: !1,
784
- emphasis: {
785
- focus: "adjacency"
786
- },
787
- nodeWidth: r,
788
- nodeGap: o,
789
- lineStyle: {
790
- color: f === "gradient" ? "source" : "#d1d5db",
791
- opacity: f === "gradient" ? w : 0.4,
792
- curveness: 0.5
793
- },
794
- label: {
795
- show: !0,
796
- color: h,
797
- fontSize: 12,
798
- formatter: q ? (l) => {
799
- const m = l.name ?? "", S = C.get(m), y = ge(m);
800
- if (S?.value !== void 0) {
801
- const M = ge(
802
- b(S.value)
803
- );
804
- return V ? `{name|${y}} {value|${M}}` : `{value|${M}}
805
- {name|${y}}`;
806
- }
807
- return y;
808
- } : void 0,
809
- rich: q ? {
810
- value: {
811
- fontSize: 11,
812
- color: h,
813
- lineHeight: V ? void 0 : 16
814
- },
815
- name: {
816
- fontSize: 12,
817
- color: h,
818
- fontWeight: 700
819
- }
820
- } : void 0
821
- }
822
- }
823
- ]
824
- };
825
- }, [
826
- n,
827
- t,
828
- s,
829
- r,
830
- o,
831
- D,
832
- T,
833
- I,
834
- N,
835
- f,
836
- w,
837
- q,
838
- V,
839
- b,
840
- v
841
- ]), Z = be(
842
- (h) => {
843
- if (h.dataType === "node" && O && h.name) {
844
- const $ = n.findIndex((R) => R.name === h.name), C = {
845
- ...$ >= 0 ? n[$] : null,
846
- name: h.name
847
- };
848
- O(C);
849
- } else if (h.dataType === "edge" && L && h.data) {
850
- const $ = h.data, H = typeof $ == "object" && $ !== null && "source" in $ ? String($.source) : "", C = typeof $ == "object" && $ !== null && "target" in $ ? String($.target) : "", R = n.findIndex((y) => y.name === H), z = n.findIndex((y) => y.name === C);
851
- if (R === -1 || z === -1) return;
852
- const l = h.value, m = typeof l == "number" ? l : Array.isArray(l) && typeof l[0] == "number" ? l[0] : 0, S = t.find(
853
- (y) => y.source === R && y.target === z
854
- );
855
- L({
856
- ...S,
857
- source: R,
858
- target: z,
859
- value: m
860
- });
861
- }
862
- },
863
- [n, t, O, L]
864
- ), G = ee(
865
- () => ({
866
- click: Z
867
- }),
868
- [Z]
869
- );
870
- return /* @__PURE__ */ d(
871
- ce,
872
- {
873
- echarts: e,
874
- options: ne,
875
- className: u,
876
- isDarkMode: N,
877
- height: a,
878
- onEvents: G
879
- }
880
- );
881
- }
882
- Ve.displayName = "SankeyChart";
883
- export {
884
- ce as C,
885
- Ve as S,
886
- Be as T,
887
- Ze as a,
888
- Y as b
889
- };
890
- //# sourceMappingURL=SankeyChart-g1tng405ml2e0qg2.js.map