@nuvoui/core 1.3.5 → 1.4.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 (64) hide show
  1. package/LICENSE +21 -0
  2. package/dist/nuvoui.css +322 -258
  3. package/dist/nuvoui.css.map +1 -1
  4. package/dist/nuvoui.min.css +23 -1
  5. package/dist/nuvoui.min.css.map +1 -1
  6. package/package.json +1 -1
  7. package/src/styles/base/_base.scss +148 -147
  8. package/src/styles/base/_reset.scss +41 -49
  9. package/src/styles/build.scss +25 -1
  10. package/src/styles/components/_tooltips.scss +271 -0
  11. package/src/styles/config/_borders.scss +15 -0
  12. package/src/styles/config/_breakpoints.scss +11 -0
  13. package/src/styles/config/_colors.scss +192 -0
  14. package/src/styles/config/_constants.scss +1 -0
  15. package/src/styles/config/_container-queries.scss +1 -0
  16. package/src/styles/config/_feature-flags.scss +33 -0
  17. package/src/styles/config/_layouts.scss +13 -0
  18. package/src/styles/config/_shadows.scss +9 -0
  19. package/src/styles/config/_spacing.scss +41 -0
  20. package/src/styles/config/_theme-validation.scss +59 -0
  21. package/src/styles/config/_typography.scss +45 -0
  22. package/src/styles/functions/_breakpoints.scss +15 -0
  23. package/src/styles/functions/_colors.scss +280 -0
  24. package/src/styles/functions/_css-vars.scss +33 -0
  25. package/src/styles/functions/_feature-flags.scss +20 -0
  26. package/src/styles/functions/_math.scss +72 -0
  27. package/src/styles/functions/_strings.scss +68 -0
  28. package/src/styles/functions/_types.scss +104 -0
  29. package/src/styles/functions/_units.scss +83 -0
  30. package/src/styles/index.scss +26 -5
  31. package/src/styles/layouts/_container.scss +28 -27
  32. package/src/styles/layouts/_flex.scss +340 -337
  33. package/src/styles/layouts/_grid.scss +131 -128
  34. package/src/styles/mixins-map.json +484 -479
  35. package/src/styles/mixins-map.scss +1 -1
  36. package/src/styles/themes/_theme.scss +230 -211
  37. package/src/styles/tools/_accessibility.scss +50 -0
  38. package/src/styles/tools/_container-queries.scss +98 -0
  39. package/src/styles/tools/_feature-support.scss +46 -0
  40. package/src/styles/tools/_media-queries.scss +70 -0
  41. package/src/styles/tools/_modern-layout.scss +49 -0
  42. package/src/styles/utilities/_alignment.scss +35 -34
  43. package/src/styles/utilities/_animations.scss +312 -311
  44. package/src/styles/utilities/_backdrop-filters.scss +194 -193
  45. package/src/styles/utilities/_borders.scss +243 -237
  46. package/src/styles/utilities/_colors.scss +16 -136
  47. package/src/styles/utilities/_cursor.scss +10 -10
  48. package/src/styles/utilities/_display.scss +192 -191
  49. package/src/styles/utilities/_helpers.scss +106 -106
  50. package/src/styles/utilities/_opacity.scss +27 -25
  51. package/src/styles/utilities/_position.scss +124 -121
  52. package/src/styles/utilities/_shadows.scss +171 -169
  53. package/src/styles/utilities/_sizing.scss +197 -194
  54. package/src/styles/utilities/_spacing.scss +230 -227
  55. package/src/styles/utilities/_transforms.scss +235 -234
  56. package/src/styles/utilities/_transitions.scss +136 -135
  57. package/src/styles/utilities/_typography.scss +242 -239
  58. package/src/styles/utilities/_z-index.scss +69 -68
  59. package/src/styles/abstracts/_config.scss +0 -254
  60. package/src/styles/abstracts/_functions.scss +0 -626
  61. package/src/styles/themes/refactored_borders.ipynb +0 -37
  62. package/src/styles/utilities/_container-queries.scss +0 -95
  63. package/src/styles/utilities/_media-queries.scss +0 -189
  64. package/src/styles/utilities/_tooltips.scss +0 -258
@@ -6,158 +6,38 @@
6
6
  @use "sass:list";
7
7
  @use "sass:string";
8
8
 
9
- @use "../abstracts/config" as *;
10
- @use "../abstracts/functions" as FN;
11
-
12
- // Color Validation
13
- @function is-valid-color($color) {
14
- @return meta.type-of($color) == "color";
15
- }
16
-
17
- // Scale Generation Function
18
- @function create-color-scale($color) {
19
- $scale: ();
20
- $stops: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900);
21
-
22
- @each $shade in $stops {
23
- $adjusted-color: get-color($color, $shade);
24
- $scale: map.set($scale, $shade, $adjusted-color);
25
- }
26
-
27
- @return $scale;
28
- }
29
-
30
- @function get-color($color, $shade: 500) {
31
- @if FN.is-css-var($color) {
32
- @if $shade != 500 {
33
- @warn "CSS variables do not support shade values. ";
34
- }
35
- @return FN.get-css-var($color);
36
- }
37
-
38
- $colors-list: (
39
- "primary": $primary,
40
- "secondary": $secondary,
41
- "success": $success,
42
- "danger": $danger,
43
- "warning": $warning,
44
- "info": $info,
45
- );
46
-
47
- @if meta.type-of($shade) == "string" {
48
- $shade: FN.to-number($shade);
49
- }
50
-
51
- @if FN.get-type($color) == "color" {
52
- $color: FN.to-color($color);
53
- } @else if map.has-key($colors-list, $color) {
54
- $color: map.get($colors-list, $color);
55
- } @else if map.has-key($color-primitives, $color) {
56
- $color: map.get($color-primitives, $color);
57
- } @else {
58
- @warn "Unexpected color value: #{$color}";
59
- @return currentColor;
60
- }
61
-
62
- $x1: 50; // First input value
63
- $y1: 95; // First output percentage
64
- $x2: 900; // Second input value
65
- $y2: 15; // Second output percentage
66
- // Calculate slope (m) of the line
67
- $slope: math.div($y2 - $y1, $x2 - $x1);
68
-
69
- // Calculate y-intercept (b) of the line: y = mx + b
70
- $y-intercept: $y1 - ($slope * $x1);
71
-
72
- // Calculate the output percentage using the linear equation: y = mx + b
73
- $result: ($slope * $shade) + $y-intercept;
74
- $lightness: math.percentage(math.div($result, 100));
75
- $adjusted-color: $color;
76
-
77
- @if $shade < 500 {
78
- // Lighter shades: mix with white
79
- $mix-percentage: math.div($lightness - 50%, 50%) * 100%;
80
- $adjusted-color: color.mix(white, $color, $mix-percentage);
81
- } @else if $shade > 500 {
82
- // Darker shades: mix with black
83
- $mix-percentage: math.div(50% - $lightness, 50%) * 100%;
84
- $adjusted-color: color.mix(black, $color, $mix-percentage);
85
- }
86
-
87
- @return $adjusted-color;
88
- }
89
-
90
- // Luminance calculation for contrast
91
- @function luminance($color) {
92
- $red: math.div(color.channel($color, "red"), 255);
93
- $green: math.div(color.channel($color, "green"), 255);
94
- $blue: math.div(color.channel($color, "blue"), 255);
95
-
96
- $red: if($red <= 0.0393, math.div($red, 12.92), math.pow((math.div($red + 0.055, 1.055)), 2.4));
97
- $green: if($green <= 0.0393, math.div($green, 12.92), math.pow((math.div($green + 0.055, 1.055)), 2.4));
98
- $blue: if($blue <= 0.0393, math.div($blue, 12.92), math.pow((math.div($blue + 0.055, 1.055)), 2.4));
99
-
100
- @return 0.2126 * $red + 0.7152 * $green + 0.0722 * $blue;
101
- }
102
-
103
- // Find appropriate text color for a background
104
- @function find-text-color($background) {
105
- $luminance: luminance($background);
106
- $dark-color: #000;
107
- @if map.has-key($light-theme, "text-color") {
108
- $dark-color: map.get($light-theme, "text-color");
109
- }
110
-
111
- $light-color: #fff;
112
- @if map.has-key($light-theme, "text-inverted") {
113
- $light-color: map.get($light-theme, "text-inverted");
114
- }
115
- @return if($luminance > 0.55, $dark-color, $light-color);
116
- }
9
+ @use "../config/feature-flags" as config-flags;
10
+ @use "../config/breakpoints" as config-breakpoint;
11
+ @use "../config/colors" as config-color;
12
+ @use "../config/theme-validation" as config-theme;
13
+ @use "../functions/colors" as color-fn;
117
14
 
118
15
  // Adaptive contrast mixin
119
16
  @mixin adaptive-contrast($color) {
120
- background-color: $color;
121
- color: find-text-color($color);
17
+ background-color: $color;
18
+ color: color-fn.find-text-color($color);
122
19
 
123
- @media (prefers-contrast: more) {
124
- $adjusted: if(color.lightness($color) > 50%, color.adjust($color, $lightness: -10%), color.adjust($color, $lightness: 10%));
125
-
126
- background-color: $adjusted;
127
- color: find-text-color($adjusted);
128
- }
129
- }
20
+ @media (prefers-contrast: more) {
21
+ $adjusted: if(color.lightness($color) > 50%, color.adjust($color, $lightness: -10%), color.adjust($color, $lightness: 10%));
130
22
 
131
- // Generate color scales
132
- $colors: (
133
- "primary": create-color-scale($primary),
134
- "secondary": create-color-scale($secondary),
135
- "success": create-color-scale($success),
136
- "danger": create-color-scale($danger),
137
- "warning": create-color-scale($warning),
138
- "info": create-color-scale($info),
139
- );
140
-
141
- // Generate scales for primitives
142
- $colors-primitives: ();
143
-
144
- @each $name, $color in $color-primitives {
145
- $colors-primitives: map.set($colors-primitives, $name, create-color-scale($color));
23
+ background-color: $adjusted;
24
+ color: color-fn.find-text-color($adjusted);
25
+ }
146
26
  }
147
27
 
148
28
  // todo: documentation
149
29
  @mixin bg($color, $shade: 500) {
150
- background-color: get-color($color, $shade);
30
+ background-color: color-fn.get-color($color, $shade);
151
31
  }
152
32
 
153
33
  @mixin text-color($color-name, $shade: 500) {
154
- color: get-color($color-name, $shade);
34
+ color: color-fn.get-color($color-name, $shade);
155
35
  }
156
36
 
157
37
  @mixin text-on-color($color-name, $shade: 500) {
158
- color: find-text-color(get-color($color-name, $shade));
38
+ color: color-fn.find-text-color(color-fn.get-color($color-name, $shade));
159
39
  }
160
40
 
161
41
  @mixin gradient($direction, $colors...) {
162
- background-image: linear-gradient($direction, $colors);
42
+ background-image: linear-gradient($direction, $colors);
163
43
  }
@@ -1,17 +1,17 @@
1
- @use "../abstracts/config" as VAR;
2
- @use "../abstracts/functions" as FN;
1
+ @use "../config/feature-flags" as config-flags;
2
+ @use "../functions/feature-flags" as fn-flags;
3
3
 
4
4
  @mixin cursor($cursor-value) {
5
- cursor: #{$cursor-value};
5
+ cursor: #{$cursor-value};
6
6
  }
7
7
 
8
- @if FN.feature-enabled("cursors") {
9
- $cursor-values: ("auto", "pointer", "default", "move", "not-allowed", "wait", "help", "text", "cell", "crosshair", "grabbing", "grab", "zoom-in", "zoom-out", "none", "progress", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "context-menu", "all-scroll");
8
+ @if fn-flags.feature-enabled("cursors") {
9
+ $cursor-values: ("auto", "pointer", "default", "move", "not-allowed", "wait", "help", "text", "cell", "crosshair", "grabbing", "grab", "zoom-in", "zoom-out", "none", "progress", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "context-menu", "all-scroll");
10
10
 
11
- // Generate classes for each cursor value
12
- @each $value in $cursor-values {
13
- #{VAR.$parent-selector} .cursor-#{$value} {
14
- @include cursor($value);
11
+ // Generate classes for each cursor value
12
+ @each $value in $cursor-values {
13
+ #{config-flags.$parent-selector} .cursor-#{$value} {
14
+ @include cursor($value);
15
+ }
15
16
  }
16
- }
17
17
  }