@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.
Files changed (223) hide show
  1. package/CHANGELOG.md +53 -3
  2. package/README.md +13 -0
  3. package/build/button/index.js +3 -4
  4. package/build/button/index.js.map +1 -1
  5. package/build/button/types.js.map +1 -1
  6. package/build/color-picker/component.js +2 -12
  7. package/build/color-picker/component.js.map +1 -1
  8. package/build/color-picker/picker.js +18 -77
  9. package/build/color-picker/picker.js.map +1 -1
  10. package/build/color-picker/types.js.map +1 -1
  11. package/build/custom-select-control-v2/default-component/index.js +4 -2
  12. package/build/custom-select-control-v2/default-component/index.js.map +1 -1
  13. package/build/custom-select-control-v2/index.js +1 -8
  14. package/build/custom-select-control-v2/index.js.map +1 -1
  15. package/build/custom-select-control-v2/{custom-select-item.js → item.js} +2 -1
  16. package/build/custom-select-control-v2/{custom-select-item.js.map → item.js.map} +1 -1
  17. package/build/custom-select-control-v2/legacy-component/index.js +5 -5
  18. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
  19. package/build/date-time/date/styles.js +7 -7
  20. package/build/date-time/date/styles.js.map +1 -1
  21. package/build/form-token-field/index.js +1 -1
  22. package/build/form-token-field/index.js.map +1 -1
  23. package/build/input-control/index.js +1 -1
  24. package/build/input-control/index.js.map +1 -1
  25. package/build/input-control/input-field.js +2 -1
  26. package/build/input-control/input-field.js.map +1 -1
  27. package/build/mobile/color-settings/palette.screen.native.js +1 -0
  28. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  29. package/build/navigable-container/container.js.map +1 -1
  30. package/build/navigator/navigator-provider/component.js +162 -120
  31. package/build/navigator/navigator-provider/component.js.map +1 -1
  32. package/build/navigator/navigator-screen/component.js +2 -2
  33. package/build/navigator/navigator-screen/component.js.map +1 -1
  34. package/build/palette-edit/index.js +18 -12
  35. package/build/palette-edit/index.js.map +1 -1
  36. package/build/popover/index.js +7 -34
  37. package/build/popover/index.js.map +1 -1
  38. package/build/range-control/styles/range-control-styles.js +29 -29
  39. package/build/range-control/styles/range-control-styles.js.map +1 -1
  40. package/build/text-control/types.js.map +1 -1
  41. package/build/toggle-group-control/toggle-group-control-option-base/component.js +5 -2
  42. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  43. package/build/tools-panel/tools-panel-header/component.js +1 -1
  44. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  45. package/build/utils/config-values.js +1 -1
  46. package/build/utils/config-values.js.map +1 -1
  47. package/build/utils/input/base.js +2 -2
  48. package/build/utils/input/base.js.map +1 -1
  49. package/build-module/button/index.js +3 -4
  50. package/build-module/button/index.js.map +1 -1
  51. package/build-module/button/types.js.map +1 -1
  52. package/build-module/color-picker/component.js +3 -13
  53. package/build-module/color-picker/component.js.map +1 -1
  54. package/build-module/color-picker/picker.js +19 -78
  55. package/build-module/color-picker/picker.js.map +1 -1
  56. package/build-module/color-picker/types.js.map +1 -1
  57. package/build-module/custom-select-control-v2/default-component/index.js +4 -2
  58. package/build-module/custom-select-control-v2/default-component/index.js.map +1 -1
  59. package/build-module/custom-select-control-v2/index.js +1 -2
  60. package/build-module/custom-select-control-v2/index.js.map +1 -1
  61. package/build-module/custom-select-control-v2/{custom-select-item.js → item.js} +2 -1
  62. package/build-module/custom-select-control-v2/{custom-select-item.js.map → item.js.map} +1 -1
  63. package/build-module/custom-select-control-v2/legacy-component/index.js +4 -4
  64. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
  65. package/build-module/date-time/date/styles.js +7 -7
  66. package/build-module/date-time/date/styles.js.map +1 -1
  67. package/build-module/form-token-field/index.js +1 -1
  68. package/build-module/form-token-field/index.js.map +1 -1
  69. package/build-module/input-control/index.js +1 -1
  70. package/build-module/input-control/index.js.map +1 -1
  71. package/build-module/input-control/input-field.js +2 -1
  72. package/build-module/input-control/input-field.js.map +1 -1
  73. package/build-module/mobile/color-settings/palette.screen.native.js +1 -0
  74. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  75. package/build-module/navigable-container/container.js.map +1 -1
  76. package/build-module/navigator/navigator-provider/component.js +163 -121
  77. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  78. package/build-module/navigator/navigator-screen/component.js +2 -2
  79. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  80. package/build-module/palette-edit/index.js +17 -11
  81. package/build-module/palette-edit/index.js.map +1 -1
  82. package/build-module/popover/index.js +9 -36
  83. package/build-module/popover/index.js.map +1 -1
  84. package/build-module/range-control/styles/range-control-styles.js +29 -29
  85. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  86. package/build-module/text-control/types.js.map +1 -1
  87. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +6 -3
  88. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  89. package/build-module/tools-panel/tools-panel-header/component.js +1 -1
  90. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  91. package/build-module/utils/config-values.js +1 -1
  92. package/build-module/utils/config-values.js.map +1 -1
  93. package/build-module/utils/input/base.js +2 -2
  94. package/build-module/utils/input/base.js.map +1 -1
  95. package/build-style/style-rtl.css +26 -29
  96. package/build-style/style.css +26 -29
  97. package/build-types/box-control/styles/box-control-styles.d.ts +1 -1
  98. package/build-types/button/deprecated.d.ts +4 -10
  99. package/build-types/button/deprecated.d.ts.map +1 -1
  100. package/build-types/button/index.d.ts +3 -3
  101. package/build-types/button/index.d.ts.map +1 -1
  102. package/build-types/button/stories/e2e/index.story.d.ts +1 -1
  103. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  104. package/build-types/button/stories/index.story.d.ts +7 -7
  105. package/build-types/button/stories/index.story.d.ts.map +1 -1
  106. package/build-types/button/types.d.ts +37 -8
  107. package/build-types/button/types.d.ts.map +1 -1
  108. package/build-types/color-picker/component.d.ts.map +1 -1
  109. package/build-types/color-picker/picker.d.ts +1 -1
  110. package/build-types/color-picker/picker.d.ts.map +1 -1
  111. package/build-types/color-picker/styles.d.ts +1 -1
  112. package/build-types/color-picker/types.d.ts +0 -3
  113. package/build-types/color-picker/types.d.ts.map +1 -1
  114. package/build-types/custom-select-control/stories/index.story.d.ts +35 -0
  115. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -0
  116. package/build-types/custom-select-control-v2/default-component/index.d.ts +5 -2
  117. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
  118. package/build-types/custom-select-control-v2/index.d.ts +1 -2
  119. package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
  120. package/build-types/custom-select-control-v2/{custom-select-item.d.ts → item.d.ts} +4 -1
  121. package/build-types/custom-select-control-v2/item.d.ts.map +1 -0
  122. package/build-types/custom-select-control-v2/legacy-component/index.d.ts +2 -2
  123. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  124. package/build-types/custom-select-control-v2/stories/default.story.d.ts +2 -2
  125. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
  126. package/build-types/custom-select-control-v2/stories/legacy.story.d.ts +4 -2
  127. package/build-types/custom-select-control-v2/stories/legacy.story.d.ts.map +1 -1
  128. package/build-types/date-time/date/styles.d.ts +1 -1
  129. package/build-types/dropdown/stories/index.story.d.ts +1 -0
  130. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  131. package/build-types/font-size-picker/styles.d.ts +1 -1
  132. package/build-types/form-token-field/index.d.ts +1 -1
  133. package/build-types/input-control/index.d.ts +1 -1
  134. package/build-types/input-control/input-field.d.ts.map +1 -1
  135. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  136. package/build-types/navigation/styles/navigation-styles.d.ts +1 -1
  137. package/build-types/navigator/navigator-back-button/component.d.ts +0 -1
  138. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  139. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -2
  140. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  141. package/build-types/navigator/navigator-button/component.d.ts +0 -1
  142. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  143. package/build-types/navigator/navigator-button/hook.d.ts +1 -2
  144. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  145. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  146. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  147. package/build-types/navigator/navigator-to-parent-button/component.d.ts +0 -1
  148. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  149. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  150. package/build-types/palette-edit/index.d.ts +6 -3
  151. package/build-types/palette-edit/index.d.ts.map +1 -1
  152. package/build-types/palette-edit/styles.d.ts +2 -2
  153. package/build-types/popover/index.d.ts.map +1 -1
  154. package/build-types/text-control/index.d.ts +1 -1
  155. package/build-types/text-control/types.d.ts +1 -1
  156. package/build-types/text-control/types.d.ts.map +1 -1
  157. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  158. package/build-types/toolbar/toolbar-button/index.d.ts +4 -10
  159. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  160. package/package.json +21 -21
  161. package/src/button/index.tsx +3 -4
  162. package/src/button/test/index.tsx +6 -6
  163. package/src/button/types.ts +37 -9
  164. package/src/color-picker/component.tsx +3 -25
  165. package/src/color-picker/picker.tsx +12 -96
  166. package/src/color-picker/types.ts +0 -3
  167. package/src/confirm-dialog/README.md +7 -0
  168. package/src/custom-select-control/stories/{index.story.js → index.story.tsx} +8 -3
  169. package/src/custom-select-control/test/index.js +24 -0
  170. package/src/custom-select-control-v2/README.md +27 -27
  171. package/src/custom-select-control-v2/default-component/index.tsx +5 -2
  172. package/src/custom-select-control-v2/index.tsx +1 -2
  173. package/src/custom-select-control-v2/{custom-select-item.tsx → item.tsx} +2 -0
  174. package/src/custom-select-control-v2/legacy-component/index.tsx +4 -6
  175. package/src/custom-select-control-v2/legacy-component/test/index.tsx +13 -10
  176. package/src/custom-select-control-v2/stories/default.story.tsx +16 -17
  177. package/src/custom-select-control-v2/stories/legacy.story.tsx +20 -35
  178. package/src/custom-select-control-v2/test/index.tsx +26 -16
  179. package/src/date-time/date/styles.ts +2 -2
  180. package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
  181. package/src/dropdown/stories/index.story.tsx +19 -0
  182. package/src/dropdown/style.scss +26 -0
  183. package/src/dropdown-menu/style.scss +0 -25
  184. package/src/flex/flex/README.md +2 -2
  185. package/src/form-token-field/README.md +1 -1
  186. package/src/form-token-field/index.tsx +1 -1
  187. package/src/grid/README.md +11 -11
  188. package/src/h-stack/README.md +6 -6
  189. package/src/heading/README.md +1 -1
  190. package/src/heading/test/__snapshots__/index.tsx.snap +3 -3
  191. package/src/input-control/README.md +1 -1
  192. package/src/input-control/index.tsx +1 -1
  193. package/src/input-control/input-field.tsx +2 -1
  194. package/src/input-control/stories/index.story.tsx +1 -0
  195. package/src/item-group/test/__snapshots__/index.js.snap +11 -11
  196. package/src/mobile/bottom-sheet-select-control/README.md +1 -1
  197. package/src/mobile/color-settings/palette.screen.native.js +5 -1
  198. package/src/navigable-container/container.tsx +1 -1
  199. package/src/navigator/navigator-provider/component.tsx +187 -188
  200. package/src/navigator/navigator-screen/component.tsx +2 -4
  201. package/src/palette-edit/index.tsx +21 -21
  202. package/src/palette-edit/test/index.tsx +21 -17
  203. package/src/placeholder/style.scss +5 -1
  204. package/src/popover/index.tsx +59 -99
  205. package/src/popover/style.scss +0 -9
  206. package/src/progress-bar/README.md +1 -1
  207. package/src/radio-control/README.md +3 -3
  208. package/src/range-control/styles/range-control-styles.ts +1 -1
  209. package/src/resizable-box/resize-tooltip/README.md +2 -2
  210. package/src/text/test/__snapshots__/index.tsx.snap +3 -3
  211. package/src/text-control/style.scss +2 -0
  212. package/src/text-control/types.ts +12 -1
  213. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +14 -10
  214. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +14 -12
  215. package/src/toolbar/toolbar/style.scss +1 -1
  216. package/src/tools-panel/tools-panel-header/component.tsx +1 -1
  217. package/src/truncate/README.md +5 -5
  218. package/src/utils/config-values.js +1 -1
  219. package/src/utils/input/base.js +1 -1
  220. package/src/v-stack/README.md +6 -6
  221. package/tsconfig.json +1 -0
  222. package/tsconfig.tsbuildinfo +1 -1
  223. 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 { CustomSelect as UncontrolledCustomSelect, CustomSelectItem } from '..';
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
- <CustomSelectItem value={ value } key={ key } />
44
+ <UncontrolledCustomSelectControlV2.Item value={ value } key={ key } />
45
45
  ) ),
46
46
  };
47
47
 
48
- const ControlledCustomSelect = ( props: CustomSelectProps ) => {
48
+ const ControlledCustomSelectControl = ( props: CustomSelectProps ) => {
49
49
  const [ value, setValue ] = useState< string | string[] >();
50
50
  return (
51
- <UncontrolledCustomSelect
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', UncontrolledCustomSelect ],
64
- [ 'Controlled', ControlledCustomSelect ],
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
- await type( 'aq' );
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
- expect( currentSelectedItem ).toHaveTextContent( 'aquamarine' );
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
- <CustomSelectItem key={ item } value={ item }>
260
+ <UncontrolledCustomSelectControlV2.Item
261
+ key={ item }
262
+ value={ item }
263
+ >
257
264
  { item }
258
- </CustomSelectItem>
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
- <CustomSelectItem key={ item } value={ item }>
332
+ <UncontrolledCustomSelectControlV2.Item
333
+ key={ item }
334
+ value={ item }
335
+ >
326
336
  { item }
327
- </CustomSelectItem>
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
- <CustomSelectItem value="april-29">
387
+ <UncontrolledCustomSelectControlV2.Item value="april-29">
378
388
  { renderValue( 'april-29' ) }
379
- </CustomSelectItem>
380
- <CustomSelectItem value="july-9">
389
+ </UncontrolledCustomSelectControlV2.Item>
390
+ <UncontrolledCustomSelectControlV2.Item value="july-9">
381
391
  { renderValue( 'july-9' ) }
382
- </CustomSelectItem>
392
+ </UncontrolledCustomSelectControlV2.Item>
383
393
  </Component>
384
394
  );
385
395
 
@@ -84,8 +84,8 @@ export const DayButton = styled( Button, {
84
84
 
85
85
  &&& {
86
86
  border-radius: 100%;
87
- height: ${ space( 8 ) };
88
- width: ${ space( 8 ) };
87
+ height: ${ space( 7 ) };
88
+ width: ${ space( 7 ) };
89
89
 
90
90
  ${ ( props ) =>
91
91
  props.isSelected &&
@@ -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.2;
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.2;
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.2;
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.2;
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
+ };
@@ -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
  }
@@ -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
- ##### `justify`: `CSSProperties['justifyContent']`
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
- ##### `wrap`: `boolean`
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](http://facebook.github.io/react/docs/forms.html) in the React Documentation for more information.
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](http://facebook.github.io/react/docs/forms.html) in the React Documentation for more information.
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 {
@@ -27,69 +27,69 @@ function Example() {
27
27
 
28
28
  ## Props
29
29
 
30
- ##### `align`: `CSS['alignItems']`
30
+ ### `align`: `CSS['alignItems']`
31
31
 
32
32
  Adjusts the block alignment of children.
33
33
 
34
34
  - Required: No
35
35
 
36
- ##### `alignment`: `GridAlignment`
36
+ ### `alignment`: `GridAlignment`
37
37
 
38
38
  Adjusts the horizontal and vertical alignment of children.
39
39
 
40
40
  - Required: No
41
41
 
42
- ##### `columnGap`: `CSSProperties['gridColumnGap']`
42
+ ### `columnGap`: `CSSProperties['gridColumnGap']`
43
43
 
44
44
  Adjusts the `grid-column-gap`.
45
45
 
46
46
  - Required: No
47
47
 
48
- ##### `columns`: `number`
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
- ##### `gap`: `number`
55
+ ### `gap`: `number`
56
56
 
57
57
  Gap between each child.
58
58
 
59
59
  - Required: No
60
60
  - Default: `3`
61
61
 
62
- ##### `isInline`: `boolean`
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
- ##### `justify`: `CSS['justifyContent']`
68
+ ### `justify`: `CSS['justifyContent']`
69
69
 
70
70
  Adjusts the inline alignment of children.
71
71
 
72
72
  - Required: No
73
73
 
74
- ##### `rowGap`: `CSSProperties['gridRowGap']`
74
+ ### `rowGap`: `CSSProperties['gridRowGap']`
75
75
 
76
76
  Adjusts the `grid-row-gap`.
77
77
 
78
78
  - Required: No
79
79
 
80
- ##### `rows`: `number`
80
+ ### `rows`: `number`
81
81
 
82
82
  Adjusts the number of rows of the `Grid`.
83
83
 
84
84
  - Required: No
85
85
 
86
- ##### `templateColumns`: `CSS['gridTemplateColumns']`
86
+ ### `templateColumns`: `CSS['gridTemplateColumns']`
87
87
 
88
88
  Adjusts the CSS grid `template-columns`.
89
89
 
90
90
  - Required: No
91
91
 
92
- ##### `templateRows`: `CSS['gridTemplateRows']`
92
+ ### `templateRows`: `CSS['gridTemplateRows']`
93
93
 
94
94
  Adjusts the CSS grid `template-rows`.
95
95
 
@@ -29,7 +29,7 @@ function Example() {
29
29
 
30
30
  ## Props
31
31
 
32
- ##### alignment
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
- ##### direction
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
- ##### expanded
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
- ##### justify
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
- ##### spacing
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
- ##### wrap
76
+ ### wrap
77
77
 
78
78
  **Type**: `boolean`
79
79
 
@@ -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
- ##### `level`: `1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'`
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.2;
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.2",
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.2",
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 '@wordpress/compose';
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 '@wordpress/compose';
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 }
@@ -25,6 +25,7 @@ const meta: Meta< typeof InputControl > = {
25
25
  value: { control: { disable: true } },
26
26
  },
27
27
  parameters: {
28
+ actions: { argTypesRegex: '^on.*' },
28
29
  controls: { expanded: true },
29
30
  docs: { canvas: { sourceState: 'shown' } },
30
31
  },
@@ -11,8 +11,8 @@ Snapshot Diff:
11
11
  role="listitem"
12
12
  >
13
13
  <div
14
- - class="components-item css-ufjlmj-View-medium-item-spacedAround e19lxcc00"
15
- + class="components-item css-17haj95-View-large-item-spacedAround e19lxcc00"
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-ufjlmj-View-medium-item-spacedAround e19lxcc00"
28
- + class="components-item css-17haj95-View-large-item-spacedAround e19lxcc00"
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-cl593w-View-medium-item e19lxcc00"
48
- + class="components-item css-1yvqxd-View-large-item e19lxcc00"
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.2) - 2px) / 2) 12px;
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-ufjlmj-View-medium-item-spacedAround e19lxcc00"
129
- + class="components-item css-cl593w-View-medium-item e19lxcc00"
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-ufjlmj-View-medium-item-spacedAround e19lxcc00"
157
- + class="components-item css-cl593w-View-medium-item e19lxcc00"
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 '@wordpress/compose';
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 onPress={ onClear } hitSlop={ HIT_SLOP }>
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 ) as HTMLElement[];
82
+ const focusables = finder.find( this.container );
83
83
 
84
84
  const index = this.getFocusableIndex( focusables, target );
85
85
  if ( index > -1 && target ) {