@perses-dev/components 0.23.1 → 0.25.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 (181) hide show
  1. package/dist/ColorPicker/ColorPicker.d.ts +12 -0
  2. package/dist/ColorPicker/ColorPicker.d.ts.map +1 -0
  3. package/dist/ColorPicker/ColorPicker.js +78 -0
  4. package/dist/ColorPicker/ColorPicker.js.map +1 -0
  5. package/dist/ColorPicker/index.d.ts +2 -0
  6. package/dist/ColorPicker/index.d.ts.map +1 -0
  7. package/dist/ColorPicker/index.js +15 -0
  8. package/dist/ColorPicker/index.js.map +1 -0
  9. package/dist/Dialog/Dialog.d.ts +2 -1
  10. package/dist/Dialog/Dialog.d.ts.map +1 -1
  11. package/dist/Dialog/Dialog.js +12 -1
  12. package/dist/Dialog/Dialog.js.map +1 -1
  13. package/dist/{EChart.d.ts → EChart/EChart.d.ts} +3 -3
  14. package/dist/EChart/EChart.d.ts.map +1 -0
  15. package/dist/EChart/EChart.js.map +1 -0
  16. package/dist/EChart/index.d.ts +2 -0
  17. package/dist/EChart/index.d.ts.map +1 -0
  18. package/dist/EChart/index.js +15 -0
  19. package/dist/EChart/index.js.map +1 -0
  20. package/dist/GaugeChart/GaugeChart.d.ts +1 -2
  21. package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
  22. package/dist/GaugeChart/GaugeChart.js.map +1 -1
  23. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
  24. package/dist/InfoTooltip/InfoTooltip.js +7 -3
  25. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  26. package/dist/Legend/Legend.d.ts +1 -2
  27. package/dist/Legend/Legend.d.ts.map +1 -1
  28. package/dist/Legend/Legend.js +6 -9
  29. package/dist/Legend/Legend.js.map +1 -1
  30. package/dist/LineChart/LineChart.d.ts +4 -2
  31. package/dist/LineChart/LineChart.d.ts.map +1 -1
  32. package/dist/LineChart/LineChart.js +1 -1
  33. package/dist/LineChart/LineChart.js.map +1 -1
  34. package/dist/OptionsEditorLayout/OptionsEditorControl.js +1 -1
  35. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  36. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +3 -2
  37. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
  38. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +17 -5
  39. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  40. package/dist/StatChart/StatChart.d.ts +1 -3
  41. package/dist/StatChart/StatChart.d.ts.map +1 -1
  42. package/dist/StatChart/StatChart.js +1 -3
  43. package/dist/StatChart/StatChart.js.map +1 -1
  44. package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +4 -0
  45. package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +1 -0
  46. package/dist/ThresholdsEditor/ThresholdColorPicker.js +76 -0
  47. package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -0
  48. package/dist/ThresholdsEditor/ThresholdInput.d.ts +13 -0
  49. package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -0
  50. package/dist/ThresholdsEditor/ThresholdInput.js +61 -0
  51. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -0
  52. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +10 -0
  53. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -0
  54. package/dist/ThresholdsEditor/ThresholdsEditor.js +215 -0
  55. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -0
  56. package/dist/ThresholdsEditor/index.d.ts +2 -0
  57. package/dist/ThresholdsEditor/index.d.ts.map +1 -0
  58. package/dist/ThresholdsEditor/index.js +15 -0
  59. package/dist/ThresholdsEditor/index.js.map +1 -0
  60. package/dist/TimeSeriesTooltip/focused-series.d.ts.map +1 -1
  61. package/dist/TimeSeriesTooltip/focused-series.js +3 -3
  62. package/dist/TimeSeriesTooltip/focused-series.js.map +1 -1
  63. package/dist/cjs/ColorPicker/ColorPicker.js +128 -0
  64. package/dist/cjs/{model/legend.test.js → ColorPicker/index.js} +11 -12
  65. package/dist/cjs/Dialog/Dialog.js +11 -0
  66. package/dist/{model/legend.test.js → cjs/EChart/index.js} +15 -14
  67. package/dist/cjs/InfoTooltip/InfoTooltip.js +7 -3
  68. package/dist/cjs/Legend/Legend.js +5 -8
  69. package/dist/cjs/LineChart/LineChart.js +40 -1
  70. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +1 -1
  71. package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +22 -5
  72. package/dist/cjs/StatChart/StatChart.js +1 -41
  73. package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +87 -0
  74. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +72 -0
  75. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +265 -0
  76. package/dist/cjs/ThresholdsEditor/index.js +28 -0
  77. package/dist/cjs/TimeSeriesTooltip/focused-series.js +3 -3
  78. package/dist/cjs/index.js +2 -0
  79. package/dist/cjs/test-utils/theme.js +8 -0
  80. package/dist/cjs/theme/component-overrides/alert.js +102 -0
  81. package/dist/cjs/theme/theme.js +4 -8
  82. package/dist/cjs/utils/theme-gen.js +8 -0
  83. package/dist/index.d.ts +2 -0
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js +2 -0
  86. package/dist/index.js.map +1 -1
  87. package/dist/model/graph.d.ts +2 -2
  88. package/dist/model/graph.d.ts.map +1 -1
  89. package/dist/model/graph.js.map +1 -1
  90. package/dist/model/legend.d.ts +1 -1
  91. package/dist/model/legend.d.ts.map +1 -1
  92. package/dist/model/legend.js.map +1 -1
  93. package/dist/model/theme.d.ts +5 -0
  94. package/dist/model/theme.d.ts.map +1 -1
  95. package/dist/model/theme.js.map +1 -1
  96. package/dist/model/units/bytes.d.ts +1 -1
  97. package/dist/model/units/bytes.d.ts.map +1 -1
  98. package/dist/model/units/bytes.js.map +1 -1
  99. package/dist/model/units/decimal.d.ts +1 -1
  100. package/dist/model/units/decimal.d.ts.map +1 -1
  101. package/dist/model/units/decimal.js.map +1 -1
  102. package/dist/model/units/percent.d.ts +1 -1
  103. package/dist/model/units/percent.d.ts.map +1 -1
  104. package/dist/model/units/percent.js.map +1 -1
  105. package/dist/model/units/time.d.ts +1 -1
  106. package/dist/model/units/time.d.ts.map +1 -1
  107. package/dist/model/units/time.js.map +1 -1
  108. package/dist/model/units/types.d.ts +1 -1
  109. package/dist/model/units/types.d.ts.map +1 -1
  110. package/dist/model/units/types.js.map +1 -1
  111. package/dist/test-utils/theme.d.ts.map +1 -1
  112. package/dist/test-utils/theme.js +8 -0
  113. package/dist/test-utils/theme.js.map +1 -1
  114. package/dist/theme/component-overrides/alert.d.ts +3 -0
  115. package/dist/theme/component-overrides/alert.d.ts.map +1 -0
  116. package/dist/theme/component-overrides/alert.js +96 -0
  117. package/dist/theme/component-overrides/alert.js.map +1 -0
  118. package/dist/theme/theme.d.ts.map +1 -1
  119. package/dist/theme/theme.js +5 -9
  120. package/dist/theme/theme.js.map +1 -1
  121. package/dist/utils/theme-gen.d.ts.map +1 -1
  122. package/dist/utils/theme-gen.js +8 -0
  123. package/dist/utils/theme-gen.js.map +1 -1
  124. package/package.json +8 -3
  125. package/dist/EChart.d.ts.map +0 -1
  126. package/dist/EChart.js.map +0 -1
  127. package/dist/InfoTooltip/InfoTooltip.test.d.ts +0 -2
  128. package/dist/InfoTooltip/InfoTooltip.test.d.ts.map +0 -1
  129. package/dist/InfoTooltip/InfoTooltip.test.js +0 -36
  130. package/dist/InfoTooltip/InfoTooltip.test.js.map +0 -1
  131. package/dist/LegendOptionsEditor/LegendOptionsEditor.test.d.ts +0 -2
  132. package/dist/LegendOptionsEditor/LegendOptionsEditor.test.d.ts.map +0 -1
  133. package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js +0 -62
  134. package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js.map +0 -1
  135. package/dist/StatChart/StatChart.test.d.ts +0 -2
  136. package/dist/StatChart/StatChart.test.d.ts.map +0 -1
  137. package/dist/StatChart/StatChart.test.js +0 -94
  138. package/dist/StatChart/StatChart.test.js.map +0 -1
  139. package/dist/TimeSeriesTooltip/SeriesInfo.test.d.ts +0 -2
  140. package/dist/TimeSeriesTooltip/SeriesInfo.test.d.ts.map +0 -1
  141. package/dist/TimeSeriesTooltip/SeriesInfo.test.js +0 -52
  142. package/dist/TimeSeriesTooltip/SeriesInfo.test.js.map +0 -1
  143. package/dist/TimeSeriesTooltip/TooltipContent.test.d.ts +0 -2
  144. package/dist/TimeSeriesTooltip/TooltipContent.test.d.ts.map +0 -1
  145. package/dist/TimeSeriesTooltip/TooltipContent.test.js +0 -78
  146. package/dist/TimeSeriesTooltip/TooltipContent.test.js.map +0 -1
  147. package/dist/TimeSeriesTooltip/focused-series.test.d.ts +0 -2
  148. package/dist/TimeSeriesTooltip/focused-series.test.d.ts.map +0 -1
  149. package/dist/TimeSeriesTooltip/focused-series.test.js +0 -93
  150. package/dist/TimeSeriesTooltip/focused-series.test.js.map +0 -1
  151. package/dist/UnitSelector/UnitSelector.test.d.ts +0 -2
  152. package/dist/UnitSelector/UnitSelector.test.d.ts.map +0 -1
  153. package/dist/UnitSelector/UnitSelector.test.js +0 -204
  154. package/dist/UnitSelector/UnitSelector.test.js.map +0 -1
  155. package/dist/cjs/InfoTooltip/InfoTooltip.test.js +0 -43
  156. package/dist/cjs/LegendOptionsEditor/LegendOptionsEditor.test.js +0 -69
  157. package/dist/cjs/StatChart/StatChart.test.js +0 -96
  158. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.test.js +0 -54
  159. package/dist/cjs/TimeSeriesTooltip/TooltipContent.test.js +0 -80
  160. package/dist/cjs/TimeSeriesTooltip/focused-series.test.js +0 -95
  161. package/dist/cjs/UnitSelector/UnitSelector.test.js +0 -211
  162. package/dist/cjs/model/units/units.test.js +0 -206
  163. package/dist/cjs/utils/format.test.js +0 -47
  164. package/dist/cjs/utils/theme-gen.test.js +0 -202
  165. package/dist/model/legend.test.d.ts +0 -2
  166. package/dist/model/legend.test.d.ts.map +0 -1
  167. package/dist/model/legend.test.js.map +0 -1
  168. package/dist/model/units/units.test.d.ts +0 -2
  169. package/dist/model/units/units.test.d.ts.map +0 -1
  170. package/dist/model/units/units.test.js +0 -204
  171. package/dist/model/units/units.test.js.map +0 -1
  172. package/dist/utils/format.test.d.ts +0 -2
  173. package/dist/utils/format.test.d.ts.map +0 -1
  174. package/dist/utils/format.test.js +0 -45
  175. package/dist/utils/format.test.js.map +0 -1
  176. package/dist/utils/theme-gen.test.d.ts +0 -2
  177. package/dist/utils/theme-gen.test.d.ts.map +0 -1
  178. package/dist/utils/theme-gen.test.js +0 -200
  179. package/dist/utils/theme-gen.test.js.map +0 -1
  180. /package/dist/{EChart.js → EChart/EChart.js} +0 -0
  181. /package/dist/cjs/{EChart.js → EChart/EChart.js} +0 -0
@@ -0,0 +1,96 @@
1
+ // Copyright 2023 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 { alertClasses, linkClasses } from '@mui/material';
14
+ export const MuiAlert = {
15
+ defaultProps: {
16
+ variant: 'standard',
17
+ severity: 'success'
18
+ },
19
+ styleOverrides: {
20
+ standardError: ({ theme })=>{
21
+ return theme.palette.mode === 'dark' ? {
22
+ ...theme.typography.body1,
23
+ backgroundColor: theme.palette.error.dark,
24
+ color: theme.palette.error.light,
25
+ [`& .${alertClasses.icon}`]: {
26
+ color: theme.palette.error.main
27
+ }
28
+ } : {
29
+ ...theme.typography.body1,
30
+ backgroundColor: theme.palette.error.light,
31
+ color: theme.palette.error.dark,
32
+ [`& .${alertClasses.icon}`]: {
33
+ color: theme.palette.error.main
34
+ }
35
+ };
36
+ },
37
+ standardInfo: ({ theme })=>{
38
+ return theme.palette.mode === 'dark' ? {
39
+ ...theme.typography.body1,
40
+ backgroundColor: theme.palette.info.dark,
41
+ color: theme.palette.info.light,
42
+ [`& .${alertClasses.icon}`]: {
43
+ color: theme.palette.info.main
44
+ }
45
+ } : {
46
+ ...theme.typography.body1,
47
+ backgroundColor: theme.palette.info.light,
48
+ color: theme.palette.info.dark,
49
+ [`& .${alertClasses.icon}`]: {
50
+ color: theme.palette.info.main
51
+ }
52
+ };
53
+ },
54
+ standardSuccess: ({ theme })=>{
55
+ return theme.palette.mode === 'dark' ? {
56
+ ...theme.typography.body1,
57
+ backgroundColor: theme.palette.success.dark,
58
+ color: theme.palette.success.light,
59
+ [`& .${alertClasses.icon}`]: {
60
+ color: theme.palette.success.main
61
+ }
62
+ } : {
63
+ ...theme.typography.body1,
64
+ backgroundColor: theme.palette.success.light,
65
+ color: theme.palette.success.dark,
66
+ [`& .${alertClasses.icon}`]: {
67
+ color: theme.palette.success.main
68
+ }
69
+ };
70
+ },
71
+ standardWarning: ({ theme })=>{
72
+ return theme.palette.mode === 'dark' ? {
73
+ ...theme.typography.body1,
74
+ backgroundColor: theme.palette.warning.dark,
75
+ color: theme.palette.warning.light,
76
+ [`& .${alertClasses.icon}`]: {
77
+ color: theme.palette.warning.main
78
+ }
79
+ } : {
80
+ ...theme.typography.body1,
81
+ backgroundColor: theme.palette.warning.light,
82
+ color: theme.palette.warning.dark,
83
+ [`& .${alertClasses.icon}`]: {
84
+ color: theme.palette.warning.main
85
+ }
86
+ };
87
+ },
88
+ root: {
89
+ ['& .' + linkClasses.root]: {
90
+ textDecoration: 'underline'
91
+ }
92
+ }
93
+ }
94
+ };
95
+
96
+ //# sourceMappingURL=alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/theme/component-overrides/alert.ts"],"sourcesContent":["// Copyright 2023 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 { Components, Theme, alertClasses, linkClasses } from '@mui/material';\n\nexport const MuiAlert: Components<Theme>['MuiAlert'] = {\n defaultProps: {\n variant: 'standard',\n severity: 'success',\n },\n styleOverrides: {\n standardError: ({ theme }) => {\n return theme.palette.mode === 'dark'\n ? {\n ...theme.typography.body1,\n backgroundColor: theme.palette.error.dark,\n color: theme.palette.error.light,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.error.main,\n },\n }\n : {\n ...theme.typography.body1,\n backgroundColor: theme.palette.error.light,\n color: theme.palette.error.dark,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.error.main,\n },\n };\n },\n standardInfo: ({ theme }) => {\n return theme.palette.mode === 'dark'\n ? {\n ...theme.typography.body1,\n backgroundColor: theme.palette.info.dark,\n color: theme.palette.info.light,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.info.main,\n },\n }\n : {\n ...theme.typography.body1,\n backgroundColor: theme.palette.info.light,\n color: theme.palette.info.dark,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.info.main,\n },\n };\n },\n standardSuccess: ({ theme }) => {\n return theme.palette.mode === 'dark'\n ? {\n ...theme.typography.body1,\n backgroundColor: theme.palette.success.dark,\n color: theme.palette.success.light,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.success.main,\n },\n }\n : {\n ...theme.typography.body1,\n backgroundColor: theme.palette.success.light,\n color: theme.palette.success.dark,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.success.main,\n },\n };\n },\n standardWarning: ({ theme }) => {\n return theme.palette.mode === 'dark'\n ? {\n ...theme.typography.body1,\n backgroundColor: theme.palette.warning.dark,\n color: theme.palette.warning.light,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.warning.main,\n },\n }\n : {\n ...theme.typography.body1,\n backgroundColor: theme.palette.warning.light,\n color: theme.palette.warning.dark,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.warning.main,\n },\n };\n },\n root: {\n ['& .' + linkClasses.root]: {\n textDecoration: 'underline',\n },\n },\n },\n};\n"],"names":["alertClasses","linkClasses","MuiAlert","defaultProps","variant","severity","styleOverrides","standardError","theme","palette","mode","typography","body1","backgroundColor","error","dark","color","light","icon","main","standardInfo","info","standardSuccess","success","standardWarning","warning","root","textDecoration"],"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,SAA4BA,YAAY,EAAEC,WAAW,QAAQ,eAAe,CAAC;AAE7E,OAAO,MAAMC,QAAQ,GAAkC;IACrDC,YAAY,EAAE;QACZC,OAAO,EAAE,UAAU;QACnBC,QAAQ,EAAE,SAAS;KACpB;IACDC,cAAc,EAAE;QACdC,aAAa,EAAE,CAAC,EAAEC,KAAK,CAAA,EAAE,GAAK;YAC5B,OAAOA,KAAK,CAACC,OAAO,CAACC,IAAI,KAAK,MAAM,GAChC;gBACE,GAAGF,KAAK,CAACG,UAAU,CAACC,KAAK;gBACzBC,eAAe,EAAEL,KAAK,CAACC,OAAO,CAACK,KAAK,CAACC,IAAI;gBACzCC,KAAK,EAAER,KAAK,CAACC,OAAO,CAACK,KAAK,CAACG,KAAK;gBAChC,CAAC,CAAC,GAAG,EAAEjB,YAAY,CAACkB,IAAI,CAAC,CAAC,CAAC,EAAE;oBAC3BF,KAAK,EAAER,KAAK,CAAC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gBACzBC,eAAe,EAAEL,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACR,KAAK;gBAC5CD,KAAK,EAAER,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACV,IAAI;gBACjC,CAAC,CAAC,GAAG,EAAEf,YAAY,CAACkB,IAAI,CAAC,CAAC,CAAC,EAAE;oBAC3BF,KAAK,EAAER,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACN,IAAI;iBAClC;aACF,CAAC;QACR,CAAC;QACDO,IAAI,EAAE;YACJ,CAAC,KAAK,GAAGzB,WAAW,CAACyB,IAAI,CAAC,EAAE;gBAC1BC,cAAc,EAAE,WAAW;aAC5B;SACF;KACF;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAaA,OAAO,EAAe,WAAW,EAAgB,KAAK,EAAgB,MAAM,eAAe,CAAC;AAiB5F;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,SAQzC"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAaA,OAAO,EAAe,WAAW,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAkB9E;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,SAQzC"}
@@ -10,7 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { createTheme, alertClasses } from '@mui/material';
13
+ import { createTheme } from '@mui/material';
14
+ import { MuiAlert } from './component-overrides/alert';
14
15
  import { getPaletteOptions } from './palette/palette-options';
15
16
  import { typography } from './typography';
16
17
  const getModalBackgroundStyle = ({ theme })=>{
@@ -42,6 +43,7 @@ const getModalBackgroundStyle = ({ theme })=>{
42
43
  }
43
44
  // Overrides for component default prop values and styles go here
44
45
  const components = {
46
+ MuiAlert,
45
47
  MuiFormControl: {
46
48
  defaultProps: {
47
49
  size: 'small'
@@ -62,15 +64,9 @@ const components = {
62
64
  paper: getModalBackgroundStyle
63
65
  }
64
66
  },
65
- MuiAlert: {
67
+ MuiPopover: {
66
68
  styleOverrides: {
67
- standardError: ({ theme })=>({
68
- backgroundColor: theme.palette.designSystem.red[500],
69
- color: theme.palette.common.white,
70
- [`& .${alertClasses.icon}`]: {
71
- color: theme.palette.common.white
72
- }
73
- })
69
+ paper: getModalBackgroundStyle
74
70
  }
75
71
  }
76
72
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/theme/theme.ts"],"sourcesContent":["// Copyright 2023 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, PaletteMode, ThemeOptions, Theme, alertClasses } from '@mui/material';\nimport { getPaletteOptions } from './palette/palette-options';\nimport { typography } from './typography';\n\nconst getModalBackgroundStyle = ({ theme }: { theme: Omit<Theme, 'components'> }) => {\n const backgroundStyle =\n theme.palette.mode === 'light'\n ? {}\n : {\n backgroundImage: 'unset',\n backgroundColor: theme.palette.designSystem.grey[800],\n };\n return {\n ...backgroundStyle,\n };\n};\n\n/**\n * Gets theme used by all components for the provided mode. For more details, see:\n * - Base colors, typography, sizing - go/chrono-ui-theme\n * - Material UI defaults: https://material-ui.com/customization/default-theme/\n * - Material UI variables: https://material-ui.com/customization/theming/#theme-configuration-variables\n * - Material UI global overrides and default props: https://material-ui.com/customization/globals/#css\n *\n * Need to reinstantiate the theme everytime to support switching between light and dark themes\n * https://github.com/mui-org/material-ui/issues/18831\n */\nexport function getTheme(mode: PaletteMode) {\n const theme = createTheme({\n palette: getPaletteOptions(mode),\n typography,\n mixins: {},\n components,\n });\n return theme;\n}\n\n// Overrides for component default prop values and styles go here\nconst components: ThemeOptions['components'] = {\n MuiFormControl: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiTextField: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiDrawer: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiDialog: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiAlert: {\n styleOverrides: {\n standardError: ({ theme }) => ({\n backgroundColor: theme.palette.designSystem.red[500],\n color: theme.palette.common.white,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.common.white,\n },\n }),\n },\n },\n};\n"],"names":["createTheme","alertClasses","getPaletteOptions","typography","getModalBackgroundStyle","theme","backgroundStyle","palette","mode","backgroundImage","backgroundColor","designSystem","grey","getTheme","mixins","components","MuiFormControl","defaultProps","size","MuiTextField","MuiDrawer","styleOverrides","paper","MuiDialog","MuiAlert","standardError","red","color","common","white","icon"],"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,EAAoCC,YAAY,QAAQ,eAAe,CAAC;AAC5F,SAASC,iBAAiB,QAAQ,2BAA2B,CAAC;AAC9D,SAASC,UAAU,QAAQ,cAAc,CAAC;AAE1C,MAAMC,uBAAuB,GAAG,CAAC,EAAEC,KAAK,CAAA,EAAwC,GAAK;IACnF,MAAMC,eAAe,GACnBD,KAAK,CAACE,OAAO,CAACC,IAAI,KAAK,OAAO,GAC1B,EAAE,GACF;QACEC,eAAe,EAAE,OAAO;QACxBC,eAAe,EAAEL,KAAK,CAACE,OAAO,CAACI,YAAY,CAACC,IAAI,CAAC,GAAG,CAAC;KACtD,AAAC;IACR,OAAO;QACL,GAAGN,eAAe;KACnB,CAAC;AACJ,CAAC,AAAC;AAEF;;;;;;;;;CASC,GACD,OAAO,SAASO,QAAQ,CAACL,IAAiB,EAAE;IAC1C,MAAMH,KAAK,GAAGL,WAAW,CAAC;QACxBO,OAAO,EAAEL,iBAAiB,CAACM,IAAI,CAAC;QAChCL,UAAU;QACVW,MAAM,EAAE,EAAE;QACVC,UAAU;KACX,CAAC,AAAC;IACH,OAAOV,KAAK,CAAC;AACf,CAAC;AAED,iEAAiE;AACjE,MAAMU,UAAU,GAA+B;IAC7CC,cAAc,EAAE;QACdC,YAAY,EAAE;YACZC,IAAI,EAAE,OAAO;SACd;KACF;IACDC,YAAY,EAAE;QACZF,YAAY,EAAE;YACZC,IAAI,EAAE,OAAO;SACd;KACF;IACDE,SAAS,EAAE;QACTC,cAAc,EAAE;YACdC,KAAK,EAAElB,uBAAuB;SAC/B;KACF;IACDmB,SAAS,EAAE;QACTF,cAAc,EAAE;YACdC,KAAK,EAAElB,uBAAuB;SAC/B;KACF;IACDoB,QAAQ,EAAE;QACRH,cAAc,EAAE;YACdI,aAAa,EAAE,CAAC,EAAEpB,KAAK,CAAA,EAAE,GAAM,CAAA;oBAC7BK,eAAe,EAAEL,KAAK,CAACE,OAAO,CAACI,YAAY,CAACe,GAAG,CAAC,GAAG,CAAC;oBACpDC,KAAK,EAAEtB,KAAK,CAACE,OAAO,CAACqB,MAAM,CAACC,KAAK;oBACjC,CAAC,CAAC,GAAG,EAAE5B,YAAY,CAAC6B,IAAI,CAAC,CAAC,CAAC,EAAE;wBAC3BH,KAAK,EAAEtB,KAAK,CAACE,OAAO,CAACqB,MAAM,CAACC,KAAK;qBAClC;iBACF,CAAA,AAAC;SACH;KACF;CACF,AAAC"}
1
+ {"version":3,"sources":["../../src/theme/theme.ts"],"sourcesContent":["// Copyright 2023 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, PaletteMode, ThemeOptions, Theme } from '@mui/material';\nimport { MuiAlert } from './component-overrides/alert';\nimport { getPaletteOptions } from './palette/palette-options';\nimport { typography } from './typography';\n\nconst getModalBackgroundStyle = ({ theme }: { theme: Omit<Theme, 'components'> }) => {\n const backgroundStyle =\n theme.palette.mode === 'light'\n ? {}\n : {\n backgroundImage: 'unset',\n backgroundColor: theme.palette.designSystem.grey[800],\n };\n return {\n ...backgroundStyle,\n };\n};\n\n/**\n * Gets theme used by all components for the provided mode. For more details, see:\n * - Base colors, typography, sizing - go/chrono-ui-theme\n * - Material UI defaults: https://material-ui.com/customization/default-theme/\n * - Material UI variables: https://material-ui.com/customization/theming/#theme-configuration-variables\n * - Material UI global overrides and default props: https://material-ui.com/customization/globals/#css\n *\n * Need to reinstantiate the theme everytime to support switching between light and dark themes\n * https://github.com/mui-org/material-ui/issues/18831\n */\nexport function getTheme(mode: PaletteMode) {\n const theme = createTheme({\n palette: getPaletteOptions(mode),\n typography,\n mixins: {},\n components,\n });\n return theme;\n}\n\n// Overrides for component default prop values and styles go here\nconst components: ThemeOptions['components'] = {\n MuiAlert,\n MuiFormControl: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiTextField: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiDrawer: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiDialog: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiPopover: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n};\n"],"names":["createTheme","MuiAlert","getPaletteOptions","typography","getModalBackgroundStyle","theme","backgroundStyle","palette","mode","backgroundImage","backgroundColor","designSystem","grey","getTheme","mixins","components","MuiFormControl","defaultProps","size","MuiTextField","MuiDrawer","styleOverrides","paper","MuiDialog","MuiPopover"],"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,QAA0C,eAAe,CAAC;AAC9E,SAASC,QAAQ,QAAQ,6BAA6B,CAAC;AACvD,SAASC,iBAAiB,QAAQ,2BAA2B,CAAC;AAC9D,SAASC,UAAU,QAAQ,cAAc,CAAC;AAE1C,MAAMC,uBAAuB,GAAG,CAAC,EAAEC,KAAK,CAAA,EAAwC,GAAK;IACnF,MAAMC,eAAe,GACnBD,KAAK,CAACE,OAAO,CAACC,IAAI,KAAK,OAAO,GAC1B,EAAE,GACF;QACEC,eAAe,EAAE,OAAO;QACxBC,eAAe,EAAEL,KAAK,CAACE,OAAO,CAACI,YAAY,CAACC,IAAI,CAAC,GAAG,CAAC;KACtD,AAAC;IACR,OAAO;QACL,GAAGN,eAAe;KACnB,CAAC;AACJ,CAAC,AAAC;AAEF;;;;;;;;;CASC,GACD,OAAO,SAASO,QAAQ,CAACL,IAAiB,EAAE;IAC1C,MAAMH,KAAK,GAAGL,WAAW,CAAC;QACxBO,OAAO,EAAEL,iBAAiB,CAACM,IAAI,CAAC;QAChCL,UAAU;QACVW,MAAM,EAAE,EAAE;QACVC,UAAU;KACX,CAAC,AAAC;IACH,OAAOV,KAAK,CAAC;AACf,CAAC;AAED,iEAAiE;AACjE,MAAMU,UAAU,GAA+B;IAC7Cd,QAAQ;IACRe,cAAc,EAAE;QACdC,YAAY,EAAE;YACZC,IAAI,EAAE,OAAO;SACd;KACF;IACDC,YAAY,EAAE;QACZF,YAAY,EAAE;YACZC,IAAI,EAAE,OAAO;SACd;KACF;IACDE,SAAS,EAAE;QACTC,cAAc,EAAE;YACdC,KAAK,EAAElB,uBAAuB;SAC/B;KACF;IACDmB,SAAS,EAAE;QACTF,cAAc,EAAE;YACdC,KAAK,EAAElB,uBAAuB;SAC/B;KACF;IACDoB,UAAU,EAAE;QACVH,cAAc,EAAE;YACdC,KAAK,EAAElB,uBAAuB;SAC/B;KACF;CACF,AAAC"}
@@ -1 +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,CAmKrG"}
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,CAsKrG"}
@@ -180,6 +180,14 @@ export function generateChartsTheme(muiTheme, echartsTheme) {
180
180
  padding: {
181
181
  default: parseInt(muiTheme.spacing(1.5), 10)
182
182
  }
183
+ },
184
+ thresholds: {
185
+ defaultColor: muiTheme.palette.success.main,
186
+ palette: [
187
+ '#FFCC00',
188
+ muiTheme.palette.warning.main,
189
+ muiTheme.palette.error.main
190
+ ]
183
191
  }
184
192
  };
185
193
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/theme-gen.ts"],"sourcesContent":["// Copyright 2023 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 container: {\n padding: {\n default: parseInt(muiTheme.spacing(1.5), 10),\n },\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","container","padding","default","parseInt","spacing"],"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;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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;QACDwD,SAAS,EAAE;YACTC,OAAO,EAAE;gBACPC,OAAO,EAAEC,QAAQ,CAACrE,QAAQ,CAACsE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;aAC7C;SACF;KAEF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../src/utils/theme-gen.ts"],"sourcesContent":["// Copyright 2023 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 container: {\n padding: {\n default: parseInt(muiTheme.spacing(1.5), 10),\n },\n },\n thresholds: {\n defaultColor: muiTheme.palette.success.main,\n palette: ['#FFCC00', muiTheme.palette.warning.main, muiTheme.palette.error.main],\n },\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","container","padding","default","parseInt","spacing","thresholds","defaultColor","success","main","warning","error"],"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,MAA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version": "0.25.0",
4
4
  "description": "Common UI components used across Perses features",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -24,7 +24,8 @@
24
24
  "build": "concurrently \"npm:build:*\"",
25
25
  "build:cjs": "swc ./src -d dist/cjs --config-file ../.cjs.swcrc",
26
26
  "build:esm": "swc ./src -d dist --config-file ../.swcrc",
27
- "build:types": "tsc --emitDeclarationOnly --declaration --preserveWatchOutput",
27
+ "build:types": "tsc --project tsconfig.build.json",
28
+ "type-check": "tsc --noEmit",
28
29
  "start": "concurrently -P \"npm:build:* -- {*}\" -- --watch",
29
30
  "test": "TZ=UTC jest",
30
31
  "test:watch": "TZ=UTC jest --watch",
@@ -35,7 +36,7 @@
35
36
  "@codemirror/lang-json": "^6.0.1",
36
37
  "@fontsource/lato": "^4.5.10",
37
38
  "@mui/x-date-pickers": "^5.0.0-beta.1",
38
- "@perses-dev/core": "0.23.1",
39
+ "@perses-dev/core": "0.25.0",
39
40
  "@uiw/react-codemirror": "^4.19.1",
40
41
  "date-fns": "^2.28.0",
41
42
  "date-fns-tz": "^1.3.7",
@@ -43,8 +44,12 @@
43
44
  "lodash-es": "^4.17.21",
44
45
  "mathjs": "^10.6.4",
45
46
  "mdi-material-ui": "^7.4.0",
47
+ "react-colorful": "^5.6.1",
46
48
  "react-error-boundary": "^3.1.4"
47
49
  },
50
+ "devDependencies": {
51
+ "@perses-dev/storybook": "0.25.0"
52
+ },
48
53
  "peerDependencies": {
49
54
  "@mui/material": "^5.10.0",
50
55
  "react": "^17.0.2 || ^18.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"EChart.d.ts","sourceRoot":"","sources":["../src/EChart.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAQ,MAAM,cAAc,CAAC;AAChE,OAAO,EAAO,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AA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,GAAG,yBAAyB,EAAE,CAAC;CACjE;AAED,aAAK,oBAAoB,GAAG,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAEpE,QAAA,MAAM,WAAW,gDAAiD,CAAC;AAEnE,oBAAY,cAAc,GAAG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAExD,aAAK,cAAc,GAAG,UAAU,CAAC;AAIjC,oBAAY,YAAY,CAAC,CAAC,IAAI;KAC3B,cAAc,IAAI,cAAc,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;CACxD,GAAG;KACD,cAAc,IAAI,cAAc,CAAC,CAAC,EAAE,oBAAoB;CAC1D,GAAG;KACD,SAAS,IAAI,cAAc,CAAC,CAAC,EAAE,MAAM,IAAI;CAC3C,CAAC;AAEF,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IACxD,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,MAAM,6IA2EjB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/EChart.tsx"],"sourcesContent":["// Copyright 2023 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 React, { useEffect, useLayoutEffect, useRef } from 'react';\nimport { ECharts, EChartsCoreOption, init } from 'echarts/core';\nimport { Box, SxProps, Theme } from '@mui/material';\nimport { isEqual, debounce } from 'lodash-es';\nimport { EChartsTheme } from './model';\n\n// see docs for info about each property: https://echarts.apache.org/en/api.html#events\nexport interface MouseEventsParameters<T> {\n componentType: string;\n seriesType: string;\n seriesIndex: number;\n seriesName: string;\n name: string;\n dataIndex: number;\n data: Record<string, unknown> & T;\n dataType: string;\n value: number | number[];\n color: string;\n info: Record<string, unknown>;\n}\n\ntype OnEventFunction<T> = (\n params: MouseEventsParameters<T>,\n // This is potentially undefined for testing purposes\n instance?: ECharts\n) => void;\n\nconst mouseEvents = [\n 'click',\n 'dblclick',\n 'mousedown',\n 'mousemove',\n 'mouseup',\n 'mouseover',\n 'mouseout',\n 'globalout',\n 'contextmenu',\n] as const;\n\nexport type MouseEventName = typeof mouseEvents[number];\n\n// batch event types\nexport interface DataZoomPayloadBatchItem {\n dataZoomId: string;\n // start and end not returned unless dataZoom is based on percentProp,\n // which is for cases when a dataZoom component controls multiple axes\n start?: number;\n end?: number;\n // startValue and endValue return data index for 'category' axes,\n // for axis types 'value' and 'time', actual values are returned\n startValue?: number;\n endValue?: number;\n}\n\nexport interface HighlightPayloadBatchItem {\n dataIndex: number;\n dataIndexInside: number;\n seriesIndex: number;\n // highlight action can effect multiple connected charts\n escapeConnect?: boolean;\n // whether blur state was triggered\n notBlur?: boolean;\n}\n\nexport interface BatchEventsParameters {\n type: BatchEventName;\n batch: DataZoomPayloadBatchItem[] & HighlightPayloadBatchItem[];\n}\n\ntype OnBatchEventFunction = (params: BatchEventsParameters) => void;\n\nconst batchEvents = ['datazoom', 'downplay', 'highlight'] as const;\n\nexport type BatchEventName = typeof batchEvents[number];\n\ntype ChartEventName = 'finished';\n\ntype EventName = MouseEventName | ChartEventName | BatchEventName;\n\nexport type OnEventsType<T> = {\n [mouseEventName in MouseEventName]?: OnEventFunction<T>;\n} & {\n [batchEventName in BatchEventName]?: OnBatchEventFunction;\n} & {\n [eventName in ChartEventName]?: () => void;\n};\n\nexport interface EChartsProps<T> {\n option: EChartsCoreOption;\n theme?: string | EChartsTheme;\n renderer?: 'canvas' | 'svg';\n sx?: SxProps<Theme>;\n onEvents?: OnEventsType<T>;\n _instance?: React.MutableRefObject<ECharts | undefined>;\n onChartInitialized?: (instance: ECharts) => void;\n}\n\nexport const EChart = React.memo(function EChart<T>({\n option,\n theme,\n renderer,\n sx,\n onEvents,\n _instance,\n onChartInitialized,\n}: EChartsProps<T>) {\n const initialOption = useRef<EChartsCoreOption>(option);\n const prevOption = useRef<EChartsCoreOption>(option);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const chartElement = useRef<ECharts | null>(null);\n\n // Initialize chart, dispose on unmount\n useLayoutEffect(() => {\n if (containerRef.current === null || chartElement.current !== null) return;\n chartElement.current = init(containerRef.current, theme, { renderer: renderer ?? 'canvas' });\n if (chartElement.current === undefined) return;\n chartElement.current.setOption(initialOption.current, true);\n onChartInitialized?.(chartElement.current);\n if (_instance !== undefined) {\n _instance.current = chartElement.current;\n }\n return () => {\n if (chartElement.current === null) return;\n chartElement.current.dispose();\n chartElement.current = null;\n };\n }, [_instance, onChartInitialized, theme, renderer]);\n\n // Update chart data when option changes\n useEffect(() => {\n if (prevOption.current === undefined || isEqual(prevOption.current, option)) return;\n if (!chartElement.current) return;\n chartElement.current.setOption(option, true);\n prevOption.current = option;\n }, [option]);\n\n // Resize chart, cleanup listener on unmount\n useLayoutEffect(() => {\n const updateSize = debounce(() => {\n if (!chartElement.current) return;\n chartElement.current.resize();\n }, 200);\n window.addEventListener('resize', updateSize);\n updateSize();\n return () => {\n window.removeEventListener('resize', updateSize);\n };\n }, []);\n\n // Bind and unbind chart events passed as prop\n useEffect(() => {\n const chart = chartElement.current;\n if (!chart || onEvents === undefined) return;\n bindEvents(chart, onEvents);\n return () => {\n if (chart === undefined) return;\n if (chart.isDisposed() === true) return;\n for (const event in onEvents) {\n chart.off(event);\n }\n };\n }, [onEvents]);\n\n useEffect(() => {\n const updateSize = debounce(() => {\n if (!chartElement.current) return;\n chartElement.current.resize();\n }, 200);\n updateSize();\n }, [sx]);\n\n return <Box ref={containerRef} sx={sx}></Box>;\n});\n\n// Validate event config and bind custom events\nfunction bindEvents<T>(instance: ECharts, events?: OnEventsType<T>) {\n if (events === undefined) return;\n\n function bindEvent(eventName: EventName, OnEventFunction: unknown) {\n if (typeof OnEventFunction === 'function') {\n if (isMouseEvent(eventName)) {\n instance.on(eventName, (params) => OnEventFunction(params, instance));\n } else if (isBatchEvent(eventName)) {\n instance.on(eventName, (params) => OnEventFunction(params));\n } else {\n instance.on(eventName, () => OnEventFunction(null, instance));\n }\n }\n }\n\n for (const eventName in events) {\n if (Object.prototype.hasOwnProperty.call(events, eventName)) {\n const customEvent = events[eventName as EventName] ?? null;\n if (customEvent) {\n bindEvent(eventName as EventName, customEvent);\n }\n }\n }\n}\n\nfunction isMouseEvent(eventName: EventName): eventName is MouseEventName {\n return (mouseEvents as readonly string[]).includes(eventName);\n}\n\nfunction isBatchEvent(eventName: EventName): eventName is BatchEventName {\n return (batchEvents as readonly string[]).includes(eventName);\n}\n"],"names":["React","useEffect","useLayoutEffect","useRef","init","Box","isEqual","debounce","mouseEvents","batchEvents","EChart","memo","option","theme","renderer","sx","onEvents","_instance","onChartInitialized","initialOption","prevOption","containerRef","chartElement","current","undefined","setOption","dispose","updateSize","resize","window","addEventListener","removeEventListener","chart","bindEvents","isDisposed","event","off","ref","instance","events","bindEvent","eventName","OnEventFunction","isMouseEvent","on","params","isBatchEvent","Object","prototype","hasOwnProperty","call","customEvent","includes"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=InfoTooltip.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InfoTooltip.test.d.ts","sourceRoot":"","sources":["../../src/InfoTooltip/InfoTooltip.test.tsx"],"names":[],"mappings":""}
@@ -1,36 +0,0 @@
1
- // Copyright 2023 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 { jsx as _jsx } from "react/jsx-runtime";
14
- import { render } from '@testing-library/react';
15
- import userEvent from '@testing-library/user-event';
16
- import { screen } from '@testing-library/dom';
17
- import { InfoTooltip } from './InfoTooltip';
18
- describe('InfoTooltip', ()=>{
19
- const title = 'Tooltip Title';
20
- const description = 'this is a tooltip';
21
- it('should render title and description', async ()=>{
22
- render(/*#__PURE__*/ _jsx(InfoTooltip, {
23
- title: title,
24
- description: description,
25
- children: /*#__PURE__*/ _jsx("div", {
26
- children: "tooltipAnchor"
27
- })
28
- }));
29
- const tooltipAnchor = screen.getByText('tooltipAnchor');
30
- userEvent.hover(tooltipAnchor);
31
- await screen.findByText(title);
32
- screen.findByText(description);
33
- });
34
- });
35
-
36
- //# sourceMappingURL=InfoTooltip.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/InfoTooltip/InfoTooltip.test.tsx"],"sourcesContent":["// Copyright 2023 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 { render } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { screen } from '@testing-library/dom';\nimport { InfoTooltip } from './InfoTooltip';\n\ndescribe('InfoTooltip', () => {\n const title = 'Tooltip Title';\n const description = 'this is a tooltip';\n it('should render title and description', async () => {\n render(\n <InfoTooltip title={title} description={description}>\n <div>tooltipAnchor</div>\n </InfoTooltip>\n );\n const tooltipAnchor = screen.getByText('tooltipAnchor');\n userEvent.hover(tooltipAnchor);\n await screen.findByText(title);\n screen.findByText(description);\n });\n});\n"],"names":["render","userEvent","screen","InfoTooltip","describe","title","description","it","div","tooltipAnchor","getByText","hover","findByText"],"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;AAAA,SAASA,MAAM,QAAQ,wBAAwB,CAAC;AAChD,OAAOC,SAAS,MAAM,6BAA6B,CAAC;AACpD,SAASC,MAAM,QAAQ,sBAAsB,CAAC;AAC9C,SAASC,WAAW,QAAQ,eAAe,CAAC;AAE5CC,QAAQ,CAAC,aAAa,EAAE,IAAM;IAC5B,MAAMC,KAAK,GAAG,eAAe,AAAC;IAC9B,MAAMC,WAAW,GAAG,mBAAmB,AAAC;IACxCC,EAAE,CAAC,qCAAqC,EAAE,UAAY;QACpDP,MAAM,eACJ,KAACG,WAAW;YAACE,KAAK,EAAEA,KAAK;YAAEC,WAAW,EAAEA,WAAW;sBACjD,cAAA,KAACE,KAAG;0BAAC,eAAa;cAAM;UACZ,CACf,CAAC;QACF,MAAMC,aAAa,GAAGP,MAAM,CAACQ,SAAS,CAAC,eAAe,CAAC,AAAC;QACxDT,SAAS,CAACU,KAAK,CAACF,aAAa,CAAC,CAAC;QAC/B,MAAMP,MAAM,CAACU,UAAU,CAACP,KAAK,CAAC,CAAC;QAC/BH,MAAM,CAACU,UAAU,CAACN,WAAW,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=LegendOptionsEditor.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LegendOptionsEditor.test.d.ts","sourceRoot":"","sources":["../../src/LegendOptionsEditor/LegendOptionsEditor.test.tsx"],"names":[],"mappings":""}
@@ -1,62 +0,0 @@
1
- // Copyright 2023 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 { jsx as _jsx } from "react/jsx-runtime";
14
- import { render, screen } from '@testing-library/react';
15
- import userEvent from '@testing-library/user-event';
16
- import { LegendOptionsEditor } from './LegendOptionsEditor';
17
- describe('LegendOptionsEditor', ()=>{
18
- const renderLegendOptionsEditor = (value, onChange = jest.fn())=>{
19
- render(/*#__PURE__*/ _jsx("div", {
20
- children: /*#__PURE__*/ _jsx(LegendOptionsEditor, {
21
- value: value,
22
- onChange: onChange
23
- })
24
- }));
25
- };
26
- const getLegendShowSwitch = ()=>{
27
- return screen.getByRole('checkbox', {
28
- name: 'Show'
29
- });
30
- };
31
- const getLegendPositionSelector = ()=>{
32
- return screen.getByRole('combobox', {
33
- name: 'Position'
34
- });
35
- };
36
- it('can change legend visibility by clicking', ()=>{
37
- const onChange = jest.fn();
38
- renderLegendOptionsEditor(undefined, onChange);
39
- expect(getLegendPositionSelector()).toBeDisabled();
40
- userEvent.click(getLegendShowSwitch());
41
- expect(onChange).toHaveBeenCalledWith({
42
- position: 'Bottom'
43
- });
44
- });
45
- it('should allow changing legend position', ()=>{
46
- const onChange = jest.fn();
47
- renderLegendOptionsEditor({
48
- position: 'Bottom'
49
- }, onChange);
50
- expect(getLegendPositionSelector()).toBeEnabled();
51
- userEvent.click(getLegendPositionSelector());
52
- const positionRightOption = screen.getByRole('option', {
53
- name: 'Right'
54
- });
55
- userEvent.click(positionRightOption);
56
- expect(onChange).toHaveBeenCalledWith({
57
- position: 'Right'
58
- });
59
- });
60
- });
61
-
62
- //# sourceMappingURL=LegendOptionsEditor.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/LegendOptionsEditor/LegendOptionsEditor.test.tsx"],"sourcesContent":["// Copyright 2023 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 { render, screen } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { LegendOptions } from '../model';\nimport { LegendOptionsEditor } from './LegendOptionsEditor';\n\ndescribe('LegendOptionsEditor', () => {\n const renderLegendOptionsEditor = (value?: LegendOptions, onChange = jest.fn()) => {\n render(\n <div>\n <LegendOptionsEditor value={value} onChange={onChange} />\n </div>\n );\n };\n\n const getLegendShowSwitch = () => {\n return screen.getByRole('checkbox', { name: 'Show' });\n };\n\n const getLegendPositionSelector = () => {\n return screen.getByRole('combobox', { name: 'Position' });\n };\n\n it('can change legend visibility by clicking', () => {\n const onChange = jest.fn();\n renderLegendOptionsEditor(undefined, onChange);\n expect(getLegendPositionSelector()).toBeDisabled();\n userEvent.click(getLegendShowSwitch());\n expect(onChange).toHaveBeenCalledWith({ position: 'Bottom' });\n });\n\n it('should allow changing legend position', () => {\n const onChange = jest.fn();\n renderLegendOptionsEditor({ position: 'Bottom' }, onChange);\n expect(getLegendPositionSelector()).toBeEnabled();\n userEvent.click(getLegendPositionSelector());\n const positionRightOption = screen.getByRole('option', {\n name: 'Right',\n });\n userEvent.click(positionRightOption);\n expect(onChange).toHaveBeenCalledWith({ position: 'Right' });\n });\n});\n"],"names":["render","screen","userEvent","LegendOptionsEditor","describe","renderLegendOptionsEditor","value","onChange","jest","fn","div","getLegendShowSwitch","getByRole","name","getLegendPositionSelector","it","undefined","expect","toBeDisabled","click","toHaveBeenCalledWith","position","toBeEnabled","positionRightOption"],"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;AAAA,SAASA,MAAM,EAAEC,MAAM,QAAQ,wBAAwB,CAAC;AACxD,OAAOC,SAAS,MAAM,6BAA6B,CAAC;AAEpD,SAASC,mBAAmB,QAAQ,uBAAuB,CAAC;AAE5DC,QAAQ,CAAC,qBAAqB,EAAE,IAAM;IACpC,MAAMC,yBAAyB,GAAG,CAACC,KAAqB,EAAEC,QAAQ,GAAGC,IAAI,CAACC,EAAE,EAAE,GAAK;QACjFT,MAAM,eACJ,KAACU,KAAG;sBACF,cAAA,KAACP,mBAAmB;gBAACG,KAAK,EAAEA,KAAK;gBAAEC,QAAQ,EAAEA,QAAQ;cAAI;UACrD,CACP,CAAC;IACJ,CAAC,AAAC;IAEF,MAAMI,mBAAmB,GAAG,IAAM;QAChC,OAAOV,MAAM,CAACW,SAAS,CAAC,UAAU,EAAE;YAAEC,IAAI,EAAE,MAAM;SAAE,CAAC,CAAC;IACxD,CAAC,AAAC;IAEF,MAAMC,yBAAyB,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,"file":"StatChart.test.d.ts","sourceRoot":"","sources":["../../src/StatChart/StatChart.test.tsx"],"names":[],"mappings":""}
@@ -1,94 +0,0 @@
1
- // Copyright 2023 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 { jsx as _jsx } from "react/jsx-runtime";
14
- import { render, screen } from '@testing-library/react';
15
- import { ChartsThemeProvider } from '../context/ChartsThemeProvider';
16
- import { testChartsTheme } from '../test-utils';
17
- import { StatChart } from './StatChart';
18
- describe('StatChart', ()=>{
19
- const renderChart = (unit)=>{
20
- const contentDimensions = {
21
- width: 200,
22
- height: 200
23
- };
24
- render(/*#__PURE__*/ _jsx(ChartsThemeProvider, {
25
- chartsTheme: testChartsTheme,
26
- children: /*#__PURE__*/ _jsx(StatChart, {
27
- width: contentDimensions.width,
28
- height: contentDimensions.height,
29
- data: mockStatData,
30
- unit: unit
31
- })
32
- }));
33
- };
34
- const mockStatData = {
35
- calculatedValue: 7.72931659687181,
36
- name: 'Example Stat Chart',
37
- seriesData: {
38
- name: '(((count(count(node_cpu_seconds_total{job="example"}) by (cpu))',
39
- values: [
40
- [
41
- 1654006170000,
42
- 7.736401673473903
43
- ],
44
- [
45
- 1654006185000,
46
- 7.733891213538757
47
- ],
48
- [
49
- 1654006200000,
50
- 7.731101813010433
51
- ],
52
- [
53
- 1654006215000,
54
- 7.722454672079215
55
- ],
56
- [
57
- 1654006230000,
58
- 7.722733612256738
59
- ]
60
- ]
61
- }
62
- };
63
- it('render default options (no sparkline)', ()=>{
64
- const unit = {
65
- kind: 'Decimal',
66
- decimal_places: 2
67
- };
68
- renderChart(unit);
69
- expect(screen.getByText('7.73')).toBeInTheDocument();
70
- });
71
- it('show value with bytes unit formatting', ()=>{
72
- const unit = {
73
- kind: 'Bytes'
74
- };
75
- renderChart(unit);
76
- expect(screen.getByText('7.73 bytes')).toBeInTheDocument();
77
- });
78
- it('show value with seconds time unit formatting', ()=>{
79
- const unit = {
80
- kind: 'Seconds'
81
- };
82
- renderChart(unit);
83
- expect(screen.getByText('7.73 seconds')).toBeInTheDocument();
84
- });
85
- it('show value with months time unit formatting', ()=>{
86
- const unit = {
87
- kind: 'Months'
88
- };
89
- renderChart(unit);
90
- expect(screen.getByText('7.73 months')).toBeInTheDocument();
91
- });
92
- });
93
-
94
- //# sourceMappingURL=StatChart.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/StatChart/StatChart.test.tsx"],"sourcesContent":["// Copyright 2023 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 { render, screen } from '@testing-library/react';\nimport { ChartsThemeProvider } from '../context/ChartsThemeProvider';\nimport { UnitOptions } from '../model';\nimport { testChartsTheme } from '../test-utils';\nimport { StatChart, StatChartData } from './StatChart';\n\ndescribe('StatChart', () => {\n const renderChart = (unit: UnitOptions) => {\n const contentDimensions = {\n width: 200,\n height: 200,\n };\n render(\n <ChartsThemeProvider chartsTheme={testChartsTheme}>\n <StatChart width={contentDimensions.width} height={contentDimensions.height} data={mockStatData} unit={unit} />\n </ChartsThemeProvider>\n );\n };\n\n const mockStatData: StatChartData = {\n calculatedValue: 7.72931659687181,\n name: 'Example Stat Chart',\n seriesData: {\n name: '(((count(count(node_cpu_seconds_total{job=\"example\"}) by (cpu))',\n values: [\n [1654006170000, 7.736401673473903],\n [1654006185000, 7.733891213538757],\n [1654006200000, 7.731101813010433],\n [1654006215000, 7.722454672079215],\n [1654006230000, 7.722733612256738],\n ],\n },\n };\n\n it('render default options (no sparkline)', () => {\n const unit: UnitOptions = {\n kind: 'Decimal',\n decimal_places: 2,\n };\n renderChart(unit);\n expect(screen.getByText('7.73')).toBeInTheDocument();\n });\n\n it('show value with bytes unit formatting', () => {\n const unit: UnitOptions = {\n kind: 'Bytes',\n };\n renderChart(unit);\n expect(screen.getByText('7.73 bytes')).toBeInTheDocument();\n });\n\n it('show value with seconds time unit formatting', () => {\n const unit: UnitOptions = {\n kind: 'Seconds',\n };\n renderChart(unit);\n expect(screen.getByText('7.73 seconds')).toBeInTheDocument();\n });\n\n it('show value with months time unit formatting', () => {\n const unit: UnitOptions = {\n kind: 'Months',\n };\n renderChart(unit);\n expect(screen.getByText('7.73 months')).toBeInTheDocument();\n });\n});\n"],"names":["render","screen","ChartsThemeProvider","testChartsTheme","StatChart","describe","renderChart","unit","contentDimensions","width","height","chartsTheme","data","mockStatData","calculatedValue","name","seriesData","values","it","kind","decimal_places","expect","getByText","toBeInTheDocument"],"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;AAAA,SAASA,MAAM,EAAEC,MAAM,QAAQ,wBAAwB,CAAC;AACxD,SAASC,mBAAmB,QAAQ,gCAAgC,CAAC;AAErE,SAASC,eAAe,QAAQ,eAAe,CAAC;AAChD,SAASC,SAAS,QAAuB,aAAa,CAAC;AAEvDC,QAAQ,CAAC,WAAW,EAAE,IAAM;IAC1B,MAAMC,WAAW,GAAG,CAACC,IAAiB,GAAK;QACzC,MAAMC,iBAAiB,GAAG;YACxBC,KAAK,EAAE,GAAG;YACV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C,EAAE,IAAM;QACvD,MAAMX,IAAI,GAAgB;YACxBY,IAAI,EAAE,SAAS;SAChB,AAAC;QACFb,WAAW,CAACC,IAAI,CAAC,CAAC;QAClBc,MAAM,CAACpB,MAAM,CAACqB,SAAS,CAAC,cAAc,CAAC,CAAC,CAACC,iBAAiB,EAAE,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEHL,EAAE,CAAC,6CAA6C,EAAE,IAAM;QACtD,MAAMX,IAAI,GAAgB;YACxBY,IAAI,EAAE,QAAQ;SACf,AAAC;QACFb,WAAW,CAACC,IAAI,CAAC,CAAC;QAClBc,MAAM,CAACpB,MAAM,CAACqB,SAAS,CAAC,aAAa,CAAC,CAAC,CAACC,iBAAiB,EAAE,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=SeriesInfo.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SeriesInfo.test.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesInfo.test.tsx"],"names":[],"mappings":""}