@tecsinapse/cortex-core 1.1.0 → 1.1.2-beta.0
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/components/common/common.js +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/tokens/definitions.js +10 -10
- package/dist/cjs/utils/index.js +14 -0
- package/dist/esm/components/common/common.js +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/tokens/definitions.js +10 -10
- package/dist/esm/utils/index.js +12 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +12 -0
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ const overlay = tailwindVariants.tv({
|
|
|
6
6
|
base: "fixed",
|
|
7
7
|
variants: {
|
|
8
8
|
show: {
|
|
9
|
-
true: "
|
|
9
|
+
true: "z-backdrop bg-black/50 h-full w-full left-0 top-0 transition cursor-pointer",
|
|
10
10
|
false: "invisible"
|
|
11
11
|
}
|
|
12
12
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var toggle = require('./components/toggle/toggle.js');
|
|
|
20
20
|
var tooltip = require('./components/tooltip/tooltip.js');
|
|
21
21
|
var index = require('./preset/index.js');
|
|
22
22
|
var definitions = require('./tokens/definitions.js');
|
|
23
|
+
var index$1 = require('./utils/index.js');
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
|
|
@@ -70,3 +71,4 @@ exports.fontSize = definitions.fontSize;
|
|
|
70
71
|
exports.spacing = definitions.spacing;
|
|
71
72
|
exports.textColor = definitions.textColor;
|
|
72
73
|
exports.zIndex = definitions.zIndex;
|
|
74
|
+
exports.updateThemeColors = index$1.updateThemeColors;
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
const colors = {
|
|
4
4
|
primary: {
|
|
5
|
-
xlight: "#fef9f0",
|
|
6
|
-
light: "#fccb83",
|
|
7
|
-
medium: "#f89907",
|
|
8
|
-
dark: "#ae6b05",
|
|
9
|
-
xdark: "#633d03"
|
|
5
|
+
xlight: "var(--color-primary-xlight, #fef9f0)",
|
|
6
|
+
light: "var(--color-primary-light, #fccb83)",
|
|
7
|
+
medium: "var(--color-primary-medium, #f89907)",
|
|
8
|
+
dark: "var(--color-primary-dark, #ae6b05)",
|
|
9
|
+
xdark: "var(--color-primary-xdark, #633d03)"
|
|
10
10
|
},
|
|
11
11
|
secondary: {
|
|
12
|
-
xlight: "#f8f7f7",
|
|
13
|
-
light: "#c2bfbc",
|
|
14
|
-
medium: "#85807a",
|
|
15
|
-
dark: "#5d5955",
|
|
16
|
-
xdark: "#353231"
|
|
12
|
+
xlight: "var(--color-secondary-xlight, #f8f7f7)",
|
|
13
|
+
light: "var(--color-secondary-light, #c2bfbc)",
|
|
14
|
+
medium: "var(--color-secondary-medium, #85807a)",
|
|
15
|
+
dark: "var(--color-secondary-dark, #5d5955)",
|
|
16
|
+
xdark: "var(--color-secondary-xdark, #353231)"
|
|
17
17
|
},
|
|
18
18
|
info: {
|
|
19
19
|
xlight: "#f0f8fe",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const updateThemeColors = (theme) => {
|
|
4
|
+
const root = document.documentElement;
|
|
5
|
+
Object.entries(theme).forEach(([colorName, colorShades]) => {
|
|
6
|
+
if (!colorShades) return;
|
|
7
|
+
Object.entries(colorShades).forEach(([shade, hexValue]) => {
|
|
8
|
+
if (!hexValue) return;
|
|
9
|
+
root.style.setProperty(`--color-${colorName}-${shade}`, hexValue);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.updateThemeColors = updateThemeColors;
|
|
@@ -4,7 +4,7 @@ const overlay = tv({
|
|
|
4
4
|
base: "fixed",
|
|
5
5
|
variants: {
|
|
6
6
|
show: {
|
|
7
|
-
true: "
|
|
7
|
+
true: "z-backdrop bg-black/50 h-full w-full left-0 top-0 transition cursor-pointer",
|
|
8
8
|
false: "invisible"
|
|
9
9
|
}
|
|
10
10
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -18,3 +18,4 @@ export { styleInputElement, styleLabelElement, toggle } from './components/toggl
|
|
|
18
18
|
export { tooltip, tooltipContainer } from './components/tooltip/tooltip.js';
|
|
19
19
|
export { default as preset } from './preset/index.js';
|
|
20
20
|
export { borderColor, borderRadius, borderWidth, boxShadow, colors, fontFamily, fontSize, spacing, textColor, zIndex } from './tokens/definitions.js';
|
|
21
|
+
export { updateThemeColors } from './utils/index.js';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const colors = {
|
|
2
2
|
primary: {
|
|
3
|
-
xlight: "#fef9f0",
|
|
4
|
-
light: "#fccb83",
|
|
5
|
-
medium: "#f89907",
|
|
6
|
-
dark: "#ae6b05",
|
|
7
|
-
xdark: "#633d03"
|
|
3
|
+
xlight: "var(--color-primary-xlight, #fef9f0)",
|
|
4
|
+
light: "var(--color-primary-light, #fccb83)",
|
|
5
|
+
medium: "var(--color-primary-medium, #f89907)",
|
|
6
|
+
dark: "var(--color-primary-dark, #ae6b05)",
|
|
7
|
+
xdark: "var(--color-primary-xdark, #633d03)"
|
|
8
8
|
},
|
|
9
9
|
secondary: {
|
|
10
|
-
xlight: "#f8f7f7",
|
|
11
|
-
light: "#c2bfbc",
|
|
12
|
-
medium: "#85807a",
|
|
13
|
-
dark: "#5d5955",
|
|
14
|
-
xdark: "#353231"
|
|
10
|
+
xlight: "var(--color-secondary-xlight, #f8f7f7)",
|
|
11
|
+
light: "var(--color-secondary-light, #c2bfbc)",
|
|
12
|
+
medium: "var(--color-secondary-medium, #85807a)",
|
|
13
|
+
dark: "var(--color-secondary-dark, #5d5955)",
|
|
14
|
+
xdark: "var(--color-secondary-xdark, #353231)"
|
|
15
15
|
},
|
|
16
16
|
info: {
|
|
17
17
|
xlight: "#f0f8fe",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const updateThemeColors = (theme) => {
|
|
2
|
+
const root = document.documentElement;
|
|
3
|
+
Object.entries(theme).forEach(([colorName, colorShades]) => {
|
|
4
|
+
if (!colorShades) return;
|
|
5
|
+
Object.entries(colorShades).forEach(([shade, hexValue]) => {
|
|
6
|
+
if (!hexValue) return;
|
|
7
|
+
root.style.setProperty(`--color-${colorName}-${shade}`, hexValue);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { updateThemeColors };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ColorShade {
|
|
2
|
+
xlight: string;
|
|
3
|
+
light: string;
|
|
4
|
+
medium: string;
|
|
5
|
+
dark: string;
|
|
6
|
+
xdark: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ThemeColors {
|
|
9
|
+
primary: ColorShade;
|
|
10
|
+
secondary: ColorShade;
|
|
11
|
+
}
|
|
12
|
+
export declare const updateThemeColors: (theme: Partial<ThemeColors>) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-core",
|
|
3
|
-
"version": "1.1.0",
|
|
3
|
+
"version": "1.1.2-beta.0",
|
|
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": "607a4dd151aa82ea6f6a01d3c99692d1bbe047f5"
|
|
35
35
|
}
|