@perses-dev/components 0.0.0-snapshot-test-internal-dep-dd238ac → 0.0.0-snapshot-color-palette-gen-test-bc1b508

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 (96) hide show
  1. package/dist/Dialog/Dialog.d.ts +2 -1
  2. package/dist/Dialog/Dialog.d.ts.map +1 -1
  3. package/dist/Dialog/Dialog.js +12 -1
  4. package/dist/Dialog/Dialog.js.map +1 -1
  5. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
  6. package/dist/InfoTooltip/InfoTooltip.js +10 -3
  7. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  8. package/dist/Legend/CompactLegend.d.ts +3 -1
  9. package/dist/Legend/CompactLegend.d.ts.map +1 -1
  10. package/dist/Legend/CompactLegend.js +3 -1
  11. package/dist/Legend/CompactLegend.js.map +1 -1
  12. package/dist/Legend/Legend.d.ts +11 -3
  13. package/dist/Legend/Legend.d.ts.map +1 -1
  14. package/dist/Legend/Legend.js +24 -7
  15. package/dist/Legend/Legend.js.map +1 -1
  16. package/dist/Legend/ListLegend.d.ts +14 -4
  17. package/dist/Legend/ListLegend.d.ts.map +1 -1
  18. package/dist/Legend/ListLegend.js +111 -15
  19. package/dist/Legend/ListLegend.js.map +1 -1
  20. package/dist/Legend/ListLegendItem.d.ts +14 -2
  21. package/dist/Legend/ListLegendItem.d.ts.map +1 -1
  22. package/dist/Legend/ListLegendItem.js +31 -3
  23. package/dist/Legend/ListLegendItem.js.map +1 -1
  24. package/dist/LineChart/LineChart.d.ts +8 -2
  25. package/dist/LineChart/LineChart.d.ts.map +1 -1
  26. package/dist/LineChart/LineChart.js +11 -4
  27. package/dist/LineChart/LineChart.js.map +1 -1
  28. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +4 -2
  29. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
  30. package/dist/OptionsEditorLayout/OptionsEditorControl.js +34 -5
  31. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  32. package/dist/StatChart/StatChart.d.ts +1 -0
  33. package/dist/StatChart/StatChart.d.ts.map +1 -1
  34. package/dist/StatChart/StatChart.js +2 -2
  35. package/dist/StatChart/StatChart.js.map +1 -1
  36. package/dist/ThresholdsEditor/ThresholdInput.d.ts +3 -1
  37. package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -1
  38. package/dist/ThresholdsEditor/ThresholdInput.js +9 -3
  39. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  40. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
  41. package/dist/ThresholdsEditor/ThresholdsEditor.js +57 -35
  42. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  43. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
  44. package/dist/TimeSeriesTooltip/SeriesInfo.js +4 -4
  45. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  46. package/dist/TimeSeriesTooltip/tooltip-model.d.ts +1 -9
  47. package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
  48. package/dist/TimeSeriesTooltip/tooltip-model.js +3 -7
  49. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  50. package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
  51. package/dist/TimeSeriesTooltip/utils.js +9 -6
  52. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  53. package/dist/cjs/Dialog/Dialog.js +11 -0
  54. package/dist/cjs/InfoTooltip/InfoTooltip.js +10 -3
  55. package/dist/cjs/Legend/Legend.js +24 -7
  56. package/dist/cjs/Legend/ListLegend.js +106 -13
  57. package/dist/cjs/Legend/ListLegendItem.js +30 -2
  58. package/dist/cjs/LineChart/LineChart.js +11 -4
  59. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +33 -4
  60. package/dist/cjs/StatChart/StatChart.js +2 -2
  61. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +8 -2
  62. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +56 -34
  63. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +4 -4
  64. package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +3 -7
  65. package/dist/cjs/TimeSeriesTooltip/utils.js +9 -6
  66. package/dist/cjs/model/units/bytes.js +33 -39
  67. package/dist/cjs/model/units/decimal.js +15 -26
  68. package/dist/cjs/model/units/time.js +2 -3
  69. package/dist/cjs/theme/component-overrides/alert.js +102 -0
  70. package/dist/cjs/theme/theme.js +2 -11
  71. package/dist/cjs/utils/theme-gen.js +13 -5
  72. package/dist/model/legend.d.ts +1 -1
  73. package/dist/model/legend.d.ts.map +1 -1
  74. package/dist/model/legend.js.map +1 -1
  75. package/dist/model/units/bytes.d.ts +1 -5
  76. package/dist/model/units/bytes.d.ts.map +1 -1
  77. package/dist/model/units/bytes.js +28 -42
  78. package/dist/model/units/bytes.js.map +1 -1
  79. package/dist/model/units/decimal.d.ts +1 -12
  80. package/dist/model/units/decimal.d.ts.map +1 -1
  81. package/dist/model/units/decimal.js +14 -30
  82. package/dist/model/units/decimal.js.map +1 -1
  83. package/dist/model/units/time.d.ts.map +1 -1
  84. package/dist/model/units/time.js +2 -3
  85. package/dist/model/units/time.js.map +1 -1
  86. package/dist/theme/component-overrides/alert.d.ts +3 -0
  87. package/dist/theme/component-overrides/alert.d.ts.map +1 -0
  88. package/dist/theme/component-overrides/alert.js +96 -0
  89. package/dist/theme/component-overrides/alert.js.map +1 -0
  90. package/dist/theme/theme.d.ts.map +1 -1
  91. package/dist/theme/theme.js +3 -12
  92. package/dist/theme/theme.js.map +1 -1
  93. package/dist/utils/theme-gen.d.ts.map +1 -1
  94. package/dist/utils/theme-gen.js +13 -5
  95. package/dist/utils/theme-gen.js.map +1 -1
  96. package/package.json +11 -5
@@ -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;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KAAK,EAAER,KAAK,CAACC,OAAO,CAACc,OAAO,CAACJ,IAAI;iBAClC;aACF,CAAC;QACR,CAAC;QACDK,eAAe,EAAE,CAAC,EAAEhB,KAAK,CAAA,EAAE,GAAK;YAC9B,OAAOA,KAAK,CAACC,OAAO,CAACC,IAAI,KAAK,MAAM,GAChC;gBACE,GAAGF,KAAK,CAACG,UAAU,CAACC,KAAK;gBACzBC,eAAe,EAAEL,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACV,IAAI;gBAC3CC,KAAK,EAAER,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACR,KAAK;gBAClC,CAAC,CAAC,GAAG,EAAEjB,YAAY,CAACkB,IAAI,CAAC,CAAC,CAAC,EAAE;oBAC3BF,KAAK,EAAER,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACN,IAAI;iBAClC;aACF,GACD;gBACE,GAAGX,KAAK,CAACG,UAAU,CAACC,KAAK;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'
@@ -66,17 +68,6 @@ const components = {
66
68
  styleOverrides: {
67
69
  paper: getModalBackgroundStyle
68
70
  }
69
- },
70
- MuiAlert: {
71
- styleOverrides: {
72
- standardError: ({ theme })=>({
73
- backgroundColor: theme.palette.designSystem.red[500],
74
- color: theme.palette.common.white,
75
- [`& .${alertClasses.icon}`]: {
76
- color: theme.palette.common.white
77
- }
78
- })
79
- }
80
71
  }
81
72
  };
82
73
 
@@ -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 MuiPopover: {\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","MuiPopover","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,UAAU,EAAE;QACVH,cAAc,EAAE;YACdC,KAAK,EAAElB,uBAAuB;SAC/B;KACF;IACDqB,QAAQ,EAAE;QACRJ,cAAc,EAAE;YACdK,aAAa,EAAE,CAAC,EAAErB,KAAK,CAAA,EAAE,GAAM,CAAA;oBAC7BK,eAAe,EAAEL,KAAK,CAACE,OAAO,CAACI,YAAY,CAACgB,GAAG,CAAC,GAAG,CAAC;oBACpDC,KAAK,EAAEvB,KAAK,CAACE,OAAO,CAACsB,MAAM,CAACC,KAAK;oBACjC,CAAC,CAAC,GAAG,EAAE7B,YAAY,CAAC8B,IAAI,CAAC,CAAC,CAAC,EAAE;wBAC3BH,KAAK,EAAEvB,KAAK,CAACE,OAAO,CAACsB,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,CAsKrG"}
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,CAoLrG"}
@@ -32,12 +32,20 @@ export function generateChartsTheme(muiTheme, echartsTheme) {
32
32
  left: 20,
33
33
  containLabel: true
34
34
  },
35
+ // Accessible categorical palette from: https://colorbrewer2.org/#type=qualitative&scheme=Paired&n=12
35
36
  color: [
36
- '#8dd3c7',
37
- '#bebada',
38
- '#fb8072',
39
- '#80b1d3',
40
- '#fdb462'
37
+ '#a6cee3',
38
+ '#1f78b4',
39
+ '#b2df8a',
40
+ '#33a02c',
41
+ '#fb9a99',
42
+ '#e31a1c',
43
+ '#fdbf6f',
44
+ '#ff7f00',
45
+ '#cab2d6',
46
+ '#6a3d9a',
47
+ '#ffff99',
48
+ '#b15928'
41
49
  ],
42
50
  categoryAxis: {
43
51
  show: true,
@@ -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 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;AAC7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;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;QACDC,UAAU,EAAE;YACVC,YAAY,EAAExE,QAAQ,CAACG,OAAO,CAACsE,OAAO,CAACC,IAAI;YAC3CvE,OAAO,EAAE;gBAAC,SAAS;gBAAEH,QAAQ,CAACG,OAAO,CAACwE,OAAO,CAACD,IAAI;gBAAE1E,QAAQ,CAACG,OAAO,CAACyE,KAAK,CAACF,IAAI;aAAC;SACjF;KACF,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 // Accessible categorical palette from: https://colorbrewer2.org/#type=qualitative&scheme=Paired&n=12\n color: [\n '#a6cee3',\n '#1f78b4',\n '#b2df8a',\n '#33a02c',\n '#fb9a99',\n '#e31a1c',\n '#fdbf6f',\n '#ff7f00',\n '#cab2d6',\n '#6a3d9a',\n '#ffff99',\n '#b15928',\n ],\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,EA8F3BA,IAAiB,QACTA,IAAiB;QA/FnBA,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;QACD,qGAAqG;QACrGT,KAAK,EAAE;YACL,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,S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ACG,OAAO,CAACwE,OAAO,CAACD,IAAI;gBAAE1E,QAAQ,CAACG,OAAO,CAACyE,KAAK,CAACF,IAAI;aAAC;SACjF;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/components",
3
- "version": "0.0.0-snapshot-test-internal-dep-dd238ac",
3
+ "version": "0.0.0-snapshot-color-palette-gen-test-bc1b508",
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",
@@ -36,7 +36,7 @@
36
36
  "@codemirror/lang-json": "^6.0.1",
37
37
  "@fontsource/lato": "^4.5.10",
38
38
  "@mui/x-date-pickers": "^5.0.0-beta.1",
39
- "@perses-dev/core": "0.0.0-snapshot-test-internal-dep-dd238ac",
39
+ "@perses-dev/core": "0.0.0-snapshot-color-palette-gen-test-bc1b508",
40
40
  "@uiw/react-codemirror": "^4.19.1",
41
41
  "date-fns": "^2.28.0",
42
42
  "date-fns-tz": "^1.3.7",
@@ -44,11 +44,14 @@
44
44
  "lodash-es": "^4.17.21",
45
45
  "mathjs": "^10.6.4",
46
46
  "mdi-material-ui": "^7.4.0",
47
+ "numbro": "^2.3.6",
47
48
  "react-colorful": "^5.6.1",
48
- "react-error-boundary": "^3.1.4"
49
+ "react-error-boundary": "^3.1.4",
50
+ "react-window": "^1.8.8"
49
51
  },
50
52
  "devDependencies": {
51
- "@perses-dev/storybook": "0.0.0-snapshot-test-internal-dep-dd238ac"
53
+ "@perses-dev/storybook": "0.0.0-snapshot-color-palette-gen-test-bc1b508",
54
+ "@types/react-window": "^1.8.5"
52
55
  },
53
56
  "peerDependencies": {
54
57
  "@mui/material": "^5.10.0",
@@ -57,5 +60,8 @@
57
60
  },
58
61
  "files": [
59
62
  "dist"
60
- ]
63
+ ],
64
+ "typedoc": {
65
+ "entryPoint": "./src/index.ts"
66
+ }
61
67
  }