@perses-dev/components 0.41.1 → 0.42.1
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.
- package/dist/JSONEditor.d.ts +2 -1
- package/dist/JSONEditor.d.ts.map +1 -1
- package/dist/JSONEditor.js +9 -8
- package/dist/JSONEditor.js.map +1 -1
- package/dist/cjs/JSONEditor.js +9 -8
- package/dist/cjs/test-utils/theme.js +3 -1
- package/dist/cjs/utils/theme-gen.js +4 -8
- package/dist/test-utils/theme.d.ts.map +1 -1
- package/dist/test-utils/theme.js +3 -1
- package/dist/test-utils/theme.js.map +1 -1
- package/dist/utils/theme-gen.d.ts +2 -7
- package/dist/utils/theme-gen.d.ts.map +1 -1
- package/dist/utils/theme-gen.js +4 -8
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +3 -3
package/dist/JSONEditor.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { ReactCodeMirrorProps } from '@uiw/react-codemirror/src';
|
|
3
3
|
declare type JSONEditorProps<T> = Omit<ReactCodeMirrorProps, 'onBlur' | 'theme' | 'extensions' | 'onChange' | 'value'> & {
|
|
4
4
|
value: T;
|
|
5
|
-
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
onChange?: (next: string) => void;
|
|
6
7
|
};
|
|
7
8
|
export declare function JSONEditor<T>(props: JSONEditorProps<T>): JSX.Element;
|
|
8
9
|
export {};
|
package/dist/JSONEditor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JSONEditor.d.ts","sourceRoot":"","sources":["../src/JSONEditor.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,aAAK,eAAe,CAAC,CAAC,IAAI,IAAI,CAAC,oBAAoB,EAAE,QAAQ,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,CAAC,GAAG;IAC/G,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"JSONEditor.d.ts","sourceRoot":"","sources":["../src/JSONEditor.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,aAAK,eAAe,CAAC,CAAC,IAAI,IAAI,CAAC,oBAAoB,EAAE,QAAQ,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,CAAC,GAAG;IAC/G,KAAK,EAAE,CAAC,CAAC;IACT,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,eAiCtD"}
|
package/dist/JSONEditor.js
CHANGED
|
@@ -20,6 +20,7 @@ export function JSONEditor(props) {
|
|
|
20
20
|
const theme = useTheme();
|
|
21
21
|
const isDarkMode = theme.palette.mode === 'dark';
|
|
22
22
|
const [value, setValue] = useState(()=>JSON.stringify(props.value, null, 2));
|
|
23
|
+
const [lastProcessedValue, setLastProcessedValue] = useState(value);
|
|
23
24
|
useEffect(()=>{
|
|
24
25
|
setValue(JSON.stringify(props.value, null, 2));
|
|
25
26
|
}, [
|
|
@@ -41,15 +42,15 @@ export function JSONEditor(props) {
|
|
|
41
42
|
setValue(newValue);
|
|
42
43
|
},
|
|
43
44
|
onBlur: ()=>{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// ignore this error
|
|
45
|
+
// Don't trigger the provided onChange if the last processed value is equal to the current value.
|
|
46
|
+
// This prevents e.g CTRL+F to trigger value refresh downstream, which would cause the embedded
|
|
47
|
+
// find & replace interface to close immediately.
|
|
48
|
+
if (lastProcessedValue !== value && props.onChange !== undefined) {
|
|
49
|
+
props.onChange(value);
|
|
50
|
+
setLastProcessedValue(value);
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
},
|
|
53
|
+
placeholder: props.placeholder
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
|
package/dist/JSONEditor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/JSONEditor.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 { useEffect, useState } from 'react';\nimport CodeMirror from '@uiw/react-codemirror';\nimport { json, jsonParseLinter } from '@codemirror/lang-json';\nimport { linter, lintGutter } from '@codemirror/lint';\nimport { useTheme } from '@mui/material';\nimport { ReactCodeMirrorProps } from '@uiw/react-codemirror/src';\n\ntype JSONEditorProps<T> = Omit<ReactCodeMirrorProps, 'onBlur' | 'theme' | 'extensions' | 'onChange' | 'value'> & {\n value: T;\n onChange?: (next:
|
|
1
|
+
{"version":3,"sources":["../src/JSONEditor.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 { useEffect, useState } from 'react';\nimport CodeMirror from '@uiw/react-codemirror';\nimport { json, jsonParseLinter } from '@codemirror/lang-json';\nimport { linter, lintGutter } from '@codemirror/lint';\nimport { useTheme } from '@mui/material';\nimport { ReactCodeMirrorProps } from '@uiw/react-codemirror/src';\n\ntype JSONEditorProps<T> = Omit<ReactCodeMirrorProps, 'onBlur' | 'theme' | 'extensions' | 'onChange' | 'value'> & {\n value: T;\n placeholder?: string;\n onChange?: (next: string) => void;\n};\n\nexport function JSONEditor<T>(props: JSONEditorProps<T>) {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n const [value, setValue] = useState(() => JSON.stringify(props.value, null, 2));\n const [lastProcessedValue, setLastProcessedValue] = useState<string>(value);\n\n useEffect(() => {\n setValue(JSON.stringify(props.value, null, 2));\n }, [props.value]);\n\n return (\n <CodeMirror\n {...props}\n style={{ border: `1px solid ${theme.palette.divider}` }}\n theme={isDarkMode ? 'dark' : 'light'}\n extensions={[json(), linter(jsonParseLinter()), lintGutter()]}\n value={value}\n onChange={(newValue) => {\n setValue(newValue);\n }}\n onBlur={() => {\n // Don't trigger the provided onChange if the last processed value is equal to the current value.\n // This prevents e.g CTRL+F to trigger value refresh downstream, which would cause the embedded\n // find & replace interface to close immediately.\n if (lastProcessedValue !== value && props.onChange !== undefined) {\n props.onChange(value);\n setLastProcessedValue(value);\n }\n }}\n placeholder={props.placeholder}\n />\n );\n}\n"],"names":["useEffect","useState","CodeMirror","json","jsonParseLinter","linter","lintGutter","useTheme","JSONEditor","props","theme","isDarkMode","palette","mode","value","setValue","JSON","stringify","lastProcessedValue","setLastProcessedValue","style","border","divider","extensions","onChange","newValue","onBlur","undefined","placeholder"],"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,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAC5C,OAAOC,gBAAgB,wBAAwB;AAC/C,SAASC,IAAI,EAAEC,eAAe,QAAQ,wBAAwB;AAC9D,SAASC,MAAM,EAAEC,UAAU,QAAQ,mBAAmB;AACtD,SAASC,QAAQ,QAAQ,gBAAgB;AASzC,OAAO,SAASC,WAAcC,KAAyB;IACrD,MAAMC,QAAQH;IACd,MAAMI,aAAaD,MAAME,QAAQC,SAAS;IAE1C,MAAM,CAACC,OAAOC,SAAS,GAAGd,SAAS,IAAMe,KAAKC,UAAUR,MAAMK,OAAO,MAAM;IAC3E,MAAM,CAACI,oBAAoBC,sBAAsB,GAAGlB,SAAiBa;IAErEd,UAAU;QACRe,SAASC,KAAKC,UAAUR,MAAMK,OAAO,MAAM;IAC7C,GAAG;QAACL,MAAMK;KAAM;IAEhB,qBACE,KAACZ;QACE,GAAGO,KAAK;QACTW,OAAO;YAAEC,QAAQ,CAAC,UAAU,EAAEX,MAAME,QAAQU,QAAQ,CAAC;QAAC;QACtDZ,OAAOC,aAAa,SAAS;QAC7BY,YAAY;YAACpB;YAAQE,OAAOD;YAAoBE;SAAa;QAC7DQ,OAAOA;QACPU,UAAU,CAACC;YACTV,SAASU;QACX;QACAC,QAAQ;YACN,iGAAiG;YACjG,+FAA+F;YAC/F,iDAAiD;YACjD,IAAIR,uBAAuBJ,SAASL,MAAMe,aAAaG,WAAW;gBAChElB,MAAMe,SAASV;gBACfK,sBAAsBL;YACxB;QACF;QACAc,aAAanB,MAAMmB;;AAGzB"}
|
package/dist/cjs/JSONEditor.js
CHANGED
|
@@ -35,6 +35,7 @@ function JSONEditor(props) {
|
|
|
35
35
|
const theme = (0, _material.useTheme)();
|
|
36
36
|
const isDarkMode = theme.palette.mode === 'dark';
|
|
37
37
|
const [value, setValue] = (0, _react.useState)(()=>JSON.stringify(props.value, null, 2));
|
|
38
|
+
const [lastProcessedValue, setLastProcessedValue] = (0, _react.useState)(value);
|
|
38
39
|
(0, _react.useEffect)(()=>{
|
|
39
40
|
setValue(JSON.stringify(props.value, null, 2));
|
|
40
41
|
}, [
|
|
@@ -56,14 +57,14 @@ function JSONEditor(props) {
|
|
|
56
57
|
setValue(newValue);
|
|
57
58
|
},
|
|
58
59
|
onBlur: ()=>{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// ignore this error
|
|
60
|
+
// Don't trigger the provided onChange if the last processed value is equal to the current value.
|
|
61
|
+
// This prevents e.g CTRL+F to trigger value refresh downstream, which would cause the embedded
|
|
62
|
+
// find & replace interface to close immediately.
|
|
63
|
+
if (lastProcessedValue !== value && props.onChange !== undefined) {
|
|
64
|
+
props.onChange(value);
|
|
65
|
+
setLastProcessedValue(value);
|
|
66
66
|
}
|
|
67
|
-
}
|
|
67
|
+
},
|
|
68
|
+
placeholder: props.placeholder
|
|
68
69
|
});
|
|
69
70
|
}
|
|
@@ -49,7 +49,9 @@ const TEST_ECHARTS_THEME_OVERRIDES = {
|
|
|
49
49
|
barCategoryGap: 2
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
const testChartsTheme = (0, _utils.generateChartsTheme)((0, _material.createTheme)({}),
|
|
52
|
+
const testChartsTheme = (0, _utils.generateChartsTheme)((0, _material.createTheme)({}), {
|
|
53
|
+
echartsTheme: TEST_ECHARTS_THEME_OVERRIDES
|
|
54
|
+
});
|
|
53
55
|
const mockChartsContext = {
|
|
54
56
|
chartsTheme: testChartsTheme,
|
|
55
57
|
enablePinning: false,
|
|
@@ -27,10 +27,7 @@ function _interop_require_default(obj) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
const DEFAULT_TEXT_COLOR = '#222';
|
|
30
|
-
function generateChartsTheme(muiTheme,
|
|
31
|
-
* The id of the container that will have the chart tooltip appended to it.
|
|
32
|
-
* By default, chart tooltip uses the body of the top-level document object.
|
|
33
|
-
*/ tooltipPortalContainerId) {
|
|
30
|
+
function generateChartsTheme(muiTheme, persesChartsThemeOverride) {
|
|
34
31
|
var _muiTheme_palette_text, _muiTheme_palette, _muiTheme_palette_action, _muiTheme_palette1, _muiTheme_palette_action1, _muiTheme_palette_designSystem, _muiTheme_palette_designSystem1;
|
|
35
32
|
var _muiTheme_palette_text_primary;
|
|
36
33
|
const primaryTextColor = (_muiTheme_palette_text_primary = (_muiTheme_palette_text = muiTheme.palette.text) === null || _muiTheme_palette_text === void 0 ? void 0 : _muiTheme_palette_text.primary) !== null && _muiTheme_palette_text_primary !== void 0 ? _muiTheme_palette_text_primary : DEFAULT_TEXT_COLOR;
|
|
@@ -237,9 +234,8 @@ function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
237
234
|
splitNumber: 12
|
|
238
235
|
}
|
|
239
236
|
};
|
|
240
|
-
return {
|
|
241
|
-
|
|
242
|
-
echartsTheme: (0, _merge.default)(muiConvertedTheme, echartsTheme),
|
|
237
|
+
return (0, _merge.default)({
|
|
238
|
+
echartsTheme: muiConvertedTheme,
|
|
243
239
|
noDataOption: {
|
|
244
240
|
title: {
|
|
245
241
|
show: true,
|
|
@@ -276,5 +272,5 @@ function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
276
272
|
muiTheme.palette.error.main
|
|
277
273
|
]
|
|
278
274
|
}
|
|
279
|
-
};
|
|
275
|
+
}, persesChartsThemeOverride);
|
|
280
276
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/test-utils/theme.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAoB/C,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/test-utils/theme.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAoB/C,eAAO,MAAM,eAAe,EAAE,iBAE5B,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,iBAK/B,CAAC"}
|
package/dist/test-utils/theme.js
CHANGED
|
@@ -31,7 +31,9 @@ const TEST_ECHARTS_THEME_OVERRIDES = {
|
|
|
31
31
|
barCategoryGap: 2
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
export const testChartsTheme = generateChartsTheme(createMuiTheme({}),
|
|
34
|
+
export const testChartsTheme = generateChartsTheme(createMuiTheme({}), {
|
|
35
|
+
echartsTheme: TEST_ECHARTS_THEME_OVERRIDES
|
|
36
|
+
});
|
|
35
37
|
export const mockChartsContext = {
|
|
36
38
|
chartsTheme: testChartsTheme,
|
|
37
39
|
enablePinning: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test-utils/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 as createMuiTheme } from '@mui/material';\nimport { PersesChartsTheme, EChartsTheme } from '../model';\nimport { generateChartsTheme } from '../utils';\nimport { SharedChartsState } from '../context';\n\n// app specific echarts option overrides\nconst TEST_ECHARTS_THEME_OVERRIDES: EChartsTheme = {\n textStyle: { fontFamily: 'Lato' },\n categoryAxis: {\n splitLine: {\n show: false,\n },\n },\n timeAxis: {\n splitLine: {\n show: false,\n },\n },\n bar: {\n barCategoryGap: 2,\n },\n};\n\nexport const testChartsTheme: PersesChartsTheme = generateChartsTheme(createMuiTheme({}), TEST_ECHARTS_THEME_OVERRIDES);\n\nexport const mockChartsContext: SharedChartsState = {\n chartsTheme: testChartsTheme,\n enablePinning: false,\n lastTooltipPinnedCoords: null,\n setLastTooltipPinnedCoords: () => null,\n};\n"],"names":["createTheme","createMuiTheme","generateChartsTheme","TEST_ECHARTS_THEME_OVERRIDES","textStyle","fontFamily","categoryAxis","splitLine","show","timeAxis","bar","barCategoryGap","testChartsTheme","mockChartsContext","chartsTheme","enablePinning","lastTooltipPinnedCoords","setLastTooltipPinnedCoords"],"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,eAAeC,cAAc,QAAQ,gBAAgB;AAE9D,SAASC,mBAAmB,QAAQ,WAAW;AAG/C,wCAAwC;AACxC,MAAMC,+BAA6C;IACjDC,WAAW;QAAEC,YAAY;IAAO;IAChCC,cAAc;QACZC,WAAW;YACTC,MAAM;QACR;IACF;IACAC,UAAU;QACRF,WAAW;YACTC,MAAM;QACR;IACF;IACAE,KAAK;QACHC,gBAAgB;IAClB;AACF;AAEA,OAAO,MAAMC,kBAAqCV,oBAAoBD,eAAe,CAAC,
|
|
1
|
+
{"version":3,"sources":["../../src/test-utils/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 as createMuiTheme } from '@mui/material';\nimport { PersesChartsTheme, EChartsTheme } from '../model';\nimport { generateChartsTheme } from '../utils';\nimport { SharedChartsState } from '../context';\n\n// app specific echarts option overrides\nconst TEST_ECHARTS_THEME_OVERRIDES: EChartsTheme = {\n textStyle: { fontFamily: 'Lato' },\n categoryAxis: {\n splitLine: {\n show: false,\n },\n },\n timeAxis: {\n splitLine: {\n show: false,\n },\n },\n bar: {\n barCategoryGap: 2,\n },\n};\n\nexport const testChartsTheme: PersesChartsTheme = generateChartsTheme(createMuiTheme({}), {\n echartsTheme: TEST_ECHARTS_THEME_OVERRIDES,\n});\n\nexport const mockChartsContext: SharedChartsState = {\n chartsTheme: testChartsTheme,\n enablePinning: false,\n lastTooltipPinnedCoords: null,\n setLastTooltipPinnedCoords: () => null,\n};\n"],"names":["createTheme","createMuiTheme","generateChartsTheme","TEST_ECHARTS_THEME_OVERRIDES","textStyle","fontFamily","categoryAxis","splitLine","show","timeAxis","bar","barCategoryGap","testChartsTheme","echartsTheme","mockChartsContext","chartsTheme","enablePinning","lastTooltipPinnedCoords","setLastTooltipPinnedCoords"],"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,eAAeC,cAAc,QAAQ,gBAAgB;AAE9D,SAASC,mBAAmB,QAAQ,WAAW;AAG/C,wCAAwC;AACxC,MAAMC,+BAA6C;IACjDC,WAAW;QAAEC,YAAY;IAAO;IAChCC,cAAc;QACZC,WAAW;YACTC,MAAM;QACR;IACF;IACAC,UAAU;QACRF,WAAW;YACTC,MAAM;QACR;IACF;IACAE,KAAK;QACHC,gBAAgB;IAClB;AACF;AAEA,OAAO,MAAMC,kBAAqCV,oBAAoBD,eAAe,CAAC,IAAI;IACxFY,cAAcV;AAChB,GAAG;AAEH,OAAO,MAAMW,oBAAuC;IAClDC,aAAaH;IACbI,eAAe;IACfC,yBAAyB;IACzBC,4BAA4B,IAAM;AACpC,EAAE"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { Theme } from '@mui/material';
|
|
2
|
-
import {
|
|
2
|
+
import { PersesChartsTheme } from '../model';
|
|
3
3
|
declare type MuiTheme = Omit<Theme, 'components'>;
|
|
4
|
-
export declare function generateChartsTheme(muiTheme: MuiTheme,
|
|
5
|
-
/**
|
|
6
|
-
* The id of the container that will have the chart tooltip appended to it.
|
|
7
|
-
* By default, chart tooltip uses the body of the top-level document object.
|
|
8
|
-
*/
|
|
9
|
-
tooltipPortalContainerId?: string): PersesChartsTheme;
|
|
4
|
+
export declare function generateChartsTheme(muiTheme: MuiTheme, persesChartsThemeOverride: Partial<PersesChartsTheme>): PersesChartsTheme;
|
|
10
5
|
export {};
|
|
11
6
|
//# sourceMappingURL=theme-gen.d.ts.map
|
|
@@ -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,
|
|
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,EAAgB,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAK3D,aAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAE1C,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,EAClB,yBAAyB,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACpD,iBAAiB,CAiPnB"}
|
package/dist/utils/theme-gen.js
CHANGED
|
@@ -12,10 +12,7 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import merge from 'lodash/merge';
|
|
14
14
|
const DEFAULT_TEXT_COLOR = '#222';
|
|
15
|
-
export function generateChartsTheme(muiTheme,
|
|
16
|
-
* The id of the container that will have the chart tooltip appended to it.
|
|
17
|
-
* By default, chart tooltip uses the body of the top-level document object.
|
|
18
|
-
*/ tooltipPortalContainerId) {
|
|
15
|
+
export function generateChartsTheme(muiTheme, persesChartsThemeOverride) {
|
|
19
16
|
var _muiTheme_palette_text, _muiTheme_palette, _muiTheme_palette_action, _muiTheme_palette1, _muiTheme_palette_action1, _muiTheme_palette_designSystem, _muiTheme_palette_designSystem1;
|
|
20
17
|
var _muiTheme_palette_text_primary;
|
|
21
18
|
const primaryTextColor = (_muiTheme_palette_text_primary = (_muiTheme_palette_text = muiTheme.palette.text) === null || _muiTheme_palette_text === void 0 ? void 0 : _muiTheme_palette_text.primary) !== null && _muiTheme_palette_text_primary !== void 0 ? _muiTheme_palette_text_primary : DEFAULT_TEXT_COLOR;
|
|
@@ -222,9 +219,8 @@ export function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
222
219
|
splitNumber: 12
|
|
223
220
|
}
|
|
224
221
|
};
|
|
225
|
-
return {
|
|
226
|
-
|
|
227
|
-
echartsTheme: merge(muiConvertedTheme, echartsTheme),
|
|
222
|
+
return merge({
|
|
223
|
+
echartsTheme: muiConvertedTheme,
|
|
228
224
|
noDataOption: {
|
|
229
225
|
title: {
|
|
230
226
|
show: true,
|
|
@@ -261,7 +257,7 @@ export function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
261
257
|
muiTheme.palette.error.main
|
|
262
258
|
]
|
|
263
259
|
}
|
|
264
|
-
};
|
|
260
|
+
}, persesChartsThemeOverride);
|
|
265
261
|
}
|
|
266
262
|
|
|
267
263
|
//# sourceMappingURL=theme-gen.js.map
|
|
@@ -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/merge';\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(\n muiTheme: MuiTheme,\n echartsTheme: EChartsTheme,\n /**\n * The id of the container that will have the chart tooltip appended to it.\n * By default, chart tooltip uses the body of the top-level document object.\n */\n tooltipPortalContainerId?: string\n): 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://davidmathlogic.com/colorblind\n color: [\n '#56B4E9', // lt blue\n '#009E73', // med green\n '#0072B2', // dk blue\n '#CC79A7', // lt purple\n '#F0E442', // yellow\n '#E69F00', // orange\n '#D55E00', // red\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.4,\n },\n },\n splitArea: {\n show: false,\n areaStyle: {\n color: [muiTheme.palette.grey[300]],\n },\n },\n },\n timeAxis: {\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.4,\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 backgroundColor: muiTheme.palette.designSystem?.grey[800],\n borderColor: muiTheme.palette.designSystem?.grey[800],\n textStyle: {\n color: '#fff',\n fontSize: 11,\n },\n },\n axisPointer: {\n lineStyle: {\n color: muiTheme.palette.grey[500],\n },\n },\n markLine: {\n symbol: 'none',\n symbolSize: 0,\n itemStyle: {\n color: muiTheme.palette.grey[500],\n },\n lineStyle: {\n type: 'dashed',\n width: 1,\n },\n },\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 borderRadius: 0,\n borderColor: muiTheme.palette.grey[300],\n },\n label: {\n show: false,\n color: primaryTextColor,\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 tooltipPortalContainerId,\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","tooltipPortalContainerId","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","timeAxis","valueAxis","legend","orient","pageTextStyle","pageIconColor","action","active","pageIconInactiveColor","disabled","toolbox","iconStyle","borderColor","tooltip","backgroundColor","designSystem","axisPointer","markLine","symbol","symbolSize","itemStyle","type","line","showSymbol","smooth","emphasis","bar","barMaxWidth","borderWidth","borderRadius","label","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,OAAOA,WAAW,eAAe;AAGjC,MAAMC,qBAAqB;AAK3B,OAAO,SAASC,oBACdC,QAAkB,EAClBC,YAA0B,EAC1B;;;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TC,SAAS;gBACPC,SAASC,SAAS9E,SAAS+E,QAAQ,MAAM;YAC3C;QACF;QACAC,YAAY;YACVC,cAAcjF,SAASI,QAAQ8E,QAAQC;YACvC/E,SAAS;gBAAC;gBAAWJ,SAASI,QAAQgF,QAAQD;gBAAMnF,SAASI,QAAQiF,MAAMF;aAAK;QAClF;IACF;AACF"}
|
|
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/merge';\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(\n muiTheme: MuiTheme,\n persesChartsThemeOverride: Partial<PersesChartsTheme>\n): 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://davidmathlogic.com/colorblind\n color: [\n '#56B4E9', // lt blue\n '#009E73', // med green\n '#0072B2', // dk blue\n '#CC79A7', // lt purple\n '#F0E442', // yellow\n '#E69F00', // orange\n '#D55E00', // red\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.4,\n },\n },\n splitArea: {\n show: false,\n areaStyle: {\n color: [muiTheme.palette.grey[300]],\n },\n },\n },\n timeAxis: {\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.4,\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 backgroundColor: muiTheme.palette.designSystem?.grey[800],\n borderColor: muiTheme.palette.designSystem?.grey[800],\n textStyle: {\n color: '#fff',\n fontSize: 11,\n },\n },\n axisPointer: {\n lineStyle: {\n color: muiTheme.palette.grey[500],\n },\n },\n markLine: {\n symbol: 'none',\n symbolSize: 0,\n itemStyle: {\n color: muiTheme.palette.grey[500],\n },\n lineStyle: {\n type: 'dashed',\n width: 1,\n },\n },\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 borderRadius: 0,\n borderColor: muiTheme.palette.grey[300],\n },\n label: {\n show: false,\n color: primaryTextColor,\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 merge(\n {\n echartsTheme: muiConvertedTheme,\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 persesChartsThemeOverride\n );\n}\n"],"names":["merge","DEFAULT_TEXT_COLOR","generateChartsTheme","muiTheme","persesChartsThemeOverride","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","timeAxis","valueAxis","legend","orient","pageTextStyle","pageIconColor","action","active","pageIconInactiveColor","disabled","toolbox","iconStyle","borderColor","tooltip","backgroundColor","designSystem","axisPointer","markLine","symbol","symbolSize","itemStyle","type","line","showSymbol","smooth","emphasis","bar","barMaxWidth","borderWidth","borderRadius","label","gauge","detail","fontWeight","valueAnimation","distance","splitNumber","echartsTheme","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,OAAOA,WAAW,eAAe;AAGjC,MAAMC,qBAAqB;AAK3B,OAAO,SAASC,oBACdC,QAAkB,EAClBC,yBAAqD;QAE5BD,wBA4HNA,6CACQA,+CAWNA,gCACJA;QAzIQA;IAAzB,MAAME,mBAAmBF,CAAAA,iCAAAA,CAAAA,yBAAAA,SAASG,QAAQC,kBAAjBJ,oCAAAA,KAAAA,IAAAA,uBAAuBK,qBAAvBL,4CAAAA,iCAAkCF;IAE3D,MAAMQ,oBAAkC;QACtCC,OAAO;YACLC,MAAM;QACR;QACAC,WAAW;YACTC,OAAOR;YACPS,YAAYX,SAASY,WAAWD;YAChCE,UAAU;QACZ;QACAC,MAAM;YACJC,KAAK;YACLC,OAAO;YACPC,QAAQ;YACRC,MAAM;YACNC,cAAc;QAChB;QACA,6EAA6E;QAC7ET,OAAO;YACL;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDU,cAAc;YACZZ,MAAM;YACNa,WAAW;gBACTb,MAAM;gBACNE,OAAOR;gBACPoB,QAAQ;YACV;YACAC,UAAU;gBACRf,MAAM;gBACNgB,QAAQ;gBACRC,WAAW;oBACTf,OAAOV,SAASG,QAAQuB,IAAI,CAAC,IAAI;gBACnC;YACF;YACAC,UAAU;gBACRnB,MAAM;gBACNiB,WAAW;oBACTf,OAAOV,SAASG,QAAQuB,IAAI,CAAC,IAAI;gBACnC;YACF;YACAE,WAAW;gBACTpB,MAAM;gBACNiB,WAAW;oBACTI,OAAO;oBACPnB,OAAOV,SAASG,QAAQuB,IAAI,CAAC,IAAI;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YACAwC,aAAa;QACf;IACF;IAEA,OAAOxE,MACL;QACEyE,cAAchE;QACdiE,cAAc;YACZhE,OAAO;gBACLC,MAAM;gBACNC,WAAW;oBACTC,OAAOR;oBACPW,UAAU;oBACVqD,YAAY;gBACd;gBACA9D,MAAM;gBACNc,MAAM;gBACNH,KAAK;YACP;YACAyD,OAAO;gBACLhE,MAAM;YACR;YACAiE,OAAO;gBACLjE,MAAM;YACR;QACF;QACAkE,WAAW;YACT7C,OAAO;YACPnB,OAAO;QACT;QACAiE,WAAW;YACTC,SAAS;gBACPC,SAASC,SAAS9E,SAAS+E,QAAQ,MAAM;YAC3C;QACF;QACAC,YAAY;YACVC,cAAcjF,SAASG,QAAQ+E,QAAQC;YACvChF,SAAS;gBAAC;gBAAWH,SAASG,QAAQiF,QAAQD;gBAAMnF,SAASG,QAAQkF,MAAMF;aAAK;QAClF;IACF,GACAlF;AAEJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.1",
|
|
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": "^6.12.1",
|
|
39
|
-
"@perses-dev/core": "0.
|
|
39
|
+
"@perses-dev/core": "0.42.1",
|
|
40
40
|
"@tanstack/react-table": "^8.9.1",
|
|
41
41
|
"@uiw/react-codemirror": "^4.19.1",
|
|
42
42
|
"date-fns": "^2.28.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-virtuoso": "^4.3.6"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@perses-dev/storybook": "0.
|
|
54
|
+
"@perses-dev/storybook": "0.42.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@mui/material": "^5.10.0",
|