@nuvoui/core 0.3.1 → 1.0.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.
@@ -1,6 +1,6 @@
1
1
  // _navbar.scss
2
2
 
3
- @use '../utilities/responsive' as Responsive;
3
+ @use '../utilities/media-queries' as Responsive;
4
4
  @use '../utilities/shadows' as *;
5
5
  @use '../utilities/variables' as *;
6
6
  @use '../layouts/container' as Container;
@@ -8,134 +8,130 @@
8
8
 
9
9
  .navbar {
10
10
  @include Container.container-flex;
11
+ @include Flex.align-center;
12
+ @include Flex.between;
11
13
 
12
- & {
13
- @include Flex.align-center;
14
- @include Flex.between;
14
+ &:hover {
15
+ @include shadow('lg', 'dark');
16
+ }
15
17
 
16
- &:hover {
17
- @include shadow('lg', 'dark');
18
- }
18
+ background-color: var(--nav-bg);
19
19
 
20
- background-color: var(--nav-bg);
20
+ .logo {
21
+ img {
22
+ max-height: 40px;
23
+ width: auto;
24
+ }
25
+ }
21
26
 
22
- .logo {
23
- img {
24
- max-height: 40px;
25
- width: auto;
27
+ .submenu {
28
+ background-color: white;
29
+ display: block;
30
+ visibility: hidden; // Use visibility instead of display
31
+ pointer-events: none; // Prevents interaction when hidden
32
+ opacity: 0;
33
+ position: absolute;
34
+ top: 100%;
35
+ left: 0;
36
+ min-width: 200px;
37
+ list-style: none;
38
+ margin: 0;
39
+ padding: 0;
40
+ box-shadow: 0 2px 5px rgba(0 0 0 / 10%);
41
+
42
+ // Animation
43
+ transition:
44
+ opacity 0.2s ease-in-out,
45
+ visibility 0.2s ease-in-out;
46
+
47
+ li {
48
+ a {
49
+ padding: 0.75rem 1rem;
26
50
  }
27
51
  }
28
52
 
29
- .menu {
30
- @include Flex.flex;
31
- list-style: none;
32
- margin: 0;
33
- padding: 0;
34
-
35
- li {
36
- position: relative;
37
-
38
- a {
39
- display: block;
40
- padding: 1rem;
41
- text-decoration: none;
42
- color: var(--nav-text);
43
- transition: background-color 0.2s ease-in-out;
53
+ // Nested dropdowns
54
+ .submenu {
55
+ top: 0;
56
+ left: 100%;
57
+ }
58
+ }
44
59
 
45
- &:hover {
46
- background-color: var(--nav-hover);
47
- }
60
+ .menu {
61
+ @include Flex.flex;
62
+
63
+ list-style: none;
64
+ margin: 0;
65
+ padding: 0;
66
+
67
+ li {
68
+ position: relative;
69
+
70
+ a {
71
+ display: block;
72
+ padding: 1rem;
73
+ text-decoration: none;
74
+ color: var(--nav-text);
75
+ transition: background-color 0.2s ease-in-out;
76
+
77
+ &:hover {
78
+ background-color: var(--nav-hover);
48
79
  }
80
+ }
49
81
 
50
- // Dropdown styles
51
- &:hover>.submenu {
52
- display: block;
53
- visibility: visible;
54
- opacity: 1;
55
- pointer-events: auto; // Re-enable interactions
56
- }
82
+ // Dropdown styles
83
+ &:hover>.submenu {
84
+ display: block;
85
+ visibility: visible;
86
+ opacity: 1;
87
+ pointer-events: auto; // Re-enable interactions
57
88
  }
58
89
  }
90
+ }
59
91
 
60
- .submenu {
61
- background-color: white;
62
- display: block;
63
- visibility: hidden; // Use visibility instead of display
64
- pointer-events: none; // Prevents interaction when hidden
65
- opacity: 0;
66
-
92
+ // Responsive styles
93
+ @include Responsive.media-down(md) {
94
+ .menu {
95
+ transition: all 1.3s ease;
96
+ display: none;
97
+ flex-direction: column;
98
+ background-color: var(--nav-bg);
67
99
  position: absolute;
68
100
  top: 100%;
69
101
  left: 0;
70
- min-width: 200px;
71
- list-style: none;
72
- margin: 0;
73
- padding: 0;
74
- background-color: var(--nav-bg);
75
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
76
-
77
- // Animation
78
- transition:
79
- opacity 0.2s ease-in-out,
80
- visibility 0.2s ease-in-out;
102
+ width: 100%;
81
103
 
82
- li {
83
- a {
84
- padding: 0.75rem 1rem;
85
- }
104
+ &[data-visible="true"] {
105
+ display: flex;
86
106
  }
87
107
 
88
- // Nested dropdowns
89
- .submenu {
90
- top: 0;
91
- left: 100%;
92
- }
93
- }
94
-
95
- // Responsive styles
96
- @include Responsive.media-down(md) {
97
- .menu {
98
- transition: all 1.3s ease;
99
- display: none;
100
- flex-direction: column;
101
- background-color: var(--nav-bg);
102
- position: absolute;
103
- top: 100%;
104
- left: 0;
108
+ li {
105
109
  width: 100%;
110
+ text-align: left;
106
111
 
107
- &[data-visible="true"] {
108
- display: flex;
109
- }
112
+ .submenu {
113
+ position: relative;
114
+ left: 0;
115
+ top: 0;
116
+ display: none;
117
+ visibility: visible;
118
+ opacity: 1;
119
+ pointer-events: auto;
120
+ box-shadow: none;
121
+ background-color: var(--nav-hover);
110
122
 
111
- li {
112
- width: 100%;
113
- text-align: left;
114
-
115
- .submenu {
116
- position: relative;
117
- left: 0;
118
- top: 0;
119
- display: none;
120
- visibility: visible;
121
- opacity: 1;
122
- pointer-events: auto;
123
- box-shadow: none;
124
- background-color: var(--nav-hover);
125
-
126
- &[data-visible="true"] {
127
- display: flex;
128
- flex-direction: column;
129
- }
123
+ &[data-visible="true"] {
124
+ display: flex;
125
+ flex-direction: column;
130
126
  }
131
127
  }
132
128
  }
129
+ }
133
130
 
134
- .navbar__cta {
135
- width: 100%;
136
- justify-content: center;
137
- padding: 1rem 0;
138
- }
131
+ .navbar__cta {
132
+ width: 100%;
133
+ justify-content: center;
134
+ padding: 1rem 0;
139
135
  }
140
136
  }
141
137
  }
@@ -1,6 +1,5 @@
1
- // Forward all modules for external use
1
+ /* Forward all modules for external use */
2
2
  @forward 'utilities/variables';
3
- @forward './global';
4
3
 
5
4
  // Base styles
6
5
  @forward 'base/reset';
@@ -8,12 +7,14 @@
8
7
 
9
8
  // Utilities
10
9
  @forward 'utilities/animations';
10
+ @forward 'utilities/borders';
11
11
  @forward 'utilities/colors';
12
12
  @forward 'utilities/display';
13
- @forward 'utilities/hamburger';
13
+ @forward 'utilities/opacity';
14
14
  @forward 'utilities/position';
15
- @forward 'utilities/responsive';
15
+ @forward 'utilities/media-queries';
16
16
  @forward 'utilities/shadows';
17
+ @forward 'utilities/sizing';
17
18
  @forward 'utilities/spacing';
18
19
  @forward 'utilities/typography';
19
20
  @forward 'utilities/tooltips';
@@ -30,8 +31,6 @@
30
31
 
31
32
  // Components
32
33
  @forward 'components/button';
34
+ @forward 'components/hamburger';
33
35
  @forward 'components/navbar';
34
- @forward 'components/form';
35
-
36
- // Local usage
37
- @use './global' as *;
36
+ @forward 'components/form';
@@ -12,6 +12,7 @@
12
12
 
13
13
  @mixin container {
14
14
  @include container-base;
15
+
15
16
  & {
16
17
  @each $breakpoint, $width in $container-max-widths {
17
18
  @media (min-width: map.get($breakpoints, $breakpoint)) {
@@ -38,14 +38,18 @@
38
38
  @mixin self-center {align-self: center;}
39
39
  @mixin self-stretch {align-self: stretch;}
40
40
 
41
+ @mixin shrink {flex-shrink: 1;}
42
+ @mixin shrink-0 {flex-shrink: 0;}
43
+ @mixin shrink-2 {flex-shrink: 2;}
44
+
41
45
  // Flex Child Mixins
42
- @mixin w-full {flex: 0 0 100%;}
43
- @mixin w-auto {flex: 1 1 auto;}
46
+ @mixin f-w-full {flex: 0 0 100%;}
47
+ @mixin f-w-auto {flex: 1 1 auto;}
44
48
  @mixin grow { flex: 1 1 0%; }
45
49
  @mixin no-grow { flex: none; }
46
50
 
47
51
  @mixin w-col($size) {
48
- flex: 0 0 math.percentage(math.div($size, $column-count));
52
+ flex: 0 0 math.percentage(math.div($size, $column-count)) !important;
49
53
  }
50
54
 
51
55
  // Base flex container
@@ -79,10 +83,18 @@
79
83
  &.items-stretch { align-items: stretch; }
80
84
 
81
85
  // Child flex items (using column count)
82
- > .w-auto { @include w-auto }
83
- > .w-full { @include w-full }
86
+ > .w-auto { @include f-w-auto }
87
+ > .w-full { @include f-w-full }
84
88
  > .grow { @include grow; }
85
89
  > .no-grow { @include no-grow; }
90
+
91
+ > .order-first { order: -1; }
92
+ > .order-last { order: 9999; }
93
+ > .order-none { order: 0; }
94
+
95
+ > .shrink { @include shrink; }
96
+ > .shrink-0 { @include shrink-0; }
97
+ > .shrink-2 { @include shrink-2; }
86
98
  @for $i from 1 through $column-count {
87
99
  > .w-#{$i} { @include w-col($i) }
88
100
  > .order-#{$i} { order: $i; }
@@ -121,13 +133,19 @@
121
133
  &.items-stretch\@#{$breakpoint} { align-items: stretch; }
122
134
 
123
135
  // Width (using column count)
124
- & > .w-auto\@#{$breakpoint} { flex: 1 1 auto; }
125
- & > .w-full\@#{$breakpoint} { flex: 0 0 100%; }
136
+ & > .w-auto\@#{$breakpoint} { @include f-w-auto; }
137
+ & > .w-full\@#{$breakpoint} { @include f-w-full; }
126
138
  & > .grow\@#{$breakpoint} { @include grow; }
127
139
  & > .no-grow\@#{$breakpoint} { @include no-grow; }
140
+ & > .order-first\@#{$breakpoint} { order: -1; }
141
+ & > .order-last\@#{$breakpoint} { order: 9999; }
142
+ & > .order-none\@#{$breakpoint} { order: 0; }
128
143
  @for $i from 1 through $column-count {
129
144
  & > .w-#{$i}\@#{$breakpoint} { @include w-col($i) }
130
145
  & > .order-#{$i}\@#{$breakpoint} { order: $i; }
146
+ & > .shrink\@#{$breakpoint} { @include shrink; }
147
+ & > .shrink-0\@#{$breakpoint} { @include shrink-0; }
148
+ & > .shrink-2\@#{$breakpoint} { @include shrink-2; }
131
149
  }
132
150
  }
133
151
  }
@@ -82,15 +82,13 @@
82
82
  // Responsive grid columns
83
83
  @each $breakpoint, $width in $breakpoints {
84
84
  @media (min-width: $width) {
85
- .grid.#{$breakpoint}\:cols-#{$i} {
85
+ .grid.cols-#{$i}#{$breakpoint} {
86
86
  @include grid-cols($i);
87
87
  }
88
88
  }
89
89
  }
90
90
  }
91
91
 
92
-
93
-
94
92
  // Generate Column Span Classes with Responsive Variants
95
93
  @for $i from 1 through $column-count {
96
94
  .col-span-#{$i} {
@@ -99,7 +97,7 @@
99
97
 
100
98
  @each $breakpoint, $width in $breakpoints {
101
99
  @media (min-width: $width) {
102
- .#{$breakpoint}\:col-span-#{$i} {
100
+ .col-span-#{$i}\@#{$breakpoint} {
103
101
  @include col-span($i);
104
102
  }
105
103
  }
@@ -108,7 +106,7 @@
108
106
 
109
107
 
110
108
  // Auto-fit/fill Classes
111
- @each $breakpoint, $width in $column-widths {
109
+ @each $breakpoint, $width in $breakpoints {
112
110
  .grid.auto-fit-#{$breakpoint} { @include grid-auto-fit($width); }
113
111
  .grid.auto-fill-#{$breakpoint} { @include grid-auto-fill($width); }
114
112
  }
@@ -133,13 +131,13 @@ $alignments: (
133
131
 
134
132
  @each $breakpoint, $width in $breakpoints {
135
133
  @media (min-width: $width) {
136
- .#{$breakpoint}\:justify-items-#{$name} {
134
+ .justify-items-#{$name}\@#{$breakpoint} {
137
135
  justify-items: $value;
138
136
  }
139
- .#{$breakpoint}\:align-items-#{$name} {
137
+ .align-items-#{$name}\@#{$breakpoint} {
140
138
  align-items: $value;
141
139
  }
142
- .#{$breakpoint}\:place-items-#{$name} {
140
+ .place-items-#{$name}\@#{$breakpoint} {
143
141
  place-items: $value;
144
142
  }
145
143
  }
@@ -98,7 +98,7 @@ $opacity-levels: (
98
98
  // Tooltip
99
99
  --tooltip-bg: var(--dark);
100
100
  --tooltip-text: var(--light);
101
- --tooltip-shadow-color: rgba(0,0,0,0.4);
101
+ --tooltip-shadow-color: rgb(0 0 0 / 40%);
102
102
  --microtip-transition-duration: 0.518s;
103
103
  --microtip-transition-delay: .2s;
104
104
  --microtip-transition-easing: cubic-bezier(0.16, 1, 0.9, 1);
@@ -6,7 +6,7 @@
6
6
  $generated-keyframes: ();
7
7
 
8
8
 
9
- @mixin generateBounceKeyframes($keyframeName, $x, $y) {
9
+ @mixin generate-bounce-keyframes($keyframeName, $x, $y) {
10
10
  @if not list.index($generated-keyframes, $keyframeName) {
11
11
  $generated-keyframes: list.append($generated-keyframes, $keyframeName) !global;
12
12
 
@@ -14,9 +14,11 @@ $generated-keyframes: ();
14
14
  0% {
15
15
  transform: translateX(-#{$x}) translateY(-#{$y});
16
16
  }
17
+
17
18
  50% {
18
19
  transform: translateX(#{$x}) translateY(#{$y});
19
20
  }
21
+
20
22
  100% {
21
23
  transform: translateX(-#{$x}) translateY(-#{$y});
22
24
  }
@@ -32,9 +34,9 @@ $generated-keyframes: ();
32
34
  timing: ease-in-out,
33
35
  iteration: infinite
34
36
  );
37
+
35
38
  // Merge with defaults
36
39
  $props: map.merge($defaults, $props);
37
-
38
40
  $x: map.get($props, 'horizontal');
39
41
  $y: map.get($props, 'vertical');
40
42
  $duration: map.get($props, 'duration');
@@ -46,16 +48,15 @@ $generated-keyframes: ();
46
48
  $y-unit: if($y, safe-unit-name(get-unit($y)), '-');
47
49
 
48
50
  // Clean values (remove units)
49
- $cleanX: if($x, strip-unit($x), 0);
50
- $cleanY: if($y, strip-unit($y), 0);
51
-
52
- $animationName: anim-bounce-#{$cleanX}#{$x-unit}-#{$cleanY}#{$y-unit};
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};
53
54
 
54
55
 
55
56
  & {
56
- animation: #{$animationName} $duration $easing $iteration;
57
+ animation: #{$animation-name} $duration $easing $iteration;
57
58
  }
58
- @include generateBounceKeyframes($animationName, $x, $y);
59
+ @include generate-bounce-keyframes($animation-name, $x, $y);
59
60
  }
60
61
 
61
62
 
@@ -71,64 +72,9 @@ $generated-keyframes: ();
71
72
  .anim__fade-in-reveal {
72
73
  scale: .2;
73
74
  opacity: 0.7;
74
-
75
75
  animation: fade-in-reveal linear forwards;
76
76
  animation-timeline: view();
77
-
78
77
  animation-range-start: cover;
79
78
  animation-range-end: 550px;
80
-
81
- // animation-range: enter;
82
- // animation-range: exit;
83
79
  }
84
- }
85
-
86
- @keyframes fadeOutAndCollapse {
87
- 0% {
88
- opacity: 1;
89
- bottom: 0px;
90
- height: auto;
91
- }
92
- 50% {
93
- bottom: -500px;
94
- opacity: 0;
95
- }
96
- 100% {
97
- bottom: 100%;
98
- opacity: 0;
99
- height: 0;
100
- overflow: hidden;
101
- }
102
- }
103
-
104
-
105
-
106
-
107
- // @keyframes moveVertical {
108
- // 0% {
109
- // transform: translateY(-5%);
110
- // }
111
-
112
- // 50% {
113
- // transform: translateY(5%);
114
- // }
115
-
116
- // 100% {
117
- // transform: translateY(-5%);
118
- // }
119
- // }
120
-
121
- // @keyframes moveHorizontal {
122
- // 0% {
123
- // transform: translateX(-50%) translateY(-10%);
124
- // }
125
-
126
- // 50% {
127
- // transform: translateX(50%) translateY(10%);
128
- // }
129
-
130
- // 100% {
131
- // transform: translateX(-50%) translateY(-10%);
132
- // }
133
- // }
134
-
80
+ }
@@ -0,0 +1,36 @@
1
+ // _spacing.scss
2
+
3
+ @use 'sass:math';
4
+ @use './variables' as *;
5
+
6
+ // todo: mixins mising and also finalize .b .bb or not to .b
7
+ @mixin border($val) { $val: if($val == 0, $val, $val + px); border-width: $val; }
8
+ @mixin rounded($val) { border-radius: $val; }
9
+
10
+ .border { @include border(1); }
11
+ .border-0 { @include border(0); }
12
+
13
+ @each $i in 0 1 2 4 8 {
14
+ .border-#{$i} { @include border($i); }
15
+ }
16
+
17
+ @each $color-name, $color-value in $colors {
18
+ .border-#{$color-name} { border-color: $color-value; }
19
+ }
20
+
21
+ .rounded { @include rounded(0.25rem); }
22
+ .square { @include rounded(0) }
23
+ .pill { @include rounded(9999px); }
24
+
25
+ // Responsive Position Classes
26
+ @each $breakpoint, $width in $breakpoints {
27
+ @media (min-width: $width) {
28
+
29
+ @each $i in 0 1 2 4 8 {
30
+ .border-#{$i}\@#{$breakpoint} { @include border($i); }
31
+ }
32
+ @each $i in 0 2 3 4 5 10 15 20 25 {
33
+ .rounded-#{$i}\@#{$breakpoint} { @include border($i); }
34
+ }
35
+ }
36
+ }
@@ -1,20 +1,23 @@
1
1
  @use "sass:math";
2
2
  @use 'sass:color';
3
3
  @use 'sass:map';
4
+ @use 'sass:meta';
5
+ @use 'sass:list';
4
6
 
5
7
  @use './variables' as *;
6
8
 
9
+
10
+ // todo: only functions and may be not needed
11
+
7
12
  @each $color-name, $color-value in $colors {
8
13
  .text-#{$color-name} { color: $color-value; }
9
14
  .bg-#{$color-name} { background-color: $color-value; }
10
15
  }
11
16
 
12
17
  // Modern Color System
13
- // _colors.scss
14
-
15
18
  // Color Validation
16
19
  @function is-valid-color($color) {
17
- @return type-of($color) == 'color';
20
+ @return meta.type-of($color) == 'color';
18
21
  }
19
22
 
20
23
  // Modern Color Spaces
@@ -39,22 +42,22 @@
39
42
 
40
43
  // Color Harmony Generation
41
44
  @function complementary($color) {
42
- @return adjust-hue($color, 180);
45
+ @return color.adjust($color, 180);
43
46
  }
44
47
 
45
48
  @function triadic($color) {
46
49
  @return (
47
50
  $color,
48
- adjust-hue($color, 120),
49
- adjust-hue($color, 240)
51
+ color.adjust($color, 120),
52
+ color.adjust($color, 240)
50
53
  );
51
54
  }
52
55
 
53
56
  @function split-complementary($color) {
54
57
  @return (
55
58
  $color,
56
- adjust-hue($color, 150),
57
- adjust-hue($color, 210)
59
+ color.adjust($color, 150),
60
+ color.adjust($color, 210)
58
61
  );
59
62
  }
60
63
 
@@ -74,7 +77,7 @@
74
77
  @for $i from 0 through $steps {
75
78
  $lightness: 95 - ($i * (90 / $steps));
76
79
  $new-color: color.adjust($lch-color, $lightness: $lightness);
77
- $scale: append($scale, $new-color);
80
+ $scale: list.append($scale, $new-color);
78
81
  }
79
82
 
80
83
  @return $scale;
@@ -88,13 +91,13 @@
88
91
 
89
92
  // Luminance Calculation
90
93
  @function luminance($color) {
91
- $r: red($color) / 255;
92
- $g: green($color) / 255;
93
- $b: blue($color) / 255;
94
+ $r: color.red($color) / 255;
95
+ $g: color.green($color) / 255;
96
+ $b: color.blue($color) / 255;
94
97
 
95
- $r: if($r <= 0.03928, $r / 12.92, pow(($r + 0.055) / 1.055, 2.4));
96
- $g: if($g <= 0.03928, $g / 12.92, pow(($g + 0.055) / 1.055, 2.4));
97
- $b: if($b <= 0.03928, $b / 12.92, pow(($b + 0.055) / 1.055, 2.4));
98
+ $r: if($r <= 0.0393, $r / 12.92, pow(($r + 0.055) / 1.055, 2.4));
99
+ $g: if($g <= 0.0393, $g / 12.92, pow(($g + 0.055) / 1.055, 2.4));
100
+ $b: if($b <= 0.0393, $b / 12.92, pow(($b + 0.055) / 1.055, 2.4));
98
101
 
99
102
  @return $r * 0.2126 + $g * 0.7152 + $b * 0.0722;
100
103
  }
@@ -119,28 +122,29 @@
119
122
 
120
123
  @media (prefers-contrast: more) {
121
124
  $high-contrast: adjust-contrast($background, 20%);
125
+
122
126
  background: $high-contrast;
123
127
  }
124
128
  }
125
129
 
126
130
  // Filter Mixins
127
131
  @mixin backdrop-filter($value) {
128
- -webkit-backdrop-filter: $value;
129
132
  backdrop-filter: $value;
130
133
  }
131
134
 
132
135
  @mixin filter($value) {
133
- -webkit-filter: $value;
134
136
  filter: $value;
135
137
  }
136
138
 
137
139
  // Glass Effect Utilities
138
140
  .glass-effect {
139
141
  @include backdrop-filter(blur(10px));
140
- background-color: rgba(255, 255, 255, 0.1);
142
+
143
+ background-color: rgb(255 255 255 / 10%);
141
144
  }
142
145
 
143
146
  .frosted-glass {
144
147
  @include backdrop-filter(blur(5px) saturate(180%));
145
- background-color: rgba(255, 255, 255, 0.8);
148
+
149
+ background-color: rgb(255 255 255 / 80%);
146
150
  }