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,26 +1,26 @@
1
1
  <template lang="pug">
2
- w-menu(v-model="showPopup" v-bind="wMenuProps")
3
- template(#activator="{ on }")
4
- w-button.w-confirm(v-bind="{ ...$attrs, ...buttonProps }" v-on="disablePrompt ? {} : { ...on }")
5
- slot
6
- w-flex(:column="!inline" align-center)
7
- div
8
- slot(name="question") {{ question }}
9
- .w-flex.justify-end(:class="inline ? 'ml2' : 'mt2'")
10
- w-button.mr2(
11
- v-if="cancel !== false"
12
- v-bind="cancelButtonProps"
13
- :bg-color="(cancelButton || {}).bgColor || 'error'"
14
- @keyup.escape="!persistent && onCancel()"
15
- @click="onCancel")
16
- slot(name="cancel") {{ cancelButton.label }}
17
- w-button(
18
- v-bind="confirmButtonProps"
19
- :bg-color="(confirmButton || {}).bgColor || 'success'"
20
- v-focus
21
- @keyup.escape="!persistent && onCancel()"
22
- @click="onConfirm")
23
- slot(name="confirm") {{ confirmButton.label }}
2
+ w-menu(v-model="showPopup" v-bind="wMenuProps" :disable="disablePrompt")
3
+ w-button.w-confirm(v-bind="{ ...$attrs, ...buttonProps }")
4
+ slot
5
+ template(#content)
6
+ w-flex(:column="!inline" align-center)
7
+ div
8
+ slot(name="question") {{ question }}
9
+ .w-flex.justify-end(:class="inline ? 'ml2' : 'mt2'")
10
+ w-button.mr2(
11
+ v-if="cancel !== false"
12
+ v-bind="cancelButtonProps"
13
+ :bg-color="(cancelButton || {}).bgColor || 'error'"
14
+ @keyup.escape="!persistent && onCancel()"
15
+ @click="onCancel")
16
+ slot(name="cancel") {{ cancelButton.label }}
17
+ w-button(
18
+ v-bind="confirmButtonProps"
19
+ :bg-color="(confirmButton || {}).bgColor || 'success'"
20
+ v-focus
21
+ @keyup.escape="!persistent && onCancel()"
22
+ @click="onConfirm")
23
+ slot(name="confirm") {{ confirmButton.label }}
24
24
  </template>
25
25
 
26
26
  <script>
@@ -139,7 +139,7 @@ export default {
139
139
  flex-grow: 1;
140
140
  max-width: 95%;
141
141
  overflow: auto;
142
- background-color: $dialog-bg-color;
142
+ background-color: var(--w-dialog-bg-color);
143
143
 
144
144
  @include themeable;
145
145
 
@@ -35,7 +35,7 @@ export default {
35
35
 
36
36
  <style lang="scss">
37
37
  .w-divider {
38
- border: 0 solid $divider-color;
38
+ border: 0 solid var(--w-divider-color);
39
39
  border-top-width: 1px;
40
40
 
41
41
  @include themeable;
@@ -69,15 +69,15 @@ export default {
69
69
  display: flex;
70
70
  flex: 1 1 auto;
71
71
  }
72
- &:before {margin-right: 2 * $base-increment;}
73
- &:after {margin-left: 2 * $base-increment;}
72
+ &:before {margin-right: calc(var(--w-base-increment) * 2);}
73
+ &:after {margin-left: calc(var(--w-base-increment) * 2);}
74
74
 
75
75
  // Vertical.
76
76
  &.w-divider--vertical {
77
77
  flex-direction: column;
78
78
  &:before, &:after {border-top-width: 0;border-left-width: 1px;}
79
- &:before {margin-right: 0;margin-bottom: 2 * $base-increment;}
80
- &:after {margin-left: 0;margin-top: 2 * $base-increment;}
79
+ &:before {margin-right: 0;margin-bottom: calc(var(--w-base-increment) * 2);}
80
+ &:after {margin-left: 0;margin-top: calc(var(--w-base-increment) * 2);}
81
81
  }
82
82
  }
83
83
  }
@@ -245,7 +245,7 @@ export default {
245
245
  position: inherit;
246
246
  display: flex;
247
247
  z-index: 1;
248
- background: $drawer-bg-color;
248
+ background: var(--w-drawer-bg-color);
249
249
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
250
250
 
251
251
  @include themeable;
@@ -254,13 +254,13 @@ export default {
254
254
  top: 0;
255
255
  bottom: 0;
256
256
  width: 100%;
257
- max-width: $drawer-max-size;
257
+ max-width: var(--w-drawer-max-size);
258
258
  }
259
259
  &--top, &--bottom {
260
260
  left: 0;
261
261
  right: 0;
262
262
  height: 100%;
263
- max-height: $drawer-max-size;
263
+ max-height: var(--w-drawer-max-size);
264
264
  }
265
265
  &--fit-content {width: auto;height: auto;}
266
266
 
@@ -130,7 +130,7 @@ div.w-form-el {
130
130
  &--has-error input::placeholder {color: inherit;}
131
131
 
132
132
  &-shakable {position: relative;}
133
- &--error &-shakable {animation: w-form-el-shake 0.3s $transition-duration ease-in-out;}
133
+ &--error &-shakable {animation: w-form-el-shake 0.3s var(--w-transition-duration) ease-in-out;}
134
134
 
135
135
  // Error message.
136
136
  // ------------------------------------------------------
@@ -138,7 +138,7 @@ div.w-form-el {
138
138
  width: 100%;
139
139
  flex-grow: 1;
140
140
  font-size: 0.775rem;
141
- margin-top: $base-increment;
141
+ margin-top: var(--w-base-increment);
142
142
 
143
143
  .w-form--error-placeholders & {position: absolute;bottom: 0;}
144
144
  }
@@ -98,8 +98,6 @@ export default {
98
98
  </script>
99
99
 
100
100
  <style lang="scss">
101
- @use "sass:math";
102
-
103
101
  .w-icon {
104
102
  position: relative;
105
103
  display: inline-flex;
@@ -115,21 +113,21 @@ export default {
115
113
  // The aspect ratio will not work if the content overflows (needs overflow hidden, but we don't want that in the library).
116
114
  height: 1em;
117
115
 
118
- &.size--xs {font-size: math.round(0.85 * $base-font-size);}
119
- &.size--sm {font-size: math.round(1.15 * $base-font-size);}
120
- &.size--md {font-size: math.round(1.4 * $base-font-size);}
121
- &.size--lg {font-size: math.round(1.7 * $base-font-size);}
122
- &.size--xl {font-size: 2 * $base-font-size;}
116
+ &.size--xs {font-size: round(nearest, calc(0.85 * var(--w-base-font-size)), 1px);}
117
+ &.size--sm {font-size: round(nearest, calc(1.15 * var(--w-base-font-size)), 1px);}
118
+ &.size--md {font-size: round(nearest, calc(1.4 * var(--w-base-font-size)), 1px);}
119
+ &.size--lg {font-size: round(nearest, calc(1.7 * var(--w-base-font-size)), 1px);}
120
+ &.size--xl {font-size: calc(2 * var(--w-base-font-size));}
123
121
 
124
122
  // Always an even number to align well vertically in a button.
125
- .w-button.size--xs & {font-size: math.round(0.95 * divide($base-font-size, 2)) * 2;}
126
- .w-alert.size--xs & {font-size: $base-font-size;}
127
- .w-button.size--sm &, .w-alert.size--sm & {font-size: math.round(1.15 * $base-font-size);}
128
- // .w-button.size--md &, .w-alert.size--md & {font-size: math.round(1.4 * $base-font-size);}
129
- .w-button.size--lg &, .w-alert.size--lg & {font-size: math.round(1.7 * $base-font-size);}
130
- .w-button.size--xl &, .w-alert.size--xl & {font-size: 2 * $base-font-size;}
123
+ .w-button.size--xs & {font-size: calc(2 * round(nearest, calc(0.95 * var(--w-base-font-size) / 2), 1px));}
124
+ .w-alert.size--xs & {font-size: var(--w-base-font-size);}
125
+ .w-button.size--sm &, .w-alert.size--sm & {font-size: round(nearest, calc(1.15 * var(--w-base-font-size)), 1px);}
126
+ // .w-button.size--md &, .w-alert.size--md & {font-size: round(nearest, calc(1.4 * var(--w-base-font-size)), 1px);}
127
+ .w-button.size--lg &, .w-alert.size--lg & {font-size: round(nearest, calc(1.7 * var(--w-base-font-size)), 1px);}
128
+ .w-button.size--xl &, .w-alert.size--xl & {font-size: calc(2 * var(--w-base-font-size));}
131
129
 
132
- &:before {transition: transform $transition-duration;}
130
+ &:before {transition: transform var(--w-transition-duration);}
133
131
  &--spin:before {animation: w-icon--spin 2s infinite linear;}
134
132
  &--spin-a:before {animation: w-icon--spin-a 2s infinite linear;}
135
133
  &--rotate45:before {transform: rotate(45deg);}
@@ -247,7 +247,7 @@ export default {
247
247
  }
248
248
 
249
249
  &__caption {
250
- padding-top: $base-increment;
250
+ padding-top: var(--w-base-increment);
251
251
  text-align: right;
252
252
  }
253
253
  }
@@ -162,6 +162,12 @@ export default {
162
162
  round: { type: Boolean },
163
163
  shadow: { type: Boolean },
164
164
  tile: { type: Boolean },
165
+ // Sizes.
166
+ xs: { type: Boolean },
167
+ sm: { type: Boolean },
168
+ md: { type: Boolean },
169
+ lg: { type: Boolean },
170
+ xl: { type: Boolean },
165
171
  multiple: { type: Boolean }, // Only for file uploads.
166
172
  preview: { type: [Boolean, String], default: true }, // Only for file uploads.
167
173
  loading: { type: [Boolean, Number], default: false }, // If a number is given, it will be the value of the progress.
@@ -251,6 +257,10 @@ export default {
251
257
  return this.overallFilesProgress === 100
252
258
  },
253
259
 
260
+ presetSize () {
261
+ return (this.xs && 'xs') || (this.sm && 'sm') || (this.md && 'md') || (this.lg && 'lg') || (this.xl && 'xl') || null
262
+ },
263
+
254
264
  classes () {
255
265
  return {
256
266
  'w-input': true,
@@ -266,6 +276,7 @@ export default {
266
276
  'w-input--has-placeholder': this.placeholder,
267
277
  'w-input--inner-icon-left': this.innerIconLeft,
268
278
  'w-input--inner-icon-right': this.innerIconRight,
279
+ [`size--${this.presetSize}`]: !!this.presetSize,
269
280
  // With the inheritAttrs set to false any class on the component would be lost, so add it back.
270
281
  [this.$attrs.class]: !!this.$attrs.class
271
282
  }
@@ -391,7 +402,7 @@ $inactive-color: #777;
391
402
  flex-grow: 1;
392
403
  flex-wrap: wrap;
393
404
  align-items: center;
394
- font-size: $base-font-size;
405
+ font-size: var(--w-base-font-size);
395
406
 
396
407
  &--file {
397
408
  flex-wrap: nowrap;
@@ -409,13 +420,13 @@ $inactive-color: #777;
409
420
  display: inline-flex;
410
421
  flex: 1 1 auto;
411
422
  align-items: center;
412
- height: $form-field-height;
413
- border-radius: $border-radius;
414
- border: $border;
415
- transition: border $transition-duration;
423
+ height: var(--w-size, var(--w-form-field-height));
424
+ border-radius: var(--w-border-radius);
425
+ border: var(--w-border);
426
+ transition: border var(--w-transition-duration);
416
427
 
417
428
  .w-input.h-auto & {height: auto;}
418
- .w-input--floating-label & {margin-top: 3 * $base-increment;}
429
+ .w-input--floating-label & {margin-top: calc(var(--w-base-increment) * 3);}
419
430
  .w-input[class^="bdrs"] &, .w-input[class*=" bdrs"] & {border-radius: inherit;}
420
431
 
421
432
  // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size
@@ -429,7 +440,7 @@ $inactive-color: #777;
429
440
 
430
441
  &--round {border-radius: 99em;}
431
442
  &--tile {border-radius: initial;}
432
- &--shadow {box-shadow: $box-shadow;}
443
+ &--shadow {box-shadow: var(--w-box-shadow);}
433
444
  &--loading, &--upload-complete {
434
445
  border-bottom-color: transparent;
435
446
  flex-wrap: wrap;
@@ -454,7 +465,7 @@ $inactive-color: #777;
454
465
  width: 100%;
455
466
  height: 0;
456
467
  border-bottom: 2px solid currentColor;
457
- transition: $transition-duration;
468
+ transition: var(--w-transition-duration);
458
469
  transform: scaleX(0);
459
470
  pointer-events: none;
460
471
  }
@@ -464,11 +475,11 @@ $inactive-color: #777;
464
475
  .w-input--focused &--underline:after {transform: scaleX(1);}
465
476
  &--round.w-input__input-wrap--underline:after {
466
477
  border-radius: 99em;
467
- transition: $transition-duration, height 0.035s;
478
+ transition: var(--w-transition-duration), height 0.035s;
468
479
  }
469
480
  .w-input--focused &--round.w-input__input-wrap--underline:after {
470
481
  height: 100%;
471
- transition: $transition-duration, height 0s ($transition-duration - 0.035s);
482
+ transition: var(--w-transition-duration), height 0s calc(var(--w-transition-duration) - 0.035s);
472
483
  }
473
484
  }
474
485
 
@@ -486,8 +497,8 @@ $inactive-color: #777;
486
497
  border: none;
487
498
  border-radius: inherit; // Mostly for the browser-autofilled appearance.
488
499
  outline: none;
489
- padding-left: 2 * $base-increment;
490
- padding-right: 2 * $base-increment;
500
+ padding-left: calc(var(--w-base-increment) * 2);
501
+ padding-right: calc(var(--w-base-increment) * 2);
491
502
 
492
503
  // For type="search" on Safari.
493
504
  -webkit-appearance: none;
@@ -500,15 +511,15 @@ $inactive-color: #777;
500
511
  }
501
512
 
502
513
  &__input-wrap--round &__input {
503
- padding-left: 3 * $base-increment;
504
- padding-right: 3 * $base-increment;
514
+ padding-left: calc(var(--w-base-increment) * 3);
515
+ padding-right: calc(var(--w-base-increment) * 3);
505
516
  }
506
517
 
507
518
  &--inner-icon-left &__input {padding-left: 27px;}
508
519
  &--inner-icon-right &__input {padding-right: 27px;}
509
520
 
510
521
  &--disabled &__input {
511
- color: $disabled-color;
522
+ color: var(--w-disabled-color);
512
523
  cursor: not-allowed;
513
524
  -webkit-tap-highlight-color: transparent;
514
525
  }
@@ -548,7 +559,7 @@ $inactive-color: #777;
548
559
  left: 0;
549
560
  display: flex;
550
561
  align-items: center;
551
- color: $disabled-color;
562
+ color: var(--w-disabled-color);
552
563
  }
553
564
 
554
565
  &__file-preview {
@@ -570,7 +581,7 @@ $inactive-color: #777;
570
581
  .w-input--focused &__icon {color: currentColor;}
571
582
 
572
583
  &--disabled &__icon {
573
- color: $disabled-color;
584
+ color: var(--w-disabled-color);
574
585
  cursor: not-allowed;
575
586
  -webkit-tap-highlight-color: transparent;
576
587
  }
@@ -578,15 +589,15 @@ $inactive-color: #777;
578
589
  // Label.
579
590
  // ------------------------------------------------------
580
591
  &__label {
581
- transition: color $transition-duration;
592
+ transition: color var(--w-transition-duration);
582
593
  cursor: pointer;
583
594
  user-select: none;
584
595
 
585
- &--left {margin-right: 2 * $base-increment;}
586
- &--right {margin-left: 2 * $base-increment;}
596
+ &--left {margin-right: calc(var(--w-base-increment) * 2);}
597
+ &--right {margin-left: calc(var(--w-base-increment) * 2);}
587
598
 
588
599
  .w-input--disabled & {
589
- color: $disabled-color;
600
+ color: var(--w-disabled-color);
590
601
  cursor: not-allowed;
591
602
  -webkit-tap-highlight-color: transparent;
592
603
  }
@@ -600,7 +611,7 @@ $inactive-color: #777;
600
611
  position: absolute;
601
612
  top: 50%;
602
613
  left: 0;
603
- padding-left: 2 * $base-increment;
614
+ padding-left: calc(var(--w-base-increment) * 2);
604
615
  white-space: nowrap;
605
616
  transform: translateY(-50%);
606
617
  pointer-events: none;
@@ -611,15 +622,15 @@ $inactive-color: #777;
611
622
  padding-right: 0;
612
623
  }
613
624
  .w-input__input-wrap--round & {
614
- padding-left: math.round(3 * $base-increment);
615
- padding-right: math.round(3 * $base-increment);
625
+ padding-left: calc(var(--w-base-increment) * 3);
626
+ padding-right: calc(var(--w-base-increment) * 3);
616
627
  }
617
628
  .w-input--inner-icon-left & {left: 18px;}
618
629
  .w-input--no-padding.w-input--inner-icon-left & {left: 26px;}
619
630
 
620
631
  .w-input--floating-label & {
621
632
  transform-origin: 0 0;
622
- transition: $transition-duration ease;
633
+ transition: var(--w-transition-duration) ease;
623
634
  will-change: transform;
624
635
  }
625
636
 
@@ -644,5 +655,12 @@ $inactive-color: #777;
644
655
  // Chrome & Safari - Must remain in a separated rule as Firefox discard the whole rule seeing -webkit-.
645
656
  .w-input--floating-label.w-input--inner-icon-left .w-input__input:-webkit-autofill & {left: 0;}
646
657
  }
658
+
659
+ // Sizes.
660
+ // ------------------------------------------------------
661
+ &.size--xs {--w-size: round(nearest, calc(1.43 * var(--w-base-font-size)), 1px);}
662
+ &.size--sm {--w-size: round(nearest, calc(1.71 * var(--w-base-font-size)), 1px);}
663
+ &.size--lg {--w-size: round(nearest, calc(2.29 * var(--w-base-font-size)), 1px);}
664
+ &.size--xl {--w-size: round(nearest, calc(2.71 * var(--w-base-font-size)), 1px);}
647
665
  }
648
666
  </style>
@@ -44,10 +44,13 @@ ul.w-list(:class="classes")
44
44
 
45
45
  <script>
46
46
  import { useId } from 'vue'
47
+ import RippleMixin from '../mixins/ripple'
47
48
 
48
49
  export default {
49
50
  name: 'w-list',
50
51
 
52
+ mixins: [RippleMixin],
53
+
51
54
  setup () {
52
55
  return { waveUiUseId: useId() }
53
56
  },
@@ -161,7 +164,13 @@ export default {
161
164
  },
162
165
 
163
166
  liLabelClasses (item) {
167
+ const rippleHost =
168
+ this.rippleActive &&
169
+ !item.disabled &&
170
+ (this.checklist || this.isSelectable || (this.nav && item[this.itemRouteKey]))
171
+
164
172
  return {
173
+ 'w-ripple': rippleHost,
165
174
  'w-list__item-label--disabled': item.disabled || (this.nav && !item[this.itemRouteKey] && !item.children),
166
175
  'w-list__item-label--active': (this.isSelectable && item._selected) || null,
167
176
  'w-list__item-label--focused': item._focused,
@@ -188,6 +197,7 @@ export default {
188
197
  // If selectable list, on mousedown select the item.
189
198
  const mousedown = this.isSelectable && (e => {
190
199
  e.stopPropagation()
200
+ this.onRipple(e)
191
201
  !li.disabled && this.selectItem(li)
192
202
  })
193
203
  // If selectable list, on enter key press select item.
@@ -230,6 +240,7 @@ export default {
230
240
  props.onFocus = () => (li._focused = true)
231
241
  props.onBlur = () => (li._focused = false)
232
242
  props.onInput = value => this.selectItem(li, value)
243
+ props.onPointerdown = e => this.onRipple(e)
233
244
  // When clicking on the checkbox component wrapper, trigger a focus & click on the checkbox.
234
245
  props.onClick = e => {
235
246
  const checkbox = e.target.querySelector('input[type="checkbox"]')
@@ -250,6 +261,7 @@ export default {
250
261
  if (!li.disabled && li[this.itemRouteKey]) {
251
262
  props.onKeydown = keydown
252
263
  props.onMousedown = mousedown
264
+ props.onPointerdown = e => this.onRipple(e)
253
265
 
254
266
  if (this.$router) {
255
267
  props.to = li[this.itemRouteKey]
@@ -397,10 +409,10 @@ export default {
397
409
  .w-list {
398
410
  list-style-type: none;
399
411
  margin-left: 0;
400
- font-size: $base-font-size;
412
+ font-size: var(--w-base-font-size);
401
413
 
402
- &--child {margin-left: 6 * $base-increment;}
403
- &--icon {padding-left: 8 * $base-increment;}
414
+ &--child {margin-left: calc(var(--w-base-increment) * 6);}
415
+ &--icon {padding-left: calc(var(--w-base-increment) * 8);}
404
416
 
405
417
  &__item {margin-top: 1px;}
406
418
  &__item:first-child {margin-top: 0;}
@@ -416,7 +428,7 @@ export default {
416
428
  &__item-bullet {
417
429
  position: absolute;
418
430
  right: 100%;
419
- margin-right: 3 * $base-increment;
431
+ margin-right: calc(var(--w-base-increment) * 3);
420
432
  top: 0.1em;
421
433
 
422
434
  @-moz-document url-prefix() {
@@ -425,7 +437,7 @@ export default {
425
437
 
426
438
  .w-list--hoverable &,
427
439
  .w-list--selectable &,
428
- .w-list--checklist & {margin-top: 3 * $base-increment;}
440
+ .w-list--checklist & {margin-top: calc(var(--w-base-increment) * 3);}
429
441
  }
430
442
 
431
443
  // List item Label.
@@ -451,15 +463,14 @@ export default {
451
463
 
452
464
  &--hoverable,
453
465
  &--selectable {
454
- padding: 2 * $base-increment;
466
+ padding: calc(var(--w-base-increment) * 2);
455
467
 
456
468
  &:before {
457
469
  content: '';
458
470
  position: absolute;
459
471
  inset: 0;
460
- background-color: currentColor;
461
- opacity: 0;
462
- transition: 0.2s;
472
+ background-color: transparent;
473
+ transition: background-color 0.2s;
463
474
  pointer-events: none;
464
475
  }
465
476
  }
@@ -468,17 +479,17 @@ export default {
468
479
  &--hoverable:hover:before,
469
480
  &--selectable:focus:before,
470
481
  &--focused:before,
471
- &--selectable:hover:before {opacity: 0.08;}
482
+ &--selectable:hover:before {background-color: color-mix(in srgb, currentColor 8%, transparent);}
472
483
 
473
484
  // Active class (when item is selected).
474
485
  &--active:before, &--active:focus:before, &--active:hover:before,
475
- .w-list--navigation &.router-link-exact-active:before {opacity: 0.15;}
486
+ .w-list--navigation &.router-link-exact-active:before {background-color: color-mix(in srgb, currentColor 15%, transparent);}
476
487
 
477
488
  // Active state (while pressing key or mouse).
478
489
  &--active.w-list__item-label--hoverable:hover:before,
479
490
  &--active.w-list__item-label--selectable:focus:before,
480
491
  &--active.w-list__item-label--selectable:hover:before,
481
- &--selectable:active:before {opacity: 0.2;}
492
+ &--selectable:active:before {background-color: color-mix(in srgb, currentColor 20%, transparent);}
482
493
 
483
494
  // Disabled.
484
495
  &--disabled:before {display: none;}
@@ -1,44 +1,48 @@
1
1
  <template lang="pug">
2
- slot(name="activator" :on="activatorEventHandlers")
3
- transition(:name="transitionName" appear @after-leave="onAfterLeave")
4
- .w-menu(
5
- v-if="custom && detachableVisible"
6
- ref="detachable"
7
- v-bind="$attrs"
8
- @click="hideOnMenuClick && close(true)"
9
- @mouseenter="showOnHover && (hoveringMenu = true)"
10
- @mouseleave="showOnHover && ((hoveringMenu = false), close())"
11
- :class="classes"
12
- :style="styles")
13
- slot
14
- w-card.w-menu(
15
- v-else-if="detachableVisible"
16
- ref="detachable"
17
- v-bind="$attrs"
18
- @click.native="hideOnMenuClick && close(true)"
19
- @mouseenter.native="showOnHover && (hoveringMenu = true)"
20
- @mouseleave.native="showOnHover && ((hoveringMenu = false), close())"
21
- :tile="tile"
22
- :title-class="titleClasses"
23
- :content-class="contentClasses"
24
- :shadow="shadow"
25
- :no-border="noBorder"
26
- :class="classes"
27
- :style="styles")
28
- template(v-if="$slots.title" #title)
29
- slot(name="title")
30
- template(v-if="$slots.actions" #actions)
31
- slot(name="actions")
32
- slot
33
- w-overlay(
34
- v-if="overlay"
35
- ref="overlay"
36
- :model-value="detachableVisible"
37
- :persistent="persistent"
38
- :class="overlayClasses"
39
- v-bind="overlayProps"
40
- :z-index="(zIndex || 200) - 1"
41
- @update:model-value="detachableVisible = false")
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-menu(
7
+ v-if="custom && detachableVisible"
8
+ ref="detachable"
9
+ v-bind="$attrs"
10
+ @click="hideOnMenuClick && close(true)"
11
+ @mouseenter="showOnHover && (hoveringMenu = true)"
12
+ @mouseleave="showOnHover && ((hoveringMenu = false), close())"
13
+ :class="classes"
14
+ :style="styles")
15
+ slot(v-if="$slots.activator")
16
+ slot(v-else name="content")
17
+ w-card.w-menu(
18
+ v-else-if="detachableVisible"
19
+ ref="detachable"
20
+ v-bind="$attrs"
21
+ @click.native="hideOnMenuClick && close(true)"
22
+ @mouseenter.native="showOnHover && (hoveringMenu = true)"
23
+ @mouseleave.native="showOnHover && ((hoveringMenu = false), close())"
24
+ :tile="tile"
25
+ :title-class="titleClasses"
26
+ :content-class="contentClasses"
27
+ :shadow="shadow"
28
+ :no-border="noBorder"
29
+ :class="classes"
30
+ :style="styles")
31
+ template(v-if="$slots.title" #title)
32
+ slot(name="title")
33
+ template(v-if="$slots.actions" #actions)
34
+ slot(name="actions")
35
+ slot(v-if="$slots.activator")
36
+ slot(v-else name="content")
37
+ w-overlay(
38
+ v-if="overlay"
39
+ ref="overlay"
40
+ :model-value="detachableVisible"
41
+ :persistent="persistent"
42
+ :class="overlayClasses"
43
+ v-bind="overlayProps"
44
+ :z-index="(zIndex || 200) - 1"
45
+ @update:model-value="detachableVisible = false")
42
46
  </template>
43
47
 
44
48
  <script>
@@ -175,7 +179,7 @@ export default {
175
179
  minWidth: (this.minWidth && this.menuMinWidth) || null,
176
180
  maxWidth: (this.maxWidth && this.menuMaxWidth) || null,
177
181
  visibility: this.detachableReady ? null : 'hidden', // Hidden until coords are ready.
178
- '--w-menu-bg-color': this.arrow && (this.$waveui.colors[this.bgColor] || 'var(--w-base-bg-color)')
182
+ '--w-menu-bg-color': this.arrow ? (this.$waveui.colors[this.bgColor] || 'var(--w-base-bg-color)') : null
179
183
  }
180
184
  },
181
185
 
@@ -291,36 +295,34 @@ export default {
291
295
  </script>
292
296
 
293
297
  <style lang="scss">
294
- @use "sass:math";
295
-
296
298
  .w-menu-wrap {display: none;}
297
299
 
298
300
  .w-menu {
299
301
  position: absolute;
300
302
  z-index: 100;
301
- color: $menu-color;
303
+ color: var(--w-menu-color);
302
304
 
303
305
  @include themeable;
304
306
 
305
307
  &--fixed {position: fixed;z-index: 1000;}
306
- &--card {background-color: $menu-bg-color;}
308
+ &--card {background-color: var(--w-menu-bg-color);}
307
309
  &--tile {border-radius: 0;}
308
310
  &--round {
309
311
  border-radius: 99em;
310
- padding: $base-increment math.round(2.5 * $base-increment);
312
+ padding: var(--w-base-increment) calc(var(--w-base-increment) * 2.5);
311
313
  }
312
- &--shadow {box-shadow: $box-shadow;}
314
+ &--shadow {box-shadow: var(--w-box-shadow);}
313
315
 
314
- &--top {margin-top: -3 * $base-increment;}
315
- &--bottom {margin-top: 3 * $base-increment;}
316
- &--left {margin-left: -3 * $base-increment;}
317
- &--right {margin-left: 3 * $base-increment;}
316
+ &--top {margin-top: calc(var(--w-base-increment) * -3);}
317
+ &--bottom {margin-top: calc(var(--w-base-increment) * 3);}
318
+ &--left {margin-left: calc(var(--w-base-increment) * -3);}
319
+ &--right {margin-left: calc(var(--w-base-increment) * 3);}
318
320
 
319
321
  &--arrow {
320
- &.w-menu--top {margin-top: -4 * $base-increment;}
321
- &.w-menu--bottom {margin-top: 4 * $base-increment;}
322
- &.w-menu--left {margin-left: -4 * $base-increment;}
323
- &.w-menu--right {margin-left: 4 * $base-increment;}
322
+ &.w-menu--top {margin-top: calc(var(--w-base-increment) * -4);}
323
+ &.w-menu--bottom {margin-top: calc(var(--w-base-increment) * 4);}
324
+ &.w-menu--left {margin-left: calc(var(--w-base-increment) * -4);}
325
+ &.w-menu--right {margin-left: calc(var(--w-base-increment) * 4);}
324
326
 
325
327
  // Menu without border.
326
328
  &.w-menu--no-border {