@hitachivantara/uikit-react-viz 5.2.3 → 5.2.4

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.
@@ -16,13 +16,10 @@ const HvVizProvider = ({
16
16
  selectedMode,
17
17
  selectedTheme
18
18
  } = uikitReactCore.useTheme();
19
- const [theme, setTheme] = react.useState();
20
19
  react.useEffect(() => {
21
20
  registerThemes.registerThemes(selectedTheme, colorModes, activeTheme);
22
21
  }, [selectedTheme, colorModes, activeTheme]);
23
- react.useEffect(() => {
24
- setTheme(`${selectedTheme}-${selectedMode}`);
25
- }, [selectedMode, selectedTheme]);
22
+ const theme = react.useMemo(() => `${selectedTheme}-${selectedMode}`, [selectedMode, selectedTheme]);
26
23
  const value = react.useMemo(() => ({
27
24
  theme
28
25
  }), [theme]);
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.cjs","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { useTheme } from \"@hitachivantara/uikit-react-core\";\nimport { registerThemes } from \"@viz/utils\";\nimport { createContext, useEffect, useMemo, useState } from \"react\";\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, colorModes, selectedMode, selectedTheme } = useTheme();\n\n const [theme, setTheme] = useState<string | undefined>();\n\n useEffect(() => {\n registerThemes(selectedTheme, colorModes, activeTheme);\n }, [selectedTheme, colorModes, activeTheme]);\n\n useEffect(() => {\n setTheme(`${selectedTheme}-${selectedMode}`);\n }, [selectedMode, selectedTheme]);\n\n const value = useMemo<HvVizContextValue>(\n () => ({\n theme,\n }),\n [theme]\n );\n\n return (\n <HvVizContext.Provider value={value}>{children}</HvVizContext.Provider>\n );\n};\n"],"names":["HvVizContext","createContext","theme","undefined","HvVizProvider","children","activeTheme","colorModes","selectedMode","selectedTheme","useTheme","setTheme","useState","useEffect","value","useMemo","_jsx","Provider"],"mappings":";;;;;;AAWO,MAAMA,eAAeC,MAAAA,cAAiC;AAAA,EAC3DC,OAAOC;AACT,CAAC;AA2BM,MAAMC,gBAAgBA,CAAC;AAAA,EAAEC;AAA6B,MAAM;AAC3D,QAAA;AAAA,IAAEC;AAAAA,IAAaC;AAAAA,IAAYC;AAAAA,IAAcC;AAAAA,MAAkBC,eAAS,SAAA;AAE1E,QAAM,CAACR,OAAOS,QAAQ,IAAIC,MAA6B,SAAA;AAEvDC,QAAAA,UAAU,MAAM;AACCJ,mBAAAA,eAAAA,eAAeF,YAAYD,WAAW;AAAA,EACpD,GAAA,CAACG,eAAeF,YAAYD,WAAW,CAAC;AAE3CO,QAAAA,UAAU,MAAM;AACJ,aAAA,GAAEJ,iBAAiBD,cAAc;AAAA,EAAA,GAC1C,CAACA,cAAcC,aAAa,CAAC;AAE1BK,QAAAA,QAAQC,MAAAA,QACZ,OAAO;AAAA,IACLb;AAAAA,EAAAA,IAEF,CAACA,KAAK,CACR;AAGEc,SAAAA,2BAAAA,IAAChB,aAAaiB,UAAQ;AAAA,IAACH;AAAAA,IAAaT;AAAAA,EAAAA,CAAkC;AAE1E;;;"}
1
+ {"version":3,"file":"Provider.cjs","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { useTheme } from \"@hitachivantara/uikit-react-core\";\nimport { registerThemes } from \"@viz/utils\";\nimport { createContext, useEffect, useMemo } from \"react\";\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, colorModes, selectedMode, selectedTheme } = useTheme();\n\n useEffect(() => {\n registerThemes(selectedTheme, colorModes, activeTheme);\n }, [selectedTheme, colorModes, activeTheme]);\n\n const theme = useMemo(\n () => `${selectedTheme}-${selectedMode}`,\n [selectedMode, selectedTheme]\n );\n\n const value = useMemo<HvVizContextValue>(\n () => ({\n theme,\n }),\n [theme]\n );\n\n return (\n <HvVizContext.Provider value={value}>{children}</HvVizContext.Provider>\n );\n};\n"],"names":["HvVizContext","createContext","theme","undefined","HvVizProvider","children","activeTheme","colorModes","selectedMode","selectedTheme","useTheme","useEffect","useMemo","value","_jsx","Provider"],"mappings":";;;;;;AAWO,MAAMA,eAAeC,MAAAA,cAAiC;AAAA,EAC3DC,OAAOC;AACT,CAAC;AA2BM,MAAMC,gBAAgBA,CAAC;AAAA,EAAEC;AAA6B,MAAM;AAC3D,QAAA;AAAA,IAAEC;AAAAA,IAAaC;AAAAA,IAAYC;AAAAA,IAAcC;AAAAA,MAAkBC,eAAS,SAAA;AAE1EC,QAAAA,UAAU,MAAM;AACCF,mBAAAA,eAAAA,eAAeF,YAAYD,WAAW;AAAA,EACpD,GAAA,CAACG,eAAeF,YAAYD,WAAW,CAAC;AAErCJ,QAAAA,QAAQU,MAAAA,QACZ,MAAO,GAAEH,iBAAiBD,gBAC1B,CAACA,cAAcC,aAAa,CAC9B;AAEMI,QAAAA,QAAQD,MAAAA,QACZ,OAAO;AAAA,IACLV;AAAAA,EAAAA,IAEF,CAACA,KAAK,CACR;AAGEY,SAAAA,2BAAAA,IAACd,aAAae,UAAQ;AAAA,IAACF;AAAAA,IAAaR;AAAAA,EAAAA,CAAkC;AAE1E;;;"}
@@ -1,6 +1,6 @@
1
1
  import { useTheme } from "@hitachivantara/uikit-react-core";
2
2
  import { registerThemes } from "../utils/registerThemes.js";
3
- import { createContext, useState, useEffect, useMemo } from "react";
3
+ import { createContext, useEffect, useMemo } from "react";
4
4
  import { jsx } from "@emotion/react/jsx-runtime";
5
5
  const HvVizContext = createContext({
6
6
  theme: void 0
@@ -14,13 +14,10 @@ const HvVizProvider = ({
14
14
  selectedMode,
15
15
  selectedTheme
16
16
  } = useTheme();
17
- const [theme, setTheme] = useState();
18
17
  useEffect(() => {
19
18
  registerThemes(selectedTheme, colorModes, activeTheme);
20
19
  }, [selectedTheme, colorModes, activeTheme]);
21
- useEffect(() => {
22
- setTheme(`${selectedTheme}-${selectedMode}`);
23
- }, [selectedMode, selectedTheme]);
20
+ const theme = useMemo(() => `${selectedTheme}-${selectedMode}`, [selectedMode, selectedTheme]);
24
21
  const value = useMemo(() => ({
25
22
  theme
26
23
  }), [theme]);
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { useTheme } from \"@hitachivantara/uikit-react-core\";\nimport { registerThemes } from \"@viz/utils\";\nimport { createContext, useEffect, useMemo, useState } from \"react\";\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, colorModes, selectedMode, selectedTheme } = useTheme();\n\n const [theme, setTheme] = useState<string | undefined>();\n\n useEffect(() => {\n registerThemes(selectedTheme, colorModes, activeTheme);\n }, [selectedTheme, colorModes, activeTheme]);\n\n useEffect(() => {\n setTheme(`${selectedTheme}-${selectedMode}`);\n }, [selectedMode, selectedTheme]);\n\n const value = useMemo<HvVizContextValue>(\n () => ({\n theme,\n }),\n [theme]\n );\n\n return (\n <HvVizContext.Provider value={value}>{children}</HvVizContext.Provider>\n );\n};\n"],"names":["HvVizContext","createContext","theme","undefined","HvVizProvider","children","activeTheme","colorModes","selectedMode","selectedTheme","useTheme","setTheme","useState","useEffect","value","useMemo","_jsx","Provider"],"mappings":";;;;AAWO,MAAMA,eAAeC,cAAiC;AAAA,EAC3DC,OAAOC;AACT,CAAC;AA2BM,MAAMC,gBAAgBA,CAAC;AAAA,EAAEC;AAA6B,MAAM;AAC3D,QAAA;AAAA,IAAEC;AAAAA,IAAaC;AAAAA,IAAYC;AAAAA,IAAcC;AAAAA,MAAkBC,SAAS;AAE1E,QAAM,CAACR,OAAOS,QAAQ,IAAIC,SAA6B;AAEvDC,YAAU,MAAM;AACCJ,mBAAAA,eAAeF,YAAYD,WAAW;AAAA,EACpD,GAAA,CAACG,eAAeF,YAAYD,WAAW,CAAC;AAE3CO,YAAU,MAAM;AACJ,aAAA,GAAEJ,iBAAiBD,cAAc;AAAA,EAAA,GAC1C,CAACA,cAAcC,aAAa,CAAC;AAE1BK,QAAAA,QAAQC,QACZ,OAAO;AAAA,IACLb;AAAAA,EAAAA,IAEF,CAACA,KAAK,CACR;AAGEc,SAAAA,oBAAChB,aAAaiB,UAAQ;AAAA,IAACH;AAAAA,IAAaT;AAAAA,EAAAA,CAAkC;AAE1E;"}
1
+ {"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { useTheme } from \"@hitachivantara/uikit-react-core\";\nimport { registerThemes } from \"@viz/utils\";\nimport { createContext, useEffect, useMemo } from \"react\";\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, colorModes, selectedMode, selectedTheme } = useTheme();\n\n useEffect(() => {\n registerThemes(selectedTheme, colorModes, activeTheme);\n }, [selectedTheme, colorModes, activeTheme]);\n\n const theme = useMemo(\n () => `${selectedTheme}-${selectedMode}`,\n [selectedMode, selectedTheme]\n );\n\n const value = useMemo<HvVizContextValue>(\n () => ({\n theme,\n }),\n [theme]\n );\n\n return (\n <HvVizContext.Provider value={value}>{children}</HvVizContext.Provider>\n );\n};\n"],"names":["HvVizContext","createContext","theme","undefined","HvVizProvider","children","activeTheme","colorModes","selectedMode","selectedTheme","useTheme","useEffect","useMemo","value","_jsx","Provider"],"mappings":";;;;AAWO,MAAMA,eAAeC,cAAiC;AAAA,EAC3DC,OAAOC;AACT,CAAC;AA2BM,MAAMC,gBAAgBA,CAAC;AAAA,EAAEC;AAA6B,MAAM;AAC3D,QAAA;AAAA,IAAEC;AAAAA,IAAaC;AAAAA,IAAYC;AAAAA,IAAcC;AAAAA,MAAkBC,SAAS;AAE1EC,YAAU,MAAM;AACCF,mBAAAA,eAAeF,YAAYD,WAAW;AAAA,EACpD,GAAA,CAACG,eAAeF,YAAYD,WAAW,CAAC;AAErCJ,QAAAA,QAAQU,QACZ,MAAO,GAAEH,iBAAiBD,gBAC1B,CAACA,cAAcC,aAAa,CAC9B;AAEMI,QAAAA,QAAQD,QACZ,OAAO;AAAA,IACLV;AAAAA,EAAAA,IAEF,CAACA,KAAK,CACR;AAGEY,SAAAA,oBAACd,aAAae,UAAQ;AAAA,IAACF;AAAAA,IAAaR;AAAAA,EAAAA,CAAkC;AAE1E;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-viz",
3
- "version": "5.2.3",
3
+ "version": "5.2.4",
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.18.2"
36
+ "@hitachivantara/uikit-react-core": "^5.18.3"
37
37
  },
38
38
  "files": [
39
39
  "dist"
@@ -42,7 +42,7 @@
42
42
  "access": "public",
43
43
  "directory": "package"
44
44
  },
45
- "gitHead": "664b2b715071d7a7e82255fd1b2b303f0866a2af",
45
+ "gitHead": "e7c73b4104cadf03cdab05584b9791ceda4747e2",
46
46
  "main": "dist/cjs/index.cjs",
47
47
  "exports": {
48
48
  ".": {