@wordpress/components 32.2.2-next.v.202602200903.0 → 32.3.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.
- package/CHANGELOG.md +19 -1
- package/build/alignment-matrix-control/cell.cjs +2 -2
- package/build/alignment-matrix-control/cell.cjs.map +2 -2
- package/build/alignment-matrix-control/index.cjs +2 -2
- package/build/alignment-matrix-control/index.cjs.map +2 -2
- package/build/angle-picker-control/angle-circle.cjs +2 -2
- package/build/angle-picker-control/angle-circle.cjs.map +2 -2
- package/build/color-picker/color-input.cjs +11 -8
- package/build/color-picker/color-input.cjs.map +2 -2
- package/build/color-picker/component.cjs +47 -3
- package/build/color-picker/component.cjs.map +2 -2
- package/build/color-picker/hsl-input.cjs +7 -28
- package/build/color-picker/hsl-input.cjs.map +2 -2
- package/build/color-picker/picker.cjs +29 -20
- package/build/color-picker/picker.cjs.map +2 -2
- package/build/date-time/date/styles.cjs +9 -9
- package/build/date-time/date/styles.cjs.map +2 -2
- package/build/number-control/index.cjs +2 -5
- package/build/number-control/index.cjs.map +2 -2
- package/build/select-control/styles/select-control-styles.cjs +8 -8
- package/build/select-control/styles/select-control-styles.cjs.map +2 -2
- package/build/toggle-group-control/toggle-group-control-option-base/styles.cjs +8 -8
- package/build/toggle-group-control/toggle-group-control-option-base/styles.cjs.map +2 -2
- package/build-module/alignment-matrix-control/cell.mjs +2 -2
- package/build-module/alignment-matrix-control/cell.mjs.map +2 -2
- package/build-module/alignment-matrix-control/index.mjs +2 -2
- package/build-module/alignment-matrix-control/index.mjs.map +2 -2
- package/build-module/angle-picker-control/angle-circle.mjs +2 -2
- package/build-module/angle-picker-control/angle-circle.mjs.map +2 -2
- package/build-module/color-picker/color-input.mjs +11 -8
- package/build-module/color-picker/color-input.mjs.map +2 -2
- package/build-module/color-picker/component.mjs +48 -4
- package/build-module/color-picker/component.mjs.map +2 -2
- package/build-module/color-picker/hsl-input.mjs +7 -28
- package/build-module/color-picker/hsl-input.mjs.map +2 -2
- package/build-module/color-picker/picker.mjs +30 -21
- package/build-module/color-picker/picker.mjs.map +2 -2
- package/build-module/date-time/date/styles.mjs +9 -9
- package/build-module/date-time/date/styles.mjs.map +2 -2
- package/build-module/number-control/index.mjs +2 -5
- package/build-module/number-control/index.mjs.map +2 -2
- package/build-module/select-control/styles/select-control-styles.mjs +8 -8
- package/build-module/select-control/styles/select-control-styles.mjs.map +2 -2
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.mjs +8 -8
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.mjs.map +2 -2
- package/build-style/style-rtl.css +2 -0
- package/build-style/style.css +2 -0
- package/build-types/color-picker/color-input.d.ts +1 -1
- package/build-types/color-picker/color-input.d.ts.map +1 -1
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/hsl-input.d.ts +1 -1
- package/build-types/color-picker/hsl-input.d.ts.map +1 -1
- package/build-types/color-picker/picker.d.ts +1 -1
- package/build-types/color-picker/picker.d.ts.map +1 -1
- package/build-types/color-picker/types.d.ts +6 -4
- package/build-types/color-picker/types.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/dropdown/types.d.ts +9 -13
- package/build-types/dropdown/types.d.ts.map +1 -1
- package/build-types/modal/types.d.ts +9 -3
- package/build-types/modal/types.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +10 -10
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +1 -1
- package/build-types/tools-panel/types.d.ts +1 -1
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/button/style.scss +1 -0
- package/src/color-picker/color-input.tsx +23 -4
- package/src/color-picker/component.tsx +88 -4
- package/src/color-picker/hsl-input.tsx +9 -51
- package/src/color-picker/picker.tsx +28 -24
- package/src/color-picker/test/index.tsx +139 -6
- package/src/color-picker/types.ts +6 -4
- package/src/date-time/date/styles.ts +1 -0
- package/src/dropdown/types.ts +9 -14
- package/src/form-token-field/style.scss +1 -0
- package/src/modal/types.ts +9 -5
- package/src/number-control/index.tsx +73 -77
- package/src/popover/types.ts +10 -10
- package/src/select-control/styles/select-control-styles.ts +1 -0
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +18 -16
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +4 -6
- package/src/tools-panel/types.ts +4 -1
package/src/dropdown/types.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
1
|
+
import type { useFocusOnMount } from '@wordpress/compose';
|
|
4
2
|
import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
3
|
import type Popover from '../popover';
|
|
10
4
|
import type { PopoverProps } from '../popover/types';
|
|
11
5
|
|
|
@@ -42,16 +36,17 @@ export type DropdownProps = {
|
|
|
42
36
|
*/
|
|
43
37
|
expandOnMobile?: boolean;
|
|
44
38
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
39
|
+
* Determines focus behavior when the dialog mounts.
|
|
40
|
+
*
|
|
41
|
+
* - `"firstElement"` focuses the first tabbable element within.
|
|
42
|
+
* - `"firstInputElement"` focuses the first value control within.
|
|
43
|
+
* - `true` focuses the element itself.
|
|
44
|
+
* - `false` does nothing and _should not be used unless an accessible
|
|
45
|
+
* substitute behavior is implemented_.
|
|
51
46
|
*
|
|
52
47
|
* @default 'firstElement'
|
|
53
48
|
*/
|
|
54
|
-
focusOnMount?:
|
|
49
|
+
focusOnMount?: useFocusOnMount.Mode;
|
|
55
50
|
/**
|
|
56
51
|
* Set this to customize the text that is shown in the dropdown's header
|
|
57
52
|
* when it is fullscreen on mobile.
|
package/src/modal/types.ts
CHANGED
|
@@ -51,14 +51,18 @@ export type ModalProps = {
|
|
|
51
51
|
*/
|
|
52
52
|
contentLabel?: string;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
54
|
+
* Determines focus behavior when the modal opens.
|
|
55
|
+
*
|
|
56
|
+
* - `"firstElement"` focuses the first tabbable element within.
|
|
57
|
+
* - `"firstInputElement"` focuses the first value control within.
|
|
58
|
+
* - `"firstContentElement"` focuses the first tabbable element within the modal’s content element.
|
|
59
|
+
* - `true` focuses the element itself.
|
|
60
|
+
* - `false` does nothing and _should not be used unless an accessible
|
|
61
|
+
* substitute behavior is implemented_.
|
|
56
62
|
*
|
|
57
63
|
* @default true
|
|
58
64
|
*/
|
|
59
|
-
focusOnMount?:
|
|
60
|
-
| Parameters< typeof useFocusOnMount >[ 0 ]
|
|
61
|
-
| 'firstContentElement';
|
|
65
|
+
focusOnMount?: useFocusOnMount.Mode | 'firstContentElement';
|
|
62
66
|
/**
|
|
63
67
|
* Elements that are injected into the modal header to the left of the close button (if rendered).
|
|
64
68
|
* Hidden if `__experimentalHideHeader` is `true`.
|
|
@@ -18,6 +18,7 @@ import deprecated from '@wordpress/deprecated';
|
|
|
18
18
|
*/
|
|
19
19
|
import { Input, SpinButton, styles } from './styles/number-control-styles';
|
|
20
20
|
import * as inputControlActionTypes from '../input-control/reducer/actions';
|
|
21
|
+
import type { StateReducer } from '../input-control/reducer/state';
|
|
21
22
|
import { add, subtract, clamp, ensureValidStep } from '../utils/math';
|
|
22
23
|
import { ensureNumber, isValueEmpty } from '../utils/values';
|
|
23
24
|
import type { WordPressComponentProps } from '../context/wordpress-component';
|
|
@@ -120,93 +121,91 @@ function UnforwardedNumberControl(
|
|
|
120
121
|
*
|
|
121
122
|
* @return The updated state to apply to InputControl
|
|
122
123
|
*/
|
|
123
|
-
const numberControlStateReducer:
|
|
124
|
-
|
|
125
|
-
const nextState = { ...state };
|
|
124
|
+
const numberControlStateReducer: StateReducer = ( state, action ) => {
|
|
125
|
+
const nextState = { ...state };
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
const { type, payload } = action;
|
|
128
|
+
const event = payload.event;
|
|
129
|
+
const currentValue = nextState.value;
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
131
|
+
/**
|
|
132
|
+
* Handles custom UP and DOWN Keyboard events
|
|
133
|
+
*/
|
|
134
|
+
if (
|
|
135
|
+
type === inputControlActionTypes.PRESS_UP ||
|
|
136
|
+
type === inputControlActionTypes.PRESS_DOWN
|
|
137
|
+
) {
|
|
138
|
+
nextState.value = spinValue(
|
|
139
|
+
currentValue,
|
|
140
|
+
type === inputControlActionTypes.PRESS_UP ? 'up' : 'down',
|
|
141
|
+
event as KeyboardEvent | undefined
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
144
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Handles drag to update events
|
|
147
|
+
*/
|
|
148
|
+
if ( type === inputControlActionTypes.DRAG && isDragEnabled ) {
|
|
149
|
+
const [ x, y ] = payload.delta;
|
|
150
|
+
const enableShift = payload.shiftKey && isShiftStepEnabled;
|
|
151
|
+
const modifier = enableShift
|
|
152
|
+
? ensureNumber( shiftStep ) * baseSpin
|
|
153
|
+
: baseSpin;
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
let directionModifier;
|
|
156
|
+
let delta;
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
switch ( dragDirection ) {
|
|
159
|
+
case 'n':
|
|
160
|
+
delta = y;
|
|
161
|
+
directionModifier = -1;
|
|
162
|
+
break;
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
case 'e':
|
|
165
|
+
delta = x;
|
|
166
|
+
directionModifier = isRTL() ? -1 : 1;
|
|
167
|
+
break;
|
|
168
168
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
169
|
+
case 's':
|
|
170
|
+
delta = y;
|
|
171
|
+
directionModifier = 1;
|
|
172
|
+
break;
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
case 'w':
|
|
175
|
+
delta = x;
|
|
176
|
+
directionModifier = isRTL() ? 1 : -1;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
179
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
if ( delta !== 0 ) {
|
|
181
|
+
delta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );
|
|
182
|
+
const distance = delta * modifier * directionModifier;
|
|
183
183
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
184
|
+
nextState.value = constrainValue(
|
|
185
|
+
// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined
|
|
186
|
+
add( currentValue, distance ),
|
|
187
|
+
enableShift ? modifier : undefined
|
|
188
|
+
);
|
|
190
189
|
}
|
|
190
|
+
}
|
|
191
191
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
required === false && currentValue === '';
|
|
192
|
+
/**
|
|
193
|
+
* Handles commit (ENTER key press or blur)
|
|
194
|
+
*/
|
|
195
|
+
if (
|
|
196
|
+
type === inputControlActionTypes.PRESS_ENTER ||
|
|
197
|
+
type === inputControlActionTypes.COMMIT
|
|
198
|
+
) {
|
|
199
|
+
const applyEmptyValue = required === false && currentValue === '';
|
|
201
200
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
201
|
+
nextState.value = applyEmptyValue
|
|
202
|
+
? currentValue
|
|
203
|
+
: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined
|
|
204
|
+
constrainValue( currentValue );
|
|
205
|
+
}
|
|
207
206
|
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
return stateReducerProp?.( nextState, action ) ?? nextState;
|
|
208
|
+
};
|
|
210
209
|
|
|
211
210
|
const buildSpinButtonClickHandler =
|
|
212
211
|
( direction: 'up' | 'down' ) =>
|
|
@@ -238,10 +237,7 @@ function UnforwardedNumberControl(
|
|
|
238
237
|
type={ typeProp }
|
|
239
238
|
// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components
|
|
240
239
|
value={ valueProp }
|
|
241
|
-
__unstableStateReducer={
|
|
242
|
-
const baseState = numberControlStateReducer( state, action );
|
|
243
|
-
return stateReducerProp?.( baseState, action ) ?? baseState;
|
|
244
|
-
} }
|
|
240
|
+
__unstableStateReducer={ numberControlStateReducer }
|
|
245
241
|
size={ size }
|
|
246
242
|
__shouldNotWarnDeprecated36pxSize
|
|
247
243
|
suffix={
|
package/src/popover/types.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import type { ReactNode, MutableRefObject, SyntheticEvent } from 'react';
|
|
5
1
|
import type { Placement } from '@floating-ui/react-dom';
|
|
2
|
+
import type { useFocusOnMount } from '@wordpress/compose';
|
|
3
|
+
import type { MutableRefObject, ReactNode, SyntheticEvent } from 'react';
|
|
6
4
|
|
|
7
5
|
type PositionYAxis = 'top' | 'middle' | 'bottom';
|
|
8
6
|
type PositionXAxis = 'left' | 'center' | 'right';
|
|
@@ -75,15 +73,17 @@ export type PopoverProps = {
|
|
|
75
73
|
*/
|
|
76
74
|
constrainTabbing?: boolean;
|
|
77
75
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
76
|
+
* Determines focus behavior when the popover mounts.
|
|
77
|
+
*
|
|
78
|
+
* - `"firstElement"` focuses the first tabbable element within.
|
|
79
|
+
* - `"firstInputElement"` focuses the first value control within.
|
|
80
|
+
* - `true` focuses the element itself.
|
|
81
|
+
* - `false` does nothing and _should not be used unless an accessible
|
|
82
|
+
* substitute behavior is implemented_.
|
|
83
83
|
*
|
|
84
84
|
* @default 'firstElement'
|
|
85
85
|
*/
|
|
86
|
-
focusOnMount?:
|
|
86
|
+
focusOnMount?: useFocusOnMount.Mode;
|
|
87
87
|
/**
|
|
88
88
|
* A callback invoked when the focus leaves the opened popover. This should
|
|
89
89
|
* only be provided in advanced use-cases when a popover should close under
|
|
@@ -162,6 +162,7 @@ export const Select = styled.select< SelectProps >`
|
|
|
162
162
|
cursor: inherit;
|
|
163
163
|
display: block;
|
|
164
164
|
font-family: inherit;
|
|
165
|
+
line-height: 1.3; // Override forms.css styles, large enough value to prevent descender clipping without affecting height
|
|
165
166
|
margin: 0;
|
|
166
167
|
width: 100%;
|
|
167
168
|
max-width: none;
|
|
@@ -137,7 +137,6 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
137
137
|
user-select: none;
|
|
138
138
|
width: 100%;
|
|
139
139
|
z-index: 2;
|
|
140
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
141
140
|
height: 38px;
|
|
142
141
|
aspect-ratio: 1;
|
|
143
142
|
padding-left: 0;
|
|
@@ -157,12 +156,13 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
157
156
|
border: 0;
|
|
158
157
|
}
|
|
159
158
|
|
|
160
|
-
.emotion-12[disabled]
|
|
159
|
+
.emotion-12[disabled],
|
|
160
|
+
.emotion-12[aria-disabled='true'] {
|
|
161
161
|
opacity: 0.4;
|
|
162
162
|
cursor: default;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
.emotion-12:hover {
|
|
165
|
+
.emotion-12:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
166
166
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -211,7 +211,6 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
211
211
|
user-select: none;
|
|
212
212
|
width: 100%;
|
|
213
213
|
z-index: 2;
|
|
214
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
215
214
|
height: 38px;
|
|
216
215
|
aspect-ratio: 1;
|
|
217
216
|
padding-left: 0;
|
|
@@ -229,12 +228,13 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
229
228
|
border: 0;
|
|
230
229
|
}
|
|
231
230
|
|
|
232
|
-
.emotion-17[disabled]
|
|
231
|
+
.emotion-17[disabled],
|
|
232
|
+
.emotion-17[aria-disabled='true'] {
|
|
233
233
|
opacity: 0.4;
|
|
234
234
|
cursor: default;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
.emotion-17:hover {
|
|
237
|
+
.emotion-17:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
238
238
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
239
239
|
}
|
|
240
240
|
|
|
@@ -491,12 +491,13 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
491
491
|
border: 0;
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
-
.emotion-12[disabled]
|
|
494
|
+
.emotion-12[disabled],
|
|
495
|
+
.emotion-12[aria-disabled='true'] {
|
|
495
496
|
opacity: 0.4;
|
|
496
497
|
cursor: default;
|
|
497
498
|
}
|
|
498
499
|
|
|
499
|
-
.emotion-12:hover {
|
|
500
|
+
.emotion-12:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
500
501
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
501
502
|
}
|
|
502
503
|
|
|
@@ -726,7 +727,6 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
726
727
|
user-select: none;
|
|
727
728
|
width: 100%;
|
|
728
729
|
z-index: 2;
|
|
729
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
730
730
|
height: 38px;
|
|
731
731
|
aspect-ratio: 1;
|
|
732
732
|
padding-left: 0;
|
|
@@ -746,12 +746,13 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
746
746
|
border: 0;
|
|
747
747
|
}
|
|
748
748
|
|
|
749
|
-
.emotion-12[disabled]
|
|
749
|
+
.emotion-12[disabled],
|
|
750
|
+
.emotion-12[aria-disabled='true'] {
|
|
750
751
|
opacity: 0.4;
|
|
751
752
|
cursor: default;
|
|
752
753
|
}
|
|
753
754
|
|
|
754
|
-
.emotion-12:hover {
|
|
755
|
+
.emotion-12:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
755
756
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
756
757
|
}
|
|
757
758
|
|
|
@@ -800,7 +801,6 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
800
801
|
user-select: none;
|
|
801
802
|
width: 100%;
|
|
802
803
|
z-index: 2;
|
|
803
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
804
804
|
height: 38px;
|
|
805
805
|
aspect-ratio: 1;
|
|
806
806
|
padding-left: 0;
|
|
@@ -818,12 +818,13 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
818
818
|
border: 0;
|
|
819
819
|
}
|
|
820
820
|
|
|
821
|
-
.emotion-17[disabled]
|
|
821
|
+
.emotion-17[disabled],
|
|
822
|
+
.emotion-17[aria-disabled='true'] {
|
|
822
823
|
opacity: 0.4;
|
|
823
824
|
cursor: default;
|
|
824
825
|
}
|
|
825
826
|
|
|
826
|
-
.emotion-17:hover {
|
|
827
|
+
.emotion-17:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
827
828
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
828
829
|
}
|
|
829
830
|
|
|
@@ -1074,12 +1075,13 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
1074
1075
|
border: 0;
|
|
1075
1076
|
}
|
|
1076
1077
|
|
|
1077
|
-
.emotion-12[disabled]
|
|
1078
|
+
.emotion-12[disabled],
|
|
1079
|
+
.emotion-12[aria-disabled='true'] {
|
|
1078
1080
|
opacity: 0.4;
|
|
1079
1081
|
cursor: default;
|
|
1080
1082
|
}
|
|
1081
1083
|
|
|
1082
|
-
.emotion-12:hover {
|
|
1084
|
+
.emotion-12:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
1083
1085
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
1084
1086
|
}
|
|
1085
1087
|
|
|
@@ -63,13 +63,14 @@ export const buttonView = ( {
|
|
|
63
63
|
border: 0;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
&[disabled]
|
|
66
|
+
&[disabled],
|
|
67
|
+
&[aria-disabled='true'] {
|
|
67
68
|
opacity: 0.4;
|
|
68
69
|
cursor: default;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
&:hover {
|
|
72
|
-
color: ${ COLORS.theme.
|
|
72
|
+
&:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
73
|
+
color: ${ COLORS.theme.foreground };
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
${ isDeselectable && deselectable }
|
|
@@ -83,8 +84,6 @@ const pressed = css`
|
|
|
83
84
|
`;
|
|
84
85
|
|
|
85
86
|
const deselectable = css`
|
|
86
|
-
color: ${ COLORS.theme.foreground };
|
|
87
|
-
|
|
88
87
|
&:focus {
|
|
89
88
|
outline: ${ CONFIG.borderWidthFocus } solid ${ COLORS.ui.borderFocus };
|
|
90
89
|
outline-offset: 2px;
|
|
@@ -112,7 +111,6 @@ const isIconStyles = ( {
|
|
|
112
111
|
};
|
|
113
112
|
|
|
114
113
|
return css`
|
|
115
|
-
color: ${ COLORS.theme.foreground };
|
|
116
114
|
height: ${ iconButtonSizes[ size ] };
|
|
117
115
|
aspect-ratio: 1;
|
|
118
116
|
padding-left: 0;
|
package/src/tools-panel/types.ts
CHANGED
|
@@ -20,7 +20,10 @@ export type ToolsPanelProps = {
|
|
|
20
20
|
/**
|
|
21
21
|
* The dropdown menu props to configure the panel's `DropdownMenu`.
|
|
22
22
|
*/
|
|
23
|
-
dropdownMenuProps?:
|
|
23
|
+
dropdownMenuProps?: Omit<
|
|
24
|
+
React.ComponentProps< typeof DropdownMenu >,
|
|
25
|
+
'label'
|
|
26
|
+
>;
|
|
24
27
|
/**
|
|
25
28
|
* Flags that the items in this ToolsPanel will be contained within an inner
|
|
26
29
|
* wrapper element allowing the panel to lay them out accordingly.
|