anubis-ui 1.3.1 → 1.4.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.
Files changed (60) hide show
  1. package/README.md +96 -27
  2. package/dist/interfaces/color.interface.d.ts +8 -0
  3. package/dist/interfaces/color.interface.js +2 -0
  4. package/{src/interfaces/config.interface.ts → dist/interfaces/config.interface.d.ts} +0 -3
  5. package/dist/interfaces/config.interface.js +2 -0
  6. package/dist/interfaces/files.interface.d.ts +4 -0
  7. package/dist/interfaces/files.interface.js +2 -0
  8. package/{src/interfaces/preset.interface.ts → dist/interfaces/preset.interface.d.ts} +3 -7
  9. package/dist/interfaces/preset.interface.js +2 -0
  10. package/dist/tools/config.tool.d.ts +4 -0
  11. package/dist/tools/config.tool.js +64 -0
  12. package/dist/tools/extraction/extractClasses.d.ts +5 -0
  13. package/dist/tools/extraction/extractClasses.js +134 -0
  14. package/dist/tools/fileStuff/config.file.d.ts +5 -0
  15. package/dist/tools/fileStuff/config.file.js +41 -0
  16. package/dist/tools/fileStuff/file.tools.d.ts +19 -0
  17. package/dist/tools/fileStuff/file.tools.js +88 -0
  18. package/dist/tools/fileStuff/quasar-variables.file.d.ts +1 -0
  19. package/dist/tools/fileStuff/quasar-variables.file.js +12 -0
  20. package/dist/tools/logger.d.ts +5 -0
  21. package/dist/tools/logger.js +27 -0
  22. package/dist/tools/main.d.ts +1 -0
  23. package/dist/tools/main.js +54 -0
  24. package/dist/tools/mapping/mapClassIntoRule.d.ts +5 -0
  25. package/dist/tools/mapping/mapClassIntoRule.js +256 -0
  26. package/dist/tools/mapping/mapColors.d.ts +3 -0
  27. package/dist/tools/mapping/mapColors.js +18 -0
  28. package/dist/tools/mapping/mapUtilities.d.ts +1 -0
  29. package/dist/tools/mapping/mapUtilities.js +17 -0
  30. package/dist/tools/output/css.output.d.ts +11 -0
  31. package/dist/tools/output/css.output.js +118 -0
  32. package/dist/tools/validation/color.validation.d.ts +12 -0
  33. package/{src/tools/validation/color.validation.ts → dist/tools/validation/color.validation.js} +14 -31
  34. package/dist/version.d.ts +5 -0
  35. package/dist/version.js +7 -0
  36. package/index.js +5 -18
  37. package/package.json +10 -3
  38. package/index.html +0 -20
  39. package/scripts/generate-version.js +0 -15
  40. package/src/config/colors.config.json +0 -230
  41. package/src/config/files.config.json +0 -5
  42. package/src/config/force.config.json +0 -1
  43. package/src/config/states.config.json +0 -4
  44. package/src/config/utilities.config.json +0 -152
  45. package/src/interfaces/color.interface.ts +0 -9
  46. package/src/interfaces/files.interface.ts +0 -4
  47. package/src/manual/build.js +0 -4
  48. package/src/tools/config.tool.ts +0 -70
  49. package/src/tools/extraction/extractClasses.ts +0 -215
  50. package/src/tools/fileStuff/config.file.ts +0 -44
  51. package/src/tools/fileStuff/css.file.ts +0 -47
  52. package/src/tools/fileStuff/file.tools.ts +0 -12
  53. package/src/tools/logger.ts +0 -23
  54. package/src/tools/mapping/mapClassIntoRule.ts +0 -335
  55. package/src/tools/mapping/mapColorIntoDeclaration.ts +0 -14
  56. package/src/tools/output/css.output.ts +0 -104
  57. package/tests/README.md +0 -54
  58. package/tests/validation/color.validation.test.ts +0 -182
  59. package/tsconfig.json +0 -22
  60. package/vitest.config.ts +0 -19
@@ -1,51 +1,41 @@
1
- import { IColor } from '@interfaces/color.interface';
2
- import { log } from '@tools/logger';
3
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidColorValue = exports.validateColors = void 0;
4
+ const logger_1 = require("../logger");
4
5
  /**
5
6
  * Validates a single color value (hex color or 'transparent')
6
7
  */
7
- const isValidColorValue = (value: string): boolean => {
8
+ const isValidColorValue = (value) => {
8
9
  if (value === 'transparent') {
9
10
  return true;
10
11
  }
11
12
  // Validate hex color format (#RRGGBB or #RGB)
12
13
  return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(value);
13
14
  };
14
-
15
+ exports.isValidColorValue = isValidColorValue;
15
16
  /**
16
17
  * Validates the colors configuration
17
18
  * Ensures each color has at least one valid theme (light or dark)
18
19
  * @throws Error if validation fails
19
20
  */
20
- const validateColors = (colors: IColor): void => {
21
- const errors: string[] = [];
22
-
21
+ const validateColors = (colors) => {
22
+ const errors = [];
23
23
  Object.entries(colors).forEach(([colorName, colorConfig]) => {
24
24
  const { light, dark } = colorConfig;
25
-
26
25
  // Check if at least one theme is defined
27
26
  if (!light && !dark) {
28
- errors.push(
29
- `Color "${colorName}": must have at least one theme defined (light or dark)`
30
- );
27
+ errors.push(`Color "${colorName}": must have at least one theme defined (light or dark)`);
31
28
  return;
32
29
  }
33
-
34
30
  // Validate light color if defined
35
31
  if (light && !isValidColorValue(light)) {
36
- errors.push(
37
- `Color "${colorName}": invalid light color value "${light}". Expected hex format (#RRGGBB) or "transparent"`
38
- );
32
+ errors.push(`Color "${colorName}": invalid light color value "${light}". Expected hex format (#RRGGBB) or "transparent"`);
39
33
  }
40
-
41
34
  // Validate dark color if defined
42
35
  if (dark && !isValidColorValue(dark)) {
43
- errors.push(
44
- `Color "${colorName}": invalid dark color value "${dark}". Expected hex format (#RRGGBB) or "transparent"`
45
- );
36
+ errors.push(`Color "${colorName}": invalid dark color value "${dark}". Expected hex format (#RRGGBB) or "transparent"`);
46
37
  }
47
38
  });
48
-
49
39
  if (errors.length > 0) {
50
40
  const errorMessage = [
51
41
  '❌ Color configuration validation failed:',
@@ -53,16 +43,9 @@ const validateColors = (colors: IColor): void => {
53
43
  '',
54
44
  'Please check your colors.config.json or anubis.config.json file.',
55
45
  ].join('\n');
56
-
57
- log(errorMessage);
46
+ (0, logger_1.log)(errorMessage);
58
47
  throw new Error('Invalid color configuration');
59
48
  }
60
-
61
- log(
62
- `✅ Color configuration validated (${
63
- Object.keys(colors).length
64
- } colors)`
65
- );
49
+ (0, logger_1.log)(`✅ Color configuration validated (${Object.keys(colors).length} colors)`);
66
50
  };
67
-
68
- export { validateColors, isValidColorValue };
51
+ exports.validateColors = validateColors;
@@ -0,0 +1,5 @@
1
+ export declare const version = "1.4.0";
2
+ declare const _default: {
3
+ version: string;
4
+ };
5
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // This file is auto-generated by scripts/generate-version.js
3
+ // Do not edit this file manually
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.version = void 0;
6
+ exports.version = '1.4.0';
7
+ exports.default = { version: exports.version };
package/index.js CHANGED
@@ -1,26 +1,15 @@
1
1
  "use strict";
2
2
 
3
- const { init: initConfig, config } = require('./dist/tools/config.tool');
4
- const { log, logPrefix, logo } = require('./dist/tools/logger');
5
- const { init: initClassExtraction } = require('./dist/tools/extraction/extractClasses');
3
+ const { config } = require('./dist/tools/config.tool');
4
+ const { measureDuration, log, logPrefix, logo } = require('./dist/tools/logger');
5
+ const { init: initAnubis } = require('./dist/tools/main')
6
6
 
7
7
  const init = async () => {
8
8
  logo();
9
-
10
- console.time(`${logPrefix} Config initialized in`);
11
- initConfig();
12
- console.timeEnd(`${logPrefix} Config initialized in`);
13
- log('---');
14
-
15
- console.time(`${logPrefix} Rules generated in`);
16
- await initClassExtraction();
17
- console.timeEnd(`${logPrefix} Rules generated in`);
18
- log('---');
9
+ await measureDuration('Anubis', initAnubis, false)
19
10
  };
20
11
 
21
12
  const refresh = async (file) => {
22
- // console.log({ file });
23
-
24
13
  // _ Prevent self change loop
25
14
  // todo - add targets / ignore detection
26
15
  if (file.endsWith('_anubis.scss')) { return }
@@ -30,9 +19,7 @@ const refresh = async (file) => {
30
19
  return
31
20
  }
32
21
 
33
- console.time(`${logPrefix} Refreshed in`);
34
- await initClassExtraction();
35
- console.timeEnd(`${logPrefix} Refreshed in`);
22
+ await measureDuration('Refresh', initAnubis, false)
36
23
  }
37
24
 
38
25
  function AnubisUI() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anubis-ui",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Class-based css generator",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -16,13 +16,20 @@
16
16
  ],
17
17
  "scripts": {
18
18
  "dev": "rm -rf dist; npm run prepare; node src/manual/build.js",
19
- "build": "node scripts/generate-version.js && tsc && tsc-alias",
20
- "preinstall": "npm run build",
19
+ "build": "node scripts/generate-version.js && npx tsc && npx tsc-alias",
21
20
  "prepare": "npm run build",
21
+ "prepublishOnly": "npm run build",
22
22
  "test": "vitest",
23
23
  "test:run": "vitest run",
24
24
  "test:ui": "vitest --ui"
25
25
  },
26
+ "files": [
27
+ "dist",
28
+ "index.js",
29
+ "index.d.ts",
30
+ "README.md",
31
+ "LICENSE"
32
+ ],
26
33
  "style": "dist/_anubis.scss",
27
34
  "repository": {
28
35
  "type": "git",
package/index.html DELETED
@@ -1,20 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>AnubisUI Test</title>
7
- <link rel="stylesheet" href="src/css/_anubis.scss" />
8
-
9
- <style>
10
- .paragraph-small {
11
- font-weight: var(--weight-bold);
12
- }
13
- </style>
14
- </head>
15
- <body class="body--light">
16
- <div class="rounded bg-neutral border-primary-highest-thick shadow-neutral-wide">
17
- <btn color="primary" textColor="secondary">Test button with variants</button>
18
- </div>
19
- </body>
20
- </html>
@@ -1,15 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const packageJsonPath = path.join(__dirname, '..', 'package.json');
5
- const versionFilePath = path.join(__dirname, '..', 'src', 'version.ts');
6
-
7
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
8
- const versionCode = `// This file is auto-generated by scripts/generate-version.js
9
- // Do not edit this file manually
10
-
11
- export const version = '${packageJson.version}';
12
- export default { version };
13
- `;
14
-
15
- fs.writeFileSync(versionFilePath, versionCode, 'utf-8');
@@ -1,230 +0,0 @@
1
- {
2
- "none": {
3
- "light": "transparent",
4
- "dark": "transparent"
5
- },
6
- "accent": {
7
- "light": "#0f84cb",
8
- "dark": "#1a94db"
9
- },
10
- "accent-lowest": {
11
- "light": "#f0f8ff",
12
- "dark": "#082a3f"
13
- },
14
- "accent-lower": {
15
- "light": "#e1f2ff",
16
- "dark": "#0a5a8a"
17
- },
18
- "accent-low": {
19
- "light": "#b3d9ff",
20
- "dark": "#0e6b9a"
21
- },
22
- "accent-medium": {
23
- "light": "#0f84cb",
24
- "dark": "#1a94db"
25
- },
26
- "accent-high": {
27
- "light": "#0c6ba3",
28
- "dark": "#b3d9ff"
29
- },
30
- "accent-higher": {
31
- "light": "#094a7a",
32
- "dark": "#e1f2ff"
33
- },
34
- "accent-highest": {
35
- "light": "#082a3f",
36
- "dark": "#f0f8ff"
37
- },
38
- "primary": {
39
- "light": "#0f84cb",
40
- "dark": "#1a94db"
41
- },
42
- "primary-lowest": {
43
- "light": "#f0f8ff",
44
- "dark": "#082a3f"
45
- },
46
- "primary-lower": {
47
- "light": "#e1f2ff",
48
- "dark": "#0a5a8a"
49
- },
50
- "primary-low": {
51
- "light": "#b3d9ff",
52
- "dark": "#0e6b9a"
53
- },
54
- "primary-medium": {
55
- "light": "#0f84cb",
56
- "dark": "#1a94db"
57
- },
58
- "primary-high": {
59
- "light": "#0c6ba3",
60
- "dark": "#b3d9ff"
61
- },
62
- "primary-higher": {
63
- "light": "#094a7a",
64
- "dark": "#e1f2ff"
65
- },
66
- "primary-highest": {
67
- "light": "#082a3f",
68
- "dark": "#f0f8ff"
69
- },
70
- "secondary": {
71
- "light": "#3b5161",
72
- "dark": "#4a5f6f"
73
- },
74
- "secondary-lowest": {
75
- "light": "#f5f7f8",
76
- "dark": "#1e2a30"
77
- },
78
- "secondary-lower": {
79
- "light": "#e8ecf0",
80
- "dark": "#2a3a42"
81
- },
82
- "secondary-low": {
83
- "light": "#b3c2cc",
84
- "dark": "#354a55"
85
- },
86
- "secondary-medium": {
87
- "light": "#3b5161",
88
- "dark": "#4a5f6f"
89
- },
90
- "secondary-high": {
91
- "light": "#2f404e",
92
- "dark": "#b3c2cc"
93
- },
94
- "secondary-higher": {
95
- "light": "#232f3a",
96
- "dark": "#e8ecf0"
97
- },
98
- "secondary-highest": {
99
- "light": "#1e2a30",
100
- "dark": "#f5f7f8"
101
- },
102
- "neutral": {
103
- "light": "#64748b",
104
- "dark": "#64748b"
105
- },
106
- "neutral-lowest": {
107
- "light": "#ffffff",
108
- "dark": "#0f172a"
109
- },
110
- "neutral-lower": {
111
- "light": "#f1f5f9",
112
- "dark": "#475569"
113
- },
114
- "neutral-low": {
115
- "light": "#cbd5e1",
116
- "dark": "#475569"
117
- },
118
- "neutral-medium": {
119
- "light": "#64748b",
120
- "dark": "#64748b"
121
- },
122
- "neutral-high": {
123
- "light": "#475569",
124
- "dark": "#cbd5e1"
125
- },
126
- "neutral-higher": {
127
- "light": "#1e293b",
128
- "dark": "#f1f5f9"
129
- },
130
- "neutral-highest": {
131
- "light": "#141e57",
132
- "dark": "#ffffff"
133
- },
134
- "success": {
135
- "light": "#00c99e",
136
- "dark": "#25e2b3"
137
- },
138
- "success-lowest": {
139
- "light": "#eafff7",
140
- "dark": "#00302a"
141
- },
142
- "success-lower": {
143
- "light": "#cdfeeb",
144
- "dark": "#006756"
145
- },
146
- "success-low": {
147
- "light": "#63f2ca",
148
- "dark": "#00a481"
149
- },
150
- "success-medium": {
151
- "light": "#00c99e",
152
- "dark": "#25e2b3"
153
- },
154
- "success-high": {
155
- "light": "#00836b",
156
- "dark": "#63f2ca"
157
- },
158
- "success-higher": {
159
- "light": "#005548",
160
- "dark": "#cdfeeb"
161
- },
162
- "success-highest": {
163
- "light": "#00302a",
164
- "dark": "#eafff7"
165
- },
166
- "danger": {
167
- "light": "#e64d4b",
168
- "dark": "#f17a78"
169
- },
170
- "danger-lowest": {
171
- "light": "#fdf3f3",
172
- "dark": "#420e0d"
173
- },
174
- "danger-lower": {
175
- "light": "#fde3e3",
176
- "dark": "#932221"
177
- },
178
- "danger-low": {
179
- "light": "#f8aaa9",
180
- "dark": "#d3312f"
181
- },
182
- "danger-medium": {
183
- "light": "#e64d4b",
184
- "dark": "#f17a78"
185
- },
186
- "danger-high": {
187
- "light": "#b12624",
188
- "dark": "#f8aaa9"
189
- },
190
- "danger-higher": {
191
- "light": "#7a2322",
192
- "dark": "#fde3e3"
193
- },
194
- "danger-highest": {
195
- "light": "#420e0d",
196
- "dark": "#fdf3f3"
197
- },
198
- "warning": {
199
- "light": "#ff9a00",
200
- "dark": "#ffbd1b"
201
- },
202
- "warning-lowest": {
203
- "light": "#fffbea",
204
- "dark": "#481700"
205
- },
206
- "warning-lower": {
207
- "light": "#fff3c5",
208
- "dark": "#983c08"
209
- },
210
- "warning-low": {
211
- "light": "#ffd346",
212
- "dark": "#e27300"
213
- },
214
- "warning-medium": {
215
- "light": "#ff9a00",
216
- "dark": "#ffbd1b"
217
- },
218
- "warning-high": {
219
- "light": "#bb4e02",
220
- "dark": "#ffd346"
221
- },
222
- "warning-higher": {
223
- "light": "#7c310b",
224
- "dark": "#fff3c5"
225
- },
226
- "warning-highest": {
227
- "light": "#481700",
228
- "dark": "#fffbea"
229
- }
230
- }
@@ -1,5 +0,0 @@
1
- {
2
- "targets": [
3
- "**/*.vue"
4
- ]
5
- }
@@ -1 +0,0 @@
1
- []
@@ -1,4 +0,0 @@
1
- [
2
- "hover",
3
- "not-hover"
4
- ]
@@ -1,152 +0,0 @@
1
- [
2
- {
3
- "prefix": "bg",
4
- "declaration": "background: ${color}",
5
- "export": "all"
6
- },
7
- {
8
- "prefix": "text",
9
- "declaration": "color: ${color}",
10
- "export": "all"
11
- },
12
- {
13
- "prefix": "text",
14
- "declaration": "text-decoration: ${value}",
15
- "variations": {
16
- "underline": "underline",
17
- "dashed": "dashed",
18
- "dotted": "dotted"
19
- }
20
- },
21
- {
22
- "prefix": "border",
23
- "declaration": "border-width: ${value} !important; border-color: ${color} !important; border-style: solid;",
24
- "variations": {
25
- "default": "4px",
26
- "thinest": "1px",
27
- "thiner": "2px",
28
- "thin": "3px",
29
- "thick": "6px",
30
- "thicker": "8px",
31
- "thickest": "10px",
32
- "node": "0.2rem"
33
- }
34
- },
35
- {
36
- "prefix": "inner-border",
37
- "declaration": "box-shadow: inset 0px 0px 0px ${value} ${color}",
38
- "variations": {
39
- "default": "4px",
40
- "thinest": "1px",
41
- "thiner": "2px",
42
- "thin2": "3px",
43
- "thick": "6px",
44
- "thicker": "8px",
45
- "thickest": "10px",
46
- "node": "0.2rem"
47
- }
48
- },
49
- {
50
- "prefix": "shadow",
51
- "declaration": "box-shadow: ${value} ${color}",
52
- "variations": {
53
- "default": "0px 0px 7px 1px",
54
- "densest": "0px 0px 3px 1px",
55
- "lower": "0px 0px 5px 1px",
56
- "dense": "0px 0px 5px 1px",
57
- "wide": "0px 0px 10px 1px",
58
- "wider": "0px 0px 15px 1px",
59
- "widest": "0px 0px 20px 1px"
60
- }
61
- },
62
- {
63
- "prefix": "blur",
64
- "declaration": "backdrop-filter: blur(${value})",
65
- "variations": {
66
- "default": "3px"
67
- }
68
- },
69
- {
70
- "prefix": "smooth",
71
- "declaration": "transition-duration: ${value}",
72
- "variations": {
73
- "default": "0.1s",
74
- "slowest": "0.5s",
75
- "slower": "0.3s",
76
- "slow": "0.2s",
77
- "quick": "0.07s",
78
- "quicker": "0.05s",
79
- "quickest": "0.03s"
80
- }
81
- },
82
- {
83
- "prefix": "rounded",
84
- "declaration": "border-radius: ${value}",
85
- "variations": {
86
- "default": "8px",
87
- "square": "0px",
88
- "xs": "2px",
89
- "sm": "4px",
90
- "md": "8px",
91
- "lg": "12px",
92
- "xl": "16px",
93
- "very": "9999px",
94
- "full": "50%",
95
- "half": "100%"
96
- }
97
- },
98
- {
99
- "prefix": "border",
100
- "declaration": "border-style: ${value}",
101
- "variations": {
102
- "solid": "solid",
103
- "dashed": "dashed",
104
- "dotted": "dotted"
105
- }
106
- },
107
- {
108
- "prefix": "position",
109
- "declaration": "position: ${value}",
110
- "variations": {
111
- "relative": "relative",
112
- "absolute": "absolute"
113
- }
114
- },
115
- {
116
- "prefix": "size",
117
- "declaration": "font-size: ${value} !important",
118
- "export": "variation",
119
- "variations": {
120
- "2xs": "10px",
121
- "xs": "12px",
122
- "sm": "14px",
123
- "md": "16px",
124
- "lg": "18px",
125
- "xl": "20px",
126
- "2xl": "24px",
127
- "3xl": "30px",
128
- "4xl": "36px",
129
- "5xl": "48px",
130
- "6xl": "60px",
131
- "7xl": "72px",
132
- "8xl": "96px",
133
- "9xl": "128px"
134
- }
135
- },
136
- {
137
- "prefix": "weight",
138
- "declaration": "font-weight: ${value} !important",
139
- "export": "variation",
140
- "variations": {
141
- "thin": "100",
142
- "extra-light": "200",
143
- "light": "300",
144
- "normal": "400",
145
- "medium": "500",
146
- "semi-bold": "600",
147
- "bold": "700",
148
- "extra-bold": "800",
149
- "black": "900"
150
- }
151
- }
152
- ]
@@ -1,9 +0,0 @@
1
- export interface IColor {
2
- [colorName: string]: {
3
- /** @optional Hexadecimal light color code - doesn't include opacity */
4
- light?: string[7]
5
-
6
- /** @optional Hexadecimal dark color code - doesn't include opacity */
7
- dark?: string[7]
8
- }
9
- }
@@ -1,4 +0,0 @@
1
- export interface IFileConfig {
2
- targets: string|string[]
3
- ignore: string[]
4
- }
@@ -1,4 +0,0 @@
1
- const AnubisUI = require('../../index')
2
-
3
- AnubisUI.plugin.buildStart()
4
-