wave-ui 3.28.0 → 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 (89) hide show
  1. package/dist/types/types/$waveui.d.ts +15 -1
  2. package/dist/types/types/colors.d.ts +2 -0
  3. package/dist/types/types/components/WAccordion.d.ts +92 -6
  4. package/dist/types/types/components/WAutocomplete.d.ts +437 -0
  5. package/dist/types/types/components/WCheckbox.d.ts +34 -0
  6. package/dist/types/types/components/WCheckboxes.d.ts +30 -0
  7. package/dist/types/types/components/WInput.d.ts +34 -0
  8. package/dist/types/types/components/WMenu.d.ts +12 -6
  9. package/dist/types/types/components/WRadio.d.ts +34 -0
  10. package/dist/types/types/components/WRadios.d.ts +30 -0
  11. package/dist/types/types/components/WSelect.d.ts +34 -0
  12. package/dist/types/types/components/WSwitch.d.ts +34 -0
  13. package/dist/types/types/components/WTable.d.ts +7 -0
  14. package/dist/types/types/components/WTooltip.d.ts +20 -7
  15. package/dist/types/types/components/WTransitions.d.ts +104 -0
  16. package/dist/types/types/components/WTransitions.js +2 -0
  17. package/dist/types/types/components/WTree.d.ts +7 -0
  18. package/dist/types/types/components/index.d.ts +2 -1
  19. package/dist/wave-ui.cjs.js +3 -3
  20. package/dist/wave-ui.css +1 -1
  21. package/dist/wave-ui.esm.js +1711 -1338
  22. package/dist/wave-ui.umd.js +3 -3
  23. package/package.json +1 -1
  24. package/src/wave-ui/components/index.js +0 -1
  25. package/src/wave-ui/components/transitions/w-transition-bounce.vue +2 -1
  26. package/src/wave-ui/components/transitions/w-transition-expand.vue +3 -2
  27. package/src/wave-ui/components/transitions/w-transition-fade.vue +2 -1
  28. package/src/wave-ui/components/transitions/w-transition-scale-fade.vue +2 -1
  29. package/src/wave-ui/components/transitions/w-transition-scale.vue +2 -1
  30. package/src/wave-ui/components/transitions/w-transition-slide-fade.vue +2 -1
  31. package/src/wave-ui/components/transitions/w-transition-slide.vue +2 -1
  32. package/src/wave-ui/components/transitions/w-transition-twist.vue +2 -1
  33. package/src/wave-ui/components/w-accordion/index.vue +10 -5
  34. package/src/wave-ui/components/w-accordion/item.vue +29 -14
  35. package/src/wave-ui/components/w-alert.vue +27 -29
  36. package/src/wave-ui/components/w-autocomplete.vue +626 -192
  37. package/src/wave-ui/components/w-badge.vue +54 -53
  38. package/src/wave-ui/components/w-breadcrumbs.vue +7 -9
  39. package/src/wave-ui/components/w-button/button.vue +21 -23
  40. package/src/wave-ui/components/w-button/index.vue +4 -4
  41. package/src/wave-ui/components/w-card.vue +8 -7
  42. package/src/wave-ui/components/w-checkbox.vue +31 -11
  43. package/src/wave-ui/components/w-checkboxes.vue +21 -3
  44. package/src/wave-ui/components/w-confirm.vue +22 -22
  45. package/src/wave-ui/components/w-dialog.vue +1 -1
  46. package/src/wave-ui/components/w-divider.vue +5 -5
  47. package/src/wave-ui/components/w-drawer.vue +3 -3
  48. package/src/wave-ui/components/w-form-element.vue +2 -2
  49. package/src/wave-ui/components/w-icon.vue +12 -14
  50. package/src/wave-ui/components/w-image.vue +1 -1
  51. package/src/wave-ui/components/w-input.vue +43 -25
  52. package/src/wave-ui/components/w-list.vue +11 -12
  53. package/src/wave-ui/components/w-menu.vue +57 -55
  54. package/src/wave-ui/components/w-notification.vue +4 -4
  55. package/src/wave-ui/components/w-progress.vue +6 -7
  56. package/src/wave-ui/components/w-radio.vue +32 -7
  57. package/src/wave-ui/components/w-radios.vue +28 -3
  58. package/src/wave-ui/components/w-rating.vue +7 -9
  59. package/src/wave-ui/components/w-scrollable.vue +4 -4
  60. package/src/wave-ui/components/w-select.vue +119 -101
  61. package/src/wave-ui/components/w-slider.vue +26 -26
  62. package/src/wave-ui/components/w-spinner.vue +5 -7
  63. package/src/wave-ui/components/w-switch.vue +71 -47
  64. package/src/wave-ui/components/w-table.vue +69 -36
  65. package/src/wave-ui/components/w-tabs/index.vue +21 -24
  66. package/src/wave-ui/components/w-tag.vue +35 -38
  67. package/src/wave-ui/components/w-textarea.vue +22 -22
  68. package/src/wave-ui/components/w-timeline.vue +6 -6
  69. package/src/wave-ui/components/w-toolbar.vue +8 -8
  70. package/src/wave-ui/components/w-tooltip.vue +30 -25
  71. package/src/wave-ui/components/w-tree.vue +35 -16
  72. package/src/wave-ui/core.js +9 -1
  73. package/src/wave-ui/mixins/detachable.js +98 -43
  74. package/src/wave-ui/mixins/ripple.js +2 -2
  75. package/src/wave-ui/scss/_base.scss +82 -17
  76. package/src/wave-ui/scss/_colors.scss +6 -75
  77. package/src/wave-ui/scss/_layout.scss +39 -47
  78. package/src/wave-ui/scss/_ripple.scss +2 -2
  79. package/src/wave-ui/scss/_transitions.scss +19 -19
  80. package/src/wave-ui/scss/_typography.scss +8 -9
  81. package/src/wave-ui/scss/variables/_mixins.scss +24 -25
  82. package/src/wave-ui/scss/variables/_variables.scss +4 -149
  83. package/src/wave-ui/utils/colors.js +7 -4
  84. package/src/wave-ui/utils/config.js +3 -4
  85. package/src/wave-ui/utils/dynamic-css.js +42 -20
  86. package/src/wave-ui/utils/ripple.js +3 -2
  87. package/dist/types/types/components/WApp.d.ts +0 -83
  88. package/src/wave-ui/components/w-app.vue +0 -24
  89. /package/dist/types/types/components/{WApp.js → WAutocomplete.js} +0 -0
@@ -93,19 +93,17 @@ export default {
93
93
  </script>
94
94
 
95
95
  <style lang="scss">
96
- @use "sass:math";
97
-
98
96
  .w-tag {
99
97
  position: relative;
100
98
  display: inline-flex;
101
99
  align-items: center;
102
100
  justify-content: center;
103
101
  vertical-align: middle;
104
- border-radius: $border-radius;
102
+ border-radius: var(--w-border-radius);
105
103
  border: 1px solid color-mix(in srgb, var(--w-contrast-bg-color) 8%, transparent);
106
104
  background-color: color-mix(in srgb, var(--w-base-bg-color) 85%, transparent);
107
- padding-left: 2 * $base-increment;
108
- padding-right: 2 * $base-increment;
105
+ padding-left: calc(var(--w-base-increment) * 2);
106
+ padding-right: calc(var(--w-base-increment) * 2);
109
107
  cursor: default;
110
108
  user-select: none;
111
109
 
@@ -116,40 +114,40 @@ export default {
116
114
  &--no-border {border-color: transparent;}
117
115
  &--round {border-radius: 99em;}
118
116
  &--tile {border-radius: initial;}
119
- &--shadow {box-shadow: $box-shadow;}
117
+ &--shadow {box-shadow: var(--w-box-shadow);}
120
118
 
121
119
  &.size--xs {
122
- $font-size: math.round(0.7 * $base-font-size);
123
- font-size: $font-size;
124
- line-height: $font-size + 2px;
125
- padding: math.round(0.25 * $base-increment) $base-increment;
120
+ --w-tag-font-size: round(nearest, calc(0.7 * var(--w-base-font-size)), 1px);
121
+ font-size: var(--w-tag-font-size);
122
+ line-height: calc(var(--w-tag-font-size) + 2px);
123
+ padding: calc(var(--w-base-increment) * 0.25) var(--w-base-increment);
126
124
  }
127
125
  &.size--sm {
128
- $font-size: math.round(0.82 * $base-font-size);
129
- font-size: $font-size;
130
- line-height: $font-size + 2px;
131
- padding: math.round(0.25 * $base-increment) $base-increment;
126
+ --w-tag-font-size: round(nearest, calc(0.82 * var(--w-base-font-size)), 1px);
127
+ font-size: var(--w-tag-font-size);
128
+ line-height: calc(var(--w-tag-font-size) + 2px);
129
+ padding: calc(var(--w-base-increment) * 0.25) var(--w-base-increment);
132
130
  }
133
131
  &.size--md {
134
- $font-size: math.round(0.85 * $base-font-size);
135
- font-size: $font-size;
136
- line-height: $font-size + 4px;
137
- padding-top: math.round(0.25 * $base-increment);
138
- padding-bottom: math.round(0.25 * $base-increment);
132
+ --w-tag-font-size: round(nearest, calc(0.85 * var(--w-base-font-size)), 1px);
133
+ font-size: var(--w-tag-font-size);
134
+ line-height: calc(var(--w-tag-font-size) + 4px);
135
+ padding-top: calc(var(--w-base-increment) * 0.25);
136
+ padding-bottom: calc(var(--w-base-increment) * 0.25);
139
137
  }
140
138
  &.size--lg {
141
- $font-size: math.round(1.1 * $base-font-size);
142
- font-size: $font-size;
143
- line-height: $font-size + 4px;
144
- padding-top: math.round(0.5 * $base-increment);
145
- padding-bottom: math.round(0.5 * $base-increment);
139
+ --w-tag-font-size: round(nearest, calc(1.1 * var(--w-base-font-size)), 1px);
140
+ font-size: var(--w-tag-font-size);
141
+ line-height: calc(var(--w-tag-font-size) + 4px);
142
+ padding-top: calc(var(--w-base-increment) * 0.5);
143
+ padding-bottom: calc(var(--w-base-increment) * 0.5);
146
144
  }
147
145
  &.size--xl {
148
- $font-size: math.round(1.3 * $base-font-size);
149
- font-size: $font-size;
150
- line-height: $font-size + 4px;
151
- padding-top: math.round(1 * $base-increment);
152
- padding-bottom: math.round(1 * $base-increment);
146
+ --w-tag-font-size: round(nearest, calc(1.3 * var(--w-base-font-size)), 1px);
147
+ font-size: var(--w-tag-font-size);
148
+ line-height: calc(var(--w-tag-font-size) + 4px);
149
+ padding-top: var(--w-base-increment);
150
+ padding-bottom: var(--w-base-increment);
153
151
  }
154
152
 
155
153
  &--clickable {
@@ -161,7 +159,7 @@ export default {
161
159
  margin-left: 3px;
162
160
  margin-right: -3px;
163
161
  padding: 1px;
164
- transition: $transition-duration;
162
+ transition: var(--w-transition-duration);
165
163
  }
166
164
  &.size--lg .w-tag__closable,
167
165
  &.size--xl .w-tag__closable {
@@ -178,31 +176,30 @@ export default {
178
176
  content: '';
179
177
  position: absolute;
180
178
  inset: 0;
181
- opacity: 0;
182
179
  background-color: transparent;
183
180
  // As this overlay is a smaller rectangle, the radius must be smaller to cover perfectly.
184
- border-radius: $border-radius - 1;
181
+ border-radius: calc(var(--w-border-radius) - 1px);
185
182
  transition: 0.2s;
186
183
  }
187
184
  &.w-tag--round:before {border-radius: inherit;}
188
185
 
189
186
  // Hover state.
190
- &:hover:before {background-color: currentColor;opacity: 0.06;}
187
+ &:hover:before {background-color: color-mix(in srgb, currentColor 6%, transparent);}
191
188
  &--dark:hover:before {background-color: color-mix(in srgb, var(--w-base-bg-color) 12%, transparent);opacity: 1;}
192
189
  &--outline:hover:before,
193
- &--text:hover:before {background-color: currentColor;opacity: 0.12;}
190
+ &--text:hover:before {background-color: color-mix(in srgb, currentColor 12%, transparent);}
194
191
 
195
192
  // Focus state.
196
- &:focus:before {background-color: currentColor;opacity: 0.2;}
193
+ &:focus:before {background-color: color-mix(in srgb, currentColor 20%, transparent);}
197
194
  &--dark:focus:before {background-color: color-mix(in srgb, var(--w-base-bg-color) 12%, transparent);}
198
195
  &--outline:focus:before,
199
- &--text:focus:before {background-color: currentColor;opacity: 0.12;}
196
+ &--text:focus:before {background-color: color-mix(in srgb, currentColor 12%, transparent);}
200
197
 
201
198
  // Active state.
202
- &:active:before {background-color: currentColor;opacity: 0.2;}
199
+ &:active:before {background-color: color-mix(in srgb, currentColor 20%, transparent);}
203
200
  &--dark:active:before {background-color: color-mix(in srgb, var(--w-base-bg-color) 20%, transparent);}
204
201
  &--outline:active:before,
205
- &--text:active:before {background-color: currentColor;opacity: 0.2;}
202
+ &--text:active:before {background-color: color-mix(in srgb, currentColor 20%, transparent);}
206
203
  }
207
204
  }
208
205
  </style>
@@ -237,7 +237,7 @@ $inactive-color: #777;
237
237
  display: flex;
238
238
  flex-grow: 1;
239
239
  flex-wrap: wrap;
240
- font-size: $base-font-size;
240
+ font-size: var(--w-base-font-size);
241
241
 
242
242
  @include themeable;
243
243
 
@@ -247,15 +247,15 @@ $inactive-color: #777;
247
247
  position: relative;
248
248
  display: inline-flex;
249
249
  flex: 1 1 auto;
250
- min-height: $form-field-height;
251
- border-radius: $border-radius;
252
- border: $border;
253
- transition: border $transition-duration;
250
+ min-height: var(--w-form-field-height);
251
+ border-radius: var(--w-border-radius);
252
+ border: var(--w-border);
253
+ transition: border var(--w-transition-duration);
254
254
 
255
255
  .w-textarea[class^="bdrs"] &, .w-textarea[class*=" bdrs"] & {border-radius: inherit;}
256
256
  }
257
257
 
258
- &--floating-label &__textarea-wrap {margin-top: 4 * $base-increment;}
258
+ &--floating-label &__textarea-wrap {margin-top: calc(var(--w-base-increment) * 4);}
259
259
 
260
260
  &__textarea-wrap--underline {
261
261
  border-bottom-left-radius: initial;
@@ -264,7 +264,7 @@ $inactive-color: #777;
264
264
  }
265
265
 
266
266
  &__textarea-wrap--tile {border-radius: initial;}
267
- &__textarea-wrap--shadow {box-shadow: $box-shadow;}
267
+ &__textarea-wrap--shadow {box-shadow: var(--w-box-shadow);}
268
268
 
269
269
  &--focused &__textarea-wrap {border-color: currentColor;}
270
270
 
@@ -277,7 +277,7 @@ $inactive-color: #777;
277
277
  width: 100%;
278
278
  height: 0;
279
279
  border-bottom: 2px solid currentColor;
280
- transition: $transition-duration;
280
+ transition: var(--w-transition-duration);
281
281
  transform: scaleX(0);
282
282
  pointer-events: none;
283
283
  }
@@ -290,12 +290,12 @@ $inactive-color: #777;
290
290
  width: 100%;
291
291
  height: 100%;
292
292
  font: inherit;
293
- line-height: $textarea-line-height;
293
+ line-height: var(--w-textarea-line-height);
294
294
  color: inherit;
295
295
  background: none;
296
296
  border: none;
297
297
  outline: none;
298
- padding: $base-increment (2 * $base-increment);
298
+ padding: var(--w-base-increment) calc(var(--w-base-increment) * 2);
299
299
  resize: none;
300
300
 
301
301
  .w-textarea--resizable & {resize: vertical;}
@@ -309,7 +309,7 @@ $inactive-color: #777;
309
309
  .w-textarea--inner-icon-right & {padding-right: 27px;}
310
310
 
311
311
  .w-textarea--disabled & {
312
- color: $disabled-color;
312
+ color: var(--w-disabled-color);
313
313
  cursor: not-allowed;
314
314
  -webkit-tap-highlight-color: transparent;
315
315
  }
@@ -319,7 +319,7 @@ $inactive-color: #777;
319
319
 
320
320
  // Icons inside.
321
321
  // ------------------------------------------------------
322
- &__icon {position: absolute;margin-top: $base-increment;}
322
+ &__icon {position: absolute;margin-top: var(--w-base-increment);}
323
323
  &__icon--inner-left {left: 6px;}
324
324
  &__icon--inner-right {right: 6px;}
325
325
  &--no-padding &__icon--inner-left {left: 1px;}
@@ -328,7 +328,7 @@ $inactive-color: #777;
328
328
  .w-textarea--focused &__icon {color: currentColor;}
329
329
 
330
330
  &--disabled &__icon {
331
- color: $disabled-color;
331
+ color: var(--w-disabled-color);
332
332
  cursor: not-allowed;
333
333
  -webkit-tap-highlight-color: transparent;
334
334
  }
@@ -336,21 +336,21 @@ $inactive-color: #777;
336
336
  // Label.
337
337
  // ------------------------------------------------------
338
338
  &__label {
339
- transition: color $transition-duration;
339
+ transition: color var(--w-transition-duration);
340
340
  cursor: pointer;
341
341
  align-self: flex-start;
342
342
  user-select: none;
343
343
 
344
344
  &--left {
345
- margin-top: $base-increment;
346
- margin-right: 2 * $base-increment;
345
+ margin-top: var(--w-base-increment);
346
+ margin-right: calc(var(--w-base-increment) * 2);
347
347
  }
348
348
  &--right {
349
- margin-top: $base-increment;
350
- margin-left: 2 * $base-increment;
349
+ margin-top: var(--w-base-increment);
350
+ margin-left: calc(var(--w-base-increment) * 2);
351
351
  }
352
352
  .w-textarea--disabled & {
353
- color: $disabled-color;
353
+ color: var(--w-disabled-color);
354
354
  cursor: not-allowed;
355
355
  -webkit-tap-highlight-color: transparent;
356
356
  }
@@ -362,9 +362,9 @@ $inactive-color: #777;
362
362
 
363
363
  &__label--inside {
364
364
  position: absolute;
365
- top: $base-increment;
365
+ top: var(--w-base-increment);
366
366
  left: 0;
367
- padding-left: 2 * $base-increment;
367
+ padding-left: calc(var(--w-base-increment) * 2);
368
368
  white-space: nowrap;
369
369
  transform: translateY(0%);
370
370
  pointer-events: none;
@@ -379,7 +379,7 @@ $inactive-color: #777;
379
379
 
380
380
  .w-textarea--floating-label & {
381
381
  transform-origin: 0 0;
382
- transition: $transition-duration ease;
382
+ transition: var(--w-transition-duration) ease;
383
383
  }
384
384
 
385
385
  // move label with underline style.
@@ -43,14 +43,14 @@ export default {
43
43
 
44
44
  <style lang="scss">
45
45
  .w-timeline {
46
- margin-left: $base-increment;
46
+ margin-left: var(--w-base-increment);
47
47
 
48
48
  @include themeable;
49
49
  }
50
50
 
51
51
  .w-timeline-item {
52
- padding-left: 5 * $base-increment;
53
- padding-bottom: 3 * $base-increment;
52
+ padding-left: calc(var(--w-base-increment) * 5);
53
+ padding-bottom: calc(var(--w-base-increment) * 3);
54
54
  list-style-type: none;
55
55
  position: relative;
56
56
 
@@ -61,10 +61,10 @@ export default {
61
61
  position: absolute;
62
62
  top: 2px;
63
63
  left: 0;
64
- background-color: $timeline-bullet-color;
64
+ background-color: var(--w-timeline-bullet-color);
65
65
  border-radius: 1em;
66
66
  border: 1px solid currentColor;
67
- width: $base-font-size;
67
+ width: var(--w-base-font-size);
68
68
  aspect-ratio: 1;
69
69
  min-width: 0; // Safari ratio fix (e.g. losing ratio if height is set and side padding are added).
70
70
  transform: translateX(-50%);
@@ -80,7 +80,7 @@ export default {
80
80
  top: 2px;
81
81
  bottom: -2px;
82
82
  left: -1px;
83
- border-left: 2px solid $timeline-bg-color;
83
+ border-left: 2px solid var(--w-timeline-bg-color);
84
84
  }
85
85
  }
86
86
  </style>
@@ -69,8 +69,8 @@ export default {
69
69
  display: flex;
70
70
  flex: 1 1 auto;
71
71
  align-items: center;
72
- padding: (2 * $base-increment) (3 * $base-increment);
73
- background-color: $toolbar-bg-color;
72
+ padding: calc(var(--w-base-increment) * 2) calc(var(--w-base-increment) * 3);
73
+ background-color: var(--w-toolbar-bg-color);
74
74
  z-index: 10;
75
75
 
76
76
  @include themeable;
@@ -83,30 +83,30 @@ export default {
83
83
  &--absolute.w-toolbar--right, &--fixed.w-toolbar--right {left: auto;right: 0;}
84
84
 
85
85
  // Horizontal.
86
- &--top {border-bottom: $border;}
86
+ &--top {border-bottom: var(--w-border);}
87
87
  &--bottom {
88
88
  bottom: 0;
89
89
  top: auto;
90
- border-top: $border;
90
+ border-top: var(--w-border);
91
91
  }
92
92
 
93
93
  // Vertical.
94
94
  &--vertical {
95
- padding: (2 * $base-increment);
95
+ padding: calc(var(--w-base-increment) * 2);
96
96
  flex-direction: column;
97
97
  flex-grow: 0;
98
98
  flex-shrink: 0;
99
99
  }
100
100
 
101
- &--left {border-right: $border;}
101
+ &--left {border-right: var(--w-border);}
102
102
  &--right {
103
103
  right: 0;
104
104
  left: auto;
105
- border-left: $border;
105
+ border-left: var(--w-border);
106
106
  }
107
107
 
108
108
  &--no-border, &--shadow {border-width: 0;}
109
- &--shadow {box-shadow: $box-shadow;}
109
+ &--shadow {box-shadow: var(--w-box-shadow);}
110
110
 
111
111
  .w-app > & {z-index: 200;}
112
112
 
@@ -1,13 +1,17 @@
1
1
  <template lang="pug">
2
- slot(name="activator" :on="activatorEventHandlers")
3
- transition(:name="transitionName" appear @after-leave="onAfterLeave")
4
- .w-tooltip(
5
- v-if="detachableVisible"
6
- ref="detachable"
7
- :key="tooltipInstanceId"
8
- :class="classes"
9
- :style="styles")
10
- slot
2
+ slot(name="activator")
3
+ slot(v-if="!$slots.activator")
4
+ teleport(:to="teleportTarget" :disabled="!teleportTarget")
5
+ transition(:name="transitionName" appear @after-leave="onAfterLeave")
6
+ .w-tooltip(
7
+ v-if="detachableVisible"
8
+ ref="detachable"
9
+ :key="tooltipInstanceId"
10
+ :class="classes"
11
+ :style="styles")
12
+ template(v-if="tooltip") {{ tooltip }}
13
+ slot(v-else-if="$slots.tooltip" name="tooltip")
14
+ slot(v-else-if="$slots.activator")
11
15
  </template>
12
16
 
13
17
  <script>
@@ -26,6 +30,7 @@ export default {
26
30
 
27
31
  props: {
28
32
  modelValue: {},
33
+ tooltip: { type: String }, // Simple string content shorthand; use the #tooltip slot for rich content.
29
34
  showOnClick: { type: Boolean },
30
35
  color: { type: String },
31
36
  bgColor: { type: String },
@@ -239,12 +244,12 @@ export default {
239
244
  display: table;
240
245
 
241
246
  position: absolute;
242
- padding: $base-increment math.round(1.5 * $base-increment);
243
- border-radius: $border-radius;
244
- border: 1px solid $tooltip-border-color;
245
- background-color: $tooltip-bg-color;
247
+ padding: var(--w-base-increment) calc(var(--w-base-increment) * 1.5);
248
+ border-radius: var(--w-border-radius);
249
+ border: 1px solid var(--w-tooltip-border-color);
250
+ background-color: var(--w-tooltip-bg-color);
246
251
  pointer-events: none;
247
- color: $tooltip-color;
252
+ color: var(--w-tooltip-color);
248
253
  align-items: center;
249
254
  max-width: 300px;
250
255
  width: max-content; // Not supported in IE11. :/
@@ -257,15 +262,15 @@ export default {
257
262
  &--tile {border-radius: 0;}
258
263
  &--round {
259
264
  border-radius: 99em;
260
- padding: $base-increment math.round(2.5 * $base-increment);
265
+ padding: var(--w-base-increment) calc(var(--w-base-increment) * 2.5);
261
266
  }
262
- &--shadow {box-shadow: $box-shadow;}
267
+ &--shadow {box-shadow: var(--w-box-shadow);}
263
268
  &--no-border {border: none;}
264
269
 
265
- &--top {margin-top: -3 * $base-increment;}
266
- &--bottom {margin-top: 3 * $base-increment;}
267
- &--left {margin-left: -3 * $base-increment;}
268
- &--right {margin-left: 3 * $base-increment;}
270
+ &--top {margin-top: calc(var(--w-base-increment) * -3);}
271
+ &--bottom {margin-top: calc(var(--w-base-increment) * 3);}
272
+ &--left {margin-left: calc(var(--w-base-increment) * -3);}
273
+ &--right {margin-left: calc(var(--w-base-increment) * 3);}
269
274
 
270
275
  &.size--xs {font-size: 0.75rem;}
271
276
  &.size--sm {font-size: 0.83rem;}
@@ -292,30 +297,30 @@ export default {
292
297
  .w-tooltip-slide-fade-down-enter-active, .w-tooltip-slide-fade-down-leave-active,
293
298
  .w-tooltip-slide-fade-left-enter-active, .w-tooltip-slide-fade-left-leave-active,
294
299
  .w-tooltip-slide-fade-right-enter-active, .w-tooltip-slide-fade-right-leave-active {
295
- transition: margin $transition-duration ease-in-out, opacity $transition-duration ease-in-out;
300
+ transition: margin var(--w-transition-duration) ease-in-out, opacity var(--w-transition-duration) ease-in-out;
296
301
  }
297
302
 
298
303
  // slide-fade-up.
299
304
  .w-tooltip-slide-fade-up-enter-from, .w-tooltip-slide-fade-up-leave-to {
300
- margin-top: -2 * $base-increment;
305
+ margin-top: calc(var(--w-base-increment) * -2);
301
306
  opacity: 0;
302
307
  }
303
308
 
304
309
  // slide-fade-down.
305
310
  .w-tooltip-slide-fade-down-enter-from, .w-tooltip-slide-fade-down-leave-to {
306
- margin-top: 2 * $base-increment;
311
+ margin-top: calc(var(--w-base-increment) * 2);
307
312
  opacity: 0;
308
313
  }
309
314
 
310
315
  // Slide-fade-left.
311
316
  .w-tooltip-slide-fade-left-enter-from, .w-tooltip-slide-fade-left-leave-to {
312
- margin-left: -2 * $base-increment;
317
+ margin-left: calc(var(--w-base-increment) * -2);
313
318
  opacity: 0;
314
319
  }
315
320
 
316
321
  // Slide-fade-right.
317
322
  .w-tooltip-slide-fade-right-enter-from, .w-tooltip-slide-fade-right-leave-to {
318
- margin-left: 2 * $base-increment;
323
+ margin-left: calc(var(--w-base-increment) * 2);
319
324
  opacity: 0;
320
325
  }
321
326
  // --------------------------------------------------------
@@ -9,7 +9,9 @@ ul.w-tree(:class="classes")
9
9
  :is="getTreeItemComponent(item)"
10
10
  v-bind="item.route && { [!$router || hasExternalLink(item) ? 'href' : 'to']: item.route }"
11
11
  @click="!disabled && !item.disabled && onLabelClick(item, $event)"
12
+ @pointerdown="onLabelPointerDown(item, $event)"
12
13
  @keydown="!disabled && !item.disabled && onLabelKeydown(item, $event)"
14
+ :class="itemLabelClasses(item)"
13
15
  :tabindex="getTreeItemTabindex(item)")
14
16
  //- @click.stop to not follow link if item is a link.
15
17
  w-button.w-tree__item-expand(
@@ -59,6 +61,7 @@ ul.w-tree(:class="classes")
59
61
  </template>
60
62
 
61
63
  <script>
64
+ import RippleMixin from '../mixins/ripple'
62
65
  import { consoleWarn } from '../utils/console'
63
66
  /**
64
67
  * @todo:
@@ -67,6 +70,9 @@ import { consoleWarn } from '../utils/console'
67
70
 
68
71
  export default {
69
72
  name: 'w-tree',
73
+
74
+ mixins: [RippleMixin],
75
+
70
76
  props: {
71
77
  modelValue: { type: [Object, Array] },
72
78
  data: { type: [Object, Array], required: true },
@@ -200,6 +206,16 @@ export default {
200
206
  return true // Just to chain instructions.
201
207
  },
202
208
 
209
+ isItemRippleActive (item) {
210
+ return this.rippleActive && this.selectable && !this.disabled && !item.disabled
211
+ },
212
+
213
+ itemLabelClasses (item) {
214
+ return {
215
+ 'w-ripple': this.isItemRippleActive(item)
216
+ }
217
+ },
218
+
203
219
  onLabelClick (item, e) {
204
220
  const route = item[this.itemRouteKey]
205
221
  if (route && this.$router && !this.hasExternalLink(item)) e.preventDefault()
@@ -212,6 +228,11 @@ export default {
212
228
  this.emitItemSelection(item, e) // Always emitting on click, but different event for selection.
213
229
  },
214
230
 
231
+ onLabelPointerDown (item, e) {
232
+ if (!this.isItemRippleActive(item) || e.target.closest?.('.w-tree__item-expand')) return
233
+ this.onRipple(e)
234
+ },
235
+
215
236
  onLabelKeydown (item, e) {
216
237
  // Keys: 13 enter, 32 space, 37 arrow left, 38 arrow up, 39 arrow right, 40 arrow down.
217
238
  if (!(e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) && [13, 32, 37, 38, 39, 40].includes(e.keyCode)) {
@@ -339,16 +360,14 @@ export default {
339
360
  </script>
340
361
 
341
362
  <style lang="scss">
342
- $expand-icon-size: 20px;
343
-
344
363
  .w-tree {
364
+ --w-tree-expand-icon-size: 20px;
345
365
  margin: 0;
346
366
 
347
367
  // Tree items.
348
368
  // ------------------------------------------------------
349
369
  &__item {list-style-type: none;}
350
- &__item--branch {}
351
- &__item--leaf {margin-left: $base-increment * 5 + 2px;}
370
+ &__item--leaf {margin-left: calc(var(--w-base-increment) * 5 + 2px);}
352
371
  &--no-expand-button &__item--leaf {margin-left: 0;}
353
372
 
354
373
  // Tree item label.
@@ -364,21 +383,21 @@ $expand-icon-size: 20px;
364
383
  position: absolute;
365
384
  top: -1px;
366
385
  bottom: -1px;
367
- left: - $base-increment + 2px;
368
- right: - $base-increment - 2px;
369
- border-radius: $border-radius;
386
+ left: calc(var(--w-base-increment) * -1 + 2px);
387
+ right: calc(var(--w-base-increment) * -1 - 2px);
388
+ border-radius: var(--w-border-radius);
370
389
  }
371
- &:hover:before {background-color: $primary;opacity: 0.1;}
372
- &:focus-visible:before {background-color: $primary;opacity: 0.15;}
390
+ &:hover:before {background-color: var(--w-primary-color);opacity: 0.1;}
391
+ &:focus-visible:before {background-color: var(--w-primary-color);opacity: 0.15;}
373
392
  }
374
393
  &.w-tree--selectable &__item-label {cursor: pointer;}
375
394
  &.w-tree--selectable &__item--disabled &__item-label {cursor: auto;}
376
395
  &__item--leaf &__item-label:before {
377
- left: - $base-increment;
378
- right: - $base-increment;
396
+ left: calc(var(--w-base-increment) * -1);
397
+ right: calc(var(--w-base-increment) * -1);
379
398
  }
380
399
  &__item--selected > &__item-label:before {
381
- background-color: $primary;
400
+ background-color: var(--w-primary-color);
382
401
  opacity: 0.25;
383
402
  }
384
403
  &__item--disabled &__item-label {opacity: 0.5;}
@@ -388,21 +407,21 @@ $expand-icon-size: 20px;
388
407
 
389
408
  &__item--branch > &__item-label {cursor: pointer;}
390
409
  &__item--disabled > &__item-label {
391
- color: $disabled-color;
410
+ color: var(--w-disabled-color);
392
411
  cursor: not-allowed;
393
412
  -webkit-tap-highlight-color: transparent;
394
413
  }
395
414
  &__item--unexpandable > &__item-label {
396
- margin-left: $expand-icon-size + 2px;
415
+ margin-left: calc(var(--w-tree-expand-icon-size) + 2px);
397
416
  cursor: auto;
398
417
  }
399
418
  &--disabled &__item-label {cursor: auto;}
400
419
  &--disabled &__item--branch > &__item-label {opacity: 0.5;}
401
420
 
402
- &__item-icon {margin-right: $base-increment;}
421
+ &__item-icon {margin-right: var(--w-base-increment);}
403
422
 
404
423
  // Recursive children.
405
424
  // ------------------------------------------------------
406
- .w-tree {margin-left: $base-increment * 5;}
425
+ .w-tree {margin-left: calc(var(--w-base-increment) * 5);}
407
426
  }
408
427
  </style>
@@ -91,7 +91,7 @@ export default class WaveUI {
91
91
  document.documentElement.setAttribute('data-theme', theme)
92
92
  document.head.querySelector('#wave-ui-colors')?.remove?.()
93
93
  const themeColors = this.config.colors[this.theme]
94
- injectColorsCSSInDOM(themeColors, this.config.css.colorShadeCssVariables)
94
+ injectColorsCSSInDOM(themeColors, colorPalette, this.config.css.colorShadeCssVariables)
95
95
  this.colors = flattenColors(themeColors, colorPalette)
96
96
  },
97
97
 
@@ -147,6 +147,14 @@ export default class WaveUI {
147
147
  const wApp = document.querySelector(config.on) || document.body
148
148
  wApp.classList.add('w-app')
149
149
 
150
+ // Add any custom app classes from config.
151
+ if (config.css.appClasses) {
152
+ const classesToAdd = typeof config.css.appClasses === 'string'
153
+ ? config.css.appClasses.split(' ').filter(c => c)
154
+ : config.css.appClasses
155
+ if (classesToAdd.length) wApp.classList.add(...classesToAdd)
156
+ }
157
+
150
158
  if (config.theme === 'auto') detectOSDarkMode($waveui) // Also switches the theme.
151
159
  else $waveui.switchTheme(config.theme, true)
152
160