@nuvoui/core 1.1.5 → 1.1.7

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.
@@ -0,0 +1,128 @@
1
+ @use 'sass:string';
2
+ @use 'sass:math';
3
+ @use 'sass:map';
4
+ @use 'sass:list';
5
+ @use 'sass:meta';
6
+ @use 'variables' as *;
7
+
8
+ @if $enable-debuger {
9
+ .NuvoUI-Debugger-Wrapper {
10
+ color: #fff;
11
+ font-family: Arial, sans-serif;
12
+ position: fixed;
13
+ z-index: 999999;
14
+ inset: 10px auto auto 10px;
15
+ pointer-events: none;
16
+
17
+ &.top-left {
18
+ inset: 10px auto auto 10px;
19
+ text-align: left;
20
+ }
21
+
22
+ &.top-right {
23
+ inset: 10px 10px auto auto;
24
+ text-align: right;
25
+ }
26
+
27
+ &.bottom-left {
28
+ inset: auto auto 10px 10px;
29
+ text-align: left;
30
+ }
31
+
32
+ &.bottom-right {
33
+ inset: auto 10px 10px auto;
34
+ text-align: right;
35
+ }
36
+
37
+ .NuvoUI-Debugger-Main, .NuvoUI-Debugger{
38
+ padding: 10px;
39
+ background-color: rgb(0 0 0 / 80%);
40
+ border-radius: 5px;
41
+ border: 1px solid green;
42
+ box-shadow: 0 0 2px 0 #fff;
43
+ pointer-events: none;
44
+ }
45
+
46
+ .NuvoUI-Debugger-Main {
47
+ $breakpoint-keys: map.keys($breakpoints);
48
+ $total: list.length($breakpoint-keys);
49
+
50
+ &::before,
51
+ &::after {
52
+ font-family: 'Courier New', Courier, monospace;
53
+ font-size: 0.8em;
54
+ display: block;
55
+ }
56
+
57
+ &::before {
58
+ font-weight: bold;
59
+ }
60
+
61
+ @for $i from 1 through $total {
62
+ $current: list.nth($breakpoint-keys, $i);
63
+ $current-width: map.get($breakpoints, $current);
64
+
65
+ @if $i == 1 {
66
+ @media (max-width: #{$current-width}) {
67
+ &::before {
68
+ content: "Screen: #{$current}";
69
+ }
70
+ }
71
+ } @else {
72
+ $prev: list.nth($breakpoint-keys, $i - 1);
73
+ $prev-width: map.get($breakpoints, $prev);
74
+
75
+ @media (min-width: #{$prev-width}) and (max-width: (#{$current-width} - 1)) {
76
+ &::before {
77
+ content: "Screen: #{$current}";
78
+ }
79
+ }
80
+ }
81
+ }
82
+
83
+ &::after {
84
+ content: attr(data-size);
85
+ }
86
+ }
87
+
88
+ .NuvoUI-Debugger {
89
+ margin-top: 10px;
90
+
91
+ &::before,
92
+ &::after {
93
+ font-family: 'Courier New', Courier, monospace;
94
+ font-size: 0.8em;
95
+ display: block;
96
+ }
97
+
98
+ &::before {
99
+ font-weight: bold;
100
+ content: attr(data-element);
101
+ }
102
+
103
+ &::after {
104
+ content: attr(data-size);
105
+ }
106
+ }
107
+
108
+ .NuvoUI-Debugger-Close {
109
+ color: #fff;
110
+ cursor: pointer;
111
+ font-size: 14px;
112
+ pointer-events: auto;
113
+ position: absolute;
114
+ right: 0;
115
+ top: 0;
116
+ background: #00800199;
117
+ border-radius: 20px;
118
+ height: 14px;
119
+ width: 14px;
120
+ line-height: 14px;
121
+ text-align: center;
122
+
123
+ &:hover {
124
+ background: #008001;
125
+ }
126
+ }
127
+ }
128
+ }
@@ -1,91 +1,59 @@
1
+ // Section: Utilities
2
+ // Module: Media Queries
3
+
1
4
  @use 'sass:map';
2
5
  @use 'sass:meta';
3
6
  @use './variables' as *;
7
+ @use './functions' as FN;
8
+
4
9
 
5
- // Breakpoint mixins
10
+ /**
11
+ * @description Media query mixins.
12
+ * @param {string|number} $breakpoint - The breakpoint value.
13
+ * @param {string} $type - The media query type (e.g. 'lg', 'md').
14
+ */
6
15
  @mixin media-up($breakpoint) {
7
- @if map.has-key($breakpoints, $breakpoint) {
8
- @media screen and (min-width: map.get($breakpoints, $breakpoint)) {
9
- @content;
10
- }
11
- } @else if meta.type-of($breakpoint) == number {
12
- @media screen and (min-width: $breakpoint) {
13
- @content;
14
- }
16
+ @media screen and (min-width: #{FN.get-breakpoint-value($breakpoint)}) {
17
+ @content;
15
18
  }
16
19
  }
17
20
 
18
21
  @mixin media-down($breakpoint) {
19
- @if map.has-key($breakpoints, $breakpoint) {
20
- @media screen and (max-width: (map.get($breakpoints, $breakpoint) - 0.02px)) {
21
- @content;
22
- }
23
- } @else if meta.type-of($breakpoint) == number {
24
- @media screen and (max-width: ($breakpoint - 0.02px)) {
25
- @content;
26
- }
22
+ @media screen and (max-width: (#{FN.get-breakpoint-value($breakpoint)} - 0.02px)) {
23
+ @content;
27
24
  }
28
25
  }
29
26
 
30
27
  @mixin media-between($lower, $upper) {
31
-
32
- $-lower: null;
33
- $-upper: null;
34
-
35
- @if map.has-key($breakpoints, $lower) {
36
- $-lower: map.get($breakpoints, $lower);
37
- } @else if meta.type-of($lower) == number {
38
- $-lower: $lower - 0.02px;
39
- } @else {
40
- @warn 'Unknown lower breakpoint: #{$lower}';
28
+ $lower-val: FN.get-breakpoint-value($lower);
29
+ $upper-val: FN.get-breakpoint-value($upper);
30
+ @media screen and (min-width: #{$lower-val}) and (max-width: (#{ $upper-val } - 0.02px)) {
31
+ @content;
41
32
  }
33
+ }
42
34
 
43
- @if map.has-key($breakpoints, $upper) {
44
- $-upper: map.get($breakpoints, $upper);
45
- } @else if meta.type-of($upper) == number {
46
- $-upper: $upper - 0.02px;
47
- } @else {
48
- @warn 'Unknown uppper breakpoint: #{$upper}';
49
- }
35
+ // Only at specific breakpoint
36
+ @mixin media-only($breakpoint) { // BUG BUG BUG BUG BUG
37
+ $min: FN.get-breakpoint-value($breakpoint);
38
+ $next-breakpoint: null;
50
39
 
51
- @if $-lower and $-upper {
52
- @media screen and (min-width: $-lower) and (max-width: $-upper) {
53
- @content;
40
+ @each $name, $width in $breakpoints {
41
+ @if $width > $min and (not $next-breakpoint or $width < $next-breakpoint) {
42
+ $next-breakpoint: #{$width};
54
43
  }
55
44
  }
56
- }
57
-
58
- // Only at specific breakpoint
59
- @mixin media-only($breakpoint) {
60
- @if map.has-key($breakpoints, $breakpoint) {
61
- $min: map.get($breakpoints, $breakpoint);
62
- $next-breakpoint: null;
63
-
64
- @each $name, $width in $breakpoints {
65
- @if $width > $min and (meta.type-of($next-breakpoint) == 'null' or $width < $next-breakpoint) {
66
- $next-breakpoint: $width;
67
- }
45
+
46
+ @if $next-breakpoint {
47
+ @media (min-width: #{$min}) and (max-width: (#{ $next-breakpoint } - 1)) {
48
+ @content;
68
49
  }
69
-
70
- @if $next-breakpoint {
71
- @media (min-width: $min) and (max-width: ($next-breakpoint - 1)) {
72
- @content;
73
- }
74
- } @else {
75
- @media (min-width: $min) {
76
- @content;
77
- }
50
+ } @else {
51
+ @media (min-width: #{$min}) {
52
+ @content;
78
53
  }
79
54
  }
80
55
  }
81
56
 
82
- // Example: @include container(45em) { }
83
- @mixin container-query($size) {
84
- @container (min-width: $size) {
85
- @content;
86
- }
87
- }
88
-
89
57
  // Touch devices
90
58
  @mixin touch {
91
59
  @media (hover: none) and (pointer: coarse) {
@@ -11,7 +11,7 @@
11
11
 
12
12
  // Responsive Variants for Opacity
13
13
  @each $breakpoint, $width in $breakpoints {
14
- @media (min-width: $width) {
14
+ @media (min-width: #{$width}) {
15
15
  @each $i in $percentages {
16
16
  .opacity-#{$i}\@#{$breakpoint} { opacity: math.div($i, 100); }
17
17
  .hover\:opacity-#{$i}\@#{$breakpoint}:hover { opacity: math.div($i, 100); }
@@ -46,7 +46,7 @@
46
46
 
47
47
  // Responsive Position Classes
48
48
  @each $breakpoint, $width in $breakpoints {
49
- @media (min-width: $width) {
49
+ @media (min-width: #{$width}) {
50
50
  .static\@#{$breakpoint} {
51
51
  @include static;
52
52
  }
@@ -94,7 +94,7 @@
94
94
 
95
95
  // Pixel widths based on spacing scale
96
96
  @each $breakpoint, $width in $breakpoints {
97
- @media (min-width: $width) {
97
+ @media (min-width: #{$width}) {
98
98
  // Generate utilities from spacing map
99
99
  @each $i in $spacings {
100
100
  .top-#{$i}\@#{$breakpoint} {height: if($i == 0, $i, $i + px);}
@@ -1,14 +1,15 @@
1
1
  // _spacing.scss
2
-
2
+
3
3
  @use 'sass:math';
4
4
  @use './variables' as *;
5
+ @use './container-queries' as Q;
5
6
 
6
- @mixin width($value) { width: if($value == 0, $value, $value + px); }
7
- @mixin height($value) { height: if($value == 0, $value, $value + px); }
8
- @mixin min-width($value) { min-width: if($value == 0, $value, $value + px); }
9
- @mixin min-height($value) { min-height: if($value == 0, $value, $value + px); }
10
- @mixin max-width($value) { max-width: if($value == 0, $value, $value + px); }
11
- @mixin max-height($value) { max-height: if($value == 0, $value, $value + px); }
7
+ @mixin width($value) { width: $value; }
8
+ @mixin height($value) { height: $value; }
9
+ @mixin min-width($value) { min-width: $value; }
10
+ @mixin min-height($value) { min-height: $value; }
11
+ @mixin max-width($value) { max-width: $value; }
12
+ @mixin max-height($value) { max-height: $value; }
12
13
 
13
14
  @mixin width-percent($i) { width: #{$i + '%'}; }
14
15
  @mixin height-percent($i) { height: #{$i + '%'}; }
@@ -59,8 +60,19 @@
59
60
 
60
61
  // Pixel widths based on spacing scale
61
62
  @each $breakpoint, $width in $breakpoints {
62
- @media (min-width: $width) {
63
+
64
+ .w-#{$breakpoint} { @include width($width); }
65
+ .min-w-#{$breakpoint} { @include min-width($width) }
66
+ .max-w-#{$breakpoint} { @include max-width($width) }
67
+
68
+ @each $b, $w in $breakpoints {
69
+ .min-w-#{$breakpoint}\@#{$b} { @include min-width($width) }
70
+ .max-w-#{$breakpoint}\@#{$b} { @include max-width($width) }
71
+ }
72
+
73
+ @include Q.container-up ($breakpoint) {
63
74
  // Generate utilities from spacing map
75
+
64
76
  @each $i in $spacings {
65
77
  .w-#{$i}per\@#{$breakpoint} { @include width-percent($i); }
66
78
  .h-#{$i}per\@#{$breakpoint} { @include height-percent($i); }
@@ -93,7 +93,7 @@
93
93
 
94
94
  // Responsive Position Classes
95
95
  @each $breakpoint, $width in $breakpoints {
96
- @media (min-width: $width) {
96
+ @media (min-width: #{$width}) {
97
97
  .mx-auto\@#{$breakpoint} { @include mx-auto; }
98
98
  .ml-auto\@#{$breakpoint} { @include ml-auto; }
99
99
  .mr-auto\@#{$breakpoint} { @include mr-auto; }
@@ -1,17 +1,20 @@
1
+ // Section: Text
2
+ // Module: Text
3
+
1
4
  @use 'sass:map';
2
5
 
3
6
  // Import variables
4
7
  @use '../utilities/variables' as *;
5
8
 
6
9
  // Utilities for text sizes
7
- @mixin text-xs { font-size: map.get($font-sizes, 'xs'); }
8
- @mixin text-sm { font-size: map.get($font-sizes, 'sm'); }
9
- @mixin text-md { font-size: map.get($font-sizes, 'md'); }
10
- @mixin text-lg { font-size: map.get($font-sizes, 'lg'); }
11
- @mixin text-xl { font-size: map.get($font-sizes, 'xl'); }
12
- @mixin text-2xl { font-size: map.get($font-sizes, '2xl'); }
13
- @mixin text-3xl { font-size: map.get($font-sizes, '3xl'); }
14
- @mixin text-4xl { font-size: map.get($font-sizes, '4xl'); }
10
+
11
+ /**
12
+ * Text size utility
13
+ * @param {string} $size - The size of the text.
14
+ */
15
+ @mixin text-size($size) {
16
+ font-size: map.get($font-sizes, $size);
17
+ }
15
18
 
16
19
  // Font weights
17
20
  @mixin font-thin { font-weight: 100; }
@@ -58,15 +61,9 @@
58
61
  @mixin truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
59
62
 
60
63
 
61
- // Generate text size utilities
62
- .text-xs { @include text-xs; }
63
- .text-sm { @include text-sm; }
64
- .text-md { @include text-md; }
65
- .text-lg { @include text-lg; }
66
- .text-xl { @include text-xl; }
67
- .text-2xl { @include text-2xl; }
68
- .text-3xl { @include text-3xl; }
69
- .text-4xl { @include text-4xl; }
64
+ @each $size, $val in $font-sizes {
65
+ .text-#{$size} { @include text-size($size); }
66
+ }
70
67
 
71
68
  // Generate font weight utilities
72
69
  .font-thin { @include font-thin; }
@@ -107,3 +104,54 @@
107
104
  .no-underline { @include no-underline; }
108
105
 
109
106
  .truncate { @include truncate; }
107
+
108
+
109
+ @each $breakpoint, $width in $breakpoints {
110
+ @media (min-width: #{$width}) {
111
+ @each $size, $val in $font-sizes {
112
+ // .text-#{$size}\@#{$breakpoint} { @include text-size($size); }
113
+ .text-#{$size}\@#{$breakpoint} { @include text-size($size); }
114
+ }
115
+
116
+ // Generate font weight utilities
117
+ .font-thin\@#{$breakpoint} { @include font-thin; }
118
+ .font-extralight\@#{$breakpoint} { @include font-extralight; }
119
+ .font-light\@#{$breakpoint} { @include font-light; }
120
+ .font-normal\@#{$breakpoint} { @include font-normal; }
121
+ .font-medium\@#{$breakpoint} { @include font-medium; }
122
+ .font-semibold\@#{$breakpoint} { @include font-semibold; }
123
+ .font-bold\@#{$breakpoint} { @include font-bold; }
124
+ .font-extrabold\@#{$breakpoint} { @include font-extrabold; }
125
+ .font-black\@#{$breakpoint} { @include font-black; }
126
+
127
+ // Generate line height utilities
128
+ .leading-none\@#{$breakpoint} { @include leading-none; }
129
+ .leading-tight\@#{$breakpoint} { @include leading-tight; }
130
+ .leading-snug\@#{$breakpoint} { @include leading-snug; }
131
+ .leading-normal\@#{$breakpoint} { @include leading-normal; }
132
+ .leading-relaxed\@#{$breakpoint} { @include leading-relaxed; }
133
+ .leading-loose\@#{$breakpoint} { @include leading-loose; }
134
+
135
+ // Generate text alignment utilities
136
+ .text-left\@#{$breakpoint} { @include text-left; }
137
+ .text-center\@#{$breakpoint} { @include text-center; }
138
+ .text-right\@#{$breakpoint} { @include text-right; }
139
+ .text-justify\@#{$breakpoint} { @include text-justify; }
140
+
141
+ // Classes using mixins
142
+ .uppercase\@#{$breakpoint} { @include uppercase; }
143
+ .lowercase\@#{$breakpoint} { @include lowercase; }
144
+ .capitalize\@#{$breakpoint} { @include capitalize; }
145
+ .normal-case\@#{$breakpoint} { @include normal-case; }
146
+
147
+ .italic\@#{$breakpoint} { @include italic; }
148
+ .not-italic\@#{$breakpoint} { @include not-italic; }
149
+
150
+ .underline\@#{$breakpoint} { @include underline; }
151
+ .line-through\@#{$breakpoint} { @include line-through; }
152
+ .no-underline\@#{$breakpoint} { @include no-underline; }
153
+
154
+ .truncate\@#{$breakpoint} { @include truncate; }
155
+ }
156
+ }
157
+
@@ -4,10 +4,12 @@
4
4
  $enable-debuger: false !default;
5
5
  $enable-dark-mode: true !default;
6
6
  $enable-rtl: true !default;;
7
- $enable-reduced-motion: true !default;;
8
-
7
+ $enable-reduced-motion: true !default;
9
8
  $column-count: 12 !default;
10
9
 
10
+ $default-container-name: nuvoui-container !default;
11
+ $nuvoui-container-queries: false !default;
12
+
11
13
  $primary: #007bff !default;
12
14
  $secondary: #6c757d !default;
13
15
  $success: #28a745 !default;
@@ -86,17 +88,6 @@ $font-sizes: (
86
88
  '3xl': 2rem, // 32px
87
89
  '4xl': 2.5rem // 40px
88
90
  ) !default;
89
-
90
- $padding-map: (
91
- 'xs': 0.25rem 0.5rem,
92
- 'sm': 0.375rem 0.75rem,
93
- 'md': 0.5rem 1rem,
94
- 'lg': 0.75rem 1.5rem,
95
- 'xl': 1rem 2rem,
96
- '2xl': 1.25rem 2.5rem,
97
- '3xl': 1.5rem 3rem,
98
- '4xl': 2rem 4rem,
99
- ) !default;
100
91
 
101
92
  $spacings: (
102
93
  0,1,2,3,4,5,10,15,20,25,30,35,40,45,50,60,70,80,90,100,150,200,250,300,350,400,450,500