@hitachivantara/uikit-react-viz 5.6.45 → 5.6.47

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.
@@ -33,17 +33,12 @@ echarts__namespace.use([renderers.CanvasRenderer, components.AriaComponent]);
33
33
  const HvBaseChart = react.forwardRef(
34
34
  (props, ref) => {
35
35
  const { option, width, height } = props;
36
- const { theme } = useVizTheme.useVizTheme();
36
+ const { theme, activeTheme } = useVizTheme.useVizTheme();
37
37
  const currentTheme = react.useRef(theme);
38
38
  const chartRef = react.useRef(null);
39
- const isMounted = react.useRef(false);
40
39
  const forkedRef = utils.useForkRef(ref, chartRef);
41
40
  const [initialOption, setInitialOption] = react.useState(option);
42
41
  react.useEffect(() => {
43
- if (!isMounted.current) {
44
- isMounted.current = true;
45
- return;
46
- }
47
42
  if (theme !== currentTheme.current) {
48
43
  setInitialOption(option);
49
44
  currentTheme.current = theme;
@@ -55,7 +50,10 @@ const HvBaseChart = react.forwardRef(
55
50
  instance.setOption(option, {
56
51
  replaceMerge: ["xAxis", "yAxis", "series", "dataset"]
57
52
  });
58
- }, [theme, option]);
53
+ return () => {
54
+ instance.dispose();
55
+ };
56
+ }, [theme, option, activeTheme]);
59
57
  return /* @__PURE__ */ jsxRuntime.jsx(
60
58
  ReactECharts__default.default,
61
59
  {
@@ -1 +1 @@
1
- {"version":3,"file":"BaseChart.cjs","sources":["../../../src/BaseChart/BaseChart.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState } from \"react\";\n\nimport { useForkRef } from \"@mui/material/utils\";\n\nimport { AriaComponent } from \"echarts/components\";\nimport { CanvasRenderer } from \"echarts/renderers\";\nimport * as echarts from \"echarts/core\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\n\nimport { useVizTheme } from \"../hooks\";\nimport { HvEChartsOption } from \"../types/common\";\n\n// Register chart components\necharts.use([CanvasRenderer, AriaComponent]);\n\nexport interface HvBaseChartProps {\n /** ECharts option. */\n option: HvEChartsOption;\n /** Charts width. */\n width?: echarts.ResizeOpts[\"width\"];\n /** Charts height. */\n height?: echarts.ResizeOpts[\"height\"];\n}\n\n/**\n * Base chart.\n */\nexport const HvBaseChart = forwardRef<ReactECharts, HvBaseChartProps>(\n (props, ref) => {\n const { option, width, height } = props;\n\n const { theme } = useVizTheme();\n\n const currentTheme = useRef<string | undefined>(theme);\n const chartRef = useRef<ReactECharts>(null);\n const isMounted = useRef<boolean>(false);\n\n const forkedRef = useForkRef<ReactECharts>(ref, chartRef);\n\n const [initialOption, setInitialOption] = useState<HvEChartsOption>(option);\n\n useEffect(() => {\n if (!isMounted.current) {\n isMounted.current = true;\n return;\n }\n\n // when the theme changes echarts destroys the chart and mounts it again\n // thus we need to reset the initial option\n if (theme !== currentTheme.current) {\n setInitialOption(option);\n currentTheme.current = theme;\n return;\n }\n\n const instance = chartRef.current?.getEchartsInstance();\n\n if (!instance) return;\n\n instance.setOption(option, {\n replaceMerge: [\"xAxis\", \"yAxis\", \"series\", \"dataset\"],\n });\n }, [theme, option]);\n\n return (\n <ReactECharts\n ref={forkedRef}\n echarts={echarts}\n option={initialOption}\n theme={theme}\n notMerge\n style={{\n width: width || \"100%\",\n height: height || \"100%\",\n }}\n />\n );\n }\n);\n"],"names":["echarts","CanvasRenderer","AriaComponent","forwardRef","useVizTheme","useRef","useForkRef","useState","useEffect","jsx","ReactECharts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaAA,mBAAQ,IAAI,CAACC,0BAAgBC,WAAAA,aAAa,CAAC;AAcpC,MAAM,cAAcC,MAAA;AAAA,EACzB,CAAC,OAAO,QAAQ;AACd,UAAM,EAAE,QAAQ,OAAO,OAAA,IAAW;AAE5B,UAAA,EAAE,UAAUC,YAAAA;AAEZ,UAAA,eAAeC,aAA2B,KAAK;AAC/C,UAAA,WAAWA,aAAqB,IAAI;AACpC,UAAA,YAAYA,aAAgB,KAAK;AAEjC,UAAA,YAAYC,MAAAA,WAAyB,KAAK,QAAQ;AAExD,UAAM,CAAC,eAAe,gBAAgB,IAAIC,eAA0B,MAAM;AAE1EC,UAAAA,UAAU,MAAM;AACV,UAAA,CAAC,UAAU,SAAS;AACtB,kBAAU,UAAU;AACpB;AAAA,MACF;AAII,UAAA,UAAU,aAAa,SAAS;AAClC,yBAAiB,MAAM;AACvB,qBAAa,UAAU;AACvB;AAAA,MACF;AAEM,YAAA,WAAW,SAAS,SAAS,mBAAmB;AAEtD,UAAI,CAAC;AAAU;AAEf,eAAS,UAAU,QAAQ;AAAA,QACzB,cAAc,CAAC,SAAS,SAAS,UAAU,SAAS;AAAA,MAAA,CACrD;AAAA,IAAA,GACA,CAAC,OAAO,MAAM,CAAC;AAGhB,WAAAC,2BAAA;AAAA,MAACC,sBAAA;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QAAA,SACLV;AAAAA,QACA,QAAQ;AAAA,QACR;AAAA,QACA,UAAQ;AAAA,QACR,OAAO;AAAA,UACL,OAAO,SAAS;AAAA,UAChB,QAAQ,UAAU;AAAA,QACpB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;;"}
1
+ {"version":3,"file":"BaseChart.cjs","sources":["../../../src/BaseChart/BaseChart.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState } from \"react\";\n\nimport { useForkRef } from \"@mui/material/utils\";\n\nimport { AriaComponent } from \"echarts/components\";\nimport { CanvasRenderer } from \"echarts/renderers\";\nimport * as echarts from \"echarts/core\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\n\nimport { useVizTheme } from \"../hooks\";\nimport { HvEChartsOption } from \"../types/common\";\n\n// Register chart components\necharts.use([CanvasRenderer, AriaComponent]);\n\nexport interface HvBaseChartProps {\n /** ECharts option. */\n option: HvEChartsOption;\n /** Charts width. */\n width?: echarts.ResizeOpts[\"width\"];\n /** Charts height. */\n height?: echarts.ResizeOpts[\"height\"];\n}\n\n/**\n * Base chart.\n */\nexport const HvBaseChart = forwardRef<ReactECharts, HvBaseChartProps>(\n (props, ref) => {\n const { option, width, height } = props;\n\n const { theme, activeTheme } = useVizTheme();\n\n const currentTheme = useRef<string | undefined>(theme);\n const chartRef = useRef<ReactECharts>(null);\n\n const forkedRef = useForkRef<ReactECharts>(ref, chartRef);\n\n const [initialOption, setInitialOption] = useState<HvEChartsOption>(option);\n\n useEffect(() => {\n // when the theme changes echarts destroys the chart and mounts it again\n // thus we need to reset the initial option\n if (theme !== currentTheme.current) {\n setInitialOption(option);\n currentTheme.current = theme;\n return;\n }\n\n const instance = chartRef.current?.getEchartsInstance();\n\n if (!instance) return;\n\n instance.setOption(option, {\n replaceMerge: [\"xAxis\", \"yAxis\", \"series\", \"dataset\"],\n });\n\n return () => {\n // Dispose the instance of the chart when the component unmounts. This ensures that\n // the chart theme will update when the theme changes.\n instance.dispose();\n };\n }, [theme, option, activeTheme]);\n\n return (\n <ReactECharts\n ref={forkedRef}\n echarts={echarts}\n option={initialOption}\n theme={theme}\n notMerge\n style={{\n width: width || \"100%\",\n height: height || \"100%\",\n }}\n />\n );\n }\n);\n"],"names":["echarts","CanvasRenderer","AriaComponent","forwardRef","useVizTheme","useRef","useForkRef","useState","useEffect","jsx","ReactECharts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaAA,mBAAQ,IAAI,CAACC,0BAAgBC,WAAAA,aAAa,CAAC;AAcpC,MAAM,cAAcC,MAAA;AAAA,EACzB,CAAC,OAAO,QAAQ;AACd,UAAM,EAAE,QAAQ,OAAO,OAAA,IAAW;AAElC,UAAM,EAAE,OAAO,YAAY,IAAIC,YAAY,YAAA;AAErC,UAAA,eAAeC,aAA2B,KAAK;AAC/C,UAAA,WAAWA,aAAqB,IAAI;AAEpC,UAAA,YAAYC,MAAAA,WAAyB,KAAK,QAAQ;AAExD,UAAM,CAAC,eAAe,gBAAgB,IAAIC,eAA0B,MAAM;AAE1EC,UAAAA,UAAU,MAAM;AAGV,UAAA,UAAU,aAAa,SAAS;AAClC,yBAAiB,MAAM;AACvB,qBAAa,UAAU;AACvB;AAAA,MACF;AAEM,YAAA,WAAW,SAAS,SAAS,mBAAmB;AAEtD,UAAI,CAAC;AAAU;AAEf,eAAS,UAAU,QAAQ;AAAA,QACzB,cAAc,CAAC,SAAS,SAAS,UAAU,SAAS;AAAA,MAAA,CACrD;AAED,aAAO,MAAM;AAGX,iBAAS,QAAQ;AAAA,MAAA;AAAA,IAElB,GAAA,CAAC,OAAO,QAAQ,WAAW,CAAC;AAG7B,WAAAC,2BAAA;AAAA,MAACC,sBAAA;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QAAA,SACLV;AAAAA,QACA,QAAQ;AAAA,QACR;AAAA,QACA,UAAQ;AAAA,QACR,OAAO;AAAA,UACL,OAAO,SAAS;AAAA,UAChB,QAAQ,UAAU;AAAA,QACpB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;;"}
@@ -11,7 +11,7 @@ const HvVizProvider = ({ children }) => {
11
11
  const { activeTheme, selectedMode, selectedTheme } = uikitReactCore.useTheme();
12
12
  const value = react.useMemo(() => {
13
13
  registerTheme.registerTheme(selectedTheme, selectedMode, activeTheme);
14
- return { theme: `${selectedTheme}-${selectedMode}` };
14
+ return { theme: `${selectedTheme}-${selectedMode}`, activeTheme };
15
15
  }, [selectedTheme, selectedMode, activeTheme]);
16
16
  return /* @__PURE__ */ jsxRuntime.jsx(HvVizContext.Provider, { value, children });
17
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.cjs","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { createContext, useMemo } from \"react\";\n\nimport { useTheme } from \"@hitachivantara/uikit-react-core\";\n\nimport { registerTheme } from \"../utils/registerTheme\";\n\nexport interface HvVizContextValue {\n /**\n * Current theme\n */\n theme?: string;\n}\n\nexport const HvVizContext = createContext<HvVizContextValue>({\n theme: undefined,\n});\n\nexport interface HvVizProviderProps {\n /**\n * Component tree.\n */\n children?: React.ReactNode;\n}\n\n/**\n * Enables theming capabilities for visualizations.\n *\n * Without this provider the visualizations will not comply to the UI Kit themes.\n *\n * This provider should always be used in combination with the `HvProvider` from\n * the core package since the former uses the themes provided by the latter.\n *\n * `HvVizProvider` should always be used after `HvProvider` like so to work properly:\n *\n * ```\n * <HvProvider>\n * <HvVizProvider>\n * (...)\n * </HvVizProvider>\n * </HvProvider>\n * ```\n */\nexport const HvVizProvider = ({ children }: HvVizProviderProps) => {\n const { activeTheme, selectedMode, selectedTheme } = useTheme();\n\n const value = useMemo(() => {\n registerTheme(selectedTheme, selectedMode, activeTheme);\n\n return { theme: `${selectedTheme}-${selectedMode}` };\n }, [selectedTheme, selectedMode, activeTheme]);\n\n return (\n <HvVizContext.Provider value={value}>{children}</HvVizContext.Provider>\n );\n};\n"],"names":["createContext","useTheme","useMemo","registerTheme","jsx"],"mappings":";;;;;;AAaO,MAAM,eAAeA,MAAAA,cAAiC;AAAA,EAC3D,OAAO;AACT,CAAC;AA2BM,MAAM,gBAAgB,CAAC,EAAE,eAAmC;AACjE,QAAM,EAAE,aAAa,cAAc,kBAAkBC,eAAS,SAAA;AAExD,QAAA,QAAQC,MAAAA,QAAQ,MAAM;AACZC,kBAAAA,cAAA,eAAe,cAAc,WAAW;AAEtD,WAAO,EAAE,OAAO,GAAG,aAAa,IAAI,YAAY;EAC/C,GAAA,CAAC,eAAe,cAAc,WAAW,CAAC;AAE7C,SACGC,2BAAAA,IAAA,aAAa,UAAb,EAAsB,OAAe,SAAS,CAAA;AAEnD;;;"}
1
+ {"version":3,"file":"Provider.cjs","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { createContext, useMemo } from \"react\";\n\nimport { HvTheme, useTheme } from \"@hitachivantara/uikit-react-core\";\n\nimport { registerTheme } from \"../utils/registerTheme\";\n\nexport interface HvVizContextValue {\n /**\n * Current theme\n */\n theme?: string;\n /**\n * The current active theme\n */\n activeTheme?: HvTheme;\n}\n\nexport const HvVizContext = createContext<HvVizContextValue>({\n theme: undefined,\n});\n\nexport interface HvVizProviderProps {\n /**\n * Component tree.\n */\n children?: React.ReactNode;\n}\n\n/**\n * Enables theming capabilities for visualizations.\n *\n * Without this provider the visualizations will not comply to the UI Kit themes.\n *\n * This provider should always be used in combination with the `HvProvider` from\n * the core package since the former uses the themes provided by the latter.\n *\n * `HvVizProvider` should always be used after `HvProvider` like so to work properly:\n *\n * ```\n * <HvProvider>\n * <HvVizProvider>\n * (...)\n * </HvVizProvider>\n * </HvProvider>\n * ```\n */\nexport const HvVizProvider = ({ children }: HvVizProviderProps) => {\n const { activeTheme, selectedMode, selectedTheme } = useTheme();\n\n const value = useMemo(() => {\n registerTheme(selectedTheme, selectedMode, activeTheme);\n\n return { theme: `${selectedTheme}-${selectedMode}`, activeTheme };\n }, [selectedTheme, selectedMode, activeTheme]);\n\n return (\n <HvVizContext.Provider value={value}>{children}</HvVizContext.Provider>\n );\n};\n"],"names":["createContext","useTheme","useMemo","registerTheme","jsx"],"mappings":";;;;;;AAiBO,MAAM,eAAeA,MAAAA,cAAiC;AAAA,EAC3D,OAAO;AACT,CAAC;AA2BM,MAAM,gBAAgB,CAAC,EAAE,eAAmC;AACjE,QAAM,EAAE,aAAa,cAAc,kBAAkBC,eAAS,SAAA;AAExD,QAAA,QAAQC,MAAAA,QAAQ,MAAM;AACZC,kBAAAA,cAAA,eAAe,cAAc,WAAW;AAEtD,WAAO,EAAE,OAAO,GAAG,aAAa,IAAI,YAAY,IAAI;EACnD,GAAA,CAAC,eAAe,cAAc,WAAW,CAAC;AAE7C,SACGC,2BAAAA,IAAA,aAAa,UAAb,EAAsB,OAAe,SAAS,CAAA;AAEnD;;;"}
@@ -10,17 +10,12 @@ echarts.use([CanvasRenderer, AriaComponent]);
10
10
  const HvBaseChart = forwardRef(
11
11
  (props, ref) => {
12
12
  const { option, width, height } = props;
13
- const { theme } = useVizTheme();
13
+ const { theme, activeTheme } = useVizTheme();
14
14
  const currentTheme = useRef(theme);
15
15
  const chartRef = useRef(null);
16
- const isMounted = useRef(false);
17
16
  const forkedRef = useForkRef(ref, chartRef);
18
17
  const [initialOption, setInitialOption] = useState(option);
19
18
  useEffect(() => {
20
- if (!isMounted.current) {
21
- isMounted.current = true;
22
- return;
23
- }
24
19
  if (theme !== currentTheme.current) {
25
20
  setInitialOption(option);
26
21
  currentTheme.current = theme;
@@ -32,7 +27,10 @@ const HvBaseChart = forwardRef(
32
27
  instance.setOption(option, {
33
28
  replaceMerge: ["xAxis", "yAxis", "series", "dataset"]
34
29
  });
35
- }, [theme, option]);
30
+ return () => {
31
+ instance.dispose();
32
+ };
33
+ }, [theme, option, activeTheme]);
36
34
  return /* @__PURE__ */ jsx(
37
35
  ReactECharts,
38
36
  {
@@ -1 +1 @@
1
- {"version":3,"file":"BaseChart.js","sources":["../../../src/BaseChart/BaseChart.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState } from \"react\";\n\nimport { useForkRef } from \"@mui/material/utils\";\n\nimport { AriaComponent } from \"echarts/components\";\nimport { CanvasRenderer } from \"echarts/renderers\";\nimport * as echarts from \"echarts/core\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\n\nimport { useVizTheme } from \"../hooks\";\nimport { HvEChartsOption } from \"../types/common\";\n\n// Register chart components\necharts.use([CanvasRenderer, AriaComponent]);\n\nexport interface HvBaseChartProps {\n /** ECharts option. */\n option: HvEChartsOption;\n /** Charts width. */\n width?: echarts.ResizeOpts[\"width\"];\n /** Charts height. */\n height?: echarts.ResizeOpts[\"height\"];\n}\n\n/**\n * Base chart.\n */\nexport const HvBaseChart = forwardRef<ReactECharts, HvBaseChartProps>(\n (props, ref) => {\n const { option, width, height } = props;\n\n const { theme } = useVizTheme();\n\n const currentTheme = useRef<string | undefined>(theme);\n const chartRef = useRef<ReactECharts>(null);\n const isMounted = useRef<boolean>(false);\n\n const forkedRef = useForkRef<ReactECharts>(ref, chartRef);\n\n const [initialOption, setInitialOption] = useState<HvEChartsOption>(option);\n\n useEffect(() => {\n if (!isMounted.current) {\n isMounted.current = true;\n return;\n }\n\n // when the theme changes echarts destroys the chart and mounts it again\n // thus we need to reset the initial option\n if (theme !== currentTheme.current) {\n setInitialOption(option);\n currentTheme.current = theme;\n return;\n }\n\n const instance = chartRef.current?.getEchartsInstance();\n\n if (!instance) return;\n\n instance.setOption(option, {\n replaceMerge: [\"xAxis\", \"yAxis\", \"series\", \"dataset\"],\n });\n }, [theme, option]);\n\n return (\n <ReactECharts\n ref={forkedRef}\n echarts={echarts}\n option={initialOption}\n theme={theme}\n notMerge\n style={{\n width: width || \"100%\",\n height: height || \"100%\",\n }}\n />\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;AAaA,QAAQ,IAAI,CAAC,gBAAgB,aAAa,CAAC;AAcpC,MAAM,cAAc;AAAA,EACzB,CAAC,OAAO,QAAQ;AACd,UAAM,EAAE,QAAQ,OAAO,OAAA,IAAW;AAE5B,UAAA,EAAE,UAAU;AAEZ,UAAA,eAAe,OAA2B,KAAK;AAC/C,UAAA,WAAW,OAAqB,IAAI;AACpC,UAAA,YAAY,OAAgB,KAAK;AAEjC,UAAA,YAAY,WAAyB,KAAK,QAAQ;AAExD,UAAM,CAAC,eAAe,gBAAgB,IAAI,SAA0B,MAAM;AAE1E,cAAU,MAAM;AACV,UAAA,CAAC,UAAU,SAAS;AACtB,kBAAU,UAAU;AACpB;AAAA,MACF;AAII,UAAA,UAAU,aAAa,SAAS;AAClC,yBAAiB,MAAM;AACvB,qBAAa,UAAU;AACvB;AAAA,MACF;AAEM,YAAA,WAAW,SAAS,SAAS,mBAAmB;AAEtD,UAAI,CAAC;AAAU;AAEf,eAAS,UAAU,QAAQ;AAAA,QACzB,cAAc,CAAC,SAAS,SAAS,UAAU,SAAS;AAAA,MAAA,CACrD;AAAA,IAAA,GACA,CAAC,OAAO,MAAM,CAAC;AAGhB,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QACL;AAAA,QACA,QAAQ;AAAA,QACR;AAAA,QACA,UAAQ;AAAA,QACR,OAAO;AAAA,UACL,OAAO,SAAS;AAAA,UAChB,QAAQ,UAAU;AAAA,QACpB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"BaseChart.js","sources":["../../../src/BaseChart/BaseChart.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState } from \"react\";\n\nimport { useForkRef } from \"@mui/material/utils\";\n\nimport { AriaComponent } from \"echarts/components\";\nimport { CanvasRenderer } from \"echarts/renderers\";\nimport * as echarts from \"echarts/core\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\n\nimport { useVizTheme } from \"../hooks\";\nimport { HvEChartsOption } from \"../types/common\";\n\n// Register chart components\necharts.use([CanvasRenderer, AriaComponent]);\n\nexport interface HvBaseChartProps {\n /** ECharts option. */\n option: HvEChartsOption;\n /** Charts width. */\n width?: echarts.ResizeOpts[\"width\"];\n /** Charts height. */\n height?: echarts.ResizeOpts[\"height\"];\n}\n\n/**\n * Base chart.\n */\nexport const HvBaseChart = forwardRef<ReactECharts, HvBaseChartProps>(\n (props, ref) => {\n const { option, width, height } = props;\n\n const { theme, activeTheme } = useVizTheme();\n\n const currentTheme = useRef<string | undefined>(theme);\n const chartRef = useRef<ReactECharts>(null);\n\n const forkedRef = useForkRef<ReactECharts>(ref, chartRef);\n\n const [initialOption, setInitialOption] = useState<HvEChartsOption>(option);\n\n useEffect(() => {\n // when the theme changes echarts destroys the chart and mounts it again\n // thus we need to reset the initial option\n if (theme !== currentTheme.current) {\n setInitialOption(option);\n currentTheme.current = theme;\n return;\n }\n\n const instance = chartRef.current?.getEchartsInstance();\n\n if (!instance) return;\n\n instance.setOption(option, {\n replaceMerge: [\"xAxis\", \"yAxis\", \"series\", \"dataset\"],\n });\n\n return () => {\n // Dispose the instance of the chart when the component unmounts. This ensures that\n // the chart theme will update when the theme changes.\n instance.dispose();\n };\n }, [theme, option, activeTheme]);\n\n return (\n <ReactECharts\n ref={forkedRef}\n echarts={echarts}\n option={initialOption}\n theme={theme}\n notMerge\n style={{\n width: width || \"100%\",\n height: height || \"100%\",\n }}\n />\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;AAaA,QAAQ,IAAI,CAAC,gBAAgB,aAAa,CAAC;AAcpC,MAAM,cAAc;AAAA,EACzB,CAAC,OAAO,QAAQ;AACd,UAAM,EAAE,QAAQ,OAAO,OAAA,IAAW;AAElC,UAAM,EAAE,OAAO,YAAY,IAAI,YAAY;AAErC,UAAA,eAAe,OAA2B,KAAK;AAC/C,UAAA,WAAW,OAAqB,IAAI;AAEpC,UAAA,YAAY,WAAyB,KAAK,QAAQ;AAExD,UAAM,CAAC,eAAe,gBAAgB,IAAI,SAA0B,MAAM;AAE1E,cAAU,MAAM;AAGV,UAAA,UAAU,aAAa,SAAS;AAClC,yBAAiB,MAAM;AACvB,qBAAa,UAAU;AACvB;AAAA,MACF;AAEM,YAAA,WAAW,SAAS,SAAS,mBAAmB;AAEtD,UAAI,CAAC;AAAU;AAEf,eAAS,UAAU,QAAQ;AAAA,QACzB,cAAc,CAAC,SAAS,SAAS,UAAU,SAAS;AAAA,MAAA,CACrD;AAED,aAAO,MAAM;AAGX,iBAAS,QAAQ;AAAA,MAAA;AAAA,IAElB,GAAA,CAAC,OAAO,QAAQ,WAAW,CAAC;AAG7B,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QACL;AAAA,QACA,QAAQ;AAAA,QACR;AAAA,QACA,UAAQ;AAAA,QACR,OAAO;AAAA,UACL,OAAO,SAAS;AAAA,UAChB,QAAQ,UAAU;AAAA,QACpB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
@@ -9,7 +9,7 @@ const HvVizProvider = ({ children }) => {
9
9
  const { activeTheme, selectedMode, selectedTheme } = useTheme();
10
10
  const value = useMemo(() => {
11
11
  registerTheme(selectedTheme, selectedMode, activeTheme);
12
- return { theme: `${selectedTheme}-${selectedMode}` };
12
+ return { theme: `${selectedTheme}-${selectedMode}`, activeTheme };
13
13
  }, [selectedTheme, selectedMode, activeTheme]);
14
14
  return /* @__PURE__ */ jsx(HvVizContext.Provider, { value, children });
15
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { createContext, useMemo } from \"react\";\n\nimport { useTheme } from \"@hitachivantara/uikit-react-core\";\n\nimport { registerTheme } from \"../utils/registerTheme\";\n\nexport interface HvVizContextValue {\n /**\n * Current theme\n */\n theme?: string;\n}\n\nexport const HvVizContext = createContext<HvVizContextValue>({\n theme: undefined,\n});\n\nexport interface HvVizProviderProps {\n /**\n * Component tree.\n */\n children?: React.ReactNode;\n}\n\n/**\n * Enables theming capabilities for visualizations.\n *\n * Without this provider the visualizations will not comply to the UI Kit themes.\n *\n * This provider should always be used in combination with the `HvProvider` from\n * the core package since the former uses the themes provided by the latter.\n *\n * `HvVizProvider` should always be used after `HvProvider` like so to work properly:\n *\n * ```\n * <HvProvider>\n * <HvVizProvider>\n * (...)\n * </HvVizProvider>\n * </HvProvider>\n * ```\n */\nexport const HvVizProvider = ({ children }: HvVizProviderProps) => {\n const { activeTheme, selectedMode, selectedTheme } = useTheme();\n\n const value = useMemo(() => {\n registerTheme(selectedTheme, selectedMode, activeTheme);\n\n return { theme: `${selectedTheme}-${selectedMode}` };\n }, [selectedTheme, selectedMode, activeTheme]);\n\n return (\n <HvVizContext.Provider value={value}>{children}</HvVizContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;AAaO,MAAM,eAAe,cAAiC;AAAA,EAC3D,OAAO;AACT,CAAC;AA2BM,MAAM,gBAAgB,CAAC,EAAE,eAAmC;AACjE,QAAM,EAAE,aAAa,cAAc,kBAAkB,SAAS;AAExD,QAAA,QAAQ,QAAQ,MAAM;AACZ,kBAAA,eAAe,cAAc,WAAW;AAEtD,WAAO,EAAE,OAAO,GAAG,aAAa,IAAI,YAAY;EAC/C,GAAA,CAAC,eAAe,cAAc,WAAW,CAAC;AAE7C,SACG,oBAAA,aAAa,UAAb,EAAsB,OAAe,SAAS,CAAA;AAEnD;"}
1
+ {"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { createContext, useMemo } from \"react\";\n\nimport { HvTheme, useTheme } from \"@hitachivantara/uikit-react-core\";\n\nimport { registerTheme } from \"../utils/registerTheme\";\n\nexport interface HvVizContextValue {\n /**\n * Current theme\n */\n theme?: string;\n /**\n * The current active theme\n */\n activeTheme?: HvTheme;\n}\n\nexport const HvVizContext = createContext<HvVizContextValue>({\n theme: undefined,\n});\n\nexport interface HvVizProviderProps {\n /**\n * Component tree.\n */\n children?: React.ReactNode;\n}\n\n/**\n * Enables theming capabilities for visualizations.\n *\n * Without this provider the visualizations will not comply to the UI Kit themes.\n *\n * This provider should always be used in combination with the `HvProvider` from\n * the core package since the former uses the themes provided by the latter.\n *\n * `HvVizProvider` should always be used after `HvProvider` like so to work properly:\n *\n * ```\n * <HvProvider>\n * <HvVizProvider>\n * (...)\n * </HvVizProvider>\n * </HvProvider>\n * ```\n */\nexport const HvVizProvider = ({ children }: HvVizProviderProps) => {\n const { activeTheme, selectedMode, selectedTheme } = useTheme();\n\n const value = useMemo(() => {\n registerTheme(selectedTheme, selectedMode, activeTheme);\n\n return { theme: `${selectedTheme}-${selectedMode}`, activeTheme };\n }, [selectedTheme, selectedMode, activeTheme]);\n\n return (\n <HvVizContext.Provider value={value}>{children}</HvVizContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;AAiBO,MAAM,eAAe,cAAiC;AAAA,EAC3D,OAAO;AACT,CAAC;AA2BM,MAAM,gBAAgB,CAAC,EAAE,eAAmC;AACjE,QAAM,EAAE,aAAa,cAAc,kBAAkB,SAAS;AAExD,QAAA,QAAQ,QAAQ,MAAM;AACZ,kBAAA,eAAe,cAAc,WAAW;AAEtD,WAAO,EAAE,OAAO,GAAG,aAAa,IAAI,YAAY,IAAI;EACnD,GAAA,CAAC,eAAe,cAAc,WAAW,CAAC;AAE7C,SACG,oBAAA,aAAa,UAAb,EAAsB,OAAe,SAAS,CAAA;AAEnD;"}
@@ -5,6 +5,7 @@ import { CSSInterpolation } from '@emotion/serialize';
5
5
  import { ExtractNames } from '@hitachivantara/uikit-react-core';
6
6
  import { ForwardRefExoticComponent } from 'react';
7
7
  import type { HvColorAny } from '@hitachivantara/uikit-react-core';
8
+ import { HvTheme } from '@hitachivantara/uikit-react-core';
8
9
  import { JSX as JSX_2 } from '@emotion/react/jsx-runtime';
9
10
  import ReactECharts from 'echarts-for-react/lib/core';
10
11
  import { RefAttributes } from 'react';
@@ -363,6 +364,10 @@ export declare interface HvVizContextValue {
363
364
  * Current theme
364
365
  */
365
366
  theme?: string;
367
+ /**
368
+ * The current active theme
369
+ */
370
+ activeTheme?: HvTheme;
366
371
  }
367
372
 
368
373
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-viz",
3
- "version": "5.6.45",
3
+ "version": "5.6.47",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "Contributed React visualization components for the NEXT UI Kit.",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@emotion/css": "^11.11.0",
36
- "@hitachivantara/uikit-react-core": "^5.44.7"
36
+ "@hitachivantara/uikit-react-core": "^5.45.0"
37
37
  },
38
38
  "files": [
39
39
  "dist"
@@ -42,7 +42,7 @@
42
42
  "access": "public",
43
43
  "directory": "package"
44
44
  },
45
- "gitHead": "f5fea985b044df120c0a87b71bd840700f5e4e8c",
45
+ "gitHead": "8b3bfd1137cc8650dcd801f4910d0bdd285a0c3c",
46
46
  "main": "dist/cjs/index.cjs",
47
47
  "exports": {
48
48
  ".": {