beathers 5.2.2 → 5.3.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.
Files changed (66) hide show
  1. package/CHANGELOG +119 -0
  2. package/dist/css/beathers-icons.min.css +1 -1
  3. package/dist/css/beathers-icons.min.css.map +1 -1
  4. package/dist/css/beathers.min.css +2 -2
  5. package/dist/css/beathers.min.css.map +1 -1
  6. package/dist/data/colors.d.ts +10 -0
  7. package/dist/data/colors.js +54 -0
  8. package/dist/data/font.d.ts +4 -0
  9. package/dist/data/font.js +32 -0
  10. package/dist/data/index.d.ts +3 -0
  11. package/dist/data/index.js +2 -0
  12. package/dist/index.d.ts +5 -2
  13. package/dist/index.js +4 -1
  14. package/dist/scripts/cli.d.ts +1 -0
  15. package/dist/scripts/cli.js +7 -220
  16. package/dist/scripts/commands/build.d.ts +2 -0
  17. package/dist/scripts/commands/build.js +128 -0
  18. package/dist/scripts/commands/colors.d.ts +5 -0
  19. package/dist/scripts/commands/colors.js +140 -0
  20. package/dist/scripts/commands/fonts.d.ts +4 -0
  21. package/dist/scripts/commands/fonts.js +124 -0
  22. package/dist/scripts/commands/help.d.ts +2 -0
  23. package/dist/scripts/commands/help.js +42 -0
  24. package/dist/scripts/commands/index.d.ts +14 -0
  25. package/dist/scripts/commands/index.js +95 -0
  26. package/dist/scripts/commands/init.d.ts +2 -0
  27. package/dist/scripts/commands/init.js +129 -0
  28. package/dist/scripts/commands/list.d.ts +3 -0
  29. package/dist/scripts/commands/list.js +29 -0
  30. package/dist/scripts/commands/version.d.ts +2 -0
  31. package/dist/scripts/commands/version.js +13 -0
  32. package/dist/scripts/helpers/BuildScssVariables.d.ts +3 -0
  33. package/dist/scripts/{BuildScssVariables.js → helpers/BuildScssVariables.js} +4 -4
  34. package/dist/scripts/{CallNewVariables.d.ts → helpers/CallNewVariables.d.ts} +1 -0
  35. package/dist/scripts/{LoadUserConfigs.d.ts → helpers/LoadUserConfigs.d.ts} +2 -1
  36. package/dist/scripts/{Merge.d.ts → helpers/Merge.d.ts} +2 -1
  37. package/dist/scripts/{ReadDefaultValues.d.ts → helpers/ReadDefaultValues.d.ts} +2 -1
  38. package/dist/scripts/{ReadDefaultValues.js → helpers/ReadDefaultValues.js} +6 -2
  39. package/dist/scripts/helpers/index.d.ts +6 -0
  40. package/dist/scripts/helpers/index.js +5 -0
  41. package/dist/scripts/types.d.ts +42 -4
  42. package/dist/scripts/types.js +1 -0
  43. package/package.json +90 -80
  44. package/readme.md +30 -1
  45. package/src/scss/_variables.scss +1 -305
  46. package/src/scss/beathers-icons.min.scss +245 -245
  47. package/src/scss/beathers.min.scss +2 -4
  48. package/src/scss/functions/_colors.scss +79 -68
  49. package/src/scss/functions/_mediaQueries.scss +22 -12
  50. package/src/scss/functions/_others.scss +31 -22
  51. package/src/scss/functions/_typographic.scss +11 -2
  52. package/src/scss/functions/_validations.scss +38 -43
  53. package/src/scss/settings/_configs.scss +1 -72
  54. package/src/scss/settings/_defaults.scss +139 -212
  55. package/src/scss/style/_colors.scss +39 -23
  56. package/src/scss/style/_grid.scss +23 -25
  57. package/src/scss/style/_resets.scss +119 -0
  58. package/src/scss/style/_shaping.scss +142 -89
  59. package/src/scss/style/_typographic.scss +79 -36
  60. package/dist/scripts/BuildScssVariables.d.ts +0 -2
  61. package/dist/scripts/BuildTheme.d.ts +0 -1
  62. package/dist/scripts/BuildTheme.js +0 -75
  63. package/src/scss/settings/_resets.scss +0 -103
  64. /package/dist/scripts/{CallNewVariables.js → helpers/CallNewVariables.js} +0 -0
  65. /package/dist/scripts/{LoadUserConfigs.js → helpers/LoadUserConfigs.js} +0 -0
  66. /package/dist/scripts/{Merge.js → helpers/Merge.js} +0 -0
@@ -2,18 +2,61 @@
2
2
  @use 'sass:string';
3
3
  @use 'sass:map';
4
4
  @use 'sass:list';
5
- @use '../settings/defaults' as vars;
5
+ @use '../variables' as vars;
6
6
  @use '../functions/validations' as val;
7
7
  @use '../functions/typographic' as typo;
8
8
  @use '../settings/configs' as configs;
9
9
  @use '../functions/mediaQueries' as mQ;
10
- @use '../settings/' as settings;
10
+ @use '../settings/index' as settings;
11
+ @use '../settings/defaults' as defs;
12
+
13
+ // Definitions
14
+ $useFontFamilies: if(
15
+ meta.variable-exists('vars.$useFontFamilies') and vars.$useFontFamilies,
16
+ vars.$useFontFamilies,
17
+ settings.$useFontFamilies
18
+ );
19
+ $fonts: if(meta.variable-exists('vars.$fonts') and vars.$fonts, vars.$fonts, defs.$fonts);
20
+ $fontWeights: if(meta.variable-exists('vars.$fontWeights') and vars.$fontWeights, vars.$fontWeights, defs.$fontWeights);
21
+ $fontStyles: if(meta.variable-exists('vars.$fontStyles') and vars.$fontStyles, vars.$fontStyles, defs.$fontStyles);
22
+ $fontFormat: if(meta.variable-exists('vars.$fontFormat') and vars.$fontFormat, vars.$fontFormat, defs.$fontFormat);
23
+ $defaultFontFamilies: if(
24
+ meta.variable-exists('vars.$defaultFontFamilies') and vars.$defaultFontFamilies,
25
+ vars.$defaultFontFamilies,
26
+ defs.$defaultFontFamilies
27
+ );
28
+ $useFontSizes: if(
29
+ meta.variable-exists('vars.$useFontSizes') and vars.$useFontSizes,
30
+ vars.$useFontSizes,
31
+ settings.$useFontSizes
32
+ );
33
+ $fontSizes: if(meta.variable-exists('vars.$fontSizes') and vars.$fontSizes, vars.$fontSizes, defs.$fontSizes);
34
+ $useFontShapes: if(
35
+ meta.variable-exists('vars.$useFontShapes') and vars.$useFontShapes,
36
+ vars.$useFontShapes,
37
+ settings.$useFontShapes
38
+ );
39
+ $useTextAligns: if(
40
+ meta.variable-exists('vars.$useTextAligns') and vars.$useTextAligns,
41
+ vars.$useTextAligns,
42
+ settings.$useTextAligns
43
+ );
44
+ $useTextTruncate: if(
45
+ meta.variable-exists('vars.$useTextTruncate') and vars.$useTextTruncate,
46
+ vars.$useTextTruncate,
47
+ settings.$useTextTruncate
48
+ );
49
+ $textTruncate: if(
50
+ meta.variable-exists('vars.$textTruncate') and vars.$textTruncate,
51
+ vars.$textTruncate,
52
+ defs.$textTruncate
53
+ );
11
54
 
12
55
  // Typographic Utilities
13
56
  // --------------------------------------
14
57
  // This file generates various typographic utility classes and @font-face rules
15
58
  // based on the settings and variables defined in the project.
16
- // Each section can be enabled or disabled via the `settings.$use...` variables.
59
+ // Each section can be enabled or disabled via the `$use...` variables.
17
60
 
18
61
  // Font Families & @font-face ----- ----- ----- -----
19
62
  //
@@ -21,14 +64,14 @@
21
64
  // Generates @font-face rules based on the `vars.$fonts` map and
22
65
  // corresponding utility classes for applying font families, weights, and styles.
23
66
  // The generation of these rules and classes is controlled by the
24
- // `settings.$useFontFamilies` boolean variable.
67
+ // `$useFontFamilies` boolean variable.
25
68
  //
26
- // @see settings.$useFontFamilies
69
+ // @see $useFontFamilies
27
70
  // @see vars.$fonts
28
71
  // @see vars.$fontWeights
29
72
  // @see vars.$fontStyles
30
73
  // @see configs.$fontWeightsValues (for mapping weight names to numerical values)
31
- // @see configs.$defaultFontFamilies (for fallback fonts)
74
+ // @see $defaultFontFamilies (for fallback fonts)
32
75
  // @see typo.font (mixin used for @font-face generation)
33
76
  // @see mQ.multiSizes (mixin used for responsive class generation)
34
77
  //
@@ -61,18 +104,18 @@
61
104
  // // ... responsive versions if applicable ...
62
105
  //
63
106
 
64
- @if settings.$useFontFamilies {
107
+ @if $useFontFamilies {
65
108
  // Font families ----- -----
66
109
  $fI: 0;
67
- @each $fontKey, $font in vars.$fonts {
110
+ @each $fontKey, $font in $fonts {
68
111
  // Validate parameters
69
112
  $checkedFontKey: val.string($fontKey, 'Typographic.fonts.title');
70
113
  $checkedFont: val.map($font, 'Typographic.fonts');
71
114
 
72
115
  $weights: map.get($font, 'weights');
73
- $weights: if($weights != null, map.get($font, 'weights'), vars.$fontWeights);
116
+ $weights: if($weights != null, map.get($font, 'weights'), $fontWeights);
74
117
  $styles: map.get($font, 'styles');
75
- $styles: if($styles != null, map.get($font, 'styles'), vars.$fontStyles);
118
+ $styles: if($styles != null, map.get($font, 'styles'), $fontStyles);
76
119
  $variants: map.get($font, 'variants');
77
120
 
78
121
  // Validate parameters
@@ -85,7 +128,7 @@
85
128
  @each $lang, $fontFace in $variants {
86
129
  $title: map.get($fontFace, 'title');
87
130
  $unicode: if(map.has-key($fontFace, 'unicode'), map.get($fontFace, 'unicode'), null);
88
- $format: if(map.has-key($fontFace, 'format'), map.get($fontFace, 'format'), vars.$fontFormat);
131
+ $format: if(map.has-key($fontFace, 'format'), map.get($fontFace, 'format'), $fontFormat);
89
132
  $isLocal: if(map.has-key($fontFace, 'local'), map.get($fontFace, 'isLocal'), true);
90
133
  $externalUrl: if(map.has-key($fontFace, 'url'), map.get($fontFace, 'url'), null);
91
134
 
@@ -115,7 +158,7 @@
115
158
  .#{$mainClass} {
116
159
  font-family:
117
160
  '#{$styleClass}',
118
- configs.$defaultFontFamilies if($size, !important, null);
161
+ $defaultFontFamilies if($size, !important, null);
119
162
  font-weight: if($size, $weightValue !important, $weightValue);
120
163
  @if meta.type-of($styles) == 'list' and list.length($styles) > 0 {
121
164
  &.#{$style} {
@@ -136,22 +179,22 @@
136
179
  // @description
137
180
  // Generates utility classes for applying predefined font sizes.
138
181
  // The generation of these classes is controlled by the
139
- // `settings.$useFontSizes` boolean variable.
140
- // Font sizes are defined in `configs.$fontSizes`.
182
+ // `$useFontSizes` boolean variable.
183
+ // Font sizes are defined in `$fontSizes`.
141
184
  // Responsive variants are generated using the `mQ.multiSizes` mixin.
142
185
  //
143
- // @see settings.$useFontSizes
144
- // @see configs.$fontSizes
186
+ // @see $useFontSizes
187
+ // @see $fontSizes
145
188
  // @see mQ.multiSizes
146
189
  //
147
190
  // @generatedClasses
148
191
  // - Font size classes:
149
- // - e.g., `.text-sm`, `.text-base`, `.text-lg` (based on keys in `configs.$fontSizes`)
192
+ // - e.g., `.text-sm`, `.text-base`, `.text-lg` (based on keys in `$fontSizes`)
150
193
  // - Responsive font size classes:
151
194
  // - e.g., `md:text-sm`, `lg:text-base`
152
195
  //
153
- // @example scss - Configuration in configs.$fontSizes
154
- // configs.$fontSizes: (
196
+ // @example scss - Configuration in $fontSizes
197
+ // $fontSizes: (
155
198
  // sm: 0.875rem,
156
199
  // base: 1rem
157
200
  // );
@@ -161,9 +204,9 @@
161
204
  // .text-base { font-size: 1rem; }
162
205
  // // ... responsive versions if applicable ...
163
206
  //
164
- @if settings.$useFontSizes {
207
+ @if $useFontSizes {
165
208
  @include mQ.multiSizes() using ($size, $divider) {
166
- @each $fontSize, $value in configs.$fontSizes {
209
+ @each $fontSize, $value in $fontSizes {
167
210
  $mainClass: if($size, #{$size}#{$divider}#{$fontSize}, $fontSize);
168
211
 
169
212
  .#{$mainClass} {
@@ -179,11 +222,11 @@
179
222
  // Generates utility classes for text transformations (e.g., uppercase, lowercase)
180
223
  // and other font-related shape properties like `font-variant`.
181
224
  // The generation of these classes is controlled by the
182
- // `settings.$useFontShapes` boolean variable.
225
+ // `$useFontShapes` boolean variable.
183
226
  // Shapes are defined in `configs.$fontShapes` and applied using the `typo.fontShapes` mixin.
184
227
  // Responsive variants are generated using the `mQ.multiSizes` mixin.
185
228
  //
186
- // @see settings.$useFontShapes
229
+ // @see $useFontShapes
187
230
  // @see configs.$fontShapes
188
231
  // @see typo.fontShapes
189
232
  // @see mQ.multiSizes
@@ -205,7 +248,7 @@
205
248
  // .small-caps { font-variant: small-caps; }
206
249
  // // ... responsive versions if applicable ...
207
250
  //
208
- @if settings.$useFontShapes {
251
+ @if $useFontShapes {
209
252
  @include mQ.multiSizes() using ($size, $divider) {
210
253
  @each $type, $values in configs.$fontShapes {
211
254
  @each $value in $values {
@@ -220,11 +263,11 @@
220
263
  // @description
221
264
  // Generates utility classes for text alignment (e.g., left, center, right).
222
265
  // The generation of these classes is controlled by the
223
- // `settings.$useTextAligns` boolean variable.
266
+ // `$useTextAligns` boolean variable.
224
267
  // Alignments are defined in `configs.$aligns`.
225
268
  // Responsive variants are generated using the `mQ.multiSizes` mixin.
226
269
  //
227
- // @see settings.$useTextAligns
270
+ // @see $useTextAligns
228
271
  // @see configs.$aligns
229
272
  // @see mQ.multiSizes
230
273
  //
@@ -241,7 +284,7 @@
241
284
  // .text-left { text-align: left; }
242
285
  // // ... responsive versions if applicable ...
243
286
  //
244
- @if settings.$useTextAligns {
287
+ @if $useTextAligns {
245
288
  @include mQ.multiSizes() using ($size, $divider) {
246
289
  @each $dir in configs.$aligns {
247
290
  // Validate parameters
@@ -260,22 +303,22 @@
260
303
  // @description
261
304
  // Generates utility classes for multi-line text truncation (ellipsis).
262
305
  // The generation of these classes is controlled by the
263
- // `settings.$useTextTruncate` boolean variable.
264
- // The maximum number of lines is controlled by `vars.$textTruncate`.
306
+ // `$useTextTruncate` boolean variable.
307
+ // The maximum number of lines is controlled by `$textTruncate`.
265
308
  // Responsive variants are generated using the `mQ.multiSizes` mixin.
266
309
  //
267
- // @see settings.$useTextTruncate
268
- // @see vars.$textTruncate
310
+ // @see $useTextTruncate
311
+ // @see $textTruncate
269
312
  // @see mQ.multiSizes
270
313
  //
271
314
  // @generatedClasses
272
315
  // - Text truncation classes:
273
- // - e.g., `.text-lines:1`, `.text-lines:2`, ... up to `vars.$textTruncate`
316
+ // - e.g., `.text-lines:1`, `.text-lines:2`, ... up to `$textTruncate`
274
317
  // - Responsive text truncation classes:
275
318
  // - e.g., `md:text-lines:1`, `lg:text-lines:2`
276
319
  //
277
- // @example scss - Configuration in vars.$textTruncate
278
- // vars.$textTruncate: 3;
320
+ // @example scss - Configuration in $textTruncate
321
+ // $textTruncate: 3;
279
322
  //
280
323
  // @example css - Generated CSS (simplified for .text-lines:2)
281
324
  // .text-lines\:2 { /* Note: CSS escapes the colon */
@@ -287,9 +330,9 @@
287
330
  // }
288
331
  // // ... responsive versions if applicable ...
289
332
  //
290
- @if settings.$useTextTruncate {
333
+ @if $useTextTruncate {
291
334
  @include mQ.multiSizes() using ($size, $divider) {
292
- @for $i from 1 through vars.$textTruncate {
335
+ @each $i in $textTruncate {
293
336
  $mainClass: if($size, '#{$size}#{$divider}text-lines#{\:}#{$i}', 'text-lines#{\:}#{$i}');
294
337
 
295
338
  .#{$mainClass} {
@@ -1,2 +0,0 @@
1
- import { Theme } from './types.js';
2
- export declare function BuildScssVariables(theme: Theme): string;
@@ -1 +0,0 @@
1
- export declare function BuildTheme(): Promise<void>;
@@ -1,75 +0,0 @@
1
- /* eslint-disable no-console */
2
- import fs from 'fs-extra';
3
- import * as path from 'node:path';
4
- import { fileURLToPath } from 'node:url';
5
- import { BuildScssVariables } from './BuildScssVariables.js';
6
- import { CallNewVariables } from './CallNewVariables.js';
7
- import { LoadUserConfigs } from './LoadUserConfigs.js';
8
- import { DeepMerge } from './Merge.js';
9
- import { ReadDefaultValues } from './ReadDefaultValues.js';
10
- const __filename = fileURLToPath(import.meta.url);
11
- const __dirname = path.dirname(__filename);
12
- const projectRoot = path.resolve(__dirname, '../..');
13
- const variablesPath = path.join(projectRoot, 'src', 'scss', '_variables.scss');
14
- async function defaultTheme() {
15
- let values = null;
16
- try {
17
- values = await ReadDefaultValues([path.join(projectRoot, 'src', 'scss', 'settings', '_index.scss')], [
18
- 'useMediaQueries',
19
- 'useIcons',
20
- 'useFontFamilies',
21
- 'useFontSizes',
22
- 'useFontShapes',
23
- 'useTextAligns',
24
- 'useTextTruncate',
25
- 'useColors',
26
- 'useColorsOpacities',
27
- 'useColorsLightMode',
28
- 'useColorsDarkMode',
29
- 'useCurrentColors',
30
- 'useRootColors',
31
- 'useGrid',
32
- 'useFlex',
33
- 'useTransitions',
34
- 'useWrappers',
35
- 'useShadows',
36
- 'useDisplays',
37
- 'useOverflows',
38
- 'useOpacities',
39
- 'useBlur',
40
- 'useObjectFits',
41
- 'usePositions',
42
- 'useInsets',
43
- 'useSizes',
44
- 'useGutters',
45
- 'useBorders',
46
- 'useTextBorders',
47
- 'useRadius',
48
- ]);
49
- }
50
- catch (error) {
51
- // eslint-disable-next-line no-console
52
- console.error('❌ buildCustomTheme failed:', error instanceof Error ? error.message : error);
53
- process.exit(1);
54
- }
55
- return values;
56
- }
57
- export async function BuildTheme() {
58
- try {
59
- const defaults = await defaultTheme();
60
- const userConfigs = await LoadUserConfigs();
61
- const theme = DeepMerge(defaults, userConfigs);
62
- const variablesString = BuildScssVariables(theme);
63
- await fs.writeFile(variablesPath, variablesString, { flag: 'w' });
64
- await CallNewVariables(projectRoot);
65
- }
66
- catch (error) {
67
- console.error('Error during custom theme build:', error);
68
- throw error;
69
- }
70
- }
71
- if (import.meta.url === `file://${process.argv[1]}`)
72
- BuildTheme().catch((error) => {
73
- console.error(error);
74
- process.exit(1);
75
- });
@@ -1,103 +0,0 @@
1
- @use "./configs" as configs;
2
- @use "../settings/defaults" as vars;
3
- @use "../functions/colors" as colors;
4
- @use "../settings/index" as settings;
5
-
6
- html {
7
- scroll-behavior: smooth;
8
- interpolate-size: allow-keywords;
9
- }
10
-
11
- body {
12
- position: relative;
13
- font-family: "regular";
14
- overflow-x: hidden;
15
- }
16
-
17
- *,
18
- ::before,
19
- ::after {
20
- margin: 0;
21
- padding: 0;
22
- box-sizing: border-box;
23
- }
24
-
25
- :focus,
26
- button:focus {
27
- outline: unset !important;
28
- box-shadow: unset !important;
29
- }
30
-
31
- ul {
32
- margin: unset;
33
- list-style: none;
34
- padding: 0;
35
-
36
- li {
37
- margin-bottom: unset;
38
- }
39
- }
40
-
41
- a {
42
- text-decoration: unset;
43
- }
44
-
45
- @if settings.$useColors {
46
- @if settings.$useColorsLightMode {
47
- .light::selection {
48
- background-color: colors.useColorWithMap("custom-2");
49
- color: colors.useColorWithMap("white");
50
- }
51
- }
52
- @if settings.$useColorsDarkMode {
53
- .dark::selection {
54
- background-color: colors.useColorWithMap("custom-2", "dark");
55
- color: colors.useColorWithMap("black");
56
- }
57
- }
58
- }
59
-
60
- ::-webkit-scrollbar {
61
- width: 6px;
62
-
63
- &-track {
64
- background-color: transparent;
65
- border-radius: unset;
66
- }
67
- &-thumb {
68
- border-radius: 100vw;
69
- }
70
- }
71
- @if settings.$useColors {
72
- @if settings.$useColorsLightMode {
73
- .light::-webkit-scrollbar-thumb {
74
- background: colors.useColorWithMap("third");
75
- }
76
- }
77
- @if settings.$useColorsDarkMode {
78
- .dark::-webkit-scrollbar-thumb {
79
- background: colors.useColorWithMap("third", "dark");
80
- }
81
- }
82
- }
83
-
84
- @each $option, $properties in configs.$clearanceOptions {
85
- @each $property, $value in $properties {
86
- .i\:#{$option} {
87
- #{$property}: $value !important;
88
- }
89
- .#{$option} {
90
- #{$property}: $value;
91
- }
92
- }
93
- }
94
-
95
- @each $cursor in configs.$cursors {
96
- .cursor#{\:}#{$cursor} {
97
- cursor: #{$cursor};
98
- }
99
- }
100
-
101
- .scroll-smooth {
102
- scroll-behavior: smooth;
103
- }
File without changes