@nuvoui/core 1.1.7 → 1.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuvoui/core",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "NuvoUI is a human-friendly SCSS framework designed for simplicity, and modern responsive designs.",
5
5
  "main": "dist/nuvoui.css",
6
6
  "module": "src/styles/index.scss",
@@ -11,6 +11,7 @@
11
11
  @forward 'layouts/grid';
12
12
 
13
13
  // Utilities
14
+ @forward 'utilities/alignment';
14
15
  @forward 'utilities/animations';
15
16
  @forward 'utilities/borders';
16
17
  @forward 'utilities/colors';
@@ -20,6 +21,7 @@
20
21
  @forward 'utilities/shadows';
21
22
  @forward 'utilities/sizing';
22
23
  @forward 'utilities/spacing';
24
+ @forward 'utilities/transitions';
23
25
  @forward 'utilities/typography';
24
26
  @forward 'utilities/tooltips';
25
27
  @forward 'utilities/display';
@@ -1,26 +1,31 @@
1
1
  @use 'sass:map';
2
- @use '../utilities/variables' as *;
2
+ @use '../utilities/variables' as VAR;
3
3
 
4
4
  // Base container styles
5
5
  @mixin container-base {
6
6
  width: 100%;
7
7
  margin-left: auto;
8
8
  margin-right: auto;
9
- padding-left: 1rem;
10
- padding-right: 1rem;
11
9
  }
12
10
 
11
+ @mixin container-padding($padding) {
12
+ & {
13
+ padding-top: $padding;
14
+ padding-bottom: $padding;
15
+ }
16
+ }
17
+
18
+
13
19
  // Responsive container mixin
14
20
  @mixin container($display: block) {
15
- @include container-base;
16
-
17
21
  display: $display;
18
-
19
- @each $breakpoint, $width in $container-max-widths {
20
- @media (min-width: map.get($breakpoints, $breakpoint)) {
21
- max-width: $width;
22
+ @include container-base;
23
+ @each $breakpoint, $width in VAR.$breakpoints {
24
+ @media (min-width: $width) {
25
+ max-width: $width - 100px;
22
26
  }
23
27
  }
28
+ @include container-padding(1rem);
24
29
  }
25
30
 
26
31
  // Container classes
@@ -38,4 +43,10 @@
38
43
 
39
44
  .container-fluid {
40
45
  @include container-base;
46
+ @include container-padding(1rem);
47
+ }
48
+
49
+ .container-no-padding {
50
+ @include container;
51
+ @include container-padding(0);
41
52
  }
@@ -1,9 +1,50 @@
1
1
  // Section: Layout
2
2
  // Module: Flex | Flex Inline
3
3
 
4
+ /**
5
+ * @component Flex
6
+ * @description Flexbox layout system for creating flexible page layouts
7
+ *
8
+ * @example
9
+ * <div class="flex row between x-center">
10
+ * <div class="w-6">Left column (6 units)</div>
11
+ * <div class="w-6">Right column (6 units)</div>
12
+ * </div>
13
+ *
14
+ * <div class="flex col@md row@lg">
15
+ * <!-- Changes direction based on breakpoint -->
16
+ * </div>
17
+ *
18
+ * @classes
19
+ * Base:
20
+ * - flex: Creates a flex container
21
+ *
22
+ * Direction:
23
+ * - row: Sets flex-direction to row
24
+ * - col: Sets flex-direction to column
25
+ * - row-reverse: Reverses row direction
26
+ * - col-reverse: Reverses column direction
27
+ *
28
+ * Alignment:
29
+ * - start/end/center: Controls justify-content
30
+ * - x-start/x-end/x-center: Controls align-items
31
+ *
32
+ * Child elements:
33
+ * - w-{1-12}: Sets width based on column count
34
+ * - grow: Allows item to grow
35
+ * - shrink/shrink-0: Controls shrink behavior
36
+ *
37
+ * @responsive
38
+ * All classes support responsive variants using @breakpoint suffix:
39
+ * - row@md: Row direction on medium screens and up
40
+ * - between@lg: Space-between on large screens
41
+ *
42
+ * @see grid
43
+ */
44
+
4
45
  @use 'sass:math';
5
46
  @use '../utilities/media-queries' as MC;
6
- @use '../utilities/variables' as *;
47
+ @use '../utilities/variables' as VAR;
7
48
  @use '../utilities/functions' as FN;
8
49
 
9
50
  /**
@@ -250,11 +291,11 @@
250
291
  @mixin no-grow { flex: none; }
251
292
 
252
293
  /**
253
- * @description Sets how many columns this would take using percentage of $column-count.
294
+ * @description Sets how many columns this would take using percentage of VAR.$column-count.
254
295
  * @param {Number} $size - The number of columns to span.
255
296
  */
256
297
  @mixin w-col($size) {
257
- flex: 0 0 math.percentage(math.div($size, $column-count));
298
+ flex: 0 0 math.percentage(math.div($size, VAR.$column-count));
258
299
  }
259
300
 
260
301
  // Base flex container
@@ -296,8 +337,8 @@
296
337
  &.x-content-stretch { align-content: stretch; }
297
338
 
298
339
  // Child flex items (using column count)
299
- > .w-auto { @include f-w-auto }
300
- > .w-full { @include f-w-full }
340
+ > .w-auto { @include f-w-auto; }
341
+ > .w-full { @include f-w-full; }
301
342
  > .grow { @include grow; }
302
343
  > .no-grow { @include no-grow; }
303
344
 
@@ -308,20 +349,18 @@
308
349
  > .shrink { @include shrink; }
309
350
  > .shrink-0 { @include shrink-0; }
310
351
  > .shrink-2 { @include shrink-2; }
311
- @for $i from 1 through $column-count {
312
- > .w-#{$i} { @include w-col($i) }
352
+ @for $i from 1 through VAR.$column-count {
353
+ > .w-#{$i} { @include w-col($i); }
313
354
  > .order-#{$i} { order: $i; }
314
355
  }
315
356
  }
316
357
 
317
- @each $breakpoint, $width in $breakpoints {
358
+ @each $breakpoint, $width in VAR.$breakpoints {
318
359
  // Get breakpoint value using FN function
319
360
  $bp-val: FN.get-breakpoint-value($breakpoint);
320
361
 
321
362
  @media (min-width: #{$bp-val}) {
322
363
  .flex {
323
- display: flex;
324
-
325
364
  // Direction
326
365
  &.row\@#{$breakpoint} { flex-direction: row; }
327
366
  &.row-reverse\@#{$breakpoint} { flex-direction: row-reverse; }
@@ -364,12 +403,14 @@
364
403
  & > .order-first\@#{$breakpoint} { order: -1; }
365
404
  & > .order-last\@#{$breakpoint} { order: 9999; }
366
405
  & > .order-none\@#{$breakpoint} { order: 0; }
367
- @for $i from 1 through $column-count {
368
- & > .w-#{$i}\@#{$breakpoint} { @include w-col($i) }
406
+ & > .shrink\@#{$breakpoint} { @include shrink; }
407
+ & > .shrink-0\@#{$breakpoint} { @include shrink-0; }
408
+ & > .shrink-2\@#{$breakpoint} { @include shrink-2; }
409
+
410
+ @for $i from 1 through VAR.$column-count {
411
+ & > .w-#{$i}\@#{$breakpoint} { @include w-col($i); }
412
+ & > .col-#{$i}\@#{$breakpoint} { @include w-col($i); }
369
413
  & > .order-#{$i}\@#{$breakpoint} { order: $i; }
370
- & > .shrink\@#{$breakpoint} { @include shrink; }
371
- & > .shrink-0\@#{$breakpoint} { @include shrink-0; }
372
- & > .shrink-2\@#{$breakpoint} { @include shrink-2; }
373
414
  }
374
415
  }
375
416
  }
@@ -3,7 +3,7 @@
3
3
 
4
4
  @use 'sass:math';
5
5
  @use '../utilities/functions' as FN;
6
- @use '../utilities/variables' as *;
6
+ @use '../utilities/variables' as VAR;
7
7
 
8
8
  /**
9
9
  * @description Establishes a grid container.
@@ -19,6 +19,19 @@
19
19
  @mixin cols($count) {grid-template-columns: repeat($count, minmax(0, 1fr));}
20
20
  @mixin rows($count) {grid-template-rows: repeat($count, minmax(0, 1fr));}
21
21
 
22
+
23
+ /**
24
+ * @description Establishes a grid container with a specified number of columns.
25
+ * @param {number} $count - The number of columns.
26
+
27
+ /// EXAMPLE USAGE
28
+ .custom-grid {
29
+ display: grid;
30
+ @include cols-custom("1fr_auto_1fr");
31
+ }
32
+
33
+ */
34
+
22
35
  @mixin cols-custom($template) {
23
36
  // Convert underscores to spaces so "1fr_auto" becomes "1fr auto"
24
37
  $converted: FN.str-replace($template, "_", " ");
@@ -68,42 +81,69 @@
68
81
  grid-row: $row;
69
82
  }
70
83
  @mixin position-col($col) {
71
- grid-column: $start;
84
+ grid-column: $col;
72
85
  }
73
86
  @mixin position-row($row) {
74
87
  grid-row: $row;
75
88
  }
76
89
 
77
-
78
- /// EXAMPLE USAGE
79
- .custom-grid {
80
- display: grid;
81
- @include cols-custom("1fr_auto_1fr");
82
- }
90
+ @mixin grid-gap($value) { gap: $value; }
91
+ @mixin col-gap($value) { column-gap: $value; }
92
+ @mixin row-gap($value) { row-gap: $value; }
83
93
 
84
94
  // Classes
85
95
  .grid { @include grid; }
86
96
  .grid.inline { @include grid-inline; }
87
97
 
98
+
99
+ @for $i from 1 through VAR.$column-count {
100
+ .grid.cols-#{$i} { @include cols($i); }
101
+ .grid.rows-#{$i} { @include rows($i); }
102
+ }
103
+
88
104
  // Grid Template Classes
89
- @each $breakpoint, $width in $breakpoints {
90
- // Responsive grid columns
91
- @media (min-width: #{$width}) {
92
- .grid { @include grid; }
105
+ @each $breakpoint, $width in VAR.$breakpoints {
106
+ // Responsive grid columns
107
+ @media (min-width: #{$width}) {
108
+ @for $i from 1 through VAR.$column-count {
109
+ .grid.cols-#{$i}\@#{$breakpoint} { @include cols($i); }
110
+ .grid.rows-#{$i}\@#{$breakpoint} { @include rows($i); }
111
+ }
112
+ }
113
+ }
114
+
93
115
 
94
- @for $i from 1 through $column-count {
95
- .grid.cols-#{$i} { @include cols($i); }
96
- .grid.rows-#{$i} { @include rows($i); }
116
+ // Add corresponding classes
117
+ .grid-gap-1 { @include grid-gap(0.25rem); }
118
+ .grid-gap-2 { @include grid-gap(0.5rem); }
119
+ .grid-gap-4 { @include grid-gap(1rem); }
120
+ .col-gap-1 { @include col-gap(0.25rem); }
121
+ .col-gap-2 { @include col-gap(0.5rem); }
122
+ .col-gap-4 { @include col-gap(1rem); }
123
+ .row-gap-1 { @include row-gap(0.25rem); }
124
+ .row-gap-2 { @include row-gap(0.5rem); }
125
+ .row-gap-4 { @include row-gap(1rem); }
126
+
127
+ // Responsive grid gaps
128
+ @each $breakpoint, $width in VAR.$breakpoints {
129
+ @media (min-width: #{$width}) {
130
+ .grid-gap-1\@#{$breakpoint} { @include grid-gap(0.25rem); }
131
+ .grid-gap-2\@#{$breakpoint} { @include grid-gap(0.5rem); }
132
+ .grid-gap-4\@#{$breakpoint} { @include grid-gap(1rem); }
133
+
134
+ .col-gap-1\@#{$breakpoint} { @include col-gap(0.25rem); }
135
+ .col-gap-2\@#{$breakpoint} { @include col-gap(0.5rem); }
136
+ .col-gap-4\@#{$breakpoint} { @include col-gap(1rem); }
97
137
 
98
- .grid.cols-#{$i}\@#{$breakpoint} {
99
- @include cols($i);
100
- }
101
- }
138
+ .row-gap-1\@#{$breakpoint} { @include row-gap(0.25rem); }
139
+ .row-gap-2\@#{$breakpoint} { @include row-gap(0.5rem); }
140
+ .row-gap-4\@#{$breakpoint} { @include row-gap(1rem); }
102
141
  }
103
142
  }
104
143
 
144
+
105
145
  // Generate Column Span Classes with Responsive Variants
106
- @for $i from 1 through $column-count {
146
+ @for $i from 1 through VAR.$column-count {
107
147
  .span-col-#{$i} {
108
148
  @include span-col($i);
109
149
  }
@@ -112,7 +152,7 @@
112
152
  @include span-row($i);
113
153
  }
114
154
 
115
- @each $breakpoint, $width in $breakpoints {
155
+ @each $breakpoint, $width in VAR.$breakpoints {
116
156
  @media (min-width: #{$width}) {
117
157
  .span-col-#{$i}\@#{$breakpoint} {
118
158
  @include span-col($i);
@@ -127,9 +167,9 @@
127
167
 
128
168
 
129
169
  // Auto-fit/fill Classes
130
- @each $breakpoint, $width in $breakpoints {
131
- .grid.auto-fit-#{$breakpoint} { @include auto-fit($width); }
132
- .grid.auto-fill-#{$breakpoint} { @include auto-fill($width); }
170
+ @each $size, $width in VAR.$grid-item-sizes {
171
+ .grid.auto-fit-#{$size} { @include auto-fit($width); }
172
+ .grid.auto-fill-#{$size} { @include auto-fill($width); }
133
173
  }
134
174
 
135
175
  // Flow Classes
@@ -150,7 +190,7 @@ $alignments: (
150
190
  .align-items-#{$name} { align-items: $value; }
151
191
  .place-items-#{$name} { place-items: $value; }
152
192
 
153
- @each $breakpoint, $width in $breakpoints {
193
+ @each $breakpoint, $width in VAR.$breakpoints {
154
194
  @media (min-width: #{$width}) {
155
195
  .justify-items-#{$name}\@#{$breakpoint} {
156
196
  justify-items: $value;