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
@@ -92,8 +92,6 @@ export default {
92
92
  </script>
93
93
 
94
94
  <style lang="scss">
95
- @use "sass:math";
96
-
97
95
  .w-badge-wrap {
98
96
  position: relative;
99
97
  display: inline-flex;
@@ -106,12 +104,13 @@ export default {
106
104
  justify-content: center;
107
105
  user-select: none;
108
106
  border-radius: 99em;
109
- // Always get an even number for better text vertical align.
110
- height: math.round(1.1 * divide($base-font-size, 2)) * 2;
111
- line-height: math.round(1.1 * divide($base-font-size, 2)) * 2;
112
- min-width: math.round(1.1 * divide($base-font-size, 2)) * 2;
107
+ // Always get an even number for better text vertical align (matches former Sass rounding).
108
+ --w-badge-line: calc(2 * round(nearest, calc(1.1 * var(--w-base-font-size) / 2), 1px));
109
+ height: var(--w-badge-line);
110
+ line-height: var(--w-badge-line);
111
+ min-width: var(--w-badge-line);
113
112
  z-index: 1;
114
- padding: 0 $base-increment;
113
+ padding: 0 var(--w-base-increment);
115
114
 
116
115
  @include themeable;
117
116
 
@@ -125,42 +124,44 @@ export default {
125
124
 
126
125
  // Sizes.
127
126
  &.size--xs {
128
- // Always get an even number for better text vertical alignment.
129
- $height: math.round(divide($base-font-size, 2)) * 2;
130
- font-size: math.round(0.67 * divide($base-font-size, 2)) * 2;
131
- height: $height;
132
- line-height: $height;
133
- min-width: $height;
134
-
135
- &--round {width: $height;padding: 0 math.round(divide($height, 2));}
127
+ --w-badge-h: calc(2 * round(nearest, calc(var(--w-base-font-size) / 2), 1px));
128
+ font-size: calc(2 * round(nearest, calc(0.67 * var(--w-base-font-size) / 2), 1px));
129
+ height: var(--w-badge-h);
130
+ line-height: var(--w-badge-h);
131
+ min-width: var(--w-badge-h);
132
+
133
+ &--round {
134
+ width: var(--w-badge-h);
135
+ padding: 0 round(nearest, calc(var(--w-badge-h) / 2), 1px);
136
+ }
136
137
  }
137
138
  &.size--sm {
138
- $height: math.round(1.1 * divide($base-font-size, 2)) * 2;
139
- font-size: math.round(0.75 * divide($base-font-size, 2)) * 2;
140
- height: $height;
141
- line-height: $height;
142
- min-width: $height;
139
+ --w-badge-h: calc(2 * round(nearest, calc(1.1 * var(--w-base-font-size) / 2), 1px));
140
+ font-size: calc(2 * round(nearest, calc(0.75 * var(--w-base-font-size) / 2), 1px));
141
+ height: var(--w-badge-h);
142
+ line-height: var(--w-badge-h);
143
+ min-width: var(--w-badge-h);
143
144
  }
144
145
  &.size--md {
145
- $height: math.round(1.3 * divide($base-font-size, 2)) * 2;
146
- font-size: math.round(0.9 * divide($base-font-size, 2)) * 2;
147
- height: $height;
148
- line-height: $height;
149
- min-width: $height;
146
+ --w-badge-h: calc(2 * round(nearest, calc(1.3 * var(--w-base-font-size) / 2), 1px));
147
+ font-size: calc(2 * round(nearest, calc(0.9 * var(--w-base-font-size) / 2), 1px));
148
+ height: var(--w-badge-h);
149
+ line-height: var(--w-badge-h);
150
+ min-width: var(--w-badge-h);
150
151
  }
151
152
  &.size--lg {
152
- $height: math.round(1.5 * divide($base-font-size, 2)) * 2;
153
- font-size: math.round(1.05 * divide($base-font-size, 2)) * 2;
154
- height: $height;
155
- line-height: $height;
156
- min-width: $height;
153
+ --w-badge-h: calc(2 * round(nearest, calc(1.5 * var(--w-base-font-size) / 2), 1px));
154
+ font-size: calc(2 * round(nearest, calc(1.05 * var(--w-base-font-size) / 2), 1px));
155
+ height: var(--w-badge-h);
156
+ line-height: var(--w-badge-h);
157
+ min-width: var(--w-badge-h);
157
158
  }
158
159
  &.size--xl {
159
- $height: math.round(1.8 * divide($base-font-size, 2)) * 2;
160
- font-size: math.round(1.2 * divide($base-font-size, 2)) * 2;
161
- height: $height;
162
- line-height: $height;
163
- min-width: $height;
160
+ --w-badge-h: calc(2 * round(nearest, calc(1.8 * var(--w-base-font-size) / 2), 1px));
161
+ font-size: calc(2 * round(nearest, calc(1.2 * var(--w-base-font-size) / 2), 1px));
162
+ height: var(--w-badge-h);
163
+ line-height: var(--w-badge-h);
164
+ min-width: var(--w-badge-h);
164
165
  }
165
166
 
166
167
  // Position.
@@ -169,18 +170,18 @@ export default {
169
170
  &--left {right: 100%;}
170
171
  &--right {left: 100%;}
171
172
  &--overlap {
172
- &.w-badge--top {margin-top: -1 * $base-increment;}
173
- &.w-badge--bottom {margin-bottom: -1 * $base-increment;}
174
- &.w-badge--left {margin-right: -3 * $base-increment;}
175
- &.w-badge--right {margin-left: -3 * $base-increment;}
176
- &.w-badge--top.size--xs {margin-top: math.round(-0.5 * $base-increment);}
177
- &.w-badge--bottom.size--xs {margin-bottom: math.round(-0.5 * $base-increment);}
178
- &.w-badge--top.size--sm {margin-top: math.round(-0.75 * $base-increment);}
179
- &.w-badge--bottom.size--sm {margin-bottom: math.round(-0.75 * $base-increment);}
180
- &.w-badge--top.size--lg {margin-top: math.round(-1.5 * $base-increment);}
181
- &.w-badge--bottom.size--lg {margin-bottom: math.round(-1.5 * $base-increment);}
182
- &.w-badge--top.size--xl {margin-top: -2 * $base-increment;}
183
- &.w-badge--bottom.size--xl {margin-bottom: -2 * $base-increment;}
173
+ &.w-badge--top {margin-top: calc(var(--w-base-increment) * -1);}
174
+ &.w-badge--bottom {margin-bottom: calc(var(--w-base-increment) * -1);}
175
+ &.w-badge--left {margin-right: calc(var(--w-base-increment) * -3);}
176
+ &.w-badge--right {margin-left: calc(var(--w-base-increment) * -3);}
177
+ &.w-badge--top.size--xs {margin-top: calc(var(--w-base-increment) * -0.5);}
178
+ &.w-badge--bottom.size--xs {margin-bottom: calc(var(--w-base-increment) * -0.5);}
179
+ &.w-badge--top.size--sm {margin-top: calc(var(--w-base-increment) * -0.75);}
180
+ &.w-badge--bottom.size--sm {margin-bottom: calc(var(--w-base-increment) * -0.75);}
181
+ &.w-badge--top.size--lg {margin-top: calc(var(--w-base-increment) * -1.5);}
182
+ &.w-badge--bottom.size--lg {margin-bottom: calc(var(--w-base-increment) * -1.5);}
183
+ &.w-badge--top.size--xl {margin-top: calc(var(--w-base-increment) * -2);}
184
+ &.w-badge--bottom.size--xl {margin-bottom: calc(var(--w-base-increment) * -2);}
184
185
  }
185
186
 
186
187
  // Look modifiers.
@@ -189,13 +190,13 @@ export default {
189
190
  background-color: transparent;
190
191
  border-color: currentColor;
191
192
  }
192
- &--shadow {box-shadow: $box-shadow;}
193
+ &--shadow {box-shadow: var(--w-box-shadow);}
193
194
 
194
195
  &--dot.w-badge {min-width: 0;padding: 0;aspect-ratio: 1;}
195
- &--dot.size--xs {height: math.round(1.35 * $base-increment);}
196
- &--dot.size--sm {height: math.round(1.7 * $base-increment);}
197
- &--dot.size--md {height: math.round(2.2 * $base-increment);}
198
- &--dot.size--lg {height: math.round(2.75 * $base-increment);}
199
- &--dot.size--xl {height: 3 * $base-increment;}
196
+ &--dot.size--xs {height: calc(var(--w-base-increment) * 1.35);}
197
+ &--dot.size--sm {height: calc(var(--w-base-increment) * 1.7);}
198
+ &--dot.size--md {height: calc(var(--w-base-increment) * 2.2);}
199
+ &--dot.size--lg {height: calc(var(--w-base-increment) * 2.75);}
200
+ &--dot.size--xl {height: calc(var(--w-base-increment) * 3);}
200
201
  }
201
202
  </style>
@@ -20,7 +20,8 @@
20
20
  :is="hasRouter ? 'router-link' : 'a'"
21
21
  :to="hasRouter && item[itemRouteKey]"
22
22
  :href="item[itemRouteKey]"
23
- :class="color || null")
23
+ :class="breadcrumbLinkClasses"
24
+ @pointerdown="onRipple")
24
25
  slot(name="item" :item="item" :index="i + 1" :isLast="i === items.length - 1")
25
26
  component.w-breadcrumbs__item(
26
27
  v-else
@@ -29,7 +30,8 @@
29
30
  :to="hasRouter && item[itemRouteKey]"
30
31
  :href="item[itemRouteKey]"
31
32
  v-html="item[itemLabelKey]"
32
- :class="color || null")
33
+ :class="breadcrumbLinkClasses"
34
+ @pointerdown="onRipple")
33
35
 
34
36
  //- Current page when linkLastItem is false.
35
37
  slot(
@@ -43,8 +45,13 @@
43
45
  </template>
44
46
 
45
47
  <script>
48
+ import RippleMixin from '../mixins/ripple'
49
+
46
50
  export default {
47
51
  name: 'w-breadcrumbs',
52
+
53
+ mixins: [RippleMixin],
54
+
48
55
  props: {
49
56
  items: { type: Array, required: true },
50
57
  linkLastItem: { type: Boolean },
@@ -63,6 +70,10 @@ export default {
63
70
  emits: [],
64
71
 
65
72
  computed: {
73
+ breadcrumbLinkClasses () {
74
+ return [this.color || null, { 'w-ripple': this.rippleActive }]
75
+ },
76
+
66
77
  hasRouter () {
67
78
  return '$router' in this
68
79
  },
@@ -85,21 +96,19 @@ export default {
85
96
  </script>
86
97
 
87
98
  <style lang="scss">
88
- @use "sass:math";
89
-
90
99
  .w-breadcrumbs {
91
100
  display: flex;
92
101
  align-items: center;
93
102
 
94
- &.size--xs {font-size: math.round(0.8 * $base-font-size);}
95
- &.size--sm {font-size: math.round(0.9 * $base-font-size);}
96
- &.size--md {font-size: math.round(1.05 * $base-font-size);}
97
- &.size--lg {font-size: math.round(1.2 * $base-font-size);}
98
- &.size--xl {font-size: math.round(1.4 * $base-font-size);}
103
+ &.size--xs {font-size: round(nearest, calc(0.8 * var(--w-base-font-size)), 1px);}
104
+ &.size--sm {font-size: round(nearest, calc(0.9 * var(--w-base-font-size)), 1px);}
105
+ &.size--md {font-size: round(nearest, calc(1.05 * var(--w-base-font-size)), 1px);}
106
+ &.size--lg {font-size: round(nearest, calc(1.2 * var(--w-base-font-size)), 1px);}
107
+ &.size--xl {font-size: round(nearest, calc(1.4 * var(--w-base-font-size)), 1px);}
99
108
 
100
109
  &__separator {
101
- margin-left: $base-increment;
102
- margin-right: $base-increment;
110
+ margin-left: var(--w-base-increment);
111
+ margin-right: var(--w-base-increment);
103
112
  }
104
113
  }
105
114
  </style>
@@ -6,7 +6,8 @@ component.w-button(
6
6
  :class="classes"
7
7
  :disabled="!!disabled || null"
8
8
  v-bind="attrs"
9
- :style="styles")
9
+ :style="styles"
10
+ @pointerdown="onPointerDownRipple")
10
11
  w-icon(v-if="icon" v-bind="iconProps || {}") {{ icon }}
11
12
  slot(v-else)
12
13
  transition(name="scale-fade")
@@ -22,11 +23,15 @@ component.w-button(
22
23
  </template>
23
24
 
24
25
  <script>
26
+ import RippleMixin from '../../mixins/ripple'
27
+
25
28
  export default {
26
29
  // Fully handle the attrs and listeners manually for the case of a router link that has both a
27
30
  // route and onClick.
28
31
  inheritAttrs: false,
29
32
 
33
+ mixins: [RippleMixin],
34
+
30
35
  props: {
31
36
  color: { type: String },
32
37
  bgColor: { type: String },
@@ -67,6 +72,13 @@ export default {
67
72
 
68
73
  emits: [],
69
74
 
75
+ methods: {
76
+ onPointerDownRipple (e) {
77
+ if (this.disabled || this.loading || !this.rippleActive) return
78
+ this.onRipple(e)
79
+ }
80
+ },
81
+
70
82
  computed: {
71
83
  hasRouter () {
72
84
  return '$router' in this
@@ -112,6 +124,7 @@ export default {
112
124
  },
113
125
  classes () {
114
126
  return {
127
+ 'w-ripple': this.rippleActive,
115
128
  // If no color / bg color is set, set a primary color by default.
116
129
  'primary--bg': !this.bgColor && !this.color && !(this.outline || this.text),
117
130
  primary: !this.bgColor && !this.color && !this.dark && (this.outline || this.text),
@@ -145,8 +158,6 @@ export default {
145
158
  </script>
146
159
 
147
160
  <style lang="scss">
148
- @use "sass:math";
149
-
150
161
  $spinner-size: 40;
151
162
 
152
163
  .w-button {
@@ -154,11 +165,11 @@ $spinner-size: 40;
154
165
  display: inline-flex;
155
166
  flex-shrink: 0;
156
167
  outline: none;
157
- border-radius: $border-radius;
168
+ border-radius: var(--w-border-radius);
158
169
  background-color: rgba(0, 0, 0, 0.1);
159
170
  border: 1px solid rgba(0, 0, 0, 0.04);
160
- padding-left: 2 * $base-increment;
161
- padding-right: 2 * $base-increment;
171
+ padding-left: calc(var(--w-base-increment) * 2);
172
+ padding-right: calc(var(--w-base-increment) * 2);
162
173
  box-shadow: 0 0 0 transparent;
163
174
  vertical-align: middle;
164
175
  align-self: center;
@@ -173,7 +184,7 @@ $spinner-size: 40;
173
184
  z-index: 1;
174
185
  // Background-color must not transition to not affect the hover & focus states
175
186
  // in :before & :after.
176
- transition: all $transition-duration, background-color 0s, padding 0s;
187
+ transition: all var(--w-transition-duration), background-color 0s, padding 0s;
177
188
  -webkit-tap-highlight-color: transparent;
178
189
 
179
190
  @include themeable;
@@ -185,10 +196,10 @@ $spinner-size: 40;
185
196
  // Position.
186
197
  &--absolute {position: absolute;}
187
198
  &--fixed {position: fixed;}
188
- &--top {top: 2 * $base-increment;}
189
- &--bottom {bottom: 2 * $base-increment;}
190
- &--left {left: 2 * $base-increment;}
191
- &--right {right: 2 * $base-increment;}
199
+ &--top {top: calc(var(--w-base-increment) * 2);}
200
+ &--bottom {bottom: calc(var(--w-base-increment) * 2);}
201
+ &--left {left: calc(var(--w-base-increment) * 2);}
202
+ &--right {right: calc(var(--w-base-increment) * 2);}
192
203
 
193
204
  &--dark {
194
205
  color: rgba(255, 255, 255, 0.95);
@@ -204,8 +215,8 @@ $spinner-size: 40;
204
215
  }
205
216
  &--round {
206
217
  border-radius: 99em;
207
- padding-left: 3 * $base-increment;
208
- padding-right: 3 * $base-increment;
218
+ padding-left: calc(var(--w-base-increment) * 3);
219
+ padding-right: calc(var(--w-base-increment) * 3);
209
220
  }
210
221
  &--icon {
211
222
  aspect-ratio: 1;
@@ -214,7 +225,7 @@ $spinner-size: 40;
214
225
  min-width: 0; // Safari ratio fix (e.g. losing ratio if height is set and side padding are added).
215
226
  }
216
227
  &--tile {border-radius: initial;}
217
- &--shadow {box-shadow: $box-shadow;}
228
+ &--shadow {box-shadow: var(--w-box-shadow);}
218
229
  &--loading {cursor: wait;opacity: 0.8;}
219
230
  &[disabled] {
220
231
  cursor: not-allowed;
@@ -228,16 +239,16 @@ $spinner-size: 40;
228
239
  }
229
240
 
230
241
  // Sizes adjustments (always an even number for easier vertical alignments).
231
- &.size--xs {height: math.round(1.25 * divide($base-font-size, 2)) * 2;}
232
- &.size--sm {height: math.round(1.55 * divide($base-font-size, 2)) * 2;}
233
- &.size--md {height: math.round(1.85 * divide($base-font-size, 2)) * 2;}
234
- &.size--lg {height: math.round(2.2 * divide($base-font-size, 2)) * 2;}
235
- &.size--xl {height: math.round(2.5 * divide($base-font-size, 2)) * 2;}
242
+ &.size--xs {height: calc(2 * round(nearest, calc(1.25 * var(--w-base-font-size) / 2), 1px));}
243
+ &.size--sm {height: calc(2 * round(nearest, calc(1.55 * var(--w-base-font-size) / 2), 1px));}
244
+ &.size--md {height: calc(2 * round(nearest, calc(1.85 * var(--w-base-font-size) / 2), 1px));}
245
+ &.size--lg {height: calc(2 * round(nearest, calc(2.2 * var(--w-base-font-size) / 2), 1px));}
246
+ &.size--xl {height: calc(2 * round(nearest, calc(2.5 * var(--w-base-font-size) / 2), 1px));}
236
247
 
237
- &.size--xs {padding-left: $base-increment;padding-right: $base-increment;}
238
- &.size--xl {padding-left: 3 * $base-increment;padding-right: 3 * $base-increment;}
239
- &--round.size--xs {padding-left: math.round(1.5 * $base-increment);padding-right: math.round(1.5 * $base-increment);}
240
- &--round.size--xl {padding-left: math.round(4.5 * $base-increment);padding-right: math.round(4.5 * $base-increment);}
248
+ &.size--xs {padding-left: var(--w-base-increment);padding-right: var(--w-base-increment);}
249
+ &.size--xl {padding-left: calc(var(--w-base-increment) * 3);padding-right: calc(var(--w-base-increment) * 3);}
250
+ &--round.size--xs {padding-left: calc(var(--w-base-increment) * 1.5);padding-right: calc(var(--w-base-increment) * 1.5);}
251
+ &--round.size--xl {padding-left: calc(var(--w-base-increment) * 4.5);padding-right: calc(var(--w-base-increment) * 4.5);}
241
252
  &--icon.size--xs {padding-left: 0;padding-right: 0;}
242
253
  &--icon.size--xl {padding-left: 0;padding-right: 0;}
243
254
 
@@ -246,6 +257,7 @@ $spinner-size: 40;
246
257
  content: '';
247
258
  position: absolute;
248
259
  inset: 0;
260
+ z-index: 0;
249
261
  opacity: 0;
250
262
  background-color: #000;
251
263
  border-radius: inherit;
@@ -290,7 +302,7 @@ $spinner-size: 40;
290
302
  &:active {transform: scale(1.02);}
291
303
  &:active:before {
292
304
  opacity: 0.3;
293
- @include default-transition($fast-transition-duration);
305
+ @include default-transition(var(--w-transition-duration-fast));
294
306
  }
295
307
  &--dark:active:before, &.primary--bg:active:before {opacity: 0.35;}
296
308
 
@@ -1,9 +1,9 @@
1
1
  <template lang="pug">
2
2
  component(v-if="tooltip" is="w-tooltip" v-bind="tooltipProps")
3
- template(#activator="{ on }")
4
- button-partial(v-bind="buttonProps" v-on="on")
5
- slot
6
- div(v-html="tooltip")
3
+ button-partial(v-bind="buttonProps")
4
+ slot
5
+ template(#tooltip)
6
+ div(v-html="tooltip")
7
7
  button-partial(v-else v-bind="buttonProps")
8
8
  slot
9
9
  template(#loading)
@@ -53,7 +53,8 @@ export default {
53
53
  sm: { type: Boolean },
54
54
  md: { type: Boolean },
55
55
  lg: { type: Boolean },
56
- xl: { type: Boolean }
56
+ xl: { type: Boolean },
57
+ noRipple: { type: Boolean, default: undefined }
57
58
  },
58
59
 
59
60
  components: { ButtonPartial },
@@ -63,6 +63,7 @@ export default {
63
63
  imgProps () {
64
64
  return {
65
65
  tag: 'div',
66
+ maxWidth: '100%',
66
67
  ratio: 1 / 2,
67
68
  ...this.imageProps
68
69
  }
@@ -88,21 +89,21 @@ export default {
88
89
  position: relative;
89
90
  display: flex;
90
91
  flex-direction: column;
91
- border-radius: $border-radius;
92
- border: $border;
92
+ border-radius: var(--w-border-radius);
93
+ border: var(--w-border);
93
94
 
94
95
  @include themeable;
95
96
 
96
97
  &--tile {border-radius: 0;}
97
- &--shadow {box-shadow: $box-shadow;}
98
+ &--shadow {box-shadow: var(--w-box-shadow);}
98
99
  &--no-border, &--shadow {border: none;}
99
100
 
100
101
  &__title {
101
102
  display: flex;
102
103
  align-items: center;
103
- padding: (2 * $base-increment) (3 * $base-increment);
104
+ padding: calc(var(--w-base-increment) * 2) calc(var(--w-base-increment) * 3);
104
105
  font-size: 1.3em;
105
- border-bottom: $border;
106
+ border-bottom: var(--w-border);
106
107
  border-top-left-radius: inherit;
107
108
  border-top-right-radius: inherit;
108
109
 
@@ -117,7 +118,7 @@ export default {
117
118
  }
118
119
 
119
120
  &__content {
120
- padding: 3 * $base-increment;
121
+ padding: calc(var(--w-base-increment) * 3);
121
122
  flex-grow: 1;
122
123
 
123
124
  // Only if there is no title bar.
@@ -134,7 +135,7 @@ export default {
134
135
 
135
136
  &__actions {
136
137
  display: flex;
137
- padding: (2 * $base-increment) (3 * $base-increment) (3 * $base-increment);
138
+ padding: calc(var(--w-base-increment) * 2) calc(var(--w-base-increment) * 3) calc(var(--w-base-increment) * 3);
138
139
  border-bottom-left-radius: inherit;
139
140
  border-bottom-right-radius: inherit;
140
141
 
@@ -75,6 +75,12 @@ export default {
75
75
  noRipple: { type: Boolean },
76
76
  indeterminate: { type: Boolean },
77
77
  round: { type: Boolean },
78
+ // Sizes.
79
+ xs: { type: Boolean },
80
+ sm: { type: Boolean },
81
+ md: { type: Boolean },
82
+ lg: { type: Boolean },
83
+ xl: { type: Boolean },
78
84
  dark: { type: Boolean },
79
85
  light: { type: Boolean }
80
86
  // Props from mixin: id, name, disabled, readonly, required, tabindex, validators.
@@ -98,6 +104,10 @@ export default {
98
104
  hasLabel () {
99
105
  return this.label || this.$slots.default
100
106
  },
107
+ presetSize () {
108
+ return (this.xs && 'xs') || (this.sm && 'sm') || (this.md && 'md') || (this.lg && 'lg') || (this.xl && 'xl') || null
109
+ },
110
+
101
111
  classes () {
102
112
  return {
103
113
  [`w-checkbox w-checkbox--${this.isChecked ? 'checked' : 'unchecked'}`]: true,
@@ -108,7 +118,8 @@ export default {
108
118
  'w-checkbox--rippled': this.ripple.end,
109
119
  'w-checkbox--round': this.round,
110
120
  'w-checkbox--dark': this.dark,
111
- 'w-checkbox--light': this.light
121
+ 'w-checkbox--light': this.light,
122
+ [`size--${this.presetSize}`]: !!this.presetSize
112
123
  }
113
124
  }
114
125
  },
@@ -150,6 +161,8 @@ $outline-width: 2px;
150
161
  $inactive-color: #666;
151
162
 
152
163
  .w-checkbox {
164
+ // --_size resolves --w-size if set (e.g. via size class or inline style), otherwise the global default.
165
+ --_size: var(--w-size, var(--w-small-form-el-size));
153
166
  display: inline-flex;
154
167
  align-items: center;
155
168
  vertical-align: middle;
@@ -170,7 +183,7 @@ $inactive-color: #666;
170
183
  // The fake checkbox to substitute.
171
184
  &__input {
172
185
  position: relative;
173
- width: $small-form-el-size;
186
+ width: var(--_size);
174
187
  aspect-ratio: 1;
175
188
  display: flex;
176
189
  flex: 0 0 auto; // Prevent stretching width or height.
@@ -188,12 +201,12 @@ $inactive-color: #666;
188
201
  aspect-ratio: 1;
189
202
  fill: none;
190
203
  stroke-width: 2;
191
- stroke: $contrast-color;
204
+ stroke: var(--w-contrast-color);
192
205
  stroke-linecap: round;
193
206
  stroke-linejoin: round;
194
207
  stroke-dasharray: 16px;
195
208
  stroke-dashoffset: 16px;
196
- transition: $transition-duration ease-out;
209
+ transition: var(--w-transition-duration) ease-out;
197
210
  opacity: 0;
198
211
  position: relative;
199
212
  z-index: 1;
@@ -214,25 +227,25 @@ $inactive-color: #666;
214
227
  width: 100%;
215
228
  aspect-ratio: 1;
216
229
  border: $outline-width solid $inactive-color;
217
- border-radius: $border-radius;
218
- transition: $transition-duration ease-in-out;
230
+ border-radius: var(--w-border-radius);
231
+ transition: var(--w-transition-duration) ease-in-out;
219
232
 
220
233
  .w-checkbox--round & {border-radius: 100%;}
221
- .w-checkbox--disabled & {border-color: $disabled-color;}
234
+ .w-checkbox--disabled & {border-color: var(--w-disabled-color);}
222
235
 
223
236
  // Checked state.
224
237
  :checked ~ & {
225
- border-width: divide($small-form-el-size, 2);
238
+ border-width: calc(var(--_size) / 2);
226
239
  border-color: currentColor;
227
240
  // Prevents a tiny hole while animating and in some browser zoom levels.
228
241
  background-color: currentColor;
229
242
  }
230
243
  .w-checkbox--indeterminate :checked ~ & {
231
- border-width: ((divide($small-form-el-size, 2)) - 1px) 3px;
232
- background-color: $contrast-color;
244
+ border-width: calc(var(--_size) / 2 - 1px) 3px;
245
+ background-color: var(--w-contrast-color);
233
246
  }
234
247
  .w-checkbox--disabled :checked ~ & {
235
- border-color: $disabled-color;
248
+ border-color: var(--w-disabled-color);
236
249
  // Prevents a tiny hole while animating and in some browser zoom levels.
237
250
  background-color: color-mix(in srgb, var(--w-contrast-color) 40%, transparent);
238
251
  }
@@ -282,6 +295,13 @@ $inactive-color: #666;
282
295
  opacity: 0.7;
283
296
  }
284
297
  }
298
+
299
+ // Sizes.
300
+ // ------------------------------------------------------
301
+ &.size--xs {--w-size: round(nearest, calc(0.86 * var(--w-base-font-size)), 2px);}
302
+ &.size--sm {--w-size: round(nearest, calc(1.14 * var(--w-base-font-size)), 2px);}
303
+ &.size--lg {--w-size: round(nearest, calc(1.43 * var(--w-base-font-size)), 2px);}
304
+ &.size--xl {--w-size: round(nearest, calc(1.71 * var(--w-base-font-size)), 2px);}
285
305
  }
286
306
 
287
307
  @keyframes w-checkbox-ripple {
@@ -54,7 +54,13 @@ export default {
54
54
  inline: { type: Boolean },
55
55
  round: { type: Boolean },
56
56
  color: { type: String, default: 'primary' },
57
- labelColor: { type: String, default: 'primary' }
57
+ labelColor: { type: String, default: 'primary' },
58
+ // Sizes.
59
+ xs: { type: Boolean },
60
+ sm: { type: Boolean },
61
+ md: { type: Boolean },
62
+ lg: { type: Boolean },
63
+ xl: { type: Boolean }
58
64
  // Props from mixin: id, name, disabled, readonly, required, validators.
59
65
  // Computed from mixin: inputName, isDisabled & isReadonly.
60
66
  },
@@ -84,10 +90,15 @@ export default {
84
90
  })
85
91
  },
86
92
 
93
+ presetSize () {
94
+ return (this.xs && 'xs') || (this.sm && 'sm') || (this.md && 'md') || (this.lg && 'lg') || (this.xl && 'xl') || null
95
+ },
96
+
87
97
  classes () {
88
98
  return [
89
99
  'w-checkboxes',
90
- `w-checkboxes--${this.inline ? 'inline' : 'column'}`
100
+ `w-checkboxes--${this.inline ? 'inline' : 'column'}`,
101
+ this.presetSize && `size--${this.presetSize}`
91
102
  ]
92
103
  }
93
104
  },
@@ -128,8 +139,15 @@ export default {
128
139
  flex-wrap: wrap;
129
140
  vertical-align: middle;
130
141
 
131
- .w-checkbox {margin-right: 3 * $base-increment;}
142
+ .w-checkbox {margin-right: calc(var(--w-base-increment) * 3);}
132
143
  .w-checkbox:last-child {margin-right: 0;}
133
144
  }
145
+
146
+ // Sizes (cascades --w-small-form-el-size to child w-checkbox elements).
147
+ // ------------------------------------------------------
148
+ &.size--xs {--w-size: round(nearest, calc(0.86 * var(--w-base-font-size)), 2px);}
149
+ &.size--sm {--w-size: round(nearest, calc(1.14 * var(--w-base-font-size)), 2px);}
150
+ &.size--lg {--w-size: round(nearest, calc(1.43 * var(--w-base-font-size)), 2px);}
151
+ &.size--xl {--w-size: round(nearest, calc(1.71 * var(--w-base-font-size)), 2px);}
134
152
  }
135
153
  </style>