@wordpress/dataviews 14.2.1-next.v.202605131032.0 → 15.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 (108) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/build/components/dataform-controls/date.cjs.map +3 -3
  3. package/build/components/dataform-controls/datetime.cjs.map +2 -2
  4. package/build/components/dataform-controls/email.cjs.map +3 -3
  5. package/build/components/dataform-controls/telephone.cjs.map +3 -3
  6. package/build/components/dataform-controls/url.cjs.map +3 -3
  7. package/build/components/dataform-layouts/panel/summary-button.cjs +18 -1
  8. package/build/components/dataform-layouts/panel/summary-button.cjs.map +3 -3
  9. package/build/components/dataform-layouts/panel/utils/get-label-content.cjs +17 -4
  10. package/build/components/dataform-layouts/panel/utils/get-label-content.cjs.map +3 -3
  11. package/build/components/dataviews-context/index.cjs.map +2 -2
  12. package/build/components/dataviews-filters/filter.cjs +86 -80
  13. package/build/components/dataviews-filters/filter.cjs.map +3 -3
  14. package/build/components/dataviews-filters/search-widget.cjs.map +3 -3
  15. package/build/components/dataviews-layouts/grid/composite-grid.cjs +10 -2
  16. package/build/components/dataviews-layouts/grid/composite-grid.cjs.map +2 -2
  17. package/build/components/dataviews-layouts/picker-table/index.cjs +8 -0
  18. package/build/components/dataviews-layouts/picker-table/index.cjs.map +2 -2
  19. package/build/components/dataviews-layouts/table/column-header-menu.cjs.map +3 -3
  20. package/build/components/dataviews-layouts/table/use-scroll-state.cjs.map +1 -1
  21. package/build/components/dataviews-layouts/utils/item-click-wrapper.cjs.map +2 -2
  22. package/build/components/dataviews-view-config/properties-section.cjs.map +3 -3
  23. package/build/hooks/use-form-validity.cjs.map +1 -1
  24. package/build-module/components/dataform-controls/date.mjs +2 -2
  25. package/build-module/components/dataform-controls/date.mjs.map +2 -2
  26. package/build-module/components/dataform-controls/datetime.mjs.map +2 -2
  27. package/build-module/components/dataform-controls/email.mjs +2 -2
  28. package/build-module/components/dataform-controls/email.mjs.map +2 -2
  29. package/build-module/components/dataform-controls/telephone.mjs +2 -2
  30. package/build-module/components/dataform-controls/telephone.mjs.map +2 -2
  31. package/build-module/components/dataform-controls/url.mjs +2 -2
  32. package/build-module/components/dataform-controls/url.mjs.map +2 -2
  33. package/build-module/components/dataform-layouts/panel/summary-button.mjs +19 -2
  34. package/build-module/components/dataform-layouts/panel/summary-button.mjs.map +2 -2
  35. package/build-module/components/dataform-layouts/panel/utils/get-label-content.mjs +18 -5
  36. package/build-module/components/dataform-layouts/panel/utils/get-label-content.mjs.map +2 -2
  37. package/build-module/components/dataviews-context/index.mjs.map +2 -2
  38. package/build-module/components/dataviews-filters/filter.mjs +88 -83
  39. package/build-module/components/dataviews-filters/filter.mjs.map +2 -2
  40. package/build-module/components/dataviews-filters/search-widget.mjs +3 -3
  41. package/build-module/components/dataviews-filters/search-widget.mjs.map +2 -2
  42. package/build-module/components/dataviews-layouts/grid/composite-grid.mjs +11 -4
  43. package/build-module/components/dataviews-layouts/grid/composite-grid.mjs.map +2 -2
  44. package/build-module/components/dataviews-layouts/picker-table/index.mjs +8 -0
  45. package/build-module/components/dataviews-layouts/picker-table/index.mjs.map +2 -2
  46. package/build-module/components/dataviews-layouts/table/column-header-menu.mjs +5 -5
  47. package/build-module/components/dataviews-layouts/table/column-header-menu.mjs.map +2 -2
  48. package/build-module/components/dataviews-layouts/table/use-scroll-state.mjs.map +1 -1
  49. package/build-module/components/dataviews-layouts/utils/item-click-wrapper.mjs.map +2 -2
  50. package/build-module/components/dataviews-view-config/properties-section.mjs +2 -2
  51. package/build-module/components/dataviews-view-config/properties-section.mjs.map +2 -2
  52. package/build-module/hooks/use-form-validity.mjs.map +1 -1
  53. package/build-style/style-rtl.css +395 -377
  54. package/build-style/style.css +395 -377
  55. package/build-types/components/dataform-layouts/panel/summary-button.d.ts.map +1 -1
  56. package/build-types/components/dataform-layouts/panel/utils/get-label-content.d.ts.map +1 -1
  57. package/build-types/components/dataviews-context/index.d.ts +2 -2
  58. package/build-types/components/dataviews-context/index.d.ts.map +1 -1
  59. package/build-types/components/dataviews-filters/filter.d.ts.map +1 -1
  60. package/build-types/components/dataviews-layouts/grid/composite-grid.d.ts.map +1 -1
  61. package/build-types/components/dataviews-layouts/picker-table/index.d.ts.map +1 -1
  62. package/build-types/components/dataviews-layouts/table/use-scroll-state.d.ts +9 -5
  63. package/build-types/components/dataviews-layouts/table/use-scroll-state.d.ts.map +1 -1
  64. package/build-types/components/dataviews-layouts/utils/item-click-wrapper.d.ts.map +1 -1
  65. package/build-types/dataviews/stories/free-composition.d.ts.map +1 -1
  66. package/build-wp/index.js +3298 -1396
  67. package/package.json +18 -18
  68. package/src/components/dataform-controls/date.tsx +2 -2
  69. package/src/components/dataform-controls/datetime.tsx +1 -1
  70. package/src/components/dataform-controls/email.tsx +2 -2
  71. package/src/components/dataform-controls/style.scss +2 -4
  72. package/src/components/dataform-controls/telephone.tsx +2 -2
  73. package/src/components/dataform-controls/url.tsx +2 -2
  74. package/src/components/dataform-layouts/card/style.scss +4 -7
  75. package/src/components/dataform-layouts/details/style.scss +2 -4
  76. package/src/components/dataform-layouts/panel/style.scss +41 -21
  77. package/src/components/dataform-layouts/panel/summary-button.tsx +17 -6
  78. package/src/components/dataform-layouts/panel/utils/get-label-content.tsx +15 -7
  79. package/src/components/dataform-layouts/regular/style.scss +5 -8
  80. package/src/components/dataviews-bulk-actions/style.scss +2 -6
  81. package/src/components/dataviews-context/index.ts +2 -4
  82. package/src/components/dataviews-filters/filter.tsx +93 -77
  83. package/src/components/dataviews-filters/search-widget.tsx +3 -3
  84. package/src/components/dataviews-filters/style.scss +93 -95
  85. package/src/components/dataviews-footer/style.scss +4 -6
  86. package/src/components/dataviews-item-actions/style.scss +1 -3
  87. package/src/components/dataviews-layouts/activity/style.scss +39 -41
  88. package/src/components/dataviews-layouts/grid/composite-grid.tsx +15 -8
  89. package/src/components/dataviews-layouts/grid/style.scss +46 -50
  90. package/src/components/dataviews-layouts/list/style.scss +61 -59
  91. package/src/components/dataviews-layouts/picker-grid/style.scss +33 -37
  92. package/src/components/dataviews-layouts/picker-table/index.tsx +15 -0
  93. package/src/components/dataviews-layouts/picker-table/style.scss +5 -8
  94. package/src/components/dataviews-layouts/table/column-header-menu.tsx +5 -5
  95. package/src/components/dataviews-layouts/table/style.scss +44 -46
  96. package/src/components/dataviews-layouts/table/use-scroll-state.ts +6 -6
  97. package/src/components/dataviews-layouts/utils/grid-items.scss +4 -6
  98. package/src/components/dataviews-layouts/utils/item-click-wrapper.tsx +3 -1
  99. package/src/components/dataviews-pagination/style.scss +2 -3
  100. package/src/components/dataviews-picker-footer/style.scss +1 -3
  101. package/src/components/dataviews-selection-checkbox/style.scss +0 -1
  102. package/src/components/dataviews-view-config/properties-section.tsx +2 -2
  103. package/src/components/dataviews-view-config/style.scss +8 -11
  104. package/src/dataviews/stories/free-composition.tsx +3 -1
  105. package/src/dataviews/style.scss +27 -18
  106. package/src/dataviews-picker/stories/index.story.tsx +2 -0
  107. package/src/field-types/stories/index.story.tsx +2 -2
  108. package/src/hooks/use-form-validity.ts +2 -2
@@ -11,13 +11,13 @@ import {
11
11
  Dropdown,
12
12
  FlexItem,
13
13
  SelectControl,
14
- Tooltip,
15
- Icon,
14
+ Icon as WCIcon,
16
15
  } from '@wordpress/components';
17
16
  import { __, sprintf } from '@wordpress/i18n';
18
17
  import { useMemo, useRef } from '@wordpress/element';
19
18
  import { closeSmall } from '@wordpress/icons';
20
- import { Stack } from '@wordpress/ui';
19
+ // eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
20
+ import { Stack, Tooltip } from '@wordpress/ui';
21
21
 
22
22
  /**
23
23
  * Internal dependencies
@@ -257,6 +257,10 @@ export default function Filter( {
257
257
  const isLocked = filterInView?.isLocked;
258
258
  const hasValues = ! isLocked && filterInView?.value !== undefined;
259
259
  const canResetOrRemove = ! isLocked && ( ! isPrimary || hasValues );
260
+ // TODO: revisit once `@wordpress/ui`'s `IconButton` is ready — it should
261
+ // collapse the manual icon-only `<button>` + `aria-label` + Tooltip
262
+ // composition below into a single primitive.
263
+ const resetOrRemoveLabel = isPrimary ? __( 'Reset' ) : __( 'Remove' );
260
264
  return (
261
265
  <Dropdown
262
266
  defaultOpen={ openedFilter === filter.field }
@@ -267,83 +271,95 @@ export default function Filter( {
267
271
  } }
268
272
  renderToggle={ ( { isOpen, onToggle } ) => (
269
273
  <div className="dataviews-filters__summary-chip-container">
270
- <Tooltip
271
- text={ sprintf(
272
- /* translators: 1: Filter name. */
273
- __( 'Filter by: %1$s' ),
274
- filter.name.toLowerCase()
275
- ) }
276
- placement="top"
277
- >
278
- <div
279
- className={ clsx(
280
- 'dataviews-filters__summary-chip',
281
- {
282
- 'has-reset': canResetOrRemove,
283
- 'has-values': hasValues,
284
- 'is-not-clickable': isLocked,
285
- }
274
+ <Tooltip.Root>
275
+ <Tooltip.Trigger
276
+ render={
277
+ <div
278
+ className={ clsx(
279
+ 'dataviews-filters__summary-chip',
280
+ {
281
+ 'has-reset': canResetOrRemove,
282
+ 'has-values': hasValues,
283
+ 'is-not-clickable': isLocked,
284
+ }
285
+ ) }
286
+ role="button"
287
+ tabIndex={ isLocked ? -1 : 0 }
288
+ onClick={ () => {
289
+ if ( ! isLocked ) {
290
+ onToggle();
291
+ }
292
+ } }
293
+ onKeyDown={ ( event ) => {
294
+ if (
295
+ ! isLocked &&
296
+ [ ENTER, SPACE ].includes(
297
+ event.key
298
+ )
299
+ ) {
300
+ onToggle();
301
+ event.preventDefault();
302
+ }
303
+ } }
304
+ aria-disabled={ isLocked }
305
+ aria-pressed={ isOpen }
306
+ aria-expanded={ isOpen }
307
+ ref={ toggleRef }
308
+ >
309
+ <FilterText
310
+ activeElements={ activeElements }
311
+ filterInView={ filterInView }
312
+ filter={ filter }
313
+ />
314
+ </div>
315
+ }
316
+ />
317
+ <Tooltip.Popup>
318
+ { sprintf(
319
+ /* translators: 1: Filter name. */
320
+ __( 'Filter by: %1$s' ),
321
+ filter.name.toLowerCase()
286
322
  ) }
287
- role="button"
288
- tabIndex={ isLocked ? -1 : 0 }
289
- onClick={ () => {
290
- if ( ! isLocked ) {
291
- onToggle();
292
- }
293
- } }
294
- onKeyDown={ ( event ) => {
295
- if (
296
- ! isLocked &&
297
- [ ENTER, SPACE ].includes( event.key )
298
- ) {
299
- onToggle();
300
- event.preventDefault();
323
+ </Tooltip.Popup>
324
+ </Tooltip.Root>
325
+ { canResetOrRemove && (
326
+ <Tooltip.Root>
327
+ <Tooltip.Trigger
328
+ render={
329
+ <button
330
+ className={ clsx(
331
+ 'dataviews-filters__summary-chip-remove',
332
+ { 'has-values': hasValues }
333
+ ) }
334
+ aria-label={ resetOrRemoveLabel }
335
+ onClick={ () => {
336
+ onChangeView( {
337
+ ...view,
338
+ page: 1,
339
+ filters: view.filters?.filter(
340
+ ( _filter ) =>
341
+ _filter.field !==
342
+ filter.field
343
+ ),
344
+ } );
345
+ // If the filter is not primary and can be removed, it will be added
346
+ // back to the available filters from `Add filter` component.
347
+ if ( ! isPrimary ) {
348
+ addFilterRef.current?.focus();
349
+ } else {
350
+ // If is primary, focus the toggle button.
351
+ toggleRef.current?.focus();
352
+ }
353
+ } }
354
+ >
355
+ <WCIcon icon={ closeSmall } />
356
+ </button>
301
357
  }
302
- } }
303
- aria-disabled={ isLocked }
304
- aria-pressed={ isOpen }
305
- aria-expanded={ isOpen }
306
- ref={ toggleRef }
307
- >
308
- <FilterText
309
- activeElements={ activeElements }
310
- filterInView={ filterInView }
311
- filter={ filter }
312
358
  />
313
- </div>
314
- </Tooltip>
315
- { canResetOrRemove && (
316
- <Tooltip
317
- text={ isPrimary ? __( 'Reset' ) : __( 'Remove' ) }
318
- placement="top"
319
- >
320
- <button
321
- className={ clsx(
322
- 'dataviews-filters__summary-chip-remove',
323
- { 'has-values': hasValues }
324
- ) }
325
- onClick={ () => {
326
- onChangeView( {
327
- ...view,
328
- page: 1,
329
- filters: view.filters?.filter(
330
- ( _filter ) =>
331
- _filter.field !== filter.field
332
- ),
333
- } );
334
- // If the filter is not primary and can be removed, it will be added
335
- // back to the available filters from `Add filter` component.
336
- if ( ! isPrimary ) {
337
- addFilterRef.current?.focus();
338
- } else {
339
- // If is primary, focus the toggle button.
340
- toggleRef.current?.focus();
341
- }
342
- } }
343
- >
344
- <Icon icon={ closeSmall } />
345
- </button>
346
- </Tooltip>
359
+ <Tooltip.Popup>
360
+ { resetOrRemoveLabel }
361
+ </Tooltip.Popup>
362
+ </Tooltip.Root>
347
363
  ) }
348
364
  </div>
349
365
  ) }
@@ -12,7 +12,7 @@ import clsx from 'clsx';
12
12
  import { useInstanceId } from '@wordpress/compose';
13
13
  import { __, sprintf } from '@wordpress/i18n';
14
14
  import { useState, useMemo, useDeferredValue } from '@wordpress/element';
15
- import { Icon, Composite, Spinner } from '@wordpress/components';
15
+ import { Icon as WCIcon, Composite, Spinner } from '@wordpress/components';
16
16
  import { search, check } from '@wordpress/icons';
17
17
  import { VisuallyHidden } from '@wordpress/ui';
18
18
 
@@ -68,7 +68,7 @@ const MultiSelectionOption = ( { selected }: { selected: boolean } ) => {
68
68
  { 'is-selected': selected }
69
69
  ) }
70
70
  >
71
- { selected && <Icon icon={ check } /> }
71
+ { selected && <WCIcon icon={ check } /> }
72
72
  </span>
73
73
  );
74
74
  };
@@ -272,7 +272,7 @@ function ComboboxList( { view, filter, onChangeView }: SearchWidgetProps ) {
272
272
  className="dataviews-filters__search-widget-filter-combobox__input"
273
273
  />
274
274
  <div className="dataviews-filters__search-widget-filter-combobox__icon">
275
- <Icon icon={ search } />
275
+ <WCIcon icon={ search } />
276
276
  </div>
277
277
  </div>
278
278
  <Ariakit.ComboboxList
@@ -1,6 +1,4 @@
1
- @use "sass:math";
2
- @use "@wordpress/base-styles/colors" as *;
3
- @use "@wordpress/base-styles/variables" as *;
1
+ @use "@wordpress/base-styles/variables" as vars;
4
2
  @use "@wordpress/base-styles/mixins" as *;
5
3
 
6
4
  .dataviews-filters__button {
@@ -23,14 +21,14 @@
23
21
  }
24
22
 
25
23
  .dataviews-filters__summary-popover {
26
- font-size: $default-font-size;
27
- line-height: $default-line-height;
24
+ font-size: var(--wpds-typography-font-size-md);
25
+ line-height: var(--wpds-typography-line-height-sm);
28
26
 
29
27
  .components-popover__content {
30
28
  width: 100%;
31
29
  min-width: 230px;
32
30
  max-width: 250px;
33
- border-radius: $grid-unit-05;
31
+ border-radius: var(--wpds-border-radius-md);
34
32
  }
35
33
 
36
34
  &.components-dropdown__content {
@@ -41,12 +39,12 @@
41
39
  }
42
40
 
43
41
  .dataviews-filters__summary-operators-container {
44
- padding: $grid-unit-10 $grid-unit-20;
42
+ padding: var(--wpds-dimension-padding-sm) var(--wpds-dimension-padding-lg);
45
43
 
46
44
  &:has(+ .dataviews-filters__search-widget-listbox),
47
45
  &:has(+ .dataviews-filters__search-widget-no-elements),
48
46
  &:has(+ .dataviews-filters__user-input-widget) {
49
- border-bottom: 1px solid $gray-200;
47
+ border-bottom: 1px solid var(--wpds-color-stroke-surface-neutral);
50
48
  }
51
49
 
52
50
  &:empty {
@@ -54,7 +52,7 @@
54
52
  }
55
53
 
56
54
  .dataviews-filters__summary-operators-filter-name {
57
- color: $gray-700;
55
+ color: var(--wpds-color-fg-content-neutral-weak);
58
56
  white-space: nowrap;
59
57
  overflow: hidden;
60
58
  text-overflow: ellipsis;
@@ -74,13 +72,12 @@
74
72
  white-space: pre-wrap;
75
73
 
76
74
  .dataviews-filters__summary-chip {
77
- border-radius: $grid-unit-20;
78
- border: $border-width solid transparent;
75
+ border-radius: var(--wpds-border-radius-lg);
76
+ border: var(--wpds-border-width-xs) solid var(--wpds-color-stroke-interactive-neutral);
79
77
  cursor: var(--wpds-cursor-control);
80
- padding: $grid-unit-05 $grid-unit-15;
81
- min-height: $grid-unit-40;
82
- background: $gray-100;
83
- color: $gray-800;
78
+ padding: var(--wpds-dimension-padding-xs) var(--wpds-dimension-padding-md);
79
+ min-height: calc(var(--wpds-dimension-base) * 8); // TODO: use size token when available
80
+ color: var(--wpds-color-fg-interactive-neutral);
84
81
  position: relative;
85
82
  display: flex;
86
83
  align-items: center;
@@ -91,46 +88,51 @@
91
88
  }
92
89
 
93
90
  &.has-reset {
94
- padding-inline-end: $button-size-small + $grid-unit-05;
91
+ padding-inline-end: calc(#{vars.$icon-size} + var(--wpds-dimension-padding-xs));
95
92
  }
96
93
 
97
94
  &:hover:not(&.is-not-clickable),
98
95
  &:focus-visible,
99
96
  &[aria-expanded="true"] {
100
- background: $gray-200;
101
- color: $gray-900;
97
+ color: var(--wpds-color-fg-interactive-neutral);
98
+ border-color: var(--wpds-color-stroke-interactive-neutral-active);
99
+ background-color: var(--wpds-color-bg-interactive-neutral-weak-active);
102
100
  }
103
101
 
104
102
  &.has-values {
105
- color: var(--wp-admin-theme-color);
106
- background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
103
+ color: var(--wpds-color-fg-interactive-brand);
104
+ background: var(--wpds-color-bg-interactive-brand-weak);
105
+ border-color: var(--wpds-color-stroke-interactive-brand);
107
106
 
108
- &:hover,
107
+ &:hover:not(&.is-not-clickable),
109
108
  &[aria-expanded="true"] {
110
- background: rgba(var(--wp-admin-theme-color--rgb), 0.12);
109
+ color: var(--wpds-color-fg-interactive-brand-active);
110
+ background: var(--wpds-color-bg-interactive-brand-weak-active);
111
+ border-color: var(--wpds-color-stroke-interactive-brand-active);
111
112
  }
112
113
  }
113
114
 
114
115
  &:focus-visible {
115
116
  outline: none;
116
117
  box-shadow:
117
- 0 0 0 var(--wp-admin-border-width-focus)
118
- var(--wp-admin-theme-color);
118
+ 0 0 0 var(--wpds-border-width-focus)
119
+ var(--wpds-color-stroke-focus-brand);
119
120
  }
120
121
 
121
122
  .dataviews-filters-__summary-filter-text-name {
122
- font-weight: $font-weight-medium;
123
+ font-weight: var(--wpds-typography-font-weight-medium);
123
124
  }
124
125
  }
125
126
 
126
127
  .dataviews-filters__summary-chip-remove {
127
- width: $icon-size;
128
- height: $icon-size;
129
- border-radius: 50%;
128
+ // TODO: use size token when available.
129
+ width: vars.$icon-size;
130
+ height: vars.$icon-size;
131
+ border-radius: var(--wpds-border-radius-md);
130
132
  border: 0;
131
133
  padding: 0;
132
134
  position: absolute;
133
- right: $grid-unit-05;
135
+ right: var(--wpds-dimension-padding-xs);
134
136
  top: 50%;
135
137
  transform: translateY(-50%);
136
138
  display: flex;
@@ -140,40 +142,40 @@
140
142
  cursor: var(--wpds-cursor-control);
141
143
 
142
144
  svg {
143
- fill: $gray-700;
145
+ fill: var(--wpds-color-fg-interactive-neutral);
144
146
  }
145
147
 
146
148
  &:hover,
147
149
  &:focus {
148
- background: $gray-200;
150
+ background: var(--wpds-color-bg-interactive-neutral-weak-active);
149
151
  svg {
150
- fill: $gray-900;
152
+ fill: var(--wpds-color-fg-interactive-neutral-active);
151
153
  }
152
154
  }
153
155
 
154
156
  &.has-values {
155
157
  svg {
156
- fill: var(--wp-admin-theme-color);
158
+ fill: var(--wpds-color-fg-interactive-brand);
157
159
  }
158
160
  &:hover {
159
- background: rgba(var(--wp-admin-theme-color--rgb), 0.08);
161
+ background: var(--wpds-color-bg-interactive-brand-weak-active);
160
162
  }
161
163
  }
162
164
 
163
165
  &:focus-visible {
164
166
  outline: none;
165
167
  box-shadow:
166
- 0 0 0 var(--wp-admin-border-width-focus)
167
- var(--wp-admin-theme-color);
168
+ 0 0 0 var(--wpds-border-width-focus)
169
+ var(--wpds-color-stroke-focus-brand);
168
170
  }
169
171
  }
170
172
  }
171
173
 
172
174
  .dataviews-filters__search-widget-filter-combobox-list {
173
- max-height: $grid-unit * 23;
174
- padding: $grid-unit-05;
175
+ max-height: calc(var(--wpds-dimension-base) * 46);
176
+ padding: var(--wpds-dimension-padding-xs);
175
177
  overflow: auto;
176
- border-top: 1px solid $gray-200;
178
+ border-top: 1px solid var(--wpds-color-stroke-surface-neutral);
177
179
 
178
180
  .dataviews-filters__search-widget-filter-combobox-item-value {
179
181
  [data-user-value] {
@@ -183,19 +185,19 @@
183
185
  }
184
186
 
185
187
  .dataviews-filters__search-widget-listbox {
186
- padding: $grid-unit-05;
188
+ padding: var(--wpds-dimension-padding-xs);
187
189
  overflow: auto;
188
190
  }
189
191
 
190
192
  .dataviews-filters__search-widget-listitem {
191
193
  display: flex;
192
194
  align-items: center;
193
- gap: $grid-unit-10;
194
- border-radius: $radius-small;
195
+ gap: var(--wpds-dimension-gap-md);
196
+ border-radius: var(--wpds-border-radius-sm);
195
197
  box-sizing: border-box;
196
- padding: $grid-unit-05 $grid-unit-15;
198
+ padding: var(--wpds-dimension-padding-xs) var(--wpds-dimension-padding-md);
197
199
  cursor: default;
198
- min-height: $grid-unit-40;
200
+ min-height: calc(var(--wpds-dimension-base) * 8); // TODO: use size token when available
199
201
  @include body-medium();
200
202
 
201
203
  &:last-child {
@@ -205,28 +207,24 @@
205
207
  &:hover,
206
208
  &[data-active-item],
207
209
  &:focus {
208
- background-color: var(--wp-admin-theme-color);
209
- color: $white;
210
-
211
- .dataviews-filters__search-widget-listitem-description {
212
- color: $white;
213
- }
210
+ background-color: var(--wpds-color-bg-interactive-brand-weak-active);
214
211
 
215
212
  .dataviews-filters__search-widget-listitem-single-selection {
216
- border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
217
- background: $white;
213
+ border-color: var(--wpds-color-stroke-interactive-brand-active);
214
+ background: var(--wpds-color-bg-surface-neutral-strong);
218
215
  &.is-selected {
219
- border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
220
- background: var(--wp-admin-theme-color-darker-20, #183ad6);
216
+ border-color: var(--wpds-color-stroke-interactive-brand-active);
217
+ background: var(--wpds-color-bg-interactive-brand-strong-active);
221
218
  }
222
219
  }
223
220
 
224
221
  .dataviews-filters__search-widget-listitem-multi-selection {
225
- border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
222
+ border-color: var(--wpds-color-stroke-interactive-brand-active);
223
+ background: var(--wpds-color-bg-surface-neutral-strong);
226
224
 
227
225
  &.is-selected {
228
- border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
229
- background: var(--wp-admin-theme-color-darker-20, #183ad6);
226
+ border-color: var(--wpds-color-stroke-interactive-brand-active);
227
+ background: var(--wpds-color-bg-interactive-brand-strong-active);
230
228
  }
231
229
  }
232
230
  }
@@ -242,9 +240,9 @@
242
240
  display: block;
243
241
  overflow: hidden;
244
242
  text-overflow: ellipsis;
245
- font-size: $helptext-font-size;
243
+ font-size: var(--wpds-typography-font-size-sm);
246
244
  line-height: 16px;
247
- color: $gray-700;
245
+ color: var(--wpds-color-fg-content-neutral-weak);
248
246
  }
249
247
 
250
248
  .dataviews-filters__search-widget-listitem-single-selection {
@@ -253,28 +251,28 @@
253
251
  padding: 0;
254
252
 
255
253
  &.is-selected {
256
- background: var(--wp-admin-theme-color, #3858e9);
257
- border-color: var(--wp-admin-theme-color, #3858e9);
254
+ background: var(--wpds-color-bg-interactive-brand-strong);
255
+ border-color: var(--wpds-color-stroke-interactive-brand);
258
256
 
259
257
  &::before {
260
258
  content: "";
261
- border-radius: $radius-round;
259
+ border-radius: 50%;
262
260
  box-sizing: inherit;
263
- width: math.div($radio-input-size-sm, 2);
264
- height: math.div($radio-input-size-sm, 2);
261
+ width: vars.$radio-input-size-sm * 0.5;
262
+ height: vars.$radio-input-size-sm * 0.5;
265
263
  position: absolute;
266
264
  top: 50%;
267
265
  left: 50%;
268
266
  transform: translate(-50%, -50%);
269
267
  margin: 0;
270
- background-color: $white;
268
+ background-color: var(--wpds-color-fg-interactive-brand-strong);
271
269
 
272
270
  // This border serves as a background color in Windows High Contrast mode.
273
- border: 4px solid $white;
271
+ border: 4px solid var(--wpds-color-fg-interactive-brand-strong);
274
272
 
275
273
  @include break-small() {
276
- width: math.div($radio-input-size, 2);
277
- height: math.div($radio-input-size, 2);
274
+ width: vars.$radio-input-size * 0.5;
275
+ height: vars.$radio-input-size * 0.5;
278
276
  }
279
277
  }
280
278
  }
@@ -286,8 +284,8 @@
286
284
 
287
285
  @include checkbox-control;
288
286
  position: relative;
289
- background: $white;
290
- color: $gray-900;
287
+ background: var(--wpds-color-bg-interactive-neutral-weak);
288
+ color: var(--wpds-color-fg-content-neutral);
291
289
  margin: 0;
292
290
  padding: 0;
293
291
  width: var(--checkbox-size);
@@ -302,13 +300,13 @@
302
300
  }
303
301
 
304
302
  &.is-selected {
305
- background: var(--wp-admin-theme-color, #3858e9);
306
- border-color: var(--wp-admin-theme-color, #3858e9);
303
+ background: var(--wpds-color-bg-interactive-brand-strong);
304
+ border-color: var(--wpds-color-stroke-interactive-brand);
307
305
 
308
306
  svg {
309
307
  --checkmark-size: var(--checkbox-size);
310
308
 
311
- fill: $white;
309
+ fill: var(--wpds-color-fg-interactive-neutral-strong);
312
310
  position: absolute;
313
311
  left: 50%;
314
312
  top: 50%;
@@ -326,34 +324,34 @@
326
324
 
327
325
  .dataviews-filters__search-widget-filter-combobox__wrapper {
328
326
  position: relative;
329
- padding: $grid-unit-10;
327
+ padding: var(--wpds-dimension-padding-sm);
330
328
 
331
329
  .dataviews-filters__search-widget-filter-combobox__input {
332
330
  @include input-control;
333
331
  display: block;
334
- padding: 0 $grid-unit-10 0 $grid-unit-40;
332
+ padding: 0 var(--wpds-dimension-padding-sm) 0 calc(var(--wpds-dimension-base) * 8);
335
333
  width: 100%;
336
- height: $grid-unit-40;
334
+ height: calc(var(--wpds-dimension-base) * 8); // TODO: use size token when available
337
335
 
338
336
  // Unset inherited values.
339
337
  margin-left: 0;
340
338
  margin-right: 0;
341
339
 
342
340
  /* Fonts smaller than 16px causes mobile safari to zoom. */
343
- font-size: $mobile-text-min-font-size;
341
+ font-size: vars.$mobile-text-min-font-size;
344
342
  @include break-small {
345
- font-size: $default-font-size;
343
+ font-size: var(--wpds-typography-font-size-md);
346
344
  }
347
345
 
348
346
  &:focus {
349
- background: $white;
347
+ background: var(--wpds-color-bg-surface-neutral-strong);
350
348
  box-shadow:
351
- inset 0 0 0 var(--wp-admin-border-width-focus)
352
- var(--wp-admin-theme-color);
349
+ inset 0 0 0 var(--wpds-border-width-focus)
350
+ var(--wpds-color-stroke-focus-brand);
353
351
  }
354
352
 
355
353
  &::placeholder {
356
- color: $gray-700;
354
+ color: var(--wpds-color-fg-content-neutral-weak);
357
355
  }
358
356
 
359
357
  &::-webkit-search-decoration,
@@ -366,13 +364,13 @@
366
364
 
367
365
  .dataviews-filters__search-widget-filter-combobox__icon {
368
366
  position: absolute;
369
- inset-inline-start: $grid-unit-15;
367
+ inset-inline-start: var(--wpds-dimension-gap-md);
370
368
  top: 0;
371
369
  bottom: 0;
372
370
  display: flex;
373
371
  align-items: center;
374
372
  justify-content: center;
375
- width: $icon-size;
373
+ width: vars.$icon-size;
376
374
 
377
375
  &:dir(ltr) {
378
376
  transform: scaleX(-1);
@@ -390,16 +388,16 @@
390
388
  top: 0;
391
389
  right: 0;
392
390
  transform: translate(50%, -50%);
393
- background: var(--wp-admin-theme-color, #3858e9);
394
- height: $grid-unit-20;
395
- min-width: $grid-unit-20;
396
- line-height: $grid-unit-20;
397
- padding: 0 $grid-unit-05;
391
+ background: var(--wpds-color-bg-interactive-brand-strong);
392
+ height: calc(var(--wpds-dimension-base) * 4); // TODO: use size token when available
393
+ min-width: calc(var(--wpds-dimension-base) * 4); // TODO: use size token when available
394
+ line-height: var(--wpds-typography-line-height-xs);
395
+ padding: 0 var(--wpds-dimension-padding-xs);
398
396
  text-align: center;
399
- border-radius: $grid-unit-10;
397
+ border-radius: var(--wpds-border-radius-lg);
400
398
  font-size: 11px;
401
- outline: var(--wp-admin-border-width-focus) solid $white;
402
- color: $white;
399
+ outline: var(--wpds-border-width-focus) solid var(--wpds-color-bg-surface-neutral-strong);
400
+ color: var(--wpds-color-fg-interactive-neutral-strong);
403
401
  box-sizing: border-box;
404
402
  }
405
403
 
@@ -408,10 +406,10 @@
408
406
  }
409
407
 
410
408
  .dataviews-filters__user-input-widget {
411
- padding: $grid-unit-20;
409
+ padding: var(--wpds-dimension-padding-lg);
412
410
 
413
411
  .components-input-control__prefix {
414
- padding-left: $grid-unit-10;
412
+ padding-left: var(--wpds-dimension-padding-sm);
415
413
  }
416
414
  }
417
415
 
@@ -419,5 +417,5 @@
419
417
  display: flex;
420
418
  align-items: center;
421
419
  justify-content: center;
422
- padding: $grid-unit-20;
420
+ padding: var(--wpds-dimension-padding-lg);
423
421
  }
@@ -1,6 +1,3 @@
1
- @use "@wordpress/base-styles/colors" as *;
2
- @use "@wordpress/base-styles/variables" as *;
3
- @use "@wordpress/base-styles/z-index" as *;
4
1
  @use "../../dataviews/style" as *;
5
2
 
6
3
  .dataviews-footer {
@@ -8,15 +5,16 @@
8
5
  bottom: 0;
9
6
  left: 0;
10
7
  background-color: inherit;
11
- padding: $grid-unit-15 $grid-unit-30;
12
- border-top: $border-width solid $gray-100;
8
+ padding: var(--wpds-dimension-padding-md) var(--wpds-dimension-padding-2xl);
9
+ border-top: var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral-weak);
13
10
  flex-shrink: 0;
14
11
 
15
12
  @media not (prefers-reduced-motion) {
16
13
  transition: padding ease-out 0.1s;
17
14
  }
18
15
 
19
- z-index: z-index(".dataviews-footer");
16
+ // Ensure the footer stays above the scrolling content, independent of DOM order.
17
+ z-index: 1;
20
18
 
21
19
  .is-refreshing {
22
20
  @include dataviews-refreshing();