@particle-network/ui-react 0.5.1-beta.2 → 0.5.1-beta.3

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.
@@ -1,11 +1,14 @@
1
- import { useTheme } from "./use-theme.js";
1
+ import { useMemo } from "react";
2
+ import { useThemeStore } from "./use-theme-store.js";
2
3
  const useColorScheme = ()=>{
3
- const { theme } = useTheme();
4
- const { colorScheme } = theme;
5
- return {
6
- colorScheme,
7
- isDark: 'dark' === colorScheme,
8
- isLight: 'light' === colorScheme
9
- };
4
+ const { colorScheme } = useThemeStore((state)=>state.theme);
5
+ const scheme = useMemo(()=>({
6
+ colorScheme,
7
+ isDark: 'dark' === colorScheme,
8
+ isLight: 'light' === colorScheme
9
+ }), [
10
+ colorScheme
11
+ ]);
12
+ return scheme;
10
13
  };
11
14
  export { useColorScheme };
@@ -1,10 +1,14 @@
1
- import { useTheme } from "./use-theme.js";
1
+ import { useMemo } from "react";
2
+ import { useThemeStore } from "./use-theme-store.js";
2
3
  const useThemeColor = ()=>{
3
- const { theme } = useTheme();
4
- return {
5
- ...theme.colorVariables,
6
- transparent: 'transparent',
7
- white: '#FFFFFF'
8
- };
4
+ const { colorVariables } = useThemeStore((state)=>state.theme);
5
+ const themeColor = useMemo(()=>({
6
+ ...colorVariables,
7
+ transparent: 'transparent',
8
+ white: '#FFFFFF'
9
+ }), [
10
+ colorVariables
11
+ ]);
12
+ return themeColor;
9
13
  };
10
14
  export { useThemeColor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-react",
3
- "version": "0.5.1-beta.2",
3
+ "version": "0.5.1-beta.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {