@perses-dev/components 0.0.0-snapshot-time-range-height-80d08fc

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 (481) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +18 -0
  3. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +9 -0
  4. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -0
  5. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +181 -0
  6. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -0
  7. package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +12 -0
  8. package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -0
  9. package/dist/DateTimeRangePicker/DateTimeRangePicker.js +79 -0
  10. package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -0
  11. package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +17 -0
  12. package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +1 -0
  13. package/dist/DateTimeRangePicker/TimeRangeSelector.js +58 -0
  14. package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -0
  15. package/dist/DateTimeRangePicker/index.d.ts +4 -0
  16. package/dist/DateTimeRangePicker/index.d.ts.map +1 -0
  17. package/dist/DateTimeRangePicker/index.js +17 -0
  18. package/dist/DateTimeRangePicker/index.js.map +1 -0
  19. package/dist/DateTimeRangePicker/utils.d.ts +7 -0
  20. package/dist/DateTimeRangePicker/utils.d.ts.map +1 -0
  21. package/dist/DateTimeRangePicker/utils.js +37 -0
  22. package/dist/DateTimeRangePicker/utils.js.map +1 -0
  23. package/dist/Drawer/Drawer.d.ts +9 -0
  24. package/dist/Drawer/Drawer.d.ts.map +1 -0
  25. package/dist/Drawer/Drawer.js +34 -0
  26. package/dist/Drawer/Drawer.js.map +1 -0
  27. package/dist/Drawer/index.d.ts +2 -0
  28. package/dist/Drawer/index.d.ts.map +1 -0
  29. package/dist/Drawer/index.js +15 -0
  30. package/dist/Drawer/index.js.map +1 -0
  31. package/dist/EChart.d.ts +61 -0
  32. package/dist/EChart.d.ts.map +1 -0
  33. package/dist/EChart.js +143 -0
  34. package/dist/EChart.js.map +1 -0
  35. package/dist/ErrorAlert.d.ts +9 -0
  36. package/dist/ErrorAlert.d.ts.map +1 -0
  37. package/dist/ErrorAlert.js +25 -0
  38. package/dist/ErrorAlert.js.map +1 -0
  39. package/dist/ErrorBoundary.d.ts +3 -0
  40. package/dist/ErrorBoundary.d.ts.map +1 -0
  41. package/dist/ErrorBoundary.js +16 -0
  42. package/dist/ErrorBoundary.js.map +1 -0
  43. package/dist/GaugeChart/GaugeChart.d.ts +15 -0
  44. package/dist/GaugeChart/GaugeChart.d.ts.map +1 -0
  45. package/dist/GaugeChart/GaugeChart.js +172 -0
  46. package/dist/GaugeChart/GaugeChart.js.map +1 -0
  47. package/dist/GaugeChart/index.d.ts +2 -0
  48. package/dist/GaugeChart/index.d.ts.map +1 -0
  49. package/dist/GaugeChart/index.js +15 -0
  50. package/dist/GaugeChart/index.js.map +1 -0
  51. package/dist/InfoTooltip/InfoTooltip.d.ts +17 -0
  52. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -0
  53. package/dist/InfoTooltip/InfoTooltip.js +76 -0
  54. package/dist/InfoTooltip/InfoTooltip.js.map +1 -0
  55. package/dist/InfoTooltip/InfoTooltip.test.d.ts +2 -0
  56. package/dist/InfoTooltip/InfoTooltip.test.d.ts.map +1 -0
  57. package/dist/InfoTooltip/InfoTooltip.test.js +36 -0
  58. package/dist/InfoTooltip/InfoTooltip.test.js.map +1 -0
  59. package/dist/InfoTooltip/index.d.ts +2 -0
  60. package/dist/InfoTooltip/index.d.ts.map +1 -0
  61. package/dist/InfoTooltip/index.js +15 -0
  62. package/dist/InfoTooltip/index.js.map +1 -0
  63. package/dist/JSONEditor.d.ts +8 -0
  64. package/dist/JSONEditor.d.ts.map +1 -0
  65. package/dist/JSONEditor.js +51 -0
  66. package/dist/JSONEditor.js.map +1 -0
  67. package/dist/Legend/CompactLegend.d.ts +13 -0
  68. package/dist/Legend/CompactLegend.d.ts.map +1 -0
  69. package/dist/Legend/CompactLegend.js +45 -0
  70. package/dist/Legend/CompactLegend.js.map +1 -0
  71. package/dist/Legend/Legend.d.ts +11 -0
  72. package/dist/Legend/Legend.d.ts.map +1 -0
  73. package/dist/Legend/Legend.js +39 -0
  74. package/dist/Legend/Legend.js.map +1 -0
  75. package/dist/Legend/LegendColorBadge.d.ts +7 -0
  76. package/dist/Legend/LegendColorBadge.d.ts.map +1 -0
  77. package/dist/Legend/LegendColorBadge.js +31 -0
  78. package/dist/Legend/LegendColorBadge.js.map +1 -0
  79. package/dist/Legend/ListLegend.d.ts +11 -0
  80. package/dist/Legend/ListLegend.d.ts.map +1 -0
  81. package/dist/Legend/ListLegend.js +40 -0
  82. package/dist/Legend/ListLegend.js.map +1 -0
  83. package/dist/Legend/ListLegendItem.d.ts +9 -0
  84. package/dist/Legend/ListLegendItem.d.ts.map +1 -0
  85. package/dist/Legend/ListLegendItem.js +47 -0
  86. package/dist/Legend/ListLegendItem.js.map +1 -0
  87. package/dist/Legend/index.d.ts +2 -0
  88. package/dist/Legend/index.d.ts.map +1 -0
  89. package/dist/Legend/index.js +15 -0
  90. package/dist/Legend/index.js.map +1 -0
  91. package/dist/LineChart/LineChart.d.ts +19 -0
  92. package/dist/LineChart/LineChart.d.ts.map +1 -0
  93. package/dist/LineChart/LineChart.js +189 -0
  94. package/dist/LineChart/LineChart.js.map +1 -0
  95. package/dist/LineChart/index.d.ts +3 -0
  96. package/dist/LineChart/index.d.ts.map +1 -0
  97. package/dist/LineChart/index.js +15 -0
  98. package/dist/LineChart/index.js.map +1 -0
  99. package/dist/LineChart/utils.d.ts +30 -0
  100. package/dist/LineChart/utils.d.ts.map +1 -0
  101. package/dist/LineChart/utils.js +90 -0
  102. package/dist/LineChart/utils.js.map +1 -0
  103. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +13 -0
  104. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -0
  105. package/dist/OptionsEditorLayout/OptionsEditorColumn.js +28 -0
  106. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -0
  107. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +5 -0
  108. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -0
  109. package/dist/OptionsEditorLayout/OptionsEditorControl.js +50 -0
  110. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -0
  111. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +13 -0
  112. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -0
  113. package/dist/OptionsEditorLayout/OptionsEditorGrid.js +26 -0
  114. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -0
  115. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +13 -0
  116. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -0
  117. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +36 -0
  118. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -0
  119. package/dist/OptionsEditorLayout/index.d.ts +5 -0
  120. package/dist/OptionsEditorLayout/index.d.ts.map +1 -0
  121. package/dist/OptionsEditorLayout/index.js +18 -0
  122. package/dist/OptionsEditorLayout/index.js.map +1 -0
  123. package/dist/StatChart/StatChart.d.ts +19 -0
  124. package/dist/StatChart/StatChart.d.ts.map +1 -0
  125. package/dist/StatChart/StatChart.js +121 -0
  126. package/dist/StatChart/StatChart.js.map +1 -0
  127. package/dist/StatChart/StatChart.test.d.ts +2 -0
  128. package/dist/StatChart/StatChart.test.d.ts.map +1 -0
  129. package/dist/StatChart/StatChart.test.js +87 -0
  130. package/dist/StatChart/StatChart.test.js.map +1 -0
  131. package/dist/StatChart/index.d.ts +2 -0
  132. package/dist/StatChart/index.d.ts.map +1 -0
  133. package/dist/StatChart/index.js +15 -0
  134. package/dist/StatChart/index.js.map +1 -0
  135. package/dist/Tooltip/SeriesInfo.d.ts +12 -0
  136. package/dist/Tooltip/SeriesInfo.d.ts.map +1 -0
  137. package/dist/Tooltip/SeriesInfo.js +143 -0
  138. package/dist/Tooltip/SeriesInfo.js.map +1 -0
  139. package/dist/Tooltip/SeriesMarker.d.ts +7 -0
  140. package/dist/Tooltip/SeriesMarker.d.ts.map +1 -0
  141. package/dist/Tooltip/SeriesMarker.js +33 -0
  142. package/dist/Tooltip/SeriesMarker.js.map +1 -0
  143. package/dist/Tooltip/Tooltip.d.ts +13 -0
  144. package/dist/Tooltip/Tooltip.d.ts.map +1 -0
  145. package/dist/Tooltip/Tooltip.js +72 -0
  146. package/dist/Tooltip/Tooltip.js.map +1 -0
  147. package/dist/Tooltip/TooltipContent.d.ts +9 -0
  148. package/dist/Tooltip/TooltipContent.d.ts.map +1 -0
  149. package/dist/Tooltip/TooltipContent.js +89 -0
  150. package/dist/Tooltip/TooltipContent.js.map +1 -0
  151. package/dist/Tooltip/focused-series.d.ts +25 -0
  152. package/dist/Tooltip/focused-series.d.ts.map +1 -0
  153. package/dist/Tooltip/focused-series.js +111 -0
  154. package/dist/Tooltip/focused-series.js.map +1 -0
  155. package/dist/Tooltip/focused-series.test.d.ts +2 -0
  156. package/dist/Tooltip/focused-series.test.d.ts.map +1 -0
  157. package/dist/Tooltip/focused-series.test.js +93 -0
  158. package/dist/Tooltip/focused-series.test.js.map +1 -0
  159. package/dist/Tooltip/index.d.ts +3 -0
  160. package/dist/Tooltip/index.d.ts.map +1 -0
  161. package/dist/Tooltip/index.js +16 -0
  162. package/dist/Tooltip/index.js.map +1 -0
  163. package/dist/Tooltip/tooltip-model.d.ts +79 -0
  164. package/dist/Tooltip/tooltip-model.d.ts.map +1 -0
  165. package/dist/Tooltip/tooltip-model.js +80 -0
  166. package/dist/Tooltip/tooltip-model.js.map +1 -0
  167. package/dist/Tooltip/utils.d.ts +6 -0
  168. package/dist/Tooltip/utils.d.ts.map +1 -0
  169. package/dist/Tooltip/utils.js +46 -0
  170. package/dist/Tooltip/utils.js.map +1 -0
  171. package/dist/UnitSelector/UnitSelector.d.ts +8 -0
  172. package/dist/UnitSelector/UnitSelector.d.ts.map +1 -0
  173. package/dist/UnitSelector/UnitSelector.js +112 -0
  174. package/dist/UnitSelector/UnitSelector.js.map +1 -0
  175. package/dist/UnitSelector/UnitSelector.test.d.ts +2 -0
  176. package/dist/UnitSelector/UnitSelector.test.d.ts.map +1 -0
  177. package/dist/UnitSelector/UnitSelector.test.js +205 -0
  178. package/dist/UnitSelector/UnitSelector.test.js.map +1 -0
  179. package/dist/UnitSelector/index.d.ts +2 -0
  180. package/dist/UnitSelector/index.d.ts.map +1 -0
  181. package/dist/UnitSelector/index.js +15 -0
  182. package/dist/UnitSelector/index.js.map +1 -0
  183. package/dist/YAxisLabel.d.ts +8 -0
  184. package/dist/YAxisLabel.d.ts.map +1 -0
  185. package/dist/YAxisLabel.js +39 -0
  186. package/dist/YAxisLabel.js.map +1 -0
  187. package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +187 -0
  188. package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +85 -0
  189. package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +69 -0
  190. package/dist/cjs/DateTimeRangePicker/index.js +30 -0
  191. package/dist/cjs/DateTimeRangePicker/utils.js +45 -0
  192. package/dist/cjs/Drawer/Drawer.js +40 -0
  193. package/dist/cjs/Drawer/index.js +28 -0
  194. package/dist/cjs/EChart.js +188 -0
  195. package/dist/cjs/ErrorAlert.js +29 -0
  196. package/dist/cjs/ErrorBoundary.js +22 -0
  197. package/dist/cjs/GaugeChart/GaugeChart.js +178 -0
  198. package/dist/cjs/GaugeChart/index.js +28 -0
  199. package/dist/cjs/InfoTooltip/InfoTooltip.js +93 -0
  200. package/dist/cjs/InfoTooltip/InfoTooltip.test.js +43 -0
  201. package/dist/cjs/InfoTooltip/index.js +28 -0
  202. package/dist/cjs/JSONEditor.js +57 -0
  203. package/dist/cjs/Legend/CompactLegend.js +48 -0
  204. package/dist/cjs/Legend/Legend.js +45 -0
  205. package/dist/cjs/Legend/LegendColorBadge.js +42 -0
  206. package/dist/cjs/Legend/ListLegend.js +44 -0
  207. package/dist/cjs/Legend/ListLegendItem.js +91 -0
  208. package/dist/cjs/Legend/index.js +28 -0
  209. package/dist/cjs/LineChart/LineChart.js +195 -0
  210. package/dist/cjs/LineChart/index.js +28 -0
  211. package/dist/cjs/LineChart/utils.js +95 -0
  212. package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +32 -0
  213. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +61 -0
  214. package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +29 -0
  215. package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +40 -0
  216. package/dist/cjs/OptionsEditorLayout/index.js +31 -0
  217. package/dist/cjs/StatChart/StatChart.js +165 -0
  218. package/dist/cjs/StatChart/StatChart.test.js +89 -0
  219. package/dist/cjs/StatChart/index.js +28 -0
  220. package/dist/cjs/Tooltip/SeriesInfo.js +149 -0
  221. package/dist/cjs/Tooltip/SeriesMarker.js +39 -0
  222. package/dist/cjs/Tooltip/Tooltip.js +116 -0
  223. package/dist/cjs/Tooltip/TooltipContent.js +95 -0
  224. package/dist/cjs/Tooltip/focused-series.js +117 -0
  225. package/dist/cjs/Tooltip/focused-series.test.js +95 -0
  226. package/dist/cjs/Tooltip/index.js +29 -0
  227. package/dist/cjs/Tooltip/tooltip-model.js +98 -0
  228. package/dist/cjs/Tooltip/utils.js +50 -0
  229. package/dist/cjs/UnitSelector/UnitSelector.js +118 -0
  230. package/dist/cjs/UnitSelector/UnitSelector.test.js +212 -0
  231. package/dist/cjs/UnitSelector/index.js +28 -0
  232. package/dist/cjs/YAxisLabel.js +45 -0
  233. package/dist/cjs/context/ChartsThemeProvider.js +83 -0
  234. package/dist/cjs/context/TimeZoneProvider.js +90 -0
  235. package/dist/cjs/index.js +47 -0
  236. package/dist/cjs/model/graph.js +21 -0
  237. package/dist/cjs/model/index.js +30 -0
  238. package/dist/cjs/model/theme.js +16 -0
  239. package/dist/cjs/model/units/bytes.js +60 -0
  240. package/dist/cjs/model/units/constants.js +23 -0
  241. package/dist/cjs/model/units/decimal.js +67 -0
  242. package/dist/cjs/model/units/index.js +30 -0
  243. package/dist/cjs/model/units/percent.js +64 -0
  244. package/dist/cjs/model/units/time.js +102 -0
  245. package/dist/cjs/model/units/types.js +28 -0
  246. package/dist/cjs/model/units/units.js +104 -0
  247. package/dist/cjs/test/index.js +28 -0
  248. package/dist/cjs/test/render.js +36 -0
  249. package/dist/cjs/test/setup-tests.js +20 -0
  250. package/dist/cjs/test-utils/index.js +28 -0
  251. package/dist/cjs/test-utils/theme.js +28 -0
  252. package/dist/cjs/theme/index.js +28 -0
  253. package/dist/cjs/theme/palette/background.js +40 -0
  254. package/dist/cjs/theme/palette/colors/blue.js +35 -0
  255. package/dist/cjs/theme/palette/colors/common.js +28 -0
  256. package/dist/cjs/theme/palette/colors/green.js +35 -0
  257. package/dist/cjs/theme/palette/colors/grey.js +35 -0
  258. package/dist/cjs/theme/palette/colors/index.js +35 -0
  259. package/dist/cjs/theme/palette/colors/orange.js +35 -0
  260. package/dist/cjs/theme/palette/colors/purple.js +35 -0
  261. package/dist/cjs/theme/palette/colors/red.js +35 -0
  262. package/dist/cjs/theme/palette/colors/types.js +16 -0
  263. package/dist/cjs/theme/palette/error.js +32 -0
  264. package/dist/cjs/theme/palette/grey.js +44 -0
  265. package/dist/cjs/theme/palette/index.js +28 -0
  266. package/dist/cjs/theme/palette/palette-options.js +59 -0
  267. package/dist/cjs/theme/palette/primary.js +32 -0
  268. package/dist/cjs/theme/palette/secondary.js +32 -0
  269. package/dist/cjs/theme/palette/success.js +32 -0
  270. package/dist/cjs/theme/palette/text.js +42 -0
  271. package/dist/cjs/theme/palette/warning.js +32 -0
  272. package/dist/cjs/theme/theme.js +64 -0
  273. package/dist/cjs/theme/types/ThemeExtension.d.js +17 -0
  274. package/dist/cjs/theme/typography.js +96 -0
  275. package/dist/cjs/utils/combine-sx.js +29 -0
  276. package/dist/cjs/utils/component-ids.js +31 -0
  277. package/dist/cjs/utils/format.js +56 -0
  278. package/dist/cjs/utils/format.test.js +47 -0
  279. package/dist/cjs/utils/index.js +31 -0
  280. package/dist/cjs/utils/mathjs.js +25 -0
  281. package/dist/cjs/utils/theme-gen.js +188 -0
  282. package/dist/cjs/utils/theme-gen.test.js +197 -0
  283. package/dist/context/ChartsThemeProvider.d.ts +10 -0
  284. package/dist/context/ChartsThemeProvider.d.ts.map +1 -0
  285. package/dist/context/ChartsThemeProvider.js +31 -0
  286. package/dist/context/ChartsThemeProvider.js.map +1 -0
  287. package/dist/context/TimeZoneProvider.d.ts +13 -0
  288. package/dist/context/TimeZoneProvider.d.ts.map +1 -0
  289. package/dist/context/TimeZoneProvider.js +38 -0
  290. package/dist/context/TimeZoneProvider.js.map +1 -0
  291. package/dist/index.d.ts +21 -0
  292. package/dist/index.d.ts.map +1 -0
  293. package/dist/index.js +34 -0
  294. package/dist/index.js.map +1 -0
  295. package/dist/model/graph.d.ts +34 -0
  296. package/dist/model/graph.d.ts.map +1 -0
  297. package/dist/model/graph.js +16 -0
  298. package/dist/model/graph.js.map +1 -0
  299. package/dist/model/index.d.ts +4 -0
  300. package/dist/model/index.d.ts.map +1 -0
  301. package/dist/model/index.js +17 -0
  302. package/dist/model/index.js.map +1 -0
  303. package/dist/model/theme.d.ts +15 -0
  304. package/dist/model/theme.d.ts.map +1 -0
  305. package/dist/model/theme.js +15 -0
  306. package/dist/model/theme.js.map +1 -0
  307. package/dist/model/units/bytes.d.ts +12 -0
  308. package/dist/model/units/bytes.d.ts.map +1 -0
  309. package/dist/model/units/bytes.js +48 -0
  310. package/dist/model/units/bytes.js.map +1 -0
  311. package/dist/model/units/constants.d.ts +2 -0
  312. package/dist/model/units/constants.d.ts.map +1 -0
  313. package/dist/model/units/constants.js +17 -0
  314. package/dist/model/units/constants.js.map +1 -0
  315. package/dist/model/units/decimal.d.ts +24 -0
  316. package/dist/model/units/decimal.d.ts.map +1 -0
  317. package/dist/model/units/decimal.js +59 -0
  318. package/dist/model/units/decimal.js.map +1 -0
  319. package/dist/model/units/index.d.ts +4 -0
  320. package/dist/model/units/index.d.ts.map +1 -0
  321. package/dist/model/units/index.js +17 -0
  322. package/dist/model/units/index.js.map +1 -0
  323. package/dist/model/units/percent.d.ts +12 -0
  324. package/dist/model/units/percent.d.ts.map +1 -0
  325. package/dist/model/units/percent.js +51 -0
  326. package/dist/model/units/percent.js.map +1 -0
  327. package/dist/model/units/time.d.ts +22 -0
  328. package/dist/model/units/time.d.ts.map +1 -0
  329. package/dist/model/units/time.js +88 -0
  330. package/dist/model/units/time.js.map +1 -0
  331. package/dist/model/units/types.d.ts +38 -0
  332. package/dist/model/units/types.d.ts.map +1 -0
  333. package/dist/model/units/types.js +22 -0
  334. package/dist/model/units/types.js.map +1 -0
  335. package/dist/model/units/units.d.ts +40 -0
  336. package/dist/model/units/units.d.ts.map +1 -0
  337. package/dist/model/units/units.js +83 -0
  338. package/dist/model/units/units.js.map +1 -0
  339. package/dist/test/index.d.ts +2 -0
  340. package/dist/test/index.d.ts.map +1 -0
  341. package/dist/test/index.js +15 -0
  342. package/dist/test/index.js.map +1 -0
  343. package/dist/test/render.d.ts +7 -0
  344. package/dist/test/render.d.ts.map +1 -0
  345. package/dist/test/render.js +32 -0
  346. package/dist/test/render.js.map +1 -0
  347. package/dist/test/setup-tests.d.ts +2 -0
  348. package/dist/test/setup-tests.d.ts.map +1 -0
  349. package/dist/test/setup-tests.js +18 -0
  350. package/dist/test/setup-tests.js.map +1 -0
  351. package/dist/test-utils/index.d.ts +2 -0
  352. package/dist/test-utils/index.d.ts.map +1 -0
  353. package/dist/test-utils/index.js +15 -0
  354. package/dist/test-utils/index.js.map +1 -0
  355. package/dist/test-utils/theme.d.ts +3 -0
  356. package/dist/test-utils/theme.d.ts.map +1 -0
  357. package/dist/test-utils/theme.js +22 -0
  358. package/dist/test-utils/theme.js.map +1 -0
  359. package/dist/theme/index.d.ts +37 -0
  360. package/dist/theme/index.d.ts.map +1 -0
  361. package/dist/theme/index.js +15 -0
  362. package/dist/theme/index.js.map +1 -0
  363. package/dist/theme/palette/background.d.ts +3 -0
  364. package/dist/theme/palette/background.d.ts.map +1 -0
  365. package/dist/theme/palette/background.js +34 -0
  366. package/dist/theme/palette/background.js.map +1 -0
  367. package/dist/theme/palette/colors/blue.d.ts +3 -0
  368. package/dist/theme/palette/colors/blue.d.ts.map +1 -0
  369. package/dist/theme/palette/colors/blue.js +29 -0
  370. package/dist/theme/palette/colors/blue.js.map +1 -0
  371. package/dist/theme/palette/colors/common.d.ts +3 -0
  372. package/dist/theme/palette/colors/common.d.ts.map +1 -0
  373. package/dist/theme/palette/colors/common.js +16 -0
  374. package/dist/theme/palette/colors/common.js.map +1 -0
  375. package/dist/theme/palette/colors/green.d.ts +3 -0
  376. package/dist/theme/palette/colors/green.d.ts.map +1 -0
  377. package/dist/theme/palette/colors/green.js +29 -0
  378. package/dist/theme/palette/colors/green.js.map +1 -0
  379. package/dist/theme/palette/colors/grey.d.ts +3 -0
  380. package/dist/theme/palette/colors/grey.d.ts.map +1 -0
  381. package/dist/theme/palette/colors/grey.js +29 -0
  382. package/dist/theme/palette/colors/grey.js.map +1 -0
  383. package/dist/theme/palette/colors/index.d.ts +9 -0
  384. package/dist/theme/palette/colors/index.d.ts.map +1 -0
  385. package/dist/theme/palette/colors/index.js +22 -0
  386. package/dist/theme/palette/colors/index.js.map +1 -0
  387. package/dist/theme/palette/colors/orange.d.ts +3 -0
  388. package/dist/theme/palette/colors/orange.d.ts.map +1 -0
  389. package/dist/theme/palette/colors/orange.js +29 -0
  390. package/dist/theme/palette/colors/orange.js.map +1 -0
  391. package/dist/theme/palette/colors/purple.d.ts +3 -0
  392. package/dist/theme/palette/colors/purple.d.ts.map +1 -0
  393. package/dist/theme/palette/colors/purple.js +29 -0
  394. package/dist/theme/palette/colors/purple.js.map +1 -0
  395. package/dist/theme/palette/colors/red.d.ts +3 -0
  396. package/dist/theme/palette/colors/red.d.ts.map +1 -0
  397. package/dist/theme/palette/colors/red.js +29 -0
  398. package/dist/theme/palette/colors/red.js.map +1 -0
  399. package/dist/theme/palette/colors/types.d.ts +17 -0
  400. package/dist/theme/palette/colors/types.d.ts.map +1 -0
  401. package/dist/theme/palette/colors/types.js +15 -0
  402. package/dist/theme/palette/colors/types.js.map +1 -0
  403. package/dist/theme/palette/error.d.ts +3 -0
  404. package/dist/theme/palette/error.d.ts.map +1 -0
  405. package/dist/theme/palette/error.js +26 -0
  406. package/dist/theme/palette/error.js.map +1 -0
  407. package/dist/theme/palette/grey.d.ts +3 -0
  408. package/dist/theme/palette/grey.d.ts.map +1 -0
  409. package/dist/theme/palette/grey.js +38 -0
  410. package/dist/theme/palette/grey.js.map +1 -0
  411. package/dist/theme/palette/index.d.ts +3 -0
  412. package/dist/theme/palette/index.d.ts.map +1 -0
  413. package/dist/theme/palette/index.js +15 -0
  414. package/dist/theme/palette/index.js.map +1 -0
  415. package/dist/theme/palette/palette-options.d.ts +6 -0
  416. package/dist/theme/palette/palette-options.d.ts.map +1 -0
  417. package/dist/theme/palette/palette-options.js +55 -0
  418. package/dist/theme/palette/palette-options.js.map +1 -0
  419. package/dist/theme/palette/primary.d.ts +3 -0
  420. package/dist/theme/palette/primary.d.ts.map +1 -0
  421. package/dist/theme/palette/primary.js +26 -0
  422. package/dist/theme/palette/primary.js.map +1 -0
  423. package/dist/theme/palette/secondary.d.ts +3 -0
  424. package/dist/theme/palette/secondary.d.ts.map +1 -0
  425. package/dist/theme/palette/secondary.js +26 -0
  426. package/dist/theme/palette/secondary.js.map +1 -0
  427. package/dist/theme/palette/success.d.ts +3 -0
  428. package/dist/theme/palette/success.d.ts.map +1 -0
  429. package/dist/theme/palette/success.js +26 -0
  430. package/dist/theme/palette/success.js.map +1 -0
  431. package/dist/theme/palette/text.d.ts +3 -0
  432. package/dist/theme/palette/text.d.ts.map +1 -0
  433. package/dist/theme/palette/text.js +36 -0
  434. package/dist/theme/palette/text.js.map +1 -0
  435. package/dist/theme/palette/warning.d.ts +3 -0
  436. package/dist/theme/palette/warning.d.ts.map +1 -0
  437. package/dist/theme/palette/warning.js +26 -0
  438. package/dist/theme/palette/warning.js.map +1 -0
  439. package/dist/theme/theme.d.ts +13 -0
  440. package/dist/theme/theme.d.ts.map +1 -0
  441. package/dist/theme/theme.js +67 -0
  442. package/dist/theme/theme.js.map +1 -0
  443. package/dist/theme/types/ThemeExtension.d.js +16 -0
  444. package/dist/theme/types/ThemeExtension.d.js.map +1 -0
  445. package/dist/theme/typography.d.ts +10 -0
  446. package/dist/theme/typography.d.ts.map +1 -0
  447. package/dist/theme/typography.js +92 -0
  448. package/dist/theme/typography.js.map +1 -0
  449. package/dist/utils/combine-sx.d.ts +8 -0
  450. package/dist/utils/combine-sx.d.ts.map +1 -0
  451. package/dist/utils/combine-sx.js +27 -0
  452. package/dist/utils/combine-sx.js.map +1 -0
  453. package/dist/utils/component-ids.d.ts +8 -0
  454. package/dist/utils/component-ids.d.ts.map +1 -0
  455. package/dist/utils/component-ids.js +27 -0
  456. package/dist/utils/component-ids.js.map +1 -0
  457. package/dist/utils/format.d.ts +3 -0
  458. package/dist/utils/format.d.ts.map +1 -0
  459. package/dist/utils/format.js +44 -0
  460. package/dist/utils/format.js.map +1 -0
  461. package/dist/utils/format.test.d.ts +2 -0
  462. package/dist/utils/format.test.d.ts.map +1 -0
  463. package/dist/utils/format.test.js +45 -0
  464. package/dist/utils/format.test.js.map +1 -0
  465. package/dist/utils/index.d.ts +5 -0
  466. package/dist/utils/index.d.ts.map +1 -0
  467. package/dist/utils/index.js +18 -0
  468. package/dist/utils/index.js.map +1 -0
  469. package/dist/utils/mathjs.d.ts +6 -0
  470. package/dist/utils/mathjs.d.ts.map +1 -0
  471. package/dist/utils/mathjs.js +20 -0
  472. package/dist/utils/mathjs.js.map +1 -0
  473. package/dist/utils/theme-gen.d.ts +6 -0
  474. package/dist/utils/theme-gen.d.ts.map +1 -0
  475. package/dist/utils/theme-gen.js +182 -0
  476. package/dist/utils/theme-gen.js.map +1 -0
  477. package/dist/utils/theme-gen.test.d.ts +2 -0
  478. package/dist/utils/theme-gen.test.d.ts.map +1 -0
  479. package/dist/utils/theme-gen.test.js +195 -0
  480. package/dist/utils/theme-gen.test.js.map +1 -0
  481. package/package.json +54 -0
@@ -0,0 +1,20 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { roundDependencies, create } from 'mathjs';
14
+ // This ensures we get a minimal mathjs bundle for just what we need (see https://mathjs.org/docs/custom_bundling.html)
15
+ const { round } = create({
16
+ roundDependencies
17
+ });
18
+ export { round };
19
+
20
+ //# sourceMappingURL=mathjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/mathjs.ts"],"sourcesContent":["// Copyright 2022 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { roundDependencies, create } from 'mathjs';\n\n// This ensures we get a minimal mathjs bundle for just what we need (see https://mathjs.org/docs/custom_bundling.html)\nconst { round } = create({ roundDependencies });\nexport { round };\n"],"names":["roundDependencies","create","round"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,iBAAiB,EAAEC,MAAM,QAAQ,QAAQ,CAAC;AAEnD,uHAAuH;AACvH,MAAM,EAAEC,KAAK,CAAA,EAAE,GAAGD,MAAM,CAAC;IAAED,iBAAiB;CAAE,CAAC,AAAC;AAChD,SAASE,KAAK,GAAG"}
@@ -0,0 +1,6 @@
1
+ import { Theme } from '@mui/material';
2
+ import { EChartsTheme, PersesChartsTheme } from '../model';
3
+ declare type MuiTheme = Omit<Theme, 'components'>;
4
+ export declare function generateChartsTheme(muiTheme: MuiTheme, echartsTheme: EChartsTheme): PersesChartsTheme;
5
+ export {};
6
+ //# sourceMappingURL=theme-gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-gen.d.ts","sourceRoot":"","sources":["../../src/utils/theme-gen.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAK3D,aAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAE1C,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,GAAG,iBAAiB,CA8JrG"}
@@ -0,0 +1,182 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { merge } from 'lodash-es';
14
+ const DEFAULT_TEXT_COLOR = '#222';
15
+ export function generateChartsTheme(muiTheme, echartsTheme) {
16
+ var ref, ref1, ref2, ref3, ref4;
17
+ var ref5;
18
+ const primaryTextColor = (ref5 = (ref = muiTheme.palette.text) === null || ref === void 0 ? void 0 : ref.primary) !== null && ref5 !== void 0 ? ref5 : DEFAULT_TEXT_COLOR;
19
+ const muiConvertedTheme = {
20
+ title: {
21
+ show: false
22
+ },
23
+ textStyle: {
24
+ color: primaryTextColor,
25
+ fontFamily: muiTheme.typography.fontFamily,
26
+ fontSize: 12
27
+ },
28
+ grid: {
29
+ top: 5,
30
+ right: 20,
31
+ bottom: 0,
32
+ left: 20,
33
+ containLabel: true
34
+ },
35
+ color: [
36
+ '#8dd3c7',
37
+ '#bebada',
38
+ '#fb8072',
39
+ '#80b1d3',
40
+ '#fdb462'
41
+ ],
42
+ categoryAxis: {
43
+ show: true,
44
+ axisLabel: {
45
+ show: true,
46
+ color: primaryTextColor,
47
+ margin: 15
48
+ },
49
+ axisTick: {
50
+ show: false,
51
+ length: 6,
52
+ lineStyle: {
53
+ color: muiTheme.palette.grey[600]
54
+ }
55
+ },
56
+ axisLine: {
57
+ show: true,
58
+ lineStyle: {
59
+ color: muiTheme.palette.grey[600]
60
+ }
61
+ },
62
+ splitLine: {
63
+ show: true,
64
+ lineStyle: {
65
+ width: 0.5,
66
+ color: muiTheme.palette.grey[300],
67
+ opacity: 0.6
68
+ }
69
+ },
70
+ splitArea: {
71
+ show: false,
72
+ areaStyle: {
73
+ color: [
74
+ muiTheme.palette.grey[300]
75
+ ]
76
+ }
77
+ }
78
+ },
79
+ valueAxis: {
80
+ show: true,
81
+ axisLabel: {
82
+ color: primaryTextColor,
83
+ margin: 12
84
+ },
85
+ axisLine: {
86
+ show: false
87
+ },
88
+ splitLine: {
89
+ show: true,
90
+ lineStyle: {
91
+ width: 0.5,
92
+ color: muiTheme.palette.grey[300],
93
+ opacity: 0.6
94
+ }
95
+ }
96
+ },
97
+ legend: {
98
+ orient: 'horizontal',
99
+ textStyle: {
100
+ color: primaryTextColor
101
+ },
102
+ pageTextStyle: {
103
+ color: muiTheme.palette.grey[600]
104
+ },
105
+ pageIconColor: muiTheme === null || muiTheme === void 0 ? void 0 : (ref1 = muiTheme.palette) === null || ref1 === void 0 ? void 0 : (ref2 = ref1.action) === null || ref2 === void 0 ? void 0 : ref2.active,
106
+ pageIconInactiveColor: muiTheme === null || muiTheme === void 0 ? void 0 : (ref3 = muiTheme.palette) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.action) === null || ref4 === void 0 ? void 0 : ref4.disabled
107
+ },
108
+ toolbox: {
109
+ show: true,
110
+ top: 10,
111
+ right: 10,
112
+ iconStyle: {
113
+ borderColor: primaryTextColor
114
+ }
115
+ },
116
+ tooltip: {},
117
+ line: {
118
+ showSymbol: false,
119
+ symbol: 'circle',
120
+ symbolSize: 4,
121
+ smooth: false,
122
+ lineStyle: {
123
+ width: 1
124
+ },
125
+ emphasis: {
126
+ lineStyle: {
127
+ width: 1.5
128
+ }
129
+ }
130
+ },
131
+ bar: {
132
+ barMaxWidth: 150,
133
+ itemStyle: {
134
+ borderWidth: 0,
135
+ borderColor: muiTheme.palette.grey[300]
136
+ }
137
+ },
138
+ gauge: {
139
+ detail: {
140
+ fontSize: 18,
141
+ fontWeight: 600,
142
+ valueAnimation: false
143
+ },
144
+ splitLine: {
145
+ distance: 0,
146
+ length: 4,
147
+ lineStyle: {
148
+ width: 1
149
+ }
150
+ },
151
+ splitNumber: 12
152
+ }
153
+ };
154
+ return {
155
+ echartsTheme: merge(muiConvertedTheme, echartsTheme),
156
+ noDataOption: {
157
+ title: {
158
+ show: true,
159
+ textStyle: {
160
+ color: primaryTextColor,
161
+ fontSize: 16,
162
+ fontWeight: 400
163
+ },
164
+ text: 'No data',
165
+ left: 'center',
166
+ top: 'center'
167
+ },
168
+ xAxis: {
169
+ show: false
170
+ },
171
+ yAxis: {
172
+ show: false
173
+ }
174
+ },
175
+ sparkline: {
176
+ width: 2,
177
+ color: '#1976d2'
178
+ }
179
+ };
180
+ }
181
+
182
+ //# sourceMappingURL=theme-gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/theme-gen.ts"],"sourcesContent":["// Copyright 2022 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Theme } from '@mui/material';\nimport { merge } from 'lodash-es';\nimport { EChartsTheme, PersesChartsTheme } from '../model';\n\nconst DEFAULT_TEXT_COLOR = '#222';\n\n// avoid component override type errors since only palette and typography are used\ntype MuiTheme = Omit<Theme, 'components'>;\n\nexport function generateChartsTheme(muiTheme: MuiTheme, echartsTheme: EChartsTheme): PersesChartsTheme {\n const primaryTextColor = muiTheme.palette.text?.primary ?? DEFAULT_TEXT_COLOR;\n\n const muiConvertedTheme: EChartsTheme = {\n title: {\n show: false,\n },\n textStyle: {\n color: primaryTextColor,\n fontFamily: muiTheme.typography.fontFamily,\n fontSize: 12,\n },\n grid: {\n top: 5,\n right: 20,\n bottom: 0,\n left: 20,\n containLabel: true,\n },\n color: ['#8dd3c7', '#bebada', '#fb8072', '#80b1d3', '#fdb462'],\n categoryAxis: {\n show: true,\n axisLabel: {\n show: true,\n color: primaryTextColor,\n margin: 15,\n },\n axisTick: {\n show: false,\n length: 6,\n lineStyle: {\n color: muiTheme.palette.grey[600],\n },\n },\n axisLine: {\n show: true,\n lineStyle: {\n color: muiTheme.palette.grey[600],\n },\n },\n splitLine: {\n show: true,\n lineStyle: {\n width: 0.5,\n color: muiTheme.palette.grey[300],\n opacity: 0.6,\n },\n },\n splitArea: {\n show: false,\n areaStyle: {\n color: [muiTheme.palette.grey[300]],\n },\n },\n },\n valueAxis: {\n show: true,\n axisLabel: {\n color: primaryTextColor,\n margin: 12,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: true,\n lineStyle: {\n width: 0.5,\n color: muiTheme.palette.grey[300],\n opacity: 0.6,\n },\n },\n },\n legend: {\n orient: 'horizontal',\n textStyle: {\n color: primaryTextColor,\n },\n pageTextStyle: {\n color: muiTheme.palette.grey[600],\n },\n pageIconColor: muiTheme?.palette?.action?.active,\n pageIconInactiveColor: muiTheme?.palette?.action?.disabled,\n },\n toolbox: {\n show: true,\n top: 10,\n right: 10,\n iconStyle: {\n borderColor: primaryTextColor,\n },\n },\n tooltip: {},\n line: {\n showSymbol: false,\n symbol: 'circle',\n symbolSize: 4,\n smooth: false,\n lineStyle: {\n width: 1,\n },\n emphasis: {\n lineStyle: {\n width: 1.5,\n },\n },\n },\n bar: {\n barMaxWidth: 150,\n itemStyle: {\n borderWidth: 0,\n borderColor: muiTheme.palette.grey[300],\n },\n },\n gauge: {\n detail: {\n fontSize: 18,\n fontWeight: 600,\n valueAnimation: false,\n },\n splitLine: {\n distance: 0,\n length: 4,\n lineStyle: {\n width: 1,\n },\n },\n splitNumber: 12,\n },\n };\n\n return {\n echartsTheme: merge(muiConvertedTheme, echartsTheme),\n noDataOption: {\n title: {\n show: true,\n textStyle: {\n color: primaryTextColor,\n fontSize: 16,\n fontWeight: 400,\n },\n text: 'No data',\n left: 'center',\n top: 'center',\n },\n xAxis: {\n show: false,\n },\n yAxis: {\n show: false,\n },\n },\n sparkline: {\n width: 2,\n color: '#1976d2',\n },\n // TODO: add thresholdColors to theme\n };\n}\n"],"names":["merge","DEFAULT_TEXT_COLOR","generateChartsTheme","muiTheme","echartsTheme","primaryTextColor","palette","text","primary","muiConvertedTheme","title","show","textStyle","color","fontFamily","typography","fontSize","grid","top","right","bottom","left","containLabel","categoryAxis","axisLabel","margin","axisTick","length","lineStyle","grey","axisLine","splitLine","width","opacity","splitArea","areaStyle","valueAxis","legend","orient","pageTextStyle","pageIconColor","action","active","pageIconInactiveColor","disabled","toolbox","iconStyle","borderColor","tooltip","line","showSymbol","symbol","symbolSize","smooth","emphasis","bar","barMaxWidth","itemStyle","borderWidth","gauge","detail","fontWeight","valueAnimation","distance","splitNumber","noDataOption","xAxis","yAxis","sparkline"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,KAAK,QAAQ,WAAW,CAAC;AAGlC,MAAMC,kBAAkB,GAAG,MAAM,AAAC;AAKlC,OAAO,SAASC,mBAAmB,CAACC,QAAkB,EAAEC,YAA0B,EAAqB;QAC5ED,GAAqB,EAgF3BA,IAAiB,QACTA,IAAiB;QAjFnBA,IAA8B;IAAvD,MAAME,gBAAgB,GAAGF,CAAAA,IAA8B,GAA9BA,CAAAA,GAAqB,GAArBA,QAAQ,CAACG,OAAO,CAACC,IAAI,cAArBJ,GAAqB,WAAS,GAA9BA,KAAAA,CAA8B,GAA9BA,GAAqB,CAAEK,OAAO,cAA9BL,IAA8B,cAA9BA,IAA8B,GAAIF,kBAAkB,AAAC;IAE9E,MAAMQ,iBAAiB,GAAiB;QACtCC,KAAK,EAAE;YACLC,IAAI,EAAE,KAAK;SACZ;QACDC,SAAS,EAAE;YACTC,KAAK,EAAER,gBAAgB;YACvBS,UAAU,EAAEX,QAAQ,CAACY,UAAU,CAACD,UAAU;YAC1CE,QAAQ,EAAE,EAAE;SACb;QACDC,IAAI,EAAE;YACJC,GAAG,EAAE,CAAC;YACNC,KAAK,EAAE,EAAE;YACTC,MAAM,EAAE,CAAC;YACTC,IAAI,EAAE,EAAE;YACRC,YAAY,EAAE,IAAI;SACnB;QACDT,KAAK,EAAE;YAAC,SAAS;YAAE,SAAS;YAAE,SAAS;YAAE,SAAS;YAAE,SAAS;SAAC;QAC9DU,YAAY,EAAE;YACZZ,IAAI,EAAE,IAAI;YACVa,SAAS,EAAE;gBACTb,IAAI,EAAE,IAAI;gBACVE,KAAK,EAAER,gBAAgB;gBACvBoB,MAAM,EAAE,EAAE;aACX;YACDC,QAAQ,EAAE;gBACRf,IAAI,EAAE,KAAK;gBACXgB,MAAM,EAAE,CAAC;gBACTC,SAAS,EAAE;oBACTf,KAAK,EAAEV,QAAQ,CAACG,OAAO,CAACuB,IAAI,CAAC,GAAG,CAAC;iBAClC;aACF;YACDC,QAAQ,EAAE;gBACRnB,IAAI,EAAE,IAAI;gBACViB,SAAS,EAAE;oBACTf,KAAK,EAAEV,QAAQ,CAACG,OAAO,CAACuB,IAAI,CAAC,GAAG,CAAC;iBAClC;aACF;YACDE,SAAS,EAAE;gBACTpB,IAAI,EAAE,IAAI;gBACViB,SAAS,EAAE;oBACTI,KAAK,EAAE,GAAG;oBACVnB,KAAK,EAAEV,QAAQ,CAACG,OAAO,CAACuB,IAAI,CAAC,GAAG,CAAC;oBACjCI,OAAO,EAAE,GAAG;iBACb;aACF;YACDC,SAAS,EAAE;gBACTvB,IAAI,EAAE,KAAK;gBACXwB,SAAS,EAAE;oBACTtB,KAAK,EAAE;wBAACV,QAAQ,CAACG,OAAO,CAACuB,IAAI,CAAC,GAAG,CAAC;qBAAC;iBACpC;aACF;SACF;QACDO,SAAS,EAAE;YACTzB,IAAI,EAAE,IAAI;YACVa,SAAS,EAAE;gBACTX,KAAK,EAAER,gBAAgB;gBACvBoB,MAAM,EAAE,EAAE;aACX;YACDK,QAAQ,EAAE;gBACRnB,IAAI,EAAE,KAAK;aACZ;YACDoB,SAAS,EAAE;gBACTpB,IAAI,EAAE,IAAI;gBACViB,SAAS,EAAE;oBACTI,KAAK,EAAE,GAAG;oBACVnB,KAAK,EAAEV,QAAQ,CAACG,OAAO,CAACuB,IAAI,CAAC,GAAG,CAAC;oBACjCI,OAAO,EAAE,GAAG;iBACb;aACF;SACF;QACDI,MAAM,EAAE;YACNC,MAAM,EAAE,YAAY;YACpB1B,SAAS,EAAE;gBACTC,KAAK,EAAER,gBAAgB;aACxB;YACDkC,aAAa,EAAE;gBACb1B,KAAK,EAAEV,QAAQ,CAACG,OAAO,CAACuB,IAAI,CAAC,GAAG,CAAC;aAClC;YACDW,aAAa,EAAErC,QAAQ,aAARA,QAAQ,WAAS,GAAjBA,KAAAA,CAAiB,GAAjBA,CAAAA,IAAiB,GAAjBA,QAAQ,CAAEG,OAAO,cAAjBH,IAAiB,WAAA,GAAjBA,KAAAA,CAAiB,GAAjBA,QAAAA,IAAiB,CAAEsC,MAAM,6BAAR,GAAjBtC,KAAAA,CAAiB,QAAUuC,MAAM,AAAhB;YAChCC,qBAAqB,EAAExC,QAAQ,aAARA,QAAQ,WAAS,GAAjBA,KAAAA,CAAiB,GAAjBA,CAAAA,IAAiB,GAAjBA,QAAQ,CAAEG,OAAO,cAAjBH,IAAiB,WAAA,GAAjBA,KAAAA,CAAiB,GAAjBA,QAAAA,IAAiB,CAAEsC,MAAM,6BAAR,GAAjBtC,KAAAA,CAAiB,QAAUyC,QAAQ,AAAlB;SACzC;QACDC,OAAO,EAAE;YACPlC,IAAI,EAAE,IAAI;YACVO,GAAG,EAAE,EAAE;YACPC,KAAK,EAAE,EAAE;YACT2B,SAAS,EAAE;gBACTC,WAAW,EAAE1C,gBAAgB;aAC9B;SACF;QACD2C,OAAO,EAAE,EAAE;QACXC,IAAI,EAAE;YACJC,UAAU,EAAE,KAAK;YACjBC,MAAM,EAAE,QAAQ;YAChBC,UAAU,EAAE,CAAC;YACbC,MAAM,EAAE,KAAK;YACbzB,SAAS,EAAE;gBACTI,KAAK,EAAE,CAAC;aACT;YACDsB,QAAQ,EAAE;gBACR1B,SAAS,EAAE;oBACTI,KAAK,EAAE,GAAG;iBACX;aACF;SACF;QACDuB,GAAG,EAAE;YACHC,WAAW,EAAE,GAAG;YAChBC,SAAS,EAAE;gBACTC,WAAW,EAAE,CAAC;gBACdX,WAAW,EAAE5C,QAAQ,CAACG,OAAO,CAACuB,IAAI,CAAC,GAAG,CAAC;aACxC;SACF;QACD8B,KAAK,EAAE;YACLC,MAAM,EAAE;gBACN5C,QAAQ,EAAE,EAAE;gBACZ6C,UAAU,EAAE,GAAG;gBACfC,cAAc,EAAE,KAAK;aACtB;YACD/B,SAAS,EAAE;gBACTgC,QAAQ,EAAE,CAAC;gBACXpC,MAAM,EAAE,CAAC;gBACTC,SAAS,EAAE;oBACTI,KAAK,EAAE,CAAC;iBACT;aACF;YACDgC,WAAW,EAAE,EAAE;SAChB;KACF,AAAC;IAEF,OAAO;QACL5D,YAAY,EAAEJ,KAAK,CAACS,iBAAiB,EAAEL,YAAY,CAAC;QACpD6D,YAAY,EAAE;YACZvD,KAAK,EAAE;gBACLC,IAAI,EAAE,IAAI;gBACVC,SAAS,EAAE;oBACTC,KAAK,EAAER,gBAAgB;oBACvBW,QAAQ,EAAE,EAAE;oBACZ6C,UAAU,EAAE,GAAG;iBAChB;gBACDtD,IAAI,EAAE,SAAS;gBACfc,IAAI,EAAE,QAAQ;gBACdH,GAAG,EAAE,QAAQ;aACd;YACDgD,KAAK,EAAE;gBACLvD,IAAI,EAAE,KAAK;aACZ;YACDwD,KAAK,EAAE;gBACLxD,IAAI,EAAE,KAAK;aACZ;SACF;QACDyD,SAAS,EAAE;YACTpC,KAAK,EAAE,CAAC;YACRnB,KAAK,EAAE,SAAS;SACjB;KAEF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=theme-gen.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-gen.test.d.ts","sourceRoot":"","sources":["../../src/utils/theme-gen.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,195 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { createTheme } from '@mui/material';
14
+ import { generateChartsTheme } from './theme-gen';
15
+ describe('generateChartsTheme', ()=>{
16
+ const muiTheme = createTheme({});
17
+ const echartsThemeOverrides = {
18
+ legend: {
19
+ textStyle: {
20
+ color: 'yellow'
21
+ }
22
+ },
23
+ line: {
24
+ showSymbol: true,
25
+ smooth: true
26
+ }
27
+ };
28
+ const chartsTheme = generateChartsTheme(muiTheme, echartsThemeOverrides);
29
+ it('should return perses specific charts theme from converted MUI theme', ()=>{
30
+ expect(chartsTheme).toMatchInlineSnapshot(`
31
+ Object {
32
+ "echartsTheme": Object {
33
+ "bar": Object {
34
+ "barMaxWidth": 150,
35
+ "itemStyle": Object {
36
+ "borderColor": "#e0e0e0",
37
+ "borderWidth": 0,
38
+ },
39
+ },
40
+ "categoryAxis": Object {
41
+ "axisLabel": Object {
42
+ "color": "rgba(0, 0, 0, 0.87)",
43
+ "margin": 15,
44
+ "show": true,
45
+ },
46
+ "axisLine": Object {
47
+ "lineStyle": Object {
48
+ "color": "#757575",
49
+ },
50
+ "show": true,
51
+ },
52
+ "axisTick": Object {
53
+ "length": 6,
54
+ "lineStyle": Object {
55
+ "color": "#757575",
56
+ },
57
+ "show": false,
58
+ },
59
+ "show": true,
60
+ "splitArea": Object {
61
+ "areaStyle": Object {
62
+ "color": Array [
63
+ "#e0e0e0",
64
+ ],
65
+ },
66
+ "show": false,
67
+ },
68
+ "splitLine": Object {
69
+ "lineStyle": Object {
70
+ "color": "#e0e0e0",
71
+ "opacity": 0.6,
72
+ "width": 0.5,
73
+ },
74
+ "show": true,
75
+ },
76
+ },
77
+ "color": Array [
78
+ "#8dd3c7",
79
+ "#bebada",
80
+ "#fb8072",
81
+ "#80b1d3",
82
+ "#fdb462",
83
+ ],
84
+ "gauge": Object {
85
+ "detail": Object {
86
+ "fontSize": 18,
87
+ "fontWeight": 600,
88
+ "valueAnimation": false,
89
+ },
90
+ "splitLine": Object {
91
+ "distance": 0,
92
+ "length": 4,
93
+ "lineStyle": Object {
94
+ "width": 1,
95
+ },
96
+ },
97
+ "splitNumber": 12,
98
+ },
99
+ "grid": Object {
100
+ "bottom": 0,
101
+ "containLabel": true,
102
+ "left": 20,
103
+ "right": 20,
104
+ "top": 5,
105
+ },
106
+ "legend": Object {
107
+ "orient": "horizontal",
108
+ "pageIconColor": "rgba(0, 0, 0, 0.54)",
109
+ "pageIconInactiveColor": "rgba(0, 0, 0, 0.26)",
110
+ "pageTextStyle": Object {
111
+ "color": "#757575",
112
+ },
113
+ "textStyle": Object {
114
+ "color": "yellow",
115
+ },
116
+ },
117
+ "line": Object {
118
+ "emphasis": Object {
119
+ "lineStyle": Object {
120
+ "width": 1.5,
121
+ },
122
+ },
123
+ "lineStyle": Object {
124
+ "width": 1,
125
+ },
126
+ "showSymbol": true,
127
+ "smooth": true,
128
+ "symbol": "circle",
129
+ "symbolSize": 4,
130
+ },
131
+ "textStyle": Object {
132
+ "color": "rgba(0, 0, 0, 0.87)",
133
+ "fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
134
+ "fontSize": 12,
135
+ },
136
+ "title": Object {
137
+ "show": false,
138
+ },
139
+ "toolbox": Object {
140
+ "iconStyle": Object {
141
+ "borderColor": "rgba(0, 0, 0, 0.87)",
142
+ },
143
+ "right": 10,
144
+ "show": true,
145
+ "top": 10,
146
+ },
147
+ "tooltip": Object {},
148
+ "valueAxis": Object {
149
+ "axisLabel": Object {
150
+ "color": "rgba(0, 0, 0, 0.87)",
151
+ "margin": 12,
152
+ },
153
+ "axisLine": Object {
154
+ "show": false,
155
+ },
156
+ "show": true,
157
+ "splitLine": Object {
158
+ "lineStyle": Object {
159
+ "color": "#e0e0e0",
160
+ "opacity": 0.6,
161
+ "width": 0.5,
162
+ },
163
+ "show": true,
164
+ },
165
+ },
166
+ },
167
+ "noDataOption": Object {
168
+ "title": Object {
169
+ "left": "center",
170
+ "show": true,
171
+ "text": "No data",
172
+ "textStyle": Object {
173
+ "color": "rgba(0, 0, 0, 0.87)",
174
+ "fontSize": 16,
175
+ "fontWeight": 400,
176
+ },
177
+ "top": "center",
178
+ },
179
+ "xAxis": Object {
180
+ "show": false,
181
+ },
182
+ "yAxis": Object {
183
+ "show": false,
184
+ },
185
+ },
186
+ "sparkline": Object {
187
+ "color": "#1976d2",
188
+ "width": 2,
189
+ },
190
+ }
191
+ `);
192
+ });
193
+ });
194
+
195
+ //# sourceMappingURL=theme-gen.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/theme-gen.test.ts"],"sourcesContent":["// Copyright 2022 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createTheme } from '@mui/material';\nimport { EChartsTheme, PersesChartsTheme } from '../model';\nimport { generateChartsTheme } from './theme-gen';\n\ndescribe('generateChartsTheme', () => {\n const muiTheme = createTheme({});\n const echartsThemeOverrides: EChartsTheme = {\n legend: {\n textStyle: {\n color: 'yellow',\n },\n },\n line: {\n showSymbol: true,\n smooth: true,\n },\n };\n const chartsTheme: PersesChartsTheme = generateChartsTheme(muiTheme, echartsThemeOverrides);\n\n it('should return perses specific charts theme from converted MUI theme', () => {\n expect(chartsTheme).toMatchInlineSnapshot(`\n Object {\n \"echartsTheme\": Object {\n \"bar\": Object {\n \"barMaxWidth\": 150,\n \"itemStyle\": Object {\n \"borderColor\": \"#e0e0e0\",\n \"borderWidth\": 0,\n },\n },\n \"categoryAxis\": Object {\n \"axisLabel\": Object {\n \"color\": \"rgba(0, 0, 0, 0.87)\",\n \"margin\": 15,\n \"show\": true,\n },\n \"axisLine\": Object {\n \"lineStyle\": Object {\n \"color\": \"#757575\",\n },\n \"show\": true,\n },\n \"axisTick\": Object {\n \"length\": 6,\n \"lineStyle\": Object {\n \"color\": \"#757575\",\n },\n \"show\": false,\n },\n \"show\": true,\n \"splitArea\": Object {\n \"areaStyle\": Object {\n \"color\": Array [\n \"#e0e0e0\",\n ],\n },\n \"show\": false,\n },\n \"splitLine\": Object {\n \"lineStyle\": Object {\n \"color\": \"#e0e0e0\",\n \"opacity\": 0.6,\n \"width\": 0.5,\n },\n \"show\": true,\n },\n },\n \"color\": Array [\n \"#8dd3c7\",\n \"#bebada\",\n \"#fb8072\",\n \"#80b1d3\",\n \"#fdb462\",\n ],\n \"gauge\": Object {\n \"detail\": Object {\n \"fontSize\": 18,\n \"fontWeight\": 600,\n \"valueAnimation\": false,\n },\n \"splitLine\": Object {\n \"distance\": 0,\n \"length\": 4,\n \"lineStyle\": Object {\n \"width\": 1,\n },\n },\n \"splitNumber\": 12,\n },\n \"grid\": Object {\n \"bottom\": 0,\n \"containLabel\": true,\n \"left\": 20,\n \"right\": 20,\n \"top\": 5,\n },\n \"legend\": Object {\n \"orient\": \"horizontal\",\n \"pageIconColor\": \"rgba(0, 0, 0, 0.54)\",\n \"pageIconInactiveColor\": \"rgba(0, 0, 0, 0.26)\",\n \"pageTextStyle\": Object {\n \"color\": \"#757575\",\n },\n \"textStyle\": Object {\n \"color\": \"yellow\",\n },\n },\n \"line\": Object {\n \"emphasis\": Object {\n \"lineStyle\": Object {\n \"width\": 1.5,\n },\n },\n \"lineStyle\": Object {\n \"width\": 1,\n },\n \"showSymbol\": true,\n \"smooth\": true,\n \"symbol\": \"circle\",\n \"symbolSize\": 4,\n },\n \"textStyle\": Object {\n \"color\": \"rgba(0, 0, 0, 0.87)\",\n \"fontFamily\": \"\\\\\"Roboto\\\\\", \\\\\"Helvetica\\\\\", \\\\\"Arial\\\\\", sans-serif\",\n \"fontSize\": 12,\n },\n \"title\": Object {\n \"show\": false,\n },\n \"toolbox\": Object {\n \"iconStyle\": Object {\n \"borderColor\": \"rgba(0, 0, 0, 0.87)\",\n },\n \"right\": 10,\n \"show\": true,\n \"top\": 10,\n },\n \"tooltip\": Object {},\n \"valueAxis\": Object {\n \"axisLabel\": Object {\n \"color\": \"rgba(0, 0, 0, 0.87)\",\n \"margin\": 12,\n },\n \"axisLine\": Object {\n \"show\": false,\n },\n \"show\": true,\n \"splitLine\": Object {\n \"lineStyle\": Object {\n \"color\": \"#e0e0e0\",\n \"opacity\": 0.6,\n \"width\": 0.5,\n },\n \"show\": true,\n },\n },\n },\n \"noDataOption\": Object {\n \"title\": Object {\n \"left\": \"center\",\n \"show\": true,\n \"text\": \"No data\",\n \"textStyle\": Object {\n \"color\": \"rgba(0, 0, 0, 0.87)\",\n \"fontSize\": 16,\n \"fontWeight\": 400,\n },\n \"top\": \"center\",\n },\n \"xAxis\": Object {\n \"show\": false,\n },\n \"yAxis\": Object {\n \"show\": false,\n },\n },\n \"sparkline\": Object {\n \"color\": \"#1976d2\",\n \"width\": 2,\n },\n }\n `);\n });\n});\n"],"names":["createTheme","generateChartsTheme","describe","muiTheme","echartsThemeOverrides","legend","textStyle","color","line","showSymbol","smooth","chartsTheme","it","expect","toMatchInlineSnapshot"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,QAAQ,eAAe,CAAC;AAE5C,SAASC,mBAAmB,QAAQ,aAAa,CAAC;AAElDC,QAAQ,CAAC,qBAAqB,EAAE,IAAM;IACpC,MAAMC,QAAQ,GAAGH,WAAW,CAAC,EAAE,CAAC,AAAC;IACjC,MAAMI,qBAAqB,GAAiB;QAC1CC,MAAM,EAAE;YACNC,SAAS,EAAE;gBACTC,KAAK,EAAE,QAAQ;aAChB;SACF;QACDC,IAAI,EAAE;YACJC,UAAU,EAAE,IAAI;YAChBC,MAAM,EAAE,IAAI;SACb;KACF,AAAC;IACF,MAAMC,WAAW,GAAsBV,mBAAmB,CAACE,QAAQ,EAAEC,qBAAqB,CAAC,AAAC;IAE5FQ,EAAE,CAAC,qEAAqE,EAAE,IAAM;QAC9EC,MAAM,CAACF,WAAW,CAAC,CAACG,qBAAqB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiK3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@perses-dev/components",
3
+ "version": "0.0.0-snapshot-time-range-height-80d08fc",
4
+ "description": "Common UI components used across Perses features",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://github.com/perses/perses/blob/main/README.md",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/perses/perses.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/perses/perses/issues"
13
+ },
14
+ "module": "dist/index.js",
15
+ "main": "dist/cjs/index.js",
16
+ "types": "dist/index.d.ts",
17
+ "sideEffects": [
18
+ "./dist/GaugeChart/GaugeChart.js",
19
+ "./dist/LineChart/LineChart.js",
20
+ "./dist/StatChart/StatChart.js"
21
+ ],
22
+ "scripts": {
23
+ "clean": "rimraf dist/",
24
+ "build": "concurrently \"npm:build:*\"",
25
+ "build:cjs": "swc ./src -d dist/cjs --config-file ../.cjs.swcrc",
26
+ "build:esm": "swc ./src -d dist --config-file ../.swcrc",
27
+ "build:types": "tsc --emitDeclarationOnly --declaration --preserveWatchOutput",
28
+ "start": "concurrently -P \"npm:build:* -- {*}\" -- --watch",
29
+ "test": "TZ=UTC jest",
30
+ "test:watch": "TZ=UTC jest --watch",
31
+ "lint": "eslint src --ext .ts,.tsx",
32
+ "lint:fix": "eslint --fix src --ext .ts,.tsx"
33
+ },
34
+ "dependencies": {
35
+ "@fontsource/lato": "^4.5.10",
36
+ "@mui/x-date-pickers": "^5.0.0-beta.1",
37
+ "@perses-dev/core": "0.0.0-snapshot-time-range-height-80d08fc",
38
+ "date-fns": "^2.28.0",
39
+ "date-fns-tz": "^1.3.7",
40
+ "echarts": "^5.3.3",
41
+ "lodash-es": "^4.17.21",
42
+ "mathjs": "^10.6.4",
43
+ "mdi-material-ui": "^7.4.0",
44
+ "react-error-boundary": "^3.1.4"
45
+ },
46
+ "peerDependencies": {
47
+ "@mui/material": "^5.10.0",
48
+ "react": "^17.0.2 || ^18.0.0",
49
+ "react-dom": "^17.0.2 || ^18.0.0"
50
+ },
51
+ "files": [
52
+ "dist"
53
+ ]
54
+ }