@lobehub/charts 6.0.0-beta.1 → 6.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 (404) hide show
  1. package/README.md +3 -3
  2. package/es/AccuracyBarChart/index.d.mts +62 -0
  3. package/es/AccuracyBarChart/index.mjs +324 -0
  4. package/es/AccuracyBarChart/index.mjs.map +1 -0
  5. package/es/AccuracyBarChart/styles.d.mts +14 -0
  6. package/es/AccuracyBarChart/styles.mjs +71 -0
  7. package/es/AccuracyBarChart/styles.mjs.map +1 -0
  8. package/es/AreaChart/index.d.mts +13 -0
  9. package/es/AreaChart/index.mjs +306 -0
  10. package/es/AreaChart/index.mjs.map +1 -0
  11. package/es/AreaChart/styles.d.mts +9 -0
  12. package/es/AreaChart/styles.mjs +28 -0
  13. package/es/AreaChart/styles.mjs.map +1 -0
  14. package/es/BarChart/index.d.mts +11 -0
  15. package/es/BarChart/index.mjs +288 -0
  16. package/es/BarChart/index.mjs.map +1 -0
  17. package/es/BarChart/{renderShape.d.ts → renderShape.d.mts} +3 -1
  18. package/es/BarChart/renderShape.mjs +28 -0
  19. package/es/BarChart/renderShape.mjs.map +1 -0
  20. package/es/BarChart/styles.d.mts +9 -0
  21. package/es/BarChart/styles.mjs +28 -0
  22. package/es/BarChart/styles.mjs.map +1 -0
  23. package/es/BarList/index.d.mts +32 -0
  24. package/es/BarList/index.mjs +126 -0
  25. package/es/BarList/index.mjs.map +1 -0
  26. package/es/BarList/styles.d.mts +13 -0
  27. package/es/BarList/styles.mjs +63 -0
  28. package/es/BarList/styles.mjs.map +1 -0
  29. package/es/BenchmarkColumnChart/index.d.mts +144 -0
  30. package/es/BenchmarkColumnChart/index.mjs +512 -0
  31. package/es/BenchmarkColumnChart/index.mjs.map +1 -0
  32. package/es/BenchmarkColumnChart/styles.d.mts +19 -0
  33. package/es/BenchmarkColumnChart/styles.mjs +129 -0
  34. package/es/BenchmarkColumnChart/styles.mjs.map +1 -0
  35. package/es/BenchmarkRankingChart/index.d.mts +91 -0
  36. package/es/BenchmarkRankingChart/index.mjs +345 -0
  37. package/es/BenchmarkRankingChart/index.mjs.map +1 -0
  38. package/es/BenchmarkRankingChart/styles.d.mts +36 -0
  39. package/es/BenchmarkRankingChart/styles.mjs +265 -0
  40. package/es/BenchmarkRankingChart/styles.mjs.map +1 -0
  41. package/es/BenchmarkScatterChart/index.d.mts +148 -0
  42. package/es/BenchmarkScatterChart/index.mjs +666 -0
  43. package/es/BenchmarkScatterChart/index.mjs.map +1 -0
  44. package/es/BenchmarkScatterChart/styles.d.mts +28 -0
  45. package/es/BenchmarkScatterChart/styles.mjs +193 -0
  46. package/es/BenchmarkScatterChart/styles.mjs.map +1 -0
  47. package/es/BenchmarkScatterChart/{utils.d.ts → utils.d.mts} +32 -29
  48. package/es/BenchmarkScatterChart/utils.mjs +214 -0
  49. package/es/BenchmarkScatterChart/utils.mjs.map +1 -0
  50. package/es/ComposedChart/index.d.mts +6 -0
  51. package/es/ComposedChart/index.mjs +252 -0
  52. package/es/ComposedChart/index.mjs.map +1 -0
  53. package/es/ComposedChart/styles.d.mts +9 -0
  54. package/es/ComposedChart/styles.mjs +28 -0
  55. package/es/ComposedChart/styles.mjs.map +1 -0
  56. package/es/ComposedChart/types.d.mts +71 -0
  57. package/es/ComposedChart/types.mjs +0 -0
  58. package/es/DataBars/CategoryBar.d.mts +17 -0
  59. package/es/DataBars/CategoryBar.mjs +144 -0
  60. package/es/DataBars/CategoryBar.mjs.map +1 -0
  61. package/es/DataBars/DeltaBar.d.mts +16 -0
  62. package/es/DataBars/DeltaBar.mjs +100 -0
  63. package/es/DataBars/DeltaBar.mjs.map +1 -0
  64. package/es/DataBars/MarkerBar.d.mts +19 -0
  65. package/es/DataBars/MarkerBar.mjs +72 -0
  66. package/es/DataBars/MarkerBar.mjs.map +1 -0
  67. package/es/DataBars/ProgressBar.d.mts +15 -0
  68. package/es/DataBars/ProgressBar.mjs +51 -0
  69. package/es/DataBars/ProgressBar.mjs.map +1 -0
  70. package/es/DataBars/index.d.mts +5 -0
  71. package/es/DataBars/index.mjs +5 -0
  72. package/es/DataBars/styles.d.mts +10 -0
  73. package/es/DataBars/styles.mjs +31 -0
  74. package/es/DataBars/styles.mjs.map +1 -0
  75. package/es/DonutChart/DonutChartTooltip.d.mts +14 -0
  76. package/es/DonutChart/DonutChartTooltip.mjs +25 -0
  77. package/es/DonutChart/DonutChartTooltip.mjs.map +1 -0
  78. package/es/DonutChart/index.d.mts +33 -0
  79. package/es/DonutChart/index.mjs +158 -0
  80. package/es/DonutChart/index.mjs.map +1 -0
  81. package/es/DonutChart/inputParser.d.mts +5 -0
  82. package/es/DonutChart/inputParser.mjs +8 -0
  83. package/es/DonutChart/inputParser.mjs.map +1 -0
  84. package/es/DonutChart/renderInactiveShape.d.mts +4 -0
  85. package/es/DonutChart/renderInactiveShape.mjs +22 -0
  86. package/es/DonutChart/renderInactiveShape.mjs.map +1 -0
  87. package/es/DonutChart/styles.d.mts +9 -0
  88. package/es/DonutChart/styles.mjs +28 -0
  89. package/es/DonutChart/styles.mjs.map +1 -0
  90. package/es/FunnelChart/ArrowRightIcon.d.mts +8 -0
  91. package/es/FunnelChart/ArrowRightIcon.mjs +14 -0
  92. package/es/FunnelChart/ArrowRightIcon.mjs.map +1 -0
  93. package/es/FunnelChart/index.d.mts +21 -0
  94. package/es/FunnelChart/index.mjs +419 -0
  95. package/es/FunnelChart/index.mjs.map +1 -0
  96. package/es/FunnelChart/styles.d.mts +9 -0
  97. package/es/FunnelChart/styles.mjs +28 -0
  98. package/es/FunnelChart/styles.mjs.map +1 -0
  99. package/es/FunnelChart/types.d.mts +31 -0
  100. package/es/FunnelChart/types.mjs +0 -0
  101. package/es/Heatmaps/Calendar.d.mts +21 -0
  102. package/es/Heatmaps/Calendar.mjs +107 -0
  103. package/es/Heatmaps/Calendar.mjs.map +1 -0
  104. package/es/Heatmaps/ChartLabels.d.mts +17 -0
  105. package/es/Heatmaps/ChartLabels.mjs +84 -0
  106. package/es/Heatmaps/ChartLabels.mjs.map +1 -0
  107. package/es/Heatmaps/Footer.d.mts +24 -0
  108. package/es/Heatmaps/Footer.mjs +81 -0
  109. package/es/Heatmaps/Footer.mjs.map +1 -0
  110. package/es/Heatmaps/index.d.mts +31 -0
  111. package/es/Heatmaps/index.mjs +186 -0
  112. package/es/Heatmaps/index.mjs.map +1 -0
  113. package/es/Heatmaps/styles.d.mts +10 -0
  114. package/es/Heatmaps/styles.mjs +47 -0
  115. package/es/Heatmaps/styles.mjs.map +1 -0
  116. package/es/Legend/LegendItem.d.mts +12 -0
  117. package/es/Legend/LegendItem.mjs +63 -0
  118. package/es/Legend/LegendItem.mjs.map +1 -0
  119. package/es/Legend/ScrollButton.d.mts +11 -0
  120. package/es/Legend/ScrollButton.mjs +49 -0
  121. package/es/Legend/ScrollButton.mjs.map +1 -0
  122. package/es/Legend/index.d.mts +16 -0
  123. package/es/Legend/index.mjs +151 -0
  124. package/es/Legend/index.mjs.map +1 -0
  125. package/es/LineChart/index.d.mts +11 -0
  126. package/es/LineChart/index.mjs +269 -0
  127. package/es/LineChart/index.mjs.map +1 -0
  128. package/es/LineChart/styles.d.mts +9 -0
  129. package/es/LineChart/styles.mjs +28 -0
  130. package/es/LineChart/styles.mjs.map +1 -0
  131. package/es/RadarChart/index.d.mts +27 -0
  132. package/es/RadarChart/index.mjs +155 -0
  133. package/es/RadarChart/index.mjs.map +1 -0
  134. package/es/RadarChart/styles.d.mts +8 -0
  135. package/es/RadarChart/styles.mjs +23 -0
  136. package/es/RadarChart/styles.mjs.map +1 -0
  137. package/es/ScatterChart/ScatterChartTooltip.d.mts +19 -0
  138. package/es/ScatterChart/ScatterChartTooltip.mjs +50 -0
  139. package/es/ScatterChart/ScatterChartTooltip.mjs.map +1 -0
  140. package/es/ScatterChart/ScatterChartTooltipRow.d.mts +10 -0
  141. package/es/ScatterChart/ScatterChartTooltipRow.mjs +34 -0
  142. package/es/ScatterChart/ScatterChartTooltipRow.mjs.map +1 -0
  143. package/es/ScatterChart/index.d.mts +58 -0
  144. package/es/ScatterChart/index.mjs +239 -0
  145. package/es/ScatterChart/index.mjs.map +1 -0
  146. package/es/ScatterChart/{renderShape.d.ts → renderShape.d.mts} +4 -1
  147. package/es/ScatterChart/renderShape.mjs +18 -0
  148. package/es/ScatterChart/renderShape.mjs.map +1 -0
  149. package/es/ScatterChart/styles.d.mts +9 -0
  150. package/es/ScatterChart/styles.mjs +28 -0
  151. package/es/ScatterChart/styles.mjs.map +1 -0
  152. package/es/SparkChart/SparkAreaChart.d.mts +14 -0
  153. package/es/SparkChart/SparkAreaChart.mjs +107 -0
  154. package/es/SparkChart/SparkAreaChart.mjs.map +1 -0
  155. package/es/SparkChart/SparkBarChart.d.mts +11 -0
  156. package/es/SparkChart/SparkBarChart.mjs +67 -0
  157. package/es/SparkChart/SparkBarChart.mjs.map +1 -0
  158. package/es/SparkChart/SparkLineChart.d.mts +12 -0
  159. package/es/SparkChart/SparkLineChart.mjs +71 -0
  160. package/es/SparkChart/SparkLineChart.mjs.map +1 -0
  161. package/es/SparkChart/index.d.mts +4 -0
  162. package/es/SparkChart/index.mjs +4 -0
  163. package/es/Tracker/TrackerBlock.d.mts +11 -0
  164. package/es/Tracker/TrackerBlock.mjs +50 -0
  165. package/es/Tracker/TrackerBlock.mjs.map +1 -0
  166. package/es/Tracker/index.d.mts +21 -0
  167. package/es/Tracker/index.mjs +67 -0
  168. package/es/Tracker/index.mjs.map +1 -0
  169. package/es/Tracker/styles.d.mts +8 -0
  170. package/es/Tracker/styles.mjs +24 -0
  171. package/es/Tracker/styles.mjs.map +1 -0
  172. package/es/common/BaseAnimationTimingProps.d.mts +10 -0
  173. package/es/common/BaseAnimationTimingProps.mjs +0 -0
  174. package/es/common/BaseChartProps.d.mts +61 -0
  175. package/es/common/BaseChartProps.mjs +0 -0
  176. package/es/common/BaseSparkChartProps.d.mts +17 -0
  177. package/es/common/BaseSparkChartProps.mjs +0 -0
  178. package/es/common/ChartLegend.d.mts +8 -0
  179. package/es/common/ChartLegend.mjs +32 -0
  180. package/es/common/ChartLegend.mjs.map +1 -0
  181. package/es/common/ChartTooltip/ChartTooltipFrame.d.mts +8 -0
  182. package/es/common/ChartTooltip/ChartTooltipFrame.mjs +26 -0
  183. package/es/common/ChartTooltip/ChartTooltipFrame.mjs.map +1 -0
  184. package/es/common/ChartTooltip/ChartTooltipRow.d.mts +10 -0
  185. package/es/common/ChartTooltip/ChartTooltipRow.mjs +49 -0
  186. package/es/common/ChartTooltip/ChartTooltipRow.mjs.map +1 -0
  187. package/es/common/ChartTooltip/index.d.mts +18 -0
  188. package/es/common/ChartTooltip/index.mjs +48 -0
  189. package/es/common/ChartTooltip/index.mjs.map +1 -0
  190. package/es/common/CustomTooltipProps.d.mts +15 -0
  191. package/es/common/CustomTooltipProps.mjs +0 -0
  192. package/es/common/CustomYAxisTick.d.mts +18 -0
  193. package/es/common/CustomYAxisTick.mjs +24 -0
  194. package/es/common/CustomYAxisTick.mjs.map +1 -0
  195. package/es/common/NoData.d.mts +13 -0
  196. package/es/common/NoData.mjs +25 -0
  197. package/es/common/NoData.mjs.map +1 -0
  198. package/es/common/benchmark/index.d.mts +3 -0
  199. package/es/common/benchmark/{index.js → index.mjs} +1 -1
  200. package/es/common/benchmark/types.d.mts +125 -0
  201. package/es/common/benchmark/types.mjs +0 -0
  202. package/es/common/benchmark/{utils.d.ts → utils.d.mts} +38 -36
  203. package/es/common/benchmark/utils.mjs +115 -0
  204. package/es/common/benchmark/utils.mjs.map +1 -0
  205. package/es/common/{utils.d.ts → utils.d.mts} +3 -0
  206. package/es/common/utils.mjs +36 -0
  207. package/es/common/utils.mjs.map +1 -0
  208. package/es/hooks/useOnWindowResize.d.mts +6 -0
  209. package/es/hooks/useOnWindowResize.mjs +18 -0
  210. package/es/hooks/useOnWindowResize.mjs.map +1 -0
  211. package/es/hooks/usePrefersReducedMotion.d.mts +4 -0
  212. package/es/hooks/usePrefersReducedMotion.mjs +24 -0
  213. package/es/hooks/usePrefersReducedMotion.mjs.map +1 -0
  214. package/es/hooks/useThemeColorRange.d.mts +4 -0
  215. package/es/hooks/useThemeColorRange.mjs +28 -0
  216. package/es/hooks/useThemeColorRange.mjs.map +1 -0
  217. package/es/index.d.mts +34 -0
  218. package/es/index.mjs +28 -0
  219. package/es/types/{charts.d.ts → charts.d.mts} +26 -26
  220. package/es/types/charts.mjs +12 -0
  221. package/es/types/charts.mjs.map +1 -0
  222. package/es/utils/{calendar.d.ts → calendar.d.mts} +21 -18
  223. package/es/utils/calendar.mjs +154 -0
  224. package/es/utils/calendar.mjs.map +1 -0
  225. package/es/utils/getMaxLabelLength.d.mts +13 -0
  226. package/es/utils/getMaxLabelLength.mjs +48 -0
  227. package/es/utils/getMaxLabelLength.mjs.map +1 -0
  228. package/es/utils/{index.d.ts → index.d.mts} +4 -1
  229. package/es/utils/index.mjs +19 -0
  230. package/es/utils/index.mjs.map +1 -0
  231. package/es/utils/{theme.d.ts → theme.d.mts} +3 -0
  232. package/es/utils/theme.mjs +33 -0
  233. package/es/utils/theme.mjs.map +1 -0
  234. package/package.json +144 -5
  235. package/es/AccuracyBarChart/index.d.ts +0 -60
  236. package/es/AccuracyBarChart/index.js +0 -452
  237. package/es/AccuracyBarChart/index.mdx +0 -52
  238. package/es/AccuracyBarChart/styles.d.ts +0 -11
  239. package/es/AccuracyBarChart/styles.js +0 -18
  240. package/es/AreaChart/index.d.ts +0 -11
  241. package/es/AreaChart/index.js +0 -428
  242. package/es/AreaChart/index.mdx +0 -49
  243. package/es/AreaChart/styles.d.ts +0 -6
  244. package/es/AreaChart/styles.js +0 -13
  245. package/es/BarChart/index.d.ts +0 -9
  246. package/es/BarChart/index.js +0 -390
  247. package/es/BarChart/index.mdx +0 -73
  248. package/es/BarChart/renderShape.js +0 -34
  249. package/es/BarChart/styles.d.ts +0 -6
  250. package/es/BarChart/styles.js +0 -13
  251. package/es/BarList/index.d.ts +0 -29
  252. package/es/BarList/index.js +0 -172
  253. package/es/BarList/index.mdx +0 -34
  254. package/es/BarList/styles.d.ts +0 -10
  255. package/es/BarList/styles.js +0 -18
  256. package/es/BenchmarkColumnChart/index.d.ts +0 -140
  257. package/es/BenchmarkColumnChart/index.js +0 -684
  258. package/es/BenchmarkColumnChart/index.mdx +0 -66
  259. package/es/BenchmarkColumnChart/styles.d.ts +0 -16
  260. package/es/BenchmarkColumnChart/styles.js +0 -23
  261. package/es/BenchmarkRankingChart/index.d.ts +0 -87
  262. package/es/BenchmarkRankingChart/index.js +0 -453
  263. package/es/BenchmarkRankingChart/index.mdx +0 -59
  264. package/es/BenchmarkRankingChart/styles.d.ts +0 -33
  265. package/es/BenchmarkRankingChart/styles.js +0 -41
  266. package/es/BenchmarkScatterChart/index.d.ts +0 -145
  267. package/es/BenchmarkScatterChart/index.js +0 -855
  268. package/es/BenchmarkScatterChart/index.mdx +0 -61
  269. package/es/BenchmarkScatterChart/styles.d.ts +0 -25
  270. package/es/BenchmarkScatterChart/styles.js +0 -33
  271. package/es/BenchmarkScatterChart/utils.js +0 -353
  272. package/es/ComposedChart/index.d.ts +0 -5
  273. package/es/ComposedChart/index.js +0 -333
  274. package/es/ComposedChart/index.mdx +0 -43
  275. package/es/ComposedChart/styles.d.ts +0 -6
  276. package/es/ComposedChart/styles.js +0 -13
  277. package/es/ComposedChart/types.d.ts +0 -68
  278. package/es/ComposedChart/types.js +0 -1
  279. package/es/DataBars/CategoryBar.d.ts +0 -15
  280. package/es/DataBars/CategoryBar.js +0 -199
  281. package/es/DataBars/DeltaBar.d.ts +0 -13
  282. package/es/DataBars/DeltaBar.js +0 -115
  283. package/es/DataBars/MarkerBar.d.ts +0 -16
  284. package/es/DataBars/MarkerBar.js +0 -92
  285. package/es/DataBars/ProgressBar.d.ts +0 -12
  286. package/es/DataBars/ProgressBar.js +0 -69
  287. package/es/DataBars/index.d.ts +0 -4
  288. package/es/DataBars/index.js +0 -4
  289. package/es/DataBars/index.mdx +0 -36
  290. package/es/DataBars/styles.d.ts +0 -7
  291. package/es/DataBars/styles.js +0 -14
  292. package/es/DonutChart/DonutChartTooltip.d.ts +0 -11
  293. package/es/DonutChart/DonutChartTooltip.js +0 -26
  294. package/es/DonutChart/index.d.ts +0 -31
  295. package/es/DonutChart/index.js +0 -230
  296. package/es/DonutChart/index.mdx +0 -48
  297. package/es/DonutChart/inputParser.d.ts +0 -2
  298. package/es/DonutChart/inputParser.js +0 -9
  299. package/es/DonutChart/renderInactiveShape.d.ts +0 -2
  300. package/es/DonutChart/renderInactiveShape.js +0 -27
  301. package/es/DonutChart/styles.d.ts +0 -6
  302. package/es/DonutChart/styles.js +0 -13
  303. package/es/FunnelChart/ArrowRightIcon.d.ts +0 -5
  304. package/es/FunnelChart/ArrowRightIcon.js +0 -22
  305. package/es/FunnelChart/index.d.ts +0 -19
  306. package/es/FunnelChart/index.js +0 -497
  307. package/es/FunnelChart/index.mdx +0 -21
  308. package/es/FunnelChart/styles.d.ts +0 -6
  309. package/es/FunnelChart/styles.js +0 -13
  310. package/es/FunnelChart/types.d.ts +0 -28
  311. package/es/FunnelChart/types.js +0 -1
  312. package/es/Heatmaps/Calendar.d.ts +0 -18
  313. package/es/Heatmaps/Calendar.js +0 -154
  314. package/es/Heatmaps/ChartLabels.d.ts +0 -15
  315. package/es/Heatmaps/ChartLabels.js +0 -106
  316. package/es/Heatmaps/Footer.d.ts +0 -22
  317. package/es/Heatmaps/Footer.js +0 -105
  318. package/es/Heatmaps/index.d.ts +0 -28
  319. package/es/Heatmaps/index.js +0 -225
  320. package/es/Heatmaps/index.mdx +0 -70
  321. package/es/Heatmaps/styles.d.ts +0 -7
  322. package/es/Heatmaps/styles.js +0 -14
  323. package/es/Legend/LegendItem.d.ts +0 -10
  324. package/es/Legend/LegendItem.js +0 -56
  325. package/es/Legend/ScrollButton.d.ts +0 -9
  326. package/es/Legend/ScrollButton.js +0 -62
  327. package/es/Legend/index.d.ts +0 -14
  328. package/es/Legend/index.js +0 -183
  329. package/es/Legend/index.mdx +0 -13
  330. package/es/LineChart/index.d.ts +0 -9
  331. package/es/LineChart/index.js +0 -386
  332. package/es/LineChart/index.mdx +0 -49
  333. package/es/LineChart/styles.d.ts +0 -6
  334. package/es/LineChart/styles.js +0 -13
  335. package/es/RadarChart/index.d.ts +0 -24
  336. package/es/RadarChart/index.js +0 -252
  337. package/es/RadarChart/index.mdx +0 -52
  338. package/es/RadarChart/styles.d.ts +0 -5
  339. package/es/RadarChart/styles.js +0 -12
  340. package/es/ScatterChart/ScatterChartTooltip.d.ts +0 -16
  341. package/es/ScatterChart/ScatterChartTooltip.js +0 -74
  342. package/es/ScatterChart/ScatterChartTooltipRow.d.ts +0 -7
  343. package/es/ScatterChart/ScatterChartTooltipRow.js +0 -38
  344. package/es/ScatterChart/index.d.ts +0 -56
  345. package/es/ScatterChart/index.js +0 -340
  346. package/es/ScatterChart/index.mdx +0 -49
  347. package/es/ScatterChart/renderShape.js +0 -18
  348. package/es/ScatterChart/styles.d.ts +0 -6
  349. package/es/ScatterChart/styles.js +0 -13
  350. package/es/SparkChart/SparkAreaChart.d.ts +0 -12
  351. package/es/SparkChart/SparkAreaChart.js +0 -146
  352. package/es/SparkChart/SparkBarChart.d.ts +0 -9
  353. package/es/SparkChart/SparkBarChart.js +0 -104
  354. package/es/SparkChart/SparkLineChart.d.ts +0 -10
  355. package/es/SparkChart/SparkLineChart.js +0 -108
  356. package/es/SparkChart/index.d.ts +0 -3
  357. package/es/SparkChart/index.js +0 -3
  358. package/es/SparkChart/index.mdx +0 -29
  359. package/es/Tracker/TrackerBlock.d.ts +0 -8
  360. package/es/Tracker/TrackerBlock.js +0 -62
  361. package/es/Tracker/index.d.ts +0 -18
  362. package/es/Tracker/index.js +0 -103
  363. package/es/Tracker/index.mdx +0 -41
  364. package/es/Tracker/styles.d.ts +0 -5
  365. package/es/Tracker/styles.js +0 -12
  366. package/es/common/BaseAnimationTimingProps.d.ts +0 -7
  367. package/es/common/BaseAnimationTimingProps.js +0 -1
  368. package/es/common/BaseChartProps.d.ts +0 -58
  369. package/es/common/BaseChartProps.js +0 -1
  370. package/es/common/BaseSparkChartProps.d.ts +0 -14
  371. package/es/common/BaseSparkChartProps.js +0 -1
  372. package/es/common/ChartLegend.d.ts +0 -5
  373. package/es/common/ChartLegend.js +0 -40
  374. package/es/common/ChartTooltip/ChartTooltipFrame.d.ts +0 -6
  375. package/es/common/ChartTooltip/ChartTooltipFrame.js +0 -31
  376. package/es/common/ChartTooltip/ChartTooltipRow.d.ts +0 -8
  377. package/es/common/ChartTooltip/ChartTooltipRow.js +0 -53
  378. package/es/common/ChartTooltip/index.d.ts +0 -15
  379. package/es/common/ChartTooltip/index.js +0 -64
  380. package/es/common/CustomTooltipProps.d.ts +0 -12
  381. package/es/common/CustomTooltipProps.js +0 -1
  382. package/es/common/CustomYAxisTick.d.ts +0 -15
  383. package/es/common/CustomYAxisTick.js +0 -27
  384. package/es/common/NoData.d.ts +0 -10
  385. package/es/common/NoData.js +0 -24
  386. package/es/common/benchmark/index.d.ts +0 -2
  387. package/es/common/benchmark/types.d.ts +0 -122
  388. package/es/common/benchmark/types.js +0 -1
  389. package/es/common/benchmark/utils.js +0 -159
  390. package/es/common/utils.js +0 -85
  391. package/es/hooks/useOnWindowResize.d.ts +0 -3
  392. package/es/hooks/useOnWindowResize.js +0 -15
  393. package/es/hooks/usePrefersReducedMotion.d.ts +0 -1
  394. package/es/hooks/usePrefersReducedMotion.js +0 -28
  395. package/es/hooks/useThemeColorRange.d.ts +0 -1
  396. package/es/hooks/useThemeColorRange.js +0 -8
  397. package/es/index.d.ts +0 -24
  398. package/es/index.js +0 -22
  399. package/es/types/charts.js +0 -8
  400. package/es/utils/calendar.js +0 -199
  401. package/es/utils/getMaxLabelLength.d.ts +0 -10
  402. package/es/utils/getMaxLabelLength.js +0 -110
  403. package/es/utils/index.js +0 -32
  404. package/es/utils/theme.js +0 -40
@@ -1,104 +0,0 @@
1
- 'use client';
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- var _templateObject;
5
- var _excluded = ["data", "categories", "index", "colors", "stack", "relative", "animationDuration", "showAnimation", "noDataText", "loading", "autoMinValue", "minValue", "maxValue", "className", "width", "height", "style"];
6
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
7
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
- import { Flexbox, Skeleton, css, cssVar, cx } from '@lobehub/ui';
15
- import { forwardRef } from 'react';
16
- import { Bar, BarChart as ReChartsBarChart, ResponsiveContainer, XAxis, YAxis } from 'recharts';
17
- import NoData from "../common/NoData";
18
- import { constructCategoryColors, getYAxisDomain } from "../common/utils";
19
- import { useThemeColorRange } from "../hooks/useThemeColorRange";
20
- import { jsx as _jsx } from "react/jsx-runtime";
21
- import { jsxs as _jsxs } from "react/jsx-runtime";
22
- var SparkBarChart = /*#__PURE__*/forwardRef(function (props, ref) {
23
- var themeColorRange = useThemeColorRange();
24
- var _props$data = props.data,
25
- data = _props$data === void 0 ? [] : _props$data,
26
- _props$categories = props.categories,
27
- categories = _props$categories === void 0 ? [] : _props$categories,
28
- index = props.index,
29
- _props$colors = props.colors,
30
- colors = _props$colors === void 0 ? themeColorRange : _props$colors,
31
- _props$stack = props.stack,
32
- stack = _props$stack === void 0 ? false : _props$stack,
33
- _props$relative = props.relative,
34
- relative = _props$relative === void 0 ? false : _props$relative,
35
- _props$animationDurat = props.animationDuration,
36
- animationDuration = _props$animationDurat === void 0 ? 900 : _props$animationDurat,
37
- _props$showAnimation = props.showAnimation,
38
- showAnimation = _props$showAnimation === void 0 ? false : _props$showAnimation,
39
- _props$noDataText = props.noDataText,
40
- noDataText = _props$noDataText === void 0 ? /*#__PURE__*/_jsx("div", {}) : _props$noDataText,
41
- loading = props.loading,
42
- _props$autoMinValue = props.autoMinValue,
43
- autoMinValue = _props$autoMinValue === void 0 ? false : _props$autoMinValue,
44
- minValue = props.minValue,
45
- maxValue = props.maxValue,
46
- className = props.className,
47
- _props$width = props.width,
48
- width = _props$width === void 0 ? 112 : _props$width,
49
- _props$height = props.height,
50
- height = _props$height === void 0 ? 48 : _props$height,
51
- style = props.style,
52
- rest = _objectWithoutProperties(props, _excluded);
53
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton, {
54
- height: height,
55
- width: width
56
- });
57
- var categoryColors = constructCategoryColors(categories, colors);
58
- var yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);
59
- return /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
60
- className: className,
61
- height: height,
62
- ref: ref,
63
- style: _objectSpread({
64
- position: 'relative'
65
- }, style),
66
- width: width
67
- }, rest), {}, {
68
- children: /*#__PURE__*/_jsx(ResponsiveContainer, {
69
- children: data !== null && data !== void 0 && data.length ? /*#__PURE__*/_jsxs(ReChartsBarChart, {
70
- data: data,
71
- margin: {
72
- bottom: 0,
73
- left: -1.5,
74
- right: -1.5,
75
- top: 0
76
- },
77
- stackOffset: relative ? 'expand' : 'none',
78
- children: [/*#__PURE__*/_jsx(YAxis, {
79
- domain: yAxisDomain,
80
- hide: true
81
- }), /*#__PURE__*/_jsx(XAxis, {
82
- dataKey: index,
83
- hide: true
84
- }), categories.map(function (category) {
85
- var _categoryColors$get;
86
- return /*#__PURE__*/_jsx(Bar, {
87
- animationDuration: animationDuration,
88
- className: cx(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fill: ", ";\n "])), (_categoryColors$get = categoryColors.get(category)) !== null && _categoryColors$get !== void 0 ? _categoryColors$get : cssVar.colorPrimary)),
89
- dataKey: category,
90
- fill: "",
91
- isAnimationActive: showAnimation,
92
- name: category,
93
- stackId: stack || relative ? 'a' : undefined,
94
- type: "linear"
95
- }, category);
96
- })]
97
- }) : /*#__PURE__*/_jsx(NoData, {
98
- noDataText: noDataText
99
- })
100
- })
101
- }));
102
- });
103
- SparkBarChart.displayName = 'SparkBarChart';
104
- export default SparkBarChart;
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import BaseSparkChartProps from "../common/BaseSparkChartProps";
3
- import { CurveType } from "../types/charts";
4
- export interface SparkLineChartProps extends BaseSparkChartProps {
5
- connectNulls?: boolean;
6
- curveType?: CurveType;
7
- loading?: boolean;
8
- }
9
- declare const SparkLineChart: import("react").ForwardRefExoticComponent<SparkLineChartProps & import("react").RefAttributes<HTMLDivElement>>;
10
- export default SparkLineChart;
@@ -1,108 +0,0 @@
1
- 'use client';
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- var _templateObject;
5
- var _excluded = ["data", "categories", "index", "colors", "animationDuration", "showAnimation", "curveType", "connectNulls", "noDataText", "autoMinValue", "minValue", "maxValue", "className", "width", "height", "style", "loading"];
6
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
7
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
- import { Flexbox, Skeleton, css, cssVar, cx } from '@lobehub/ui';
15
- import { forwardRef } from 'react';
16
- import { Line, LineChart as ReChartsLineChart, ResponsiveContainer, XAxis, YAxis } from 'recharts';
17
- import NoData from "../common/NoData";
18
- import { constructCategoryColors, getYAxisDomain } from "../common/utils";
19
- import { useThemeColorRange } from "../hooks/useThemeColorRange";
20
- import { jsx as _jsx } from "react/jsx-runtime";
21
- import { jsxs as _jsxs } from "react/jsx-runtime";
22
- var SparkLineChart = /*#__PURE__*/forwardRef(function (props, ref) {
23
- var themeColorRange = useThemeColorRange();
24
- var _props$data = props.data,
25
- data = _props$data === void 0 ? [] : _props$data,
26
- _props$categories = props.categories,
27
- categories = _props$categories === void 0 ? [] : _props$categories,
28
- index = props.index,
29
- _props$colors = props.colors,
30
- colors = _props$colors === void 0 ? themeColorRange : _props$colors,
31
- _props$animationDurat = props.animationDuration,
32
- animationDuration = _props$animationDurat === void 0 ? 900 : _props$animationDurat,
33
- _props$showAnimation = props.showAnimation,
34
- showAnimation = _props$showAnimation === void 0 ? false : _props$showAnimation,
35
- _props$curveType = props.curveType,
36
- curveType = _props$curveType === void 0 ? 'linear' : _props$curveType,
37
- _props$connectNulls = props.connectNulls,
38
- connectNulls = _props$connectNulls === void 0 ? false : _props$connectNulls,
39
- _props$noDataText = props.noDataText,
40
- noDataText = _props$noDataText === void 0 ? /*#__PURE__*/_jsx("div", {}) : _props$noDataText,
41
- _props$autoMinValue = props.autoMinValue,
42
- autoMinValue = _props$autoMinValue === void 0 ? false : _props$autoMinValue,
43
- minValue = props.minValue,
44
- maxValue = props.maxValue,
45
- className = props.className,
46
- _props$width = props.width,
47
- width = _props$width === void 0 ? 112 : _props$width,
48
- _props$height = props.height,
49
- height = _props$height === void 0 ? 48 : _props$height,
50
- style = props.style,
51
- loading = props.loading,
52
- rest = _objectWithoutProperties(props, _excluded);
53
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton, {
54
- height: height,
55
- width: width
56
- });
57
- var categoryColors = constructCategoryColors(categories, colors);
58
- var yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);
59
- return /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
60
- className: className,
61
- height: height,
62
- ref: ref,
63
- style: _objectSpread({
64
- position: 'relative'
65
- }, style),
66
- width: width
67
- }, rest), {}, {
68
- children: /*#__PURE__*/_jsx(ResponsiveContainer, {
69
- children: data !== null && data !== void 0 && data.length ? /*#__PURE__*/_jsxs(ReChartsLineChart, {
70
- data: data,
71
- margin: {
72
- bottom: 1,
73
- left: 1,
74
- right: 1,
75
- top: 1
76
- },
77
- children: [/*#__PURE__*/_jsx(YAxis, {
78
- domain: yAxisDomain,
79
- hide: true
80
- }), /*#__PURE__*/_jsx(XAxis, {
81
- dataKey: index,
82
- hide: true
83
- }), categories.map(function (category) {
84
- var _categoryColors$get;
85
- return /*#__PURE__*/_jsx(Line, {
86
- animationDuration: animationDuration,
87
- className: cx(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n stroke: ", ";\n "])), (_categoryColors$get = categoryColors.get(category)) !== null && _categoryColors$get !== void 0 ? _categoryColors$get : cssVar.colorPrimary)),
88
- connectNulls: connectNulls,
89
- dataKey: category,
90
- dot: false,
91
- isAnimationActive: showAnimation,
92
- name: category,
93
- stroke: "",
94
- strokeLinecap: "round",
95
- strokeLinejoin: "round",
96
- strokeOpacity: 1,
97
- strokeWidth: 2,
98
- type: curveType
99
- }, category);
100
- })]
101
- }) : /*#__PURE__*/_jsx(NoData, {
102
- noDataText: noDataText
103
- })
104
- })
105
- }));
106
- });
107
- SparkLineChart.displayName = 'SparkLineChart';
108
- export default SparkLineChart;
@@ -1,3 +0,0 @@
1
- export { default as SparkAreaChart, type SparkAreaChartProps } from './SparkAreaChart';
2
- export { default as SparkBarChart, type SparkBarChartProps } from './SparkBarChart';
3
- export { default as SparkLineChart, type SparkLineChartProps } from './SparkLineChart';
@@ -1,3 +0,0 @@
1
- export { default as SparkAreaChart } from "./SparkAreaChart";
2
- export { default as SparkBarChart } from "./SparkBarChart";
3
- export { default as SparkLineChart } from "./SparkLineChart";
@@ -1,29 +0,0 @@
1
- ---
2
- title: SparkChart
3
- description: A small graph capable of visualizing data in a simplified form.
4
- category: Visualizations
5
- ---
6
-
7
- import DemoSparkAreaChart from './demos/SparkAreaChart.tsx?demo';
8
- import DemoSparkBarChart from './demos/SparkBarChart.tsx?demo';
9
- import DemoSparkLineChart from './demos/SparkLineChart.tsx?demo';
10
-
11
- ## Spark AreaC hart
12
-
13
- <Demo of={DemoSparkAreaChart} layout="center" />
14
-
15
- ## Spark Bar Chart
16
-
17
- <Demo of={DemoSparkBarChart} layout="center" />
18
-
19
- ## Spark Line Chart
20
-
21
- <Demo of={DemoSparkLineChart} layout="center" />
22
-
23
- ## API
24
-
25
- <Api name="SparkAreaChart" />
26
-
27
- <Api name="SparkBarChart" />
28
-
29
- <Api name="SparkLineChart" />
@@ -1,8 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface TrackerBlockProps {
3
- color?: 'success' | 'warning' | 'error' | string;
4
- key?: string | number;
5
- tooltip?: ReactNode;
6
- }
7
- declare const TrackerBlock: import("react").ForwardRefExoticComponent<Omit<TrackerBlockProps & import("@lobehub/ui").FlexBasicProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
8
- export default TrackerBlock;
@@ -1,62 +0,0 @@
1
- 'use client';
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- var _excluded = ["color", "tooltip", "width", "style"];
5
- var _templateObject;
6
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
12
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
13
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
14
- import { Flexbox, Tooltip, createStaticStyles, cssVar } from '@lobehub/ui';
15
- import { forwardRef, useMemo } from 'react';
16
- import { jsx as _jsx } from "react/jsx-runtime";
17
- var styles = createStaticStyles(function (_ref) {
18
- var css = _ref.css;
19
- return {
20
- block: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n\n &:first-child {\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n }\n\n &:last-child {\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n }\n\n &:hover {\n opacity: 0.5;\n }\n "])), cssVar.colorFill, cssVar.borderRadiusSM, cssVar.borderRadiusSM, cssVar.borderRadiusSM, cssVar.borderRadiusSM)
21
- };
22
- });
23
- var TrackerBlock = /*#__PURE__*/forwardRef(function (_ref2, ref) {
24
- var color = _ref2.color,
25
- tooltip = _ref2.tooltip,
26
- width = _ref2.width,
27
- style = _ref2.style,
28
- rest = _objectWithoutProperties(_ref2, _excluded);
29
- var blockColor = useMemo(function () {
30
- switch (color) {
31
- case 'success':
32
- {
33
- return cssVar.colorSuccess;
34
- }
35
- case 'warning':
36
- {
37
- return cssVar.colorWarning;
38
- }
39
- case 'error':
40
- {
41
- return cssVar.colorError;
42
- }
43
- default:
44
- {
45
- return color;
46
- }
47
- }
48
- }, [color]);
49
- return /*#__PURE__*/_jsx(Tooltip, {
50
- title: tooltip,
51
- children: /*#__PURE__*/_jsx(Flexbox, _objectSpread({
52
- className: styles.block,
53
- height: '100%',
54
- ref: ref,
55
- style: _objectSpread({
56
- background: blockColor
57
- }, style),
58
- width: width || '100%'
59
- }, rest))
60
- });
61
- });
62
- export default TrackerBlock;
@@ -1,18 +0,0 @@
1
- import { FlexboxProps } from '@lobehub/ui';
2
- import { ReactNode } from 'react';
3
- import { TrackerBlockProps } from './TrackerBlock';
4
- interface DataItem extends TrackerBlockProps {
5
- [key: string]: any;
6
- }
7
- export interface TrackerProps extends FlexboxProps {
8
- blockGap?: number | string;
9
- blockHeight?: number | string;
10
- blockWidth?: number | string;
11
- customTooltip?: (payload: DataItem) => ReactNode;
12
- data: DataItem[];
13
- leftLabel?: ReactNode;
14
- onValueChange?: (payload: DataItem) => void;
15
- rightLabel?: ReactNode;
16
- }
17
- declare const Tracker: import("react").ForwardRefExoticComponent<Omit<TrackerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
18
- export default Tracker;
@@ -1,103 +0,0 @@
1
- 'use client';
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- var _excluded = ["data", "className", "height", "width", "blockWidth", "blockHeight", "blockGap", "customTooltip", "onValueChange", "leftLabel", "rightLabel", "style"];
5
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
11
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
- import { Flexbox, TooltipGroup, cx } from '@lobehub/ui';
13
- import { forwardRef } from 'react';
14
- import TrackerBlock from "./TrackerBlock";
15
- import { styles } from "./styles";
16
- import { jsx as _jsx } from "react/jsx-runtime";
17
- import { jsxs as _jsxs } from "react/jsx-runtime";
18
- var Tracker = /*#__PURE__*/forwardRef(function (props, ref) {
19
- var _props$data = props.data,
20
- data = _props$data === void 0 ? [] : _props$data,
21
- className = props.className,
22
- height = props.height,
23
- _props$width = props.width,
24
- width = _props$width === void 0 ? 'fit-content' : _props$width,
25
- _props$blockWidth = props.blockWidth,
26
- blockWidth = _props$blockWidth === void 0 ? 12 : _props$blockWidth,
27
- _props$blockHeight = props.blockHeight,
28
- blockHeight = _props$blockHeight === void 0 ? 40 : _props$blockHeight,
29
- _props$blockGap = props.blockGap,
30
- blockGap = _props$blockGap === void 0 ? 4 : _props$blockGap,
31
- customTooltip = props.customTooltip,
32
- onValueChange = props.onValueChange,
33
- leftLabel = props.leftLabel,
34
- rightLabel = props.rightLabel,
35
- style = props.style,
36
- rest = _objectWithoutProperties(props, _excluded);
37
- var content = /*#__PURE__*/_jsx(TooltipGroup, {
38
- children: data.map(function (item, idx) {
39
- var _item$key;
40
- return /*#__PURE__*/_jsx(TrackerBlock, {
41
- color: item.color,
42
- height: blockHeight,
43
- onClick: function onClick() {
44
- return onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(item);
45
- },
46
- style: {
47
- cursor: onValueChange ? 'pointer' : 'default'
48
- },
49
- tooltip: customTooltip ? customTooltip(item) : item.tooltip,
50
- width: blockWidth
51
- }, (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : idx);
52
- })
53
- });
54
- if (leftLabel || rightLabel) {
55
- return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
56
- className: className,
57
- gap: 8,
58
- height: height,
59
- ref: ref,
60
- style: _objectSpread({
61
- position: 'relative'
62
- }, style),
63
- width: width
64
- }, rest), {}, {
65
- children: [/*#__PURE__*/_jsxs(Flexbox, {
66
- align: 'center',
67
- horizontal: true,
68
- justify: 'space-between',
69
- width: '100%',
70
- children: [/*#__PURE__*/_jsx("div", {
71
- className: cx(styles.strongLabel, styles.emphasis),
72
- children: leftLabel
73
- }), /*#__PURE__*/_jsx("div", {
74
- className: cx(styles.label, styles.emphasis),
75
- style: {
76
- textAlign: 'right'
77
- },
78
- children: rightLabel
79
- })]
80
- }), /*#__PURE__*/_jsx(Flexbox, {
81
- align: 'center',
82
- gap: blockGap,
83
- height: blockHeight,
84
- horizontal: true,
85
- width: '100%',
86
- children: content
87
- })]
88
- }));
89
- }
90
- return /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
91
- align: 'center',
92
- className: className,
93
- gap: blockGap,
94
- height: height || blockHeight,
95
- horizontal: true,
96
- ref: ref,
97
- width: width
98
- }, rest), {}, {
99
- children: content
100
- }));
101
- });
102
- Tracker.displayName = 'Tracker';
103
- export default Tracker;
@@ -1,41 +0,0 @@
1
- ---
2
- title: Tracker
3
- description: Component for visualizing activity logs or other data related to monitoring.
4
- category: Visualizations
5
- ---
6
-
7
- import DemoIndex from './demos/index.tsx?demo';
8
- import DemoExample from './demos/example.tsx?demo';
9
- import DemoClickEvent from './demos/clickEvent.tsx?demo';
10
- import DemoCustomTooltip from './demos/customTooltip.tsx?demo';
11
- import DemoCustomColors from './demos/customColors.tsx?demo';
12
-
13
- <Demo of={DemoIndex} layout="bare" />
14
-
15
- ## Usage example
16
-
17
- The example below shows a composition of an uptime monitor with a `Tracker` component. The \`tooltip property acts as pop-up information and displays the provided status.
18
-
19
- <Demo of={DemoExample} layout="center" />
20
-
21
- ## Usage example with click event
22
-
23
- The example below shows an interacive chart using the `onValueChange` prop.
24
-
25
- <Demo of={DemoClickEvent} />
26
-
27
- ## Usage example with custom tooltip
28
-
29
- The example below shows a custom tooltip using `customTooltip` prop.
30
-
31
- <Demo of={DemoCustomTooltip} layout="center" />
32
-
33
- ## Usage example with a custom colors
34
-
35
- The example below shows a chart with custom `colors`.
36
-
37
- <Demo of={DemoCustomColors} layout="center" />
38
-
39
- ## API
40
-
41
- <Api name="Tracker" />
@@ -1,5 +0,0 @@
1
- export declare const styles: {
2
- emphasis: string;
3
- label: string;
4
- strongLabel: string;
5
- };
@@ -1,12 +0,0 @@
1
- var _templateObject, _templateObject2, _templateObject3;
2
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
- import { createStaticStyles } from '@lobehub/ui';
4
- export var styles = createStaticStyles(function (_ref) {
5
- var css = _ref.css,
6
- cssVar = _ref.cssVar;
7
- return {
8
- emphasis: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n "]))),
9
- label: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: 12px;\n line-height: 16px;\n color: ", ";\n "])), cssVar.colorTextDescription),
10
- strongLabel: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: 12px;\n font-weight: 500;\n line-height: 16px;\n fill: ", ";\n "])), cssVar.colorTextSecondary)
11
- };
12
- });
@@ -1,7 +0,0 @@
1
- interface BaseAnimationTimingProps {
2
- animationDuration?: number;
3
- height?: string | number;
4
- showAnimation?: boolean;
5
- width?: string | number;
6
- }
7
- export default BaseAnimationTimingProps;
@@ -1 +0,0 @@
1
- export {};
@@ -1,58 +0,0 @@
1
- import { ComponentType, HTMLAttributes } from 'react';
2
- import type { AxisDomain } from 'recharts/types/util/types';
3
- import type { NoDataProps } from "./NoData";
4
- import { IntervalType, LabelFormatter, ValueFormatter } from "../types/charts";
5
- import type BaseAnimationTimingProps from './BaseAnimationTimingProps';
6
- import { CustomTooltipProps } from './CustomTooltipProps';
7
- type FixedProps = {
8
- categoryClicked: string;
9
- eventType: 'dot' | 'category' | 'bar' | 'slice' | 'bubble';
10
- };
11
- type BaseEventProps = FixedProps & {
12
- [key: string]: number | string;
13
- };
14
- export type EventProps = BaseEventProps | null | undefined;
15
- interface BaseChartProps extends BaseAnimationTimingProps, HTMLAttributes<HTMLDivElement> {
16
- allowDecimals?: boolean;
17
- autoMinValue?: boolean;
18
- categories: string[];
19
- colors?: string[];
20
- customCategories?: {
21
- [key: string]: string;
22
- };
23
- customTooltip?: ComponentType<CustomTooltipProps>;
24
- data: any[];
25
- enableLegendSlider?: boolean;
26
- height?: string | number;
27
- index: string;
28
- intervalType?: IntervalType;
29
- loading?: boolean;
30
- maxValue?: number;
31
- minValue?: number;
32
- noDataText?: NoDataProps['noDataText'];
33
- onValueChange?: (value: EventProps) => void;
34
- rotateLabelX?: {
35
- angle: number;
36
- verticalShift?: number;
37
- xAxisHeight?: number;
38
- };
39
- showGridLines?: boolean;
40
- showLegend?: boolean;
41
- showTooltip?: boolean;
42
- showXAxis?: boolean;
43
- showYAxis?: boolean;
44
- startEndOnly?: boolean;
45
- tickGap?: number;
46
- valueFormatter?: ValueFormatter;
47
- width?: string | number;
48
- xAxisLabel?: string;
49
- xAxisLabelFormatter?: LabelFormatter;
50
- yAxisAlign?: 'left' | 'right';
51
- /**
52
- * Forward to recharts `YAxis.domain`. When set, overrides `autoMinValue` / `minValue` / `maxValue`.
53
- */
54
- yAxisDomain?: AxisDomain;
55
- yAxisLabel?: string;
56
- yAxisWidth?: number;
57
- }
58
- export default BaseChartProps;
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- import { HTMLAttributes } from 'react';
2
- import { NoDataProps } from "./NoData";
3
- import BaseAnimationTimingProps from './BaseAnimationTimingProps';
4
- interface BaseSparkChartProps extends BaseAnimationTimingProps, HTMLAttributes<HTMLDivElement> {
5
- autoMinValue?: boolean;
6
- categories: string[];
7
- colors?: string[];
8
- data: any[];
9
- index: string;
10
- maxValue?: number;
11
- minValue?: number;
12
- noDataText?: NoDataProps['noDataText'];
13
- }
14
- export default BaseSparkChartProps;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
- declare const ChartLegend: ({ payload }: any, categoryColors: Map<string, string>, setLegendHeight: Dispatch<SetStateAction<number>>, activeLegend: string | undefined, onClick?: ((category: string, color: string) => void) | undefined, enableLegendSlider?: boolean, customCategories?: {
3
- [key: string]: string;
4
- } | undefined) => import("react").JSX.Element;
5
- export default ChartLegend;