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
@@ -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>
@@ -409,10 +409,10 @@ export default {
409
409
  .w-list {
410
410
  list-style-type: none;
411
411
  margin-left: 0;
412
- font-size: $base-font-size;
412
+ font-size: var(--w-base-font-size);
413
413
 
414
- &--child {margin-left: 6 * $base-increment;}
415
- &--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);}
416
416
 
417
417
  &__item {margin-top: 1px;}
418
418
  &__item:first-child {margin-top: 0;}
@@ -428,7 +428,7 @@ export default {
428
428
  &__item-bullet {
429
429
  position: absolute;
430
430
  right: 100%;
431
- margin-right: 3 * $base-increment;
431
+ margin-right: calc(var(--w-base-increment) * 3);
432
432
  top: 0.1em;
433
433
 
434
434
  @-moz-document url-prefix() {
@@ -437,7 +437,7 @@ export default {
437
437
 
438
438
  .w-list--hoverable &,
439
439
  .w-list--selectable &,
440
- .w-list--checklist & {margin-top: 3 * $base-increment;}
440
+ .w-list--checklist & {margin-top: calc(var(--w-base-increment) * 3);}
441
441
  }
442
442
 
443
443
  // List item Label.
@@ -463,15 +463,14 @@ export default {
463
463
 
464
464
  &--hoverable,
465
465
  &--selectable {
466
- padding: 2 * $base-increment;
466
+ padding: calc(var(--w-base-increment) * 2);
467
467
 
468
468
  &:before {
469
469
  content: '';
470
470
  position: absolute;
471
471
  inset: 0;
472
- background-color: currentColor;
473
- opacity: 0;
474
- transition: 0.2s;
472
+ background-color: transparent;
473
+ transition: background-color 0.2s;
475
474
  pointer-events: none;
476
475
  }
477
476
  }
@@ -480,17 +479,17 @@ export default {
480
479
  &--hoverable:hover:before,
481
480
  &--selectable:focus:before,
482
481
  &--focused:before,
483
- &--selectable:hover:before {opacity: 0.08;}
482
+ &--selectable:hover:before {background-color: color-mix(in srgb, currentColor 8%, transparent);}
484
483
 
485
484
  // Active class (when item is selected).
486
485
  &--active:before, &--active:focus:before, &--active:hover:before,
487
- .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);}
488
487
 
489
488
  // Active state (while pressing key or mouse).
490
489
  &--active.w-list__item-label--hoverable:hover:before,
491
490
  &--active.w-list__item-label--selectable:focus:before,
492
491
  &--active.w-list__item-label--selectable:hover:before,
493
- &--selectable:active:before {opacity: 0.2;}
492
+ &--selectable:active:before {background-color: color-mix(in srgb, currentColor 20%, transparent);}
494
493
 
495
494
  // Disabled.
496
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 {
@@ -168,8 +168,8 @@ export default {
168
168
  .w-notification {
169
169
  display: flex;
170
170
  justify-content: center;
171
- left: 2 * $base-increment;
172
- right: 2 * $base-increment;
171
+ left: calc(var(--w-base-increment) * 2);
172
+ right: calc(var(--w-base-increment) * 2);
173
173
  position: fixed;
174
174
  z-index: 300;
175
175
  pointer-events: none;
@@ -178,8 +178,8 @@ export default {
178
178
 
179
179
  // Position.
180
180
  &--absolute {position: absolute;z-index: 400;}
181
- &--top {top: 0;padding-top: 2 * $base-increment;}
182
- &--bottom {bottom: 0;padding-bottom: 2 * $base-increment;}
181
+ &--top {top: 0;padding-top: calc(var(--w-base-increment) * 2);}
182
+ &--bottom {bottom: 0;padding-bottom: calc(var(--w-base-increment) * 2);}
183
183
  &--left {justify-content: flex-start;right: auto;}
184
184
  &--right {justify-content: flex-end;left: auto;}
185
185
 
@@ -135,11 +135,11 @@ $circle-size: 40;
135
135
  &--top {top: 0;}
136
136
  &--bottom {bottom: 0;}
137
137
 
138
- &--shadow {box-shadow: $box-shadow;}
138
+ &--shadow {box-shadow: var(--w-box-shadow);}
139
139
 
140
140
  // Linear progress.
141
141
  // ------------------------------------------------------
142
- &--linear {border-radius: $border-radius;}
142
+ &--linear {border-radius: var(--w-border-radius);}
143
143
  // Tile, round and outline are only available on linear progress.
144
144
  &--tile {border-radius: 0;}
145
145
  &--round {border-radius: 99em;}
@@ -147,7 +147,7 @@ $circle-size: 40;
147
147
 
148
148
  &--linear {
149
149
  display: flex;
150
- height: $base-increment;
150
+ height: var(--w-base-increment);
151
151
  overflow: hidden;
152
152
 
153
153
  // Background.
@@ -156,8 +156,7 @@ $circle-size: 40;
156
156
  position: absolute;
157
157
  inset: 0;
158
158
  border-radius: inherit;
159
- background-color: currentColor;
160
- opacity: 0.15;
159
+ background-color: color-mix(in srgb, currentColor 15%, transparent);
161
160
  }
162
161
  &.w-progress--outline:after {display: none;}
163
162
 
@@ -242,11 +241,11 @@ $circle-size: 40;
242
241
  display: inline-flex;
243
242
  width: 3em;
244
243
  aspect-ratio: 1;
245
- font-size: $base-font-size;
244
+ font-size: var(--w-base-font-size);
246
245
 
247
246
  svg {display: block;width: 100%;}
248
247
  circle.bg {stroke: currentColor;}
249
- &.w-progress--default-bg circle.bg {stroke: $progress-bg-color;}
248
+ &.w-progress--default-bg circle.bg {stroke: var(--w-progress-bg-color);}
250
249
 
251
250
  .w-progress__progress {
252
251
  transform-origin: 100% 100%;
@@ -69,6 +69,12 @@ export default {
69
69
  color: { type: String, default: 'primary' },
70
70
  labelColor: { type: String, default: 'primary' },
71
71
  noRipple: { type: Boolean },
72
+ // Sizes.
73
+ xs: { type: Boolean },
74
+ sm: { type: Boolean },
75
+ md: { type: Boolean },
76
+ lg: { type: Boolean },
77
+ xl: { type: Boolean },
72
78
  dark: { type: Boolean },
73
79
  light: { type: Boolean }
74
80
  // Props from mixin: id, name, disabled, readonly, required, tabindex, validators.
@@ -90,6 +96,10 @@ export default {
90
96
  hasLabel () {
91
97
  return this.label || this.$slots.default
92
98
  },
99
+ presetSize () {
100
+ return (this.xs && 'xs') || (this.sm && 'sm') || (this.md && 'md') || (this.lg && 'lg') || (this.xl && 'xl') || null
101
+ },
102
+
93
103
  classes () {
94
104
  return {
95
105
  [`w-radio w-radio--${this.inputValue ? 'checked' : 'unchecked'}`]: true,
@@ -98,7 +108,8 @@ export default {
98
108
  'w-radio--ripple': this.ripple.start,
99
109
  'w-radio--rippled': this.ripple.end,
100
110
  'w-radio--dark': this.ripple.dark,
101
- 'w-radio--light': this.ripple.light
111
+ 'w-radio--light': this.ripple.light,
112
+ [`size--${this.presetSize}`]: !!this.presetSize
102
113
  }
103
114
  }
104
115
  },
@@ -148,6 +159,8 @@ $outline-width: 2px;
148
159
  $inactive-color: #666;
149
160
 
150
161
  .w-radio {
162
+ // --_size resolves --w-size if set (e.g. via size class or inline style), otherwise the global default.
163
+ --_size: var(--w-size, var(--w-small-form-el-size));
151
164
  display: inline-flex;
152
165
  align-items: center;
153
166
  vertical-align: middle;
@@ -175,7 +188,7 @@ $inactive-color: #666;
175
188
  &__input {
176
189
  position: relative;
177
190
  border-radius: 100%;
178
- width: $small-form-el-size;
191
+ width: var(--_size);
179
192
  aspect-ratio: 1;
180
193
  display: flex;
181
194
  flex: 0 0 auto; // Prevent stretching width or height.
@@ -185,11 +198,11 @@ $inactive-color: #666;
185
198
  transition: 0.3s ease-in-out;
186
199
  cursor: inherit;
187
200
 
188
- .w-radio--disabled & {border-color: $disabled-color;}
201
+ .w-radio--disabled & {border-color: var(--w-disabled-color);}
189
202
 
190
203
  // Checked state.
191
204
  :checked ~ & {border-color: currentColor;}
192
- .w-radio--disabled :checked ~ & {border-color: $disabled-color;}
205
+ .w-radio--disabled :checked ~ & {border-color: var(--w-disabled-color);}
193
206
  }
194
207
 
195
208
  // The inner bullet - visible when checked.
@@ -200,7 +213,7 @@ $inactive-color: #666;
200
213
  border: 0 solid $inactive-color;
201
214
  // Prevents a tiny hole while animating and in some browser zoom levels.
202
215
  background-color: $inactive-color;
203
- transition: $transition-duration;
216
+ transition: var(--w-transition-duration);
204
217
 
205
218
  :checked ~ & {
206
219
  border-width: 4px;
@@ -209,9 +222,9 @@ $inactive-color: #666;
209
222
  background-color: currentColor;
210
223
  }
211
224
  .w-radio--disabled & {
212
- border-color: $disabled-color;
225
+ border-color: var(--w-disabled-color);
213
226
  // Prevents a tiny hole while animating and in some browser zoom levels.
214
- background-color: $disabled-color;
227
+ background-color: var(--w-disabled-color);
215
228
  }
216
229
  }
217
230
 
@@ -256,6 +269,18 @@ $inactive-color: #666;
256
269
 
257
270
  .w-radio--disabled & {opacity: 0.7;}
258
271
  }
272
+
273
+ // Sizes.
274
+ // ------------------------------------------------------
275
+ &.size--xs {--w-size: round(nearest, calc(0.86 * var(--w-base-font-size)), 2px);}
276
+ &.size--xs &__input {border-width: 1px;}
277
+ &.size--xs :checked ~ &__input:after {border-width: 3px;}
278
+ &.size--sm {--w-size: round(nearest, calc(1.14 * var(--w-base-font-size)), 2px);}
279
+ &.size--sm :checked ~ &__input:after {border-width: 3px;}
280
+ &.size--lg {--w-size: round(nearest, calc(1.43 * var(--w-base-font-size)), 2px);}
281
+ &.size--lg :checked ~ &__input:after {border-width: 5px;}
282
+ &.size--xl {--w-size: round(nearest, calc(1.71 * var(--w-base-font-size)), 2px);}
283
+ &.size--xl :checked ~ &__input:after {border-width: 6px;}
259
284
  }
260
285
 
261
286
  @keyframes w-radio-ripple {