@wordpress/components 35.0.1 → 36.0.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 (368) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/CONTRIBUTING.md +33 -26
  3. package/build/alignment-matrix-control/cell.cjs +1 -1
  4. package/build/alignment-matrix-control/cell.cjs.map +2 -2
  5. package/build/alignment-matrix-control/index.cjs +1 -1
  6. package/build/alignment-matrix-control/index.cjs.map +2 -2
  7. package/build/angle-picker-control/angle-circle.cjs +1 -1
  8. package/build/angle-picker-control/angle-circle.cjs.map +2 -2
  9. package/build/angle-picker-control/index.cjs +2 -2
  10. package/build/autocomplete/get-autocomplete-match.cjs.map +1 -1
  11. package/build/autocomplete/index.cjs.map +1 -1
  12. package/build/base-control/styles/base-control-styles.cjs +6 -6
  13. package/build/base-control/styles/base-control-styles.cjs.map +2 -2
  14. package/build/border-control/styles.cjs +17 -14
  15. package/build/border-control/styles.cjs.map +2 -2
  16. package/build/box-control/{input-control.cjs → box-input-control.cjs} +9 -9
  17. package/build/box-control/box-input-control.cjs.map +7 -0
  18. package/build/box-control/index.cjs +9 -25
  19. package/build/box-control/index.cjs.map +3 -3
  20. package/build/button/index.cjs +3 -7
  21. package/build/button/index.cjs.map +2 -2
  22. package/build/card/card-divider/hook.cjs.map +2 -2
  23. package/build/color-palette/index.cjs.map +1 -1
  24. package/build/color-picker/component.cjs.map +1 -1
  25. package/build/date-time/utils.cjs.map +1 -1
  26. package/build/disabled/index.cjs.map +2 -2
  27. package/build/divider/component.cjs +108 -3
  28. package/build/divider/component.cjs.map +4 -4
  29. package/build/draggable/index.cjs.map +1 -1
  30. package/build/external-link/index.cjs +1 -1
  31. package/build/external-link/index.cjs.map +1 -1
  32. package/build/higher-order/with-fallback-styles/index.cjs +18 -44
  33. package/build/higher-order/with-fallback-styles/index.cjs.map +2 -2
  34. package/build/menu/popover.cjs.map +1 -1
  35. package/build/menu/styles.cjs +17 -17
  36. package/build/menu/styles.cjs.map +2 -2
  37. package/build/modal/index.cjs.map +1 -1
  38. package/build/modal/use-modal-exit-animation.cjs +37 -52
  39. package/build/modal/use-modal-exit-animation.cjs.map +2 -2
  40. package/build/palette-edit/index.cjs +1 -1
  41. package/build/progress-bar/index.cjs +1 -1
  42. package/build/progress-bar/index.cjs.map +2 -2
  43. package/build/query-controls/index.cjs +2 -2
  44. package/build/query-controls/index.cjs.map +2 -2
  45. package/build/range-control/index.cjs.map +1 -1
  46. package/build/sandbox/index.cjs +7 -1
  47. package/build/sandbox/index.cjs.map +2 -2
  48. package/build/snackbar/index.cjs +1 -1
  49. package/build/spinner/styles.cjs +4 -4
  50. package/build/spinner/styles.cjs.map +2 -2
  51. package/build/tabs/index.cjs +0 -18
  52. package/build/tabs/index.cjs.map +2 -2
  53. package/build/tabs/tablist.cjs +5 -15
  54. package/build/tabs/tablist.cjs.map +2 -2
  55. package/build/text-control/index.cjs +3 -12
  56. package/build/text-control/index.cjs.map +3 -3
  57. package/build/tools-panel/styles.cjs +13 -13
  58. package/build/tools-panel/styles.cjs.map +2 -2
  59. package/build/tools-panel/tools-panel/hook.cjs.map +1 -1
  60. package/build/tree-select/index.cjs +1 -1
  61. package/build/tree-select/index.cjs.map +1 -1
  62. package/build/truncate/utils.cjs +1 -1
  63. package/build/truncate/utils.cjs.map +1 -1
  64. package/build/utils/colors-values.cjs +12 -12
  65. package/build/utils/colors-values.cjs.map +2 -2
  66. package/build/utils/config-values.cjs +2 -2
  67. package/build/utils/config-values.cjs.map +2 -2
  68. package/build/utils/dropdown-motion.cjs.map +2 -2
  69. package/build/utils/strings.cjs.map +1 -1
  70. package/build/validated-form-controls/components/text-control.cjs +0 -1
  71. package/build/validated-form-controls/components/text-control.cjs.map +2 -2
  72. package/build-module/alignment-matrix-control/cell.mjs +1 -1
  73. package/build-module/alignment-matrix-control/cell.mjs.map +2 -2
  74. package/build-module/alignment-matrix-control/index.mjs +1 -1
  75. package/build-module/alignment-matrix-control/index.mjs.map +2 -2
  76. package/build-module/angle-picker-control/angle-circle.mjs +1 -1
  77. package/build-module/angle-picker-control/angle-circle.mjs.map +2 -2
  78. package/build-module/angle-picker-control/index.mjs +2 -2
  79. package/build-module/autocomplete/get-autocomplete-match.mjs.map +1 -1
  80. package/build-module/autocomplete/index.mjs.map +1 -1
  81. package/build-module/base-control/styles/base-control-styles.mjs +6 -6
  82. package/build-module/base-control/styles/base-control-styles.mjs.map +2 -2
  83. package/build-module/border-control/styles.mjs +17 -14
  84. package/build-module/border-control/styles.mjs.map +2 -2
  85. package/build-module/box-control/{input-control.mjs → box-input-control.mjs} +6 -6
  86. package/build-module/box-control/box-input-control.mjs.map +7 -0
  87. package/build-module/box-control/index.mjs +9 -25
  88. package/build-module/box-control/index.mjs.map +2 -2
  89. package/build-module/button/index.mjs +2 -5
  90. package/build-module/button/index.mjs.map +2 -2
  91. package/build-module/card/card-divider/hook.mjs.map +2 -2
  92. package/build-module/color-palette/index.mjs.map +1 -1
  93. package/build-module/color-picker/component.mjs.map +1 -1
  94. package/build-module/date-time/utils.mjs.map +1 -1
  95. package/build-module/disabled/index.mjs.map +2 -2
  96. package/build-module/divider/component.mjs +108 -3
  97. package/build-module/divider/component.mjs.map +3 -3
  98. package/build-module/draggable/index.mjs.map +1 -1
  99. package/build-module/external-link/index.mjs +1 -1
  100. package/build-module/external-link/index.mjs.map +1 -1
  101. package/build-module/higher-order/with-fallback-styles/index.mjs +20 -46
  102. package/build-module/higher-order/with-fallback-styles/index.mjs.map +2 -2
  103. package/build-module/menu/popover.mjs.map +1 -1
  104. package/build-module/menu/styles.mjs +17 -17
  105. package/build-module/menu/styles.mjs.map +2 -2
  106. package/build-module/modal/index.mjs.map +1 -1
  107. package/build-module/modal/use-modal-exit-animation.mjs +37 -52
  108. package/build-module/modal/use-modal-exit-animation.mjs.map +2 -2
  109. package/build-module/palette-edit/index.mjs +1 -1
  110. package/build-module/progress-bar/index.mjs +1 -1
  111. package/build-module/progress-bar/index.mjs.map +2 -2
  112. package/build-module/query-controls/index.mjs +2 -2
  113. package/build-module/query-controls/index.mjs.map +2 -2
  114. package/build-module/range-control/index.mjs.map +1 -1
  115. package/build-module/sandbox/index.mjs +3 -1
  116. package/build-module/sandbox/index.mjs.map +2 -2
  117. package/build-module/snackbar/index.mjs +1 -1
  118. package/build-module/spinner/styles.mjs +4 -4
  119. package/build-module/spinner/styles.mjs.map +2 -2
  120. package/build-module/tabs/index.mjs +1 -19
  121. package/build-module/tabs/index.mjs.map +2 -2
  122. package/build-module/tabs/tablist.mjs +5 -15
  123. package/build-module/tabs/tablist.mjs.map +2 -2
  124. package/build-module/text-control/index.mjs +3 -12
  125. package/build-module/text-control/index.mjs.map +2 -2
  126. package/build-module/tools-panel/styles.mjs +13 -13
  127. package/build-module/tools-panel/styles.mjs.map +2 -2
  128. package/build-module/tools-panel/tools-panel/hook.mjs.map +1 -1
  129. package/build-module/tree-select/index.mjs +1 -1
  130. package/build-module/tree-select/index.mjs.map +1 -1
  131. package/build-module/truncate/utils.mjs +1 -1
  132. package/build-module/truncate/utils.mjs.map +1 -1
  133. package/build-module/utils/colors-values.mjs +12 -12
  134. package/build-module/utils/colors-values.mjs.map +2 -2
  135. package/build-module/utils/config-values.mjs +2 -2
  136. package/build-module/utils/config-values.mjs.map +2 -2
  137. package/build-module/utils/dropdown-motion.mjs.map +2 -2
  138. package/build-module/utils/strings.mjs.map +1 -1
  139. package/build-module/validated-form-controls/components/text-control.mjs +0 -1
  140. package/build-module/validated-form-controls/components/text-control.mjs.map +2 -2
  141. package/build-style/style-rtl.css +85 -101
  142. package/build-style/style.css +85 -101
  143. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  144. package/build-types/border-control/styles.d.ts.map +1 -1
  145. package/build-types/box-control/box-input-control.d.ts +3 -0
  146. package/build-types/box-control/box-input-control.d.ts.map +1 -0
  147. package/build-types/box-control/index.d.ts +2 -6
  148. package/build-types/box-control/index.d.ts.map +1 -1
  149. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  150. package/build-types/box-control/types.d.ts +7 -6
  151. package/build-types/box-control/types.d.ts.map +1 -1
  152. package/build-types/button/index.d.ts +0 -2
  153. package/build-types/button/index.d.ts.map +1 -1
  154. package/build-types/card/card-divider/hook.d.ts +1 -274
  155. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  156. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  157. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  158. package/build-types/disabled/index.d.ts +0 -1
  159. package/build-types/disabled/index.d.ts.map +1 -1
  160. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  161. package/build-types/divider/component.d.ts.map +1 -1
  162. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  163. package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -35
  164. package/build-types/higher-order/with-fallback-styles/index.d.ts.map +1 -1
  165. package/build-types/higher-order/with-fallback-styles/test/index.d.ts.map +1 -0
  166. package/build-types/icon/stories/index.story.d.ts +0 -1
  167. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  168. package/build-types/menu/styles.d.ts.map +1 -1
  169. package/build-types/menu/types.d.ts +2 -2
  170. package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
  171. package/build-types/resizable-box/index.d.ts +0 -2
  172. package/build-types/resizable-box/index.d.ts.map +1 -1
  173. package/build-types/resizable-box/stories/index.story.d.ts +0 -2
  174. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  175. package/build-types/sandbox/index.d.ts +15 -0
  176. package/build-types/sandbox/index.d.ts.map +1 -1
  177. package/build-types/spinner/styles.d.ts.map +1 -1
  178. package/build-types/tabs/index.d.ts.map +1 -1
  179. package/build-types/tabs/tablist.d.ts.map +1 -1
  180. package/build-types/text-control/index.d.ts +0 -1
  181. package/build-types/text-control/index.d.ts.map +1 -1
  182. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  183. package/build-types/text-control/types.d.ts +2 -1
  184. package/build-types/text-control/types.d.ts.map +1 -1
  185. package/build-types/tools-panel/styles.d.ts.map +1 -1
  186. package/build-types/utils/colors-values.d.ts.map +1 -1
  187. package/build-types/utils/dropdown-motion.d.ts.map +1 -1
  188. package/build-types/validated-form-controls/components/combobox-control.d.ts +2 -2
  189. package/build-types/validated-form-controls/components/text-control.d.ts +2 -2
  190. package/build-types/validated-form-controls/components/text-control.d.ts.map +1 -1
  191. package/package.json +34 -28
  192. package/src/angle-picker-control/angle-circle.tsx +3 -3
  193. package/src/base-control/README.md +2 -2
  194. package/src/base-control/styles/base-control-styles.ts +1 -0
  195. package/src/border-control/styles.ts +1 -0
  196. package/src/box-control/README.md +1 -13
  197. package/src/box-control/{input-control.tsx → box-input-control.tsx} +4 -4
  198. package/src/box-control/index.tsx +5 -23
  199. package/src/box-control/stories/index.story.tsx +1 -3
  200. package/src/box-control/test/index.tsx +15 -2
  201. package/src/box-control/types.ts +7 -6
  202. package/src/button/index.tsx +2 -4
  203. package/src/button/style.scss +3 -3
  204. package/src/card/card-divider/hook.ts +5 -1
  205. package/src/card/test/__snapshots__/index.tsx.snap +7 -9
  206. package/src/checkbox-control/test/__snapshots__/index.tsx.snap +4 -3
  207. package/src/composite/stories/index.story.tsx +5 -0
  208. package/src/confirm-dialog/stories/index.story.tsx +1 -0
  209. package/src/custom-select-control/test/index.tsx +1 -1
  210. package/src/disabled/README.md +0 -1
  211. package/src/disabled/index.tsx +0 -1
  212. package/src/disabled/stories/index.story.tsx +0 -1
  213. package/src/divider/component.tsx +27 -3
  214. package/src/divider/style.module.scss +21 -0
  215. package/src/divider/test/index.tsx +21 -11
  216. package/src/dropdown/stories/index.story.tsx +5 -0
  217. package/src/dropdown-menu/style.scss +1 -1
  218. package/src/external-link/style.scss +4 -4
  219. package/src/form-toggle/style.scss +1 -1
  220. package/src/heading/test/__snapshots__/index.tsx.snap +4 -4
  221. package/src/higher-order/with-constrained-tabbing/README.md +0 -2
  222. package/src/higher-order/with-fallback-styles/index.tsx +31 -61
  223. package/src/higher-order/with-fallback-styles/test/index.tsx +47 -0
  224. package/src/higher-order/with-focus-return/README.md +0 -2
  225. package/src/icon/stories/index.story.tsx +0 -15
  226. package/src/menu/README.md +2 -2
  227. package/src/menu/styles.ts +2 -0
  228. package/src/menu/test/index.tsx +104 -87
  229. package/src/menu/types.ts +2 -2
  230. package/src/menu-item/test/__snapshots__/index.js.snap +2 -0
  231. package/src/modal/style.scss +1 -1
  232. package/src/modal/test/index.tsx +0 -24
  233. package/src/modal/use-modal-exit-animation.ts +2 -2
  234. package/src/navigable-container/test/navigable-menu.tsx +0 -16
  235. package/src/navigable-container/test/tababble-container.tsx +0 -16
  236. package/src/navigator/test/index.tsx +0 -24
  237. package/src/notice/style.scss +11 -13
  238. package/src/notice/test/__snapshots__/index.tsx.snap +1 -0
  239. package/src/panel/README.md +2 -0
  240. package/src/panel/stories/index.story.tsx +2 -2
  241. package/src/panel/style.scss +1 -1
  242. package/src/placeholder/stories/index.story.tsx +0 -1
  243. package/src/radio-control/style.scss +1 -1
  244. package/src/resizable-box/index.tsx +1 -2
  245. package/src/sandbox/index.tsx +18 -1
  246. package/src/sandbox/test/index.tsx +44 -1
  247. package/src/spinner/styles.ts +1 -0
  248. package/src/tab-panel/style.scss +6 -6
  249. package/src/tab-panel/test/index.tsx +0 -17
  250. package/src/tabs/index.tsx +1 -26
  251. package/src/tabs/tablist.tsx +5 -21
  252. package/src/tabs/test/index.tsx +16 -44
  253. package/src/text/test/__snapshots__/index.tsx.snap +3 -3
  254. package/src/text-control/README.md +0 -9
  255. package/src/text-control/index.tsx +3 -14
  256. package/src/text-control/stories/index.story.tsx +0 -2
  257. package/src/text-control/style.scss +7 -11
  258. package/src/text-control/test/text-control.tsx +1 -5
  259. package/src/text-control/types.ts +2 -1
  260. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +38 -26
  261. package/src/toolbar/toolbar-group/style.scss +2 -2
  262. package/src/tools-panel/styles.ts +1 -1
  263. package/src/tools-panel/tools-panel/README.md +0 -2
  264. package/src/tooltip/stories/index.story.tsx +2 -2
  265. package/src/tree-grid/test/index.tsx +0 -23
  266. package/src/utils/colors-values.js +36 -16
  267. package/src/utils/config-values.js +2 -2
  268. package/src/utils/dropdown-motion.ts +6 -4
  269. package/src/utils/theme-variables.scss +18 -13
  270. package/src/validated-form-controls/components/text-control.tsx +2 -10
  271. package/build/box-control/input-control.cjs.map +0 -7
  272. package/build/divider/styles.cjs +0 -98
  273. package/build/divider/styles.cjs.map +0 -7
  274. package/build-module/box-control/input-control.mjs.map +0 -7
  275. package/build-module/divider/styles.mjs +0 -63
  276. package/build-module/divider/styles.mjs.map +0 -7
  277. package/build-types/box-control/input-control.d.ts +0 -3
  278. package/build-types/box-control/input-control.d.ts.map +0 -1
  279. package/build-types/card/context.d.ts +0 -3
  280. package/build-types/card/context.d.ts.map +0 -1
  281. package/build-types/date-time/date/index.d.ts +0 -23
  282. package/build-types/date-time/date/index.d.ts.map +0 -1
  283. package/build-types/date-time/date/styles.d.ts +0 -45
  284. package/build-types/date-time/date/styles.d.ts.map +0 -1
  285. package/build-types/date-time/date/test/index.d.ts.map +0 -1
  286. package/build-types/date-time/date/test/use-lilius.d.ts +0 -2
  287. package/build-types/date-time/date/test/use-lilius.d.ts.map +0 -1
  288. package/build-types/date-time/date/use-lilius/index.d.ts +0 -169
  289. package/build-types/date-time/date/use-lilius/index.d.ts.map +0 -1
  290. package/build-types/date-time/time/index.d.ts +0 -27
  291. package/build-types/date-time/time/index.d.ts.map +0 -1
  292. package/build-types/date-time/time/styles.d.ts +0 -93
  293. package/build-types/date-time/time/styles.d.ts.map +0 -1
  294. package/build-types/date-time/time/test/index.d.ts +0 -2
  295. package/build-types/date-time/time/test/index.d.ts.map +0 -1
  296. package/build-types/date-time/time/time-input/index.d.ts +0 -4
  297. package/build-types/date-time/time/time-input/index.d.ts.map +0 -1
  298. package/build-types/date-time/time/time-input/test/index.d.ts +0 -2
  299. package/build-types/date-time/time/time-input/test/index.d.ts.map +0 -1
  300. package/build-types/date-time/time/timezone.d.ts +0 -7
  301. package/build-types/date-time/time/timezone.d.ts.map +0 -1
  302. package/build-types/divider/styles.d.ts +0 -10
  303. package/build-types/divider/styles.d.ts.map +0 -1
  304. package/build-types/mobile/image/constants.d.ts +0 -5
  305. package/build-types/mobile/image/constants.d.ts.map +0 -1
  306. package/build-types/navigation/back-button/index.d.ts +0 -7
  307. package/build-types/navigation/back-button/index.d.ts.map +0 -1
  308. package/build-types/navigation/constants.d.ts +0 -3
  309. package/build-types/navigation/constants.d.ts.map +0 -1
  310. package/build-types/navigation/context.d.ts +0 -4
  311. package/build-types/navigation/context.d.ts.map +0 -1
  312. package/build-types/navigation/group/context.d.ts +0 -7
  313. package/build-types/navigation/group/context.d.ts.map +0 -1
  314. package/build-types/navigation/group/index.d.ts +0 -7
  315. package/build-types/navigation/group/index.d.ts.map +0 -1
  316. package/build-types/navigation/index.d.ts +0 -46
  317. package/build-types/navigation/index.d.ts.map +0 -1
  318. package/build-types/navigation/item/base-content.d.ts +0 -3
  319. package/build-types/navigation/item/base-content.d.ts.map +0 -1
  320. package/build-types/navigation/item/base.d.ts +0 -3
  321. package/build-types/navigation/item/base.d.ts.map +0 -1
  322. package/build-types/navigation/item/index.d.ts +0 -7
  323. package/build-types/navigation/item/index.d.ts.map +0 -1
  324. package/build-types/navigation/item/use-navigation-tree-item.d.ts +0 -3
  325. package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +0 -1
  326. package/build-types/navigation/menu/context.d.ts +0 -7
  327. package/build-types/navigation/menu/context.d.ts.map +0 -1
  328. package/build-types/navigation/menu/index.d.ts +0 -7
  329. package/build-types/navigation/menu/index.d.ts.map +0 -1
  330. package/build-types/navigation/menu/menu-title-search.d.ts +0 -3
  331. package/build-types/navigation/menu/menu-title-search.d.ts.map +0 -1
  332. package/build-types/navigation/menu/menu-title.d.ts +0 -3
  333. package/build-types/navigation/menu/menu-title.d.ts.map +0 -1
  334. package/build-types/navigation/menu/search-no-results-found.d.ts +0 -3
  335. package/build-types/navigation/menu/search-no-results-found.d.ts.map +0 -1
  336. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +0 -3
  337. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +0 -1
  338. package/build-types/navigation/stories/index.story.d.ts +0 -23
  339. package/build-types/navigation/stories/index.story.d.ts.map +0 -1
  340. package/build-types/navigation/stories/utils/controlled-state.d.ts +0 -7
  341. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +0 -1
  342. package/build-types/navigation/stories/utils/default.d.ts +0 -10
  343. package/build-types/navigation/stories/utils/default.d.ts.map +0 -1
  344. package/build-types/navigation/stories/utils/group.d.ts +0 -10
  345. package/build-types/navigation/stories/utils/group.d.ts.map +0 -1
  346. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +0 -10
  347. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +0 -1
  348. package/build-types/navigation/stories/utils/more-examples.d.ts +0 -10
  349. package/build-types/navigation/stories/utils/more-examples.d.ts.map +0 -1
  350. package/build-types/navigation/stories/utils/search.d.ts +0 -10
  351. package/build-types/navigation/stories/utils/search.d.ts.map +0 -1
  352. package/build-types/navigation/styles/navigation-styles.d.ts +0 -55
  353. package/build-types/navigation/styles/navigation-styles.d.ts.map +0 -1
  354. package/build-types/navigation/test/index.d.ts +0 -2
  355. package/build-types/navigation/test/index.d.ts.map +0 -1
  356. package/build-types/navigation/types.d.ts +0 -266
  357. package/build-types/navigation/types.d.ts.map +0 -1
  358. package/build-types/navigation/use-create-navigation-tree.d.ts +0 -15
  359. package/build-types/navigation/use-create-navigation-tree.d.ts.map +0 -1
  360. package/build-types/navigation/use-navigation-tree-nodes.d.ts +0 -10
  361. package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +0 -1
  362. package/build-types/navigation/utils.d.ts +0 -3
  363. package/build-types/navigation/utils.d.ts.map +0 -1
  364. package/build-types/visually-hidden/test/index.d.ts +0 -2
  365. package/build-types/visually-hidden/test/index.d.ts.map +0 -1
  366. package/src/divider/styles.ts +0 -81
  367. package/src/divider/test/__snapshots__/index.tsx.snap +0 -71
  368. /package/build-types/{date-time/date → higher-order/with-fallback-styles}/test/index.d.ts +0 -0
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { render, screen, waitFor } from '@testing-library/react';
5
- import { press, click, hover, type } from '@ariakit/test';
4
+ import { act, render, screen, waitFor } from '@testing-library/react';
5
+ import userEvent from '@testing-library/user-event';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -14,10 +14,6 @@ import { useState } from '@wordpress/element';
14
14
  */
15
15
  import { Menu } from '..';
16
16
 
17
- const delay = ( delayInMs: number ) => {
18
- return new Promise( ( resolve ) => setTimeout( resolve, delayInMs ) );
19
- };
20
-
21
17
  const waitForFocusedMenu = () =>
22
18
  waitFor( () => expect( screen.getByRole( 'menu' ) ).toHaveFocus() );
23
19
 
@@ -26,10 +22,20 @@ const waitForFocusedMenuItem = ( name: string ) =>
26
22
  expect( screen.getByRole( 'menuitem', { name } ) ).toHaveFocus()
27
23
  );
28
24
 
25
+ const resetTypeahead = () => {
26
+ act( () => jest.advanceTimersByTime( 500 ) );
27
+ };
28
+
29
29
  // Open dropdown => open menu
30
30
  // Submenu trigger item => open submenu
31
31
 
32
32
  describe( 'Menu', () => {
33
+ let user: ReturnType< typeof userEvent.setup >;
34
+
35
+ beforeEach( () => {
36
+ user = userEvent.setup();
37
+ } );
38
+
33
39
  // See https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/
34
40
  it( 'should follow the WAI-ARIA spec', async () => {
35
41
  render(
@@ -58,7 +64,7 @@ describe( 'Menu', () => {
58
64
  expect( toggleButton ).toHaveAttribute( 'aria-haspopup', 'menu' );
59
65
  expect( toggleButton ).toHaveAttribute( 'aria-expanded', 'false' );
60
66
 
61
- await click( toggleButton );
67
+ await user.click( toggleButton );
62
68
 
63
69
  expect( toggleButton ).toHaveAttribute( 'aria-expanded', 'true' );
64
70
 
@@ -82,7 +88,7 @@ describe( 'Menu', () => {
82
88
  expect( submenuTrigger ).toHaveAttribute( 'aria-haspopup', 'menu' );
83
89
  expect( submenuTrigger ).toHaveAttribute( 'aria-expanded', 'false' );
84
90
 
85
- await hover( submenuTrigger );
91
+ await user.hover( submenuTrigger );
86
92
 
87
93
  // Wait for the open animation after hovering
88
94
  await waitFor( () =>
@@ -119,7 +125,7 @@ describe( 'Menu', () => {
119
125
  expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument();
120
126
 
121
127
  // Click to open the menu
122
- await click( toggleButton );
128
+ await user.click( toggleButton );
123
129
 
124
130
  // Menu open, focus is on the menu wrapper
125
131
  await waitForFocusedMenu();
@@ -142,14 +148,14 @@ describe( 'Menu', () => {
142
148
  } );
143
149
 
144
150
  // Move focus on the toggle
145
- await press.Tab();
151
+ await user.tab();
146
152
 
147
153
  expect( toggleButton ).toHaveFocus();
148
154
 
149
155
  // Menu closed
150
156
  expect( screen.queryByRole( 'menuitem' ) ).not.toBeInTheDocument();
151
157
 
152
- await press.ArrowDown();
158
+ await user.keyboard( '{ArrowDown}' );
153
159
 
154
160
  // Menu open, focus is on the first focusable item
155
161
  // (disabled items are still focusable and accessible)
@@ -173,16 +179,16 @@ describe( 'Menu', () => {
173
179
  } );
174
180
 
175
181
  // Move focus on the toggle
176
- await press.Tab();
182
+ await user.tab();
177
183
 
178
184
  expect( toggleButton ).toHaveFocus();
179
185
 
180
186
  // Menu closed
181
187
  expect( screen.queryByRole( 'menuitem' ) ).not.toBeInTheDocument();
182
188
 
183
- // Keyboard-triggered clicks have `detail: 0`, which Ariakit uses to
184
- // distinguish keyboard activation from pointer activation.
185
- await press.Space( toggleButton, { detail: 0 } );
189
+ // Use keyboard activation so the synthetic click has `detail: 0`,
190
+ // which Ariakit uses to distinguish it from pointer activation.
191
+ await user.keyboard( ' ' );
186
192
 
187
193
  await waitFor( () =>
188
194
  expect( toggleButton ).toHaveAttribute(
@@ -207,16 +213,18 @@ describe( 'Menu', () => {
207
213
  name: 'Open dropdown',
208
214
  } );
209
215
 
210
- await click( trigger );
216
+ await user.click( trigger );
211
217
 
212
218
  // Focuses menu on mouse click, focuses first item on keyboard press
213
219
  // Can be changed with a custom useEffect
214
220
  await waitForFocusedMenu();
215
221
 
216
222
  // Pressing esc will close the menu and move focus to the toggle
217
- await press.Escape();
223
+ await user.keyboard( '{Escape}' );
218
224
 
219
- expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument();
225
+ await waitFor( () =>
226
+ expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument()
227
+ );
220
228
 
221
229
  await waitFor( () =>
222
230
  expect(
@@ -238,9 +246,11 @@ describe( 'Menu', () => {
238
246
  expect( screen.getByRole( 'menu' ) ).toBeInTheDocument();
239
247
 
240
248
  // Click on the body (ie. outside of the dropdown menu)
241
- await click( document.body );
249
+ await user.click( document.body );
242
250
 
243
- expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument();
251
+ await waitFor( () =>
252
+ expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument()
253
+ );
244
254
  } );
245
255
 
246
256
  it( 'should close when clicking on a menu item', async () => {
@@ -256,9 +266,11 @@ describe( 'Menu', () => {
256
266
  expect( screen.getByRole( 'menu' ) ).toBeInTheDocument();
257
267
 
258
268
  // Clicking a menu item will close the menu
259
- await click( screen.getByRole( 'menuitem' ) );
269
+ await user.click( screen.getByRole( 'menuitem' ) );
260
270
 
261
- expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument();
271
+ await waitFor( () =>
272
+ expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument()
273
+ );
262
274
  } );
263
275
 
264
276
  it( 'should not close when clicking on a menu item when the `hideOnClick` prop is set to `false`', async () => {
@@ -274,7 +286,7 @@ describe( 'Menu', () => {
274
286
  expect( screen.getByRole( 'menu' ) ).toBeVisible();
275
287
 
276
288
  // Clicking a menu item will close the menu
277
- await click( screen.getByRole( 'menuitem' ) );
289
+ await user.click( screen.getByRole( 'menuitem' ) );
278
290
 
279
291
  expect( screen.getByRole( 'menu' ) ).toBeVisible();
280
292
  } );
@@ -292,7 +304,7 @@ describe( 'Menu', () => {
292
304
  expect( screen.getByRole( 'menu' ) ).toBeInTheDocument();
293
305
 
294
306
  // Clicking a disabled menu item won't close the menu
295
- await click( screen.getByRole( 'menuitem' ) );
307
+ await user.click( screen.getByRole( 'menuitem' ) );
296
308
 
297
309
  expect( screen.getByRole( 'menu' ) ).toBeInTheDocument();
298
310
  } );
@@ -325,7 +337,7 @@ describe( 'Menu', () => {
325
337
  } )
326
338
  ).not.toBeInTheDocument();
327
339
 
328
- await hover(
340
+ await user.hover(
329
341
  screen.getByRole( 'menuitem', { name: 'Submenu trigger item' } )
330
342
  );
331
343
 
@@ -358,57 +370,53 @@ describe( 'Menu', () => {
358
370
  </Menu>
359
371
  );
360
372
 
361
- // The menu is focused automatically when `defaultOpen` is set.
362
- await waitForFocusedMenu();
373
+ // The first menu item is focused automatically when `defaultOpen` is
374
+ // set and jsdom reports visible elements as focusable.
375
+ await waitForFocusedMenuItem( 'Menu item 1' );
363
376
 
364
377
  // Arrow up/down selects menu items
365
378
  // The selection wraps around from last to first and viceversa
366
- await press.ArrowDown();
367
- expect(
368
- screen.getByRole( 'menuitem', { name: 'Menu item 1' } )
369
- ).toHaveFocus();
370
-
371
- await press.ArrowDown();
379
+ await user.keyboard( '{ArrowDown}' );
372
380
  expect(
373
381
  screen.getByRole( 'menuitem', { name: 'Menu item 2' } )
374
382
  ).toHaveFocus();
375
383
 
376
- await press.ArrowDown();
384
+ await user.keyboard( '{ArrowDown}' );
377
385
  expect(
378
386
  screen.getByRole( 'menuitem', { name: 'Submenu trigger item' } )
379
387
  ).toHaveFocus();
380
388
 
381
- await press.ArrowDown();
389
+ await user.keyboard( '{ArrowDown}' );
382
390
  expect(
383
391
  screen.getByRole( 'menuitem', { name: 'Menu item 3' } )
384
392
  ).toHaveFocus();
385
393
 
386
- await press.ArrowDown();
394
+ await user.keyboard( '{ArrowDown}' );
387
395
  expect(
388
396
  screen.getByRole( 'menuitem', { name: 'Menu item 1' } )
389
397
  ).toHaveFocus();
390
398
 
391
- await press.ArrowUp();
399
+ await user.keyboard( '{ArrowUp}' );
392
400
  expect(
393
401
  screen.getByRole( 'menuitem', { name: 'Menu item 3' } )
394
402
  ).toHaveFocus();
395
403
 
396
- await press.ArrowUp();
404
+ await user.keyboard( '{ArrowUp}' );
397
405
  expect(
398
406
  screen.getByRole( 'menuitem', { name: 'Submenu trigger item' } )
399
407
  ).toHaveFocus();
400
408
 
401
409
  // Arrow right/left can be used to enter/leave submenus
402
410
  // (focus crosses menu contexts, so wait for it to settle)
403
- await press.ArrowRight();
411
+ await user.keyboard( '{ArrowRight}' );
404
412
  await waitForFocusedMenuItem( 'Submenu item 1' );
405
413
 
406
- await press.ArrowDown();
414
+ await user.keyboard( '{ArrowDown}' );
407
415
  expect(
408
416
  screen.getByRole( 'menuitem', { name: 'Submenu item 2' } )
409
417
  ).toHaveFocus();
410
418
 
411
- await press.ArrowLeft();
419
+ await user.keyboard( '{ArrowLeft}' );
412
420
  expect(
413
421
  screen.getByRole( 'menuitem', {
414
422
  name: 'Submenu trigger item',
@@ -416,20 +424,20 @@ describe( 'Menu', () => {
416
424
  ).toHaveFocus();
417
425
 
418
426
  // Spacebar or enter key can also be used to enter a submenu
419
- await press.Enter();
427
+ await user.keyboard( '{Enter}' );
420
428
  await waitForFocusedMenuItem( 'Submenu item 1' );
421
429
 
422
- await press.ArrowLeft();
430
+ await user.keyboard( '{ArrowLeft}' );
423
431
  expect(
424
432
  screen.getByRole( 'menuitem', {
425
433
  name: 'Submenu trigger item',
426
434
  } )
427
435
  ).toHaveFocus();
428
436
 
429
- await press.Space();
437
+ await user.keyboard( ' ' );
430
438
  await waitForFocusedMenuItem( 'Submenu item 1' );
431
439
 
432
- await press.ArrowLeft();
440
+ await user.keyboard( '{ArrowLeft}' );
433
441
  expect(
434
442
  screen.getByRole( 'menuitem', {
435
443
  name: 'Submenu trigger item',
@@ -478,7 +486,7 @@ describe( 'Menu', () => {
478
486
  render( <ControlledRadioGroup /> );
479
487
 
480
488
  // Open dropdown
481
- await click(
489
+ await user.click(
482
490
  screen.getByRole( 'button', { name: 'Open dropdown' } )
483
491
  );
484
492
 
@@ -492,7 +500,7 @@ describe( 'Menu', () => {
492
500
  ).not.toBeChecked();
493
501
 
494
502
  // Click first radio item, make sure that the callback fires
495
- await click(
503
+ await user.click(
496
504
  screen.getByRole( 'menuitemradio', { name: 'Radio item one' } )
497
505
  );
498
506
  expect( onRadioValueChangeSpy ).toHaveBeenCalledTimes( 1 );
@@ -509,7 +517,7 @@ describe( 'Menu', () => {
509
517
  ).not.toBeChecked();
510
518
 
511
519
  // Click second radio item, make sure that the callback fires
512
- await click(
520
+ await user.click(
513
521
  screen.getByRole( 'menuitemradio', { name: 'Radio item two' } )
514
522
  );
515
523
  expect( onRadioValueChangeSpy ).toHaveBeenCalledTimes( 2 );
@@ -558,7 +566,7 @@ describe( 'Menu', () => {
558
566
  );
559
567
 
560
568
  // Open dropdown
561
- await click(
569
+ await user.click(
562
570
  screen.getByRole( 'button', { name: 'Open dropdown' } )
563
571
  );
564
572
 
@@ -572,7 +580,7 @@ describe( 'Menu', () => {
572
580
  ).toBeChecked();
573
581
 
574
582
  // Click first radio item, make sure that the callback fires
575
- await click(
583
+ await user.click(
576
584
  screen.getByRole( 'menuitemradio', { name: 'Radio item one' } )
577
585
  );
578
586
  expect( onRadioValueChangeSpy ).toHaveBeenCalledTimes( 1 );
@@ -589,7 +597,7 @@ describe( 'Menu', () => {
589
597
  ).not.toBeChecked();
590
598
 
591
599
  // Click second radio item, make sure that the callback fires
592
- await click(
600
+ await user.click(
593
601
  screen.getByRole( 'menuitemradio', { name: 'Radio item two' } )
594
602
  );
595
603
  expect( onRadioValueChangeSpy ).toHaveBeenCalledTimes( 2 );
@@ -658,7 +666,7 @@ describe( 'Menu', () => {
658
666
  render( <ControlledRadioGroup /> );
659
667
 
660
668
  // Open dropdown
661
- await click(
669
+ await user.click(
662
670
  screen.getByRole( 'button', { name: 'Open dropdown' } )
663
671
  );
664
672
 
@@ -678,7 +686,7 @@ describe( 'Menu', () => {
678
686
  ).not.toBeChecked();
679
687
 
680
688
  // Click first checkbox item, make sure that the callback fires
681
- await click(
689
+ await user.click(
682
690
  screen.getByRole( 'menuitemcheckbox', {
683
691
  name: 'Checkbox item one',
684
692
  } )
@@ -698,7 +706,7 @@ describe( 'Menu', () => {
698
706
  ).toBeChecked();
699
707
 
700
708
  // Click second checkbox item, make sure that the callback fires
701
- await click(
709
+ await user.click(
702
710
  screen.getByRole( 'menuitemcheckbox', {
703
711
  name: 'Checkbox item two',
704
712
  } )
@@ -718,7 +726,7 @@ describe( 'Menu', () => {
718
726
  ).toBeChecked();
719
727
 
720
728
  // Click second checkbox item, make sure that the callback fires
721
- await click(
729
+ await user.click(
722
730
  screen.getByRole( 'menuitemcheckbox', {
723
731
  name: 'Checkbox item two',
724
732
  } )
@@ -778,7 +786,7 @@ describe( 'Menu', () => {
778
786
  );
779
787
 
780
788
  // Open dropdown
781
- await click(
789
+ await user.click(
782
790
  screen.getByRole( 'button', { name: 'Open dropdown' } )
783
791
  );
784
792
 
@@ -798,7 +806,7 @@ describe( 'Menu', () => {
798
806
  ).toBeChecked();
799
807
 
800
808
  // Click first checkbox item, make sure that the callback fires
801
- await click(
809
+ await user.click(
802
810
  screen.getByRole( 'menuitemcheckbox', {
803
811
  name: 'Checkbox item one',
804
812
  } )
@@ -818,7 +826,7 @@ describe( 'Menu', () => {
818
826
  ).toBeChecked();
819
827
 
820
828
  // Click second checkbox item, make sure that the callback fires
821
- await click(
829
+ await user.click(
822
830
  screen.getByRole( 'menuitemcheckbox', {
823
831
  name: 'Checkbox item two',
824
832
  } )
@@ -838,7 +846,7 @@ describe( 'Menu', () => {
838
846
  ).not.toBeChecked();
839
847
 
840
848
  // Click second checkbox item, make sure that the callback fires
841
- await click(
849
+ await user.click(
842
850
  screen.getByRole( 'menuitemcheckbox', {
843
851
  name: 'Checkbox item two',
844
852
  } )
@@ -874,7 +882,7 @@ describe( 'Menu', () => {
874
882
  );
875
883
 
876
884
  // Click to open the menu
877
- await click(
885
+ await user.click(
878
886
  screen.getByRole( 'button', {
879
887
  name: 'Open dropdown',
880
888
  } )
@@ -904,7 +912,7 @@ describe( 'Menu', () => {
904
912
  );
905
913
 
906
914
  // Click to open the menu
907
- await click(
915
+ await user.click(
908
916
  screen.getByRole( 'button', {
909
917
  name: 'Open dropdown',
910
918
  } )
@@ -922,9 +930,11 @@ describe( 'Menu', () => {
922
930
 
923
931
  // The outer button can be focused by pressing tab. Doing so will cause
924
932
  // the Menu to close.
925
- await press.Tab();
933
+ await user.tab();
926
934
  expect( outerButton ).toBeVisible();
927
- expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument();
935
+ await waitFor( () =>
936
+ expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument()
937
+ );
928
938
  } );
929
939
  } );
930
940
 
@@ -942,7 +952,7 @@ describe( 'Menu', () => {
942
952
  );
943
953
 
944
954
  // Click to open the menu
945
- await click(
955
+ await user.click(
946
956
  screen.getByRole( 'button', {
947
957
  name: 'Open dropdown',
948
958
  } )
@@ -969,7 +979,7 @@ describe( 'Menu', () => {
969
979
  );
970
980
 
971
981
  // Click to open the menu
972
- await click(
982
+ await user.click(
973
983
  screen.getByRole( 'button', {
974
984
  name: 'Open dropdown',
975
985
  } )
@@ -1000,7 +1010,7 @@ describe( 'Menu', () => {
1000
1010
  );
1001
1011
 
1002
1012
  // Click to open the menu
1003
- await click(
1013
+ await user.click(
1004
1014
  screen.getByRole( 'button', {
1005
1015
  name: 'Open dropdown',
1006
1016
  } )
@@ -1031,7 +1041,7 @@ describe( 'Menu', () => {
1031
1041
  );
1032
1042
 
1033
1043
  // Click to open the menu
1034
- await click(
1044
+ await user.click(
1035
1045
  screen.getByRole( 'button', {
1036
1046
  name: 'Open dropdown',
1037
1047
  } )
@@ -1047,6 +1057,17 @@ describe( 'Menu', () => {
1047
1057
  } );
1048
1058
 
1049
1059
  describe( 'typeahead', () => {
1060
+ beforeEach( () => {
1061
+ jest.useFakeTimers();
1062
+ user = userEvent.setup( {
1063
+ advanceTimers: jest.advanceTimersByTime,
1064
+ } );
1065
+ } );
1066
+
1067
+ afterEach( () => {
1068
+ jest.useRealTimers();
1069
+ } );
1070
+
1050
1071
  it( 'should highlight matching item', async () => {
1051
1072
  render(
1052
1073
  <Menu>
@@ -1059,7 +1080,7 @@ describe( 'Menu', () => {
1059
1080
  );
1060
1081
 
1061
1082
  // Click to open the menu
1062
- await click(
1083
+ await user.click(
1063
1084
  screen.getByRole( 'button', {
1064
1085
  name: 'Open dropdown',
1065
1086
  } )
@@ -1067,17 +1088,16 @@ describe( 'Menu', () => {
1067
1088
  await waitForFocusedMenu();
1068
1089
 
1069
1090
  // Type "tw", it should match and focus the item with content "Two"
1070
- await type( 'tw' );
1091
+ await user.keyboard( 'tw' );
1071
1092
  expect(
1072
1093
  screen.getByRole( 'menuitem', { name: 'Two' } )
1073
1094
  ).toHaveFocus();
1074
1095
 
1075
- // Wait for the typeahead timer to reset and interpret
1076
- // the next keystrokes as a new search
1077
- await delay( 500 );
1096
+ // Reset the typeahead search so the next keystrokes start a new query.
1097
+ resetTypeahead();
1078
1098
 
1079
1099
  // Type "on", it should match and focus the item with content "One"
1080
- await type( 'on' );
1100
+ await user.keyboard( 'on' );
1081
1101
  expect(
1082
1102
  screen.getByRole( 'menuitem', { name: 'One' } )
1083
1103
  ).toHaveFocus();
@@ -1095,7 +1115,7 @@ describe( 'Menu', () => {
1095
1115
  );
1096
1116
 
1097
1117
  // Click to open the menu
1098
- await click(
1118
+ await user.click(
1099
1119
  screen.getByRole( 'button', {
1100
1120
  name: 'Open dropdown',
1101
1121
  } )
@@ -1103,35 +1123,32 @@ describe( 'Menu', () => {
1103
1123
  await waitForFocusedMenu();
1104
1124
 
1105
1125
  // Type a string that doesn't match any items. Focus shouldn't move.
1106
- await type( 'abc' );
1126
+ await user.keyboard( 'abc' );
1107
1127
  expect( screen.getByRole( 'menu' ) ).toHaveFocus();
1108
1128
 
1109
- // Wait for the typeahead timer to reset and interpret
1110
- // the next keystrokes as a new search
1111
- await delay( 500 );
1129
+ // Reset the typeahead search so the next keystrokes start a new query.
1130
+ resetTypeahead();
1112
1131
 
1113
1132
  // Type "on", it should match and focus the item with content "One"
1114
- await type( 'on' );
1133
+ await user.keyboard( 'on' );
1115
1134
  expect(
1116
1135
  screen.getByRole( 'menuitem', { name: 'One' } )
1117
1136
  ).toHaveFocus();
1118
1137
 
1119
- // Wait for the typeahead timer to reset and interpret
1120
- // the next keystrokes as a new search
1121
- await delay( 500 );
1138
+ // Reset the typeahead search so the next keystrokes start a new query.
1139
+ resetTypeahead();
1122
1140
 
1123
1141
  // Type a string that doesn't match any items. Focus shouldn't move.
1124
- await type( 'abc' );
1142
+ await user.keyboard( 'abc' );
1125
1143
  expect(
1126
1144
  screen.getByRole( 'menuitem', { name: 'One' } )
1127
1145
  ).toHaveFocus();
1128
1146
 
1129
- // Wait for the typeahead timer to reset and interpret
1130
- // the next keystrokes as a new search
1131
- await delay( 500 );
1147
+ // Reset the typeahead search so the next keystrokes start a new query.
1148
+ resetTypeahead();
1132
1149
 
1133
1150
  // Type "tw", it should match and focus the item with content "Two"
1134
- await type( 'tw' );
1151
+ await user.keyboard( 'tw' );
1135
1152
  expect(
1136
1153
  screen.getByRole( 'menuitem', { name: 'Two' } )
1137
1154
  ).toHaveFocus();
package/src/menu/types.ts CHANGED
@@ -258,7 +258,7 @@ export interface CheckboxItemProps {
258
258
  * The checked state of the checkbox menu item when it is initially rendered.
259
259
  * Use when not wanting to control its checked state.
260
260
  *
261
- * Note: this prop will be overriden by the `checked` prop, if it is defined.
261
+ * Note: this prop will be overridden by the `checked` prop, if it is defined.
262
262
  */
263
263
  defaultChecked?: Ariakit.MenuItemCheckboxProps[ 'defaultChecked' ];
264
264
  /**
@@ -321,7 +321,7 @@ export interface RadioItemProps {
321
321
  * The checked state of the radio menu item when it is initially rendered.
322
322
  * Use when not wanting to control its checked state.
323
323
  *
324
- * Note: this prop will be overriden by the `checked` prop, if it is defined.
324
+ * Note: this prop will be overridden by the `checked` prop, if it is defined.
325
325
  */
326
326
  defaultChecked?: Ariakit.MenuItemRadioProps[ 'defaultChecked' ];
327
327
  /**
@@ -20,6 +20,7 @@ exports[`MenuItem should match snapshot when all props provided 1`] = `
20
20
  <svg
21
21
  aria-hidden="true"
22
22
  class="components-menu-items__item-icon has-icon-right"
23
+ fill="currentColor"
23
24
  focusable="false"
24
25
  height="24"
25
26
  viewBox="0 0 24 24"
@@ -79,6 +80,7 @@ exports[`MenuItem should match snapshot when isSelected and role are optionally
79
80
  <svg
80
81
  aria-hidden="true"
81
82
  class="components-menu-items__item-icon has-icon-right"
83
+ fill="currentColor"
82
84
  focusable="false"
83
85
  height="24"
84
86
  viewBox="0 0 24 24"
@@ -217,7 +217,7 @@
217
217
  }
218
218
 
219
219
  .components-modal__content.has-scrolled-content:not(.hide-header) & {
220
- border-bottom-color: $gray-300;
220
+ border-bottom-color: var(--wpds-color-stroke-surface-neutral);
221
221
  }
222
222
 
223
223
  & + p {
@@ -269,9 +269,6 @@ describe( 'Modal', () => {
269
269
  } );
270
270
 
271
271
  describe( 'Focus handling', () => {
272
- const originalGetClientRects =
273
- window.HTMLElement.prototype.getClientRects;
274
-
275
272
  const FocusMountDemo = ( {
276
273
  focusOnMount,
277
274
  }: Pick< ModalProps, 'focusOnMount' > ) => {
@@ -300,27 +297,6 @@ describe( 'Modal', () => {
300
297
  );
301
298
  };
302
299
 
303
- beforeEach( () => {
304
- /**
305
- * The test environment does not have a layout engine, so we need to mock
306
- * the getClientRects method. This ensures that the focusable elements can be
307
- * found by the `focusOnMount` logic which depends on layout information
308
- * to determine if the element is visible or not.
309
- * See https://github.com/WordPress/gutenberg/blob/trunk/packages/dom/src/focusable.js#L55-L61.
310
- */
311
- // @ts-expect-error We're not trying to comply to the DOM spec, only mocking
312
- window.HTMLElement.prototype.getClientRects = function () {
313
- return [ 'trick-jsdom-into-having-size-for-element-rect' ];
314
- };
315
- } );
316
-
317
- afterEach( () => {
318
- // Restore original HTMLElement prototype.
319
- // See beforeEach for details.
320
- window.HTMLElement.prototype.getClientRects =
321
- originalGetClientRects;
322
- } );
323
-
324
300
  it( 'should focus the Modal dialog by default when `focusOnMount` prop is not provided', async () => {
325
301
  const user = userEvent.setup();
326
302
 
@@ -14,8 +14,8 @@ import { CONFIG } from '../utils';
14
14
  * Milliseconds used as a fallback when racing `animationend` against a timeout.
15
15
  *
16
16
  * Sourced from `CONFIG.transitionDuration`. This value is implicitly coupled to
17
- * the modal frame’s CSS `animation-duration` in `style.scss`, which uses
18
- * `var(--wpds-motion-duration-md)`. If either the token, the SCSS, or
17
+ * the modal frame’s CSS `animation-duration` in `style.scss`, which uses the
18
+ * WPDS `motion-duration-md` token. If either the token, the SCSS, or
19
19
  * `CONFIG.transitionDuration` changes, keep them aligned so exit timing stays correct.
20
20
  */
21
21
  const FRAME_ANIMATION_DURATION_MS = Number.parseInt(
@@ -28,23 +28,7 @@ const getNavigableMenuFocusables = () => [
28
28
  screen.getByRole( 'link', { name: 'Item 4' } ),
29
29
  ];
30
30
 
31
- const originalGetClientRects = window.HTMLElement.prototype.getClientRects;
32
-
33
31
  describe( 'NavigableMenu', () => {
34
- beforeAll( () => {
35
- // Mocking `getClientRects()` is necessary to pass a check performed by
36
- // the `focus.tabbable.find()` and by the `focus.focusable.find()` functions
37
- // from the `@wordpress/dom` package.
38
- // @ts-expect-error We're not trying to comply to the DOM spec, only mocking
39
- window.HTMLElement.prototype.getClientRects = function () {
40
- return [ 'trick-jsdom-into-having-size-for-element-rect' ];
41
- };
42
- } );
43
-
44
- afterAll( () => {
45
- window.HTMLElement.prototype.getClientRects = originalGetClientRects;
46
- } );
47
-
48
32
  it( 'moves focus on its focusable children by using the up/down arrow keys', async () => {
49
33
  const user = userEvent.setup();
50
34