@nuvoui/core 0.3.0 → 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,125 +1,137 @@
1
1
  // _navbar.scss
2
2
 
3
- @use '../utilities/variables' as *;
3
+ @use '../utilities/media-queries' as Responsive;
4
4
  @use '../utilities/shadows' as *;
5
+ @use '../utilities/variables' as *;
5
6
  @use '../layouts/container' as Container;
6
7
  @use '../layouts/flex' as Flex;
7
- @use '../layouts/grid' as Grid;
8
-
9
- :root {
10
- --shadow-color: 255, 0, 0;
11
- }
12
8
 
13
9
  .navbar {
14
-
15
- @include Flex.between;
16
10
  @include Container.container-flex;
11
+ @include Flex.align-center;
12
+ @include Flex.between;
17
13
 
18
- // @include Grid.grid-flow-row;
19
- // @include Grid.grid-flow-col;
20
- // @include Grid.grid-cols(2);
21
- // @include Container.container-grid;
22
-
23
- & {
24
- @include Flex.align-center;
25
- // @include shadow('md', 'colored');
14
+ &:hover {
15
+ @include shadow('lg', 'dark');
16
+ }
26
17
 
27
- background-color: var(--nav-bg);
18
+ background-color: var(--nav-bg);
28
19
 
29
- &:hover {
30
- @include shadow('lg', 'dark');
20
+ .logo {
21
+ img {
22
+ max-height: 40px;
23
+ width: auto;
31
24
  }
25
+ }
32
26
 
33
- .logo {
34
- img {
35
- max-height: 40px;
36
- 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;
37
50
  }
38
51
  }
39
52
 
40
- .menu {
41
- @include Flex.flex;
42
- list-style: none;
43
- margin: 0;
44
- padding: 0;
45
-
46
- li {
47
- position: relative;
48
-
49
- a {
50
- display: block;
51
- padding: 1rem;
52
- text-decoration: none;
53
- color: var(--nav-text);
54
- transition: background-color 0.2s ease-in-out;
53
+ // Nested dropdowns
54
+ .submenu {
55
+ top: 0;
56
+ left: 100%;
57
+ }
58
+ }
55
59
 
56
- &:hover {
57
- background-color: var(--nav-hover);
58
- }
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);
59
79
  }
80
+ }
60
81
 
61
- // Dropdown styles
62
- &:hover>.submenu {
63
- display: block;
64
- visibility: visible;
65
- opacity: 1;
66
- pointer-events: auto; // Re-enable interactions
67
- }
82
+ // Dropdown styles
83
+ &:hover>.submenu {
84
+ display: block;
85
+ visibility: visible;
86
+ opacity: 1;
87
+ pointer-events: auto; // Re-enable interactions
68
88
  }
69
89
  }
90
+ }
70
91
 
71
- .submenu {
72
- background-color: white;
73
- display: block;
74
- visibility: hidden; // Use visibility instead of display
75
- pointer-events: none; // Prevents interaction when hidden
76
- opacity: 0;
77
-
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);
78
99
  position: absolute;
79
100
  top: 100%;
80
101
  left: 0;
81
- min-width: 200px;
82
- list-style: none;
83
- margin: 0;
84
- padding: 0;
85
- background-color: var(--nav-bg);
86
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
87
-
88
- // Animation
89
- transition:
90
- opacity 0.2s ease-in-out,
91
- visibility 0.2s ease-in-out;
92
-
93
- li {
94
- a {
95
- padding: 0.75rem 1rem;
96
- }
97
- }
102
+ width: 100%;
98
103
 
99
- // Nested dropdowns
100
- .submenu {
101
- top: 0;
102
- left: 100%;
104
+ &[data-visible="true"] {
105
+ display: flex;
103
106
  }
104
- }
105
-
106
- @media (max-width: 768px) {
107
- flex-direction: column;
108
107
 
109
- .menu {
110
- flex-direction: column;
108
+ li {
111
109
  width: 100%;
110
+ text-align: left;
112
111
 
113
112
  .submenu {
114
- position: static;
113
+ position: relative;
114
+ left: 0;
115
+ top: 0;
115
116
  display: none;
116
- width: 100%;
117
+ visibility: visible;
118
+ opacity: 1;
119
+ pointer-events: auto;
120
+ box-shadow: none;
121
+ background-color: var(--nav-hover);
117
122
 
118
- li a {
119
- padding-left: 2rem;
123
+ &[data-visible="true"] {
124
+ display: flex;
125
+ flex-direction: column;
120
126
  }
121
127
  }
122
128
  }
123
129
  }
130
+
131
+ .navbar__cta {
132
+ width: 100%;
133
+ justify-content: center;
134
+ padding: 1rem 0;
135
+ }
124
136
  }
125
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,9 +7,14 @@
8
7
 
9
8
  // Utilities
10
9
  @forward 'utilities/animations';
10
+ @forward 'utilities/borders';
11
11
  @forward 'utilities/colors';
12
+ @forward 'utilities/display';
13
+ @forward 'utilities/opacity';
12
14
  @forward 'utilities/position';
15
+ @forward 'utilities/media-queries';
13
16
  @forward 'utilities/shadows';
17
+ @forward 'utilities/sizing';
14
18
  @forward 'utilities/spacing';
15
19
  @forward 'utilities/typography';
16
20
  @forward 'utilities/tooltips';
@@ -27,8 +31,6 @@
27
31
 
28
32
  // Components
29
33
  @forward 'components/button';
34
+ @forward 'components/hamburger';
30
35
  @forward 'components/navbar';
31
- @forward 'components/form';
32
-
33
- // Local usage
34
- @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,9 +38,19 @@
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;}
48
+ @mixin grow { flex: 1 1 0%; }
49
+ @mixin no-grow { flex: none; }
50
+
51
+ @mixin w-col($size) {
52
+ flex: 0 0 math.percentage(math.div($size, $column-count)) !important;
53
+ }
44
54
 
45
55
  // Base flex container
46
56
  .flex {
@@ -72,19 +82,22 @@
72
82
  &.items-baseline { align-items: baseline; }
73
83
  &.items-stretch { align-items: stretch; }
74
84
 
75
- // Gap modifiers
76
- @for $i from 0 through 8 {
77
- &.gap-#{$i} { gap: #{$i * 0.25}rem; }
78
- }
79
-
80
85
  // Child flex items (using column count)
81
- > .w-auto { flex: 1 1 auto; }
82
- > .w-full { flex: 0 0 100%; }
83
-
86
+ > .w-auto { @include f-w-auto }
87
+ > .w-full { @include f-w-full }
88
+ > .grow { @include grow; }
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; }
84
98
  @for $i from 1 through $column-count {
85
- > .w-#{$i} {
86
- flex: 0 0 math.percentage( math.div($i, $column-count));
87
- }
99
+ > .w-#{$i} { @include w-col($i) }
100
+ > .order-#{$i} { order: $i; }
88
101
  }
89
102
  }
90
103
 
@@ -92,45 +105,48 @@
92
105
  // Responsive variants
93
106
  @each $breakpoint, $width in $breakpoints {
94
107
  @media (min-width: $width) {
95
- // Direction
96
- .flex.row\@#{$breakpoint} { flex-direction: row; }
97
- .flex.row-reverse\@#{$breakpoint} { flex-direction: row-reverse; }
98
- .flex.col\@#{$breakpoint} { flex-direction: column; }
99
- .flex.col-reverse\@#{$breakpoint} { flex-direction: column-reverse; }
100
-
101
- // Wrap
102
- .flex.wrap\@#{$breakpoint} { flex-wrap: wrap; }
103
- .flex.nowrap\@#{$breakpoint} { flex-wrap: nowrap; }
104
- .flex.wrap-reverse\@#{$breakpoint} { flex-wrap: wrap-reverse; }
105
-
106
- // Justify
107
- .flex.start\@#{$breakpoint} { justify-content: flex-start; }
108
- .flex.end\@#{$breakpoint} { justify-content: flex-end; }
109
- .flex.center\@#{$breakpoint} { justify-content: center; }
110
- .flex.between\@#{$breakpoint} { justify-content: space-between; }
111
- .flex.around\@#{$breakpoint} { justify-content: space-around; }
112
- .flex.evenly\@#{$breakpoint} { justify-content: space-evenly; }
113
-
114
- // Align
115
- .flex.items-start\@#{$breakpoint} { align-items: flex-start; }
116
- .flex.items-end\@#{$breakpoint} { align-items: flex-end; }
117
- .flex.items-center\@#{$breakpoint} { align-items: center; }
118
- .flex.items-baseline\@#{$breakpoint} { align-items: baseline; }
119
- .flex.items-stretch\@#{$breakpoint} { align-items: stretch; }
120
-
121
- // Width (using column count)
122
- .flex.w-auto\@#{$breakpoint} { flex: 1 1 auto; }
123
- .flex.w-full\@#{$breakpoint} { flex: 0 0 100%; }
124
-
125
- @for $i from 1 through $column-count {
126
- .flex.w-#{$i}\@#{$breakpoint} {
127
- flex: 0 0 math.percentage(math.div($i, $column-count));
108
+ .flex {
109
+ // Direction
110
+ &.row\@#{$breakpoint} { flex-direction: row; }
111
+ &.row-reverse\@#{$breakpoint} { flex-direction: row-reverse; }
112
+ &.col\@#{$breakpoint} { flex-direction: column; }
113
+ &.col-reverse\@#{$breakpoint} { flex-direction: column-reverse; }
114
+
115
+ // Wrap
116
+ &.wrap\@#{$breakpoint} { flex-wrap: wrap; }
117
+ &.nowrap\@#{$breakpoint} { flex-wrap: nowrap; }
118
+ &.wrap-reverse\@#{$breakpoint} { flex-wrap: wrap-reverse; }
119
+
120
+ // Justify
121
+ &.start\@#{$breakpoint} { justify-content: flex-start; }
122
+ &.end\@#{$breakpoint} { justify-content: flex-end; }
123
+ &.center\@#{$breakpoint} { justify-content: center; }
124
+ &.between\@#{$breakpoint} { justify-content: space-between; }
125
+ &.around\@#{$breakpoint} { justify-content: space-around; }
126
+ &.evenly\@#{$breakpoint} { justify-content: space-evenly; }
127
+
128
+ // Align
129
+ &.items-start\@#{$breakpoint} { align-items: flex-start; }
130
+ &.items-end\@#{$breakpoint} { align-items: flex-end; }
131
+ &.items-center\@#{$breakpoint} { align-items: center; }
132
+ &.items-baseline\@#{$breakpoint} { align-items: baseline; }
133
+ &.items-stretch\@#{$breakpoint} { align-items: stretch; }
134
+
135
+ // Width (using column count)
136
+ & > .w-auto\@#{$breakpoint} { @include f-w-auto; }
137
+ & > .w-full\@#{$breakpoint} { @include f-w-full; }
138
+ & > .grow\@#{$breakpoint} { @include grow; }
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; }
143
+ @for $i from 1 through $column-count {
144
+ & > .w-#{$i}\@#{$breakpoint} { @include w-col($i) }
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; }
128
149
  }
129
150
  }
130
-
131
- // Gap
132
- @for $i from 0 through 8 {
133
- .flex.gap-#{$i}\@#{$breakpoint} { gap: #{$i * 0.25}rem; }
134
- }
135
151
  }
136
152
  }
@@ -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
  }
@@ -24,8 +26,7 @@ $generated-keyframes: ();
24
26
  }
25
27
  }
26
28
 
27
-
28
- @mixin animate-move($props) {
29
+ @mixin animate-bounce($props) {
29
30
  $defaults: (
30
31
  vertical: 0%,
31
32
  horizontal: 0%,
@@ -33,11 +34,11 @@ $generated-keyframes: ();
33
34
  timing: ease-in-out,
34
35
  iteration: infinite
35
36
  );
37
+
36
38
  // Merge with defaults
37
39
  $props: map.merge($defaults, $props);
38
-
39
- $x: map.get($props, 'vertical');
40
- $y: map.get($props, 'horizontal');
40
+ $x: map.get($props, 'horizontal');
41
+ $y: map.get($props, 'vertical');
41
42
  $duration: map.get($props, 'duration');
42
43
  $easing: map.get($props, 'timing');
43
44
  $iteration: map.get($props, 'iteration');
@@ -47,16 +48,15 @@ $generated-keyframes: ();
47
48
  $y-unit: if($y, safe-unit-name(get-unit($y)), '-');
48
49
 
49
50
  // Clean values (remove units)
50
- $cleanX: if($x, strip-unit($x), 0);
51
- $cleanY: if($y, strip-unit($y), 0);
52
-
53
- $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};
54
54
 
55
55
 
56
56
  & {
57
- animation: #{$animationName} $duration $easing $iteration;
57
+ animation: #{$animation-name} $duration $easing $iteration;
58
58
  }
59
- @include generateBounceKeyframes($animationName, $x, $y);
59
+ @include generate-bounce-keyframes($animation-name, $x, $y);
60
60
  }
61
61
 
62
62
 
@@ -72,64 +72,9 @@ $generated-keyframes: ();
72
72
  .anim__fade-in-reveal {
73
73
  scale: .2;
74
74
  opacity: 0.7;
75
-
76
75
  animation: fade-in-reveal linear forwards;
77
76
  animation-timeline: view();
78
-
79
77
  animation-range-start: cover;
80
78
  animation-range-end: 550px;
81
-
82
- // animation-range: enter;
83
- // animation-range: exit;
84
- }
85
- }
86
-
87
- @keyframes fadeOutAndCollapse {
88
- 0% {
89
- opacity: 1;
90
- bottom: 0px;
91
- height: auto;
92
- }
93
- 50% {
94
- bottom: -500px;
95
- opacity: 0;
96
- }
97
- 100% {
98
- bottom: 100%;
99
- opacity: 0;
100
- height: 0;
101
- overflow: hidden;
102
79
  }
103
- }
104
-
105
-
106
-
107
-
108
- // @keyframes moveVertical {
109
- // 0% {
110
- // transform: translateY(-5%);
111
- // }
112
-
113
- // 50% {
114
- // transform: translateY(5%);
115
- // }
116
-
117
- // 100% {
118
- // transform: translateY(-5%);
119
- // }
120
- // }
121
-
122
- // @keyframes moveHorizontal {
123
- // 0% {
124
- // transform: translateX(-50%) translateY(-10%);
125
- // }
126
-
127
- // 50% {
128
- // transform: translateX(50%) translateY(10%);
129
- // }
130
-
131
- // 100% {
132
- // transform: translateX(-50%) translateY(-10%);
133
- // }
134
- // }
135
-
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
+ }