@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 +0 -1
- package/dist/cjs/provider/DarkThemeContext.js +8 -17
- package/dist/cjs/tokens/definitions.js +8 -8
- package/dist/cjs/utils/index.js +0 -10
- package/dist/esm/index.js +1 -1
- package/dist/esm/provider/DarkThemeContext.js +8 -17
- package/dist/esm/tokens/definitions.js +8 -8
- package/dist/esm/utils/index.js +1 -10
- package/dist/types/preset/index.d.ts +4 -4
- package/dist/types/tokens/definitions.d.ts +8 -8
- package/dist/types/utils/index.d.ts +0 -1
- package/package.json +2 -2
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-
|
|
19
|
-
style.setProperty(
|
|
20
|
-
|
|
21
|
-
|
|
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-
|
|
39
|
-
style.setProperty("--color-content-
|
|
40
|
-
style.setProperty("--color-content-
|
|
41
|
-
style.setProperty("--color-content-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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: {
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -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 {
|
|
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-
|
|
17
|
-
style.setProperty(
|
|
18
|
-
|
|
19
|
-
|
|
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-
|
|
37
|
-
style.setProperty("--color-content-
|
|
38
|
-
style.setProperty("--color-content-
|
|
39
|
-
style.setProperty("--color-content-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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: {
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -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 {
|
|
12
|
+
export { updateThemeColors };
|
|
@@ -47,10 +47,10 @@ declare const preset: {
|
|
|
47
47
|
overlay: string;
|
|
48
48
|
};
|
|
49
49
|
content: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
high: string;
|
|
62
|
+
medium: string;
|
|
63
|
+
low: string;
|
|
64
|
+
minimal: string;
|
|
65
65
|
inverse: string;
|
|
66
66
|
};
|
|
67
67
|
error: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-core",
|
|
3
|
-
"version": "1.3.0-beta.
|
|
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": "
|
|
34
|
+
"gitHead": "b874e5cbb323a24981bb9d6e2e1f1d2ccf454b0a"
|
|
35
35
|
}
|