@tecsinapse/cortex-core 1.2.0-beta.9 → 1.2.1-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.
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var tailwindVariants = require('tailwind-variants');
4
+
5
+ const manager = tailwindVariants.tv({
6
+ base: "fixed rounded-micro p-deca bg-white shadow-xl flex transition bottom-deca right-deca z-modal",
7
+ variants: {
8
+ open: {
9
+ true: "scale-100 visible",
10
+ false: "invisible"
11
+ }
12
+ }
13
+ });
14
+
15
+ exports.manager = manager;
package/dist/cjs/index.js CHANGED
@@ -18,8 +18,10 @@ var table = require('./components/table/table.js');
18
18
  var tag = require('./components/tag/tag.js');
19
19
  var toggle = require('./components/toggle/toggle.js');
20
20
  var tooltip = require('./components/tooltip/tooltip.js');
21
+ var manager = require('./components/manager/manager.js');
22
+ var index = require('./preset/index.js');
21
23
  var definitions = require('./tokens/definitions.js');
22
- var index = require('./utils/index.js');
24
+ var index$1 = require('./utils/index.js');
23
25
 
24
26
 
25
27
 
@@ -59,6 +61,8 @@ exports.styleLabelElement = toggle.styleLabelElement;
59
61
  exports.toggle = toggle.toggle;
60
62
  exports.tooltip = tooltip.tooltip;
61
63
  exports.tooltipContainer = tooltip.tooltipContainer;
64
+ exports.manager = manager.manager;
65
+ exports.preset = index;
62
66
  exports.borderColor = definitions.borderColor;
63
67
  exports.borderRadius = definitions.borderRadius;
64
68
  exports.borderWidth = definitions.borderWidth;
@@ -69,4 +73,4 @@ exports.fontSize = definitions.fontSize;
69
73
  exports.spacing = definitions.spacing;
70
74
  exports.textColor = definitions.textColor;
71
75
  exports.zIndex = definitions.zIndex;
72
- exports.updateThemeColors = index.updateThemeColors;
76
+ exports.updateThemeColors = index$1.updateThemeColors;
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var definitions = require('../tokens/definitions.js');
4
+
5
+ const preset = {
6
+ theme: {
7
+ fontFamily: definitions.fontFamily,
8
+ extend: {
9
+ colors: definitions.colors,
10
+ textColor: definitions.textColor,
11
+ spacing: definitions.spacing,
12
+ borderRadius: definitions.borderRadius,
13
+ borderWidth: definitions.borderWidth,
14
+ fontSize: definitions.fontSize,
15
+ boxShadow: definitions.boxShadow,
16
+ borderColor: definitions.borderColor,
17
+ zIndex: definitions.zIndex,
18
+ keyframes: {
19
+ opacity: {
20
+ "0%": { opacity: 0 },
21
+ "100%": { opacity: 1 }
22
+ },
23
+ progress: {
24
+ "0%": { transform: "translateX(0) scaleX(0)" },
25
+ "40%": { transform: "translateX(0) scaleX(0.4)" },
26
+ "100%": { transform: "translateX(100%) scaleX(0.5)" }
27
+ }
28
+ },
29
+ animation: {
30
+ opacity: "opacity 1s ease-in-out",
31
+ progress: "progress 1s infinite linear"
32
+ },
33
+ transformOrigin: {
34
+ "left-right": "0% 50%"
35
+ }
36
+ }
37
+ }
38
+ };
39
+
40
+ module.exports = preset;
@@ -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 = {
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ var polished = require('polished');
4
+
3
5
  const updateThemeColors = (theme) => {
4
6
  const root = document.documentElement;
5
7
  Object.entries(theme).forEach(([colorName, colorShades]) => {
@@ -7,6 +9,15 @@ const updateThemeColors = (theme) => {
7
9
  Object.entries(colorShades).forEach(([shade, hexValue]) => {
8
10
  if (!hexValue) return;
9
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
+ );
20
+ }
10
21
  });
11
22
  });
12
23
  };
@@ -0,0 +1,13 @@
1
+ import { tv } from 'tailwind-variants';
2
+
3
+ const manager = tv({
4
+ base: "fixed rounded-micro p-deca bg-white shadow-xl flex transition bottom-deca right-deca z-modal",
5
+ variants: {
6
+ open: {
7
+ true: "scale-100 visible",
8
+ false: "invisible"
9
+ }
10
+ }
11
+ });
12
+
13
+ export { manager };
package/dist/esm/index.js CHANGED
@@ -16,5 +16,7 @@ export { hr, tCell, tFoot, tHead, tHeadCell, tRoot, tRow } from './components/ta
16
16
  export { tag } from './components/tag/tag.js';
17
17
  export { styleInputElement, styleLabelElement, toggle } from './components/toggle/toggle.js';
18
18
  export { tooltip, tooltipContainer } from './components/tooltip/tooltip.js';
19
+ export { manager } from './components/manager/manager.js';
20
+ export { default as preset } from './preset/index.js';
19
21
  export { borderColor, borderRadius, borderWidth, boxShadow, colors, fontFamily, fontSize, spacing, textColor, zIndex } from './tokens/definitions.js';
20
22
  export { updateThemeColors } from './utils/index.js';
@@ -0,0 +1,38 @@
1
+ import { fontFamily, colors, textColor, spacing, borderRadius, borderWidth, fontSize, boxShadow, borderColor, zIndex } from '../tokens/definitions.js';
2
+
3
+ const preset = {
4
+ theme: {
5
+ fontFamily,
6
+ extend: {
7
+ colors,
8
+ textColor,
9
+ spacing,
10
+ borderRadius,
11
+ borderWidth,
12
+ fontSize,
13
+ boxShadow,
14
+ borderColor,
15
+ zIndex,
16
+ keyframes: {
17
+ opacity: {
18
+ "0%": { opacity: 0 },
19
+ "100%": { opacity: 1 }
20
+ },
21
+ progress: {
22
+ "0%": { transform: "translateX(0) scaleX(0)" },
23
+ "40%": { transform: "translateX(0) scaleX(0.4)" },
24
+ "100%": { transform: "translateX(100%) scaleX(0.5)" }
25
+ }
26
+ },
27
+ animation: {
28
+ opacity: "opacity 1s ease-in-out",
29
+ progress: "progress 1s infinite linear"
30
+ },
31
+ transformOrigin: {
32
+ "left-right": "0% 50%"
33
+ }
34
+ }
35
+ }
36
+ };
37
+
38
+ export { preset as default };
@@ -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 = {
@@ -1,3 +1,5 @@
1
+ import { getContrast, readableColor } from 'polished';
2
+
1
3
  const updateThemeColors = (theme) => {
2
4
  const root = document.documentElement;
3
5
  Object.entries(theme).forEach(([colorName, colorShades]) => {
@@ -5,6 +7,15 @@ const updateThemeColors = (theme) => {
5
7
  Object.entries(colorShades).forEach(([shade, hexValue]) => {
6
8
  if (!hexValue) return;
7
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
+ );
18
+ }
8
19
  });
9
20
  });
10
21
  };
@@ -16,3 +16,4 @@ export * from './table/table';
16
16
  export * from './tag/tag';
17
17
  export * from './toggle/toggle';
18
18
  export * from './tooltip/tooltip';
19
+ export * from './manager/manager';
@@ -0,0 +1,16 @@
1
+ export declare const manager: import("tailwind-variants").TVReturnType<{
2
+ open: {
3
+ true: string;
4
+ false: string;
5
+ };
6
+ }, undefined, "fixed rounded-micro p-deca bg-white shadow-xl flex transition bottom-deca right-deca z-modal", {
7
+ open: {
8
+ true: string;
9
+ false: string;
10
+ };
11
+ }, undefined, import("tailwind-variants").TVReturnType<{
12
+ open: {
13
+ true: string;
14
+ false: string;
15
+ };
16
+ }, undefined, "fixed rounded-micro p-deca bg-white shadow-xl flex transition bottom-deca right-deca z-modal", unknown, unknown, undefined>>;
@@ -1,3 +1,4 @@
1
1
  export * from './components';
2
+ export { default as preset } from './preset';
2
3
  export * from './tokens/definitions';
3
4
  export * from './utils';
@@ -0,0 +1,152 @@
1
+ declare const preset: {
2
+ theme: {
3
+ fontFamily: {
4
+ sans: string[];
5
+ mono: string;
6
+ };
7
+ extend: {
8
+ colors: {
9
+ primary: {
10
+ xlight: string;
11
+ light: string;
12
+ medium: string;
13
+ dark: string;
14
+ xdark: string;
15
+ };
16
+ secondary: {
17
+ xlight: string;
18
+ light: string;
19
+ medium: string;
20
+ dark: string;
21
+ xdark: string;
22
+ };
23
+ info: {
24
+ xlight: string;
25
+ light: string;
26
+ medium: string;
27
+ dark: string;
28
+ xdark: string;
29
+ };
30
+ success: {
31
+ xlight: string;
32
+ light: string;
33
+ medium: string;
34
+ dark: string;
35
+ xdark: string;
36
+ };
37
+ warning: {
38
+ xlight: string;
39
+ light: string;
40
+ medium: string;
41
+ dark: string;
42
+ xdark: string;
43
+ };
44
+ error: {
45
+ xlight: string;
46
+ light: string;
47
+ medium: string;
48
+ dark: string;
49
+ xdark: string;
50
+ };
51
+ miscellaneous: {
52
+ body: string;
53
+ };
54
+ };
55
+ textColor: {
56
+ light: string;
57
+ medium: string;
58
+ dark: string;
59
+ orange: string;
60
+ };
61
+ spacing: {
62
+ nano: string;
63
+ micro: string;
64
+ mili: string;
65
+ centi: string;
66
+ deca: string;
67
+ kilo: string;
68
+ mega: string;
69
+ giga: string;
70
+ tera: string;
71
+ peta: string;
72
+ hexa: string;
73
+ };
74
+ borderRadius: {
75
+ nano: string;
76
+ micro: string;
77
+ mili: string;
78
+ centi: string;
79
+ deca: string;
80
+ pill: string;
81
+ };
82
+ borderWidth: {
83
+ pico: string;
84
+ nano: string;
85
+ };
86
+ fontSize: {
87
+ h5: string[];
88
+ h4: string[];
89
+ h3: string[];
90
+ h2: string[];
91
+ h1: string[];
92
+ base: string[];
93
+ sub: string[];
94
+ label: string[];
95
+ micro: string;
96
+ mili: string;
97
+ centi: string;
98
+ deca: string;
99
+ kilo: string;
100
+ mega: string;
101
+ };
102
+ boxShadow: {
103
+ default: string;
104
+ };
105
+ borderColor: {
106
+ 'success-light': string;
107
+ };
108
+ zIndex: {
109
+ default: number;
110
+ absolute: number;
111
+ select: number;
112
+ input: number;
113
+ popover: number;
114
+ tooltip: number;
115
+ header: number;
116
+ backdrop: number;
117
+ drawer: number;
118
+ sidebar: number;
119
+ modal: number;
120
+ };
121
+ keyframes: {
122
+ opacity: {
123
+ '0%': {
124
+ opacity: number;
125
+ };
126
+ '100%': {
127
+ opacity: number;
128
+ };
129
+ };
130
+ progress: {
131
+ '0%': {
132
+ transform: string;
133
+ };
134
+ '40%': {
135
+ transform: string;
136
+ };
137
+ '100%': {
138
+ transform: string;
139
+ };
140
+ };
141
+ };
142
+ animation: {
143
+ opacity: string;
144
+ progress: string;
145
+ };
146
+ transformOrigin: {
147
+ 'left-right': string;
148
+ };
149
+ };
150
+ };
151
+ };
152
+ export default preset;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tecsinapse/cortex-core",
3
- "version": "1.2.0-beta.9",
3
+ "version": "1.2.1-beta.0",
4
4
  "license": "MIT",
5
5
  "description": "Core library for tailwindcss based design",
6
6
  "main": "dist/esm/index.js",
@@ -17,11 +17,9 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "clsx": "2.1.1",
20
+ "polished": "^4.3.1",
20
21
  "tailwind-variants": "1.0.0"
21
22
  },
22
- "devDependencies": {
23
- "rollup-plugin-copy": "^3.4.0"
24
- },
25
23
  "repository": {
26
24
  "type": "git",
27
25
  "directory": "packages/cortex-core",
@@ -34,5 +32,5 @@
34
32
  "peerDependencies": {
35
33
  "tailwindcss": ">=3.3.0"
36
34
  },
37
- "gitHead": "b7e6698f18e533fa52aa672c4cad4ec9b140751b"
35
+ "gitHead": "5d1fe44b137a1f5f68fca9fc1fc5e6b842be1b23"
38
36
  }
package/dist/default.css DELETED
@@ -1,93 +0,0 @@
1
- @theme {
2
- --color-primary-xlight: #fef9f0;
3
- --color-primary-light: #fccb83;
4
- --color-primary-medium: #f89907;
5
- --color-primary-dark: #ae6b05;
6
- --color-primary-xdark: #633d03;
7
- --color-secondary-xlight: #f8f7f7;
8
- --color-secondary-light: #c2bfbc;
9
- --color-secondary-medium: #85807a;
10
- --color-secondary-dark: #5d5955;
11
- --color-secondary-xdark: #353231;
12
- --color-info-xlight: #f0f8fe;
13
- --color-info-light: #85c7fa;
14
- --color-info-medium: #239bf6;
15
- --color-info-dark: #0873c4;
16
- --color-info-xdark: #043962;
17
- --color-success-xlight: #f3fcf8;
18
- --color-success-light: #99e6c9;
19
- --color-success-medium: #2db783;
20
- --color-success-dark: #238f67;
21
- --color-success-xdark: #14523b;
22
- --color-warning-xlight: #fffcf0;
23
- --color-warning-light: #ffe380;
24
- --color-warning-medium: #ffc700;
25
- --color-warning-dark: #cc9f00;
26
- --color-warning-xdark: #665000;
27
- --color-error-xlight: #fdf3f2;
28
- --color-error-light: #ee9891;
29
- --color-error-medium: #e04638;
30
- --color-error-dark: #9b2318;
31
- --color-error-xdark: #58240e;
32
- --color-miscellaneous-body: #f8f7f7;
33
- --spacing-nano: 0.125rem;
34
- --spacing-micro: 0.25rem;
35
- --spacing-mili: 0.5rem;
36
- --spacing-centi: 0.75rem;
37
- --spacing-deca: 1rem;
38
- --spacing-kilo: 1.5rem;
39
- --spacing-mega: 2rem;
40
- --spacing-giga: 2.5rem;
41
- --spacing-tera: 3rem;
42
- --spacing-peta: 3.5rem;
43
- --spacing-hexa: 4rem;
44
- --border-radius-nano: 0.125rem;
45
- --border-radius-micro: 0.25rem;
46
- --border-radius-mili: 0.5rem;
47
- --border-radius-centi: 1rem;
48
- --border-radius-deca: 1.5rem;
49
- --border-radius-pill: 999999px;
50
- --border-width-pico: 0.063rem;
51
- --border-width-nano: 0.125rem;
52
- --font-size-h5: 1rem;
53
- --line-height-h5: 1.5rem;
54
- --font-size-h4: 1.125rem;
55
- --line-height-h4: 1.688rem;
56
- --font-size-h3: 1.25rem;
57
- --line-height-h3: 2rem;
58
- --font-size-h2: 1.625rem;
59
- --line-height-h2: 2.375rem;
60
- --font-size-h1: 2rem;
61
- --line-height-h1: 2.625rem;
62
- --font-size-base: 0.875rem;
63
- --line-height-base: 1.313rem;
64
- --font-size-sub: 0.75rem;
65
- --line-height-sub: 1.125rem;
66
- --font-size-label: 0.625rem;
67
- --line-height-label: 0.75rem;
68
- --font-size-micro: 0.75rem;
69
- --font-size-mili: 0.875rem;
70
- --font-size-centi: 1rem;
71
- --font-size-deca: 1.125rem;
72
- --font-size-kilo: 1.5rem;
73
- --font-size-mega: 2rem;
74
- --box-shadow-default: 0 2px 8px rgba(0, 0, 0, 0.05);
75
- --border-color-success-light: #99E6C9;
76
- --font-family-sans: Lato, system-ui, -apple-system, BlinkMacSystemFont, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
77
- --font-family-mono: Consolas, monaco, monospace;
78
- --text-color-light: #fff;
79
- --text-color-medium: #85807a;
80
- --text-color-dark: #353231;
81
- --text-color-orange: #f89907;
82
- --z-index-default: 0;
83
- --z-index-absolute: 1;
84
- --z-index-select: 20;
85
- --z-index-input: 20;
86
- --z-index-popover: 30;
87
- --z-index-tooltip: 40;
88
- --z-index-header: 600;
89
- --z-index-backdrop: 700;
90
- --z-index-drawer: 700;
91
- --z-index-sidebar: 800;
92
- --z-index-modal: 1000;
93
- }