@tecsinapse/cortex-core 2.0.2-beta.0 → 2.0.2-beta.2

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.
@@ -3,7 +3,7 @@
3
3
  var tailwindVariants = require('tailwind-variants');
4
4
 
5
5
  const buttonStyles = tailwindVariants.tv({
6
- base: "text-base h-fit font-bold disabled:text-white enabled:active:scale-95 transform transition hover:text-white text-white cursor-pointer items-center flex justify-center",
6
+ base: "text-base h-fit font-bold disabled:text-light enabled:active:scale-95 transform transition hover:text-light text-light cursor-pointer items-center flex justify-center",
7
7
  variants: {
8
8
  intent: {
9
9
  primary: "bg-primary-medium disabled:bg-primary-light active:bg-primary-dark enabled:hover:border-primary-dark hover:bg-primary-dark",
@@ -15,7 +15,7 @@ const tagStyles = myTV({
15
15
  base: "rounded-micro px-micro py-nano w-fit font-bold text-label items-center flex gap-1",
16
16
  variants: {
17
17
  intent: {
18
- primary: "bg-primary-medium text-white",
18
+ primary: "bg-primary-medium text-light",
19
19
  secondary: "bg-secondary-medium text-white",
20
20
  info: "bg-info-medium text-white",
21
21
  success: "bg-success-medium text-white",
@@ -153,9 +153,9 @@ const fontFamily = {
153
153
  mono: "Consolas, monaco, monospace"
154
154
  };
155
155
  const textColor = {
156
- light: "#fff",
157
- medium: "#85807a",
158
- dark: "#353231",
156
+ light: "var(--color-text-light, #fff)",
157
+ medium: "var(--color-text-medium, #85807a)",
158
+ dark: "var(--color-text-dark, #353231)",
159
159
  orange: "#f89907"
160
160
  };
161
161
  const zIndex = {
@@ -9,13 +9,11 @@ const updateThemeColors = (theme) => {
9
9
  Object.entries(colorShades).forEach(([shade, hexValue]) => {
10
10
  if (!hexValue) return;
11
11
  root.style.setProperty(`--color-${colorName}-${shade}`, hexValue);
12
- (shade !== "xlight" && shade !== "xdark" && polished.getContrast(
13
- root.style.getPropertyValue(`--color-text-${shade}`),
14
- hexValue
15
- ) < 4.5) ?? root.style.setProperty(
16
- `--color-text-${shade}`,
17
- polished.readableColor(hexValue)
18
- );
12
+ if (colorName === "primary" && shade === "medium") {
13
+ if (polished.getContrast(hexValue, "#fff") < 4.5) {
14
+ root.style.setProperty("--color-text-light", polished.readableColor(hexValue));
15
+ }
16
+ }
19
17
  });
20
18
  });
21
19
  };
@@ -1,7 +1,7 @@
1
1
  import { tv } from 'tailwind-variants';
2
2
 
3
3
  const buttonStyles = tv({
4
- base: "text-base h-fit font-bold disabled:text-white enabled:active:scale-95 transform transition hover:text-white text-white cursor-pointer items-center flex justify-center",
4
+ base: "text-base h-fit font-bold disabled:text-light enabled:active:scale-95 transform transition hover:text-light text-light cursor-pointer items-center flex justify-center",
5
5
  variants: {
6
6
  intent: {
7
7
  primary: "bg-primary-medium disabled:bg-primary-light active:bg-primary-dark enabled:hover:border-primary-dark hover:bg-primary-dark",
@@ -13,7 +13,7 @@ const tagStyles = myTV({
13
13
  base: "rounded-micro px-micro py-nano w-fit font-bold text-label items-center flex gap-1",
14
14
  variants: {
15
15
  intent: {
16
- primary: "bg-primary-medium text-white",
16
+ primary: "bg-primary-medium text-light",
17
17
  secondary: "bg-secondary-medium text-white",
18
18
  info: "bg-info-medium text-white",
19
19
  success: "bg-success-medium text-white",
@@ -151,9 +151,9 @@ const fontFamily = {
151
151
  mono: "Consolas, monaco, monospace"
152
152
  };
153
153
  const textColor = {
154
- light: "#fff",
155
- medium: "#85807a",
156
- dark: "#353231",
154
+ light: "var(--color-text-light, #fff)",
155
+ medium: "var(--color-text-medium, #85807a)",
156
+ dark: "var(--color-text-dark, #353231)",
157
157
  orange: "#f89907"
158
158
  };
159
159
  const zIndex = {
@@ -7,13 +7,11 @@ const updateThemeColors = (theme) => {
7
7
  Object.entries(colorShades).forEach(([shade, hexValue]) => {
8
8
  if (!hexValue) return;
9
9
  root.style.setProperty(`--color-${colorName}-${shade}`, hexValue);
10
- (shade !== "xlight" && shade !== "xdark" && getContrast(
11
- root.style.getPropertyValue(`--color-text-${shade}`),
12
- hexValue
13
- ) < 4.5) ?? root.style.setProperty(
14
- `--color-text-${shade}`,
15
- readableColor(hexValue)
16
- );
10
+ if (colorName === "primary" && shade === "medium") {
11
+ if (getContrast(hexValue, "#fff") < 4.5) {
12
+ root.style.setProperty("--color-text-light", readableColor(hexValue));
13
+ }
14
+ }
17
15
  });
18
16
  });
19
17
  };
@@ -20,7 +20,7 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
20
20
  circle: string;
21
21
  base: string;
22
22
  };
23
- }, undefined, "text-base h-fit font-bold disabled:text-white enabled:active:scale-95 transform transition hover:text-white text-white cursor-pointer items-center flex justify-center", {
23
+ }, undefined, "text-base h-fit font-bold disabled:text-light enabled:active:scale-95 transform transition hover:text-light text-light cursor-pointer items-center flex justify-center", {
24
24
  intent: {
25
25
  primary: string;
26
26
  secondary: string;
@@ -62,7 +62,7 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
62
62
  circle: string;
63
63
  base: string;
64
64
  };
65
- }, undefined, "text-base h-fit font-bold disabled:text-white enabled:active:scale-95 transform transition hover:text-white text-white cursor-pointer items-center flex justify-center", unknown, unknown, undefined>>;
65
+ }, undefined, "text-base h-fit font-bold disabled:text-light enabled:active:scale-95 transform transition hover:text-light text-light cursor-pointer items-center flex justify-center", unknown, unknown, undefined>>;
66
66
  export type ButtonVariants = VariantProps<typeof buttonStyles> & {
67
67
  className?: string;
68
68
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tecsinapse/cortex-core",
3
- "version": "2.0.2-beta.0",
3
+ "version": "2.0.2-beta.2",
4
4
  "license": "MIT",
5
5
  "description": "Core library for tailwindcss based design",
6
6
  "main": "dist/esm/index.js",
@@ -35,5 +35,5 @@
35
35
  "peerDependencies": {
36
36
  "tailwindcss": "^4.1.16"
37
37
  },
38
- "gitHead": "b324924bd1777951d5ffd6a131b7b5d832dc1ca9"
38
+ "gitHead": "206d1de1e16b2cc748feff799ab53fc3306248f3"
39
39
  }