@wordpress/components 29.4.0 → 29.5.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 +24 -0
- package/build/border-control/border-control-dropdown/component.js +19 -21
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +3 -3
- package/build/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build/border-control/styles.js +24 -19
- package/build/border-control/styles.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker.js +1 -0
- package/build/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build/circular-option-picker/index.js +7 -0
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/circular-option-picker/types.js.map +1 -1
- package/build/circular-option-picker/utils.js +31 -0
- package/build/circular-option-picker/utils.js.map +1 -0
- package/build/color-palette/index.js +9 -29
- package/build/color-palette/index.js.map +1 -1
- package/build/duotone-picker/duotone-picker.js +8 -28
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/font-size-picker/types.js.map +1 -1
- package/build/gradient-picker/index.js +8 -28
- package/build/gradient-picker/index.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +22 -22
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/mobile/bottom-sheet/switch-cell.native.js +1 -1
- package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build/number-control/index.js +2 -2
- package/build/number-control/index.js.map +1 -1
- package/build/textarea-control/styles/textarea-control-styles.js +3 -3
- package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +19 -21
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +3 -3
- package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build-module/border-control/styles.js +22 -13
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +1 -0
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/circular-option-picker/index.js +1 -0
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/circular-option-picker/types.js.map +1 -1
- package/build-module/circular-option-picker/utils.js +25 -0
- package/build-module/circular-option-picker/utils.js.map +1 -0
- package/build-module/color-palette/index.js +7 -29
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +6 -28
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/font-size-picker/types.js.map +1 -1
- package/build-module/gradient-picker/index.js +6 -28
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +22 -22
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/mobile/bottom-sheet/switch-cell.native.js +1 -1
- package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build-module/number-control/index.js +2 -2
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/textarea-control/styles/textarea-control-styles.js +3 -3
- package/build-module/textarea-control/styles/textarea-control-styles.js.map +1 -1
- package/build-style/style-rtl.css +6 -6
- package/build-style/style.css +7 -6
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -1
- package/build-types/border-control/styles.d.ts +1 -1
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/circular-option-picker/index.d.ts +1 -0
- package/build-types/circular-option-picker/index.d.ts.map +1 -1
- package/build-types/circular-option-picker/types.d.ts +11 -7
- package/build-types/circular-option-picker/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/utils.d.ts +17 -0
- package/build-types/circular-option-picker/utils.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/font-size-picker/types.d.ts +4 -0
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/gradient-picker/index.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/border-box-control/test/index.tsx +1 -1
- package/src/border-control/border-control-dropdown/component.tsx +8 -12
- package/src/border-control/border-control-dropdown/hook.ts +3 -3
- package/src/border-control/styles.ts +4 -10
- package/src/border-control/test/index.js +1 -1
- package/src/circular-option-picker/README.md +13 -0
- package/src/circular-option-picker/circular-option-picker.tsx +1 -1
- package/src/circular-option-picker/index.tsx +1 -0
- package/src/circular-option-picker/stories/index.story.tsx +1 -1
- package/src/circular-option-picker/test/index.tsx +1 -0
- package/src/circular-option-picker/types.ts +11 -10
- package/src/circular-option-picker/utils.tsx +27 -0
- package/src/color-palette/index.tsx +11 -29
- package/src/color-palette/test/index.tsx +1 -1
- package/src/duotone-picker/duotone-picker.tsx +10 -28
- package/src/font-size-picker/README.md +2 -0
- package/src/font-size-picker/stories/index.story.tsx +4 -0
- package/src/font-size-picker/types.ts +4 -0
- package/src/gradient-picker/index.tsx +10 -28
- package/src/input-control/styles/input-control-styles.tsx +9 -1
- package/src/mobile/bottom-sheet/switch-cell.native.js +1 -1
- package/src/notice/README.md +1 -1
- package/src/notice/style.scss +1 -0
- package/src/number-control/README.md +1 -1
- package/src/number-control/index.tsx +2 -2
- package/src/text-control/style.scss +6 -0
- package/src/textarea-control/styles/textarea-control-styles.ts +0 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gradient-picker/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gradient-picker/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACX,4BAA4B,EAI5B,MAAM,SAAS,CAAC;AAgIjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,cAAc,CAAE,EAC/B,SAAS,EACT,SAAc,EACd,QAAQ,EACR,KAAK,EACL,SAAgB,EAChB,WAAkB,EAClB,sBAA8B,EAC9B,iCAAiC,EACjC,YAAgB,EAChB,GAAG,eAAe,EAClB,EAAE,4BAA4B,+BA2C9B;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-control-styles.d.ts","sourceRoot":"","sources":["../../../src/input-control/styles/input-control-styles.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAE9E,KAAK,cAAc,GAAG;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,aAAa,CAAE,OAAO,CAAE,CAAC;IAChD,aAAa,CAAC,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,MAAM;;SATuC,MAAO,WAAW;2GAY3E,CAAC;AAEF,eAAO,MAAM,MAAM;;SAduC,MAAO,WAAW;2GAmB3E,CAAC;AAEF,KAAK,aAAa,GAAG;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAiBF,eAAO,MAAM,UAAU;;SAzCmC,MAAO,WAAW;yHA2D3E,CAAC;AAEF,eAAO,MAAM,IAAI;;;;UAgBhB,CAAC;AA+BF,eAAO,MAAM,SAAS;;SA5GoC,MAAO,WAAW;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src/textarea-control/styles/textarea-control-styles.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,cAAc;;SAfI,MAAQ,WAC/B;
|
|
1
|
+
{"version":3,"file":"textarea-control-styles.d.ts","sourceRoot":"","sources":["../../../src/textarea-control/styles/textarea-control-styles.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,cAAc;;SAfI,MAAQ,WAC/B;2HAgEP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "29.
|
|
3
|
+
"version": "29.5.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -44,23 +44,23 @@
|
|
|
44
44
|
"@types/gradient-parser": "0.1.3",
|
|
45
45
|
"@types/highlight-words-core": "1.2.1",
|
|
46
46
|
"@use-gesture/react": "^10.3.1",
|
|
47
|
-
"@wordpress/a11y": "^4.
|
|
48
|
-
"@wordpress/compose": "^7.
|
|
49
|
-
"@wordpress/date": "^5.
|
|
50
|
-
"@wordpress/deprecated": "^4.
|
|
51
|
-
"@wordpress/dom": "^4.
|
|
52
|
-
"@wordpress/element": "^6.
|
|
53
|
-
"@wordpress/escape-html": "^3.
|
|
54
|
-
"@wordpress/hooks": "^4.
|
|
55
|
-
"@wordpress/html-entities": "^4.
|
|
56
|
-
"@wordpress/i18n": "^5.
|
|
57
|
-
"@wordpress/icons": "^10.
|
|
58
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
59
|
-
"@wordpress/keycodes": "^4.
|
|
60
|
-
"@wordpress/primitives": "^4.
|
|
61
|
-
"@wordpress/private-apis": "^1.
|
|
62
|
-
"@wordpress/rich-text": "^7.
|
|
63
|
-
"@wordpress/warning": "^3.
|
|
47
|
+
"@wordpress/a11y": "^4.19.0",
|
|
48
|
+
"@wordpress/compose": "^7.19.0",
|
|
49
|
+
"@wordpress/date": "^5.19.0",
|
|
50
|
+
"@wordpress/deprecated": "^4.19.0",
|
|
51
|
+
"@wordpress/dom": "^4.19.0",
|
|
52
|
+
"@wordpress/element": "^6.19.0",
|
|
53
|
+
"@wordpress/escape-html": "^3.19.0",
|
|
54
|
+
"@wordpress/hooks": "^4.19.0",
|
|
55
|
+
"@wordpress/html-entities": "^4.19.0",
|
|
56
|
+
"@wordpress/i18n": "^5.19.0",
|
|
57
|
+
"@wordpress/icons": "^10.19.0",
|
|
58
|
+
"@wordpress/is-shallow-equal": "^5.19.0",
|
|
59
|
+
"@wordpress/keycodes": "^4.19.0",
|
|
60
|
+
"@wordpress/primitives": "^4.19.0",
|
|
61
|
+
"@wordpress/private-apis": "^1.19.0",
|
|
62
|
+
"@wordpress/rich-text": "^7.19.0",
|
|
63
|
+
"@wordpress/warning": "^3.19.0",
|
|
64
64
|
"change-case": "^4.1.2",
|
|
65
65
|
"clsx": "^2.1.1",
|
|
66
66
|
"colord": "^2.7.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "d6b0b20fa927b110140dc7fdd906a7e0bf662004"
|
|
89
89
|
}
|
|
@@ -157,7 +157,7 @@ const BorderControlDropdown = (
|
|
|
157
157
|
onStyleChange,
|
|
158
158
|
popoverContentClassName,
|
|
159
159
|
popoverControlsClassName,
|
|
160
|
-
|
|
160
|
+
resetButtonWrapperClassName,
|
|
161
161
|
size,
|
|
162
162
|
__unstablePopoverProps,
|
|
163
163
|
...otherProps
|
|
@@ -173,7 +173,7 @@ const BorderControlDropdown = (
|
|
|
173
173
|
enableStyle
|
|
174
174
|
);
|
|
175
175
|
|
|
176
|
-
const
|
|
176
|
+
const enableResetButton = color || ( style && style !== 'none' );
|
|
177
177
|
const dropdownPosition = __experimentalIsRenderedInSidebar
|
|
178
178
|
? 'bottom left'
|
|
179
179
|
: undefined;
|
|
@@ -199,9 +199,7 @@ const BorderControlDropdown = (
|
|
|
199
199
|
</Button>
|
|
200
200
|
);
|
|
201
201
|
|
|
202
|
-
const renderContent: DropdownComponentProps[ 'renderContent' ] = (
|
|
203
|
-
onClose,
|
|
204
|
-
} ) => (
|
|
202
|
+
const renderContent: DropdownComponentProps[ 'renderContent' ] = () => (
|
|
205
203
|
<>
|
|
206
204
|
<DropdownContentWrapper paddingSize="medium">
|
|
207
205
|
<VStack className={ popoverControlsClassName } spacing={ 6 }>
|
|
@@ -224,22 +222,20 @@ const BorderControlDropdown = (
|
|
|
224
222
|
/>
|
|
225
223
|
) }
|
|
226
224
|
</VStack>
|
|
227
|
-
|
|
228
|
-
{ showResetButton && (
|
|
229
|
-
<DropdownContentWrapper paddingSize="none">
|
|
225
|
+
<div className={ resetButtonWrapperClassName }>
|
|
230
226
|
<Button
|
|
231
|
-
className={ resetButtonClassName }
|
|
232
227
|
variant="tertiary"
|
|
233
228
|
onClick={ () => {
|
|
234
229
|
onReset();
|
|
235
|
-
onClose();
|
|
236
230
|
} }
|
|
231
|
+
disabled={ ! enableResetButton }
|
|
232
|
+
accessibleWhenDisabled
|
|
237
233
|
__next40pxDefaultSize
|
|
238
234
|
>
|
|
239
235
|
{ __( 'Reset' ) }
|
|
240
236
|
</Button>
|
|
241
|
-
</
|
|
242
|
-
|
|
237
|
+
</div>
|
|
238
|
+
</DropdownContentWrapper>
|
|
243
239
|
</>
|
|
244
240
|
);
|
|
245
241
|
|
|
@@ -76,8 +76,8 @@ export function useBorderControlDropdown(
|
|
|
76
76
|
return cx( styles.borderControlPopoverContent );
|
|
77
77
|
}, [ cx ] );
|
|
78
78
|
|
|
79
|
-
const
|
|
80
|
-
return cx( styles.
|
|
79
|
+
const resetButtonWrapperClassName = useMemo( () => {
|
|
80
|
+
return cx( styles.resetButtonWrapper );
|
|
81
81
|
}, [ cx ] );
|
|
82
82
|
|
|
83
83
|
return {
|
|
@@ -94,7 +94,7 @@ export function useBorderControlDropdown(
|
|
|
94
94
|
onReset,
|
|
95
95
|
popoverContentClassName,
|
|
96
96
|
popoverControlsClassName,
|
|
97
|
-
|
|
97
|
+
resetButtonWrapperClassName,
|
|
98
98
|
size,
|
|
99
99
|
__experimentalIsRenderedInSidebar,
|
|
100
100
|
};
|
|
@@ -147,16 +147,10 @@ export const borderControlPopoverControls = css`
|
|
|
147
147
|
export const borderControlPopoverContent = css``;
|
|
148
148
|
export const borderColorIndicator = css``;
|
|
149
149
|
|
|
150
|
-
export const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
/* Override button component styling */
|
|
155
|
-
&& {
|
|
156
|
-
border-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 400 ] };
|
|
157
|
-
border-top-left-radius: 0;
|
|
158
|
-
border-top-right-radius: 0;
|
|
159
|
-
}
|
|
150
|
+
export const resetButtonWrapper = css`
|
|
151
|
+
display: flex;
|
|
152
|
+
justify-content: flex-end;
|
|
153
|
+
margin-top: 12px;
|
|
160
154
|
`;
|
|
161
155
|
|
|
162
156
|
export const borderSlider = () => css`
|
|
@@ -138,7 +138,7 @@ describe( 'BorderControl', () => {
|
|
|
138
138
|
|
|
139
139
|
const customColorPicker = getButton( /Custom color picker/ );
|
|
140
140
|
const circularOptionPicker = screen.getByRole( 'listbox', {
|
|
141
|
-
name: 'Custom color picker
|
|
141
|
+
name: 'Custom color picker',
|
|
142
142
|
} );
|
|
143
143
|
const colorSwatchButtons =
|
|
144
144
|
within( circularOptionPicker ).getAllByRole( 'option' );
|
|
@@ -93,6 +93,19 @@ Prevents keyboard interaction from wrapping around. Only used when `asButtons` i
|
|
|
93
93
|
- Required: No
|
|
94
94
|
- Default: `true`
|
|
95
95
|
|
|
96
|
+
### `aria-labelledby`: `string`
|
|
97
|
+
|
|
98
|
+
The ID reference list of one or more elements that label the wrapper element.
|
|
99
|
+
|
|
100
|
+
- Required: No
|
|
101
|
+
|
|
102
|
+
### `aria-label`: `string`
|
|
103
|
+
|
|
104
|
+
The label for the wrapper element. Not used if an 'aria-labelledby' is provided.
|
|
105
|
+
|
|
106
|
+
- Required: No
|
|
107
|
+
- Default: `Custom color picker`
|
|
108
|
+
|
|
96
109
|
## Subcomponents
|
|
97
110
|
|
|
98
111
|
### `CircularOptionPicker.ButtonAction`
|
|
@@ -132,7 +132,7 @@ function ButtonsCircularOptionPicker(
|
|
|
132
132
|
);
|
|
133
133
|
|
|
134
134
|
return (
|
|
135
|
-
<div { ...additionalProps } id={ baseId }>
|
|
135
|
+
<div { ...additionalProps } role="group" id={ baseId }>
|
|
136
136
|
<CircularOptionPickerContext.Provider value={ contextValue }>
|
|
137
137
|
{ options }
|
|
138
138
|
{ children }
|
|
@@ -131,7 +131,7 @@ WithLoopingDisabled.parameters = {
|
|
|
131
131
|
docs: {
|
|
132
132
|
source: {
|
|
133
133
|
code: `<CircularOptionPicker
|
|
134
|
-
|
|
134
|
+
'aria-label': 'Circular Option Picker',
|
|
135
135
|
loop={false}
|
|
136
136
|
options={<DefaultOptions />}
|
|
137
137
|
/>`,
|
|
@@ -57,6 +57,7 @@ describe( 'CircularOptionPicker', () => {
|
|
|
57
57
|
|
|
58
58
|
expect( screen.queryByRole( 'listbox' ) ).not.toBeInTheDocument();
|
|
59
59
|
expect( screen.queryByRole( 'option' ) ).not.toBeInTheDocument();
|
|
60
|
+
expect( screen.getByRole( 'group' ) ).toBeInTheDocument();
|
|
60
61
|
expect( screen.getByRole( 'button' ) ).toBeInTheDocument();
|
|
61
62
|
} );
|
|
62
63
|
} );
|
|
@@ -40,6 +40,16 @@ type CommonCircularOptionPickerProps = {
|
|
|
40
40
|
* The child elements.
|
|
41
41
|
*/
|
|
42
42
|
children?: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* The ID reference list of one or more elements that label the wrapper
|
|
45
|
+
* element.
|
|
46
|
+
*/
|
|
47
|
+
'aria-labelledby'?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The label for the wrapper element. Defaults to 'Custom color picker'. Not
|
|
50
|
+
* used if an 'aria-labelledby' is provided.
|
|
51
|
+
*/
|
|
52
|
+
'aria-label'?: string;
|
|
43
53
|
};
|
|
44
54
|
|
|
45
55
|
type WithBaseId = {
|
|
@@ -59,16 +69,7 @@ type FullListboxCircularOptionPickerProps = CommonCircularOptionPickerProps & {
|
|
|
59
69
|
* @default true
|
|
60
70
|
*/
|
|
61
71
|
loop?: boolean;
|
|
62
|
-
}
|
|
63
|
-
| {
|
|
64
|
-
'aria-label': string;
|
|
65
|
-
'aria-labelledby'?: never;
|
|
66
|
-
}
|
|
67
|
-
| {
|
|
68
|
-
'aria-label'?: never;
|
|
69
|
-
'aria-labelledby': string;
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
+
};
|
|
72
73
|
|
|
73
74
|
export type ListboxCircularOptionPickerProps = WithBaseId &
|
|
74
75
|
Omit< FullListboxCircularOptionPickerProps, 'asButtons' >;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Computes the common props for the CircularOptionPicker.
|
|
8
|
+
*/
|
|
9
|
+
export function getComputeCircularOptionPickerCommonProps(
|
|
10
|
+
asButtons?: boolean,
|
|
11
|
+
loop?: boolean,
|
|
12
|
+
ariaLabel?: string,
|
|
13
|
+
ariaLabelledby?: string
|
|
14
|
+
) {
|
|
15
|
+
const metaProps = asButtons
|
|
16
|
+
? { asButtons: true }
|
|
17
|
+
: { asButtons: false, loop };
|
|
18
|
+
|
|
19
|
+
const labelProps = {
|
|
20
|
+
'aria-labelledby': ariaLabelledby,
|
|
21
|
+
'aria-label': ariaLabelledby
|
|
22
|
+
? undefined
|
|
23
|
+
: ariaLabel || __( 'Custom color picker' ),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return { metaProps, labelProps };
|
|
27
|
+
}
|
|
@@ -19,7 +19,9 @@ import { useCallback, useMemo, useState, forwardRef } from '@wordpress/element';
|
|
|
19
19
|
*/
|
|
20
20
|
import Dropdown from '../dropdown';
|
|
21
21
|
import { ColorPicker } from '../color-picker';
|
|
22
|
-
import CircularOptionPicker
|
|
22
|
+
import CircularOptionPicker, {
|
|
23
|
+
getComputeCircularOptionPickerCommonProps,
|
|
24
|
+
} from '../circular-option-picker';
|
|
23
25
|
import { VStack } from '../v-stack';
|
|
24
26
|
import { Truncate } from '../truncate';
|
|
25
27
|
import { ColorHeading } from './styles';
|
|
@@ -233,7 +235,7 @@ function UnforwardedColorPalette(
|
|
|
233
235
|
buttonLabelName,
|
|
234
236
|
displayValue
|
|
235
237
|
)
|
|
236
|
-
: __( 'Custom color picker
|
|
238
|
+
: __( 'Custom color picker' );
|
|
237
239
|
|
|
238
240
|
const paletteCommonProps = {
|
|
239
241
|
clearColor,
|
|
@@ -251,33 +253,12 @@ function UnforwardedColorPalette(
|
|
|
251
253
|
</CircularOptionPicker.ButtonAction>
|
|
252
254
|
);
|
|
253
255
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
metaProps = { asButtons: true };
|
|
261
|
-
} else {
|
|
262
|
-
const _metaProps: { asButtons: false; loop?: boolean } = {
|
|
263
|
-
asButtons: false,
|
|
264
|
-
loop,
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
if ( ariaLabel ) {
|
|
268
|
-
metaProps = { ..._metaProps, 'aria-label': ariaLabel };
|
|
269
|
-
} else if ( ariaLabelledby ) {
|
|
270
|
-
metaProps = {
|
|
271
|
-
..._metaProps,
|
|
272
|
-
'aria-labelledby': ariaLabelledby,
|
|
273
|
-
};
|
|
274
|
-
} else {
|
|
275
|
-
metaProps = {
|
|
276
|
-
..._metaProps,
|
|
277
|
-
'aria-label': __( 'Custom color picker.' ),
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
}
|
|
256
|
+
const { metaProps, labelProps } = getComputeCircularOptionPickerCommonProps(
|
|
257
|
+
asButtons,
|
|
258
|
+
loop,
|
|
259
|
+
ariaLabel,
|
|
260
|
+
ariaLabelledby
|
|
261
|
+
);
|
|
281
262
|
|
|
282
263
|
return (
|
|
283
264
|
<VStack spacing={ 3 } ref={ forwardedRef } { ...additionalProps }>
|
|
@@ -335,6 +316,7 @@ function UnforwardedColorPalette(
|
|
|
335
316
|
{ ( colors.length > 0 || actions ) && (
|
|
336
317
|
<CircularOptionPicker
|
|
337
318
|
{ ...metaProps }
|
|
319
|
+
{ ...labelProps }
|
|
338
320
|
actions={ actions }
|
|
339
321
|
options={
|
|
340
322
|
hasMultipleColorOrigins ? (
|
|
@@ -258,7 +258,7 @@ describe( 'ColorPalette', () => {
|
|
|
258
258
|
expect( screen.queryByText( colorCode ) ).not.toBeInTheDocument();
|
|
259
259
|
expect(
|
|
260
260
|
screen.getByRole( 'button', {
|
|
261
|
-
name: /^Custom color picker
|
|
261
|
+
name: /^Custom color picker$/,
|
|
262
262
|
} )
|
|
263
263
|
).toBeInTheDocument();
|
|
264
264
|
} );
|
|
@@ -13,7 +13,9 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
import ColorListPicker from './color-list-picker';
|
|
16
|
-
import CircularOptionPicker
|
|
16
|
+
import CircularOptionPicker, {
|
|
17
|
+
getComputeCircularOptionPickerCommonProps,
|
|
18
|
+
} from '../circular-option-picker';
|
|
17
19
|
import { VStack } from '../v-stack';
|
|
18
20
|
|
|
19
21
|
import CustomDuotoneBar from './custom-duotone-bar';
|
|
@@ -127,33 +129,12 @@ function DuotonePicker( {
|
|
|
127
129
|
);
|
|
128
130
|
} );
|
|
129
131
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
metaProps = { asButtons: true };
|
|
137
|
-
} else {
|
|
138
|
-
const _metaProps: { asButtons: false; loop?: boolean } = {
|
|
139
|
-
asButtons: false,
|
|
140
|
-
loop,
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
if ( ariaLabel ) {
|
|
144
|
-
metaProps = { ..._metaProps, 'aria-label': ariaLabel };
|
|
145
|
-
} else if ( ariaLabelledby ) {
|
|
146
|
-
metaProps = {
|
|
147
|
-
..._metaProps,
|
|
148
|
-
'aria-labelledby': ariaLabelledby,
|
|
149
|
-
};
|
|
150
|
-
} else {
|
|
151
|
-
metaProps = {
|
|
152
|
-
..._metaProps,
|
|
153
|
-
'aria-label': __( 'Custom color picker.' ),
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
}
|
|
132
|
+
const { metaProps, labelProps } = getComputeCircularOptionPickerCommonProps(
|
|
133
|
+
asButtons,
|
|
134
|
+
loop,
|
|
135
|
+
ariaLabel,
|
|
136
|
+
ariaLabelledby
|
|
137
|
+
);
|
|
157
138
|
|
|
158
139
|
const options = unsetable
|
|
159
140
|
? [ unsetOption, ...duotoneOptions ]
|
|
@@ -163,6 +144,7 @@ function DuotonePicker( {
|
|
|
163
144
|
<CircularOptionPicker
|
|
164
145
|
{ ...otherProps }
|
|
165
146
|
{ ...metaProps }
|
|
147
|
+
{ ...labelProps }
|
|
166
148
|
options={ options }
|
|
167
149
|
actions={
|
|
168
150
|
!! clearable && (
|
|
@@ -99,6 +99,8 @@ Available units for custom font size selection.
|
|
|
99
99
|
|
|
100
100
|
The current font size value.
|
|
101
101
|
|
|
102
|
+
**Note**: For the `units` property to work, the current font size value must be specified as strings with units (e.g., `'12px'` instead of `12`). When the font size is provided as a number, the component operates in "unitless mode" where the `units` property has no effect.
|
|
103
|
+
|
|
102
104
|
- Required: No
|
|
103
105
|
|
|
104
106
|
### `withReset`: `boolean`
|
|
@@ -18,6 +18,10 @@ const meta: Meta< typeof FontSizePicker > = {
|
|
|
18
18
|
component: FontSizePicker,
|
|
19
19
|
argTypes: {
|
|
20
20
|
value: { control: false },
|
|
21
|
+
units: {
|
|
22
|
+
control: 'inline-check',
|
|
23
|
+
options: [ 'px', 'em', 'rem', 'vw', 'vh' ],
|
|
24
|
+
},
|
|
21
25
|
},
|
|
22
26
|
parameters: {
|
|
23
27
|
actions: { argTypesRegex: '^on.*' },
|
|
@@ -34,6 +34,10 @@ export type FontSizePickerProps = {
|
|
|
34
34
|
units?: string[];
|
|
35
35
|
/**
|
|
36
36
|
* The current font size value.
|
|
37
|
+
*
|
|
38
|
+
* Note: For the `units` property to work, the current font size value must be specified
|
|
39
|
+
* as strings with units (e.g., '12px' instead of 12). When the font size is provided
|
|
40
|
+
* as a number, the component operates in "unitless mode" where the `units` property has no effect.
|
|
37
41
|
*/
|
|
38
42
|
value?: number | string;
|
|
39
43
|
/**
|
|
@@ -8,7 +8,9 @@ import { useCallback, useMemo } from '@wordpress/element';
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
import CircularOptionPicker
|
|
11
|
+
import CircularOptionPicker, {
|
|
12
|
+
getComputeCircularOptionPickerCommonProps,
|
|
13
|
+
} from '../circular-option-picker';
|
|
12
14
|
import CustomGradientPicker from '../custom-gradient-picker';
|
|
13
15
|
import { VStack } from '../v-stack';
|
|
14
16
|
import { ColorHeading } from '../color-palette/styles';
|
|
@@ -128,37 +130,17 @@ function Component( props: PickerProps< any > ) {
|
|
|
128
130
|
<SingleOrigin { ...additionalProps } />
|
|
129
131
|
);
|
|
130
132
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
metaProps = { asButtons: true };
|
|
138
|
-
} else {
|
|
139
|
-
const _metaProps: { asButtons: false; loop?: boolean } = {
|
|
140
|
-
asButtons: false,
|
|
141
|
-
loop,
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
if ( ariaLabel ) {
|
|
145
|
-
metaProps = { ..._metaProps, 'aria-label': ariaLabel };
|
|
146
|
-
} else if ( ariaLabelledby ) {
|
|
147
|
-
metaProps = {
|
|
148
|
-
..._metaProps,
|
|
149
|
-
'aria-labelledby': ariaLabelledby,
|
|
150
|
-
};
|
|
151
|
-
} else {
|
|
152
|
-
metaProps = {
|
|
153
|
-
..._metaProps,
|
|
154
|
-
'aria-label': __( 'Custom color picker.' ),
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
}
|
|
133
|
+
const { metaProps, labelProps } = getComputeCircularOptionPickerCommonProps(
|
|
134
|
+
asButtons,
|
|
135
|
+
loop,
|
|
136
|
+
ariaLabel,
|
|
137
|
+
ariaLabelledby
|
|
138
|
+
);
|
|
158
139
|
|
|
159
140
|
return (
|
|
160
141
|
<CircularOptionPicker
|
|
161
142
|
{ ...metaProps }
|
|
143
|
+
{ ...labelProps }
|
|
162
144
|
actions={ actions }
|
|
163
145
|
options={ options }
|
|
164
146
|
/>
|
|
@@ -285,7 +285,15 @@ export const Input = styled.input< InputProps >`
|
|
|
285
285
|
${ customPaddings }
|
|
286
286
|
|
|
287
287
|
&::-webkit-input-placeholder {
|
|
288
|
-
|
|
288
|
+
color: ${ COLORS.ui.darkGrayPlaceholder };
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
&::-moz-placeholder {
|
|
292
|
+
color: ${ COLORS.ui.darkGrayPlaceholder };
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&:-ms-input-placeholder {
|
|
296
|
+
color: ${ COLORS.ui.darkGrayPlaceholder };
|
|
289
297
|
}
|
|
290
298
|
|
|
291
299
|
&[type='email'],
|
|
@@ -57,7 +57,7 @@ export default function BottomSheetSwitchCell( props ) {
|
|
|
57
57
|
accessibilityRole="none"
|
|
58
58
|
accessibilityHint={
|
|
59
59
|
/* translators: accessibility text (hint for switches) */
|
|
60
|
-
__( 'Double tap to
|
|
60
|
+
__( 'Double tap to change setting' )
|
|
61
61
|
}
|
|
62
62
|
onPress={ onPress }
|
|
63
63
|
editable={ false }
|
package/src/notice/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Notices are color-coded to indicate the type of message being communicated:
|
|
|
19
19
|
- **Informational** notices are **blue** by default.
|
|
20
20
|
- If there is a parent `Theme` component with an `accent` color prop, informational notices will take on that color instead.
|
|
21
21
|
- **Success** notices are **green.**
|
|
22
|
-
- **Warning** notices are **yellow
|
|
22
|
+
- **Warning** notices are **yellow.**
|
|
23
23
|
- **Error** notices are **red.**
|
|
24
24
|
|
|
25
25
|
If an icon is included in the Notice, it should be color-coded to match the Notice state.
|
package/src/notice/style.scss
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
|
-
NumberControl is an enhanced HTML [`input[type="number]`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number) element.
|
|
7
|
+
NumberControl is an enhanced HTML [`input[type="number"]`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number) element.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
@@ -229,8 +229,8 @@ function UnforwardedNumberControl(
|
|
|
229
229
|
hideHTMLArrows={ spinControls !== 'native' }
|
|
230
230
|
isDragEnabled={ isDragEnabled }
|
|
231
231
|
label={ label }
|
|
232
|
-
max={ max }
|
|
233
|
-
min={ min }
|
|
232
|
+
max={ max === Infinity ? undefined : max }
|
|
233
|
+
min={ min === -Infinity ? undefined : min }
|
|
234
234
|
ref={ mergedRef }
|
|
235
235
|
required={ required }
|
|
236
236
|
step={ step }
|
|
@@ -62,7 +62,6 @@ export const StyledTextarea = styled.textarea`
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
&::-moz-placeholder {
|
|
65
|
-
opacity: 1; // Necessary because Firefox reduces this from 1.
|
|
66
65
|
color: ${ COLORS.ui.darkGrayPlaceholder };
|
|
67
66
|
}
|
|
68
67
|
|
|
@@ -76,7 +75,6 @@ export const StyledTextarea = styled.textarea`
|
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
&::-moz-placeholder {
|
|
79
|
-
opacity: 1; // Necessary because Firefox reduces this from 1.
|
|
80
78
|
color: ${ COLORS.ui.lightGrayPlaceholder };
|
|
81
79
|
}
|
|
82
80
|
|