@tecsinapse/cortex-core 2.0.2-beta.1 → 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",
@@ -9,14 +9,10 @@ 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
- if (shade !== "xlight" && shade !== "xdark" && polished.getContrast(
13
- root.style.getPropertyValue(`--color-text-${shade}`),
14
- hexValue
15
- ) < 4.5) {
16
- root.style.setProperty(
17
- `--color-text-${shade}`,
18
- polished.readableColor(hexValue)
19
- );
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
+ }
20
16
  }
21
17
  });
22
18
  });
@@ -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",
@@ -7,14 +7,10 @@ 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
- if (shade !== "xlight" && shade !== "xdark" && getContrast(
11
- root.style.getPropertyValue(`--color-text-${shade}`),
12
- hexValue
13
- ) < 4.5) {
14
- root.style.setProperty(
15
- `--color-text-${shade}`,
16
- readableColor(hexValue)
17
- );
10
+ if (colorName === "primary" && shade === "medium") {
11
+ if (getContrast(hexValue, "#fff") < 4.5) {
12
+ root.style.setProperty("--color-text-light", readableColor(hexValue));
13
+ }
18
14
  }
19
15
  });
20
16
  });
@@ -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.1",
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": "7312335a32c082dd8cf3b264bae6cda03678f5f1"
38
+ "gitHead": "206d1de1e16b2cc748feff799ab53fc3306248f3"
39
39
  }