@nuvoui/core 1.1.7 → 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 -28
  14. package/src/styles/layouts/_container.scss +14 -22
  15. package/src/styles/layouts/_flex.scss +60 -18
  16. package/src/styles/layouts/_grid.scss +36 -28
  17. package/src/styles/layouts/_index.scss +3 -0
  18. package/src/styles/mixins-map.scss +877 -1225
  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 +20 -0
  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 +46 -7
  26. package/src/styles/utilities/_display.scss +57 -3
  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 +54 -19
  30. package/src/styles/utilities/_opacity.scss +110 -8
  31. package/src/styles/utilities/_position.scss +177 -71
  32. package/src/styles/utilities/_shadows.scss +194 -67
  33. package/src/styles/utilities/_sizing.scss +62 -57
  34. package/src/styles/utilities/_spacing.scss +331 -64
  35. package/src/styles/utilities/_tooltips.scss +153 -105
  36. package/src/styles/utilities/_transitions.scss +152 -0
  37. package/src/styles/utilities/_typography.scss +113 -89
  38. package/src/styles/utilities/_functions.scss +0 -84
  39. package/src/styles/utilities/_variables.scss +0 -98
@@ -1,106 +1,212 @@
1
- @use './variables' as *;
1
+ @use '../abstracts' as *;
2
+
3
+ /**
4
+ * @component Position
5
+ * @description Controls element positioning and placement within the document flow
6
+ *
7
+ * @example
8
+ * <!-- Basic positioning -->
9
+ * <div class="relative">
10
+ * <div class="absolute top-0 right-0">
11
+ * Positioned in top-right corner
12
+ * </div>
13
+ * </div>
14
+ *
15
+ * <!-- Sticky header -->
16
+ * <header class="sticky top-0">
17
+ * This header sticks to the top when scrolling
18
+ * </header>
19
+ *
20
+ * <!-- Responsive positioning -->
21
+ * <div class="relative@md">
22
+ * <div class="absolute@md top-2 left-2">
23
+ * Only positioned on medium screens and up
24
+ * </div>
25
+ * </div>
26
+ *
27
+ * @classes
28
+ * Position Types:
29
+ * - static: Default position, follows document flow
30
+ * - relative: Positioned relative to normal position
31
+ * - absolute: Positioned relative to nearest positioned ancestor
32
+ * - fixed: Positioned relative to viewport
33
+ * - sticky: Positioned based on scroll position
34
+ *
35
+ * Placement:
36
+ * - top-{value}: Sets top position
37
+ * - right-{value}: Sets right position
38
+ * - bottom-{value}: Sets bottom position
39
+ * - left-{value}: Sets left position
40
+ *
41
+ * Common values: 0, 1, 2, 3, 4, 5, 10, etc. (based on spacing scale)
42
+ *
43
+ * @responsive
44
+ * All position classes support responsive variants using @breakpoint suffix:
45
+ * - relative@md: Relative positioning on medium screens and up
46
+ * - top-0@lg: Zero top position on large screens
47
+ *
48
+ * @see z-index, transform
49
+ */
50
+
51
+
52
+ // -----------------------------------------------
53
+ // MIXINS
54
+ // -----------------------------------------------
2
55
 
3
- // Position Mixins
56
+
57
+ /**
58
+ * @mixin static
59
+ * @description Sets position to static (default document flow)
60
+ * @example
61
+ * .element {
62
+ * @include static;
63
+ * }
64
+ */
4
65
  @mixin static {
5
66
  position: static;
6
67
  }
7
68
 
69
+ /**
70
+ * @mixin relative
71
+ * @description Sets position to relative, creating a positioning context
72
+ * @example
73
+ * .container {
74
+ * @include relative;
75
+ * }
76
+ */
8
77
  @mixin relative {
9
78
  position: relative;
10
79
  }
11
80
 
81
+ /**
82
+ * @mixin absolute
83
+ * @description Sets position to absolute, removing from normal document flow
84
+ * @example
85
+ * .popup {
86
+ * @include absolute;
87
+ * top: 0;
88
+ * left: 0;
89
+ * }
90
+ */
12
91
  @mixin absolute {
13
92
  position: absolute;
14
93
  }
15
94
 
95
+ /**
96
+ * @mixin absolute
97
+ * @description Sets position to absolute, removing from normal document flow
98
+ * @example
99
+ * .popup {
100
+ * @include absolute;
101
+ * top: 0;
102
+ * left: 0;
103
+ * }
104
+ */
16
105
  @mixin fixed {
17
106
  position: fixed;
18
107
  }
19
108
 
109
+ /**
110
+ * @mixin sticky
111
+ * @description Creates a sticky element that remains in view during scrolling
112
+ * @example
113
+ * .nav {
114
+ * @include sticky;
115
+ * }
116
+ */
20
117
  @mixin sticky {
21
118
  position: sticky;
22
119
  z-index: 999;
23
120
  top: 0;
24
121
  }
25
122
 
26
- // Position Classes
27
- .static {
28
- @include static;
29
- }
30
-
31
- .relative {
32
- @include relative;
33
- }
34
-
35
- .absolute {
36
- @include absolute;
37
- }
38
-
39
- .fixed {
40
- @include fixed;
41
- }
42
-
43
- .sticky {
44
- @include sticky;
45
- }
46
-
47
- // Responsive Position Classes
48
- @each $breakpoint, $width in $breakpoints {
49
- @media (min-width: #{$width}) {
50
- .static\@#{$breakpoint} {
51
- @include static;
52
- }
53
- .relative\@#{$breakpoint} {
54
- @include relative;
55
- }
56
- .absolute\@#{$breakpoint} {
57
- @include absolute;
58
- }
59
- .fixed\@#{$breakpoint} {
60
- @include fixed;
61
- }
62
- .sticky\@#{$breakpoint} {
63
- @include sticky;
64
- }
65
- }
66
- }
67
-
68
123
 
69
- // Top, Right, Bottom, Left Mixins
70
- @mixin top($value) {
71
- top: if($value == 0, $value, $value + px);
72
- }
124
+ /**
125
+ * @mixin top
126
+ * @description Sets the top position of an element
127
+ * @param {Number|Length} $value - Position value (in px, rem, etc.)
128
+ * @example
129
+ * .toast {
130
+ * @include absolute;
131
+ * @include top(1rem);
132
+ * }
133
+ */
134
+ @mixin top($value) {top: $value; }
135
+
136
+ /**
137
+ * @mixin right
138
+ * @description Sets the right position of an element
139
+ * @param {Number|Length} $value - Position value (in px, rem, etc.)
140
+ * @example
141
+ * .badge {
142
+ * @include absolute;
143
+ * @include right(0);
144
+ * }
145
+ */
146
+ @mixin right($value) {right: $value; }
147
+
148
+ /**
149
+ * @mixin bottom
150
+ * @description Sets the bottom position of an element
151
+ * @param {Number|Length} $value - Position value (in px, rem, etc.)
152
+ * @example
153
+ * .footer {
154
+ * @include fixed;
155
+ * @include bottom(0);
156
+ * }
157
+ */
158
+ @mixin bottom($value) {bottom: $value; }
159
+
160
+ /**
161
+ * @mixin left
162
+ * @description Sets the left position of an element
163
+ * @param {Number|Length} $value - Position value (in px, rem, etc.)
164
+ * @example
165
+ * .sidebar {
166
+ * @include fixed;
167
+ * @include left(0);
168
+ * }
169
+ */
170
+ @mixin left($value) {left: $value; }
73
171
 
74
- @mixin right($value) {
75
- right: if($value == 0, $value, $value + px);
76
- }
77
172
 
78
- @mixin bottom($value) {
79
- bottom: if($value == 0, $value, $value + px);
80
- }
81
173
 
82
- @mixin left($value) {
83
- left: if($value == 0, $value, $value + px);
84
- }
174
+ // -----------------------------------------------
175
+ // UTILITY CLASSES
176
+ // -----------------------------------------------
85
177
 
86
- // Top, Right, Bottom, Left Classes
87
- @each $i in $spacings {
88
- .top-#{$i} {@include top($i);}
89
- .right-#{$i} {@include right($i);}
90
- .bottom-#{$i} {@include bottom($i);}
91
- .left-#{$i} {@include left($i);}
178
+ // Position Classes
179
+ .static { @include static; }
180
+ .relative { @include relative; }
181
+ .absolute { @include absolute; }
182
+ .fixed { @include fixed; }
183
+ .sticky { @include sticky; }
184
+
185
+ // Placement Classes
186
+ @each $key, $value in $spacings {
187
+ .top-#{$key} { @include top($value); }
188
+ .right-#{$key} { @include right($value); }
189
+ .bottom-#{$key} { @include bottom($value); }
190
+ .left-#{$key} { @include left($value); }
92
191
  }
93
192
 
193
+ // -----------------------------------------------
194
+ // RESPONSIVE CLASSES
195
+ // -----------------------------------------------
94
196
 
95
- // Pixel widths based on spacing scale
197
+ // Responsive Position Classes
96
198
  @each $breakpoint, $width in $breakpoints {
97
199
  @media (min-width: #{$width}) {
98
- // Generate utilities from spacing map
99
- @each $i in $spacings {
100
- .top-#{$i}\@#{$breakpoint} {height: if($i == 0, $i, $i + px);}
101
- .right-#{$i}\@#{$breakpoint} {width: if($i == 0, $i, $i + px);}
102
- .bottom-#{$i}\@#{$breakpoint} {min-width: if($i == 0, $i, $i + px);}
103
- .left-#{$i}\@#{$breakpoint} {min-height: if($i == 0, $i, $i + px);}
104
- }
200
+ .static\@#{$breakpoint} {@include static;}
201
+ .relative\@#{$breakpoint} {@include relative;}
202
+ .absolute\@#{$breakpoint} {@include absolute;}
203
+ .fixed\@#{$breakpoint} {@include fixed;}
204
+ .sticky\@#{$breakpoint} {@include sticky;}
205
+ @each $key, $value in $spacings {
206
+ .top-#{$key}\@#{$breakpoint} {@include top($value);}
207
+ .right-#{$key}\@#{$breakpoint} {@include right($value);}
208
+ .bottom-#{$key}\@#{$breakpoint} {@include bottom($value);}
209
+ .left-#{$key}\@#{$breakpoint} {@include left($value);}
210
+ }
105
211
  }
106
212
  }
@@ -1,82 +1,93 @@
1
1
  // _shadows.scss
2
- @use 'sass:map';
3
- @use 'sass:math';
4
- @use 'sass:string';
5
- @use './variables' as *;
6
-
7
-
8
- // Shadow Variables
9
- $shadow-colors: (
10
- 'default': rgb(0 0 0 / 10%),
11
- 'dark': rgb(0 0 0 / 20%),
12
- 'darker': rgb(0 0 0 / 35%),
13
- 'darkest': rgb(0 0 0 / 50%),
14
- );
2
+ @use "sass:map";
3
+ @use "sass:math";
4
+ @use "sass:string";
5
+ @use "../abstracts" as VAR;
15
6
 
16
7
  $shadow-sizes: (
17
- 'sm': (
18
- 'x': 0,
19
- 'y': 1px,
20
- 'blur': 2px,
21
- 'spread': 0
8
+ "sm": (
9
+ "x": 0,
10
+ "y": 1px,
11
+ "blur": 2px,
12
+ "spread": 0,
13
+ ),
14
+ "md": (
15
+ "x": 0,
16
+ "y": 4px,
17
+ "blur": 6px,
18
+ "spread": -1px,
22
19
  ),
23
- 'md': (
24
- 'x': 0,
25
- 'y': 4px,
26
- 'blur': 6px,
27
- 'spread': -1px
20
+ "lg": (
21
+ "x": 0,
22
+ "y": 10px,
23
+ "blur": 15px,
24
+ "spread": -3px,
28
25
  ),
29
- 'lg': (
30
- 'x': 0,
31
- 'y': 10px,
32
- 'blur': 15px,
33
- 'spread': -3px
26
+ "xl": (
27
+ "x": 0,
28
+ "y": 20px,
29
+ "blur": 25px,
30
+ "spread": -5px,
34
31
  ),
35
- 'xl': (
36
- 'x': 0,
37
- 'y': 20px,
38
- 'blur': 25px,
39
- 'spread': -5px
32
+ "hero": (
33
+ "x": 0,
34
+ "y": 20px,
35
+ "blur": 25px,
36
+ "spread": 5px,
40
37
  ),
41
- 'hero': (
42
- 'x': 0,
43
- 'y': 20px,
44
- 'blur': 25px,
45
- 'spread': 5px
38
+ "monster": (
39
+ "x": 0,
40
+ "y": 20px,
41
+ "blur": 55px,
42
+ "spread": 20px,
46
43
  ),
47
- 'monster': (
48
- 'x': 0,
49
- 'y': 20px,
50
- 'blur': 55px,
51
- 'spread': 20px
52
- )
53
44
  );
54
45
 
55
- // Shadow Mixins
46
+ /**
47
+ * Generates a CSS shadow string from a given size.
48
+ *
49
+ * @param {String} $size - The shadow size.
50
+ * @param {String} $color - The shadow color.
51
+ * @return {String} - The CSS shadow string.
52
+ */
53
+
56
54
  @mixin shadow-base($x, $y, $blur, $spread, $color) {
57
- transition: box-shadow 0.2s ease-in-out;
58
55
  box-shadow: $x $y $blur $spread $color;
59
56
  }
60
57
 
61
- @mixin shadow($size: 'md', $color: 'default') {
58
+ /**
59
+ * Generates a CSS shadow string from a given size.
60
+ *
61
+ * @param {String} $size - The shadow size.
62
+ * @param {String} $color - The shadow color.
63
+ */
64
+ @mixin shadow($size: "md", $color: "default") {
65
+ @if not map.has-key($shadow-sizes, $size) {
66
+ @warn "Shadow size '#{$size}' not found in $shadow-sizes map";
67
+ $size: "md"; // Fallback to default
68
+ }
69
+ @if not map.has-key(VAR.$shadow-colors, $color) {
70
+ @warn "Shadow color '#{$color}' not found in VAR.$shadow-colors map";
71
+ $color: "default"; // Fallback to default
72
+ }
73
+
62
74
  $shadow: map.get($shadow-sizes, $size);
63
- $shadow-color: map.get($shadow-colors, $color);
75
+ $shadow-color: map.get(VAR.$shadow-colors, $color);
64
76
  @include shadow-base(
65
- map.get($shadow, 'x'),
66
- map.get($shadow, 'y'),
67
- map.get($shadow, 'blur'),
68
- map.get($shadow, 'spread'),
77
+ map.get($shadow, "x"),
78
+ map.get($shadow, "y"),
79
+ map.get($shadow, "blur"),
80
+ map.get($shadow, "spread"),
69
81
  $shadow-color
70
82
  );
71
83
  }
72
84
 
73
- @mixin shadow-inset($size: 'md', $color: 'default') {
85
+ @mixin shadow-inset($size: "md", $color: "default") {
74
86
  $shadow: map.get($shadow-sizes, $size);
75
- $shadow-color: map.get($shadow-colors, $color);
76
-
77
- box-shadow: inset map.get($shadow, 'x') map.get($shadow, 'y')
78
- map.get($shadow, 'blur') map.get($shadow, 'spread')
79
- $shadow-color;
87
+ $shadow-color: map.get(VAR.$shadow-colors, $color);
88
+
89
+ box-shadow: inset map.get($shadow, "x") map.get($shadow, "y") map.get($shadow, "blur") map.get($shadow, "spread")
90
+ $shadow-color;
80
91
  }
81
92
 
82
93
  // Utility Classes
@@ -88,19 +99,135 @@ $shadow-sizes: (
88
99
  .shadow-#{$size} {
89
100
  @include shadow($size);
90
101
  }
91
-
92
- .shadow-#{$size}-dark {
93
- @include shadow($size, 'dark');
102
+
103
+ // Shadow with color variants
104
+ @each $color-name, $color-value in VAR.$shadow-colors {
105
+ @if $color-name != "default" {
106
+ .shadow-#{$size}-#{$color-name} {
107
+ @include shadow($size, $color-name);
108
+ }
109
+ }
94
110
  }
95
-
111
+
96
112
  .shadow-inset-#{$size} {
97
113
  @include shadow-inset($size);
98
114
  }
115
+
116
+ // Inset shadows with color variants
117
+ @each $color-name, $color-value in VAR.$shadow-colors {
118
+ @if $color-name != "default" {
119
+ .shadow-inset-#{$size}-#{$color-name} {
120
+ @include shadow-inset($size, $color-name);
121
+ }
122
+ }
123
+ }
124
+
125
+ // Hover shadows
126
+ .hover\:shadow-#{$size}:hover {
127
+ @include shadow($size);
128
+ }
129
+
130
+ // Hover shadows with color variants
131
+ @each $color-name, $color-value in VAR.$shadow-colors {
132
+ @if $color-name != "default" {
133
+ .hover\:shadow-#{$size}-#{$color-name}:hover {
134
+ @include shadow($size, $color-name);
135
+ }
136
+ }
137
+ }
138
+
139
+ // Focus shadows
140
+ .focus\:shadow-#{$size}:focus {
141
+ @include shadow($size);
142
+ }
143
+
144
+ // Focus shadows with color variants
145
+ @each $color-name, $color-value in VAR.$shadow-colors {
146
+ @if $color-name != "default" {
147
+ .focus\:shadow-#{$size}-#{$color-name}:focus {
148
+ @include shadow($size, $color-name);
149
+ }
150
+ }
151
+ }
152
+
153
+ // Active shadows
154
+ .active\:shadow-#{$size}:active {
155
+ @include shadow($size);
156
+ }
157
+
158
+ // Active shadows with color variants
159
+ @each $color-name, $color-value in VAR.$shadow-colors {
160
+ @if $color-name != "default" {
161
+ .active\:shadow-#{$size}-#{$color-name}:active {
162
+ @include shadow($size, $color-name);
163
+ }
164
+ }
165
+ }
166
+ }
167
+
168
+ // Responsive variants
169
+ @each $breakpoint, $width in VAR.$breakpoints {
170
+ @media (min-width: #{$width}) {
171
+ @each $size, $values in $shadow-sizes {
172
+ // Regular shadows with breakpoints
173
+ .shadow-#{$size}\@#{$breakpoint} {
174
+ @include shadow($size);
175
+ }
176
+
177
+ // Shadows with color variants at breakpoints
178
+ @each $color-name, $color-value in VAR.$shadow-colors {
179
+ @if $color-name != "default" {
180
+ .shadow-#{$size}-#{$color-name}\@#{$breakpoint} {
181
+ @include shadow($size, $color-name);
182
+ }
183
+ }
184
+ }
185
+
186
+ // Hover shadows with breakpoints
187
+ .hover\:shadow-#{$size}\@#{$breakpoint}:hover {
188
+ @include shadow($size);
189
+ }
190
+
191
+ // Hover shadows with color variants at breakpoints
192
+ @each $color-name, $color-value in VAR.$shadow-colors {
193
+ @if $color-name != "default" {
194
+ .hover\:shadow-#{$size}-#{$color-name}\@#{$breakpoint}:hover {
195
+ @include shadow($size, $color-name);
196
+ }
197
+ }
198
+ }
199
+
200
+ // Focus shadows with breakpoints
201
+ .focus\:shadow-#{$size}\@#{$breakpoint}:focus {
202
+ @include shadow($size);
203
+ }
204
+
205
+ // Focus shadows with color variants at breakpoints
206
+ @each $color-name, $color-value in VAR.$shadow-colors {
207
+ @if $color-name != "default" {
208
+ .focus\:shadow-#{$size}-#{$color-name}\@#{$breakpoint}:focus {
209
+ @include shadow($size, $color-name);
210
+ }
211
+ }
212
+ }
213
+ }
214
+ }
99
215
  }
100
216
 
101
- // Hover variants
102
- .shadow-hover {
103
- &:hover {
104
- @include shadow('lg');
217
+ @for $i from 1 through 5 {
218
+ .elevation-#{$i} {
219
+ @if $i == 1 {
220
+ @include shadow("sm");
221
+ } @else if $i == 2 {
222
+ @include shadow("md");
223
+ } @else if $i == 3 {
224
+ @include shadow("lg");
225
+ } @else if $i == 4 {
226
+ @include shadow("xl");
227
+ } @else if $i == 5 {
228
+ @include shadow("monster");
229
+ }
230
+
231
+ z-index: $i;
105
232
  }
106
- }
233
+ }