wave-ui 3.27.2 → 4.0.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 (98) hide show
  1. package/dist/types/types/$waveui.d.ts +21 -1
  2. package/dist/types/types/colors.d.ts +2 -0
  3. package/dist/types/types/components/WAccordion.d.ts +99 -6
  4. package/dist/types/types/components/WAutocomplete.d.ts +437 -0
  5. package/dist/types/types/components/WBreadcrumbs.d.ts +7 -0
  6. package/dist/types/types/components/WButton.d.ts +7 -0
  7. package/dist/types/types/components/WCheckbox.d.ts +34 -0
  8. package/dist/types/types/components/WCheckboxes.d.ts +30 -0
  9. package/dist/types/types/components/WInput.d.ts +34 -0
  10. package/dist/types/types/components/WList.d.ts +7 -0
  11. package/dist/types/types/components/WMenu.d.ts +12 -6
  12. package/dist/types/types/components/WRadio.d.ts +34 -0
  13. package/dist/types/types/components/WRadios.d.ts +30 -0
  14. package/dist/types/types/components/WScrollable.d.ts +143 -0
  15. package/dist/types/types/components/WScrollable.js +2 -0
  16. package/dist/types/types/components/WSelect.d.ts +34 -0
  17. package/dist/types/types/components/WSwitch.d.ts +34 -0
  18. package/dist/types/types/components/WTable.d.ts +7 -0
  19. package/dist/types/types/components/WTabs.d.ts +7 -0
  20. package/dist/types/types/components/WTag.d.ts +7 -0
  21. package/dist/types/types/components/WTooltip.d.ts +20 -7
  22. package/dist/types/types/components/WTransitions.d.ts +104 -0
  23. package/dist/types/types/components/WTransitions.js +2 -0
  24. package/dist/types/types/components/WTree.d.ts +7 -0
  25. package/dist/types/types/components/index.d.ts +3 -1
  26. package/dist/wave-ui.cjs.js +3 -3
  27. package/dist/wave-ui.css +1 -1
  28. package/dist/wave-ui.esm.js +2190 -1350
  29. package/dist/wave-ui.umd.js +3 -3
  30. package/package.json +6 -6
  31. package/src/wave-ui/components/index.js +0 -1
  32. package/src/wave-ui/components/transitions/w-transition-bounce.vue +2 -1
  33. package/src/wave-ui/components/transitions/w-transition-expand.vue +3 -2
  34. package/src/wave-ui/components/transitions/w-transition-fade.vue +2 -1
  35. package/src/wave-ui/components/transitions/w-transition-scale-fade.vue +2 -1
  36. package/src/wave-ui/components/transitions/w-transition-scale.vue +2 -1
  37. package/src/wave-ui/components/transitions/w-transition-slide-fade.vue +2 -1
  38. package/src/wave-ui/components/transitions/w-transition-slide.vue +2 -1
  39. package/src/wave-ui/components/transitions/w-transition-twist.vue +2 -1
  40. package/src/wave-ui/components/w-accordion/index.vue +15 -6
  41. package/src/wave-ui/components/w-accordion/item.vue +71 -26
  42. package/src/wave-ui/components/w-alert.vue +27 -29
  43. package/src/wave-ui/components/w-autocomplete.vue +626 -192
  44. package/src/wave-ui/components/w-badge.vue +54 -53
  45. package/src/wave-ui/components/w-breadcrumbs.vue +20 -11
  46. package/src/wave-ui/components/w-button/button.vue +36 -24
  47. package/src/wave-ui/components/w-button/index.vue +6 -5
  48. package/src/wave-ui/components/w-card.vue +8 -7
  49. package/src/wave-ui/components/w-checkbox.vue +31 -11
  50. package/src/wave-ui/components/w-checkboxes.vue +21 -3
  51. package/src/wave-ui/components/w-confirm.vue +22 -22
  52. package/src/wave-ui/components/w-dialog.vue +1 -1
  53. package/src/wave-ui/components/w-divider.vue +5 -5
  54. package/src/wave-ui/components/w-drawer.vue +3 -3
  55. package/src/wave-ui/components/w-form-element.vue +2 -2
  56. package/src/wave-ui/components/w-icon.vue +12 -14
  57. package/src/wave-ui/components/w-image.vue +1 -1
  58. package/src/wave-ui/components/w-input.vue +43 -25
  59. package/src/wave-ui/components/w-list.vue +23 -12
  60. package/src/wave-ui/components/w-menu.vue +57 -55
  61. package/src/wave-ui/components/w-notification.vue +4 -4
  62. package/src/wave-ui/components/w-progress.vue +6 -7
  63. package/src/wave-ui/components/w-radio.vue +32 -7
  64. package/src/wave-ui/components/w-radios.vue +28 -3
  65. package/src/wave-ui/components/w-rating.vue +7 -9
  66. package/src/wave-ui/components/w-scrollable.vue +670 -97
  67. package/src/wave-ui/components/w-select.vue +119 -101
  68. package/src/wave-ui/components/w-slider.vue +26 -26
  69. package/src/wave-ui/components/w-spinner.vue +5 -7
  70. package/src/wave-ui/components/w-switch.vue +71 -47
  71. package/src/wave-ui/components/w-table.vue +69 -36
  72. package/src/wave-ui/components/w-tabs/index.vue +31 -24
  73. package/src/wave-ui/components/w-tag.vue +49 -38
  74. package/src/wave-ui/components/w-textarea.vue +22 -22
  75. package/src/wave-ui/components/w-timeline.vue +6 -6
  76. package/src/wave-ui/components/w-toolbar.vue +8 -8
  77. package/src/wave-ui/components/w-tooltip.vue +30 -25
  78. package/src/wave-ui/components/w-tree.vue +35 -16
  79. package/src/wave-ui/core.js +11 -1
  80. package/src/wave-ui/mixins/detachable.js +98 -43
  81. package/src/wave-ui/mixins/ripple.js +39 -0
  82. package/src/wave-ui/scss/_base.scss +82 -17
  83. package/src/wave-ui/scss/_colors.scss +6 -75
  84. package/src/wave-ui/scss/_layout.scss +39 -47
  85. package/src/wave-ui/scss/_ripple.scss +37 -0
  86. package/src/wave-ui/scss/_transitions.scss +19 -19
  87. package/src/wave-ui/scss/_typography.scss +8 -9
  88. package/src/wave-ui/scss/index.scss +1 -0
  89. package/src/wave-ui/scss/variables/_mixins.scss +24 -25
  90. package/src/wave-ui/scss/variables/_variables.scss +4 -151
  91. package/src/wave-ui/utils/colors.js +7 -4
  92. package/src/wave-ui/utils/config.js +5 -4
  93. package/src/wave-ui/utils/dynamic-css.js +42 -20
  94. package/src/wave-ui/utils/ripple.js +72 -0
  95. package/src/wave-ui/utils/wave-ripple-directive.js +40 -0
  96. package/dist/types/types/components/WApp.d.ts +0 -83
  97. package/src/wave-ui/components/w-app.vue +0 -24
  98. /package/dist/types/types/components/{WApp.js → WAutocomplete.js} +0 -0
@@ -1,4 +1,3 @@
1
- @use "sass:math";
2
1
  @use 'variables' as *;
3
2
 
4
3
  // All these CSS classes will not be generated if the $use-layout-classes is set to false.
@@ -73,18 +72,18 @@
73
72
  // Borders (from 0 to 6), radii (from 0 to 6 + `m` for max).
74
73
  // ----------------------------------------------
75
74
  @for $i from 1 through 6 {
76
- .bd#{$i} {border: $i + px solid $border-color;}
75
+ .bd#{$i} {border: #{$i}px solid var(--w-border-color);}
77
76
  }
78
- .bdx1 {border-left: 1px solid $border-color;border-right: 1px solid $border-color;}
79
- .bdy1 {border-top: 1px solid $border-color;border-bottom: 1px solid $border-color;}
80
- .bdl1 {border-left: 1px solid $border-color;}
81
- .bdr1 {border-right: 1px solid $border-color;}
82
- .bdt1 {border-top: 1px solid $border-color;}
83
- .bdb1 {border-bottom: 1px solid $border-color;}
77
+ .bdx1 {border-left: var(--w-border);border-right: var(--w-border);}
78
+ .bdy1 {border-top: var(--w-border);border-bottom: var(--w-border);}
79
+ .bdl1 {border-left: var(--w-border);}
80
+ .bdr1 {border-right: var(--w-border);}
81
+ .bdt1 {border-top: var(--w-border);}
82
+ .bdb1 {border-bottom: var(--w-border);}
84
83
  .bd0 {border: none;}
85
84
 
86
85
  @for $i from 1 through 6 {
87
- .bdrs#{$i} {border-radius: math.round($i * $base-increment);}
86
+ .bdrs#{$i} {border-radius: calc(#{$i} * var(--w-base-increment));}
88
87
  }
89
88
  .bdrsr {border-radius: 999em;}
90
89
  .bdrsm {border-radius: 100%;}
@@ -95,36 +94,33 @@
95
94
  // ----------------------------------------------
96
95
  @for $i from -6 through -1 {
97
96
  .sh#{$i} {
98
- box-shadow: 0 0 (-1 * math.round($i * $base-increment)) rgba(#000, max(0.15 * divide(-$i, 2), 0.15)) inset;
97
+ box-shadow: var(--w-shadow-n#{-1 * $i});
99
98
  }
100
99
  }
101
100
  @for $i from 1 through 6 {
102
101
  .sh#{$i} {
103
- box-shadow: 0 0 1px rgba(#000, 0.1),
104
- math.round($base-increment * divide($i, 4)) math.round($base-increment * divide($i, 4)) math.round($i * $base-increment) rgba(#000, max(0.15 * divide($i, 2), 0.15));
102
+ box-shadow: var(--w-shadow-#{$i});
105
103
  }
106
104
  }
107
- .sh0 {box-shadow: none;}
105
+ .sh0 {box-shadow: var(--w-shadow-0);}
108
106
  // ----------------------------------------------
109
107
 
110
108
  // Spaces.
111
109
  // ----------------------------------------------
112
110
  // Margin.
113
111
  @for $i from 0 through 12 {
114
- $number: math.round($i * $base-increment);
115
- .ma#{$i} {margin: $number;}
116
- @if ($i > 0) {.ma-#{$i} {margin: -$number;}}
112
+ .ma#{$i} {margin: calc(#{$i} * var(--w-base-increment));}
113
+ @if ($i > 0) {.ma-#{$i} {margin: calc(-#{$i} * var(--w-base-increment));}}
117
114
  }
118
115
  .maa {margin: auto;}
119
116
  .ma0 {margin: 0;}
120
117
 
121
118
  @for $i from 0 through 12 {
122
- $number: math.round($i * $base-increment);
123
- .mx#{$i} {margin-left: $number;margin-right: $number;}
124
- .my#{$i} {margin-top: $number;margin-bottom: $number;}
119
+ .mx#{$i} {margin-left: calc(#{$i} * var(--w-base-increment));margin-right: calc(#{$i} * var(--w-base-increment));}
120
+ .my#{$i} {margin-top: calc(#{$i} * var(--w-base-increment));margin-bottom: calc(#{$i} * var(--w-base-increment));}
125
121
  @if ($i > 0) {
126
- .mx-#{$i} {margin-left: -$number;margin-right: -$number;}
127
- .my-#{$i} {margin-top: -$number;margin-bottom: -$number;}
122
+ .mx-#{$i} {margin-left: calc(-#{$i} * var(--w-base-increment));margin-right: calc(-#{$i} * var(--w-base-increment));}
123
+ .my-#{$i} {margin-top: calc(-#{$i} * var(--w-base-increment));margin-bottom: calc(-#{$i} * var(--w-base-increment));}
128
124
  }
129
125
  }
130
126
  .mxa {margin-left: auto;margin-right: auto;}
@@ -133,16 +129,15 @@
133
129
  .my0 {margin-top: 0;margin-bottom: 0;}
134
130
 
135
131
  @for $i from 0 through 12 {
136
- $number: math.round($i * $base-increment);
137
- .mt#{$i} {margin-top: $number;}
138
- .mr#{$i} {margin-right: $number;}
139
- .mb#{$i} {margin-bottom: $number;}
140
- .ml#{$i} {margin-left: $number;}
132
+ .mt#{$i} {margin-top: calc(#{$i} * var(--w-base-increment));}
133
+ .mr#{$i} {margin-right: calc(#{$i} * var(--w-base-increment));}
134
+ .mb#{$i} {margin-bottom: calc(#{$i} * var(--w-base-increment));}
135
+ .ml#{$i} {margin-left: calc(#{$i} * var(--w-base-increment));}
141
136
  @if ($i > 0) {
142
- .mt-#{$i} {margin-top: -$number;}
143
- .mr-#{$i} {margin-right: -$number;}
144
- .mb-#{$i} {margin-bottom: -$number;}
145
- .ml-#{$i} {margin-left: -$number;}
137
+ .mt-#{$i} {margin-top: calc(-#{$i} * var(--w-base-increment));}
138
+ .mr-#{$i} {margin-right: calc(-#{$i} * var(--w-base-increment));}
139
+ .mb-#{$i} {margin-bottom: calc(-#{$i} * var(--w-base-increment));}
140
+ .ml-#{$i} {margin-left: calc(-#{$i} * var(--w-base-increment));}
146
141
  }
147
142
  }
148
143
  .mta {margin-top: auto;}
@@ -156,25 +151,22 @@
156
151
 
157
152
  // Padding.
158
153
  @for $i from 1 through 12 {
159
- $number: math.round($i * $base-increment);
160
- .pa#{$i} {padding: $number;}
154
+ .pa#{$i} {padding: calc(#{$i} * var(--w-base-increment));}
161
155
  }
162
156
  .pa0 {padding: 0;}
163
157
 
164
158
  @for $i from 0 through 12 {
165
- $number: math.round($i * $base-increment);
166
- .px#{$i} {padding-left: $number;padding-right: $number;}
167
- .py#{$i} {padding-top: $number;padding-bottom: $number;}
159
+ .px#{$i} {padding-left: calc(#{$i} * var(--w-base-increment));padding-right: calc(#{$i} * var(--w-base-increment));}
160
+ .py#{$i} {padding-top: calc(#{$i} * var(--w-base-increment));padding-bottom: calc(#{$i} * var(--w-base-increment));}
168
161
  }
169
162
  .px0 {padding-left: 0;padding-right: 0;}
170
163
  .py0 {padding-top: 0;padding-bottom: 0;}
171
164
 
172
165
  @for $i from 0 through 12 {
173
- $number: math.round($i * $base-increment);
174
- .pt#{$i} {padding-top: $number;}
175
- .pr#{$i} {padding-right: $number;}
176
- .pb#{$i} {padding-bottom: $number;}
177
- .pl#{$i} {padding-left: $number;}
166
+ .pt#{$i} {padding-top: calc(#{$i} * var(--w-base-increment));}
167
+ .pr#{$i} {padding-right: calc(#{$i} * var(--w-base-increment));}
168
+ .pb#{$i} {padding-bottom: calc(#{$i} * var(--w-base-increment));}
169
+ .pl#{$i} {padding-left: calc(#{$i} * var(--w-base-increment));}
178
170
  }
179
171
  .pt0 {padding-top: 0;}
180
172
  .pr0 {padding-right: 0;}
@@ -184,14 +176,14 @@
184
176
 
185
177
  // Sizes.
186
178
  // ----------------------------------------------
187
- // In all the sizes below, math.round(x / 2) * 2 to always have even numbers.
179
+ // In all the sizes below, round(nearest, …, 1px) matches former Sass rounding for px base sizes.
188
180
  // Different heights with a mix of odd and even numbers will misalign
189
181
  // when vertically centering (vertical-align or align-items center).
190
- .size--xs {font-size: math.round(0.8 * $base-font-size);}
191
- .size--sm {font-size: math.round(0.9 * $base-font-size);}
192
- .size--md {font-size: math.round(1 * $base-font-size);}
193
- .size--lg {font-size: math.round(1.2 * $base-font-size);}
194
- .size--xl {font-size: math.round(1.4 * $base-font-size);}
182
+ .size--xs {font-size: round(nearest, calc(0.8 * var(--w-base-font-size)), 1px);}
183
+ .size--sm {font-size: round(nearest, calc(0.9 * var(--w-base-font-size)), 1px);}
184
+ .size--md {font-size: round(nearest, calc(1 * var(--w-base-font-size)), 1px);}
185
+ .size--lg {font-size: round(nearest, calc(1.2 * var(--w-base-font-size)), 1px);}
186
+ .size--xl {font-size: round(nearest, calc(1.4 * var(--w-base-font-size)), 1px);}
195
187
  // ----------------------------------------------
196
188
 
197
189
  // Grid system.
@@ -228,6 +220,6 @@
228
220
  }
229
221
 
230
222
  @for $i from 1 through 12 {
231
- .w-flex.gap#{$i}, .w-grid.gap#{$i} {gap: math.round($base-increment * $i);}
223
+ .w-flex.gap#{$i}, .w-grid.gap#{$i} {gap: calc(#{$i} * var(--w-base-increment));}
232
224
  }
233
225
  .w-flex.gap0, .w-grid.gap0 {gap: 0;}
@@ -0,0 +1,37 @@
1
+ // Pointer ripple (v-wave-ripple + components using applyRipple).
2
+ // Note: avoid overflow:hidden here so hosts like w-button keep focus rings that extend past the box.
3
+ .w-ripple {
4
+ position: relative;
5
+
6
+ .w-ripple__ink-container {
7
+ position: absolute;
8
+ inset: 0;
9
+ overflow: hidden;
10
+ border-radius: inherit;
11
+ pointer-events: none;
12
+ }
13
+ }
14
+
15
+ .w-ripple__ink {
16
+ position: absolute;
17
+ z-index: 2; // Above .w-button:before hover overlay (explicit z-index:0 on :before keeps ink visible).
18
+ border-radius: 50%;
19
+ pointer-events: none;
20
+ transform: scale(0);
21
+ opacity: 0.5;
22
+ // currentColor is often invisible on filled buttons (e.g. white on white); use a neutral ink.
23
+ background-color: color-mix(in srgb, #000 22%, transparent);
24
+ will-change: transform, opacity;
25
+ animation: w-ripple-ink-expand 0.65s ease-out forwards;
26
+ }
27
+
28
+ html[data-theme='dark'] .w-ripple__ink {
29
+ background-color: color-mix(in srgb, #fff 20%, transparent);
30
+ }
31
+
32
+ @keyframes w-ripple-ink-expand {
33
+ to {
34
+ transform: scale(1);
35
+ opacity: 0;
36
+ }
37
+ }
@@ -1,11 +1,11 @@
1
1
  @use 'variables' as *;
2
2
 
3
- $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
3
+ $fast-out-slow-in: var(--w-transition-timing-fast-out-slow-in);
4
4
 
5
5
  // Fade.
6
6
  // --------------------------------------------------------
7
- .fade-enter-active {animation: w-fade $transition-duration;}
8
- .fade-leave-active {animation: w-fade $transition-duration reverse;}
7
+ .fade-enter-active {animation: w-fade var(--w-transition-duration);}
8
+ .fade-leave-active {animation: w-fade var(--w-transition-duration) reverse;}
9
9
  @keyframes w-fade {
10
10
  0% {opacity: 0;}
11
11
  100% {opacity: 1;}
@@ -15,7 +15,7 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
15
15
  // Slide-right: translate x from left to right.
16
16
  // --------------------------------------------------------
17
17
  .slide-right-enter-active, .slide-right-leave-active {
18
- transition: $transition-duration $fast-out-slow-in;
18
+ transition: var(--w-transition-duration) $fast-out-slow-in;
19
19
  transition-property: transform, left, margin-left;
20
20
  transform: translateX(0%);
21
21
  }
@@ -29,7 +29,7 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
29
29
  // Slide-left: translate x from right to left.
30
30
  // --------------------------------------------------------
31
31
  .slide-left-enter-active, .slide-left-leave-active {
32
- transition: $transition-duration;
32
+ transition: var(--w-transition-duration);
33
33
  transition-property: transform, right, margin-right;
34
34
  transform: translateX(0%);
35
35
  }
@@ -43,7 +43,7 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
43
43
  // Slide-down: translate y from top to bottom.
44
44
  // --------------------------------------------------------
45
45
  .slide-down-enter-active, .slide-down-leave-active {
46
- transition: transform $transition-duration $fast-out-slow-in;
46
+ transition: transform var(--w-transition-duration) $fast-out-slow-in;
47
47
  transition-property: transform, top, margin-top;
48
48
  transform: translateY(0%);
49
49
  }
@@ -57,7 +57,7 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
57
57
  // Slide-up: translate y from bottom to top.
58
58
  // --------------------------------------------------------
59
59
  .slide-up-enter-active, .slide-up-leave-active {
60
- transition: transform $transition-duration $fast-out-slow-in;
60
+ transition: transform var(--w-transition-duration) $fast-out-slow-in;
61
61
  transition-property: transform, bottom, margin-bottom;
62
62
  transform: translateY(0%);
63
63
  }
@@ -71,7 +71,7 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
71
71
  // Slide-fade-left.
72
72
  // --------------------------------------------------------
73
73
  .slide-fade-left-enter-active, .slide-fade-left-leave-active {
74
- transition: all $transition-duration $fast-out-slow-in;
74
+ transition: all var(--w-transition-duration) $fast-out-slow-in;
75
75
  }
76
76
  .slide-fade-left-enter-from, .slide-fade-left-leave-to {
77
77
  transform: translateX(12px);
@@ -81,7 +81,7 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
81
81
  // Slide-fade-right.
82
82
  // --------------------------------------------------------
83
83
  .slide-fade-right-enter-active, .slide-fade-right-leave-active {
84
- transition: all $transition-duration $fast-out-slow-in;
84
+ transition: all var(--w-transition-duration) $fast-out-slow-in;
85
85
  }
86
86
  .slide-fade-right-enter-from, .slide-fade-right-leave-to {
87
87
  transform: translateX(-12px);
@@ -92,7 +92,7 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
92
92
  // Slide-fade-up.
93
93
  // --------------------------------------------------------
94
94
  .slide-fade-up-enter-active, .slide-fade-up-leave-active {
95
- transition: all $transition-duration $fast-out-slow-in;
95
+ transition: all var(--w-transition-duration) $fast-out-slow-in;
96
96
  }
97
97
  .slide-fade-up-enter-from, .slide-fade-up-leave-to {
98
98
  transform: translateY(12px);
@@ -103,7 +103,7 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
103
103
  // Slide-fade-down.
104
104
  // --------------------------------------------------------
105
105
  .slide-fade-down-enter-active, .slide-fade-down-leave-active {
106
- transition: all $transition-duration $fast-out-slow-in;
106
+ transition: all var(--w-transition-duration) $fast-out-slow-in;
107
107
  }
108
108
  .slide-fade-down-enter-from, .slide-fade-down-leave-to {
109
109
  transform: translateY(-12px);
@@ -113,8 +113,8 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
113
113
 
114
114
  // Scale.
115
115
  // --------------------------------------------------------
116
- .scale-enter-active {animation: w-scale $transition-duration;}
117
- .scale-leave-active {animation: w-scale $transition-duration reverse;}
116
+ .scale-enter-active {animation: w-scale var(--w-transition-duration);}
117
+ .scale-leave-active {animation: w-scale var(--w-transition-duration) reverse;}
118
118
  @keyframes w-scale {
119
119
  0% {transform: scale(0);}
120
120
  100% {transform: scale(1);}
@@ -123,8 +123,8 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
123
123
 
124
124
  // Scale-fade.
125
125
  // --------------------------------------------------------
126
- .scale-fade-enter-active {animation: w-scale-fade $transition-duration;}
127
- .scale-fade-leave-active {animation: w-scale-fade $transition-duration reverse;}
126
+ .scale-fade-enter-active {animation: w-scale-fade var(--w-transition-duration);}
127
+ .scale-fade-leave-active {animation: w-scale-fade var(--w-transition-duration) reverse;}
128
128
  @keyframes w-scale-fade {
129
129
  0% {transform: scale(0.8);opacity: 0;}
130
130
  100% {transform: scale(1);opacity: 1;}
@@ -133,8 +133,8 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
133
133
 
134
134
  // Bounce.
135
135
  // --------------------------------------------------------
136
- .bounce-enter-active {animation: w-bounce ($transition-duration + 0.05s);}
137
- .bounce-leave-active {animation: w-bounce ($transition-duration + 0.05s) reverse;}
136
+ .bounce-enter-active {animation: w-bounce calc(var(--w-transition-duration) + 0.05s);}
137
+ .bounce-leave-active {animation: w-bounce calc(var(--w-transition-duration) + 0.05s) reverse;}
138
138
  @keyframes w-bounce {
139
139
  0% {transform: scale(0.7);opacity: 0;}
140
140
  60% {transform: scale(1.1);opacity: 1;}
@@ -144,8 +144,8 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
144
144
 
145
145
  // Twist.
146
146
  // --------------------------------------------------------
147
- .twist-enter-active {animation: w-twist ($transition-duration + 0.25s);}
148
- .twist-leave-active {animation: w-twist ($transition-duration + 0.25s) reverse;}
147
+ .twist-enter-active {animation: w-twist calc(var(--w-transition-duration) + 0.25s);}
148
+ .twist-leave-active {animation: w-twist calc(var(--w-transition-duration) + 0.25s) reverse;}
149
149
  @keyframes w-twist {
150
150
  0% {transform: scale(0) rotate(-70deg);}
151
151
  60% {transform: scale(1.03) rotate(6deg);}
@@ -1,41 +1,40 @@
1
- @use "sass:math";
2
1
  @use 'variables' as *;
3
2
 
4
3
  #{$css-scope} {
5
4
  .headline, .title1 {
6
- font-size: math.round(2.2 * $base-font-size);
5
+ font-size: calc(2.2 * var(--w-base-font-size));
7
6
  font-weight: 100;
8
7
  }
9
8
 
10
9
  .title2 {
11
- font-size: math.round(1.7 * $base-font-size);
10
+ font-size: calc(1.7 * var(--w-base-font-size));
12
11
  font-weight: 400;
13
12
  }
14
13
 
15
14
  .title3 {
16
- font-size: math.round(1.4 * $base-font-size);
15
+ font-size: calc(1.4 * var(--w-base-font-size));
17
16
  font-weight: 400;
18
17
  }
19
18
 
20
19
  .title4 {
21
- font-size: math.round(1.25 * $base-font-size);
20
+ font-size: calc(1.25 * var(--w-base-font-size));
22
21
  font-weight: 400;
23
22
  }
24
23
 
25
24
  .title5 {
26
- font-size: math.round(1.1 * $base-font-size);
25
+ font-size: calc(1.1 * var(--w-base-font-size));
27
26
  font-weight: 600;
28
27
  }
29
28
 
30
29
  .body {
31
- font-size: $base-font-size;
30
+ font-size: var(--w-base-font-size);
32
31
  font-weight: normal;
33
32
  }
34
33
 
35
34
  .caption {
36
- font-size: math.round(0.85 * $base-font-size);
35
+ font-size: calc(0.85 * var(--w-base-font-size));
37
36
  font-style: italic;
38
- color: $caption-color;
37
+ color: var(--w-caption-color);
39
38
  }
40
39
 
41
40
  .text-upper {text-transform: uppercase;}
@@ -4,3 +4,4 @@
4
4
  @forward 'colors';
5
5
  @forward 'icons';
6
6
  @forward 'transitions';
7
+ @forward 'ripple';
@@ -1,33 +1,32 @@
1
- @use "sass:map";
2
- @use "variables" as *;
3
-
4
1
  // This allows each UI component to be used in dark or light theme regardless of the global theme.
5
2
  @mixin themeable {
6
3
  // Will force the light style on this component.
7
4
  &--light {
8
- --w-base-bg-color: #{map.get($theme-light, 'base-bg-color')};
9
- --w-base-color: #{map.get($theme-light, 'base-color')};
10
- --w-contrast-bg-color: #{map.get($theme-light, 'contrast-bg-color')};
11
- --w-contrast-color: #{map.get($theme-light, 'contrast-color')};
12
- --w-disabled-color: #{map.get($theme-light, 'disabled-color')};
13
- color: rgba(var(--w-base-color), 0.7);
5
+ --w-base-bg-color: #fff;
6
+ --w-base-color: #000;
7
+ --w-contrast-bg-color: #000;
8
+ --w-contrast-color: #fff;
9
+ --w-caption-color: #a0a0a0;
10
+ --w-disabled-color: #ccc;
11
+ color: var(--w-base-color-muted);
14
12
  }
15
13
  // Will force the dark style on this component.
16
14
  &--dark {
17
- --w-base-bg-color: #{map.get($theme-dark, 'base-bg-color')};
18
- --w-base-color: #{map.get($theme-dark, 'base-color')};
19
- --w-contrast-bg-color: #{map.get($theme-dark, 'contrast-bg-color')};
20
- --w-contrast-color: #{map.get($theme-dark, 'contrast-color')};
21
- --w-disabled-color: #{map.get($theme-dark, 'disabled-color')};
22
- color: rgba(var(--w-base-color), 0.7);
15
+ --w-base-bg-color: #222;
16
+ --w-base-color: #fff;
17
+ --w-contrast-bg-color: #fff;
18
+ --w-contrast-color: #000;
19
+ --w-caption-color: #6e6e6e;
20
+ --w-disabled-color: #4a4a4a;
21
+ color: var(--w-base-color-muted);
23
22
  }
24
23
  }
25
24
 
26
- @mixin default-transition($duration: $transition-duration, $delay: 0s) {
25
+ @mixin default-transition($duration: var(--w-transition-duration), $delay: 0s) {
27
26
  transition: $duration $delay ease-in-out;
28
27
  }
29
28
 
30
- @mixin out-back-transition($duration: $transition-duration, $delay: 0s) {
29
+ @mixin out-back-transition($duration: var(--w-transition-duration), $delay: 0s) {
31
30
  transition: $duration $delay cubic-bezier(0.18, 0.89, 0.32, 1.28);
32
31
  }
33
32
 
@@ -78,21 +77,21 @@
78
77
 
79
78
  &#{$selector}--align-top:before {
80
79
  transform: none;
81
- top: (2 * $base-increment) - 1px;
80
+ top: calc(2 * var(--w-base-increment) - 1px);
82
81
  }
83
82
  &#{$selector}--align-bottom:before {
84
83
  transform: none;
85
84
  top: auto;
86
- bottom: (2 * $base-increment) - 1px;
85
+ bottom: calc(2 * var(--w-base-increment) - 1px);
87
86
  }
88
87
  &#{$selector}--align-left:before {
89
88
  transform: none;
90
- left: (2 * $base-increment) - 1px;
89
+ left: calc(2 * var(--w-base-increment) - 1px);
91
90
  }
92
91
  &#{$selector}--align-right:before {
93
92
  transform: none;
94
93
  left: auto;
95
- right: (2 * $base-increment) - 1px;
94
+ right: calc(2 * var(--w-base-increment) - 1px);
96
95
  }
97
96
  }
98
97
 
@@ -129,8 +128,8 @@
129
128
  transform: translateY(-50%);
130
129
  }
131
130
 
132
- &#{$selector}--align-top:after {transform: none;top: 2 * $base-increment;}
133
- &#{$selector}--align-bottom:after {transform: none;top: auto;bottom: 2 * $base-increment;}
134
- &#{$selector}--align-left:after {transform: none;left: 2 * $base-increment;}
135
- &#{$selector}--align-right:after {transform: none;left: auto;right: 2 * $base-increment;}
131
+ &#{$selector}--align-top:after {transform: none;top: calc(2 * var(--w-base-increment));}
132
+ &#{$selector}--align-bottom:after {transform: none;top: auto;bottom: calc(2 * var(--w-base-increment));}
133
+ &#{$selector}--align-left:after {transform: none;left: calc(2 * var(--w-base-increment));}
134
+ &#{$selector}--align-right:after {transform: none;left: auto;right: calc(2 * var(--w-base-increment));}
136
135
  }
@@ -1,157 +1,10 @@
1
- @use "sass:math";
2
- @use "sass:map";
3
-
4
- @function divide($a, $b) {
5
- @return math.div($a, $b);
6
- }
7
-
8
- // THEME COLORS.
9
- // ========================================================
10
- // If you don't need themes, you can leave this as is and override the global defaults.
11
- $theme-light: (
12
- base-bg-color: #fff,
13
- base-color: #000,
14
- contrast-bg-color: #000,
15
- contrast-color: #fff,
16
- caption-color: #a0a0a0,
17
- disabled-color: #ccc
18
- ) !default;
19
-
20
- $theme-dark: (
21
- base-bg-color: #222,
22
- base-color: #fff,
23
- contrast-bg-color: #fff,
24
- contrast-color: #000,
25
- caption-color: #6e6e6e,
26
- disabled-color: #4a4a4a
27
- ) !default;
28
-
29
- // These variables are filled up with the current theme colors for you to use.
30
- $primary: var(--w-primary-color);
31
- $secondary: var(--w-secondary-color);
32
- $base-bg-color: var(--w-base-bg-color);
33
- $base-color: var(--w-base-color);
34
- $contrast-bg-color: var(--w-contrast-bg-color);
35
- $contrast-color: var(--w-contrast-color);
36
- $caption-color: var(--w-caption-color);
37
- // When a form element is disabled (checkbox, radio, input, select list).
38
- $disabled-color: var(--w-disabled-color);
1
+ // Theme palette defaults live as plain CSS on :root[data-theme] in _base.scss
2
+ // and in the themeable mixin (_mixins.scss). Override with CSS, e.g.
3
+ // :root { --w-base-font-size: 16px; } (also drives --w-base-increment on :root)
4
+ // :root[data-theme="light"] { --w-base-bg-color: #fafafa; }
39
5
 
40
6
  // GLOBAL DEFAULTS.
41
7
  // ========================================================
42
8
  $css-scope: '.w-app' !default; // Allows control on CSS rules priority.
43
9
  // True by default. False allows you to use an external CSS library (like Tailwind).
44
10
  $use-layout-classes: true !default;
45
-
46
- $base-font-size: 14px !default; // Must be a px unit.
47
- $base-increment: math.round(divide($base-font-size, 4)) !default;
48
- $layout-padding: $base-increment * 4 !default; // Applied on the .content-wrap tag.
49
- $border-radius: 4px !default;
50
- $border-color: color-mix(in srgb, var(--w-contrast-bg-color) 12%, transparent) !default;
51
- $border: 1px solid $border-color !default;
52
- $transition-duration: 0.25s !default;
53
- $fast-transition-duration: 0.15s !default;
54
- $box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
55
- 0 2px 2px 0 rgba(0, 0, 0, 0.15),
56
- 0 1px 5px 0 rgba(0, 0, 0, 0.15) !default;
57
- $form-field-height: math.round(2 * $base-font-size) !default;
58
- // Always an even number for better vertical alignment. (Used in checkbox, radio, switch)
59
- $small-form-el-size: math.round(divide(1.3 * $base-font-size, 2)) * 2 !default;
60
-
61
- // Detachable elements are: w-tooltip, w-menu, w-confirm.
62
- $detachable-bg-color: $base-bg-color !default;
63
- $detachable-color: $base-color !default;
64
-
65
- // COMPONENTS DEFAULTS.
66
- // ========================================================
67
- // w-confirm.
68
- // --------------------------------------------------------
69
- $confirm-bg-color: $detachable-bg-color !default;
70
- $confirm-color: $detachable-color !default;
71
- // --------------------------------------------------------
72
-
73
- // w-dialog.
74
- // --------------------------------------------------------
75
- $dialog-bg-color: $base-bg-color !default;
76
- // --------------------------------------------------------
77
-
78
- // w-divider.
79
- // --------------------------------------------------------
80
- $divider-color: $border-color !default;
81
- // --------------------------------------------------------
82
-
83
- // w-drawer.
84
- // --------------------------------------------------------
85
- $drawer-max-size: 380px !default;
86
- $drawer-bg-color: $base-bg-color !default;
87
- // --------------------------------------------------------
88
-
89
- // w-menu.
90
- // --------------------------------------------------------
91
- $menu-bg-color: $detachable-bg-color !default;
92
- $menu-color: $detachable-color !default;
93
- // --------------------------------------------------------
94
-
95
- // w-progress.
96
- // --------------------------------------------------------
97
- $progress-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 15%, transparent) !default;
98
- // --------------------------------------------------------
99
-
100
- // w-rating.
101
- // --------------------------------------------------------
102
- $rating-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, transparent) !default;
103
- // --------------------------------------------------------
104
-
105
- // w-slider.
106
- // --------------------------------------------------------
107
- $slider-height: $base-increment !default;
108
- $slider-track-color: color-mix(in srgb, var(--w-contrast-bg-color) 15%, transparent) !default;
109
- $slider-thumb-button-bg-color: $base-bg-color !default;
110
- $slider-thumb-label-bg-color: $base-bg-color !default;
111
- $slider-thumb-label-color: color-mix(in srgb, var(--w-base-color) 75%, transparent) !default;
112
- $slider-step-label-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 20%, transparent) !default;
113
- $slider-step-label-color: color-mix(in srgb, var(--w-base-color) 50%, transparent) !default;
114
-
115
- // w-switch.
116
- // --------------------------------------------------------
117
- $switch-inactive-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, transparent) !default;
118
- $switch-thumb-color: $base-bg-color !default;
119
- // --------------------------------------------------------
120
-
121
- // w-table.
122
- // --------------------------------------------------------
123
- $table-tr-odd-color: color-mix(in srgb, var(--w-contrast-bg-color) 2%, transparent) !default;
124
- $table-tr-hover-color: color-mix(in srgb, var(--w-contrast-bg-color) 5%, transparent) !default;
125
- $table-color: color-mix(in srgb, var(--w-contrast-color) 70%, transparent) !default;
126
- // --------------------------------------------------------
127
-
128
- // w-textarea.
129
- // --------------------------------------------------------
130
- $textarea-line-height: 1.2 !default;
131
- // --------------------------------------------------------
132
-
133
- // w-timeline.
134
- // --------------------------------------------------------
135
- $timeline-bullet-color: $base-bg-color !default;
136
- $timeline-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, transparent) !default;
137
- // --------------------------------------------------------
138
-
139
- // w-toolbar.
140
- // --------------------------------------------------------
141
- $toolbar-max-size: 380px !default;
142
- $toolbar-bg-color: $base-bg-color !default;
143
- // --------------------------------------------------------
144
-
145
- // w-tooltip.
146
- // --------------------------------------------------------
147
- $tooltip-bg-color: $detachable-bg-color !default;
148
- $tooltip-color: $detachable-color !default;
149
- $tooltip-border-color: $border-color !default;
150
- // --------------------------------------------------------
151
-
152
- // w-scrollable.
153
- // --------------------------------------------------------
154
- $scrollbar-size: 8px !default;
155
- $scrollbar-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 8%, var(--w-base-bg-color)) !default;
156
- $scrollbar-thumb-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, var(--w-base-bg-color)) !default;
157
- // --------------------------------------------------------
@@ -1,5 +1,9 @@
1
1
  import { consoleError } from './console'
2
2
 
3
+ // The built-in palette remains the single source for exact legacy shade values.
4
+ // dynamic-css.js exposes these colors as --w-*-color variables; SCSS color
5
+ // utility classes only reference those variables.
6
+
3
7
  /**
4
8
  * Generates the color shades for each custom color and status colors for the current theme (only),
5
9
  * and save it in the config object.
@@ -37,11 +41,10 @@ export const flattenColors = (themeColors, colorPalette) => {
37
41
  const colors = {
38
42
  ...colorPalette.reduce((obj, color) => {
39
43
  obj[color.label] = color.color
40
- const shades = (color.shades || []).reduce((obj, color) => {
44
+ ;(color.shades || []).forEach(color => {
41
45
  obj[color.label] = color.color
42
- return obj
43
- }, {})
44
- return { ...obj, ...shades }
46
+ })
47
+ return obj
45
48
  }, { ...themeColors, ...themeColors.shades })
46
49
  }
47
50
  delete colors.shades