@wordpress/components 27.1.0 → 27.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 +53 -3
- package/README.md +13 -0
- package/build/button/index.js +3 -4
- package/build/button/index.js.map +1 -1
- package/build/button/types.js.map +1 -1
- package/build/color-picker/component.js +2 -12
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/picker.js +18 -77
- package/build/color-picker/picker.js.map +1 -1
- package/build/color-picker/types.js.map +1 -1
- package/build/custom-select-control-v2/default-component/index.js +4 -2
- package/build/custom-select-control-v2/default-component/index.js.map +1 -1
- package/build/custom-select-control-v2/index.js +1 -8
- package/build/custom-select-control-v2/index.js.map +1 -1
- package/build/custom-select-control-v2/{custom-select-item.js → item.js} +2 -1
- package/build/custom-select-control-v2/{custom-select-item.js.map → item.js.map} +1 -1
- package/build/custom-select-control-v2/legacy-component/index.js +5 -5
- package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
- package/build/date-time/date/styles.js +7 -7
- package/build/date-time/date/styles.js.map +1 -1
- package/build/form-token-field/index.js +1 -1
- package/build/form-token-field/index.js.map +1 -1
- package/build/input-control/index.js +1 -1
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-field.js +2 -1
- package/build/input-control/input-field.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +1 -0
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +162 -120
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +2 -2
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/palette-edit/index.js +18 -12
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +7 -34
- package/build/popover/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +29 -29
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/text-control/types.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +5 -2
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +1 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/utils/config-values.js +1 -1
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/input/base.js +2 -2
- package/build/utils/input/base.js.map +1 -1
- package/build-module/button/index.js +3 -4
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/types.js.map +1 -1
- package/build-module/color-picker/component.js +3 -13
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/picker.js +19 -78
- package/build-module/color-picker/picker.js.map +1 -1
- package/build-module/color-picker/types.js.map +1 -1
- package/build-module/custom-select-control-v2/default-component/index.js +4 -2
- package/build-module/custom-select-control-v2/default-component/index.js.map +1 -1
- package/build-module/custom-select-control-v2/index.js +1 -2
- package/build-module/custom-select-control-v2/index.js.map +1 -1
- package/build-module/custom-select-control-v2/{custom-select-item.js → item.js} +2 -1
- package/build-module/custom-select-control-v2/{custom-select-item.js.map → item.js.map} +1 -1
- package/build-module/custom-select-control-v2/legacy-component/index.js +4 -4
- package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
- package/build-module/date-time/date/styles.js +7 -7
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/form-token-field/index.js +1 -1
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/input-control/index.js +1 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-field.js +2 -1
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +1 -0
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +163 -121
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +2 -2
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/palette-edit/index.js +17 -11
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +9 -36
- package/build-module/popover/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +29 -29
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/text-control/types.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +6 -3
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/utils/config-values.js +1 -1
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/input/base.js +2 -2
- package/build-module/utils/input/base.js.map +1 -1
- package/build-style/style-rtl.css +26 -29
- package/build-style/style.css +26 -29
- package/build-types/box-control/styles/box-control-styles.d.ts +1 -1
- package/build-types/button/deprecated.d.ts +4 -10
- package/build-types/button/deprecated.d.ts.map +1 -1
- package/build-types/button/index.d.ts +3 -3
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +7 -7
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/button/types.d.ts +37 -8
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/color-picker/component.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/styles.d.ts +1 -1
- package/build-types/color-picker/types.d.ts +0 -3
- package/build-types/color-picker/types.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts +35 -0
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/default-component/index.d.ts +5 -2
- package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/index.d.ts +1 -2
- package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/{custom-select-item.d.ts → item.d.ts} +4 -1
- package/build-types/custom-select-control-v2/item.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts +2 -2
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/default.story.d.ts +2 -2
- package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/legacy.story.d.ts +4 -2
- package/build-types/custom-select-control-v2/stories/legacy.story.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +1 -1
- package/build-types/dropdown/stories/index.story.d.ts +1 -0
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts +1 -1
- package/build-types/form-token-field/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +0 -1
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +1 -2
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +0 -1
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +1 -2
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +0 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/palette-edit/index.d.ts +6 -3
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +2 -2
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +1 -1
- package/build-types/text-control/types.d.ts +1 -1
- package/build-types/text-control/types.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +4 -10
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/button/index.tsx +3 -4
- package/src/button/test/index.tsx +6 -6
- package/src/button/types.ts +37 -9
- package/src/color-picker/component.tsx +3 -25
- package/src/color-picker/picker.tsx +12 -96
- package/src/color-picker/types.ts +0 -3
- package/src/confirm-dialog/README.md +7 -0
- package/src/custom-select-control/stories/{index.story.js → index.story.tsx} +8 -3
- package/src/custom-select-control/test/index.js +24 -0
- package/src/custom-select-control-v2/README.md +27 -27
- package/src/custom-select-control-v2/default-component/index.tsx +5 -2
- package/src/custom-select-control-v2/index.tsx +1 -2
- package/src/custom-select-control-v2/{custom-select-item.tsx → item.tsx} +2 -0
- package/src/custom-select-control-v2/legacy-component/index.tsx +4 -6
- package/src/custom-select-control-v2/legacy-component/test/index.tsx +13 -10
- package/src/custom-select-control-v2/stories/default.story.tsx +16 -17
- package/src/custom-select-control-v2/stories/legacy.story.tsx +20 -35
- package/src/custom-select-control-v2/test/index.tsx +26 -16
- package/src/date-time/date/styles.ts +2 -2
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
- package/src/dropdown/stories/index.story.tsx +19 -0
- package/src/dropdown/style.scss +26 -0
- package/src/dropdown-menu/style.scss +0 -25
- package/src/flex/flex/README.md +2 -2
- package/src/form-token-field/README.md +1 -1
- package/src/form-token-field/index.tsx +1 -1
- package/src/grid/README.md +11 -11
- package/src/h-stack/README.md +6 -6
- package/src/heading/README.md +1 -1
- package/src/heading/test/__snapshots__/index.tsx.snap +3 -3
- package/src/input-control/README.md +1 -1
- package/src/input-control/index.tsx +1 -1
- package/src/input-control/input-field.tsx +2 -1
- package/src/input-control/stories/index.story.tsx +1 -0
- package/src/item-group/test/__snapshots__/index.js.snap +11 -11
- package/src/mobile/bottom-sheet-select-control/README.md +1 -1
- package/src/mobile/color-settings/palette.screen.native.js +5 -1
- package/src/navigable-container/container.tsx +1 -1
- package/src/navigator/navigator-provider/component.tsx +187 -188
- package/src/navigator/navigator-screen/component.tsx +2 -4
- package/src/palette-edit/index.tsx +21 -21
- package/src/palette-edit/test/index.tsx +21 -17
- package/src/placeholder/style.scss +5 -1
- package/src/popover/index.tsx +59 -99
- package/src/popover/style.scss +0 -9
- package/src/progress-bar/README.md +1 -1
- package/src/radio-control/README.md +3 -3
- package/src/range-control/styles/range-control-styles.ts +1 -1
- package/src/resizable-box/resize-tooltip/README.md +2 -2
- package/src/text/test/__snapshots__/index.tsx.snap +3 -3
- package/src/text-control/style.scss +2 -0
- package/src/text-control/types.ts +12 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +14 -10
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +14 -12
- package/src/toolbar/toolbar/style.scss +1 -1
- package/src/tools-panel/tools-panel-header/component.tsx +1 -1
- package/src/truncate/README.md +5 -5
- package/src/utils/config-values.js +1 -1
- package/src/utils/input/base.js +1 -1
- package/src/v-stack/README.md +6 -6
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build-types/custom-select-control-v2/custom-select-item.d.ts.map +0 -1
|
@@ -12,7 +12,7 @@ import { useState } from '@wordpress/element';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
-
import
|
|
15
|
+
import UncontrolledCustomSelectControlV2 from '..';
|
|
16
16
|
import type { CustomSelectProps } from '../types';
|
|
17
17
|
|
|
18
18
|
const items = [
|
|
@@ -41,14 +41,14 @@ const items = [
|
|
|
41
41
|
const defaultProps = {
|
|
42
42
|
label: 'label!',
|
|
43
43
|
children: items.map( ( { value, key } ) => (
|
|
44
|
-
<
|
|
44
|
+
<UncontrolledCustomSelectControlV2.Item value={ value } key={ key } />
|
|
45
45
|
) ),
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
const
|
|
48
|
+
const ControlledCustomSelectControl = ( props: CustomSelectProps ) => {
|
|
49
49
|
const [ value, setValue ] = useState< string | string[] >();
|
|
50
50
|
return (
|
|
51
|
-
<
|
|
51
|
+
<UncontrolledCustomSelectControlV2
|
|
52
52
|
{ ...props }
|
|
53
53
|
onChange={ ( nextValue: string | string[] ) => {
|
|
54
54
|
setValue( nextValue );
|
|
@@ -60,8 +60,8 @@ const ControlledCustomSelect = ( props: CustomSelectProps ) => {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
describe.each( [
|
|
63
|
-
[ 'Uncontrolled',
|
|
64
|
-
[ 'Controlled',
|
|
63
|
+
[ 'Uncontrolled', UncontrolledCustomSelectControlV2 ],
|
|
64
|
+
[ 'Controlled', ControlledCustomSelectControl ],
|
|
65
65
|
] )( 'CustomSelectControlV2 (%s)', ( ...modeAndComponent ) => {
|
|
66
66
|
const [ , Component ] = modeAndComponent;
|
|
67
67
|
|
|
@@ -175,8 +175,10 @@ describe.each( [
|
|
|
175
175
|
await sleep();
|
|
176
176
|
await press.Tab();
|
|
177
177
|
expect( currentSelectedItem ).toHaveFocus();
|
|
178
|
+
expect( currentSelectedItem ).toHaveTextContent( 'violets' );
|
|
178
179
|
|
|
179
|
-
|
|
180
|
+
// Ideally we would test a multi-character typeahead, but anything more than a single character is flaky
|
|
181
|
+
await type( 'a' );
|
|
180
182
|
|
|
181
183
|
expect(
|
|
182
184
|
screen.queryByRole( 'listbox', {
|
|
@@ -185,8 +187,10 @@ describe.each( [
|
|
|
185
187
|
} )
|
|
186
188
|
).not.toBeInTheDocument();
|
|
187
189
|
|
|
190
|
+
// This Enter is a workaround for flakiness, and shouldn't be necessary in an actual browser
|
|
188
191
|
await press.Enter();
|
|
189
|
-
|
|
192
|
+
|
|
193
|
+
expect( currentSelectedItem ).toHaveTextContent( 'amber' );
|
|
190
194
|
} );
|
|
191
195
|
|
|
192
196
|
it( 'Should have correct aria-selected value for selections', async () => {
|
|
@@ -253,9 +257,12 @@ describe.each( [
|
|
|
253
257
|
'rose blush',
|
|
254
258
|
'ultraviolet morning light',
|
|
255
259
|
].map( ( item ) => (
|
|
256
|
-
<
|
|
260
|
+
<UncontrolledCustomSelectControlV2.Item
|
|
261
|
+
key={ item }
|
|
262
|
+
value={ item }
|
|
263
|
+
>
|
|
257
264
|
{ item }
|
|
258
|
-
</
|
|
265
|
+
</UncontrolledCustomSelectControlV2.Item>
|
|
259
266
|
) ) }
|
|
260
267
|
</Component>
|
|
261
268
|
);
|
|
@@ -322,9 +329,12 @@ describe.each( [
|
|
|
322
329
|
render(
|
|
323
330
|
<Component defaultValue={ defaultValues } label="Multi-select">
|
|
324
331
|
{ defaultValues.map( ( item ) => (
|
|
325
|
-
<
|
|
332
|
+
<UncontrolledCustomSelectControlV2.Item
|
|
333
|
+
key={ item }
|
|
334
|
+
value={ item }
|
|
335
|
+
>
|
|
326
336
|
{ item }
|
|
327
|
-
</
|
|
337
|
+
</UncontrolledCustomSelectControlV2.Item>
|
|
328
338
|
) ) }
|
|
329
339
|
</Component>
|
|
330
340
|
);
|
|
@@ -374,12 +384,12 @@ describe.each( [
|
|
|
374
384
|
|
|
375
385
|
render(
|
|
376
386
|
<Component label="Rendered" renderSelectedValue={ renderValue }>
|
|
377
|
-
<
|
|
387
|
+
<UncontrolledCustomSelectControlV2.Item value="april-29">
|
|
378
388
|
{ renderValue( 'april-29' ) }
|
|
379
|
-
</
|
|
380
|
-
<
|
|
389
|
+
</UncontrolledCustomSelectControlV2.Item>
|
|
390
|
+
<UncontrolledCustomSelectControlV2.Item value="july-9">
|
|
381
391
|
{ renderValue( 'july-9' ) }
|
|
382
|
-
</
|
|
392
|
+
</UncontrolledCustomSelectControlV2.Item>
|
|
383
393
|
</Component>
|
|
384
394
|
);
|
|
385
395
|
|
|
@@ -59,7 +59,7 @@ exports[`DimensionControl rendering renders with custom sizes 1`] = `
|
|
|
59
59
|
|
|
60
60
|
.emotion-11 {
|
|
61
61
|
color: #1e1e1e;
|
|
62
|
-
line-height: 1.
|
|
62
|
+
line-height: 1.4;
|
|
63
63
|
margin: 0;
|
|
64
64
|
font-size: calc((13 / 13) * 13px);
|
|
65
65
|
font-weight: normal;
|
|
@@ -330,7 +330,7 @@ exports[`DimensionControl rendering renders with defaults 1`] = `
|
|
|
330
330
|
|
|
331
331
|
.emotion-11 {
|
|
332
332
|
color: #1e1e1e;
|
|
333
|
-
line-height: 1.
|
|
333
|
+
line-height: 1.4;
|
|
334
334
|
margin: 0;
|
|
335
335
|
font-size: calc((13 / 13) * 13px);
|
|
336
336
|
font-weight: normal;
|
|
@@ -611,7 +611,7 @@ exports[`DimensionControl rendering renders with icon and custom icon label 1`]
|
|
|
611
611
|
|
|
612
612
|
.emotion-11 {
|
|
613
613
|
color: #1e1e1e;
|
|
614
|
-
line-height: 1.
|
|
614
|
+
line-height: 1.4;
|
|
615
615
|
margin: 0;
|
|
616
616
|
font-size: calc((13 / 13) * 13px);
|
|
617
617
|
font-weight: normal;
|
|
@@ -904,7 +904,7 @@ exports[`DimensionControl rendering renders with icon and default icon label 1`]
|
|
|
904
904
|
|
|
905
905
|
.emotion-11 {
|
|
906
906
|
color: #1e1e1e;
|
|
907
|
-
line-height: 1.
|
|
907
|
+
line-height: 1.4;
|
|
908
908
|
margin: 0;
|
|
909
909
|
font-size: calc((13 / 13) * 13px);
|
|
910
910
|
font-weight: normal;
|
|
@@ -8,6 +8,8 @@ import type { Meta, StoryFn } from '@storybook/react';
|
|
|
8
8
|
*/
|
|
9
9
|
import Dropdown from '..';
|
|
10
10
|
import Button from '../../button';
|
|
11
|
+
import MenuGroup from '../../menu-group';
|
|
12
|
+
import MenuItem from '../../menu-item';
|
|
11
13
|
import { DropdownContentWrapper } from '../dropdown-content-wrapper';
|
|
12
14
|
|
|
13
15
|
const meta: Meta< typeof Dropdown > = {
|
|
@@ -83,3 +85,20 @@ WithNoPadding.args = {
|
|
|
83
85
|
</DropdownContentWrapper>
|
|
84
86
|
),
|
|
85
87
|
};
|
|
88
|
+
|
|
89
|
+
export const WithMenuItems = Template.bind( {} );
|
|
90
|
+
WithMenuItems.args = {
|
|
91
|
+
...Default.args,
|
|
92
|
+
renderContent: () => (
|
|
93
|
+
<>
|
|
94
|
+
<MenuGroup label="Group 1">
|
|
95
|
+
<MenuItem>Item 1</MenuItem>
|
|
96
|
+
<MenuItem>Item 2</MenuItem>
|
|
97
|
+
</MenuGroup>
|
|
98
|
+
<MenuGroup label="Group 2">
|
|
99
|
+
<MenuItem>Item 1</MenuItem>
|
|
100
|
+
<MenuItem>Item 2</MenuItem>
|
|
101
|
+
</MenuGroup>
|
|
102
|
+
</>
|
|
103
|
+
),
|
|
104
|
+
};
|
package/src/dropdown/style.scss
CHANGED
|
@@ -10,4 +10,30 @@
|
|
|
10
10
|
[role="menuitem"] {
|
|
11
11
|
white-space: nowrap;
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
.components-menu-group {
|
|
15
|
+
padding: $grid-unit-10;
|
|
16
|
+
margin-top: 0;
|
|
17
|
+
margin-bottom: 0;
|
|
18
|
+
margin-left: -$grid-unit-10;
|
|
19
|
+
margin-right: -$grid-unit-10;
|
|
20
|
+
|
|
21
|
+
&:first-child {
|
|
22
|
+
margin-top: -$grid-unit-10;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:last-child {
|
|
26
|
+
margin-bottom: -$grid-unit-10;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.components-menu-group + .components-menu-group {
|
|
31
|
+
margin-top: 0;
|
|
32
|
+
border-top: $border-width solid $gray-400;
|
|
33
|
+
padding: $grid-unit-10;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.is-alternate .components-menu-group + .components-menu-group {
|
|
37
|
+
border-color: $gray-900;
|
|
38
|
+
}
|
|
13
39
|
}
|
|
@@ -60,29 +60,4 @@
|
|
|
60
60
|
padding-right: $grid-unit-10;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.components-menu-group {
|
|
64
|
-
padding: $grid-unit-10;
|
|
65
|
-
margin-top: 0;
|
|
66
|
-
margin-bottom: 0;
|
|
67
|
-
margin-left: -$grid-unit-10;
|
|
68
|
-
margin-right: -$grid-unit-10;
|
|
69
|
-
|
|
70
|
-
&:first-child {
|
|
71
|
-
margin-top: -$grid-unit-10;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
&:last-child {
|
|
75
|
-
margin-bottom: -$grid-unit-10;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.components-menu-group + .components-menu-group {
|
|
80
|
-
margin-top: 0;
|
|
81
|
-
border-top: $border-width solid $gray-400;
|
|
82
|
-
padding: $grid-unit-10;
|
|
83
|
-
|
|
84
|
-
.is-alternate & {
|
|
85
|
-
border-color: $gray-900;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
63
|
}
|
package/src/flex/flex/README.md
CHANGED
|
@@ -53,14 +53,14 @@ Spacing in between each child can be adjusted by using `gap`. The value of `gap`
|
|
|
53
53
|
- Required: No
|
|
54
54
|
- Default: `2`
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
### `justify`: `CSSProperties['justifyContent']`
|
|
57
57
|
|
|
58
58
|
Horizontally aligns content if the `direction` is `row`, or vertically aligns content if the `direction` is `column`.
|
|
59
59
|
|
|
60
60
|
- Required: No
|
|
61
61
|
- Default: `space-between`
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
### `wrap`: `boolean`
|
|
64
64
|
|
|
65
65
|
Determines if children should wrap.
|
|
66
66
|
|
|
@@ -4,7 +4,7 @@ A `FormTokenField` is a field similar to the tags and categories fields in the i
|
|
|
4
4
|
|
|
5
5
|
Up to one hundred suggestions that match what the user has typed so far will be shown from which the user can pick from (auto-complete). Tokens are separated by the "," character. Suggestions can be selected with the up or down arrows and added with the tab or enter key.
|
|
6
6
|
|
|
7
|
-
The `value` property is handled in a manner similar to controlled form components. See [Forms](
|
|
7
|
+
The `value` property is handled in a manner similar to controlled form components. See [Forms](https://react.dev/reference/react-dom/components#form-components) in the React Documentation for more information.
|
|
8
8
|
|
|
9
9
|
## Keyboard Accessibility
|
|
10
10
|
|
|
@@ -40,7 +40,7 @@ const identity = ( value: string ) => value;
|
|
|
40
40
|
* Tokens are separated by the "," character. Suggestions can be selected with the up or down arrows and added with the tab or enter key.
|
|
41
41
|
*
|
|
42
42
|
* The `value` property is handled in a manner similar to controlled form components.
|
|
43
|
-
* See [Forms](
|
|
43
|
+
* See [Forms](https://react.dev/reference/react-dom/components#form-components) in the React Documentation for more information.
|
|
44
44
|
*/
|
|
45
45
|
export function FormTokenField( props: FormTokenFieldProps ) {
|
|
46
46
|
const {
|
package/src/grid/README.md
CHANGED
|
@@ -27,69 +27,69 @@ function Example() {
|
|
|
27
27
|
|
|
28
28
|
## Props
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
### `align`: `CSS['alignItems']`
|
|
31
31
|
|
|
32
32
|
Adjusts the block alignment of children.
|
|
33
33
|
|
|
34
34
|
- Required: No
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
### `alignment`: `GridAlignment`
|
|
37
37
|
|
|
38
38
|
Adjusts the horizontal and vertical alignment of children.
|
|
39
39
|
|
|
40
40
|
- Required: No
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
### `columnGap`: `CSSProperties['gridColumnGap']`
|
|
43
43
|
|
|
44
44
|
Adjusts the `grid-column-gap`.
|
|
45
45
|
|
|
46
46
|
- Required: No
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
### `columns`: `number`
|
|
49
49
|
|
|
50
50
|
Adjusts the number of columns of the `Grid`.
|
|
51
51
|
|
|
52
52
|
- Required: No
|
|
53
53
|
- Default: `2`
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
### `gap`: `number`
|
|
56
56
|
|
|
57
57
|
Gap between each child.
|
|
58
58
|
|
|
59
59
|
- Required: No
|
|
60
60
|
- Default: `3`
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
### `isInline`: `boolean`
|
|
63
63
|
|
|
64
64
|
Changes the CSS display from `grid` to `inline-grid`.
|
|
65
65
|
|
|
66
66
|
- Required: No
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
### `justify`: `CSS['justifyContent']`
|
|
69
69
|
|
|
70
70
|
Adjusts the inline alignment of children.
|
|
71
71
|
|
|
72
72
|
- Required: No
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
### `rowGap`: `CSSProperties['gridRowGap']`
|
|
75
75
|
|
|
76
76
|
Adjusts the `grid-row-gap`.
|
|
77
77
|
|
|
78
78
|
- Required: No
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
### `rows`: `number`
|
|
81
81
|
|
|
82
82
|
Adjusts the number of rows of the `Grid`.
|
|
83
83
|
|
|
84
84
|
- Required: No
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
### `templateColumns`: `CSS['gridTemplateColumns']`
|
|
87
87
|
|
|
88
88
|
Adjusts the CSS grid `template-columns`.
|
|
89
89
|
|
|
90
90
|
- Required: No
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
### `templateRows`: `CSS['gridTemplateRows']`
|
|
93
93
|
|
|
94
94
|
Adjusts the CSS grid `template-rows`.
|
|
95
95
|
|
package/src/h-stack/README.md
CHANGED
|
@@ -29,7 +29,7 @@ function Example() {
|
|
|
29
29
|
|
|
30
30
|
## Props
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
### alignment
|
|
33
33
|
|
|
34
34
|
**Type**: `HStackAlignment` | `CSS[ 'alignItems' ]`
|
|
35
35
|
|
|
@@ -47,33 +47,33 @@ Determines how the child elements are aligned.
|
|
|
47
47
|
- `edge`: Justifies content to be evenly spread out up to the main axis edges of the container.
|
|
48
48
|
- `stretch`: Stretches content to the cross axis edges of the container.
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
### direction
|
|
51
51
|
|
|
52
52
|
**Type**: `FlexDirection`
|
|
53
53
|
|
|
54
54
|
The direction flow of the children content can be adjusted with `direction`. `column` will align children vertically and `row` will align children horizontally.
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
### expanded
|
|
57
57
|
|
|
58
58
|
**Type**: `boolean`
|
|
59
59
|
|
|
60
60
|
Expands to the maximum available width (if horizontal) or height (if vertical).
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
### justify
|
|
63
63
|
|
|
64
64
|
**Type**: `CSS['justifyContent']`
|
|
65
65
|
|
|
66
66
|
Horizontally aligns content if the `direction` is `row`, or vertically aligns content if the `direction` is `column`.
|
|
67
67
|
In the example below, `flex-start` will align the children content to the left.
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
### spacing
|
|
70
70
|
|
|
71
71
|
**Type**: `CSS['width']`
|
|
72
72
|
|
|
73
73
|
The amount of space between each child element. Spacing in between each child can be adjusted by using `spacing`.
|
|
74
74
|
The value of `spacing` works as a multiplier to the library's grid system (base of `4px`).
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
### wrap
|
|
77
77
|
|
|
78
78
|
**Type**: `boolean`
|
|
79
79
|
|
package/src/heading/README.md
CHANGED
|
@@ -25,7 +25,7 @@ function Example() {
|
|
|
25
25
|
|
|
26
26
|
For a complete list of those props, check out [`Text`](/packages/components/src/text/README.md#props).
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
### `level`: `1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'`
|
|
29
29
|
|
|
30
30
|
Passing any of the heading levels to `level` will both render the correct typographic text size as well as the semantic element corresponding to the level (`h1` for `1` for example).
|
|
31
31
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`props should render correctly 1`] = `
|
|
4
4
|
.emotion-0 {
|
|
5
5
|
color: #1e1e1e;
|
|
6
|
-
line-height: 1.
|
|
6
|
+
line-height: 1.4;
|
|
7
7
|
margin: 0;
|
|
8
8
|
color: #1e1e1e;
|
|
9
9
|
font-size: calc(1.95 * 13px);
|
|
@@ -32,7 +32,7 @@ Snapshot Diff:
|
|
|
32
32
|
- "font-size": "calc(1.25 * 13px)",
|
|
33
33
|
+ "font-size": "calc(1.95 * 13px)",
|
|
34
34
|
"font-weight": "600",
|
|
35
|
-
"line-height": "1.
|
|
35
|
+
"line-height": "1.4",
|
|
36
36
|
"margin": "0",
|
|
37
37
|
},
|
|
38
38
|
]
|
|
@@ -50,7 +50,7 @@ Snapshot Diff:
|
|
|
50
50
|
- "font-size": "calc(1.25 * 13px)",
|
|
51
51
|
+ "font-size": "calc(1.95 * 13px)",
|
|
52
52
|
"font-weight": "600",
|
|
53
|
-
"line-height": "1.
|
|
53
|
+
"line-height": "1.4",
|
|
54
54
|
"margin": "0",
|
|
55
55
|
},
|
|
56
56
|
]
|
|
@@ -10,7 +10,7 @@ InputControl components let users enter and edit text. This is an experimental c
|
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
12
|
import { __experimentalInputControl as InputControl } from '@wordpress/components';
|
|
13
|
-
import { useState } from '
|
|
13
|
+
import { useState } from 'react';
|
|
14
14
|
|
|
15
15
|
const Example = () => {
|
|
16
16
|
const [ value, setValue ] = useState( '' );
|
|
@@ -126,7 +126,7 @@ export function UnforwardedInputControl(
|
|
|
126
126
|
*
|
|
127
127
|
* ```jsx
|
|
128
128
|
* import { __experimentalInputControl as InputControl } from '@wordpress/components';
|
|
129
|
-
* import { useState } from '
|
|
129
|
+
* import { useState } from 'react';
|
|
130
130
|
*
|
|
131
131
|
* const Example = () => {
|
|
132
132
|
* const [ value, setValue ] = useState( '' );
|
|
@@ -24,6 +24,7 @@ import { useDragCursor } from './utils';
|
|
|
24
24
|
import { Input } from './styles/input-control-styles';
|
|
25
25
|
import { useInputControlStateReducer } from './reducer/reducer';
|
|
26
26
|
import type { InputFieldProps } from './types';
|
|
27
|
+
import { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';
|
|
27
28
|
|
|
28
29
|
const noop = () => {};
|
|
29
30
|
|
|
@@ -222,7 +223,7 @@ function InputField(
|
|
|
222
223
|
onBlur={ handleOnBlur }
|
|
223
224
|
onChange={ handleOnChange }
|
|
224
225
|
onFocus={ handleOnFocus }
|
|
225
|
-
onKeyDown={ handleOnKeyDown }
|
|
226
|
+
onKeyDown={ withIgnoreIMEEvents( handleOnKeyDown ) }
|
|
226
227
|
onMouseDown={ handleOnMouseDown }
|
|
227
228
|
ref={ ref }
|
|
228
229
|
inputSize={ size }
|
|
@@ -11,8 +11,8 @@ Snapshot Diff:
|
|
|
11
11
|
role="listitem"
|
|
12
12
|
>
|
|
13
13
|
<div
|
|
14
|
-
- class="components-item css-
|
|
15
|
-
+ class="components-item css-
|
|
14
|
+
- class="components-item css-1n28wmo-View-medium-item-spacedAround e19lxcc00"
|
|
15
|
+
+ class="components-item css-gg7ygh-View-large-item-spacedAround e19lxcc00"
|
|
16
16
|
data-wp-c16t="true"
|
|
17
17
|
data-wp-component="Item"
|
|
18
18
|
>
|
|
@@ -24,8 +24,8 @@ Snapshot Diff:
|
|
|
24
24
|
role="listitem"
|
|
25
25
|
>
|
|
26
26
|
<div
|
|
27
|
-
- class="components-item css-
|
|
28
|
-
+ class="components-item css-
|
|
27
|
+
- class="components-item css-1n28wmo-View-medium-item-spacedAround e19lxcc00"
|
|
28
|
+
+ class="components-item css-gg7ygh-View-large-item-spacedAround e19lxcc00"
|
|
29
29
|
data-wp-c16t="true"
|
|
30
30
|
data-wp-component="Item"
|
|
31
31
|
>
|
|
@@ -44,8 +44,8 @@ Snapshot Diff:
|
|
|
44
44
|
role="listitem"
|
|
45
45
|
>
|
|
46
46
|
<div
|
|
47
|
-
- class="components-item css-
|
|
48
|
-
+ class="components-item css-
|
|
47
|
+
- class="components-item css-1lf4kzd-View-medium-item e19lxcc00"
|
|
48
|
+
+ class="components-item css-1vv4aem-View-large-item e19lxcc00"
|
|
49
49
|
data-wp-c16t="true"
|
|
50
50
|
data-wp-component="Item"
|
|
51
51
|
>
|
|
@@ -74,7 +74,7 @@ exports[`ItemGroup ItemGroup component should render correctly 1`] = `
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.emotion-3 {
|
|
77
|
-
padding: calc((36px - calc(13px * 1.
|
|
77
|
+
padding: calc((36px - calc(13px * 1.4) - 2px) / 2) 12px;
|
|
78
78
|
box-sizing: border-box;
|
|
79
79
|
width: 100%;
|
|
80
80
|
display: block;
|
|
@@ -125,8 +125,8 @@ Snapshot Diff:
|
|
|
125
125
|
role="listitem"
|
|
126
126
|
>
|
|
127
127
|
<div
|
|
128
|
-
- class="components-item css-
|
|
129
|
-
+ class="components-item css-
|
|
128
|
+
- class="components-item css-1n28wmo-View-medium-item-spacedAround e19lxcc00"
|
|
129
|
+
+ class="components-item css-1lf4kzd-View-medium-item e19lxcc00"
|
|
130
130
|
data-wp-c16t="true"
|
|
131
131
|
data-wp-component="Item"
|
|
132
132
|
>
|
|
@@ -153,8 +153,8 @@ Snapshot Diff:
|
|
|
153
153
|
role="listitem"
|
|
154
154
|
>
|
|
155
155
|
<div
|
|
156
|
-
- class="components-item css-
|
|
157
|
-
+ class="components-item css-
|
|
156
|
+
- class="components-item css-1n28wmo-View-medium-item-spacedAround e19lxcc00"
|
|
157
|
+
+ class="components-item css-1lf4kzd-View-medium-item e19lxcc00"
|
|
158
158
|
data-wp-c16t="true"
|
|
159
159
|
data-wp-component="Item"
|
|
160
160
|
>
|
|
@@ -10,7 +10,7 @@ However, instead of opening up the selection in a modal, the selection opens up
|
|
|
10
10
|
* WordPress dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { BottomSheetSelectControl } from '@wordpress/components';
|
|
13
|
-
import { useState } from '
|
|
13
|
+
import { useState } from 'react';
|
|
14
14
|
|
|
15
15
|
const options = [
|
|
16
16
|
{
|
|
@@ -112,7 +112,11 @@ const PaletteScreen = () => {
|
|
|
112
112
|
|
|
113
113
|
function getClearButton() {
|
|
114
114
|
return (
|
|
115
|
-
<TouchableWithoutFeedback
|
|
115
|
+
<TouchableWithoutFeedback
|
|
116
|
+
accessibilityLabel={ __( 'Clear selected color' ) }
|
|
117
|
+
onPress={ onClear }
|
|
118
|
+
hitSlop={ HIT_SLOP }
|
|
119
|
+
>
|
|
116
120
|
<View style={ styles.clearButtonContainer }>
|
|
117
121
|
<Text style={ clearButtonStyle }>{ __( 'Reset' ) }</Text>
|
|
118
122
|
</View>
|
|
@@ -79,7 +79,7 @@ class NavigableContainer extends Component< NavigableContainerProps > {
|
|
|
79
79
|
|
|
80
80
|
const { onlyBrowserTabstops } = this.props;
|
|
81
81
|
const finder = onlyBrowserTabstops ? focus.tabbable : focus.focusable;
|
|
82
|
-
const focusables = finder.find( this.container )
|
|
82
|
+
const focusables = finder.find( this.container );
|
|
83
83
|
|
|
84
84
|
const index = this.getFocusableIndex( focusables, target );
|
|
85
85
|
if ( index > -1 && target ) {
|