@wordpress/components 26.0.4 → 27.1.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 (382) hide show
  1. package/.stylelintrc.js +2 -2
  2. package/CHANGELOG.md +45 -0
  3. package/CONTRIBUTING.md +72 -0
  4. package/build/autocomplete/index.js +3 -8
  5. package/build/autocomplete/index.js.map +1 -1
  6. package/build/base-control/index.native.js.map +1 -1
  7. package/build/border-box-control/border-box-control/component.js.map +1 -1
  8. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  9. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  10. package/build/button/index.js +2 -2
  11. package/build/button/index.js.map +1 -1
  12. package/build/button/index.native.js.map +1 -1
  13. package/build/color-picker/component.js +10 -1
  14. package/build/color-picker/component.js.map +1 -1
  15. package/build/color-picker/styles.js +8 -9
  16. package/build/color-picker/styles.js.map +1 -1
  17. package/build/combobox-control/index.js +4 -9
  18. package/build/combobox-control/index.js.map +1 -1
  19. package/build/confirm-dialog/component.js.map +1 -1
  20. package/build/custom-select-control/index.js +2 -15
  21. package/build/custom-select-control/index.js.map +1 -1
  22. package/build/custom-select-control-v2/custom-select-item.js +32 -0
  23. package/build/custom-select-control-v2/custom-select-item.js.map +1 -0
  24. package/build/custom-select-control-v2/custom-select.js +91 -0
  25. package/build/custom-select-control-v2/custom-select.js.map +1 -0
  26. package/build/custom-select-control-v2/default-component/index.js +41 -0
  27. package/build/custom-select-control-v2/default-component/index.js.map +1 -0
  28. package/build/custom-select-control-v2/index.js +13 -82
  29. package/build/custom-select-control-v2/index.js.map +1 -1
  30. package/build/custom-select-control-v2/legacy-component/index.js +123 -0
  31. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -0
  32. package/build/custom-select-control-v2/styles.js +73 -50
  33. package/build/custom-select-control-v2/styles.js.map +1 -1
  34. package/build/custom-select-control-v2/types.js.map +1 -1
  35. package/build/draggable/index.native.js +2 -2
  36. package/build/draggable/index.native.js.map +1 -1
  37. package/build/dropdown-menu/index.native.js.map +1 -1
  38. package/build/flex/flex/hook.js +1 -1
  39. package/build/flex/flex/hook.js.map +1 -1
  40. package/build/font-size-picker/font-size-picker-select.js +0 -1
  41. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  42. package/build/font-size-picker/index.native.js.map +1 -1
  43. package/build/form-token-field/index.js +3 -8
  44. package/build/form-token-field/index.js.map +1 -1
  45. package/build/form-token-field/suggestions-list.js +5 -12
  46. package/build/form-token-field/suggestions-list.js.map +1 -1
  47. package/build/h-stack/hook.js +6 -1
  48. package/build/h-stack/hook.js.map +1 -1
  49. package/build/mobile/bottom-sheet/button.native.js.map +1 -1
  50. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  51. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  52. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  53. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  54. package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  55. package/build/mobile/gradient/index.native.js.map +1 -1
  56. package/build/mobile/image/index.native.js +4 -13
  57. package/build/mobile/image/index.native.js.map +1 -1
  58. package/build/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +1 -1
  59. package/build/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js.map +1 -1
  60. package/build/mobile/media-edit/index.native.js.map +1 -1
  61. package/build/modal/index.js +2 -10
  62. package/build/modal/index.js.map +1 -1
  63. package/build/palette-edit/index.js.map +1 -1
  64. package/build/progress-bar/styles.js +5 -5
  65. package/build/progress-bar/styles.js.map +1 -1
  66. package/build/query-controls/index.native.js.map +1 -1
  67. package/build/range-control/index.js.map +1 -1
  68. package/build/search-control/index.native.js.map +1 -1
  69. package/build/snackbar/index.js +3 -2
  70. package/build/snackbar/index.js.map +1 -1
  71. package/build/snackbar/list.js +2 -1
  72. package/build/snackbar/list.js.map +1 -1
  73. package/build/snackbar/types.js.map +1 -1
  74. package/build/tabs/index.js +7 -7
  75. package/build/tabs/index.js.map +1 -1
  76. package/build/tabs/types.js.map +1 -1
  77. package/build/utils/hooks/index.js +0 -7
  78. package/build/utils/hooks/index.js.map +1 -1
  79. package/build/utils/with-ignore-ime-events.js +34 -0
  80. package/build/utils/with-ignore-ime-events.js.map +1 -0
  81. package/build-module/autocomplete/index.js +3 -8
  82. package/build-module/autocomplete/index.js.map +1 -1
  83. package/build-module/base-control/index.native.js.map +1 -1
  84. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  85. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  86. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  87. package/build-module/button/index.js +2 -2
  88. package/build-module/button/index.js.map +1 -1
  89. package/build-module/button/index.native.js.map +1 -1
  90. package/build-module/color-picker/component.js +11 -2
  91. package/build-module/color-picker/component.js.map +1 -1
  92. package/build-module/color-picker/styles.js +8 -9
  93. package/build-module/color-picker/styles.js.map +1 -1
  94. package/build-module/combobox-control/index.js +4 -9
  95. package/build-module/combobox-control/index.js.map +1 -1
  96. package/build-module/confirm-dialog/component.js.map +1 -1
  97. package/build-module/custom-select-control/index.js +2 -15
  98. package/build-module/custom-select-control/index.js.map +1 -1
  99. package/build-module/custom-select-control-v2/custom-select-item.js +26 -0
  100. package/build-module/custom-select-control-v2/custom-select-item.js.map +1 -0
  101. package/build-module/custom-select-control-v2/custom-select.js +82 -0
  102. package/build-module/custom-select-control-v2/custom-select.js.map +1 -0
  103. package/build-module/custom-select-control-v2/default-component/index.js +30 -0
  104. package/build-module/custom-select-control-v2/default-component/index.js.map +1 -0
  105. package/build-module/custom-select-control-v2/index.js +2 -74
  106. package/build-module/custom-select-control-v2/index.js.map +1 -1
  107. package/build-module/custom-select-control-v2/legacy-component/index.js +111 -0
  108. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -0
  109. package/build-module/custom-select-control-v2/styles.js +73 -42
  110. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  111. package/build-module/custom-select-control-v2/types.js.map +1 -1
  112. package/build-module/draggable/index.native.js +2 -2
  113. package/build-module/draggable/index.native.js.map +1 -1
  114. package/build-module/dropdown-menu/index.native.js.map +1 -1
  115. package/build-module/flex/flex/hook.js +1 -1
  116. package/build-module/flex/flex/hook.js.map +1 -1
  117. package/build-module/font-size-picker/font-size-picker-select.js +0 -1
  118. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  119. package/build-module/font-size-picker/index.native.js.map +1 -1
  120. package/build-module/form-token-field/index.js +3 -8
  121. package/build-module/form-token-field/index.js.map +1 -1
  122. package/build-module/form-token-field/suggestions-list.js +5 -12
  123. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  124. package/build-module/h-stack/hook.js +6 -1
  125. package/build-module/h-stack/hook.js.map +1 -1
  126. package/build-module/mobile/bottom-sheet/button.native.js.map +1 -1
  127. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  128. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  129. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  130. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  131. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  132. package/build-module/mobile/gradient/index.native.js.map +1 -1
  133. package/build-module/mobile/image/index.native.js +6 -15
  134. package/build-module/mobile/image/index.native.js.map +1 -1
  135. package/build-module/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +1 -1
  136. package/build-module/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js.map +1 -1
  137. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  138. package/build-module/modal/index.js +3 -10
  139. package/build-module/modal/index.js.map +1 -1
  140. package/build-module/palette-edit/index.js.map +1 -1
  141. package/build-module/progress-bar/styles.js +5 -5
  142. package/build-module/progress-bar/styles.js.map +1 -1
  143. package/build-module/query-controls/index.native.js.map +1 -1
  144. package/build-module/range-control/index.js.map +1 -1
  145. package/build-module/search-control/index.native.js.map +1 -1
  146. package/build-module/snackbar/index.js +3 -2
  147. package/build-module/snackbar/index.js.map +1 -1
  148. package/build-module/snackbar/list.js +2 -1
  149. package/build-module/snackbar/list.js.map +1 -1
  150. package/build-module/snackbar/types.js.map +1 -1
  151. package/build-module/tabs/index.js +7 -7
  152. package/build-module/tabs/index.js.map +1 -1
  153. package/build-module/tabs/types.js.map +1 -1
  154. package/build-module/utils/hooks/index.js +0 -1
  155. package/build-module/utils/hooks/index.js.map +1 -1
  156. package/build-module/utils/with-ignore-ime-events.js +28 -0
  157. package/build-module/utils/with-ignore-ime-events.js.map +1 -0
  158. package/build-style/style-rtl.css +10 -2
  159. package/build-style/style.css +10 -2
  160. package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
  161. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  162. package/build-types/animate/stories/index.story.d.ts +7 -7
  163. package/build-types/autocomplete/index.d.ts.map +1 -1
  164. package/build-types/base-control/stories/index.story.d.ts +1 -1
  165. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  166. package/build-types/border-control/stories/index.story.d.ts +6 -6
  167. package/build-types/box-control/stories/index.story.d.ts +6 -6
  168. package/build-types/button/stories/e2e/index.story.d.ts +1 -1
  169. package/build-types/button/stories/index.story.d.ts +7 -7
  170. package/build-types/card/stories/index.story.d.ts +2 -2
  171. package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
  172. package/build-types/color-palette/stories/index.story.d.ts +3 -3
  173. package/build-types/color-picker/component.d.ts.map +1 -1
  174. package/build-types/color-picker/stories/index.story.d.ts +1 -1
  175. package/build-types/color-picker/styles.d.ts.map +1 -1
  176. package/build-types/combobox-control/index.d.ts.map +1 -1
  177. package/build-types/combobox-control/stories/index.story.d.ts +2 -2
  178. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  179. package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
  180. package/build-types/custom-select-control/index.d.ts.map +1 -1
  181. package/build-types/custom-select-control-v2/custom-select-item.d.ts +9 -0
  182. package/build-types/custom-select-control-v2/custom-select-item.d.ts.map +1 -0
  183. package/build-types/custom-select-control-v2/custom-select.d.ts +6 -0
  184. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -0
  185. package/build-types/custom-select-control-v2/default-component/index.d.ts +6 -0
  186. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -0
  187. package/build-types/custom-select-control-v2/index.d.ts +5 -6
  188. package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
  189. package/build-types/custom-select-control-v2/legacy-component/index.d.ts +5 -0
  190. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -0
  191. package/build-types/custom-select-control-v2/legacy-component/test/index.d.ts +2 -0
  192. package/build-types/custom-select-control-v2/legacy-component/test/index.d.ts.map +1 -0
  193. package/build-types/custom-select-control-v2/stories/default.story.d.ts +30 -0
  194. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -0
  195. package/build-types/custom-select-control-v2/stories/legacy.story.d.ts +12 -0
  196. package/build-types/custom-select-control-v2/stories/legacy.story.d.ts.map +1 -0
  197. package/build-types/custom-select-control-v2/styles.d.ts +31 -6
  198. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  199. package/build-types/custom-select-control-v2/types.d.ts +136 -14
  200. package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
  201. package/build-types/dimension-control/stories/index.story.d.ts +2 -2
  202. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  203. package/build-types/dropdown/stories/index.story.d.ts +3 -3
  204. package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
  205. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  206. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
  207. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
  208. package/build-types/flex/flex/hook.d.ts +2 -3
  209. package/build-types/flex/flex/hook.d.ts.map +1 -1
  210. package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
  211. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  212. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  213. package/build-types/form-token-field/index.d.ts.map +1 -1
  214. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  215. package/build-types/gradient-picker/stories/index.story.d.ts +3 -3
  216. package/build-types/guide/stories/index.story.d.ts +1 -1
  217. package/build-types/h-stack/hook.d.ts +2 -4
  218. package/build-types/h-stack/hook.d.ts.map +1 -1
  219. package/build-types/icon/stories/index.story.d.ts +4 -4
  220. package/build-types/input-control/stories/index.story.d.ts +6 -6
  221. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
  222. package/build-types/menu-group/stories/index.story.d.ts +1 -1
  223. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  224. package/build-types/modal/index.d.ts.map +1 -1
  225. package/build-types/navigation/stories/index.story.d.ts +6 -6
  226. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -1
  227. package/build-types/notice/stories/index.story.d.ts +4 -4
  228. package/build-types/number-control/stories/index.story.d.ts +1 -1
  229. package/build-types/palette-edit/stories/index.story.d.ts +2 -2
  230. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  231. package/build-types/query-controls/stories/index.story.d.ts +1 -1
  232. package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
  233. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  234. package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
  235. package/build-types/sandbox/stories/index.story.d.ts +1 -1
  236. package/build-types/search-control/stories/index.story.d.ts +2 -2
  237. package/build-types/select-control/stories/index.story.d.ts +2 -2
  238. package/build-types/shortcut/stories/index.story.d.ts +1 -1
  239. package/build-types/snackbar/index.d.ts +5 -2
  240. package/build-types/snackbar/index.d.ts.map +1 -1
  241. package/build-types/snackbar/list.d.ts.map +1 -1
  242. package/build-types/snackbar/test/index.d.ts +2 -0
  243. package/build-types/snackbar/test/index.d.ts.map +1 -0
  244. package/build-types/snackbar/test/list.d.ts +2 -0
  245. package/build-types/snackbar/test/list.d.ts.map +1 -0
  246. package/build-types/snackbar/types.d.ts +18 -2
  247. package/build-types/snackbar/types.d.ts.map +1 -1
  248. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  249. package/build-types/tabs/index.d.ts +1 -1
  250. package/build-types/tabs/stories/index.story.d.ts +9 -9
  251. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  252. package/build-types/tabs/types.d.ts +1 -1
  253. package/build-types/text/stories/index.story.d.ts +3 -3
  254. package/build-types/theme/stories/index.story.d.ts +1 -1
  255. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  256. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  257. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  258. package/build-types/tooltip/stories/index.story.d.ts +1 -1
  259. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  260. package/build-types/tree-select/stories/index.story.d.ts +1 -1
  261. package/build-types/utils/hooks/index.d.ts +0 -1
  262. package/build-types/utils/with-ignore-ime-events.d.ts +15 -0
  263. package/build-types/utils/with-ignore-ime-events.d.ts.map +1 -0
  264. package/build-types/v-stack/hook.d.ts +2 -4
  265. package/build-types/v-stack/hook.d.ts.map +1 -1
  266. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  267. package/package.json +19 -20
  268. package/src/alignment-matrix-control/test/index.tsx +3 -1
  269. package/src/autocomplete/index.tsx +3 -10
  270. package/src/base-control/index.native.js +1 -1
  271. package/src/base-control/test/index.tsx +1 -1
  272. package/src/border-box-control/border-box-control/component.tsx +1 -1
  273. package/src/border-box-control/border-box-control-split-controls/component.tsx +4 -4
  274. package/src/border-control/border-control-dropdown/component.tsx +1 -1
  275. package/src/button/index.native.js +1 -1
  276. package/src/button/index.tsx +1 -1
  277. package/src/button/style.scss +1 -3
  278. package/src/circular-option-picker/test/index.tsx +6 -5
  279. package/src/color-picker/component.tsx +22 -11
  280. package/src/color-picker/styles.ts +1 -15
  281. package/src/combobox-control/index.tsx +33 -41
  282. package/src/combobox-control/test/index.tsx +1 -1
  283. package/src/composite/legacy/test/index.tsx +18 -2
  284. package/src/confirm-dialog/component.tsx +1 -1
  285. package/src/confirm-dialog/test/index.tsx +5 -21
  286. package/src/custom-select-control/README.md +0 -10
  287. package/src/custom-select-control/index.js +3 -22
  288. package/src/custom-select-control/stories/index.story.js +0 -1
  289. package/src/custom-select-control/test/index.js +17 -17
  290. package/src/custom-select-control-v2/README.md +97 -7
  291. package/src/custom-select-control-v2/custom-select-item.tsx +29 -0
  292. package/src/custom-select-control-v2/custom-select.tsx +122 -0
  293. package/src/custom-select-control-v2/default-component/index.tsx +27 -0
  294. package/src/custom-select-control-v2/index.tsx +2 -102
  295. package/src/custom-select-control-v2/legacy-component/index.tsx +133 -0
  296. package/src/custom-select-control-v2/legacy-component/test/index.tsx +457 -0
  297. package/src/custom-select-control-v2/stories/{index.story.tsx → default.story.tsx} +27 -33
  298. package/src/custom-select-control-v2/stories/legacy.story.tsx +87 -0
  299. package/src/custom-select-control-v2/styles.ts +82 -38
  300. package/src/custom-select-control-v2/test/index.tsx +207 -17
  301. package/src/custom-select-control-v2/types.ts +147 -20
  302. package/src/disabled/test/index.tsx +1 -1
  303. package/src/draggable/index.native.js +2 -2
  304. package/src/draggable/test/index.native.js +6 -2
  305. package/src/dropdown-menu/index.native.js +2 -2
  306. package/src/dropdown-menu-v2/stories/index.story.tsx +1 -0
  307. package/src/dropdown-menu-v2/test/index.tsx +4 -1
  308. package/src/flex/flex/hook.ts +1 -1
  309. package/src/font-size-picker/font-size-picker-select.tsx +0 -1
  310. package/src/font-size-picker/index.native.js +2 -2
  311. package/src/form-token-field/index.tsx +4 -11
  312. package/src/form-token-field/suggestions-list.tsx +5 -17
  313. package/src/h-stack/hook.tsx +2 -1
  314. package/src/h-stack/test/index.tsx +10 -0
  315. package/src/item-group/test/index.js +2 -2
  316. package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +10 -15
  317. package/src/mobile/bottom-sheet/button.native.js +1 -5
  318. package/src/mobile/bottom-sheet/index.native.js +2 -2
  319. package/src/mobile/bottom-sheet/range-cell.native.js +1 -1
  320. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +2 -2
  321. package/src/mobile/bottom-sheet-select-control/index.native.js +1 -1
  322. package/src/mobile/bottom-sheet-text-control/index.native.js +1 -1
  323. package/src/mobile/gradient/index.native.js +1 -1
  324. package/src/mobile/image/index.native.js +8 -23
  325. package/src/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +1 -1
  326. package/src/mobile/media-edit/index.native.js +1 -1
  327. package/src/modal/index.tsx +2 -12
  328. package/src/modal/style.scss +1 -0
  329. package/src/modal/test/index.tsx +1 -1
  330. package/src/navigation/stories/utils/hide-if-empty.tsx +2 -6
  331. package/src/palette-edit/index.tsx +2 -2
  332. package/src/popover/test/index.tsx +1 -4
  333. package/src/progress-bar/stories/index.story.tsx +1 -0
  334. package/src/progress-bar/styles.ts +2 -2
  335. package/src/query-controls/index.native.js +2 -2
  336. package/src/radio-group/stories/index.story.tsx +1 -0
  337. package/src/range-control/index.tsx +3 -3
  338. package/src/range-control/test/index.tsx +2 -2
  339. package/src/search-control/index.native.js +1 -1
  340. package/src/snackbar/index.tsx +5 -2
  341. package/src/snackbar/list.tsx +6 -1
  342. package/src/snackbar/stories/list.story.tsx +0 -3
  343. package/src/snackbar/test/index.tsx +267 -0
  344. package/src/snackbar/test/list.tsx +46 -0
  345. package/src/snackbar/types.ts +31 -3
  346. package/src/tab-panel/test/index.tsx +8 -1
  347. package/src/tabs/README.md +18 -18
  348. package/src/tabs/index.tsx +7 -7
  349. package/src/tabs/stories/index.story.tsx +2 -1
  350. package/src/tabs/test/index.tsx +66 -36
  351. package/src/tabs/types.ts +1 -1
  352. package/src/theme/stories/index.story.tsx +1 -0
  353. package/src/toggle-group-control/test/index.tsx +5 -1
  354. package/src/toolbar/toolbar-group/style.scss +1 -0
  355. package/src/tools-panel/stories/index.story.tsx +8 -8
  356. package/src/tools-panel/test/index.tsx +10 -28
  357. package/src/tooltip/style.scss +2 -1
  358. package/src/tooltip/test/index.native.js +3 -3
  359. package/src/tooltip/test/index.tsx +5 -0
  360. package/src/tree-grid/test/index.tsx +1 -1
  361. package/src/utils/hooks/index.js +0 -1
  362. package/src/utils/with-ignore-ime-events.ts +32 -0
  363. package/src/v-stack/test/index.tsx +10 -0
  364. package/tsconfig.json +0 -1
  365. package/tsconfig.tsbuildinfo +1 -1
  366. package/build/custom-select-control/styles.js +0 -27
  367. package/build/custom-select-control/styles.js.map +0 -1
  368. package/build/utils/hooks/use-latest-ref.js +0 -33
  369. package/build/utils/hooks/use-latest-ref.js.map +0 -1
  370. package/build-module/custom-select-control/styles.js +0 -18
  371. package/build-module/custom-select-control/styles.js.map +0 -1
  372. package/build-module/utils/hooks/use-latest-ref.js +0 -27
  373. package/build-module/utils/hooks/use-latest-ref.js.map +0 -1
  374. package/build-types/custom-select-control/styles.d.ts +0 -11
  375. package/build-types/custom-select-control/styles.d.ts.map +0 -1
  376. package/build-types/custom-select-control-v2/stories/index.story.d.ts +0 -20
  377. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +0 -1
  378. package/build-types/utils/hooks/use-latest-ref.d.ts +0 -15
  379. package/build-types/utils/hooks/use-latest-ref.d.ts.map +0 -1
  380. package/src/custom-select-control/styles.ts +0 -28
  381. package/src/utils/hooks/test/use-latest-ref.js +0 -119
  382. package/src/utils/hooks/use-latest-ref.ts +0 -29
@@ -28,10 +28,12 @@ const TouchEventType = {
28
28
  // For testing, we mock the "requestAnimationFrame" so it calls the callback passed instantly.
29
29
  let requestAnimationFrameCopy;
30
30
  beforeEach( () => {
31
+ jest.useFakeTimers();
31
32
  requestAnimationFrameCopy = global.requestAnimationFrame;
32
33
  global.requestAnimationFrame = ( callback ) => callback();
33
34
  } );
34
35
  afterEach( () => {
36
+ jest.useRealTimers();
35
37
  global.requestAnimationFrame = requestAnimationFrameCopy;
36
38
  } );
37
39
 
@@ -43,7 +45,7 @@ describe( 'Draggable', () => {
43
45
  <Draggable>
44
46
  <DraggableTrigger
45
47
  id={ triggerId }
46
- enabled={ true }
48
+ enabled
47
49
  minDuration={ 500 }
48
50
  onLongPress={ onLongPress }
49
51
  testID="draggableTrigger"
@@ -58,6 +60,7 @@ describe( 'Draggable', () => {
58
60
  { oldState: State.BEGAN, state: State.ACTIVE },
59
61
  { state: State.ACTIVE },
60
62
  ] );
63
+ jest.runOnlyPendingTimers();
61
64
 
62
65
  expect( onLongPress ).toHaveBeenCalledTimes( 1 );
63
66
  expect( onLongPress ).toHaveBeenCalledWith( triggerId );
@@ -93,6 +96,7 @@ describe( 'Draggable', () => {
93
96
  { oldState: State.BEGAN, state: State.ACTIVE },
94
97
  { state: State.ACTIVE },
95
98
  ] );
99
+ jest.runOnlyPendingTimers();
96
100
  fireGestureHandler( draggable, [
97
101
  // TOUCHES_DOWN event is only received on ACTIVE state, so we have to fire it manually.
98
102
  { oldState: State.BEGAN, state: State.ACTIVE },
@@ -112,7 +116,7 @@ describe( 'Draggable', () => {
112
116
  ] );
113
117
  // TODO(jest-console): Fix the warning and remove the expect below.
114
118
  expect( console ).toHaveWarnedWith(
115
- '[Reanimated] You can not use setGestureState in non-worklet function.'
119
+ '[Reanimated] setGestureState() cannot be used with Jest.'
116
120
  );
117
121
 
118
122
  expect( onDragStart ).toHaveBeenCalledTimes( 1 );
@@ -108,7 +108,7 @@ function DropdownMenu( {
108
108
  renderContent={ ( { isOpen, onClose, ...props } ) => {
109
109
  return (
110
110
  <BottomSheet
111
- hideHeader={ true }
111
+ hideHeader
112
112
  isVisible={ isOpen }
113
113
  onClose={ onClose }
114
114
  >
@@ -135,7 +135,7 @@ function DropdownMenu( {
135
135
  } }
136
136
  editable={ false }
137
137
  icon={ control.icon }
138
- leftAlign={ true }
138
+ leftAlign
139
139
  isSelected={ control.isActive }
140
140
  separatorType={
141
141
  Platform.OS === 'android'
@@ -56,6 +56,7 @@ const meta: Meta< typeof DropdownMenu > = {
56
56
  children: { control: { type: null } },
57
57
  trigger: { control: { type: null } },
58
58
  },
59
+ tags: [ 'status-private' ],
59
60
  parameters: {
60
61
  actions: { argTypesRegex: '^on.*' },
61
62
  badges: [ 'private' ],
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { render, screen, waitFor } from '@testing-library/react';
5
- import { press, click, hover, type } from '@ariakit/test';
5
+ import { press, click, hover, sleep, type } from '@ariakit/test';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -123,6 +123,7 @@ describe( 'DropdownMenu', () => {
123
123
  } );
124
124
 
125
125
  // Move focus on the toggle
126
+ await sleep();
126
127
  await press.Tab();
127
128
 
128
129
  expect( toggleButton ).toHaveFocus();
@@ -153,6 +154,7 @@ describe( 'DropdownMenu', () => {
153
154
  } );
154
155
 
155
156
  // Move focus on the toggle
157
+ await sleep();
156
158
  await press.Tab();
157
159
 
158
160
  expect( toggleButton ).toHaveFocus();
@@ -908,6 +910,7 @@ describe( 'DropdownMenu', () => {
908
910
 
909
911
  // The outer button can be focused by pressing tab. Doing so will cause
910
912
  // the DropdownMenu to close.
913
+ await sleep();
911
914
  await press.Tab();
912
915
  expect( outerButton ).toBeInTheDocument();
913
916
  expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument();
@@ -22,7 +22,7 @@ import type { FlexProps } from '../types';
22
22
 
23
23
  function useDeprecatedProps(
24
24
  props: WordPressComponentProps< FlexProps, 'div' >
25
- ): WordPressComponentProps< FlexProps, 'div' > {
25
+ ): Omit< typeof props, 'isReversed' > {
26
26
  const { isReversed, ...otherProps } = props;
27
27
 
28
28
  if ( typeof isReversed !== 'undefined' ) {
@@ -69,7 +69,6 @@ const FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {
69
69
  return (
70
70
  <CustomSelectControl
71
71
  __next40pxDefaultSize={ __next40pxDefaultSize }
72
- __nextUnconstrainedWidth
73
72
  className="components-font-size-picker__select"
74
73
  label={ __( 'Font size' ) }
75
74
  hideLabelFromVision
@@ -111,7 +111,7 @@ function FontSizePicker( {
111
111
  separatorType="none"
112
112
  label={ __( 'Default' ) }
113
113
  onPress={ onChangeValue( undefined ) }
114
- leftAlign={ true }
114
+ leftAlign
115
115
  key={ 'default' }
116
116
  accessibilityRole={ 'button' }
117
117
  accessibilityLabel={ __( 'Selected: Default' ) }
@@ -137,7 +137,7 @@ function FontSizePicker( {
137
137
  label={ item.name }
138
138
  subLabel={ item.sizePx }
139
139
  onPress={ onChangeValue( item.sizePx ) }
140
- leftAlign={ true }
140
+ leftAlign
141
141
  key={ index }
142
142
  accessibilityRole={ 'button' }
143
143
  accessibilityLabel={
@@ -28,6 +28,7 @@ import {
28
28
  } from '../base-control/styles/base-control-styles';
29
29
  import { Spacer } from '../spacer';
30
30
  import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
31
+ import { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';
31
32
 
32
33
  const identity = ( value: string ) => value;
33
34
 
@@ -194,15 +195,7 @@ export function FormTokenField( props: FormTokenFieldProps ) {
194
195
  function onKeyDown( event: KeyboardEvent ) {
195
196
  let preventDefault = false;
196
197
 
197
- if (
198
- event.defaultPrevented ||
199
- // Ignore keydowns from IMEs
200
- event.nativeEvent.isComposing ||
201
- // Workaround for Mac Safari where the final Enter/Backspace of an IME composition
202
- // is `isComposing=false`, even though it's technically still part of the composition.
203
- // These can only be detected by keyCode.
204
- event.keyCode === 229
205
- ) {
198
+ if ( event.defaultPrevented ) {
206
199
  return;
207
200
  }
208
201
  switch ( event.key ) {
@@ -689,7 +682,7 @@ export function FormTokenField( props: FormTokenFieldProps ) {
689
682
 
690
683
  if ( ! disabled ) {
691
684
  tokenFieldProps = Object.assign( {}, tokenFieldProps, {
692
- onKeyDown,
685
+ onKeyDown: withIgnoreIMEEvents( onKeyDown ),
693
686
  onKeyPress,
694
687
  onFocus: onFocusHandler,
695
688
  } );
@@ -718,7 +711,7 @@ export function FormTokenField( props: FormTokenFieldProps ) {
718
711
  justify="flex-start"
719
712
  align="center"
720
713
  gap={ 1 }
721
- wrap={ true }
714
+ wrap
722
715
  __next40pxDefaultSize={ __next40pxDefaultSize }
723
716
  hasTokens={ !! value.length }
724
717
  >
@@ -1,14 +1,12 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import scrollView from 'dom-scroll-into-view';
5
4
  import classnames from 'classnames';
6
5
  import type { MouseEventHandler, ReactNode } from 'react';
7
6
 
8
7
  /**
9
8
  * WordPress dependencies
10
9
  */
11
- import { useState } from '@wordpress/element';
12
10
  import { useRefEffect } from '@wordpress/compose';
13
11
 
14
12
  /**
@@ -32,8 +30,6 @@ export function SuggestionsList< T extends string | { value: string } >( {
32
30
  instanceId,
33
31
  __experimentalRenderItem,
34
32
  }: SuggestionsListProps< T > ) {
35
- const [ scrollingIntoView, setScrollingIntoView ] = useState( false );
36
-
37
33
  const listRef = useRefEffect< HTMLUListElement >(
38
34
  ( listNode ) => {
39
35
  // only have to worry about scrolling selected suggestion into view
@@ -44,16 +40,10 @@ export function SuggestionsList< T extends string | { value: string } >( {
44
40
  scrollIntoView &&
45
41
  listNode.children[ selectedIndex ]
46
42
  ) {
47
- setScrollingIntoView( true );
48
- scrollView(
49
- listNode.children[ selectedIndex ] as HTMLLIElement,
50
- listNode,
51
- {
52
- onlyScrollIfNeeded: true,
53
- }
54
- );
55
- rafId = requestAnimationFrame( () => {
56
- setScrollingIntoView( false );
43
+ listNode.children[ selectedIndex ].scrollIntoView( {
44
+ behavior: 'instant',
45
+ block: 'nearest',
46
+ inline: 'nearest',
57
47
  } );
58
48
  }
59
49
 
@@ -68,9 +58,7 @@ export function SuggestionsList< T extends string | { value: string } >( {
68
58
 
69
59
  const handleHover = ( suggestion: T ) => {
70
60
  return () => {
71
- if ( ! scrollingIntoView ) {
72
- onHover?.( suggestion );
73
- }
61
+ onHover?.( suggestion );
74
62
  };
75
63
  };
76
64
 
@@ -47,7 +47,8 @@ export function useHStack( props: WordPressComponentProps< Props, 'div' > ) {
47
47
  gap: spacing,
48
48
  };
49
49
 
50
- const flexProps = useFlex( propsForFlex );
50
+ // Omit `isColumn` because it's not used in HStack.
51
+ const { isColumn, ...flexProps } = useFlex( propsForFlex );
51
52
 
52
53
  return flexProps;
53
54
  }
@@ -39,4 +39,14 @@ describe( 'props', () => {
39
39
  );
40
40
  expect( container ).toMatchSnapshot();
41
41
  } );
42
+
43
+ test( 'should not pass through invalid props to the `as` component', () => {
44
+ const AsComponent = ( props: JSX.IntrinsicElements[ 'div' ] ) => {
45
+ return <div { ...props } />;
46
+ };
47
+
48
+ render( <HStack as={ AsComponent }>foobar</HStack> );
49
+
50
+ expect( console ).not.toHaveErrored();
51
+ } );
42
52
  } );
@@ -29,7 +29,7 @@ describe( 'ItemGroup', () => {
29
29
  );
30
30
 
31
31
  const { container: withBorders } = render(
32
- <ItemGroup isBordered={ true }>
32
+ <ItemGroup isBordered>
33
33
  <Item>Code is poetry</Item>
34
34
  </ItemGroup>
35
35
  );
@@ -63,7 +63,7 @@ describe( 'ItemGroup', () => {
63
63
  );
64
64
 
65
65
  const { container: separatedItems } = render(
66
- <ItemGroup isSeparated={ true }>
66
+ <ItemGroup isSeparated>
67
67
  <Item>Code is poetry</Item>
68
68
  </ItemGroup>
69
69
  );
@@ -2,12 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { Text } from 'react-native';
5
- import {
6
- render,
7
- fireEvent,
8
- withReanimatedTimer,
9
- advanceAnimationByTime,
10
- } from 'test/helpers';
5
+ import { act, render, fireEvent, withReanimatedTimer } from 'test/helpers';
11
6
  import { useNavigation } from '@react-navigation/native';
12
7
 
13
8
  /**
@@ -63,7 +58,7 @@ it( 'animates height transitioning from non-full-screen to non-full-screen', asy
63
58
  screen.getByTestId( 'navigation-screen-test-screen-1' ),
64
59
  screen1Layout
65
60
  );
66
- advanceAnimationByTime( 1 );
61
+ act( () => jest.advanceTimersByTime( 1 ) );
67
62
  expect( navigationContainer ).toHaveAnimatedStyle( screen1Layout );
68
63
 
69
64
  // Navigate to screen 2
@@ -75,7 +70,7 @@ it( 'animates height transitioning from non-full-screen to non-full-screen', asy
75
70
  );
76
71
  // The animation takes 300 ms, so we wait that time plus 1 ms
77
72
  // to the completion.
78
- advanceAnimationByTime( 301 );
73
+ act( () => jest.advanceTimersByTime( 301 ) );
79
74
  expect( navigationContainer ).toHaveAnimatedStyle( screen2Layout );
80
75
  } ) );
81
76
 
@@ -105,14 +100,14 @@ it( 'animates height transitioning from non-full-screen to full-screen', async (
105
100
  screen.getByTestId( 'navigation-screen-test-screen-1' ),
106
101
  screen1Layout
107
102
  );
108
- advanceAnimationByTime( 1 );
103
+ act( () => jest.advanceTimersByTime( 1 ) );
109
104
  expect( navigationContainer ).toHaveAnimatedStyle( screen1Layout );
110
105
 
111
106
  // Navigate to screen 2
112
107
  fireEvent.press( screen.getByText( /test-screen-1/ ) );
113
108
  // The animation takes 300 ms, so we wait that time plus 1 ms
114
109
  // to the completion.
115
- advanceAnimationByTime( 301 );
110
+ act( () => jest.advanceTimersByTime( 301 ) );
116
111
  expect( navigationContainer ).toHaveAnimatedStyle( {
117
112
  height: WINDOW_HEIGHT,
118
113
  } );
@@ -144,14 +139,14 @@ it( 'animates height transitioning from full-screen to non-full-screen', async (
144
139
  screen.getByTestId( 'navigation-screen-test-screen-1' ),
145
140
  screen1Layout
146
141
  );
147
- advanceAnimationByTime( 1 );
142
+ act( () => jest.advanceTimersByTime( 1 ) );
148
143
  expect( navigationContainer ).toHaveAnimatedStyle( screen1Layout );
149
144
 
150
145
  // Navigate to screen 2
151
146
  fireEvent.press( screen.getByText( /test-screen-1/ ) );
152
147
  // The animation takes 300 ms, so we wait that time plus 1 ms
153
148
  // to the completion.
154
- advanceAnimationByTime( 301 );
149
+ act( () => jest.advanceTimersByTime( 301 ) );
155
150
  expect( navigationContainer ).toHaveAnimatedStyle( {
156
151
  height: WINDOW_HEIGHT,
157
152
  } );
@@ -160,7 +155,7 @@ it( 'animates height transitioning from full-screen to non-full-screen', async (
160
155
  fireEvent.press( await screen.findByText( /test-screen-2/ ) );
161
156
  // The animation takes 300 ms, so we wait that time plus 1 ms
162
157
  // to the completion.
163
- advanceAnimationByTime( 301 );
158
+ act( () => jest.advanceTimersByTime( 301 ) );
164
159
  expect( navigationContainer ).toHaveAnimatedStyle( screen1Layout );
165
160
  } ) );
166
161
 
@@ -187,7 +182,7 @@ it( 'does not animate height transitioning from full-screen to full-screen', asy
187
182
 
188
183
  // First height value should be set without animation, but we need
189
184
  // to wait for a frame to let animated styles be updated.
190
- advanceAnimationByTime( 1 );
185
+ act( () => jest.advanceTimersByTime( 1 ) );
191
186
  expect( navigationContainer ).toHaveAnimatedStyle( {
192
187
  height: WINDOW_HEIGHT,
193
188
  } );
@@ -195,7 +190,7 @@ it( 'does not animate height transitioning from full-screen to full-screen', asy
195
190
  // Navigate to screen 2
196
191
  fireEvent.press( screen.getByText( /test-screen-1/ ) );
197
192
  // We wait some milliseconds to check if height has changed.
198
- advanceAnimationByTime( 10 );
193
+ act( () => jest.advanceTimersByTime( 10 ) );
199
194
  expect( navigationContainer ).toHaveAnimatedStyle( {
200
195
  height: WINDOW_HEIGHT,
201
196
  } );
@@ -9,11 +9,7 @@ import { TouchableOpacity, View, Text } from 'react-native';
9
9
  import styles from './styles.scss';
10
10
 
11
11
  const BottomSheetButton = ( { onPress, disabled, text, color } ) => (
12
- <TouchableOpacity
13
- accessible={ true }
14
- onPress={ onPress }
15
- disabled={ disabled }
16
- >
12
+ <TouchableOpacity accessible onPress={ onPress } disabled={ disabled }>
17
13
  <View style={ { flexDirection: 'row', justifyContent: 'center' } }>
18
14
  <Text style={ { ...styles.buttonText, color } }>{ text }</Text>
19
15
  </View>
@@ -540,8 +540,8 @@ class BottomSheet extends Component {
540
540
  }
541
541
  onAccessibilityEscape={ this.onCloseBottomSheet }
542
542
  testID="bottom-sheet"
543
- hardwareAccelerated={ true }
544
- useNativeDriverForBackdrop={ true }
543
+ hardwareAccelerated
544
+ useNativeDriverForBackdrop
545
545
  { ...rest }
546
546
  >
547
547
  <KeyboardAvoidingView
@@ -181,7 +181,7 @@ class BottomSheetRangeCell extends Component {
181
181
 
182
182
  return (
183
183
  <View
184
- accessible={ true }
184
+ accessible
185
185
  accessibilityRole="adjustable"
186
186
  accessibilityActions={ [
187
187
  { name: 'increment' },
@@ -174,7 +174,7 @@ class BottomSheetStepperCell extends Component {
174
174
 
175
175
  return (
176
176
  <View
177
- accessible={ true }
177
+ accessible
178
178
  accessibilityRole="adjustable"
179
179
  accessibilityLabel={ accessibilityLabel }
180
180
  accessibilityHint={ getAccessibilityHint() }
@@ -214,7 +214,7 @@ class BottomSheetStepperCell extends Component {
214
214
  icon={ icon }
215
215
  label={ label }
216
216
  labelStyle={ labelStyle }
217
- leftAlign={ true }
217
+ leftAlign
218
218
  separatorType={ separatorType }
219
219
  disabled={ disabled }
220
220
  >
@@ -91,7 +91,7 @@ const BottomSheetSelectControl = ( {
91
91
  label={ item.label }
92
92
  icon={ item.icon }
93
93
  onPress={ onChangeValue( item.value ) }
94
- leftAlign={ true }
94
+ leftAlign
95
95
  key={ index }
96
96
  accessibilityRole={ 'button' }
97
97
  accessibilityLabel={
@@ -82,7 +82,7 @@ const BottomSheetTextControl = ( {
82
82
  label={ label }
83
83
  onChangeText={ ( text ) => onChange( text ) }
84
84
  defaultValue={ initialValue }
85
- multiline={ true }
85
+ multiline
86
86
  placeholder={ placeholder }
87
87
  placeholderTextColor={ '#87a6bc' }
88
88
  style={ textEditorStyle }
@@ -135,7 +135,7 @@ function Gradient( {
135
135
  return (
136
136
  <RNLinearGradient
137
137
  colors={ colors }
138
- useAngle={ true }
138
+ useAngle
139
139
  angle={ getGradientAngle( gradientValue ) }
140
140
  locations={ locations }
141
141
  angleCenter={ angleCenter }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { Animated, Image as RNImage, Text, View } from 'react-native';
4
+ import { Image as RNImage, Text, View } from 'react-native';
5
5
  import FastImage from 'react-native-fast-image';
6
6
 
7
7
  /**
@@ -11,7 +11,7 @@ import { __ } from '@wordpress/i18n';
11
11
  import { Icon } from '@wordpress/components';
12
12
  import { image, offline } from '@wordpress/icons';
13
13
  import { usePreferredColorSchemeStyle } from '@wordpress/compose';
14
- import { useEffect, useState, useRef, Platform } from '@wordpress/element';
14
+ import { useEffect, useState, Platform } from '@wordpress/element';
15
15
 
16
16
  /**
17
17
  * Internal dependencies
@@ -218,19 +218,8 @@ const ImageComponent = ( {
218
218
  focalPoint && styles.focalPointContainer,
219
219
  ];
220
220
 
221
- const opacityValue = useRef( new Animated.Value( 1 ) ).current;
222
-
223
- useEffect( () => {
224
- Animated.timing( opacityValue, {
225
- toValue: isUploadInProgress ? 0.3 : 1,
226
- duration: 100,
227
- useNativeDriver: true,
228
- } ).start();
229
- }, [ isUploadInProgress, opacityValue ] );
230
-
231
221
  const imageStyles = [
232
222
  {
233
- opacity: opacityValue,
234
223
  height: containerSize?.height,
235
224
  },
236
225
  ! resizeMode && {
@@ -300,13 +289,9 @@ const ImageComponent = ( {
300
289
  key={ url }
301
290
  style={ imageContainerStyles }
302
291
  >
303
- { isSelected &&
304
- highlightSelected &&
305
- ! (
306
- isUploadInProgress ||
307
- isUploadFailed ||
308
- isUploadPaused
309
- ) && <View style={ imageSelectedStyles } /> }
292
+ { isSelected && highlightSelected && (
293
+ <View style={ imageSelectedStyles } />
294
+ ) }
310
295
 
311
296
  { ! imageData ? (
312
297
  <View style={ placeholderStyles }>
@@ -319,7 +304,7 @@ const ImageComponent = ( {
319
304
  { Platform.isAndroid && (
320
305
  <>
321
306
  { networkImageLoaded && networkURL && (
322
- <Animated.Image
307
+ <Image
323
308
  style={ imageStyles }
324
309
  fadeDuration={ 0 }
325
310
  source={ { uri: networkURL } }
@@ -331,7 +316,7 @@ const ImageComponent = ( {
331
316
  />
332
317
  ) }
333
318
  { ! networkImageLoaded && ! networkURL && (
334
- <Animated.Image
319
+ <Image
335
320
  style={ imageStyles }
336
321
  fadeDuration={ 0 }
337
322
  source={ { uri: localURL } }
@@ -345,7 +330,7 @@ const ImageComponent = ( {
345
330
  ) }
346
331
  { Platform.isIOS && (
347
332
  <>
348
- <Animated.Image
333
+ <Image
349
334
  style={ imageStyles }
350
335
  source={ {
351
336
  uri:
@@ -45,7 +45,7 @@ export default function useScrollToSection(
45
45
  if (
46
46
  ! scrollViewRef.current ||
47
47
  ! scrollEnabled ||
48
- ! scrollViewMeasurements
48
+ ! scrollViewMeasurements.current
49
49
  ) {
50
50
  return;
51
51
  }
@@ -103,7 +103,7 @@ export class MediaEdit extends Component {
103
103
  hideCancelButton
104
104
  ref={ ( instance ) => ( this.picker = instance ) }
105
105
  options={ this.getMediaOptionsItems() }
106
- leftAlign={ true }
106
+ leftAlign
107
107
  onChange={ this.onPickerSelect }
108
108
  // translators: %s: block title e.g: "Paragraph".
109
109
  title={ __( 'Media options' ) }
@@ -41,6 +41,7 @@ import * as ariaHelper from './aria-helper';
41
41
  import Button from '../button';
42
42
  import StyleProvider from '../style-provider';
43
43
  import type { ModalProps } from './types';
44
+ import { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';
44
45
 
45
46
  // Used to track and dismiss the prior modal when another opens unless nested.
46
47
  const ModalContext = createContext<
@@ -196,17 +197,6 @@ function UnforwardedModal(
196
197
  }, [ isContentScrollable, childrenContainerRef ] );
197
198
 
198
199
  function handleEscapeKeyDown( event: KeyboardEvent< HTMLDivElement > ) {
199
- if (
200
- // Ignore keydowns from IMEs
201
- event.nativeEvent.isComposing ||
202
- // Workaround for Mac Safari where the final Enter/Backspace of an IME composition
203
- // is `isComposing=false`, even though it's technically still part of the composition.
204
- // These can only be detected by keyCode.
205
- event.keyCode === 229
206
- ) {
207
- return;
208
- }
209
-
210
200
  if (
211
201
  shouldCloseOnEsc &&
212
202
  ( event.code === 'Escape' || event.key === 'Escape' ) &&
@@ -265,7 +255,7 @@ function UnforwardedModal(
265
255
  'components-modal__screen-overlay',
266
256
  overlayClassName
267
257
  ) }
268
- onKeyDown={ handleEscapeKeyDown }
258
+ onKeyDown={ withIgnoreIMEEvents( handleEscapeKeyDown ) }
269
259
  { ...( shouldCloseOnClickOutside ? overlayPressHandlers : {} ) }
270
260
  >
271
261
  <StyleProvider document={ document }>
@@ -15,6 +15,7 @@
15
15
 
16
16
  // The modal window element.
17
17
  .components-modal__frame {
18
+ @include reset;
18
19
  // Use the entire viewport on smaller screens.
19
20
  margin: $grid-unit-50 0 0 0;
20
21
  width: 100%;
@@ -335,7 +335,7 @@ describe( 'Modal', () => {
335
335
  it( 'should focus the Modal dialog when `true` passed as value for `focusOnMount` prop', async () => {
336
336
  const user = userEvent.setup();
337
337
 
338
- render( <FocusMountDemo focusOnMount={ true } /> );
338
+ render( <FocusMountDemo focusOnMount /> );
339
339
 
340
340
  const opener = screen.getByRole( 'button', {
341
341
  name: 'Toggle Modal',
@@ -42,11 +42,7 @@ export const HideIfEmptyStory: StoryFn< typeof Navigation > = ( {
42
42
  />
43
43
  </NavigationMenu>
44
44
 
45
- <NavigationMenu
46
- menu="root-sub-1"
47
- parentMenu="root"
48
- isEmpty={ true }
49
- />
45
+ <NavigationMenu menu="root-sub-1" parentMenu="root" isEmpty />
50
46
  <NavigationMenu
51
47
  menu="root-sub-2"
52
48
  parentMenu="root"
@@ -57,7 +53,7 @@ export const HideIfEmptyStory: StoryFn< typeof Navigation > = ( {
57
53
  <NavigationMenu
58
54
  menu="root-sub-1-sub-1"
59
55
  parentMenu="root-sub-1"
60
- isEmpty={ true }
56
+ isEmpty
61
57
  />
62
58
  </Navigation>
63
59
 
@@ -592,14 +592,14 @@ export function PaletteEdit( {
592
592
  gradients={ gradients }
593
593
  onChange={ onSelectPaletteItem }
594
594
  clearable={ false }
595
- disableCustomGradients={ true }
595
+ disableCustomGradients
596
596
  />
597
597
  ) : (
598
598
  <ColorPalette
599
599
  colors={ colors }
600
600
  onChange={ onSelectPaletteItem }
601
601
  clearable={ false }
602
- disableCustomColors={ true }
602
+ disableCustomColors
603
603
  />
604
604
  ) ) }
605
605
  </>