@volverjs/style 0.1.22 → 0.1.24-beta.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.
Files changed (140) hide show
  1. package/README.md +30 -0
  2. package/dist/base.css +1 -1
  3. package/dist/components/vv-accordion.css +1 -1
  4. package/dist/components/vv-alert.css +1 -1
  5. package/dist/components/vv-badge.css +1 -1
  6. package/dist/components/vv-button.css +1 -1
  7. package/dist/components/vv-card.css +1 -1
  8. package/dist/components/vv-checkbox.css +1 -1
  9. package/dist/components/vv-dropdown-action.css +1 -1
  10. package/dist/components/vv-dropdown-option.css +1 -1
  11. package/dist/components/vv-dropdown.css +1 -1
  12. package/dist/components/vv-input-file.css +1 -1
  13. package/dist/components/vv-input-text.css +1 -1
  14. package/dist/components/vv-nav.css +1 -1
  15. package/dist/components/vv-radio.css +1 -1
  16. package/dist/components/vv-select.css +1 -1
  17. package/dist/components/vv-text.css +1 -1
  18. package/dist/components/vv-tooltip.css +1 -1
  19. package/dist/components.css +1 -1
  20. package/dist/export.css +1 -1
  21. package/dist/props/breakpoints.css +1 -1
  22. package/dist/props/colors.css +1 -1
  23. package/dist/props/effects.css +1 -1
  24. package/dist/props/spacing.css +1 -1
  25. package/dist/props/transitions.css +1 -1
  26. package/dist/props/typography.css +1 -1
  27. package/dist/props.css +1 -1
  28. package/dist/reset.css +1 -1
  29. package/dist/themes/dark/components.css +1 -1
  30. package/dist/themes/dark/props.css +1 -1
  31. package/dist/themes/dark/volver.css +1 -1
  32. package/dist/utilities/borders.css +1 -1
  33. package/dist/utilities/colors.css +1 -1
  34. package/dist/utilities/effects.css +1 -1
  35. package/dist/utilities/flexbox.css +1 -1
  36. package/dist/utilities/grid.css +1 -1
  37. package/dist/utilities/layout.css +1 -1
  38. package/dist/utilities/sizing.css +1 -1
  39. package/dist/utilities/typography.css +1 -1
  40. package/dist/utilities.css +1 -1
  41. package/dist/volver.css +1 -1
  42. package/package.json +22 -22
  43. package/src/_config.scss +12 -0
  44. package/src/_layers.scss +4 -0
  45. package/src/_preflight.scss +2 -0
  46. package/src/components/vv-accordion-group.scss +3 -0
  47. package/src/components/vv-accordion.scss +3 -0
  48. package/src/components/vv-alert-group.scss +3 -0
  49. package/src/components/vv-alert.scss +3 -0
  50. package/src/components/vv-avatar-group.scss +3 -0
  51. package/src/components/vv-avatar.scss +3 -0
  52. package/src/components/vv-badge.scss +3 -0
  53. package/src/components/vv-breadcrumb.scss +3 -0
  54. package/src/components/vv-button-group.scss +3 -0
  55. package/src/components/vv-button.scss +3 -0
  56. package/src/components/vv-card.scss +3 -0
  57. package/src/components/vv-checkbox-group.scss +3 -0
  58. package/src/components/vv-checkbox.scss +3 -0
  59. package/src/components/vv-dialog.scss +3 -0
  60. package/src/components/vv-dropdown-action.scss +3 -0
  61. package/src/components/vv-dropdown-optgroup.scss +3 -0
  62. package/src/components/vv-dropdown-option.scss +3 -0
  63. package/src/components/vv-dropdown.scss +3 -0
  64. package/src/components/vv-input-file.scss +3 -0
  65. package/src/components/vv-input-text.scss +3 -0
  66. package/src/components/vv-nav.scss +3 -0
  67. package/src/components/vv-progress.scss +3 -0
  68. package/src/components/vv-radio-group.scss +3 -0
  69. package/src/components/vv-radio.scss +3 -0
  70. package/src/components/vv-select.scss +3 -0
  71. package/src/components/vv-skeleton.scss +3 -0
  72. package/src/components/vv-tab.scss +3 -0
  73. package/src/components/vv-table.scss +3 -0
  74. package/src/components/vv-text.scss +3 -0
  75. package/src/components/vv-textarea.scss +3 -0
  76. package/src/components/vv-tooltip.scss +5 -7
  77. package/src/export.scss +0 -1
  78. package/src/props/background.scss +5 -3
  79. package/src/props/borders.scss +5 -3
  80. package/src/props/breakpoints.scss +11 -9
  81. package/src/props/colors.scss +4 -2
  82. package/src/props/effects.scss +5 -3
  83. package/src/props/filters.scss +6 -4
  84. package/src/props/input.scss +4 -2
  85. package/src/props/layout.scss +5 -3
  86. package/src/props/sizing.scss +5 -3
  87. package/src/props/spacing.scss +16 -16
  88. package/src/props/transitions.scss +150 -118
  89. package/src/props/typography.scss +24 -24
  90. package/src/reset.scss +4 -3
  91. package/src/settings/_colors.scss +80 -50
  92. package/src/settings/_effects.scss +7 -7
  93. package/src/settings/components/_vv-accordion.scss +2 -1
  94. package/src/settings/components/_vv-badge.scss +2 -10
  95. package/src/settings/components/_vv-button.scss +1 -1
  96. package/src/settings/components/_vv-card.scss +3 -17
  97. package/src/settings/components/_vv-nav.scss +1 -6
  98. package/src/settings/components/_vv-text.scss +1 -0
  99. package/src/themes/dark/components/_vv-alert.scss +14 -10
  100. package/src/themes/dark/components/_vv-avatar.scss +14 -10
  101. package/src/themes/dark/components/_vv-badge.scss +14 -10
  102. package/src/themes/dark/components/_vv-button.scss +14 -10
  103. package/src/themes/dark/components/_vv-dropdown-action.scss +14 -10
  104. package/src/themes/dark/components/_vv-dropdown-option.scss +14 -10
  105. package/src/themes/dark/components/_vv-nav.scss +14 -10
  106. package/src/themes/dark/components/_vv-select.scss +14 -10
  107. package/src/themes/dark/props/_background.scss +3 -0
  108. package/src/themes/dark/props/_colors.scss +3 -0
  109. package/src/themes/dark/props/_input.scss +3 -0
  110. package/src/themes/dark/settings/_colors.scss +42 -28
  111. package/src/themes/dark/settings/components/_vv-alert.scss +23 -0
  112. package/src/themes/dark/settings/components/_vv-avatar.scss +3 -0
  113. package/src/themes/dark/settings/components/_vv-button.scss +0 -1
  114. package/src/tools/_breakpoints.scss +20 -4
  115. package/src/tools/_functions.scss +157 -0
  116. package/src/tools/_mixins.scss +5 -1216
  117. package/src/tools/mixin-modules/_attrs.scss +178 -0
  118. package/src/tools/mixin-modules/_bem.scss +751 -0
  119. package/src/tools/mixin-modules/_helpers.scss +23 -0
  120. package/src/tools/mixin-modules/_index.scss +25 -0
  121. package/src/tools/mixin-modules/_layers.scss +42 -0
  122. package/src/tools/mixin-modules/_props.scss +41 -0
  123. package/src/tools/mixin-modules/_theme.scss +354 -0
  124. package/src/tools/mixin-modules/_utilities.scss +121 -0
  125. package/src/utilities/backgrounds.scss +3 -0
  126. package/src/utilities/borders.scss +3 -0
  127. package/src/utilities/colors.scss +3 -0
  128. package/src/utilities/effects.scss +3 -0
  129. package/src/utilities/filters.scss +3 -0
  130. package/src/utilities/flexbox.scss +3 -0
  131. package/src/utilities/grid.scss +3 -0
  132. package/src/utilities/interactivity.scss +3 -0
  133. package/src/utilities/layout.scss +3 -0
  134. package/src/utilities/sizing.scss +3 -0
  135. package/src/utilities/spacing.scss +3 -0
  136. package/src/utilities/tables.scss +3 -0
  137. package/src/utilities/transforms.scss +11 -6
  138. package/src/utilities/transitions.scss +3 -0
  139. package/src/utilities/typography.scss +3 -0
  140. package/src/volver.scss +2 -1
@@ -17,7 +17,11 @@
17
17
  @function breakpoint-next($name, $bps: $breakpoints, $bps-names: map.keys($bps)) {
18
18
  $n: list.index($bps-names, $name);
19
19
 
20
- @return if($n != null and $n < list.length($bps-names), list.nth($bps-names, $n + 1), null);
20
+ @if $n != null and $n < list.length($bps-names) {
21
+ @return list.nth($bps-names, $n + 1);
22
+ } @else {
23
+ @return null;
24
+ }
21
25
  }
22
26
 
23
27
  @function bp-next($name, $bps: $breakpoints, $bps-names: map.keys($bps)) {
@@ -30,7 +34,11 @@
30
34
  @function breakpoint-min($name, $bps: $breakpoints) {
31
35
  $min: map.get($bps, $name);
32
36
 
33
- @return if($min != 0, $min, null);
37
+ @if $min != 0 {
38
+ @return $min;
39
+ } @else {
40
+ @return null;
41
+ }
34
42
  }
35
43
 
36
44
  @function bp-min($name, $bps: $breakpoints) {
@@ -48,7 +56,11 @@
48
56
  @function breakpoint-max($name, $bps: $breakpoints) {
49
57
  $next: breakpoint-next($name, $bps);
50
58
 
51
- @return if($next, breakpoint-min($next, $bps) - 0.02, null);
59
+ @if $next {
60
+ @return breakpoint-min($next, $bps) - 0.02;
61
+ } @else {
62
+ @return null;
63
+ }
52
64
  }
53
65
 
54
66
  @function bp-max($name, $bps: $breakpoints) {
@@ -62,7 +74,11 @@
62
74
  // >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
63
75
  // "-sm"
64
76
  @function breakpoint-infix($name, $bps: $breakpoints) {
65
- @return if(breakpoint-min($name, $bps) == null, "", "-#{$name}");
77
+ @if not breakpoint-min($name, $bps) {
78
+ @return "";
79
+ } @else {
80
+ @return "-#{$name}";
81
+ }
66
82
  }
67
83
 
68
84
  @function bp-infix($name, $bps: $breakpoints) {
@@ -106,6 +106,163 @@
106
106
  @return $result;
107
107
  }
108
108
 
109
+ // ============================================
110
+ // Color Mix Functions (CSS native color-mix())
111
+ // ============================================
112
+
113
+ // Generate a single color value - returns the base color as-is
114
+ // @param {Color} $color - Any valid CSS color (hex, rgb, hsl, oklch, etc.)
115
+ // @param {String} $name - Color name for the CSS variable
116
+ // @return {Map} Map with just the base color
117
+ @function color-base-map($color, $name) {
118
+ @return (
119
+ #{$name}: #{$color}
120
+ );
121
+ }
122
+
123
+ // Generate a relative color syntax expression for CSS
124
+ // Uses hsl(from color h s calc(l * X)) or hsl(from color h s calc(l +/- X)) to modify only lightness
125
+ // In CSS Relative Color Syntax, h/s/l are numbers:
126
+ // - h: 0-360 (degrees)
127
+ // - s: 0-100 (not a percentage unit, just a number)
128
+ // - l: 0-100 (not a percentage unit, just a number)
129
+ // @param {String} $name - Color variable name
130
+ // @param {Number} $lightness-change - Lightness change as percentage (e.g., 10%)
131
+ // @param {Boolean} $fixed - If true, use addition (l + X). If false, use multiplication (l * X)
132
+ // @return {String} CSS relative color syntax expression
133
+ @function relative-color-value($name, $lightness-change, $fixed: false) {
134
+ @if $fixed {
135
+ // Fixed mode: use addition/subtraction (for surface, word colors)
136
+ // Convert percentage to plain number (2% -> 2)
137
+ $number-change: math.div($lightness-change, 1%);
138
+
139
+ @if $lightness-change > 0 {
140
+ @return string.unquote('hsl(from var(--color-#{$name}) h s calc(l + #{$number-change}))');
141
+ } @else {
142
+ @return string.unquote('hsl(from var(--color-#{$name}) h s calc(l - #{math.abs($number-change)}))');
143
+ }
144
+ } @else {
145
+ // Proportional mode: use multiplication (for brand, accent, etc.)
146
+ // Convert percentage to multiplier (10% -> 1.1 for lighten, 0.9 for darken)
147
+ $scale-factor: math.div($lightness-change, 100%);
148
+ $multiplier: 1 + $scale-factor;
149
+
150
+ @return string.unquote('hsl(from var(--color-#{$name}) h s calc(l * #{$multiplier}))');
151
+ }
152
+ }
153
+
154
+ // Generate shades map using CSS Relative Color Syntax
155
+ // @param {Color} $color - Base color in any format
156
+ // @param {String} $name - Color name for CSS variables
157
+ // @param {Number} $steps - Number of lighten/darken steps (default: 5)
158
+ // @param {Number} $scale - Lightness increment per step (default: 10%)
159
+ // @return {Map} Complete shades map with base + lighten + darken variants
160
+ @function color-mix-shades-map(
161
+ $color,
162
+ $name,
163
+ $steps: 5,
164
+ $scale: 10%
165
+ ) {
166
+ // Start with base color
167
+ $result: color-base-map($color, $name);
168
+
169
+ // Generate lighten shades
170
+ @for $i from 1 through $steps {
171
+ $key: 'lighten-#{$i}';
172
+ $change: $scale * $i;
173
+ $result: map.merge($result, (#{$key}: relative-color-value($name, $change)));
174
+ }
175
+
176
+ // Generate darken shades
177
+ @for $i from 1 through $steps {
178
+ $key: 'darken-#{$i}';
179
+ $change: $scale * $i * -1;
180
+ $result: map.merge($result, (#{$key}: relative-color-value($name, $change)));
181
+ }
182
+
183
+ @return $result;
184
+ }
185
+
186
+ // Generate darken shades only using CSS Relative Color Syntax
187
+ // Used for surface colors that need numeric keys (1, 2, 3...)
188
+ // Uses fixed addition (l - X) for consistent step sizes
189
+ // @param {Color} $color - Base color
190
+ // @param {String} $name - Color name
191
+ // @param {Number} $steps - Number of darken steps (default: 5)
192
+ // @param {Number} $scale - Lightness decrement per step (default: 2%)
193
+ // @return {Map} Darken variants map with numeric keys
194
+ @function color-mix-darken-map(
195
+ $color,
196
+ $name,
197
+ $steps: 5,
198
+ $scale: 2%
199
+ ) {
200
+ // Start with base color
201
+ $result: color-base-map($color, $name);
202
+
203
+ // Generate darken shades with numeric keys (using fixed addition)
204
+ @for $i from 1 through $steps {
205
+ $change: $scale * $i * -1;
206
+ $result: map.merge($result, (#{$i}: relative-color-value($name, $change, $fixed: true)));
207
+ }
208
+
209
+ @return $result;
210
+ }
211
+
212
+ // Generate lighten shades only using CSS Relative Color Syntax
213
+ // Used for colors that need numeric keys with lighten effect
214
+ // Uses fixed addition (l + X) for consistent step sizes
215
+ // @param {Color} $color - Base color
216
+ // @param {String} $name - Color name
217
+ // @param {Number} $steps - Number of lighten steps (default: 5)
218
+ // @param {Number} $scale - Lightness increment per step (default: 12%)
219
+ // @return {Map} Lighten variants map with numeric keys
220
+ @function color-mix-lighten-map(
221
+ $color,
222
+ $name,
223
+ $steps: 5,
224
+ $scale: 12%
225
+ ) {
226
+ // Start with base color
227
+ $result: color-base-map($color, $name);
228
+
229
+ // Generate lighten shades with numeric keys (using fixed addition)
230
+ @for $i from 1 through $steps {
231
+ $change: $scale * $i;
232
+ $result: map.merge($result, (#{$i}: relative-color-value($name, $change, $fixed: true)));
233
+ }
234
+
235
+ @return $result;
236
+ }
237
+
238
+ // Generate alpha variants using CSS color-mix()
239
+ // @param {Color} $color - Base color
240
+ // @param {String} $name - Color name
241
+ // @param {Number} $steps - Number of alpha steps (default: 9)
242
+ // @param {Number} $scale - Alpha increment per step (default: 0.1)
243
+ // @return {Map} Alpha variants map
244
+ @function color-mix-alpha-map(
245
+ $color,
246
+ $name,
247
+ $steps: 9,
248
+ $scale: 0.1
249
+ ) {
250
+ $result: color-base-map($color, $name);
251
+
252
+ @for $i from 1 through $steps {
253
+ $key: '#{$i}';
254
+ $percentage: 100% - ($scale * $i * 100%);
255
+
256
+ // Mix with transparent to get alpha
257
+ $result: map.merge($result, (#{$key}: string.unquote('color-mix(in srgb, var(--color-#{$name}), transparent #{$percentage})')));
258
+ }
259
+
260
+ @return $result;
261
+ }
262
+
263
+ // ============================================
264
+ // Legacy Color Functions (HSL channel-based)
265
+ // ============================================
109
266
  @function color-shades-map(
110
267
  $color,
111
268
  $name,