beathers 5.7.6 โ 5.9.1
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/.prettierrc.js +10 -8
- package/CHANGELOG +305 -274
- package/css/beathers.min.css +2 -2
- package/css/beathers.min.css.map +1 -1
- package/docs/colors.md +250 -250
- package/docs/grid-system.md +130 -130
- package/docs/shaping.md +272 -272
- package/docs/typography.md +124 -124
- package/package.json +107 -105
- package/readme.md +301 -301
- package/scripts/commands/build.js +4 -4
- package/scripts/commands/clean.d.ts +2 -0
- package/scripts/commands/clean.d.ts.map +1 -0
- package/scripts/commands/clean.js +22 -0
- package/scripts/commands/fonts.d.ts.map +1 -1
- package/scripts/commands/fonts.js +4 -3
- package/scripts/commands/index.js +8 -8
- package/scripts/commands/init.js +1 -1
- package/scripts/commands/version-update.d.ts +2 -0
- package/scripts/commands/version-update.d.ts.map +1 -0
- package/scripts/commands/version-update.js +122 -0
- package/scripts/commands/version.js +1 -1
- package/scripts/helpers/BuildScssVariables.d.ts +1 -1
- package/scripts/helpers/BuildScssVariables.d.ts.map +1 -1
- package/scripts/helpers/BuildScssVariables.js +20 -10
- package/scripts/helpers/LoadUserConfigs.js +1 -1
- package/scripts/helpers/ReadDefaultValues.js +20 -20
- package/scripts/types.d.ts +1 -1
- package/scripts/types.d.ts.map +1 -1
- package/scss/_variables.scss +19 -19
- package/scss/beathers.min.scss +15 -14
- package/scss/functions/_colors.scss +242 -230
- package/scss/functions/_mediaQueries.scss +140 -136
- package/scss/functions/_others.scss +113 -79
- package/scss/functions/_typographic.scss +133 -129
- package/scss/functions/_validations.scss +293 -251
- package/scss/settings/_configs.scss +270 -270
- package/scss/settings/_defaults.scss +209 -214
- package/scss/settings/_index.scss +90 -90
- package/scss/style/_button.scss +103 -101
- package/scss/style/_colors.scss +156 -146
- package/scss/style/_dialog.scss +147 -146
- package/scss/style/_glass.scss +98 -80
- package/scss/style/_grid.scss +121 -95
- package/scss/style/_loader.scss +74 -62
- package/scss/style/_resets.scss +176 -168
- package/scss/style/_shaping.scss +561 -439
- package/scss/style/_typographic.scss +400 -345
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import { exec } from 'child_process';
|
|
3
2
|
import fs from 'fs-extra';
|
|
3
|
+
import { exec } from 'node:child_process';
|
|
4
|
+
import path from 'node:path';
|
|
4
5
|
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import
|
|
6
|
-
import { promisify } from 'util';
|
|
6
|
+
import { promisify } from 'node:util';
|
|
7
7
|
import { promptInput } from '../commands/index.js';
|
|
8
8
|
import { BuildScssVariables, DeepMerge, LoadUserConfigs, ReadDefaultValues } from '../helpers/index.js';
|
|
9
9
|
const execAsync = promisify(exec);
|
|
@@ -93,7 +93,7 @@ async function BuildTheme(customOutputPath) {
|
|
|
93
93
|
const userConfigs = await LoadUserConfigs();
|
|
94
94
|
console.log('๐ Building theme variables...');
|
|
95
95
|
const theme = DeepMerge(defaults, userConfigs);
|
|
96
|
-
const variablesString = BuildScssVariables(theme
|
|
96
|
+
const variablesString = BuildScssVariables(theme);
|
|
97
97
|
await fs.writeFile(variablesPath, variablesString, { flag: 'w' });
|
|
98
98
|
console.log(`โ
Theme variables generated`);
|
|
99
99
|
console.log('');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../src/scripts/commands/clean.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
const targets = ['public/css', 'css', 'scss', 'index.js', 'index.d.ts', 'index.d.ts.map', 'data', 'scripts'];
|
|
5
|
+
async function clean() {
|
|
6
|
+
const cwd = process.cwd();
|
|
7
|
+
const cleaned = [];
|
|
8
|
+
for (const target of targets) {
|
|
9
|
+
const targetPath = path.join(cwd, target);
|
|
10
|
+
if (await fs.pathExists(targetPath)) {
|
|
11
|
+
await fs.remove(targetPath);
|
|
12
|
+
cleaned.push(target);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (cleaned.length > 0) {
|
|
16
|
+
console.log('๐งน Cleaned the following files/folders:');
|
|
17
|
+
cleaned.forEach((f) => console.log(' -', f));
|
|
18
|
+
}
|
|
19
|
+
else
|
|
20
|
+
console.log('No files or folders needed cleaning.');
|
|
21
|
+
}
|
|
22
|
+
await clean();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/scripts/commands/fonts.ts"],"names":[],"mappings":"AAMA,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/scripts/commands/fonts.ts"],"names":[],"mappings":"AAMA,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CA2F7C;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CA4BhD;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CA4BhD"}
|
|
@@ -36,15 +36,16 @@ export async function AddFont() {
|
|
|
36
36
|
const title = await promptInput(question('title', l));
|
|
37
37
|
const unicode = await promptInput(question('unicode', l));
|
|
38
38
|
const isLocal = await promptUser(question('isLocal', l));
|
|
39
|
-
if (
|
|
39
|
+
if (isLocal)
|
|
40
|
+
format = await promptSelection(question('format', l), ['woff2', 'woff']);
|
|
41
|
+
else {
|
|
40
42
|
while (true) {
|
|
41
43
|
url = await promptInput(question('url', l));
|
|
42
44
|
if (url && /^https?:\/\//.test(url))
|
|
43
45
|
break;
|
|
44
46
|
console.error('โ Invalid URL format. URL must start with \x1b[36mhttp://\x1b[0m or \x1b[36mhttps://\x1b[0m');
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
format = await promptSelection(question('format', l), ['woff2', 'woff']);
|
|
48
|
+
}
|
|
48
49
|
variants[l] = {
|
|
49
50
|
title: title ?? fontName,
|
|
50
51
|
...(unicode && { unicode }),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
|
-
import path from 'path';
|
|
3
|
+
import path from 'node:path';
|
|
4
4
|
// Functions
|
|
5
5
|
export async function promptUser(question) {
|
|
6
|
-
const readline = await import('readline');
|
|
6
|
+
const readline = await import('node:readline');
|
|
7
7
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
8
8
|
return new Promise((resolve) => {
|
|
9
9
|
rl.question(question, (answer) => {
|
|
@@ -13,7 +13,7 @@ export async function promptUser(question) {
|
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
export async function promptInput(question) {
|
|
16
|
-
const readline = await import('readline');
|
|
16
|
+
const readline = await import('node:readline');
|
|
17
17
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
18
18
|
return new Promise((resolve) => {
|
|
19
19
|
rl.question(question, (answer) => {
|
|
@@ -23,7 +23,7 @@ export async function promptInput(question) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
export async function promptSelection(question, options) {
|
|
26
|
-
const readline = await import('readline');
|
|
26
|
+
const readline = await import('node:readline');
|
|
27
27
|
return new Promise((resolve) => {
|
|
28
28
|
const ask = () => {
|
|
29
29
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -31,7 +31,7 @@ export async function promptSelection(question, options) {
|
|
|
31
31
|
options.forEach((option, index) => console.log(` ${index + 1}. ${option}`));
|
|
32
32
|
rl.question('Enter your choice (number): ', (answer) => {
|
|
33
33
|
rl.close();
|
|
34
|
-
const choice = parseInt(answer.trim()) - 1;
|
|
34
|
+
const choice = Number.parseInt(answer.trim()) - 1;
|
|
35
35
|
if (choice >= 0 && choice < options.length)
|
|
36
36
|
resolve(options[choice]);
|
|
37
37
|
else {
|
|
@@ -60,9 +60,9 @@ export async function loadConfig(filePath) {
|
|
|
60
60
|
}
|
|
61
61
|
else if (['.js', '.ts'].includes(extension)) {
|
|
62
62
|
let content = await fs.readFile(filePath, 'utf-8');
|
|
63
|
-
content = content.
|
|
64
|
-
content = content.
|
|
65
|
-
content = content.
|
|
63
|
+
content = content.replaceAll(/import.*from.*['"].*['"];?\n/g, '');
|
|
64
|
+
content = content.replaceAll(/export default\s+/, '');
|
|
65
|
+
content = content.replaceAll(/satisfies Theme\s*$/, '');
|
|
66
66
|
try {
|
|
67
67
|
const config = eval(`(${content})`);
|
|
68
68
|
return config;
|
package/scripts/commands/init.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import path from 'path';
|
|
4
|
+
import path from 'node:path';
|
|
5
5
|
import { promptSelection, promptUser } from '../commands/index.js';
|
|
6
6
|
import { ReadDefaultValues } from '../helpers/index.js';
|
|
7
7
|
async function getDefaultValues() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-update.d.ts","sourceRoot":"","sources":["../../src/scripts/commands/version-update.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
const EXCLUDE = [
|
|
5
|
+
'node_modules',
|
|
6
|
+
'.git',
|
|
7
|
+
'pnpm-lock.yaml',
|
|
8
|
+
'dist',
|
|
9
|
+
'build',
|
|
10
|
+
'.next',
|
|
11
|
+
'.turbo',
|
|
12
|
+
'.vscode',
|
|
13
|
+
'.DS_Store',
|
|
14
|
+
'coverage',
|
|
15
|
+
'out',
|
|
16
|
+
'logs',
|
|
17
|
+
'tmp',
|
|
18
|
+
'temp',
|
|
19
|
+
'yarn.lock',
|
|
20
|
+
'package-lock.json',
|
|
21
|
+
];
|
|
22
|
+
function bumpVersion(version, type) {
|
|
23
|
+
const [major, minor, patch] = version.split('.').map(Number);
|
|
24
|
+
if (type === 'magor')
|
|
25
|
+
return `${major + 1}.0.0`;
|
|
26
|
+
if (type === 'minor')
|
|
27
|
+
return `${major}.${minor + 1}.0`;
|
|
28
|
+
return `${major}.${minor}.${patch + 1}`;
|
|
29
|
+
}
|
|
30
|
+
function findAllFiles(dir, exts = ['.ts', '.js', '.json', '.md', '.scss'], exclude = []) {
|
|
31
|
+
let results = [];
|
|
32
|
+
const list = fs.readdirSync(dir);
|
|
33
|
+
list.forEach((file) => {
|
|
34
|
+
const filePath = path.join(dir, file);
|
|
35
|
+
if (exclude.some((ex) => filePath.includes(ex)))
|
|
36
|
+
return;
|
|
37
|
+
const stat = fs.statSync(filePath);
|
|
38
|
+
if (stat?.isDirectory())
|
|
39
|
+
results = results.concat(findAllFiles(filePath, exts, exclude));
|
|
40
|
+
else if (exts.includes(path.extname(file)))
|
|
41
|
+
results.push(filePath);
|
|
42
|
+
});
|
|
43
|
+
return results;
|
|
44
|
+
}
|
|
45
|
+
async function main() {
|
|
46
|
+
const args = process.argv.slice(2);
|
|
47
|
+
const flag = args.find((a) => a.startsWith('--'))?.replace('--', '');
|
|
48
|
+
const type = flag === 'minor' || flag === 'magor' ? flag : 'patch';
|
|
49
|
+
const pkgPath = path.resolve('package.json');
|
|
50
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
51
|
+
const oldVersion = pkg.version;
|
|
52
|
+
const newVersion = bumpVersion(oldVersion, type);
|
|
53
|
+
pkg.version = newVersion;
|
|
54
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
55
|
+
const updatedFiles = [pkgPath];
|
|
56
|
+
const workspaceRoot = path.resolve('.');
|
|
57
|
+
process.stdout.write('\u23F3 Updating version across files... ');
|
|
58
|
+
const files = findAllFiles(workspaceRoot, ['.ts', '.js', '.json', '.md', '.scss'], EXCLUDE);
|
|
59
|
+
for (const file of files) {
|
|
60
|
+
if (path.resolve(file) === pkgPath)
|
|
61
|
+
continue;
|
|
62
|
+
const content = fs.readFileSync(file, 'utf-8');
|
|
63
|
+
if (!content.includes(oldVersion))
|
|
64
|
+
continue;
|
|
65
|
+
const updated = content.replaceAll(new RegExp(oldVersion.replaceAll('.', String.raw `\.`), 'g'), newVersion);
|
|
66
|
+
fs.writeFileSync(file, updated);
|
|
67
|
+
updatedFiles.push(file);
|
|
68
|
+
}
|
|
69
|
+
process.stdout.write('\r');
|
|
70
|
+
const changelogPath = path.resolve('CHANGELOG');
|
|
71
|
+
let changelogContent = '';
|
|
72
|
+
let changelogExists = false;
|
|
73
|
+
try {
|
|
74
|
+
changelogContent = fs.readFileSync(changelogPath, 'utf-8');
|
|
75
|
+
changelogExists = true;
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
console.log('โ ๏ธ No CHANGELOG file found, skipping changelog update.');
|
|
79
|
+
}
|
|
80
|
+
if (changelogExists) {
|
|
81
|
+
const today = new Date();
|
|
82
|
+
const yyyy = today.getFullYear();
|
|
83
|
+
const mm = String(today.getMonth() + 1).padStart(2, '0');
|
|
84
|
+
const dd = String(today.getDate()).padStart(2, '0');
|
|
85
|
+
const dateStr = `${yyyy}-${mm}-${dd}`;
|
|
86
|
+
let newSection = `## [${newVersion}] - ${dateStr}\n\n`;
|
|
87
|
+
if (type === 'minor' || type === 'magor')
|
|
88
|
+
newSection += '### Changed\n\n- \n\n### Added\n\n- \n\n';
|
|
89
|
+
newSection += '### Fixed\n\n-\n';
|
|
90
|
+
const lines = changelogContent.split(/\r?\n/);
|
|
91
|
+
let insertIdx = lines.findIndex((l) => l.trim().toLowerCase() === '# changelog');
|
|
92
|
+
if (insertIdx === -1)
|
|
93
|
+
insertIdx = 0;
|
|
94
|
+
insertIdx++;
|
|
95
|
+
while (insertIdx < lines.length && lines[insertIdx].trim() === '')
|
|
96
|
+
insertIdx++;
|
|
97
|
+
lines.splice(insertIdx, 0, newSection);
|
|
98
|
+
fs.writeFileSync(changelogPath, lines.join('\n'));
|
|
99
|
+
updatedFiles.push(changelogPath);
|
|
100
|
+
}
|
|
101
|
+
// Success message
|
|
102
|
+
console.log('โ
', 'Version updated from', `\x1b[36m${oldVersion}\x1b[0m`, 'to', `\x1b[36m${newVersion}\x1b[0m`, '\n');
|
|
103
|
+
if (updatedFiles.length) {
|
|
104
|
+
console.log('\x1b[36mUpdated files:\x1b[0m');
|
|
105
|
+
updatedFiles.forEach((f) => {
|
|
106
|
+
const relPath = path.relative(workspaceRoot, f).split(path.sep).join('/');
|
|
107
|
+
const fileName = path.basename(f);
|
|
108
|
+
console.log(` โข \x1b]8;;file://${workspaceRoot.replaceAll('\\', '/')}/${relPath}\x1b\\${fileName}\x1b]8;;\x1b\\`);
|
|
109
|
+
});
|
|
110
|
+
console.log();
|
|
111
|
+
if (updatedFiles.includes(changelogPath)) {
|
|
112
|
+
const relChangelog = path.relative(workspaceRoot, changelogPath).split(path.sep).join('/');
|
|
113
|
+
console.log(`\x1b[33mEdit your new changelog section:\x1b[0m \x1b]8;;file://${workspaceRoot.replaceAll('\\', '/')}/${relChangelog}\x1b\\CHANGELOG\x1b]8;;\x1b\\\n`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else
|
|
117
|
+
console.log('No files needed updating.');
|
|
118
|
+
}
|
|
119
|
+
main().catch((err) => {
|
|
120
|
+
console.error('โ Error:', err.message);
|
|
121
|
+
process.exit(1);
|
|
122
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import path from 'path';
|
|
4
|
+
import path from 'node:path';
|
|
5
5
|
export function Version() {
|
|
6
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = path.dirname(__filename);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildScssVariables.d.ts","sourceRoot":"","sources":["../../src/scripts/helpers/BuildScssVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"BuildScssVariables.d.ts","sourceRoot":"","sources":["../../src/scripts/helpers/BuildScssVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AA0MnC,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAYvD"}
|
|
@@ -18,13 +18,21 @@ function BuildColors(colors) {
|
|
|
18
18
|
function BuildTypography(typography) {
|
|
19
19
|
let scss = '\n\n// --- Typography ---\n';
|
|
20
20
|
scss += '$defaultFontFamilies:';
|
|
21
|
-
scss += typography?.defaultFontFamilies?.length
|
|
21
|
+
scss += typography?.defaultFontFamilies?.length
|
|
22
|
+
? typography.defaultFontFamilies.join(', ').replaceAll('"', '')
|
|
23
|
+
: 'null';
|
|
22
24
|
scss += ';\n';
|
|
23
25
|
let fontPath = typography?.fontMainPath;
|
|
24
26
|
if (!fontPath?.startsWith('/'))
|
|
25
27
|
fontPath = `/${fontPath}`;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
if (fontPath)
|
|
29
|
+
scss += `$fontMainPath: "${fontPath}";\n`;
|
|
30
|
+
else
|
|
31
|
+
scss += '$fontMainPath: null;\n';
|
|
32
|
+
if (typography?.fontFormat)
|
|
33
|
+
scss += `$fontFormat: "${typography.fontFormat}";\n`;
|
|
34
|
+
else
|
|
35
|
+
scss += '$fontFormat: null;\n';
|
|
28
36
|
scss += '$fontWeights: (';
|
|
29
37
|
scss += typography?.fontWeights?.length ? typography.fontWeights.map((fW) => `"${fW}"`).join(', ') : '';
|
|
30
38
|
scss += ');\n';
|
|
@@ -32,11 +40,14 @@ function BuildTypography(typography) {
|
|
|
32
40
|
scss += typography?.fontStyles?.length ? typography.fontStyles.map((fS) => `"${fS}"`).join(', ') : '';
|
|
33
41
|
scss += ');\n';
|
|
34
42
|
scss += '$fontSizes: (';
|
|
35
|
-
|
|
43
|
+
const fontSizes = Object.entries(typography?.fontSizes ?? {});
|
|
44
|
+
if (fontSizes?.length) {
|
|
36
45
|
scss += '\n';
|
|
37
|
-
|
|
38
|
-
scss += `"${name}": ${value}
|
|
39
|
-
|
|
46
|
+
fontSizes.forEach(([name, value], i) => {
|
|
47
|
+
scss += `"${name}": ${value}`;
|
|
48
|
+
if (i !== fontSizes.length - 1)
|
|
49
|
+
scss += ',\n';
|
|
50
|
+
});
|
|
40
51
|
scss += '\n';
|
|
41
52
|
}
|
|
42
53
|
scss += ');\n';
|
|
@@ -57,7 +68,7 @@ function BuildTypography(typography) {
|
|
|
57
68
|
for (const [lang, variant] of Object.entries(font.variants)) {
|
|
58
69
|
scss += `"${lang}": (\n`;
|
|
59
70
|
if (variant?.title)
|
|
60
|
-
scss += `"title": ${variant.title.
|
|
71
|
+
scss += `"title": ${variant.title.replaceAll('"', '')},\n`;
|
|
61
72
|
if (variant?.unicode)
|
|
62
73
|
scss += `"unicode": "${variant.unicode}",\n`;
|
|
63
74
|
if (variant?.format)
|
|
@@ -166,8 +177,7 @@ function BuildLoader(loader) {
|
|
|
166
177
|
scss += `$loaderDuration: ${loader?.duration ?? 'null'};\n`;
|
|
167
178
|
return scss;
|
|
168
179
|
}
|
|
169
|
-
|
|
170
|
-
export function BuildScssVariables(theme, isLocalBuild = false) {
|
|
180
|
+
export function BuildScssVariables(theme) {
|
|
171
181
|
const { colors, roles, settings, typography, glass, loader } = theme;
|
|
172
182
|
let scss = '// Generated by Beathers builder\n // Do not edit this file directly\n\n';
|
|
173
183
|
scss += BuildColors(colors);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import { pathToFileURL } from 'node:url';
|
|
3
|
-
import path from 'path';
|
|
3
|
+
import path from 'node:path';
|
|
4
4
|
const userConfigFiles = ['beathers.configs.js', 'beathers.configs.ts', 'beathers.configs.json'];
|
|
5
5
|
function findConfigFile(basePath) {
|
|
6
6
|
for (const filename of userConfigFiles) {
|
|
@@ -7,7 +7,7 @@ function sanitize(val) {
|
|
|
7
7
|
return true;
|
|
8
8
|
if (trimmed === 'false')
|
|
9
9
|
return false;
|
|
10
|
-
if (!isNaN(Number(trimmed)))
|
|
10
|
+
if (!Number.isNaN(Number(trimmed)))
|
|
11
11
|
return Number(trimmed);
|
|
12
12
|
return trimmed;
|
|
13
13
|
}
|
|
@@ -24,7 +24,7 @@ function cleanString(value) {
|
|
|
24
24
|
function cleanNumber(value) {
|
|
25
25
|
let result = null;
|
|
26
26
|
const num = Number(value);
|
|
27
|
-
if (!isNaN(num) && num.toString() === value)
|
|
27
|
+
if (!Number.isNaN(num) && num.toString() === value)
|
|
28
28
|
result = num;
|
|
29
29
|
return result;
|
|
30
30
|
}
|
|
@@ -38,34 +38,34 @@ function buildArray(value) {
|
|
|
38
38
|
}
|
|
39
39
|
function buildJson(value) {
|
|
40
40
|
const raw = value
|
|
41
|
-
.
|
|
42
|
-
.
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
.
|
|
46
|
-
.
|
|
47
|
-
.
|
|
41
|
+
.replaceAll('(', '{')
|
|
42
|
+
.replaceAll(')', '}')
|
|
43
|
+
.replaceAll("'", '"')
|
|
44
|
+
.replaceAll(/(\w+):/g, '"$1":')
|
|
45
|
+
.replaceAll(/:\s*"?(\d+)"?\.(\d+)(rem)?/g, ':"$1.$2$3"')
|
|
46
|
+
.replaceAll(/:\s*(\w+)/g, ': "$1"')
|
|
47
|
+
.replaceAll(/,\s*}/g, '\n}');
|
|
48
48
|
const parsed = JSON.parse(raw);
|
|
49
49
|
const sanitized = sanitize(parsed);
|
|
50
50
|
return sanitized;
|
|
51
51
|
}
|
|
52
52
|
function buildColors(value) {
|
|
53
53
|
const raw = value
|
|
54
|
-
.
|
|
55
|
-
.
|
|
56
|
-
.
|
|
57
|
-
.
|
|
58
|
-
.
|
|
59
|
-
.
|
|
54
|
+
.replaceAll('(', '{')
|
|
55
|
+
.replaceAll(')', '}')
|
|
56
|
+
.replaceAll("'", '"')
|
|
57
|
+
.replaceAll(/#([0-9a-fA-F]{3,6})/g, '"#$1"')
|
|
58
|
+
.replaceAll(/,\s*}/g, '}')
|
|
59
|
+
.replaceAll(/\n\s*/g, '');
|
|
60
60
|
const parsed = JSON.parse(raw);
|
|
61
61
|
return parsed;
|
|
62
62
|
}
|
|
63
63
|
function buildWrappers(value) {
|
|
64
64
|
const raw = value
|
|
65
|
-
.
|
|
66
|
-
.
|
|
67
|
-
.
|
|
68
|
-
.
|
|
65
|
+
.replaceAll('(', '{')
|
|
66
|
+
.replaceAll(')', '}')
|
|
67
|
+
.replaceAll(/(\w+):\s*([0-9%px]+)\s+([0-9.]+rem)/g, '"$1": {"width": "$2", "padding": "$3"}')
|
|
68
|
+
.replaceAll(/,\s*}/g, '}');
|
|
69
69
|
const parsed = JSON.parse(raw);
|
|
70
70
|
return parsed;
|
|
71
71
|
}
|
|
@@ -75,7 +75,7 @@ export async function ReadDefaultValues(files, VariableNames) {
|
|
|
75
75
|
for (const file of files) {
|
|
76
76
|
const content = await fs.readFile(file, 'utf8');
|
|
77
77
|
for (const name of VariableNames) {
|
|
78
|
-
const variableRegex = new RegExp(
|
|
78
|
+
const variableRegex = new RegExp(String.raw `^\s*\$${name}\s*:\s*([\s\S]*?)\s*!default\s*;?`, 'm');
|
|
79
79
|
const match = variableRegex.exec(content);
|
|
80
80
|
if (match) {
|
|
81
81
|
const value = match[1].trim();
|
package/scripts/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** CSS size unit values supporting px, rem, em, viewport units, and percentages */
|
|
2
|
-
type SizeUnit = 0 | `${number}px` | `${number}rem` | `${number}em` | `${number}vw` | `${number}vh` | `${number}%`;
|
|
2
|
+
type SizeUnit = 0 | '0' | `${number}px` | `${number}rem` | `${number}em` | `${number}vw` | `${number}vh` | `${number}%`;
|
|
3
3
|
/** Color configuration object with optional light and dark theme hex values */
|
|
4
4
|
type ColorType = Record<string, {
|
|
5
5
|
light?: `#${string}`;
|
package/scripts/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/scripts/types.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,KAAK,QAAQ,GAAG,CAAC,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,MAAM,KAAK,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,MAAM,GAAG,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/scripts/types.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,KAAK,QAAQ,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,MAAM,KAAK,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,MAAM,GAAG,CAAA;AAIvH,+EAA+E;AAC/E,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,CAAC,EAAE,IAAI,MAAM,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,MAAM,EAAE,CAAA;CAAE,CAAC,CAAA;AAG9E,sDAAsD;AACtD,KAAK,UAAU,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,CAAA;AAExH,6DAA6D;AAC7D,KAAK,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AAEhD,UAAU,WAAW;IACnB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAA;IAEb,yCAAyC;IACzC,OAAO,CAAC,EAAE,MA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SAAS,CAAA;IAElB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,UAAU,CAAA;IAEvB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB,sEAAsE;IACtE,KAAK,CAAC,EAAE,KAAK,CAAA;IAEb,gEAAgE;IAChE,KAAK,CAAC,EAAE,KAAK,CAAA;IAEb,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,YAAY,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,KAAK,EACL,KAAK,GACN,CAAA"}
|
package/scss/_variables.scss
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
// Do not edit this file directly
|
|
3
3
|
|
|
4
4
|
// --- Colors ---
|
|
5
|
-
$colors:
|
|
5
|
+
$colors: null;
|
|
6
6
|
|
|
7
7
|
// --- Typography ---
|
|
8
8
|
$defaultFontFamilies: null;
|
|
9
9
|
$fontMainPath: '/undefined';
|
|
10
10
|
$fontFormat: null;
|
|
11
|
-
$fontWeights:
|
|
12
|
-
$fontStyles:
|
|
13
|
-
$fontSizes:
|
|
14
|
-
$textTruncate:
|
|
15
|
-
$fonts:
|
|
11
|
+
$fontWeights: null;
|
|
12
|
+
$fontStyles: null;
|
|
13
|
+
$fontSizes: null;
|
|
14
|
+
$textTruncate: null;
|
|
15
|
+
$fonts: null;
|
|
16
16
|
|
|
17
17
|
// --- Settings ---
|
|
18
18
|
$axisDivisions: null;
|
|
19
|
-
$opacities:
|
|
20
|
-
$blurValues:
|
|
21
|
-
$insetValues:
|
|
22
|
-
$bordersValue:
|
|
23
|
-
$radiuses:
|
|
24
|
-
$breakpoints:
|
|
25
|
-
$wrappers:
|
|
26
|
-
$guttersValues:
|
|
19
|
+
$opacities: null;
|
|
20
|
+
$blurValues: null;
|
|
21
|
+
$insetValues: null;
|
|
22
|
+
$bordersValue: null;
|
|
23
|
+
$radiuses: null;
|
|
24
|
+
$breakpoints: null;
|
|
25
|
+
$wrappers: null;
|
|
26
|
+
$guttersValues: null;
|
|
27
27
|
|
|
28
28
|
// --- Roles ---
|
|
29
29
|
$useFontFamilies: true;
|
|
@@ -81,26 +81,26 @@ $useButton: false;
|
|
|
81
81
|
$glassBlur: null;
|
|
82
82
|
$glassColor: (
|
|
83
83
|
'light': #ffffff,
|
|
84
|
-
'dark': #000000
|
|
84
|
+
'dark': #000000
|
|
85
85
|
);
|
|
86
86
|
$glassBorderThickness: null;
|
|
87
87
|
$glassBorder1Color: (
|
|
88
88
|
'light': #e6e6e6,
|
|
89
|
-
'dark': #303030
|
|
89
|
+
'dark': #303030
|
|
90
90
|
);
|
|
91
91
|
$glassBorder2Color: (
|
|
92
92
|
'light': #e6e6e6,
|
|
93
|
-
'dark': #303030
|
|
93
|
+
'dark': #303030
|
|
94
94
|
);
|
|
95
95
|
$glassLightAngle: null;
|
|
96
96
|
|
|
97
97
|
// --- Loader ---
|
|
98
98
|
$loaderColorMain: (
|
|
99
99
|
'light': #ffffff,
|
|
100
|
-
'dark': #1a1d21
|
|
100
|
+
'dark': #1a1d21
|
|
101
101
|
);
|
|
102
102
|
$loaderColorSecond: (
|
|
103
103
|
'light': #f4f4f4,
|
|
104
|
-
'dark': #2e2e3f
|
|
104
|
+
'dark': #2e2e3f
|
|
105
105
|
);
|
|
106
106
|
$loaderDuration: 2s;
|
package/scss/beathers.min.scss
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Beathers v5.
|
|
3
|
-
* Copyright 2020-2026 Bhoenix Studio
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@use './style/
|
|
8
|
-
@use './style/
|
|
9
|
-
@use './style/
|
|
10
|
-
@use './style/
|
|
11
|
-
@use './style/
|
|
12
|
-
@use './style/
|
|
13
|
-
@use './style/
|
|
14
|
-
@use './style/
|
|
1
|
+
/*!
|
|
2
|
+
* Beathers v5.9.1 (https://bhoenixstudio.com/beathers)
|
|
3
|
+
* Copyright 2020-2026 Bhoenix Studio
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Style ----- ----- ----- -----
|
|
7
|
+
@use './style/resets';
|
|
8
|
+
@use './style/colors';
|
|
9
|
+
@use './style/typographic';
|
|
10
|
+
@use './style/grid';
|
|
11
|
+
@use './style/shaping';
|
|
12
|
+
@use './style/glass';
|
|
13
|
+
@use './style/loader';
|
|
14
|
+
@use './style/dialog';
|
|
15
|
+
@use './style/button';
|