@volverjs/style 0.1.2-beta.9 → 0.1.2

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 (180) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +53 -46
  3. package/dist/components/vv-accordion.css +1 -1
  4. package/dist/components/vv-alert.css +1 -0
  5. package/dist/components/vv-avatar.css +1 -0
  6. package/dist/components/vv-badge.css +1 -1
  7. package/dist/components/vv-breadcrumb.css +1 -1
  8. package/dist/components/vv-button-group.css +1 -1
  9. package/dist/components/vv-button.css +1 -1
  10. package/dist/components/vv-card.css +1 -1
  11. package/dist/components/vv-checkbox-group.css +1 -0
  12. package/dist/components/vv-checkbox.css +1 -0
  13. package/dist/components/vv-dialog.css +1 -1
  14. package/dist/components/vv-dropdown.css +1 -1
  15. package/dist/components/vv-input-text.css +1 -1
  16. package/dist/components/vv-nav.css +1 -1
  17. package/dist/components/vv-progress.css +1 -1
  18. package/dist/components/vv-radio-group.css +1 -0
  19. package/dist/components/vv-radio.css +1 -0
  20. package/dist/components/vv-select.css +1 -1
  21. package/dist/components/vv-skeleton.css +1 -0
  22. package/dist/components/vv-tab.css +1 -0
  23. package/dist/components/vv-table.css +1 -1
  24. package/dist/components/vv-text.css +1 -1
  25. package/dist/components/vv-textarea.css +1 -1
  26. package/dist/components/vv-toast.css +1 -0
  27. package/dist/components/vv-tooltip.css +1 -0
  28. package/dist/components.css +1 -1
  29. package/dist/export.css +1 -1
  30. package/dist/props/background.css +1 -1
  31. package/dist/props/breakpoints.css +1 -0
  32. package/dist/props/colors.css +1 -1
  33. package/dist/props/filters.css +1 -1
  34. package/dist/props/input.css +1 -1
  35. package/dist/props/layout.css +1 -1
  36. package/dist/props/spacing.css +1 -1
  37. package/dist/props/transitions.css +1 -0
  38. package/dist/props.css +1 -1
  39. package/dist/themes/dark/components.css +1 -1
  40. package/dist/themes/dark/props.css +1 -1
  41. package/dist/themes/dark/volver.css +1 -1
  42. package/dist/utilities/backgrounds.css +1 -1
  43. package/dist/utilities/borders.css +1 -1
  44. package/dist/utilities/colors.css +1 -1
  45. package/dist/utilities/effects.css +1 -1
  46. package/dist/utilities/filters.css +1 -1
  47. package/dist/utilities/flexbox.css +1 -1
  48. package/dist/utilities/interactivity.css +1 -0
  49. package/dist/utilities/layout.css +1 -1
  50. package/dist/utilities/sizing.css +1 -1
  51. package/dist/utilities/spacing.css +1 -1
  52. package/dist/utilities/transitions.css +1 -0
  53. package/dist/utilities/typography.css +1 -1
  54. package/dist/utilities.css +1 -1
  55. package/dist/volver.css +1 -1
  56. package/package.json +56 -36
  57. package/src/_config.scss +17 -11
  58. package/src/_context.scss +3 -3
  59. package/src/_preflight.scss +308 -247
  60. package/src/components/index.scss +25 -19
  61. package/src/components/vv-accordion.scss +3 -2
  62. package/src/components/vv-alert.scss +13 -0
  63. package/src/components/vv-avatar.scss +13 -0
  64. package/src/components/vv-badge.scss +3 -2
  65. package/src/components/vv-breadcrumb.scss +3 -2
  66. package/src/components/vv-button-group.scss +11 -10
  67. package/src/components/vv-button.scss +5 -8
  68. package/src/components/vv-card.scss +3 -2
  69. package/src/components/vv-checkbox-group.scss +13 -0
  70. package/src/components/{vv-input-checkbox.scss → vv-checkbox.scss} +7 -6
  71. package/src/components/vv-dialog.scss +3 -2
  72. package/src/components/vv-dropdown.scss +3 -2
  73. package/src/components/vv-input-text.scss +6 -5
  74. package/src/components/vv-nav.scss +3 -2
  75. package/src/components/vv-progress.scss +3 -2
  76. package/src/components/vv-radio-group.scss +13 -0
  77. package/src/components/{vv-input-radio.scss → vv-radio.scss} +6 -5
  78. package/src/components/vv-select.scss +6 -5
  79. package/src/components/vv-skeleton.scss +14 -0
  80. package/src/components/vv-tab.scss +13 -0
  81. package/src/components/vv-table.scss +3 -2
  82. package/src/components/vv-text.scss +3 -2
  83. package/src/components/vv-textarea.scss +6 -5
  84. package/src/components/vv-toast.scss +13 -0
  85. package/src/components/vv-tooltip.scss +33 -0
  86. package/src/export.scss +89 -27
  87. package/src/props/background.scss +1 -1
  88. package/src/props/borders.scss +1 -1
  89. package/src/props/breakpoints.scss +15 -0
  90. package/src/props/colors.scss +1 -1
  91. package/src/props/effects.scss +1 -1
  92. package/src/props/filters.scss +2 -1
  93. package/src/props/index.scss +13 -12
  94. package/src/props/input.scss +1 -1
  95. package/src/props/layout.scss +1 -1
  96. package/src/props/media.scss +1 -1
  97. package/src/props/sizing.scss +1 -1
  98. package/src/props/spacing.scss +2 -2
  99. package/src/props/{animation.scss → transitions.scss} +53 -2
  100. package/src/props/typography.scss +2 -2
  101. package/src/settings/_background.scss +6 -1
  102. package/src/settings/_breakpoints.scss +2 -0
  103. package/src/settings/_colors.scss +23 -4
  104. package/src/settings/_effects.scss +47 -2
  105. package/src/settings/_filters.scss +9 -0
  106. package/src/settings/_index.scss +40 -33
  107. package/src/settings/_input.scss +8 -6
  108. package/src/settings/_interactivity.scss +39 -0
  109. package/src/settings/_layout.scss +18 -10
  110. package/src/settings/_spacing.scss +1 -0
  111. package/src/settings/_transitions.scss +44 -0
  112. package/src/settings/components/_vv-accordion.scss +40 -34
  113. package/src/settings/components/_vv-alert.scss +161 -0
  114. package/src/settings/components/_vv-avatar.scss +55 -0
  115. package/src/settings/components/_vv-badge.scss +43 -11
  116. package/src/settings/components/_vv-breadcrumb.scss +23 -15
  117. package/src/settings/components/_vv-button-group.scss +4 -0
  118. package/src/settings/components/_vv-button.scss +30 -25
  119. package/src/settings/components/_vv-card.scss +2 -2
  120. package/src/settings/components/{_vv-input-checkbox-group.scss → _vv-checkbox-group.scss} +2 -1
  121. package/src/settings/components/{_vv-input-checkbox.scss → _vv-checkbox.scss} +46 -11
  122. package/src/settings/components/_vv-dialog.scss +71 -89
  123. package/src/settings/components/_vv-input-text.scss +83 -37
  124. package/src/settings/components/_vv-nav.scss +98 -13
  125. package/src/settings/components/_vv-progress.scss +1 -1
  126. package/src/settings/components/_vv-radio-group.scss +3 -0
  127. package/src/settings/components/{_vv-input-radio.scss → _vv-radio.scss} +33 -4
  128. package/src/settings/components/_vv-select.scss +34 -43
  129. package/src/settings/components/_vv-skeleton.scss +22 -0
  130. package/src/settings/components/_vv-tab.scss +16 -0
  131. package/src/settings/components/_vv-table.scss +8 -1
  132. package/src/settings/components/_vv-text.scss +20 -0
  133. package/src/settings/components/_vv-textarea.scss +49 -24
  134. package/src/settings/components/_vv-toast.scss +259 -0
  135. package/src/settings/components/_vv-tooltip.scss +74 -0
  136. package/src/themes/dark/_context.scss +7 -4
  137. package/src/themes/dark/components/_vv-button.scss +2 -4
  138. package/src/themes/dark/components/index.scss +1 -2
  139. package/src/themes/dark/props/_background.scss +1 -1
  140. package/src/themes/dark/props/_colors.scss +1 -1
  141. package/src/themes/dark/props/_input.scss +15 -0
  142. package/src/themes/dark/props/index.scss +3 -2
  143. package/src/themes/dark/settings/_background.scss +5 -0
  144. package/src/themes/dark/settings/_colors.scss +22 -2
  145. package/src/themes/dark/settings/_index.scss +4 -4
  146. package/src/themes/dark/settings/_input.scss +8 -0
  147. package/src/themes/dark/settings/components/_vv-button.scss +9 -9
  148. package/src/themes/dark/volver.scss +2 -2
  149. package/src/tools/_breakpoints.scss +7 -7
  150. package/src/tools/_functions.scss +95 -37
  151. package/src/tools/_index.scss +3 -3
  152. package/src/tools/_mixins.scss +166 -35
  153. package/src/utilities/backgrounds.scss +15 -8
  154. package/src/utilities/borders.scss +22 -9
  155. package/src/utilities/colors.scss +9 -5
  156. package/src/utilities/effects.scss +23 -5
  157. package/src/utilities/filters.scss +15 -4
  158. package/src/utilities/flexbox.scss +15 -8
  159. package/src/utilities/grid.scss +17 -9
  160. package/src/utilities/index.scss +13 -12
  161. package/src/utilities/interactivity.scss +10 -0
  162. package/src/utilities/layout.scss +35 -23
  163. package/src/utilities/sizing.scss +23 -26
  164. package/src/utilities/spacing.scss +1 -1
  165. package/src/utilities/transitions.scss +47 -0
  166. package/src/utilities/typography.scss +34 -17
  167. package/src/volver.scss +4 -4
  168. package/dist/components/vv-input-checkbox-group.css +0 -1
  169. package/dist/components/vv-input-checkbox.css +0 -1
  170. package/dist/components/vv-input-radio-group.css +0 -1
  171. package/dist/components/vv-input-radio.css +0 -1
  172. package/dist/props/animation.css +0 -1
  173. package/dist/utilities/animation.css +0 -1
  174. package/src/components/vv-input-checkbox-group.scss +0 -12
  175. package/src/components/vv-input-radio-group.scss +0 -12
  176. package/src/settings/_animation.scss +0 -9
  177. package/src/settings/components/_vv-input-radio-group.scss +0 -1
  178. package/src/themes/dark/components/_vv-input-checkbox.scss +0 -24
  179. package/src/themes/dark/settings/components/_vv-input-checkbox.scss +0 -26
  180. package/src/utilities/animation.scss +0 -8
@@ -1,15 +1,35 @@
1
1
  @use 'sass:color';
2
+ @use 'sass:map';
3
+ @use '../../../tools/functions' as *;
4
+ @use '../../../settings/colors' as *;
2
5
 
3
6
  $dark-color-scheme: dark !default;
4
7
  $dark-color-brand: #1976d2 !default;
5
8
  $dark-color-word: hsl(color.hue($dark-color-brand) 15% 85%) !default;
6
9
  $dark-color-surface: hsl(color.hue($dark-color-brand) 10% 5%) !default;
7
10
  $dark-color-alpha: hsla(0deg 0% 100% / 0%) !default;
11
+ $dark-color-surface-palette: (
12
+ brand: hsl(var(--color-brand-hue) var(--color-brand-saturation) 10%),
13
+ accent: hsl(var(--color-accent-hue) var(--color-accent-saturation) 10%),
14
+ success: hsl(var(--color-success-hue) var(--color-success-saturation) 10%),
15
+ danger: hsl(var(--color-danger-hue) var(--color-danger-saturation) 10%),
16
+ info: hsl(var(--color-info-hue) var(--color-info-saturation) 10%),
17
+ warning: hsl(var(--color-warning-hue) var(--color-warning-saturation) 10%),
18
+ ) !default;
8
19
 
9
20
  // color map
10
21
  $dark-colors: (
11
22
  scheme: $dark-color-scheme,
12
- word: color-darken-map($dark-color-word, 'word', $scale: 15%),
13
- surface: color-lighten-map($dark-color-surface, 'surface', $scale: 5%),
23
+ word: color-darken-map($dark-color-word, 'word', $scale: 12%, $fixed: true),
24
+ surface:
25
+ map.merge(
26
+ color-lighten-map(
27
+ $dark-color-surface,
28
+ 'surface',
29
+ $scale: 5%,
30
+ $fixed: true
31
+ ),
32
+ $dark-color-surface-palette
33
+ ),
14
34
  alpha: color-alpha-map($dark-color-alpha, 'alpha', $steps: 5, $scale: 5%),
15
35
  ) !default;
@@ -1,5 +1,5 @@
1
- @import 'colors';
2
- @import 'background';
1
+ @forward 'colors';
2
+ @forward 'background';
3
+ @forward 'input';
3
4
 
4
- @import 'components/vv-button';
5
- @import 'components/vv-input-checkbox';
5
+ @forward 'components/vv-button';
@@ -0,0 +1,8 @@
1
+ $dark-input: (
2
+ invalid: (
3
+ color: var(--color-danger-lighten-2),
4
+ ),
5
+ valid: (
6
+ color: var(--color-success-lighten-2),
7
+ ),
8
+ ) !default;
@@ -1,20 +1,20 @@
1
1
  $dark-vv-button: (
2
2
  modifier: (
3
3
  primary: (
4
- border-color: var(--color-gray-lighten-3),
5
- background: var(--color-gray-lighten-3),
4
+ border-color: var(--color-gray-darken-1),
5
+ background: var(--color-gray-darken-1),
6
6
  state: (
7
7
  focus-visible: (
8
8
  outline: var(--spacing-px) solid var(--color-gray),
9
9
  ),
10
10
  hover: (
11
- background: var(--color-gray-lighten-2),
12
- border-color: var(--color-gray-lighten-2),
13
- ),
14
- active: (
15
11
  background: var(--color-gray-lighten-1),
16
12
  border-color: var(--color-gray-lighten-1),
17
13
  ),
14
+ active: (
15
+ background: var(--color-gray),
16
+ border-color: var(--color-gray),
17
+ ),
18
18
  ),
19
19
  ),
20
20
  secondary: (
@@ -41,7 +41,7 @@ $dark-vv-button: (
41
41
  state: (
42
42
  focus-visible: (
43
43
  outline: var(--spacing-px) solid var(--color-gray),
44
- outline-offset: 0,
44
+ outline-offset: var(--spacing-0),
45
45
  ),
46
46
  hover: (
47
47
  background: var(--color-gray-darken-4),
@@ -51,8 +51,8 @@ $dark-vv-button: (
51
51
  ),
52
52
  ),
53
53
  ),
54
- text: (
55
- text-shadow: 0 1px 0 var(--color-gray-darken-5),
54
+ link: (
55
+ color: var(--color-brand-lighten-1),
56
56
  ),
57
57
  ),
58
58
  ) !default;
@@ -1,5 +1,5 @@
1
1
  // props
2
- @import 'props';
2
+ @use 'props';
3
3
 
4
4
  // components
5
- @import 'components';
5
+ @use 'components';
@@ -28,7 +28,7 @@
28
28
  // Minimum breakpoint width. Null for the smallest (first) breakpoint.
29
29
  // >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
30
30
  // 576px
31
- @function breakpoint-min($name, $bps: $breakpoints) {
31
+ @function breakpoint-min($name, $bps) {
32
32
  $min: map.get($bps, $name);
33
33
  @return if($min != 0, $min, null);
34
34
  }
@@ -41,7 +41,7 @@
41
41
  // See https://bugs.webkit.org/show_bug.cgi?id=178261
42
42
  // >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
43
43
  // 767.98px
44
- @function breakpoint-max($name, $bps: $breakpoints) {
44
+ @function breakpoint-max($name, $bps) {
45
45
  $next: breakpoint-next($name, $bps);
46
46
  @return if($next, breakpoint-min($next, $bps) - 0.02, null);
47
47
  }
@@ -52,13 +52,13 @@
52
52
  // "" (Returns a blank string)
53
53
  // >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
54
54
  // "-sm"
55
- @function breakpoint-infix($name, $bps: $breakpoints) {
55
+ @function breakpoint-infix($name, $bps) {
56
56
  @return if(breakpoint-min($name, $bps) == null, '', '-#{$name}');
57
57
  }
58
58
 
59
59
  // Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
60
60
  // Makes the @content apply to the given breakpoint and wider.
61
- @mixin media-breakpoint-up($name, $bps: $breakpoints) {
61
+ @mixin media-breakpoint-up($name, $bps) {
62
62
  $min: breakpoint-min($name, $bps);
63
63
  @if $min {
64
64
  @media (min-width: $min) {
@@ -71,7 +71,7 @@
71
71
 
72
72
  // Media of at most the maximum breakpoint width. No query for the largest breakpoint.
73
73
  // Makes the @content apply to the given breakpoint and narrower.
74
- @mixin media-breakpoint-down($name, $bps: $breakpoints) {
74
+ @mixin media-breakpoint-down($name, $bps) {
75
75
  $max: breakpoint-max($name, $bps);
76
76
  @if $max {
77
77
  @media (max-width: $max) {
@@ -84,7 +84,7 @@
84
84
 
85
85
  // Media that spans multiple breakpoint widths.
86
86
  // Makes the @content apply between the min and max breakpoints
87
- @mixin media-breakpoint-between($lower, $upper, $bps: $breakpoints) {
87
+ @mixin media-breakpoint-between($lower, $upper, $bps) {
88
88
  $min: breakpoint-min($lower, $bps);
89
89
  $max: breakpoint-max($upper, $bps);
90
90
 
@@ -106,7 +106,7 @@
106
106
  // Media between the breakpoint's minimum and maximum widths.
107
107
  // No minimum for the smallest breakpoint, and no maximum for the largest one.
108
108
  // Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
109
- @mixin media-breakpoint-only($name, $bps: $breakpoints) {
109
+ @mixin media-breakpoint-only($name, $bps) {
110
110
  $min: breakpoint-min($name, $bps);
111
111
  $max: breakpoint-max($name, $bps);
112
112
 
@@ -3,6 +3,7 @@
3
3
  @use 'sass:color';
4
4
  @use 'sass:string';
5
5
  @use 'sass:list';
6
+ @use 'sass:math';
6
7
 
7
8
  @function hsla-map($color, $name) {
8
9
  @return (
@@ -37,17 +38,20 @@
37
38
  @return $result;
38
39
  }
39
40
 
40
- @function color-shades-map($color, $name, $steps: 5, $scale: 10%) {
41
- $result: (#{$name}: $color);
42
- @for $index from 1 to ($steps + 1) {
43
- $result: map.merge(
44
- map.merge(
45
- $result,
46
- color-lighten-map($color, $name, $steps, $scale, 'lighten')
47
- ),
48
- color-darken-map($color, $name, $steps, $scale, 'darken')
49
- );
50
- }
41
+ @function color-shades-map(
42
+ $color,
43
+ $name,
44
+ $steps: 5,
45
+ $scale: 10%,
46
+ $fixed: false
47
+ ) {
48
+ $result: map.merge(
49
+ map.merge(
50
+ (#{$name}: $color),
51
+ color-lighten-map($color, $name, $steps, $scale, 'lighten', $fixed)
52
+ ),
53
+ color-darken-map($color, $name, $steps, $scale, 'darken', $fixed)
54
+ );
51
55
  @return $result;
52
56
  }
53
57
 
@@ -56,7 +60,8 @@
56
60
  $name,
57
61
  $steps: 5,
58
62
  $scale: 10%,
59
- $prefix: ''
63
+ $prefix: '',
64
+ $fixed: false
60
65
  ) {
61
66
  $result: hsla-map($color, $name);
62
67
  @for $index from 1 to ($steps + 1) {
@@ -65,23 +70,53 @@
65
70
  $key: $prefix + '-' + $index;
66
71
  }
67
72
 
68
- $value: color.scale($color, $lightness: $scale * $index);
69
- $result: map.merge(
70
- $result,
71
- (
72
- #{$key}:
73
- hsl(
74
- var(--color-#{$name}-hue)
75
- var(--color-#{$name}-saturation)
76
- color.lightness($value)
77
- )
78
- )
79
- );
73
+ @if $fixed {
74
+ $increment: $scale * $index;
75
+ $result: map.merge(
76
+ $result,
77
+ (
78
+ #{$key}:
79
+ hsl(
80
+ var(--color-#{$name}-hue)
81
+ var(--color-#{$name}-saturation)
82
+ calc(
83
+ var(--color-#{$name}-lightness) +
84
+ #{$increment}
85
+ )
86
+ )
87
+ )
88
+ );
89
+ } @else {
90
+ $increment: math.div($scale * $index, 100);
91
+ $increment: math.div($increment, ($increment * 0 + 1));
92
+ $result: map.merge(
93
+ $result,
94
+ (
95
+ #{$key}:
96
+ hsl(
97
+ var(--color-#{$name}-hue)
98
+ var(--color-#{$name}-saturation)
99
+ calc(
100
+ var(--color-#{$name}-lightness) +
101
+ var(--color-#{$name}-lightness) *
102
+ #{$increment}
103
+ )
104
+ )
105
+ )
106
+ );
107
+ }
80
108
  }
81
109
  @return $result;
82
110
  }
83
111
 
84
- @function color-darken-map($color, $name, $steps: 5, $scale: 10%, $prefix: '') {
112
+ @function color-darken-map(
113
+ $color,
114
+ $name,
115
+ $steps: 5,
116
+ $scale: 10%,
117
+ $prefix: '',
118
+ $fixed: false
119
+ ) {
85
120
  $result: hsla-map($color, $name);
86
121
 
87
122
  @for $index from 1 to ($steps + 1) {
@@ -90,18 +125,41 @@
90
125
  $key: $prefix + '-' + $index;
91
126
  }
92
127
 
93
- $value: color.scale($color, $lightness: -1 * $scale * $index);
94
- $result: map.merge(
95
- $result,
96
- (
97
- #{$key}:
98
- hsl(
99
- var(--color-#{$name}-hue)
100
- var(--color-#{$name}-saturation)
101
- color.lightness($value)
102
- )
103
- )
104
- );
128
+ @if $fixed {
129
+ $decrement: $scale * $index;
130
+ $result: map.merge(
131
+ $result,
132
+ (
133
+ #{$key}:
134
+ hsl(
135
+ var(--color-#{$name}-hue)
136
+ var(--color-#{$name}-saturation)
137
+ calc(
138
+ var(--color-#{$name}-lightness) -
139
+ #{$decrement}
140
+ )
141
+ )
142
+ )
143
+ );
144
+ } @else {
145
+ $decrement: math.div($scale * $index, 100);
146
+ $decrement: math.div($decrement, ($decrement * 0 + 1));
147
+ $result: map.merge(
148
+ $result,
149
+ (
150
+ #{$key}:
151
+ hsl(
152
+ var(--color-#{$name}-hue)
153
+ var(--color-#{$name}-saturation)
154
+ calc(
155
+ var(--color-#{$name}-lightness) -
156
+ var(--color-#{$name}-lightness) *
157
+ #{$decrement}
158
+ )
159
+ )
160
+ )
161
+ );
162
+ }
105
163
  }
106
164
  @return $result;
107
165
  }
@@ -1,3 +1,3 @@
1
- @import 'functions';
2
- @import 'mixins';
3
- @import 'breakpoints';
1
+ @forward 'functions';
2
+ @forward 'mixins';
3
+ @forward 'breakpoints';