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
@@ -49,7 +49,13 @@ export default {
49
49
  itemColorKey: { type: String, default: 'color' }, // Support a different color per item.
50
50
  inline: { type: Boolean },
51
51
  color: { type: String, default: 'primary' },
52
- labelColor: { type: String, default: 'primary' }
52
+ labelColor: { type: String, default: 'primary' },
53
+ // Sizes.
54
+ xs: { type: Boolean },
55
+ sm: { type: Boolean },
56
+ md: { type: Boolean },
57
+ lg: { type: Boolean },
58
+ xl: { type: Boolean }
53
59
  // Props from mixin: id, name, disabled, readonly, required, validators.
54
60
  // Computed from mixin: inputName, isDisabled & isReadonly.
55
61
  },
@@ -77,10 +83,15 @@ export default {
77
83
  color: item[this.itemColorKey] || this.color
78
84
  }))
79
85
  },
86
+ presetSize () {
87
+ return (this.xs && 'xs') || (this.sm && 'sm') || (this.md && 'md') || (this.lg && 'lg') || (this.xl && 'xl') || null
88
+ },
89
+
80
90
  classes () {
81
91
  return [
82
92
  'w-radios',
83
- `w-radios--${this.inline ? 'inline' : 'column'}`
93
+ `w-radios--${this.inline ? 'inline' : 'column'}`,
94
+ this.presetSize && `size--${this.presetSize}`
84
95
  ]
85
96
  }
86
97
  },
@@ -113,8 +124,22 @@ export default {
113
124
  flex-wrap: wrap;
114
125
  vertical-align: middle;
115
126
 
116
- .w-radio {margin-right: 3 * $base-increment;}
127
+ .w-radio {margin-right: calc(var(--w-base-increment) * 3);}
117
128
  .w-radio:last-child {margin-right: 0;}
118
129
  }
130
+
131
+ // Sizes (cascades --w-small-form-el-size to child w-radio elements).
132
+ // Also scales the radio bullet border-width proportionally.
133
+ // ------------------------------------------------------
134
+ &.size--xs {--w-size: round(nearest, calc(0.86 * var(--w-base-font-size)), 2px);}
135
+ &.size--xs .w-radio__input {border-width: 1px;}
136
+ &.size--xs :checked ~ .w-radio__input:after {border-width: 3px;}
137
+ &.size--sm {--w-size: round(nearest, calc(1.14 * var(--w-base-font-size)), 2px);}
138
+ &.size--sm .w-radio__input {border-width: 1.5px;}
139
+ &.size--sm :checked ~ .w-radio__input:after {border-width: 4px;}
140
+ &.size--lg {--w-size: round(nearest, calc(1.43 * var(--w-base-font-size)), 2px);}
141
+ &.size--lg :checked ~ .w-radio__input:after {border-width: 5px;}
142
+ &.size--xl {--w-size: round(nearest, calc(1.71 * var(--w-base-font-size)), 2px);}
143
+ &.size--xl :checked ~ .w-radio__input:after {border-width: 7px;}
119
144
  }
120
145
  </style>
@@ -167,8 +167,6 @@ export default {
167
167
  </script>
168
168
 
169
169
  <style lang="scss">
170
- @use "sass:math";
171
-
172
170
  .w-rating {
173
171
  display: inline-flex;
174
172
  align-items: center;
@@ -184,21 +182,21 @@ export default {
184
182
  justify-content: center;
185
183
  border: none;
186
184
  background: none;
187
- color: $rating-bg-color;
185
+ color: var(--w-rating-bg-color);
188
186
  cursor: pointer;
189
187
  -webkit-tap-highlight-color: transparent;
190
- @include default-transition($fast-transition-duration);
188
+ @include default-transition(var(--w-transition-duration-fast));
191
189
 
192
190
  // Disabled & readonly.
193
191
  .w-rating--disabled & {opacity: 0.6;cursor: not-allowed;}
194
192
  .w-rating--readonly & {cursor: auto;}
195
193
 
196
194
  // Sizes.
197
- &.size--xs {font-size: math.round(0.85 * $base-font-size);}
198
- &.size--sm {font-size: math.round(1.15 * $base-font-size);}
199
- &.size--md {font-size: math.round(1.4 * $base-font-size);}
200
- &.size--lg {font-size: math.round(1.7 * $base-font-size);}
201
- &.size--xl {font-size: 2 * $base-font-size;margin-left: 0;}
195
+ &.size--xs {font-size: round(nearest, calc(0.85 * var(--w-base-font-size)), 1px);}
196
+ &.size--sm {font-size: round(nearest, calc(1.15 * var(--w-base-font-size)), 1px);}
197
+ &.size--md {font-size: round(nearest, calc(1.4 * var(--w-base-font-size)), 1px);}
198
+ &.size--lg {font-size: round(nearest, calc(1.7 * var(--w-base-font-size)), 1px);}
199
+ &.size--xl {font-size: calc(2 * var(--w-base-font-size));margin-left: 0;}
202
200
 
203
201
  &:before {font-size: 1.1em;}
204
202
  &:before, .w-icon:before {
@@ -744,19 +744,19 @@ defineExpose({
744
744
  cursor: pointer;
745
745
  touch-action: none;
746
746
  opacity: 1;
747
- transition: opacity $fast-transition-duration ease;
747
+ transition: opacity var(--w-transition-duration-fast) ease;
748
748
 
749
749
  &--horizontal {
750
750
  width: 100%;
751
751
  border-bottom-left-radius: inherit;
752
752
  border-bottom-right-radius: inherit;
753
- height: $scrollbar-size;
753
+ height: var(--w-scrollbar-size);
754
754
  }
755
755
  &--vertical {
756
756
  inset: 0 0 0 auto;
757
757
  border-top-right-radius: inherit;
758
758
  border-bottom-right-radius: inherit;
759
- width: $scrollbar-size;
759
+ width: var(--w-scrollbar-size);
760
760
  }
761
761
 
762
762
  &--hidden {
@@ -770,7 +770,7 @@ defineExpose({
770
770
  color: color-mix(in srgb, var(--w-contrast-bg-color) 8%, var(--w-base-bg-color));
771
771
  background: currentColor;
772
772
 
773
- border-radius: $border-radius;
773
+ border-radius: var(--w-border-radius);
774
774
  z-index: 1;
775
775
  transition: box-shadow 0.15s ease;
776
776
  cursor: grab;
@@ -24,77 +24,77 @@ component(
24
24
  custom
25
25
  min-width="activator"
26
26
  v-bind="menuProps || {}")
27
- template(#activator)
28
- //- Input wrapper.
29
- .w-select__selection-wrap(
30
- @click="!isDisabled && !isReadonly && onInputFieldClick()"
31
- role="button"
32
- aria-haspopup="listbox"
33
- :aria-expanded="showMenu ? 'true' : 'false'"
34
- :aria-owns="selectListId"
35
- :aria-activedescendant="`${selectListId}_item-1`"
36
- :class="inputWrapClasses")
37
- slot(name="icon-left")
38
- w-icon.w-select__icon.w-select__icon--inner-left(
39
- v-if="innerIconLeft"
40
- tag="label"
41
- @click="$emit('click:inner-icon-left', $event)") {{ innerIconLeft }}
42
- .w-select__selection-slot(v-if="$slots.selection")
43
- //- inputValue is always an array.
44
- slot(name="selection" :item="multiple ? inputValue : inputValue[0]")
45
- .w-select__selection(
46
- ref="selection-input"
47
- @focus="!isDisabled && !isReadonly && onFocus($event)"
48
- @blur="onBlur"
49
- @keydown="!isDisabled && !isReadonly && onKeydown($event)"
50
- v-bind="selectionAttributes"
51
- v-html="selectionHtml")
52
- //- For standard HTML form submission.
53
- input(
54
- v-for="(val, i) in (inputValue.length ? inputValue : [{}])"
55
- :key="i"
56
- type="hidden"
57
- :value="val.value === undefined ? '' : val.value.toString()"
58
- :name="inputName + (multiple ? '[]' : '')")
59
- template(v-if="labelPosition === 'inside' && showLabelInside")
60
- label.w-select__label.w-select__label--inside.w-form-el-shakable(
61
- v-if="$slots.default || label"
62
- :class="labelClasses")
63
- slot {{ label }}
64
- slot(name="icon-right")
65
- w-icon.w-select__icon.w-select__icon--inner-right(
66
- v-if="innerIconRight"
67
- tag="label"
68
- @click="$emit('click:inner-icon-right', $event)") {{ innerIconRight }}
69
- w-list(
70
- ref="w-list"
71
- :model-value="inputValue"
72
- @update:model-value="onInput"
73
- @item-click="$emit('item-click', $event)"
74
- @item-select="onListItemSelect"
75
- @keydown="onWListKeydown"
76
- @keydown:enter="noUnselect && !multiple && closeMenu()"
77
- @keydown:escape="showMenu && (showMenu = false) /* Will call closeMenu() from w-menu(@close). */"
78
- :items="selectItems"
79
- :multiple="multiple"
80
- arrows-navigation
81
- return-object
82
- :add-ids="selectListId"
83
- :no-unselect="noUnselect"
84
- :selection-color="selectionColor"
85
- :item-color-key="itemColorKey"
86
- role="listbox"
87
- tabindex="-1")
88
- template(v-for="i in items.length" #[`item.${i}`]="{ item, selected, index }")
89
- slot(
90
- v-if="$slots[`item.${i}`] && $slots[`item.${i}`](item, selected, index)"
91
- :name="`item.${i}`"
92
- :item="item"
93
- :selected="selected"
94
- :index="index")
95
- | {{ item[itemLabelKey] }}
96
- slot(v-else name="item" :item="item" :selected="selected" :index="index") {{ item[itemLabelKey] }}
97
-
27
+ //- Input wrapper.
28
+ .w-select__selection-wrap(
29
+ @click="!isDisabled && !isReadonly && onInputFieldClick()"
30
+ role="button"
31
+ aria-haspopup="listbox"
32
+ :aria-expanded="showMenu ? 'true' : 'false'"
33
+ :aria-owns="selectListId"
34
+ :aria-activedescendant="`${selectListId}_item-1`"
35
+ :class="inputWrapClasses")
36
+ slot(name="icon-left")
37
+ w-icon.w-select__icon.w-select__icon--inner-left(
38
+ v-if="innerIconLeft"
39
+ tag="label"
40
+ @click="$emit('click:inner-icon-left', $event)") {{ innerIconLeft }}
41
+ .w-select__selection-slot(v-if="$slots.selection")
42
+ //- inputValue is always an array.
43
+ slot(name="selection" :item="multiple ? inputValue : inputValue[0]")
44
+ .w-select__selection(
45
+ ref="selection-input"
46
+ @focus="!isDisabled && !isReadonly && onFocus($event)"
47
+ @blur="onBlur"
48
+ @keydown="!isDisabled && !isReadonly && onKeydown($event)"
49
+ v-bind="selectionAttributes"
50
+ v-html="selectionHtml")
51
+ //- For standard HTML form submission.
52
+ input(
53
+ v-for="(val, i) in (inputValue.length ? inputValue : [{}])"
54
+ :key="i"
55
+ type="hidden"
56
+ :value="val.value === undefined ? '' : val.value.toString()"
57
+ :name="inputName + (multiple ? '[]' : '')")
58
+ template(v-if="labelPosition === 'inside' && showLabelInside")
59
+ label.w-select__label.w-select__label--inside.w-form-el-shakable(
60
+ v-if="$slots.default || label"
61
+ :class="labelClasses")
62
+ slot {{ label }}
63
+ slot(name="icon-right")
64
+ w-icon.w-select__icon.w-select__icon--inner-right(
65
+ v-if="innerIconRight"
66
+ tag="label"
67
+ @click="$emit('click:inner-icon-right', $event)") {{ innerIconRight }}
68
+ template(#content)
69
+ w-list(
70
+ ref="w-list"
71
+ :model-value="inputValue"
72
+ @update:model-value="onInput"
73
+ @item-click="$emit('item-click', $event)"
74
+ @item-select="onListItemSelect"
75
+ @keydown="onWListKeydown"
76
+ @keydown:enter="noUnselect && !multiple && closeMenu()"
77
+ @keydown:escape="showMenu && (showMenu = false) /* Will call closeMenu() from w-menu(@close). */"
78
+ :items="selectItems"
79
+ :multiple="multiple"
80
+ arrows-navigation
81
+ return-object
82
+ :add-ids="selectListId"
83
+ :no-unselect="noUnselect"
84
+ :selection-color="selectionColor"
85
+ :item-color-key="itemColorKey"
86
+ role="listbox"
87
+ tabindex="-1")
88
+ template(v-for="i in items.length" #[`item.${i}`]="{ item, selected, index }")
89
+ slot(
90
+ v-if="$slots[`item.${i}`] && $slots[`item.${i}`](item, selected, index)"
91
+ :name="`item.${i}`"
92
+ :item="item"
93
+ :selected="selected"
94
+ :index="index")
95
+ | {{ item[itemLabelKey] }}
96
+ slot(v-else name="item" :item="item" :selected="selected" :index="index") {{ item[itemLabelKey] }}
97
+
98
98
  template(v-if="labelPosition === 'right'")
99
99
  label.w-select__label.w-select__label--right.w-form-el-shakable(
100
100
  v-if="$slots.default || label"
@@ -147,6 +147,12 @@ export default {
147
147
  round: { type: Boolean },
148
148
  shadow: { type: Boolean },
149
149
  tile: { type: Boolean },
150
+ // Sizes.
151
+ xs: { type: Boolean },
152
+ sm: { type: Boolean },
153
+ md: { type: Boolean },
154
+ lg: { type: Boolean },
155
+ xl: { type: Boolean },
150
156
  returnObject: { type: Boolean },
151
157
  // By default you can unselect a list item by re-selecting it.
152
158
  // Allow preventing that on single selection lists only.
@@ -214,6 +220,10 @@ export default {
214
220
  if (this.$slots.selection) return ''
215
221
  return this.selectionString
216
222
  },
223
+ presetSize () {
224
+ return (this.xs && 'xs') || (this.sm && 'sm') || (this.md && 'md') || (this.lg && 'lg') || (this.xl && 'xl') || null
225
+ },
226
+
217
227
  classes () {
218
228
  return {
219
229
  'w-select': true,
@@ -229,7 +239,8 @@ export default {
229
239
  'w-select--has-placeholder': this.placeholder,
230
240
  'w-select--inner-icon-left': this.innerIconLeft,
231
241
  'w-select--inner-icon-right': this.innerIconRight,
232
- 'w-select--open': this.showMenu
242
+ 'w-select--open': this.showMenu,
243
+ [`size--${this.presetSize}`]: !!this.presetSize
233
244
  }
234
245
  },
235
246
  inputWrapClasses () {
@@ -441,12 +452,12 @@ export default {
441
452
  flex-grow: 1;
442
453
  flex-wrap: wrap;
443
454
  align-items: center;
444
- font-size: $base-font-size;
455
+ font-size: var(--w-base-font-size);
445
456
 
446
457
  @include themeable;
447
458
 
448
459
  &--disabled {
449
- color: $disabled-color;
460
+ color: var(--w-disabled-color);
450
461
  cursor: not-allowed;
451
462
  -webkit-tap-highlight-color: transparent;
452
463
  }
@@ -463,16 +474,16 @@ export default {
463
474
  display: inline-flex;
464
475
  flex: 1 1 auto;
465
476
  align-items: center;
466
- min-height: $form-field-height; // Min-height to allow multiple lines.
467
- border-radius: $border-radius;
468
- border: $border;
469
- transition: border $transition-duration;
477
+ min-height: var(--w-size, var(--w-form-field-height)); // Min-height to allow multiple lines.
478
+ border-radius: var(--w-border-radius);
479
+ border: var(--w-border);
480
+ transition: border var(--w-transition-duration);
470
481
 
471
482
  &--tile {border-radius: initial;}
472
- &--shadow {box-shadow: $box-shadow;}
483
+ &--shadow {box-shadow: var(--w-box-shadow);}
473
484
  .w-select[class^="bdrs"] &, .w-select[class*=" bdrs"] & {border-radius: inherit;}
474
485
 
475
- .w-select--floating-label & {margin-top: 3 * $base-increment;}
486
+ .w-select--floating-label & {margin-top: calc(var(--w-base-increment) * 3);}
476
487
 
477
488
  &--underline {
478
489
  border-bottom-left-radius: initial;
@@ -493,7 +504,7 @@ export default {
493
504
  width: 100%;
494
505
  height: 0;
495
506
  border-bottom: 2px solid currentColor;
496
- transition: $transition-duration;
507
+ transition: var(--w-transition-duration);
497
508
  transform: scaleX(0);
498
509
  pointer-events: none;
499
510
  }
@@ -502,12 +513,12 @@ export default {
502
513
  .w-select--open &--underline:after {transform: scaleX(1);}
503
514
  &--round.w-select__selection-wrap--underline:after {
504
515
  border-radius: 99em;
505
- transition: $transition-duration, height 0.035s;
516
+ transition: var(--w-transition-duration), height 0.035s;
506
517
  }
507
518
  .w-select--focused &--round.w-select__selection-wrap--underline:after,
508
519
  .w-select--open &--round.w-select__selection-wrap--underline:after {
509
520
  height: 100%;
510
- transition: $transition-duration, height 0s ($transition-duration - 0.035s);
521
+ transition: var(--w-transition-duration), height 0s calc(var(--w-transition-duration) - 0.035s);
511
522
  }
512
523
  }
513
524
 
@@ -520,8 +531,8 @@ export default {
520
531
  height: 100%;
521
532
  min-height: inherit;
522
533
  outline: none;
523
- padding-left: 2 * $base-increment;
524
- padding-right: 2 * $base-increment;
534
+ padding-left: calc(var(--w-base-increment) * 2);
535
+ padding-right: calc(var(--w-base-increment) * 2);
525
536
  display: flex;
526
537
  align-items: center;
527
538
  cursor: pointer;
@@ -541,15 +552,15 @@ export default {
541
552
  }
542
553
 
543
554
  .w-select__selection-wrap--round & {
544
- padding-left: 3 * $base-increment;
545
- padding-right: 3 * $base-increment;
555
+ padding-left: calc(var(--w-base-increment) * 3);
556
+ padding-right: calc(var(--w-base-increment) * 3);
546
557
  }
547
558
 
548
559
  .w-select--inner-icon-left & {padding-left: 27px;}
549
560
  &-slot, .w-select--inner-icon-right & {padding-right: 22px;}
550
561
 
551
562
  .w-select--disabled & {
552
- color: $disabled-color;
563
+ color: var(--w-disabled-color);
553
564
  cursor: not-allowed;
554
565
  -webkit-tap-highlight-color: transparent;
555
566
  }
@@ -575,13 +586,13 @@ export default {
575
586
 
576
587
  .w-select--disabled &,
577
588
  .w-select--readonly & {
578
- color: $disabled-color;
589
+ color: var(--w-disabled-color);
579
590
  cursor: not-allowed;
580
591
  -webkit-tap-highlight-color: transparent;
581
592
  }
582
593
 
583
- &--inner-left {left: $base-increment;}
584
- &--inner-right {right: $base-increment;}
594
+ &--inner-left {left: var(--w-base-increment);}
595
+ &--inner-right {right: var(--w-base-increment);}
585
596
  .w-select--no-padding &--inner-left {left: 1px;}
586
597
  .w-select--no-padding &--inner-right {right: 1px;}
587
598
 
@@ -596,15 +607,15 @@ export default {
596
607
  &__label {
597
608
  display: flex;
598
609
  align-items: center;
599
- transition: color $transition-duration;
610
+ transition: color var(--w-transition-duration);
600
611
  cursor: pointer;
601
612
  user-select: none;
602
613
 
603
- &--left {margin-right: 2 * $base-increment;}
604
- &--right {margin-left: 2 * $base-increment;}
614
+ &--left {margin-right: calc(var(--w-base-increment) * 2);}
615
+ &--right {margin-left: calc(var(--w-base-increment) * 2);}
605
616
 
606
617
  .w-select--disabled & {
607
- color: $disabled-color;
618
+ color: var(--w-disabled-color);
608
619
  cursor: not-allowed;
609
620
  -webkit-tap-highlight-color: transparent;
610
621
  }
@@ -621,7 +632,7 @@ export default {
621
632
  white-space: nowrap;
622
633
  // Use margin instead of padding as the scale transformation below decreases the real padding
623
634
  // size and misaligns the label.
624
- margin-left: 2 * $base-increment;
635
+ margin-left: calc(var(--w-base-increment) * 2);
625
636
  pointer-events: none;
626
637
 
627
638
  .w-select--inner-icon-right & {padding-right: 26px;}
@@ -631,14 +642,14 @@ export default {
631
642
  margin-left: 0;
632
643
  }
633
644
  .w-select__selection-wrap--round & {
634
- margin-left: math.round(3 * $base-increment);
645
+ margin-left: calc(var(--w-base-increment) * 3);
635
646
  }
636
647
  .w-select--inner-icon-left & {left: 18px;}
637
648
  .w-select--no-padding.w-select--inner-icon-left & {left: 26px;}
638
649
 
639
650
  .w-select--floating-label & {
640
651
  transform-origin: 0 0;
641
- transition: $transition-duration ease;
652
+ transition: var(--w-transition-duration) ease;
642
653
  }
643
654
 
644
655
  // Move label with underline style.
@@ -657,15 +668,22 @@ export default {
657
668
  .w-select--floating-label.w-select--inner-icon-left .w-select__select:-webkit-autofill & {left: 0;}
658
669
  }
659
670
 
671
+ // Sizes.
672
+ // ------------------------------------------------------
673
+ &.size--xs {--w-size: round(nearest, calc(1.43 * var(--w-base-font-size)), 1px);}
674
+ &.size--sm {--w-size: round(nearest, calc(1.71 * var(--w-base-font-size)), 1px);}
675
+ &.size--lg {--w-size: round(nearest, calc(2.29 * var(--w-base-font-size)), 1px);}
676
+ &.size--xl {--w-size: round(nearest, calc(2.71 * var(--w-base-font-size)), 1px);}
677
+
660
678
  // Menu.
661
679
  // ------------------------------------------------------
662
680
  &__menu {
663
681
  margin: 0;
664
682
  max-height: 300px;
665
683
  overflow: auto;
666
- background-color: $base-bg-color;
667
- border: $border;
668
- border-radius: $border-radius;
684
+ background-color: var(--w-base-bg-color);
685
+ border: var(--w-border);
686
+ border-radius: var(--w-border-radius);
669
687
 
670
688
  .w-list {width: 100%;}
671
689
  }
@@ -283,12 +283,12 @@ export default {
283
283
 
284
284
  // Slider label, left & right.
285
285
  // ------------------------------------------------------
286
- &__label--left {margin-right: 3 * $base-increment;}
287
- &__label--right {margin-left: 3 * $base-increment;}
286
+ &__label--left {margin-right: calc(var(--w-base-increment) * 3);}
287
+ &__label--right {margin-left: calc(var(--w-base-increment) * 3);}
288
288
 
289
289
  // Steps labels.
290
290
  // ------------------------------------------------------
291
- &--has-step-labels {padding-bottom: 4 * $base-increment;}
291
+ &--has-step-labels {padding-bottom: calc(var(--w-base-increment) * 4);}
292
292
  &__step-labels {
293
293
  position: absolute;
294
294
  top: 0;
@@ -300,8 +300,8 @@ export default {
300
300
  position: absolute;
301
301
  transform: translateX(-50%);
302
302
  font-size: 0.8em;
303
- padding-top: 2 * $base-increment;
304
- color: $slider-step-label-color;
303
+ padding-top: calc(var(--w-base-increment) * 2);
304
+ color: var(--w-slider-step-label-color);
305
305
  z-index: 1;
306
306
  cursor: pointer;
307
307
 
@@ -311,10 +311,10 @@ export default {
311
311
  left: 50%;
312
312
  transform: translateX(-50%);
313
313
  top: 0;
314
- width: $base-increment;
314
+ width: var(--w-base-increment);
315
315
  aspect-ratio: 1;
316
316
  min-width: 0; // Safari ratio fix (e.g. losing ratio if height is set and side padding are added).
317
- background-color: $slider-step-label-bg-color;
317
+ background-color: var(--w-slider-step-label-bg-color);
318
318
  border-radius: 99em;
319
319
  // box-shadow: 0 0 0 1px #fff;
320
320
  box-sizing: border-box;
@@ -333,10 +333,10 @@ export default {
333
333
  &__track {
334
334
  position: relative;
335
335
  flex-grow: 1;
336
- height: $slider-height;
337
- background-color: $slider-track-color;
336
+ height: var(--w-slider-height);
337
+ background-color: var(--w-slider-track-color);
338
338
  -webkit-tap-highlight-color: transparent;
339
- border-radius: $border-radius;
339
+ border-radius: var(--w-border-radius);
340
340
  touch-action: none;
341
341
  cursor: pointer;
342
342
 
@@ -364,7 +364,7 @@ export default {
364
364
  right: 0;
365
365
  height: 100%;
366
366
  z-index: 1;
367
- transition: $transition-duration;
367
+ transition: var(--w-transition-duration);
368
368
  border-radius: inherit;
369
369
 
370
370
  .w-slider--dragging & {transition: none;}
@@ -375,14 +375,14 @@ export default {
375
375
  // ------------------------------------------------------
376
376
  &__thumb {
377
377
  position: absolute;
378
- width: 3 * $base-increment;
378
+ width: calc(var(--w-base-increment) * 3);
379
379
  aspect-ratio: 1;
380
380
  min-width: 0; // Safari ratio fix (e.g. losing ratio if height is set and side padding are added).
381
381
  left: 100%;
382
382
  top: 50%;
383
383
  transform: translate(-50%, -50%);
384
384
  z-index: 2;
385
- transition: $transition-duration;
385
+ transition: var(--w-transition-duration);
386
386
 
387
387
  .w-slider--dragging & {transition: none;}
388
388
  }
@@ -397,7 +397,7 @@ export default {
397
397
  border: none;
398
398
  border-radius: 99em;
399
399
  cursor: pointer;
400
- background-color: $slider-thumb-button-bg-color;
400
+ background-color: var(--w-slider-thumb-button-bg-color);
401
401
 
402
402
  .w-slider--disabled &, .w-slider--readonly & {cursor: auto;}
403
403
 
@@ -417,17 +417,17 @@ export default {
417
417
  &:active:before, .w-slider--dragging &:before {
418
418
  opacity: 1;
419
419
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
420
- transition-duration: $fast-transition-duration;
420
+ transition-duration: var(--w-transition-duration-fast);
421
421
  }
422
422
  .w-slider--disabled &:before,
423
423
  .w-slider--readonly &:before {box-shadow: none;opacity: 0.4;}
424
424
 
425
425
  // The outline when focused, but also a bigger reactive zone for fat fingers when not.
426
426
  &:after {
427
- left: -2 * $base-increment;
428
- right: -2 * $base-increment;
429
- top: -2 * $base-increment;
430
- bottom: -2 * $base-increment;
427
+ left: calc(var(--w-base-increment) * -2);
428
+ right: calc(var(--w-base-increment) * -2);
429
+ top: calc(var(--w-base-increment) * -2);
430
+ bottom: calc(var(--w-base-increment) * -2);
431
431
  opacity: 0;
432
432
  background-color: currentColor;
433
433
  }
@@ -441,15 +441,15 @@ export default {
441
441
  position: absolute;
442
442
  left: 50%;
443
443
  bottom: 100%;
444
- margin-bottom: math.round(3 * $base-increment);
444
+ margin-bottom: calc(var(--w-base-increment) * 3);
445
445
  transform: translateX(-50%);
446
- padding: math.round(0.75 * $base-increment) (2 * $base-increment);
447
- background-color: $slider-thumb-label-bg-color;
448
- border-radius: $border-radius;
449
- border: $border;
446
+ padding: calc(var(--w-base-increment) * 0.75) calc(var(--w-base-increment) * 2);
447
+ background-color: var(--w-slider-thumb-label-bg-color);
448
+ border-radius: var(--w-border-radius);
449
+ border: var(--w-border);
450
450
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
451
451
  font-size: 0.85em;
452
- color: $slider-thumb-label-color;
452
+ color: var(--w-slider-thumb-label-color);
453
453
 
454
454
  &:before, &:after {
455
455
  content: '';
@@ -463,7 +463,7 @@ export default {
463
463
  }
464
464
 
465
465
  &:before {border-width: 7px;border-top-color: inherit;}
466
- &:after {border-width: 6px;border-top-color: $slider-thumb-label-bg-color;}
466
+ &:after {border-width: 6px;border-top-color: var(--w-slider-thumb-label-bg-color);}
467
467
 
468
468
  &--droplet {
469
469
  transform: translateX(-50%) rotate(-45deg);
@@ -55,8 +55,6 @@ export default {
55
55
  </script>
56
56
 
57
57
  <style lang="scss">
58
- @use "sass:math";
59
-
60
58
  .w-spinner {
61
59
  position: relative;
62
60
  display: inline-flex;
@@ -66,11 +64,11 @@ export default {
66
64
  aspect-ratio: 1;
67
65
  min-width: 0; // Safari ratio fix (e.g. losing ratio if height is set and side padding are added).
68
66
 
69
- &.size--xs {font-size: math.round(0.9 * divide($base-font-size, 2)) * 2;}
70
- &.size--sm {font-size: math.round(1.5 * $base-font-size);}
71
- &.size--md {font-size: math.round(2 * $base-font-size);}
72
- &.size--lg {font-size: math.round(2.5 * $base-font-size);}
73
- &.size--xl {font-size: 3 * $base-font-size;}
67
+ &.size--xs {font-size: calc(2 * round(nearest, calc(0.9 * var(--w-base-font-size) / 2), 1px));}
68
+ &.size--sm {font-size: round(nearest, calc(1.5 * var(--w-base-font-size)), 1px);}
69
+ &.size--md {font-size: round(nearest, calc(2 * var(--w-base-font-size)), 1px);}
70
+ &.size--lg {font-size: round(nearest, calc(2.5 * var(--w-base-font-size)), 1px);}
71
+ &.size--xl {font-size: calc(3 * var(--w-base-font-size));}
74
72
 
75
73
  &:before, &:after {
76
74
  content: '';