@nuvoui/core 1.1.8 → 1.2.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 (39) hide show
  1. package/README.md +90 -35
  2. package/dist/nuvoui.css +28531 -0
  3. package/dist/nuvoui.css.map +1 -0
  4. package/dist/nuvoui.min.css +2 -1
  5. package/dist/nuvoui.min.css.map +1 -0
  6. package/package.json +48 -27
  7. package/src/styles/abstracts/_config.scss +157 -0
  8. package/src/styles/abstracts/_functions.scss +81 -0
  9. package/src/styles/abstracts/_index.scss +2 -0
  10. package/src/styles/base/_base.scss +2 -2
  11. package/src/styles/base/_index.scss +2 -0
  12. package/src/styles/base/_reset.scss +8 -6
  13. package/src/styles/index.scss +11 -30
  14. package/src/styles/layouts/_container.scss +2 -21
  15. package/src/styles/layouts/_flex.scss +4 -3
  16. package/src/styles/layouts/_grid.scss +3 -35
  17. package/src/styles/layouts/_index.scss +3 -0
  18. package/src/styles/mixins-map.scss +875 -1477
  19. package/src/styles/themes/_index.scss +1 -0
  20. package/src/styles/themes/_theme.scss +175 -57
  21. package/src/styles/utilities/_alignment.scss +1 -1
  22. package/src/styles/utilities/_animations.scss +65 -61
  23. package/src/styles/utilities/_borders.scss +280 -16
  24. package/src/styles/utilities/_colors.scss +68 -49
  25. package/src/styles/utilities/_container-queries.scss +9 -10
  26. package/src/styles/utilities/_display.scss +2 -2
  27. package/src/styles/utilities/_helpers.scss +110 -108
  28. package/src/styles/utilities/_index.scss +19 -0
  29. package/src/styles/utilities/_media-queries.scss +48 -14
  30. package/src/styles/utilities/_opacity.scss +33 -15
  31. package/src/styles/utilities/_position.scss +7 -7
  32. package/src/styles/utilities/_shadows.scss +147 -95
  33. package/src/styles/utilities/_sizing.scss +22 -21
  34. package/src/styles/utilities/_spacing.scss +38 -22
  35. package/src/styles/utilities/_tooltips.scss +153 -105
  36. package/src/styles/utilities/_transitions.scss +1 -1
  37. package/src/styles/utilities/_typography.scss +4 -4
  38. package/src/styles/utilities/_functions.scss +0 -84
  39. package/src/styles/utilities/_variables.scss +0 -126
@@ -0,0 +1 @@
1
+ @forward "theme";
@@ -1,36 +1,31 @@
1
- // _theme.scss
2
- @use 'sass:color';
3
- @use 'sass:map';
4
- @use '../utilities/colors' as *;
5
- @use '../utilities/variables' as *;
6
-
7
-
8
- // Generate scales for primitives
9
- $colors-primitives: ();
10
-
11
- @each $name, $color in $color-primitives {
12
- $colors-primitives: map.set($colors-primitives, $name, create-color-scale($color));
13
- }
1
+ // _theme.scss - CSS variables and utility classes
2
+ @use "sass:color";
3
+ @use "sass:map";
4
+ @use "../utilities/colors" as COL;
5
+ @use "../abstracts" as *;
14
6
 
15
7
  :root {
16
- @each $color-name, $scale in $colors {
8
+ // Theme color CSS variables
9
+ @each $color-name, $scale in COL.$colors {
17
10
  --#{$color-name}: #{color.adjust(map.get($scale, 500), $alpha: 1)};
18
11
  @each $shade, $value in $scale {
19
12
  --#{$color-name}-#{$shade}: #{color.adjust($value, $alpha: 1)};
20
13
  }
21
14
  }
22
15
 
23
- @each $color-name, $scale in $colors-primitives {
16
+ // Primitive color CSS variables
17
+ @each $color-name, $scale in COL.$colors-primitives {
24
18
  --#{$color-name}: #{color.adjust(map.get($scale, 500), $alpha: 1)};
25
19
  @each $shade, $value in $scale {
26
20
  --#{$color-name}-#{$shade}: #{color.adjust($value, $alpha: 1)};
27
21
  }
28
22
  }
29
23
 
30
- --background: #{map.get($light-theme, 'background')};
31
- --foreground: #{map.get($light-theme, 'foreground')};
32
- --surface: #{map.get($light-theme, 'surface')};
33
- --border: var(--primary-600);
24
+ // Light theme variables
25
+ --background: #{map.get($light-theme, "background")};
26
+ --foreground: #{map.get($light-theme, "foreground")};
27
+ --surface: #{map.get($light-theme, "surface")};
28
+ --border: var(--gray-600);
34
29
  --text-primary: var(--gray-900);
35
30
  --text-secondary: var(--gray-600);
36
31
  --button-bg-color: var(--primary);
@@ -38,31 +33,33 @@ $colors-primitives: ();
38
33
  --button-text-color: var(--gray-100);
39
34
  --link-color: var(--primary);
40
35
  --link-hover-color: var(--primary-600);
36
+ --inverted-text-color: var(--gray-100);
41
37
 
42
-
38
+ // Scrollbar styling
43
39
  &::-webkit-scrollbar {
44
40
  width: 12px;
45
41
  }
46
42
 
47
43
  &::-webkit-scrollbar-track {
48
- background: var(--background); // Light background
44
+ background: var(--background);
49
45
  }
50
46
 
51
47
  &::-webkit-scrollbar-thumb {
52
- background-color: #888; // Dark gray thumb
48
+ background-color: #888;
53
49
  border-radius: 6px;
54
- border: 3px solid var(--background); // Light background
50
+ border: 3px solid var(--background);
55
51
  }
56
52
 
57
53
  scrollbar-width: thin;
58
- scrollbar-color: #888 var(--background); // Dark gray thumb, light background
54
+ scrollbar-color: #888 var(--background);
59
55
  }
60
56
 
57
+ // Dark theme settings
61
58
  [data-theme="dark"] {
62
- --background: #{map.get($dark-theme, 'background')};
63
- --foreground: #{map.get($dark-theme, 'foreground')};
64
- --surface: #{map.get($dark-theme, 'surface')};
65
- --border: var(--primary-400);
59
+ --background: #{map.get($dark-theme, "background")};
60
+ --foreground: #{map.get($dark-theme, "foreground")};
61
+ --surface: #{map.get($dark-theme, "surface")};
62
+ --border: var(--gray-400);
66
63
  --text-primary: var(--gray-100);
67
64
  --text-secondary: var(--gray-400);
68
65
  --button-bg-color: var(--primary);
@@ -70,6 +67,7 @@ $colors-primitives: ();
70
67
  --button-text-color: var(--gray-200);
71
68
  --link-color: var(--primary);
72
69
  --link-hover-color: var(--primary-400);
70
+ --inverted-text-color: var(--gray-900);
73
71
 
74
72
  &::-webkit-scrollbar-track {
75
73
  background: var(--background);
@@ -80,32 +78,152 @@ $colors-primitives: ();
80
78
  border: 3px solid var(--background);
81
79
  }
82
80
 
83
- scrollbar-color: #555 var(--background);
84
- }
85
-
86
- // --font-family-heading: var(--font-family-base);
87
- // --text-primary: #{map.get($colors, 'dark')};
88
- // --link-color: #{map.get($colors, 'primary')};
89
- // --link-hover-color: #{color.scale(map.get($colors, 'primary'), $lightness: -10%)};
90
-
91
- // --nav-bg: #{map.get($colors, 'light')};
92
- // // --nav-hover: #{color.scale(map.get($colors, 'light'), $lightness: -10%)};
93
- // --nav-hover: white;
94
- // --nav-text: #{map.get($colors, 'dark')};
95
-
96
- // // Link Colors
97
- // --link-color: var(--primary);
98
- // --link-hover-color: #{color.scale(map.get($colors, 'primary'), $lightness: if($theme == 'light', -10%, 10%))};
99
- // --link-active-color: #{color.scale(map.get($colors, 'primary'), $lightness: if($theme == 'light', -20%, 20%))};
100
- // --link-visited-color: #{color.scale(map.get($colors, 'primary'), $saturation: -20%)};
101
-
102
- // // Tooltip
103
- // --tooltip-bg: var(--dark);
104
- // --tooltip-text: var(--light);
105
- // --tooltip-shadow-color: rgb(0 0 0 / 40%);
106
- // --microtip-transition-duration: 0.518s;
107
- // --microtip-transition-delay: .2s;
108
- // --microtip-transition-easing: cubic-bezier(0.16, 1, 0.9, 1);
109
- // --microtip-font-size: 0.875rem;
110
- // --microtip-font-weight: 300;
111
- // --microtip-text-transform: none;
81
+ scrollbar-color: #555 var(--background);
82
+ }
83
+
84
+ // -----------------------------------------------
85
+ // COLOR UTILITY CLASSES
86
+ // -----------------------------------------------
87
+
88
+ // Theme color background utilities
89
+ @each $color-name, $scale in COL.$colors {
90
+ @each $shade, $value in $scale {
91
+ .bg-#{$color-name}-#{$shade} {
92
+ background-color: var(--#{$color-name}-#{$shade});
93
+ }
94
+
95
+ // Automatic text contrast for backgrounds
96
+ .text-on-#{$color-name}-#{$shade} {
97
+ color: COL.find-text-color($value);
98
+ }
99
+
100
+ .text-#{$color-name}-#{$shade} {
101
+ color: var(--#{$color-name}-#{$shade});
102
+ }
103
+ }
104
+
105
+ // Base color classes
106
+ .bg-#{$color-name} {
107
+ background-color: var(--#{$color-name});
108
+ }
109
+
110
+ .text-#{$color-name} {
111
+ color: var(--#{$color-name});
112
+ }
113
+ }
114
+
115
+ // Primitive color utilities
116
+ @each $color-name, $scale in COL.$colors-primitives {
117
+ @each $shade, $value in $scale {
118
+ .bg-#{$color-name}-#{$shade} {
119
+ background-color: var(--#{$color-name}-#{$shade});
120
+ }
121
+
122
+ .text-on-#{$color-name}-#{$shade} {
123
+ color: COL.find-text-color($value);
124
+ }
125
+
126
+ .text-#{$color-name}-#{$shade} {
127
+ color: var(--#{$color-name}-#{$shade});
128
+ }
129
+ }
130
+
131
+ // Base color classes
132
+ .bg-#{$color-name} {
133
+ background-color: var(--#{$color-name});
134
+ }
135
+
136
+ .text-#{$color-name} {
137
+ color: var(--#{$color-name});
138
+ }
139
+ }
140
+
141
+ // Semantic color utilities
142
+ .bg-page {
143
+ background-color: var(--background);
144
+ }
145
+
146
+ .bg-card {
147
+ background-color: var(--surface);
148
+ }
149
+
150
+ .bg-active {
151
+ background-color: var(--button-bg-color);
152
+ }
153
+
154
+ .bg-hover {
155
+ background-color: var(--button-bg-color-hover);
156
+ }
157
+
158
+ .text-default {
159
+ color: var(--text-primary);
160
+ }
161
+
162
+ .text-muted {
163
+ color: var(--text-secondary);
164
+ }
165
+
166
+ .text-subtle {
167
+ color: var(--text-secondary);
168
+ opacity: 0.7;
169
+ }
170
+
171
+ .text-inverted {
172
+ color: var(--inverted-text-color);
173
+ }
174
+
175
+ .bg-white {
176
+ background-color: white;
177
+ }
178
+
179
+ .bg-black {
180
+ background-color: black;
181
+ }
182
+
183
+ .text-white {
184
+ color: white;
185
+ }
186
+
187
+ .text-black {
188
+ color: black;
189
+ }
190
+
191
+ // Hover utilities
192
+ @each $color-name, $scale in COL.$colors {
193
+ @each $shade, $value in $scale {
194
+ .hover\:bg-#{$color-name}-#{$shade}:hover {
195
+ background-color: var(--#{$color-name}-#{$shade});
196
+ }
197
+
198
+ .hover\:text-#{$color-name}-#{$shade}:hover {
199
+ color: var(--#{$color-name}-#{$shade});
200
+ }
201
+ }
202
+ }
203
+
204
+ @each $color-name, $scale in COL.$colors-primitives {
205
+ @each $shade, $value in $scale {
206
+ .hover\:bg-#{$color-name}-#{$shade}:hover {
207
+ background-color: var(--#{$color-name}-#{$shade});
208
+ }
209
+
210
+ .hover\:text-#{$color-name}-#{$shade}:hover {
211
+ color: var(--#{$color-name}-#{$shade});
212
+ }
213
+ }
214
+ }
215
+
216
+ // Glass effects
217
+ .glass-effect {
218
+ @include COL.backdrop-filter(blur(8px));
219
+
220
+ background-color: rgb(255 255 255 / 10%);
221
+ border: 1px solid rgb(255 255 255 / 20%);
222
+ }
223
+
224
+ .frosted-glass {
225
+ @include COL.backdrop-filter(blur(15px));
226
+
227
+ background-color: rgb(255 255 255 / 70%);
228
+ border: 1px solid rgb(255 255 255 / 80%);
229
+ }
@@ -1,4 +1,4 @@
1
- @use '../utilities/variables' as VAR;
1
+ @use '../abstracts' as VAR;
2
2
 
3
3
  @mixin align-baseline { vertical-align: baseline; }
4
4
  @mixin align-top { vertical-align: top; }
@@ -1,80 +1,84 @@
1
- @use 'sass:list';
1
+ @use "sass:list";
2
2
 
3
- @use 'sass:map';
4
- @use './functions' as *;
3
+ @use "sass:map";
4
+ @use "../abstracts/functions" as *;
5
5
 
6
6
  $generated-keyframes: ();
7
7
 
8
-
9
8
  @mixin generate-bounce-keyframes($keyframeName, $x, $y) {
10
- @if not list.index($generated-keyframes, $keyframeName) {
11
- $generated-keyframes: list.append($generated-keyframes, $keyframeName) !global;
12
-
13
- @keyframes #{$keyframeName} {
14
- 0% {
15
- transform: translateX(-#{$x}) translateY(-#{$y});
16
- }
9
+ @if not list.index($generated-keyframes, $keyframeName) {
10
+ $generated-keyframes: list.append($generated-keyframes, $keyframeName) !global;
11
+
12
+ @keyframes #{$keyframeName} {
13
+ 0% {
14
+ transform: translateX(-#{$x}) translateY(-#{$y});
15
+ }
17
16
 
18
- 50% {
19
- transform: translateX(#{$x}) translateY(#{$y});
20
- }
17
+ 50% {
18
+ transform: translateX(#{$x}) translateY(#{$y});
19
+ }
21
20
 
22
- 100% {
23
- transform: translateX(-#{$x}) translateY(-#{$y});
24
- }
25
- }
21
+ 100% {
22
+ transform: translateX(-#{$x}) translateY(-#{$y});
23
+ }
26
24
  }
25
+ }
27
26
  }
28
27
 
29
28
  @mixin animate-bounce($props) {
30
- $defaults: (
31
- vertical: 0%,
32
- horizontal: 0%,
33
- duration: 5s,
34
- timing: ease-in-out,
35
- iteration: infinite
36
- );
37
-
38
- // Merge with defaults
39
- $props: map.merge($defaults, $props);
40
- $x: map.get($props, 'horizontal');
41
- $y: map.get($props, 'vertical');
42
- $duration: map.get($props, 'duration');
43
- $easing: map.get($props, 'timing');
44
- $iteration: map.get($props, 'iteration');
45
-
46
- // Handle units
47
- $x-unit: if($x, safe-unit-name(get-unit($x)), '-');
48
- $y-unit: if($y, safe-unit-name(get-unit($y)), '-');
49
-
50
- // Clean values (remove units)
51
- $clean-x: if($x, strip-unit($x), 0);
52
- $clean-y: if($y, strip-unit($y), 0);
53
- $animation-name: anim-bounce-#{$clean-x}#{$x-unit}-#{$clean-y}#{$y-unit};
29
+ $defaults: (
30
+ vertical: 0%,
31
+ horizontal: 0%,
32
+ duration: 5s,
33
+ timing: ease-in-out,
34
+ iteration: infinite,
35
+ );
54
36
 
37
+ // Merge with defaults
38
+ $props: map.merge($defaults, $props);
39
+ $x: map.get($props, "horizontal");
40
+ $y: map.get($props, "vertical");
41
+ $duration: map.get($props, "duration");
42
+ $easing: map.get($props, "timing");
43
+ $iteration: map.get($props, "iteration");
55
44
 
56
- & {
57
- animation: #{$animation-name} $duration $easing $iteration;
58
- }
59
- @include generate-bounce-keyframes($animation-name, $x, $y);
60
- }
45
+ // Handle units
46
+ $x-unit: if($x, safe-unit-name(get-unit($x)), "-");
47
+ $y-unit: if($y, safe-unit-name(get-unit($y)), "-");
61
48
 
49
+ // Clean values (remove units)
50
+ $clean-x: if($x, strip-unit($x), 0);
51
+ $clean-y: if($y, strip-unit($y), 0);
52
+ $animation-name: anim-bounce-#{$clean-x}#{$x-unit}-#{$clean-y}#{$y-unit};
62
53
 
63
- @keyframes fade-in-reveal {
64
- to {
65
- scale: 1;
66
- opacity: 1;
67
- }
54
+ & {
55
+ animation: #{$animation-name} $duration $easing $iteration;
56
+ }
57
+ @include generate-bounce-keyframes($animation-name, $x, $y);
68
58
  }
69
59
 
60
+ @keyframes fade-in-reveal {
61
+ to {
62
+ scale: 1;
63
+ opacity: 1;
64
+ }
65
+ }
70
66
 
71
67
  @media (prefers-reduced-motion: no-preference) {
72
- .anim__fade-in-reveal {
73
- scale: .2;
74
- opacity: 0.7;
75
- animation: fade-in-reveal linear forwards;
76
- animation-timeline: view();
77
- animation-range-start: cover;
78
- animation-range-end: 550px;
79
- }
80
- }
68
+ .anim__fade-in-reveal {
69
+ scale: 0.2;
70
+ opacity: 0.7;
71
+ animation: fade-in-reveal linear forwards;
72
+ animation-timeline: view();
73
+ animation-range-start: cover;
74
+ animation-range-end: 550px;
75
+ }
76
+ }
77
+
78
+ @mixin hover-ready {
79
+ & {
80
+ transition-property: color, background-color, border-color, box-shadow, opacity, border-radius;
81
+ transition-duration: 0.2s;
82
+ transition-timing-function: ease-in-out;
83
+ }
84
+ }