wave-ui 3.28.0 → 4.0.1

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 (93) hide show
  1. package/dist/.nojekyll +0 -0
  2. package/dist/types/types/$waveui.d.ts +15 -1
  3. package/dist/types/types/colors.d.ts +2 -0
  4. package/dist/types/types/components/WAccordion.d.ts +92 -6
  5. package/dist/types/types/components/WAutocomplete.d.ts +437 -0
  6. package/dist/types/types/components/WCheckbox.d.ts +34 -0
  7. package/dist/types/types/components/WCheckboxes.d.ts +30 -0
  8. package/dist/types/types/components/WInput.d.ts +34 -0
  9. package/dist/types/types/components/WMenu.d.ts +14 -7
  10. package/dist/types/types/components/WRadio.d.ts +34 -0
  11. package/dist/types/types/components/WRadios.d.ts +30 -0
  12. package/dist/types/types/components/WSelect.d.ts +34 -0
  13. package/dist/types/types/components/WSwitch.d.ts +34 -0
  14. package/dist/types/types/components/WTable.d.ts +7 -0
  15. package/dist/types/types/components/WTooltip.d.ts +22 -8
  16. package/dist/types/types/components/WTransitions.d.ts +104 -0
  17. package/dist/types/types/components/WTransitions.js +2 -0
  18. package/dist/types/types/components/WTree.d.ts +7 -0
  19. package/dist/types/types/components/index.d.ts +2 -1
  20. package/dist/types/types/index.d.ts +1 -0
  21. package/dist/types/types/mixins/detachable.d.ts +7 -0
  22. package/dist/types/types/mixins/detachable.js +2 -0
  23. package/dist/wave-ui.cjs.js +3 -3
  24. package/dist/wave-ui.css +1 -1
  25. package/dist/wave-ui.esm.js +1743 -1365
  26. package/dist/wave-ui.umd.js +3 -3
  27. package/package.json +1 -1
  28. package/src/wave-ui/components/index.js +0 -1
  29. package/src/wave-ui/components/transitions/w-transition-bounce.vue +2 -1
  30. package/src/wave-ui/components/transitions/w-transition-expand.vue +3 -2
  31. package/src/wave-ui/components/transitions/w-transition-fade.vue +2 -1
  32. package/src/wave-ui/components/transitions/w-transition-scale-fade.vue +2 -1
  33. package/src/wave-ui/components/transitions/w-transition-scale.vue +2 -1
  34. package/src/wave-ui/components/transitions/w-transition-slide-fade.vue +2 -1
  35. package/src/wave-ui/components/transitions/w-transition-slide.vue +2 -1
  36. package/src/wave-ui/components/transitions/w-transition-twist.vue +2 -1
  37. package/src/wave-ui/components/w-accordion/index.vue +10 -5
  38. package/src/wave-ui/components/w-accordion/item.vue +29 -14
  39. package/src/wave-ui/components/w-alert.vue +27 -29
  40. package/src/wave-ui/components/w-autocomplete.vue +626 -192
  41. package/src/wave-ui/components/w-badge.vue +54 -53
  42. package/src/wave-ui/components/w-breadcrumbs.vue +7 -9
  43. package/src/wave-ui/components/w-button/button.vue +21 -23
  44. package/src/wave-ui/components/w-button/index.vue +4 -4
  45. package/src/wave-ui/components/w-card.vue +8 -7
  46. package/src/wave-ui/components/w-checkbox.vue +31 -11
  47. package/src/wave-ui/components/w-checkboxes.vue +21 -3
  48. package/src/wave-ui/components/w-confirm.vue +22 -22
  49. package/src/wave-ui/components/w-dialog.vue +1 -1
  50. package/src/wave-ui/components/w-divider.vue +5 -5
  51. package/src/wave-ui/components/w-drawer.vue +3 -3
  52. package/src/wave-ui/components/w-form-element.vue +2 -2
  53. package/src/wave-ui/components/w-icon.vue +12 -14
  54. package/src/wave-ui/components/w-image.vue +1 -1
  55. package/src/wave-ui/components/w-input.vue +43 -25
  56. package/src/wave-ui/components/w-list.vue +11 -12
  57. package/src/wave-ui/components/w-menu.vue +57 -55
  58. package/src/wave-ui/components/w-notification.vue +4 -4
  59. package/src/wave-ui/components/w-progress.vue +6 -7
  60. package/src/wave-ui/components/w-radio.vue +32 -7
  61. package/src/wave-ui/components/w-radios.vue +28 -3
  62. package/src/wave-ui/components/w-rating.vue +7 -9
  63. package/src/wave-ui/components/w-scrollable.vue +4 -4
  64. package/src/wave-ui/components/w-select.vue +119 -101
  65. package/src/wave-ui/components/w-slider.vue +26 -26
  66. package/src/wave-ui/components/w-spinner.vue +5 -7
  67. package/src/wave-ui/components/w-switch.vue +71 -47
  68. package/src/wave-ui/components/w-table.vue +69 -36
  69. package/src/wave-ui/components/w-tabs/index.vue +21 -24
  70. package/src/wave-ui/components/w-tag.vue +35 -38
  71. package/src/wave-ui/components/w-textarea.vue +22 -22
  72. package/src/wave-ui/components/w-timeline.vue +6 -6
  73. package/src/wave-ui/components/w-toolbar.vue +8 -8
  74. package/src/wave-ui/components/w-tooltip.vue +30 -25
  75. package/src/wave-ui/components/w-tree.vue +35 -16
  76. package/src/wave-ui/core.js +9 -1
  77. package/src/wave-ui/mixins/detachable.js +118 -55
  78. package/src/wave-ui/mixins/ripple.js +2 -2
  79. package/src/wave-ui/scss/_base.scss +82 -17
  80. package/src/wave-ui/scss/_colors.scss +6 -75
  81. package/src/wave-ui/scss/_layout.scss +39 -47
  82. package/src/wave-ui/scss/_ripple.scss +2 -2
  83. package/src/wave-ui/scss/_transitions.scss +19 -19
  84. package/src/wave-ui/scss/_typography.scss +8 -9
  85. package/src/wave-ui/scss/variables/_mixins.scss +24 -25
  86. package/src/wave-ui/scss/variables/_variables.scss +4 -149
  87. package/src/wave-ui/utils/colors.js +7 -4
  88. package/src/wave-ui/utils/config.js +3 -4
  89. package/src/wave-ui/utils/dynamic-css.js +42 -20
  90. package/src/wave-ui/utils/ripple.js +3 -2
  91. package/dist/types/types/components/WApp.d.ts +0 -83
  92. package/src/wave-ui/components/w-app.vue +0 -24
  93. /package/dist/types/types/components/{WApp.js → WAutocomplete.js} +0 -0
@@ -37,13 +37,14 @@ component(
37
37
  :class="inputClasses")
38
38
  .w-switch__track(v-if="$slots.track")
39
39
  slot(name="track")
40
- .w-switch__thumb(v-if="$slots.thumb || loading")
41
- w-progress(
42
- v-if="loading"
43
- circle
44
- color="inherit"
45
- v-bind="typeof loading === 'number' && { 'model-value': loading }")
46
- slot(v-else name="thumb")
40
+ .w-switch__thumb
41
+ .w-switch__thumb-content
42
+ w-progress(
43
+ v-if="loading"
44
+ circle
45
+ color="inherit"
46
+ v-bind="typeof loading === 'number' && { 'model-value': loading }")
47
+ slot(v-else-if="$slots.thumb" name="thumb")
47
48
  template(v-if="hasLabel && !labelOnLeft")
48
49
  label.w-switch__label.w-switch__label--right.w-form-el-shakable(
49
50
  v-if="$slots.default || label"
@@ -73,6 +74,12 @@ export default {
73
74
  thin: { type: Boolean },
74
75
  noRipple: { type: Boolean },
75
76
  loading: { type: [Boolean, Number], default: false },
77
+ // Sizes.
78
+ xs: { type: Boolean },
79
+ sm: { type: Boolean },
80
+ md: { type: Boolean },
81
+ lg: { type: Boolean },
82
+ xl: { type: Boolean },
76
83
  dark: { type: Boolean },
77
84
  light: { type: Boolean }
78
85
  // Props from mixin: id, name, disabled, readonly, required, tabindex, validators.
@@ -103,6 +110,10 @@ export default {
103
110
  hasLabel () {
104
111
  return this.label || this.$slots.default
105
112
  },
113
+ presetSize () {
114
+ return (this.xs && 'xs') || (this.sm && 'sm') || (this.md && 'md') || (this.lg && 'lg') || (this.xl && 'xl') || null
115
+ },
116
+
106
117
  classes () {
107
118
  return {
108
119
  [`w-switch w-switch--${this.isOn ? 'on' : 'off'}`]: true,
@@ -116,6 +127,7 @@ export default {
116
127
  'w-switch--rippled': this.ripple.end,
117
128
  'w-switch--dark': this.dark,
118
129
  'w-switch--light': this.light,
130
+ [`size--${this.presetSize}`]: !!this.presetSize,
119
131
  // With the inheritAttrs set to false any class on the component would be lost, so add it back.
120
132
  [this.$attrs.class]: !!this.$attrs.class
121
133
  }
@@ -161,11 +173,11 @@ export default {
161
173
  </script>
162
174
 
163
175
  <style lang="scss">
164
- @use "sass:math";
165
-
166
176
  $outline-width: 2px;
167
177
 
168
178
  .w-switch {
179
+ // --_size resolves --w-size if set (e.g. via size class or inline style), otherwise the global default.
180
+ --_size: var(--w-size, var(--w-small-form-el-size));
169
181
  display: inline-flex;
170
182
  align-items: center;
171
183
  vertical-align: middle;
@@ -191,15 +203,15 @@ $outline-width: 2px;
191
203
  // Switch.
192
204
  &__input {
193
205
  position: relative;
194
- width: 2 * ($small-form-el-size + $outline-width);
195
- height: $small-form-el-size + (2 * $outline-width);
206
+ width: calc(2 * (var(--_size) + #{$outline-width}));
207
+ height: calc(var(--_size) + (2 * #{$outline-width}));
196
208
  display: flex;
197
209
  flex: 0 0 auto; // Prevent stretching width or height.
198
210
  align-items: center;
199
211
  justify-content: center;
200
212
  border: $outline-width solid transparent;
201
213
  border-radius: 3em;
202
- background-color: $switch-inactive-color;
214
+ background-color: var(--w-switch-inactive-color);
203
215
  cursor: inherit;
204
216
  @include default-transition;
205
217
 
@@ -215,13 +227,13 @@ $outline-width: 2px;
215
227
  .w-switch--thin & {
216
228
  box-sizing: border-box;
217
229
  border: none;
218
- width: 2 * $small-form-el-size;
219
- height: math.round(0.7 * $small-form-el-size);
230
+ width: calc(2 * var(--_size));
231
+ height: round(nearest, calc(0.7 * var(--_size)), 1px);
220
232
  }
221
- .w-switch--thin :checked ~ & {background-color: $switch-inactive-color;}
233
+ .w-switch--thin :checked ~ & {background-color: var(--w-switch-inactive-color);}
222
234
 
223
235
  // Disabled.
224
- .w-switch--disabled & {color: $disabled-color;}
236
+ .w-switch--disabled & {color: var(--w-disabled-color);}
225
237
  .w-switch--disabled :checked ~ & {opacity: 0.5;}
226
238
  }
227
239
 
@@ -238,76 +250,72 @@ $outline-width: 2px;
238
250
  }
239
251
  .w-switch--on &__track {left: 0;transform: translateX(0);}
240
252
 
241
- // Thumb: show either the thumb slot if any, or :after otherwise.
242
- &__thumb, &__input:after {
243
- content: '';
253
+ // Thumb.
254
+ &__thumb {
244
255
  position: absolute;
245
256
  left: 0;
246
- width: $small-form-el-size;
247
- height: $small-form-el-size;
257
+ top: 50%;
258
+ width: calc(100% - var(--_size));
259
+ height: var(--_size);
260
+ transform: translateX(0) translateY(-50%);
261
+ @include default-transition;
262
+ }
263
+ .w-switch--on &__thumb {transform: translateX(100%) translateY(-50%);}
264
+
265
+ &__thumb-content {
266
+ position: relative;
267
+ isolation: isolate;
268
+ width: var(--_size);
269
+ height: var(--_size);
248
270
  display: flex;
249
271
  align-items: center;
250
272
  justify-content: center; // Center any content that could be put via slots.
251
- background-color: $switch-thumb-color;
273
+ background-color: var(--w-switch-thumb-color);
252
274
  border-radius: 100%;
253
- @include default-transition;
254
275
 
255
276
  .w-switch[class^="bdrs"] &, .w-switch[class*=" bdrs"] & {border-radius: inherit;}
256
277
 
257
- .w-switch--on & {left: 100%;transform: translateX(-100%);}
258
-
259
278
  .w-switch--thin & {
260
- top: - math.round(0.15 * $small-form-el-size);
261
279
  transform: scale(1.1);
262
- box-shadow: $box-shadow;
280
+ box-shadow: var(--w-box-shadow);
263
281
  }
264
282
  .w-switch--thin.w-switch--on & {
265
- transform: translateX(-100%) scale(1.1);
266
283
  background-color: currentColor;
267
284
  }
268
285
  }
269
286
  &--loading .w-progress {padding: 1px;}
270
287
  &--loading.w-switch--thin.w-switch--on .w-progress {color: #fff;}
271
- &--loading &__input:after, &--custom-thumb &__input:after {display: none;}
272
288
 
273
289
  // The focus outline & ripple on switch activation.
274
- &__input:before {
290
+ &__thumb-content:before {
275
291
  content: '';
276
292
  position: absolute;
277
- left: 0;
278
- top: 0;
279
- width: $small-form-el-size;
280
- aspect-ratio: 1;
293
+ inset: 0;
281
294
  background-color: currentColor;
282
295
  border-radius: 100%;
283
296
  opacity: 0;
284
297
  pointer-events: none;
298
+ z-index: -1;
285
299
  transition: 0.25s ease-in-out;
286
300
 
287
- :checked ~ & {transform: translateX(-100%) scale(0);left: 100%;}
288
-
289
301
  .w-switch[class^="bdrs"] &, .w-switch[class*=" bdrs"] & {border-radius: inherit;}
290
- .w-switch--thin & {top: - math.round(0.15 * $small-form-el-size);}
291
302
  }
292
303
 
293
- &--ripple &__input:before {
304
+ &--ripple &__thumb-content:before {
294
305
  background-color: transparent;
295
306
  animation: w-switch-ripple 0.55s 0.15s ease;
296
307
  }
297
308
 
298
- :focus ~ &__input:before {
299
- transform: translateX(0) scale(1.8);
309
+ :focus ~ &__input &__thumb-content:before {
310
+ transform: scale(1.8);
300
311
  opacity: 0.2;
301
312
  }
302
- :focus:checked ~ &__input:before {
303
- transform: translateX(-100%) scale(1.8);
304
- }
305
313
 
306
314
  // After ripple reset to default state, then remove the class via js and the
307
315
  // `:focus ~ &__input:before` will re-transition to normal focused outline.
308
- &--rippled &__input:before {
316
+ &--rippled &__thumb-content:before {
309
317
  transition: none;
310
- transform: translateX(-100%) scale(0);
318
+ transform: scale(0);
311
319
  opacity: 0;
312
320
  }
313
321
 
@@ -319,10 +327,26 @@ $outline-width: 2px;
319
327
 
320
328
  .w-switch--disabled & {opacity: 0.5;}
321
329
  }
330
+
331
+ // Sizes.
332
+ // ------------------------------------------------------
333
+ &.size--xs {--w-size: round(nearest, calc(0.86 * var(--w-base-font-size)), 2px);}
334
+ &.size--sm {--w-size: round(nearest, calc(1.14 * var(--w-base-font-size)), 2px);}
335
+ &.size--lg {--w-size: round(nearest, calc(1.43 * var(--w-base-font-size)), 2px);}
336
+ &.size--xl {--w-size: round(nearest, calc(1.71 * var(--w-base-font-size)), 2px);}
322
337
  }
323
338
 
324
339
  @keyframes w-switch-ripple {
325
- 0% {opacity: 0.8;transform: translateX(-100%) scale(1);background-color: currentColor;} // Start with visible ripple.
326
- 100% {opacity: 0;transform: translateX(-100%) scale(2.8);} // Propagate ripple to max radius and fade out.
340
+ // Start with visible ripple.
341
+ 0% {
342
+ opacity: 0.8;
343
+ transform: scale(1);
344
+ background-color: currentColor;
345
+ }
346
+ // Propagate ripple to max radius and fade out.
347
+ 100% {
348
+ opacity: 0;
349
+ transform: scale(2.8);
350
+ }
327
351
  }
328
352
  </style>
@@ -19,6 +19,7 @@
19
19
  v-for="(header, i) in headers"
20
20
  :key="i"
21
21
  @click="!colResizing.dragging && header.sortable !== false && sortTable(header)"
22
+ @pointerdown="onHeaderPointerDown($event, header)"
22
23
  :class="headerClasses(header)")
23
24
  w-icon.w-table__header-sort(
24
25
  v-if="header.sortable !== false && header.align === 'right'"
@@ -73,13 +74,14 @@
73
74
  tr.w-table__row(
74
75
  v-else
75
76
  @click="doSelectRow(item, i)"
77
+ @pointerdown="onRowPointerDown"
76
78
  :class="{ 'w-table__row--selected': selectedRowsByUid[item._uid] !== undefined, 'w-table__row--expanded': expandedRowsByUid[item._uid] !== undefined, [item.class]: item.class }")
77
79
  template(v-for="(header, j) in headers")
78
80
  td.w-table__cell(
79
81
  v-if="$slots[`item-cell.${header.key}`] || $slots[`item-cell.${j + 1}`] || $slots['item-cell']"
80
82
  :key="`${j}-a`"
81
83
  :data-label="header.label"
82
- :class="{ [`text-${header.align || 'left'}`]: true, 'w-table__cell--sticky': header.sticky }")
84
+ :class="cellClasses(header)")
83
85
  slot(
84
86
  v-if="$slots[`item-cell.${header.key}`]"
85
87
  :name="`item-cell.${header.key}`"
@@ -109,7 +111,7 @@
109
111
  v-else
110
112
  :key="`${j}-b`"
111
113
  :data-label="header.label"
112
- :class="{ [`text-${header.align || 'left'}`]: true, 'w-table__cell--sticky': header.sticky }")
114
+ :class="cellClasses(header)")
113
115
  div(v-html="item[header.key] || ''")
114
116
  span.w-table__col-resizer(
115
117
  v-if="j < headers.length - 1 && resizableColumns"
@@ -194,6 +196,7 @@
194
196
  * @todo: (Column Resizing) Recalc. on browser resize.
195
197
  */
196
198
 
199
+ import RippleMixin from '../mixins/ripple'
197
200
  import { consoleError } from '../utils/console'
198
201
 
199
202
  // When column resizing is on, this is the minimum cell width that we can resize to.
@@ -201,6 +204,9 @@ const minColumnWidth = 15
201
204
 
202
205
  export default {
203
206
  name: 'w-table',
207
+
208
+ mixins: [RippleMixin],
209
+
204
210
  props: {
205
211
  items: { type: Array, required: true },
206
212
  headers: { type: Array, required: true },
@@ -383,6 +389,10 @@ export default {
383
389
  return this.headers.find(header => header.sticky)
384
390
  },
385
391
 
392
+ hasClickableRows () {
393
+ return this.expandableRows === '' || !!this.expandableRows || this.selectableRows === '' || !!this.selectableRows
394
+ },
395
+
386
396
  // Faster lookup than array.includes(uid) and also cached.
387
397
  selectedRowsByUid () {
388
398
  return this.selectedRowsInternal.reduce((obj, uid) => (obj[uid] = true) && obj, {})
@@ -397,6 +407,7 @@ export default {
397
407
  methods: {
398
408
  headerClasses (header) {
399
409
  return {
410
+ 'w-ripple': this.rippleActive && header.sortable !== false,
400
411
  'w-table__header--sortable': header.sortable !== false, // Can also be falsy with `0`.
401
412
  'w-table__header--sticky': header.sticky,
402
413
  'w-table__header--resizable': !!this.resizableColumns,
@@ -404,6 +415,14 @@ export default {
404
415
  }
405
416
  },
406
417
 
418
+ cellClasses (header) {
419
+ return {
420
+ 'w-ripple': this.rippleActive && this.hasClickableRows,
421
+ [`text-${header.align || 'left'}`]: true,
422
+ 'w-table__cell--sticky': header.sticky
423
+ }
424
+ },
425
+
407
426
  headerSortClasses (header) {
408
427
  const headerSorting = this.activeSortingKeys[header.key]
409
428
  return [
@@ -426,6 +445,20 @@ export default {
426
445
  else if (typeof this.fetch === 'function') await this.callApiFetch()
427
446
  },
428
447
 
448
+ onHeaderPointerDown (e, header) {
449
+ if (header.sortable === false || e.target.closest?.('.w-table__col-resizer')) return
450
+ this.onRipple(e)
451
+ },
452
+
453
+ onRowPointerDown (e) {
454
+ if (!this.hasClickableRows || e.target.closest?.('.w-table__col-resizer')) return
455
+ const row = e.currentTarget
456
+ const rowRect = row.getBoundingClientRect()
457
+ row.querySelectorAll(':scope > .w-table__cell').forEach(cell => {
458
+ this.onRipple(e, cell, { sizeRect: rowRect })
459
+ })
460
+ },
461
+
429
462
  doSelectRow (item, index) {
430
463
  const expandable = this.expandableRows === '' ? true : this.expandableRows
431
464
  const selectable = this.selectableRows === '' ? true : this.selectableRows
@@ -730,8 +763,8 @@ $tr-border-top: 1px;
730
763
  position: relative;
731
764
  display: flex;
732
765
  flex-direction: column;
733
- border-radius: $border-radius;
734
- border: $border;
766
+ border-radius: var(--w-border-radius);
767
+ border: var(--w-border);
735
768
 
736
769
  &--loading {overflow: hidden;}
737
770
 
@@ -767,7 +800,7 @@ $tr-border-top: 1px;
767
800
  // ------------------------------------------------------
768
801
  thead {position: relative;}
769
802
 
770
- &__header {padding: $base-increment;}
803
+ &__header {padding: var(--w-base-increment);}
771
804
  &__header--resizable {
772
805
  overflow: hidden;
773
806
  white-space: nowrap;
@@ -777,7 +810,7 @@ $tr-border-top: 1px;
777
810
  &--fixed-header thead {
778
811
  position: sticky;
779
812
  top: 0;
780
- background-color: $base-bg-color;
813
+ background-color: var(--w-base-bg-color);
781
814
  z-index: 1; // For sticky columns to go under.
782
815
 
783
816
  &:after {
@@ -786,7 +819,7 @@ $tr-border-top: 1px;
786
819
  bottom: 0;
787
820
  left: 0;
788
821
  right: 0;
789
- border-bottom: $border;
822
+ border-bottom: var(--w-border);
790
823
  }
791
824
  }
792
825
 
@@ -799,7 +832,7 @@ $tr-border-top: 1px;
799
832
  position: absolute;
800
833
  inset: 0;
801
834
  z-index: -1;
802
- background-color: $base-bg-color;
835
+ background-color: var(--w-base-bg-color);
803
836
  }
804
837
  }
805
838
 
@@ -831,7 +864,7 @@ $tr-border-top: 1px;
831
864
 
832
865
  &:before {
833
866
  content: '';
834
- border-right: $border;
867
+ border-right: var(--w-border);
835
868
  position: absolute;
836
869
  left: 50%;
837
870
  top: 0;
@@ -860,19 +893,19 @@ $tr-border-top: 1px;
860
893
  justify-content: center;
861
894
  height: 100%;
862
895
  width: 100%;
863
- padding-top: 2 * $base-increment;
864
- padding-bottom: 2 * $base-increment;
896
+ padding-top: calc(var(--w-base-increment) * 2);
897
+ padding-bottom: calc(var(--w-base-increment) * 2);
865
898
  }
866
899
 
867
900
  // Table body.
868
901
  // ------------------------------------------------------
869
- tbody {transition: opacity $transition-duration;}
902
+ tbody {transition: opacity var(--w-transition-duration);}
870
903
  &--loading-in-header tbody {opacity: 0.6;}
871
904
 
872
905
  tbody tr {border-top: $tr-border-top solid color-mix(in srgb, var(--w-base-color) 6%, transparent);}
873
906
  // Don't apply built-in bg color if a bg color is already found on a tr.
874
- tbody tr:nth-child(odd):not(.no-data):not([class*="--bg"]) {background-color: $table-tr-odd-color;}
875
- tbody .w-table__row:hover:not(.no-data):not([class*="--bg"]) {background-color: $table-tr-hover-color;}
907
+ tbody tr:nth-child(odd):not(.no-data):not([class*="--bg"]) {background-color: var(--w-table-tr-odd-color);}
908
+ tbody .w-table__row:hover:not(.no-data):not([class*="--bg"]) {background-color: var(--w-table-tr-hover-color);}
876
909
 
877
910
  &__row--selected td {position: relative;}
878
911
  &__row--selected td:before {
@@ -884,9 +917,9 @@ $tr-border-top: 1px;
884
917
  pointer-events: none;
885
918
  }
886
919
 
887
- &__cell {padding: math.round(divide($base-increment, 2)) $base-increment;}
888
- &__header:first-child, &__cell:first-child {padding-left: 2 * $base-increment;}
889
- &__header:last-child, &__cell:last-child {padding-right: 2 * $base-increment;}
920
+ &__cell {padding: calc(var(--w-base-increment) / 2) var(--w-base-increment);}
921
+ &__header:first-child, &__cell:first-child {padding-left: calc(var(--w-base-increment) * 2);}
922
+ &__header:last-child, &__cell:last-child {padding-right: calc(var(--w-base-increment) * 2);}
890
923
 
891
924
  &--resizable-cols &__cell {
892
925
  position: relative;
@@ -911,14 +944,14 @@ $tr-border-top: 1px;
911
944
  bottom: 0;
912
945
  z-index: -1;
913
946
  }
914
- &:before {background-color: $base-bg-color;}
947
+ &:before {background-color: var(--w-base-bg-color);}
915
948
  }
916
- tr:nth-child(odd) &__cell--sticky:after {background-color: $table-tr-odd-color;}
917
- tr:hover &__cell--sticky:after {background-color: $table-tr-hover-color;}
949
+ tr:nth-child(odd) &__cell--sticky:after {background-color: var(--w-table-tr-odd-color);}
950
+ tr:hover &__cell--sticky:after {background-color: var(--w-table-tr-hover-color);}
918
951
 
919
952
  .no-data &__cell {
920
953
  background-color: rgba(255, 255, 255, 0.2);
921
- padding: (2 * $base-increment) $base-increment;
954
+ padding: calc(var(--w-base-increment) * 2) var(--w-base-increment);
922
955
  }
923
956
 
924
957
  // Table footer.
@@ -926,7 +959,7 @@ $tr-border-top: 1px;
926
959
  &--fixed-footer tfoot {
927
960
  position: sticky;
928
961
  bottom: -1px;
929
- background-color: $base-bg-color;
962
+ background-color: var(--w-base-bg-color);
930
963
  z-index: 1; // For sticky columns to go under.
931
964
 
932
965
  &:after {
@@ -935,13 +968,13 @@ $tr-border-top: 1px;
935
968
  top: 0;
936
969
  left: 0;
937
970
  right: 0;
938
- border-top: $border;
971
+ border-top: var(--w-border);
939
972
  }
940
973
  }
941
974
 
942
975
  &__footer &__cell {
943
- padding-top: $base-increment;
944
- padding-bottom: $base-increment;
976
+ padding-top: var(--w-base-increment);
977
+ padding-bottom: var(--w-base-increment);
945
978
  }
946
979
 
947
980
  // Pagination.
@@ -950,8 +983,8 @@ $tr-border-top: 1px;
950
983
  display: flex;
951
984
  align-items: center;
952
985
  justify-content: flex-end;
953
- gap: 2 * $base-increment;
954
- padding: $base-increment 2 * $base-increment;
986
+ gap: calc(var(--w-base-increment) * 2);
987
+ padding: var(--w-base-increment) calc(var(--w-base-increment) * 2);
955
988
 
956
989
  .w-pagination__items-per-page {
957
990
  flex: 0 0 auto;
@@ -963,7 +996,7 @@ $tr-border-top: 1px;
963
996
  padding-left: 1px; // Prevent overflow causing scrollbar.
964
997
  padding-right: 1px;
965
998
  max-height: 4.5em;
966
- gap: 0.5 * $base-increment;
999
+ gap: calc(var(--w-base-increment) * 0.5);
967
1000
  overflow-y: hidden;
968
1001
  }
969
1002
 
@@ -976,20 +1009,20 @@ $tr-border-top: 1px;
976
1009
  background-color: color-mix(in srgb, var(--w-base-bg-color) 40%, transparent);
977
1010
 
978
1011
  &:hover:before {
979
- background-color: $primary;
1012
+ background-color: var(--w-primary-color);
980
1013
  opacity: 0.1;
981
1014
  }
982
1015
  &:active:before {
983
- background-color: $primary;
1016
+ background-color: var(--w-primary-color);
984
1017
  opacity: 0.2;
985
1018
  }
986
1019
 
987
1020
  &--active {
988
1021
  font-weight: bold;
989
- color: $primary;
1022
+ color: var(--w-primary-color);
990
1023
 
991
1024
  &:before {
992
- background-color: $primary;
1025
+ background-color: var(--w-primary-color);
993
1026
  opacity: 0.1;
994
1027
  }
995
1028
  }
@@ -1016,14 +1049,14 @@ $tr-border-top: 1px;
1016
1049
  display: flex;
1017
1050
  flex-direction: column;
1018
1051
  flex-grow: 1;
1019
- padding-top: $base-increment;
1020
- padding-bottom: $base-increment;
1052
+ padding-top: var(--w-base-increment);
1053
+ padding-bottom: var(--w-base-increment);
1021
1054
  }
1022
1055
 
1023
1056
  .w-table__cell {
1024
1057
  display: flex;
1025
- padding-left: 2 * $base-increment;
1026
- padding-right: 2 * $base-increment;
1058
+ padding-left: calc(var(--w-base-increment) * 2);
1059
+ padding-right: calc(var(--w-base-increment) * 2);
1027
1060
  }
1028
1061
 
1029
1062
  tr:not(.no-data) .text-center,
@@ -361,12 +361,10 @@ export default {
361
361
  </script>
362
362
 
363
363
  <style lang="scss">
364
- @use "sass:math";
365
-
366
364
  .w-tabs {
367
365
  z-index: 1;
368
- border-radius: $border-radius;
369
- border: $border;
366
+ border-radius: var(--w-border-radius);
367
+ border: var(--w-border);
370
368
  overflow: hidden;
371
369
 
372
370
  @include themeable;
@@ -382,13 +380,13 @@ export default {
382
380
 
383
381
  &--center {justify-content: center;}
384
382
  &--right {justify-content: flex-end;}
385
- .w-tabs--pill-slider & {padding-left: $base-increment;}
383
+ .w-tabs--pill-slider & {padding-left: var(--w-base-increment);}
386
384
 
387
385
  .w-tabs--card &:after {
388
386
  content: '';
389
387
  display: flex;
390
388
  flex-grow: 1;
391
- border-bottom: $border;
389
+ border-bottom: var(--w-border);
392
390
  align-self: flex-end;
393
391
  }
394
392
  }
@@ -399,18 +397,18 @@ export default {
399
397
  position: relative;
400
398
  display: flex;
401
399
  align-items: center;
402
- padding: (2 * $base-increment) (3 * $base-increment);
400
+ padding: calc(var(--w-base-increment) * 2) calc(var(--w-base-increment) * 3);
403
401
  justify-content: center;
404
- font-size: math.round(1.2 * $base-font-size);
405
- transition: $transition-duration ease-in-out, flex-grow 0s, flex 0s; // `flex` for Safari.
402
+ font-size: round(nearest, calc(1.2 * var(--w-base-font-size)), 1px);
403
+ transition: var(--w-transition-duration) ease-in-out, flex-grow 0s, flex 0s; // `flex` for Safari.
406
404
  user-select: none;
407
405
  cursor: pointer;
408
406
  -webkit-tap-highlight-color: transparent;
409
407
 
410
408
  .w-tabs--fill-bar & {flex-grow: 1;flex-basis: 0;}
411
409
  .w-tabs--card & {
412
- border: $border;
413
- border-radius: $border-radius $border-radius 0 0;
410
+ border: var(--w-border);
411
+ border-radius: var(--w-border-radius) var(--w-border-radius) 0 0;
414
412
  margin-right: -1px;
415
413
  }
416
414
  .w-tabs--card &--active {border-bottom-color: transparent;}
@@ -425,13 +423,12 @@ export default {
425
423
  content: '';
426
424
  position: absolute;
427
425
  inset: 0;
428
- background-color: currentColor;
429
- opacity: 0;
430
- transition: $fast-transition-duration;
426
+ background-color: transparent;
427
+ transition: background-color var(--w-transition-duration-fast);
431
428
  }
432
429
 
433
- &--active:before, &:focus:before, &:hover:before {opacity: 0.05;}
434
- &:active:before {opacity: 0.08;}
430
+ &--active:before, &:focus:before, &:hover:before {background-color: color-mix(in srgb, currentColor 5%, transparent);}
431
+ &:active:before {background-color: color-mix(in srgb, currentColor 8%, transparent);}
435
432
  &--disabled:before {display: none;}
436
433
  }
437
434
  &--pill-slider &__bar-item:before {display: none;}
@@ -455,7 +452,7 @@ export default {
455
452
  bottom: 0;
456
453
  height: 2px;
457
454
  background-color: currentColor;
458
- transition: $transition-duration ease-in-out;
455
+ transition: var(--w-transition-duration) ease-in-out;
459
456
  }
460
457
  &--pill-slider &__slider {
461
458
  opacity: 0.1;
@@ -473,12 +470,12 @@ export default {
473
470
  flex-grow: 1;
474
471
 
475
472
  .w-tabs--card & {
476
- border: $border;
473
+ border: var(--w-border);
477
474
  border-top: none;
478
- border-radius: 0 0 $border-radius $border-radius;
475
+ border-radius: 0 0 var(--w-border-radius) var(--w-border-radius);
479
476
  }
480
477
  }
481
- &__content {padding: 3 * $base-increment;}
478
+ &__content {padding: calc(var(--w-base-increment) * 3);}
482
479
  }
483
480
 
484
481
  .w-tabs-slide-left-leave-active,
@@ -490,8 +487,8 @@ export default {
490
487
  overflow: hidden;
491
488
  }
492
489
 
493
- .w-tabs-slide-left-enter-active {animation: w-tabs-slide-left-enter $transition-duration + 0.15s;}
494
- .w-tabs-slide-left-leave-active {animation: w-tabs-slide-left-leave $transition-duration + 0.15s;}
490
+ .w-tabs-slide-left-enter-active {animation: w-tabs-slide-left-enter calc(var(--w-transition-duration) + 0.15s);}
491
+ .w-tabs-slide-left-leave-active {animation: w-tabs-slide-left-leave calc(var(--w-transition-duration) + 0.15s);}
495
492
  @keyframes w-tabs-slide-left-enter {
496
493
  0% {transform: translateX(100%);}
497
494
  100% {transform: translateX(0);}
@@ -501,8 +498,8 @@ export default {
501
498
  100% {transform: translateX(-100%);}
502
499
  }
503
500
 
504
- .w-tabs-slide-right-enter-active {animation: w-tabs-slide-right-enter $transition-duration + 0.15s;}
505
- .w-tabs-slide-right-leave-active {animation: w-tabs-slide-right-leave $transition-duration + 0.15s;}
501
+ .w-tabs-slide-right-enter-active {animation: w-tabs-slide-right-enter calc(var(--w-transition-duration) + 0.15s);}
502
+ .w-tabs-slide-right-leave-active {animation: w-tabs-slide-right-leave calc(var(--w-transition-duration) + 0.15s);}
506
503
  @keyframes w-tabs-slide-right-enter {
507
504
  0% {transform: translateX(-100%);}
508
505
  100% {transform: translateX(0);}