@tecsinapse/cortex-core 1.3.0-beta.3 → 1.3.0-beta.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.
package/dist/cjs/index.js CHANGED
@@ -75,7 +75,6 @@ exports.fontSize = definitions.fontSize;
75
75
  exports.spacing = definitions.spacing;
76
76
  exports.textColor = definitions.textColor;
77
77
  exports.zIndex = definitions.zIndex;
78
- exports.setDarkMode = index$1.setDarkMode;
79
78
  exports.updateThemeColors = index$1.updateThemeColors;
80
79
  exports.ThemeProvider = DarkThemeContext.ThemeProvider;
81
80
  exports.useDarkTheme = DarkThemeContext.useDarkTheme;
@@ -15,19 +15,10 @@ const ThemeProvider = ({ children }) => {
15
15
  style.setProperty("--color-surface-base", definitions.darkColors.surface.base);
16
16
  style.setProperty("--color-surface-raised", definitions.darkColors.surface.raised);
17
17
  style.setProperty("--color-surface-overlay", definitions.darkColors.surface.overlay);
18
- style.setProperty("--color-content-primary", definitions.darkColors.content.primary);
19
- style.setProperty(
20
- "--color-content-secondary",
21
- definitions.darkColors.content.secondary
22
- );
23
- style.setProperty(
24
- "--color-content-tertiary",
25
- definitions.darkColors.content.tertiary
26
- );
27
- style.setProperty(
28
- "--color-content-disabled",
29
- definitions.darkColors.content.disabled
30
- );
18
+ style.setProperty("--color-content-high", definitions.darkColors.content.high);
19
+ style.setProperty("--color-content-medium", definitions.darkColors.content.medium);
20
+ style.setProperty("--color-content-low", definitions.darkColors.content.low);
21
+ style.setProperty("--color-content-minimal", definitions.darkColors.content.minimal);
31
22
  style.setProperty("--color-content-inverse", definitions.darkColors.content.inverse);
32
23
  } else {
33
24
  style.setProperty("--color-body", definitions.colors.miscellaneous.body);
@@ -35,10 +26,10 @@ const ThemeProvider = ({ children }) => {
35
26
  style.setProperty("--color-surface-base", definitions.colors.surface.base);
36
27
  style.setProperty("--color-surface-raised", definitions.colors.surface.raised);
37
28
  style.setProperty("--color-surface-overlay", definitions.colors.surface.overlay);
38
- style.setProperty("--color-content-primary", definitions.colors.content.primary);
39
- style.setProperty("--color-content-secondary", definitions.colors.content.secondary);
40
- style.setProperty("--color-content-tertiary", definitions.colors.content.tertiary);
41
- style.setProperty("--color-content-disabled", definitions.colors.content.disabled);
29
+ style.setProperty("--color-content-high", definitions.colors.content.high);
30
+ style.setProperty("--color-content-medium", definitions.colors.content.medium);
31
+ style.setProperty("--color-content-low", definitions.colors.content.low);
32
+ style.setProperty("--color-content-minimal", definitions.colors.content.minimal);
42
33
  style.setProperty("--color-content-inverse", definitions.colors.content.inverse);
43
34
  }
44
35
  }, [theme]);
@@ -11,10 +11,10 @@ const darkColors = {
11
11
  overlay: "#2d2d30"
12
12
  },
13
13
  content: {
14
- primary: "#f8f7f7",
15
- secondary: "#c2bfbc",
16
- tertiary: "#85807a",
17
- disabled: "#5d5955",
14
+ high: "#f8f7f7",
15
+ medium: "#c2bfbc",
16
+ low: "#85807a",
17
+ minimal: "#5d5955",
18
18
  inverse: "#353231"
19
19
  }
20
20
  };
@@ -60,10 +60,10 @@ const colors = {
60
60
  overlay: "var(--color-surface-overlay, #ffffff)"
61
61
  },
62
62
  content: {
63
- primary: "var(--color-content-primary, #353231)",
64
- secondary: "var(--color-content-secondary, #5d5955)",
65
- tertiary: "var(--color-content-tertiary, #85807a)",
66
- disabled: "var(--color-content-disabled, #c2bfbc)",
63
+ high: "var(--color-content-high, #353231)",
64
+ medium: "var(--color-content-medium, #5d5955)",
65
+ low: "var(--color-content-low, #85807a)",
66
+ minimal: "var(--color-content-minimal, #c2bfbc)",
67
67
  inverse: "var(--color-content-inverse, #ffffff)"
68
68
  },
69
69
  error: {
@@ -10,15 +10,5 @@ const updateThemeColors = (theme) => {
10
10
  });
11
11
  });
12
12
  };
13
- const setDarkMode = () => {
14
- const style = document.documentElement.style;
15
- const isDark = style.getPropertyValue("--color-body") !== "#f8f7f7";
16
- if (!isDark) {
17
- style.setProperty("--color-body", "#1e1e1e");
18
- } else {
19
- style.setProperty("--color-body", "#f8f7f7");
20
- }
21
- };
22
13
 
23
- exports.setDarkMode = setDarkMode;
24
14
  exports.updateThemeColors = updateThemeColors;
package/dist/esm/index.js CHANGED
@@ -19,5 +19,5 @@ export { tooltip, tooltipContainer } from './components/tooltip/tooltip.js';
19
19
  export { manager } from './components/manager/manager.js';
20
20
  export { default as preset } from './preset/index.js';
21
21
  export { borderColor, borderRadius, borderWidth, boxShadow, colors, darkColors, fontFamily, fontSize, spacing, textColor, zIndex } from './tokens/definitions.js';
22
- export { setDarkMode, updateThemeColors } from './utils/index.js';
22
+ export { updateThemeColors } from './utils/index.js';
23
23
  export { ThemeProvider, useDarkTheme } from './provider/DarkThemeContext.js';
@@ -13,19 +13,10 @@ const ThemeProvider = ({ children }) => {
13
13
  style.setProperty("--color-surface-base", darkColors.surface.base);
14
14
  style.setProperty("--color-surface-raised", darkColors.surface.raised);
15
15
  style.setProperty("--color-surface-overlay", darkColors.surface.overlay);
16
- style.setProperty("--color-content-primary", darkColors.content.primary);
17
- style.setProperty(
18
- "--color-content-secondary",
19
- darkColors.content.secondary
20
- );
21
- style.setProperty(
22
- "--color-content-tertiary",
23
- darkColors.content.tertiary
24
- );
25
- style.setProperty(
26
- "--color-content-disabled",
27
- darkColors.content.disabled
28
- );
16
+ style.setProperty("--color-content-high", darkColors.content.high);
17
+ style.setProperty("--color-content-medium", darkColors.content.medium);
18
+ style.setProperty("--color-content-low", darkColors.content.low);
19
+ style.setProperty("--color-content-minimal", darkColors.content.minimal);
29
20
  style.setProperty("--color-content-inverse", darkColors.content.inverse);
30
21
  } else {
31
22
  style.setProperty("--color-body", colors.miscellaneous.body);
@@ -33,10 +24,10 @@ const ThemeProvider = ({ children }) => {
33
24
  style.setProperty("--color-surface-base", colors.surface.base);
34
25
  style.setProperty("--color-surface-raised", colors.surface.raised);
35
26
  style.setProperty("--color-surface-overlay", colors.surface.overlay);
36
- style.setProperty("--color-content-primary", colors.content.primary);
37
- style.setProperty("--color-content-secondary", colors.content.secondary);
38
- style.setProperty("--color-content-tertiary", colors.content.tertiary);
39
- style.setProperty("--color-content-disabled", colors.content.disabled);
27
+ style.setProperty("--color-content-high", colors.content.high);
28
+ style.setProperty("--color-content-medium", colors.content.medium);
29
+ style.setProperty("--color-content-low", colors.content.low);
30
+ style.setProperty("--color-content-minimal", colors.content.minimal);
40
31
  style.setProperty("--color-content-inverse", colors.content.inverse);
41
32
  }
42
33
  }, [theme]);
@@ -9,10 +9,10 @@ const darkColors = {
9
9
  overlay: "#2d2d30"
10
10
  },
11
11
  content: {
12
- primary: "#f8f7f7",
13
- secondary: "#c2bfbc",
14
- tertiary: "#85807a",
15
- disabled: "#5d5955",
12
+ high: "#f8f7f7",
13
+ medium: "#c2bfbc",
14
+ low: "#85807a",
15
+ minimal: "#5d5955",
16
16
  inverse: "#353231"
17
17
  }
18
18
  };
@@ -58,10 +58,10 @@ const colors = {
58
58
  overlay: "var(--color-surface-overlay, #ffffff)"
59
59
  },
60
60
  content: {
61
- primary: "var(--color-content-primary, #353231)",
62
- secondary: "var(--color-content-secondary, #5d5955)",
63
- tertiary: "var(--color-content-tertiary, #85807a)",
64
- disabled: "var(--color-content-disabled, #c2bfbc)",
61
+ high: "var(--color-content-high, #353231)",
62
+ medium: "var(--color-content-medium, #5d5955)",
63
+ low: "var(--color-content-low, #85807a)",
64
+ minimal: "var(--color-content-minimal, #c2bfbc)",
65
65
  inverse: "var(--color-content-inverse, #ffffff)"
66
66
  },
67
67
  error: {
@@ -8,14 +8,5 @@ const updateThemeColors = (theme) => {
8
8
  });
9
9
  });
10
10
  };
11
- const setDarkMode = () => {
12
- const style = document.documentElement.style;
13
- const isDark = style.getPropertyValue("--color-body") !== "#f8f7f7";
14
- if (!isDark) {
15
- style.setProperty("--color-body", "#1e1e1e");
16
- } else {
17
- style.setProperty("--color-body", "#f8f7f7");
18
- }
19
- };
20
11
 
21
- export { setDarkMode, updateThemeColors };
12
+ export { updateThemeColors };
@@ -47,10 +47,10 @@ declare const preset: {
47
47
  overlay: string;
48
48
  };
49
49
  content: {
50
- primary: string;
51
- secondary: string;
52
- tertiary: string;
53
- disabled: string;
50
+ high: string;
51
+ medium: string;
52
+ low: string;
53
+ minimal: string;
54
54
  inverse: string;
55
55
  };
56
56
  error: {
@@ -9,10 +9,10 @@ declare const darkColors: {
9
9
  overlay: string;
10
10
  };
11
11
  content: {
12
- primary: string;
13
- secondary: string;
14
- tertiary: string;
15
- disabled: string;
12
+ high: string;
13
+ medium: string;
14
+ low: string;
15
+ minimal: string;
16
16
  inverse: string;
17
17
  };
18
18
  };
@@ -58,10 +58,10 @@ declare const colors: {
58
58
  overlay: string;
59
59
  };
60
60
  content: {
61
- primary: string;
62
- secondary: string;
63
- tertiary: string;
64
- disabled: string;
61
+ high: string;
62
+ medium: string;
63
+ low: string;
64
+ minimal: string;
65
65
  inverse: string;
66
66
  };
67
67
  error: {
@@ -1,3 +1,2 @@
1
1
  import { colors } from '../tokens/definitions';
2
2
  export declare const updateThemeColors: (theme: Partial<typeof colors>) => void;
3
- export declare const setDarkMode: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tecsinapse/cortex-core",
3
- "version": "1.3.0-beta.3",
3
+ "version": "1.3.0-beta.4",
4
4
  "license": "MIT",
5
5
  "description": "Core library for tailwindcss based design",
6
6
  "main": "dist/esm/index.js",
@@ -31,5 +31,5 @@
31
31
  "peerDependencies": {
32
32
  "tailwindcss": ">=3.3.0"
33
33
  },
34
- "gitHead": "f13be73645bde5042aeb082331dc6c6d80fb506e"
34
+ "gitHead": "b874e5cbb323a24981bb9d6e2e1f1d2ccf454b0a"
35
35
  }