@wordpress/components 20.0.1-next.d6164808d3.0 → 20.0.2-next.957ca95e4c.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 (434) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/CONTRIBUTING.md +12 -12
  3. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +12 -12
  4. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  5. package/build/autocomplete/get-default-use-items.js +7 -1
  6. package/build/autocomplete/get-default-use-items.js.map +1 -1
  7. package/build/autocomplete/index.js +3 -1
  8. package/build/autocomplete/index.js.map +1 -1
  9. package/build/card/card/component.js +6 -11
  10. package/build/card/card/component.js.map +1 -1
  11. package/build/card/card/hook.js +0 -10
  12. package/build/card/card/hook.js.map +1 -1
  13. package/build/card/card/index.js.map +1 -1
  14. package/build/card/card-body/component.js +7 -8
  15. package/build/card/card-body/component.js.map +1 -1
  16. package/build/card/card-body/hook.js +0 -4
  17. package/build/card/card-body/hook.js.map +1 -1
  18. package/build/card/card-body/index.js.map +1 -1
  19. package/build/card/card-divider/component.js +7 -8
  20. package/build/card/card-divider/component.js.map +1 -1
  21. package/build/card/card-divider/hook.js +0 -4
  22. package/build/card/card-divider/hook.js.map +1 -1
  23. package/build/card/card-divider/index.js.map +1 -1
  24. package/build/card/card-footer/component.js +7 -8
  25. package/build/card/card-footer/component.js.map +1 -1
  26. package/build/card/card-footer/hook.js +0 -4
  27. package/build/card/card-footer/hook.js.map +1 -1
  28. package/build/card/card-footer/index.js.map +1 -1
  29. package/build/card/card-header/component.js +7 -8
  30. package/build/card/card-header/component.js.map +1 -1
  31. package/build/card/card-header/hook.js +0 -4
  32. package/build/card/card-header/hook.js.map +1 -1
  33. package/build/card/card-header/index.js.map +1 -1
  34. package/build/card/card-media/component.js +7 -7
  35. package/build/card/card-media/component.js.map +1 -1
  36. package/build/card/card-media/hook.js +0 -4
  37. package/build/card/card-media/hook.js.map +1 -1
  38. package/build/card/card-media/index.js.map +1 -1
  39. package/build/card/context.js.map +1 -1
  40. package/build/card/index.js.map +1 -1
  41. package/build/card/styles.js +17 -17
  42. package/build/card/styles.js.map +1 -1
  43. package/build/clipboard-button/index.js +16 -1
  44. package/build/clipboard-button/index.js.map +1 -1
  45. package/build/color-palette/index.js +6 -2
  46. package/build/color-palette/index.js.map +1 -1
  47. package/build/custom-gradient-picker/index.js +11 -0
  48. package/build/custom-gradient-picker/index.js.map +1 -1
  49. package/build/date-time/date/index.js +25 -6
  50. package/build/date-time/date/index.js.map +1 -1
  51. package/build/date-time/date/styles.js +22 -12
  52. package/build/date-time/date/styles.js.map +1 -1
  53. package/build/date-time/date-time/index.js +1 -3
  54. package/build/date-time/date-time/index.js.map +1 -1
  55. package/build/date-time/date-time/styles.js +19 -5
  56. package/build/date-time/date-time/styles.js.map +1 -1
  57. package/build/date-time/time/styles.js +12 -12
  58. package/build/date-time/time/styles.js.map +1 -1
  59. package/build/drop-zone/index.js +2 -4
  60. package/build/drop-zone/index.js.map +1 -1
  61. package/build/dropdown-menu/index.js +1 -3
  62. package/build/dropdown-menu/index.js.map +1 -1
  63. package/build/dropdown-menu/index.native.js +0 -17
  64. package/build/dropdown-menu/index.native.js.map +1 -1
  65. package/build/focal-point-picker/controls.js +4 -4
  66. package/build/focal-point-picker/controls.js.map +1 -1
  67. package/build/focal-point-picker/focal-point.js +4 -6
  68. package/build/focal-point-picker/focal-point.js.map +1 -1
  69. package/build/focal-point-picker/grid.js +6 -35
  70. package/build/focal-point-picker/grid.js.map +1 -1
  71. package/build/focal-point-picker/index.js +160 -330
  72. package/build/focal-point-picker/index.js.map +1 -1
  73. package/build/focal-point-picker/media.js +4 -34
  74. package/build/focal-point-picker/media.js.map +1 -1
  75. package/build/focal-point-picker/styles/focal-point-picker-style.js +14 -14
  76. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  77. package/build/focal-point-picker/utils.js +2 -6
  78. package/build/focal-point-picker/utils.js.map +1 -1
  79. package/build/focusable-iframe/index.js +6 -0
  80. package/build/focusable-iframe/index.js.map +1 -1
  81. package/build/form-token-field/index.js +18 -15
  82. package/build/form-token-field/index.js.map +1 -1
  83. package/build/gradient-picker/index.js +12 -1
  84. package/build/gradient-picker/index.js.map +1 -1
  85. package/build/guide/index.js +8 -6
  86. package/build/guide/index.js.map +1 -1
  87. package/build/higher-order/with-constrained-tabbing/index.js +1 -1
  88. package/build/higher-order/with-constrained-tabbing/index.js.map +1 -1
  89. package/build/higher-order/with-spoken-messages/index.js +2 -0
  90. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  91. package/build/isolated-event-container/index.js +4 -0
  92. package/build/isolated-event-container/index.js.map +1 -1
  93. package/build/mobile/global-styles-context/utils.native.js +1 -1
  94. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  95. package/build/navigable-container/menu.js +3 -9
  96. package/build/navigable-container/menu.js.map +1 -1
  97. package/build/navigation/menu/menu-title-search.js +1 -3
  98. package/build/navigation/menu/menu-title-search.js.map +1 -1
  99. package/build/palette-edit/index.js +6 -2
  100. package/build/palette-edit/index.js.map +1 -1
  101. package/build/popover/index.js +15 -35
  102. package/build/popover/index.js.map +1 -1
  103. package/build/text-highlight/index.js +4 -4
  104. package/build/text-highlight/index.js.map +1 -1
  105. package/build/toggle-group-control/toggle-group-control/component.js +1 -1
  106. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  107. package/build/toggle-group-control/toggle-group-control/styles.js +23 -8
  108. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  109. package/build/tooltip/index.js +1 -7
  110. package/build/tooltip/index.js.map +1 -1
  111. package/build/tree-grid/index.js +4 -10
  112. package/build/tree-grid/index.js.map +1 -1
  113. package/build/utils/strings.js +13 -0
  114. package/build/utils/strings.js.map +1 -1
  115. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +12 -12
  116. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  117. package/build-module/autocomplete/get-default-use-items.js +6 -1
  118. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  119. package/build-module/autocomplete/index.js +2 -1
  120. package/build-module/autocomplete/index.js.map +1 -1
  121. package/build-module/card/card/component.js +5 -10
  122. package/build-module/card/card/component.js.map +1 -1
  123. package/build-module/card/card/hook.js +0 -9
  124. package/build-module/card/card/hook.js.map +1 -1
  125. package/build-module/card/card/index.js.map +1 -1
  126. package/build-module/card/card-body/component.js +7 -8
  127. package/build-module/card/card-body/component.js.map +1 -1
  128. package/build-module/card/card-body/hook.js +0 -4
  129. package/build-module/card/card-body/hook.js.map +1 -1
  130. package/build-module/card/card-body/index.js.map +1 -1
  131. package/build-module/card/card-divider/component.js +7 -8
  132. package/build-module/card/card-divider/component.js.map +1 -1
  133. package/build-module/card/card-divider/hook.js +0 -4
  134. package/build-module/card/card-divider/hook.js.map +1 -1
  135. package/build-module/card/card-divider/index.js.map +1 -1
  136. package/build-module/card/card-footer/component.js +7 -8
  137. package/build-module/card/card-footer/component.js.map +1 -1
  138. package/build-module/card/card-footer/hook.js +0 -4
  139. package/build-module/card/card-footer/hook.js.map +1 -1
  140. package/build-module/card/card-footer/index.js.map +1 -1
  141. package/build-module/card/card-header/component.js +7 -8
  142. package/build-module/card/card-header/component.js.map +1 -1
  143. package/build-module/card/card-header/hook.js +0 -4
  144. package/build-module/card/card-header/hook.js.map +1 -1
  145. package/build-module/card/card-header/index.js.map +1 -1
  146. package/build-module/card/card-media/component.js +7 -7
  147. package/build-module/card/card-media/component.js.map +1 -1
  148. package/build-module/card/card-media/hook.js +0 -4
  149. package/build-module/card/card-media/hook.js.map +1 -1
  150. package/build-module/card/card-media/index.js.map +1 -1
  151. package/build-module/card/context.js.map +1 -1
  152. package/build-module/card/index.js.map +1 -1
  153. package/build-module/card/styles.js +17 -17
  154. package/build-module/card/styles.js.map +1 -1
  155. package/build-module/clipboard-button/index.js +17 -1
  156. package/build-module/clipboard-button/index.js.map +1 -1
  157. package/build-module/color-palette/index.js +5 -2
  158. package/build-module/color-palette/index.js.map +1 -1
  159. package/build-module/custom-gradient-picker/index.js +10 -0
  160. package/build-module/custom-gradient-picker/index.js.map +1 -1
  161. package/build-module/date-time/date/index.js +27 -8
  162. package/build-module/date-time/date/index.js.map +1 -1
  163. package/build-module/date-time/date/styles.js +21 -5
  164. package/build-module/date-time/date/styles.js.map +1 -1
  165. package/build-module/date-time/date-time/index.js +2 -3
  166. package/build-module/date-time/date-time/index.js.map +1 -1
  167. package/build-module/date-time/date-time/styles.js +20 -1
  168. package/build-module/date-time/date-time/styles.js.map +1 -1
  169. package/build-module/date-time/time/styles.js +12 -12
  170. package/build-module/date-time/time/styles.js.map +1 -1
  171. package/build-module/drop-zone/index.js +2 -3
  172. package/build-module/drop-zone/index.js.map +1 -1
  173. package/build-module/dropdown-menu/index.js +1 -2
  174. package/build-module/dropdown-menu/index.js.map +1 -1
  175. package/build-module/dropdown-menu/index.native.js +0 -16
  176. package/build-module/dropdown-menu/index.native.js.map +1 -1
  177. package/build-module/focal-point-picker/controls.js +4 -4
  178. package/build-module/focal-point-picker/controls.js.map +1 -1
  179. package/build-module/focal-point-picker/focal-point.js +4 -6
  180. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  181. package/build-module/focal-point-picker/grid.js +6 -34
  182. package/build-module/focal-point-picker/grid.js.map +1 -1
  183. package/build-module/focal-point-picker/index.js +158 -325
  184. package/build-module/focal-point-picker/index.js.map +1 -1
  185. package/build-module/focal-point-picker/media.js +4 -36
  186. package/build-module/focal-point-picker/media.js.map +1 -1
  187. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +13 -14
  188. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  189. package/build-module/focal-point-picker/utils.js +2 -6
  190. package/build-module/focal-point-picker/utils.js.map +1 -1
  191. package/build-module/focusable-iframe/index.js +6 -0
  192. package/build-module/focusable-iframe/index.js.map +1 -1
  193. package/build-module/form-token-field/index.js +18 -14
  194. package/build-module/form-token-field/index.js.map +1 -1
  195. package/build-module/gradient-picker/index.js +11 -1
  196. package/build-module/gradient-picker/index.js.map +1 -1
  197. package/build-module/guide/index.js +8 -5
  198. package/build-module/guide/index.js.map +1 -1
  199. package/build-module/higher-order/with-constrained-tabbing/index.js +1 -1
  200. package/build-module/higher-order/with-constrained-tabbing/index.js.map +1 -1
  201. package/build-module/higher-order/with-spoken-messages/index.js +2 -0
  202. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  203. package/build-module/isolated-event-container/index.js +3 -0
  204. package/build-module/isolated-event-container/index.js.map +1 -1
  205. package/build-module/mobile/global-styles-context/utils.native.js +2 -2
  206. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  207. package/build-module/navigable-container/menu.js +3 -8
  208. package/build-module/navigable-container/menu.js.map +1 -1
  209. package/build-module/navigation/menu/menu-title-search.js +1 -2
  210. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  211. package/build-module/palette-edit/index.js +6 -2
  212. package/build-module/palette-edit/index.js.map +1 -1
  213. package/build-module/popover/index.js +15 -35
  214. package/build-module/popover/index.js.map +1 -1
  215. package/build-module/text-highlight/index.js +2 -5
  216. package/build-module/text-highlight/index.js.map +1 -1
  217. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -1
  218. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  219. package/build-module/toggle-group-control/toggle-group-control/styles.js +20 -6
  220. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  221. package/build-module/tooltip/index.js +1 -6
  222. package/build-module/tooltip/index.js.map +1 -1
  223. package/build-module/tree-grid/index.js +4 -9
  224. package/build-module/tree-grid/index.js.map +1 -1
  225. package/build-module/utils/strings.js +11 -0
  226. package/build-module/utils/strings.js.map +1 -1
  227. package/build-style/style-rtl.css +2 -21
  228. package/build-style/style.css +2 -21
  229. package/build-types/animation/index.d.ts +2 -0
  230. package/build-types/animation/index.d.ts.map +1 -0
  231. package/build-types/card/card/component.d.ts +3 -3
  232. package/build-types/card/card/component.d.ts.map +1 -1
  233. package/build-types/card/card/hook.d.ts +7 -2
  234. package/build-types/card/card/hook.d.ts.map +1 -1
  235. package/build-types/card/card/index.d.ts +2 -2
  236. package/build-types/card/card/index.d.ts.map +1 -1
  237. package/build-types/card/card-body/component.d.ts +3 -3
  238. package/build-types/card/card-body/component.d.ts.map +1 -1
  239. package/build-types/card/card-body/hook.d.ts +5 -2
  240. package/build-types/card/card-body/hook.d.ts.map +1 -1
  241. package/build-types/card/card-body/index.d.ts +2 -2
  242. package/build-types/card/card-body/index.d.ts.map +1 -1
  243. package/build-types/card/card-divider/component.d.ts +3 -3
  244. package/build-types/card/card-divider/component.d.ts.map +1 -1
  245. package/build-types/card/card-divider/hook.d.ts +5 -2
  246. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  247. package/build-types/card/card-divider/index.d.ts +2 -2
  248. package/build-types/card/card-divider/index.d.ts.map +1 -1
  249. package/build-types/card/card-footer/component.d.ts +3 -3
  250. package/build-types/card/card-footer/component.d.ts.map +1 -1
  251. package/build-types/card/card-footer/hook.d.ts +5 -2
  252. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  253. package/build-types/card/card-footer/index.d.ts +2 -2
  254. package/build-types/card/card-footer/index.d.ts.map +1 -1
  255. package/build-types/card/card-header/component.d.ts +3 -3
  256. package/build-types/card/card-header/component.d.ts.map +1 -1
  257. package/build-types/card/card-header/hook.d.ts +5 -2
  258. package/build-types/card/card-header/hook.d.ts.map +1 -1
  259. package/build-types/card/card-header/index.d.ts +2 -2
  260. package/build-types/card/card-header/index.d.ts.map +1 -1
  261. package/build-types/card/card-media/component.d.ts +3 -4
  262. package/build-types/card/card-media/component.d.ts.map +1 -1
  263. package/build-types/card/card-media/hook.d.ts +6 -5
  264. package/build-types/card/card-media/hook.d.ts.map +1 -1
  265. package/build-types/card/card-media/index.d.ts +2 -2
  266. package/build-types/card/card-media/index.d.ts.map +1 -1
  267. package/build-types/card/context.d.ts +3 -2
  268. package/build-types/card/context.d.ts.map +1 -1
  269. package/build-types/card/index.d.ts +6 -6
  270. package/build-types/card/index.d.ts.map +1 -1
  271. package/build-types/card/stories/index.d.ts +12 -0
  272. package/build-types/card/stories/index.d.ts.map +1 -0
  273. package/build-types/card/styles.d.ts +20 -22
  274. package/build-types/card/styles.d.ts.map +1 -1
  275. package/build-types/card/test/index.d.ts +2 -0
  276. package/build-types/card/test/index.d.ts.map +1 -0
  277. package/build-types/card/types.d.ts +7 -1
  278. package/build-types/card/types.d.ts.map +1 -1
  279. package/build-types/clipboard-button/index.d.ts +16 -0
  280. package/build-types/clipboard-button/index.d.ts.map +1 -0
  281. package/build-types/color-palette/index.d.ts.map +1 -1
  282. package/build-types/composite/index.d.ts +2 -0
  283. package/build-types/composite/index.d.ts.map +1 -0
  284. package/build-types/date-time/date/index.d.ts +1 -1
  285. package/build-types/date-time/date/index.d.ts.map +1 -1
  286. package/build-types/date-time/date/styles.d.ts +4 -0
  287. package/build-types/date-time/date/styles.d.ts.map +1 -1
  288. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  289. package/build-types/date-time/date-time/styles.d.ts +13 -0
  290. package/build-types/date-time/date-time/styles.d.ts.map +1 -1
  291. package/build-types/date-time/time/styles.d.ts.map +1 -1
  292. package/build-types/disclosure/index.d.ts +2 -0
  293. package/build-types/disclosure/index.d.ts.map +1 -0
  294. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  295. package/build-types/focusable-iframe/index.d.ts +8 -0
  296. package/build-types/focusable-iframe/index.d.ts.map +1 -0
  297. package/build-types/form-token-field/index.d.ts.map +1 -1
  298. package/build-types/form-token-field/test/index.d.ts +2 -0
  299. package/build-types/form-token-field/test/index.d.ts.map +1 -0
  300. package/build-types/higher-order/with-constrained-tabbing/index.d.ts +3 -0
  301. package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -0
  302. package/build-types/higher-order/with-spoken-messages/index.d.ts +4 -0
  303. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -0
  304. package/build-types/isolated-event-container/index.d.ts +3 -0
  305. package/build-types/isolated-event-container/index.d.ts.map +1 -0
  306. package/build-types/mobile/inserter-button/sparkles.d.ts +3 -0
  307. package/build-types/mobile/inserter-button/sparkles.d.ts.map +1 -0
  308. package/build-types/navigable-container/menu.d.ts.map +1 -1
  309. package/build-types/popover/index.d.ts +0 -1
  310. package/build-types/popover/index.d.ts.map +1 -1
  311. package/build-types/radio-context/index.d.ts +6 -0
  312. package/build-types/radio-context/index.d.ts.map +1 -0
  313. package/build-types/text-highlight/index.d.ts +0 -3
  314. package/build-types/text-highlight/index.d.ts.map +1 -1
  315. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  316. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +4 -0
  317. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  318. package/build-types/tooltip/index.d.ts.map +1 -1
  319. package/build-types/utils/strings.d.ts +8 -0
  320. package/build-types/utils/strings.d.ts.map +1 -1
  321. package/package.json +17 -17
  322. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -0
  323. package/src/autocomplete/get-default-use-items.js +6 -1
  324. package/src/autocomplete/index.js +2 -1
  325. package/src/card/card/{component.js → component.tsx} +13 -9
  326. package/src/card/card/{hook.js → hook.ts} +11 -11
  327. package/src/card/card/{index.js → index.ts} +0 -0
  328. package/src/card/card-body/{component.js → component.tsx} +13 -9
  329. package/src/card/card-body/{hook.js → hook.ts} +5 -5
  330. package/src/card/card-body/{index.js → index.ts} +0 -0
  331. package/src/card/card-divider/{component.js → component.tsx} +16 -10
  332. package/src/card/card-divider/{hook.js → hook.ts} +5 -5
  333. package/src/card/card-divider/{index.js → index.ts} +0 -0
  334. package/src/card/card-footer/{component.js → component.tsx} +13 -9
  335. package/src/card/card-footer/{hook.js → hook.ts} +5 -5
  336. package/src/card/card-footer/{index.js → index.ts} +0 -0
  337. package/src/card/card-header/{component.js → component.tsx} +13 -9
  338. package/src/card/card-header/{hook.js → hook.ts} +5 -5
  339. package/src/card/card-header/{index.js → index.ts} +0 -0
  340. package/src/card/card-media/{component.js → component.tsx} +13 -8
  341. package/src/card/card-media/{hook.js → hook.ts} +5 -5
  342. package/src/card/card-media/{index.js → index.ts} +0 -0
  343. package/src/card/{context.js → context.ts} +0 -0
  344. package/src/card/{index.js → index.ts} +0 -0
  345. package/src/card/stories/index.tsx +75 -0
  346. package/src/card/{styles.js → styles.ts} +0 -0
  347. package/src/card/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  348. package/src/card/test/{index.js → index.tsx} +3 -3
  349. package/src/card/types.ts +8 -1
  350. package/src/clipboard-button/index.js +13 -0
  351. package/src/color-palette/index.js +8 -5
  352. package/src/color-palette/style.scss +0 -14
  353. package/src/color-palette/test/__snapshots__/index.js.snap +11 -4
  354. package/src/custom-gradient-picker/index.js +12 -0
  355. package/src/custom-gradient-picker/stories/index.js +3 -0
  356. package/src/date-time/date/index.tsx +26 -6
  357. package/src/date-time/date/styles.ts +6 -0
  358. package/src/date-time/date/test/index.tsx +6 -2
  359. package/src/date-time/date-time/index.tsx +3 -4
  360. package/src/date-time/date-time/styles.ts +9 -0
  361. package/src/date-time/time/styles.ts +1 -0
  362. package/src/drop-zone/index.js +2 -3
  363. package/src/dropdown-menu/index.js +1 -2
  364. package/src/dropdown-menu/index.native.js +0 -13
  365. package/src/dropdown-menu/test/index.js +54 -58
  366. package/src/focal-point-picker/README.md +3 -6
  367. package/src/focal-point-picker/controls.js +4 -4
  368. package/src/focal-point-picker/focal-point.js +2 -8
  369. package/src/focal-point-picker/grid.js +5 -41
  370. package/src/focal-point-picker/index.js +161 -303
  371. package/src/focal-point-picker/media.js +4 -28
  372. package/src/focal-point-picker/styles/focal-point-picker-style.js +5 -8
  373. package/src/focal-point-picker/test/index.js +1 -1
  374. package/src/focal-point-picker/utils.js +2 -6
  375. package/src/focusable-iframe/index.js +5 -0
  376. package/src/form-token-field/index.tsx +17 -23
  377. package/src/form-token-field/test/index.tsx +2106 -0
  378. package/src/gradient-picker/README.md +9 -0
  379. package/src/gradient-picker/index.js +9 -0
  380. package/src/gradient-picker/stories/index.js +1 -0
  381. package/src/guide/index.js +6 -3
  382. package/src/guide/test/index.js +138 -1
  383. package/src/higher-order/with-constrained-tabbing/index.js +1 -1
  384. package/src/higher-order/with-spoken-messages/index.js +2 -0
  385. package/src/isolated-event-container/index.js +3 -0
  386. package/src/mobile/global-styles-context/utils.native.js +7 -2
  387. package/src/navigable-container/menu.js +3 -7
  388. package/src/navigation/menu/menu-title-search.js +1 -2
  389. package/src/palette-edit/index.js +14 -10
  390. package/src/palette-edit/style.scss +3 -11
  391. package/src/placeholder/style.scss +1 -4
  392. package/src/popover/index.js +17 -35
  393. package/src/popover/stories/index.js +0 -1
  394. package/src/text-highlight/index.tsx +1 -5
  395. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +62 -44
  396. package/src/toggle-group-control/toggle-group-control/component.tsx +3 -2
  397. package/src/toggle-group-control/toggle-group-control/styles.ts +5 -0
  398. package/src/tooltip/index.js +1 -5
  399. package/src/tree-grid/index.js +4 -9
  400. package/src/utils/strings.ts +11 -0
  401. package/tsconfig.json +45 -76
  402. package/tsconfig.tsbuildinfo +1 -1
  403. package/build/ui/__storybook-utils/example-grid.js +0 -88
  404. package/build/ui/__storybook-utils/example-grid.js.map +0 -1
  405. package/build/ui/__storybook-utils/index.js +0 -19
  406. package/build/ui/__storybook-utils/index.js.map +0 -1
  407. package/build/ui/__storybook-utils/page.js +0 -43
  408. package/build/ui/__storybook-utils/page.js.map +0 -1
  409. package/build/utils/keyboard.js +0 -41
  410. package/build/utils/keyboard.js.map +0 -1
  411. package/build-module/ui/__storybook-utils/example-grid.js +0 -69
  412. package/build-module/ui/__storybook-utils/example-grid.js.map +0 -1
  413. package/build-module/ui/__storybook-utils/index.js +0 -2
  414. package/build-module/ui/__storybook-utils/index.js.map +0 -1
  415. package/build-module/ui/__storybook-utils/page.js +0 -32
  416. package/build-module/ui/__storybook-utils/page.js.map +0 -1
  417. package/build-module/utils/keyboard.js +0 -33
  418. package/build-module/utils/keyboard.js.map +0 -1
  419. package/build-types/form-token-field/test/lib/fixtures.d.ts +0 -26
  420. package/build-types/form-token-field/test/lib/fixtures.d.ts.map +0 -1
  421. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +0 -21
  422. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +0 -1
  423. package/build-types/utils/keyboard.d.ts +0 -12
  424. package/build-types/utils/keyboard.d.ts.map +0 -1
  425. package/src/card/stories/index.js +0 -209
  426. package/src/form-token-field/test/index.js +0 -442
  427. package/src/form-token-field/test/lib/fixtures.js +0 -89
  428. package/src/form-token-field/test/lib/token-field-wrapper.tsx +0 -71
  429. package/src/guide/test/page-control.js +0 -40
  430. package/src/ui/__storybook-utils/example-grid.js +0 -61
  431. package/src/ui/__storybook-utils/index.js +0 -1
  432. package/src/ui/__storybook-utils/page.js +0 -29
  433. package/src/utils/keyboard.js +0 -28
  434. package/src/utils/test/keyboard.js +0 -34
@@ -7,8 +7,12 @@ import classnames from 'classnames';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { __ } from '@wordpress/i18n';
10
- import { Component, createRef } from '@wordpress/element';
11
- import { withInstanceId } from '@wordpress/compose';
10
+ import { useEffect, useRef, useState } from '@wordpress/element';
11
+ import {
12
+ __experimentalUseDragging as useDragging,
13
+ useInstanceId,
14
+ useIsomorphicLayoutEffect,
15
+ } from '@wordpress/compose';
12
16
 
13
17
  /**
14
18
  * Internal dependencies
@@ -22,154 +26,99 @@ import {
22
26
  MediaWrapper,
23
27
  MediaContainer,
24
28
  } from './styles/focal-point-picker-style';
25
- import { roundClamp } from '../utils/math';
26
29
  import { INITIAL_BOUNDS } from './utils';
27
-
28
- export class FocalPointPicker extends Component {
29
- constructor( props ) {
30
- super( ...arguments );
31
-
32
- this.state = {
33
- isDragging: false,
34
- bounds: INITIAL_BOUNDS,
35
- percentages: props.value,
36
- };
37
-
38
- this.containerRef = createRef();
39
- this.mediaRef = createRef();
40
-
41
- this.onMouseDown = this.startDrag.bind( this );
42
- this.onMouseUp = this.stopDrag.bind( this );
43
- this.onKeyDown = this.onKeyDown.bind( this );
44
- this.onMouseMove = this.doDrag.bind( this );
45
- this.ifDraggingStop = () => {
46
- if ( this.state.isDragging ) {
47
- this.stopDrag();
48
- }
49
- };
50
- this.onChangeAtControls = ( value ) => {
51
- this.updateValue( value, () => {
52
- this.props.onChange( this.state.percentages );
53
- } );
54
- };
55
-
56
- this.updateBounds = this.updateBounds.bind( this );
57
- this.updateValue = this.updateValue.bind( this );
58
- }
59
- componentDidMount() {
60
- const { defaultView } = this.containerRef.current.ownerDocument;
61
- defaultView.addEventListener( 'resize', this.updateBounds );
62
-
63
- /*
64
- * Set initial bound values.
65
- *
66
- * This is necessary for Safari:
67
- * https://github.com/WordPress/gutenberg/issues/25814
68
- */
69
- this.updateBounds();
70
- }
71
- componentDidUpdate( prevProps ) {
72
- if ( prevProps.url !== this.props.url ) {
73
- this.ifDraggingStop();
74
- }
75
- /*
76
- * Handles cases where the incoming value changes.
77
- * An example is the values resetting based on an UNDO action.
78
- */
79
- const {
80
- isDragging,
81
- percentages: { x, y },
82
- } = this.state;
83
- const { value } = this.props;
84
- if ( ! isDragging && ( value.x !== x || value.y !== y ) ) {
85
- this.setState( { percentages: this.props.value } );
86
- }
87
- }
88
- componentWillUnmount() {
89
- const { defaultView } = this.containerRef.current.ownerDocument;
90
- defaultView.removeEventListener( 'resize', this.updateBounds );
91
- this.ifDraggingStop();
92
- }
93
- calculateBounds() {
94
- const bounds = INITIAL_BOUNDS;
95
-
96
- if ( ! this.mediaRef.current ) {
97
- return bounds;
98
- }
99
-
100
- // Prevent division by zero when updateBounds runs in componentDidMount
101
- if (
102
- this.mediaRef.current.clientWidth === 0 ||
103
- this.mediaRef.current.clientHeight === 0
104
- ) {
105
- return bounds;
106
- }
107
-
108
- const dimensions = {
109
- width: this.mediaRef.current.clientWidth,
110
- height: this.mediaRef.current.clientHeight,
111
- };
112
-
113
- const pickerDimensions = this.pickerDimensions();
114
-
115
- const widthRatio = pickerDimensions.width / dimensions.width;
116
- const heightRatio = pickerDimensions.height / dimensions.height;
117
-
118
- if ( heightRatio >= widthRatio ) {
119
- bounds.width = bounds.right = pickerDimensions.width;
120
- bounds.height = dimensions.height * widthRatio;
121
- bounds.top = ( pickerDimensions.height - bounds.height ) / 2;
122
- bounds.bottom = bounds.top + bounds.height;
123
- } else {
124
- bounds.height = bounds.bottom = pickerDimensions.height;
125
- bounds.width = dimensions.width * heightRatio;
126
- bounds.left = ( pickerDimensions.width - bounds.width ) / 2;
127
- bounds.right = bounds.left + bounds.width;
30
+ import { useUpdateEffect } from '../utils/hooks';
31
+
32
+ const GRID_OVERLAY_TIMEOUT = 600;
33
+
34
+ export default function FocalPointPicker( {
35
+ autoPlay = true,
36
+ className,
37
+ help,
38
+ label,
39
+ onChange,
40
+ onDrag,
41
+ onDragEnd,
42
+ onDragStart,
43
+ resolvePoint,
44
+ url,
45
+ value: valueProp = {
46
+ x: 0.5,
47
+ y: 0.5,
48
+ },
49
+ } ) {
50
+ const [ point, setPoint ] = useState( valueProp );
51
+ const [ showGridOverlay, setShowGridOverlay ] = useState( false );
52
+
53
+ const { startDrag, endDrag, isDragging } = useDragging( {
54
+ onDragStart: ( event ) => {
55
+ dragAreaRef.current.focus();
56
+ const value = getValueWithinDragArea( event );
57
+ onDragStart?.( value, event );
58
+ setPoint( value );
59
+ },
60
+ onDragMove: ( event ) => {
61
+ // Prevents text-selection when dragging.
62
+ event.preventDefault();
63
+ const value = getValueWithinDragArea( event );
64
+ onDrag?.( value, event );
65
+ setPoint( value );
66
+ },
67
+ onDragEnd: ( event ) => {
68
+ onDragEnd?.( event );
69
+ onChange?.( point );
70
+ },
71
+ } );
72
+
73
+ // Uses the internal point while dragging or else the value from props.
74
+ const { x, y } = isDragging ? point : valueProp;
75
+
76
+ const dragAreaRef = useRef();
77
+ const [ bounds, setBounds ] = useState( INITIAL_BOUNDS );
78
+ const refUpdateBounds = useRef( () => {
79
+ const { clientWidth: width, clientHeight: height } =
80
+ dragAreaRef.current;
81
+ // Falls back to initial bounds if the ref has no size. Since styles
82
+ // give the drag area dimensions even when the media has not loaded
83
+ // this should only happen in unit tests (jsdom).
84
+ setBounds(
85
+ width > 0 && height > 0 ? { width, height } : { ...INITIAL_BOUNDS }
86
+ );
87
+ } );
88
+
89
+ useEffect( () => {
90
+ const updateBounds = refUpdateBounds.current;
91
+ const { defaultView } = dragAreaRef.current.ownerDocument;
92
+ defaultView.addEventListener( 'resize', updateBounds );
93
+ return () => defaultView.removeEventListener( 'resize', updateBounds );
94
+ }, [] );
95
+
96
+ // Updates the bounds to cover cases of unspecified media or load failures.
97
+ useIsomorphicLayoutEffect( () => void refUpdateBounds.current(), [] );
98
+
99
+ const getValueWithinDragArea = ( { clientX, clientY, shiftKey } ) => {
100
+ const { top, left } = dragAreaRef.current.getBoundingClientRect();
101
+ let nextX = ( clientX - left ) / bounds.width;
102
+ let nextY = ( clientY - top ) / bounds.height;
103
+ // Enables holding shift to jump values by 10%.
104
+ if ( shiftKey ) {
105
+ nextX = Math.round( nextX / 0.1 ) * 0.1;
106
+ nextY = Math.round( nextY / 0.1 ) * 0.1;
128
107
  }
129
- return bounds;
130
- }
131
- updateValue( nextValue = {}, callback ) {
132
- const resolvedValue =
133
- this.props.resolvePoint?.( nextValue ) ?? nextValue;
108
+ return getFinalValue( { x: nextX, y: nextY } );
109
+ };
134
110
 
135
- const { x, y } = resolvedValue;
136
-
137
- const nextPercentage = {
138
- x: parseFloat( x ).toFixed( 2 ),
139
- y: parseFloat( y ).toFixed( 2 ),
111
+ const getFinalValue = ( value ) => {
112
+ const resolvedValue = resolvePoint?.( value ) ?? value;
113
+ resolvedValue.x = Math.max( 0, Math.min( resolvedValue.x, 1 ) );
114
+ resolvedValue.y = Math.max( 0, Math.min( resolvedValue.y, 1 ) );
115
+ return {
116
+ x: parseFloat( resolvedValue.x ).toFixed( 2 ),
117
+ y: parseFloat( resolvedValue.y ).toFixed( 2 ),
140
118
  };
119
+ };
141
120
 
142
- this.setState( { percentages: nextPercentage }, callback );
143
- }
144
- updateBounds() {
145
- this.setState( {
146
- bounds: this.calculateBounds(),
147
- } );
148
- }
149
- startDrag( event ) {
150
- event.persist();
151
- this.containerRef.current.focus();
152
- this.setState( { isDragging: true } );
153
- const { ownerDocument } = this.containerRef.current;
154
- ownerDocument.addEventListener( 'mouseup', this.onMouseUp );
155
- ownerDocument.addEventListener( 'mousemove', this.onMouseMove );
156
- const value = this.getValueFromPoint(
157
- { x: event.pageX, y: event.pageY },
158
- event.shiftKey
159
- );
160
- this.updateValue( value );
161
- this.props.onDragStart?.( value, event );
162
- }
163
- stopDrag( event ) {
164
- const { ownerDocument } = this.containerRef.current;
165
- ownerDocument.removeEventListener( 'mouseup', this.onMouseUp );
166
- ownerDocument.removeEventListener( 'mousemove', this.onMouseMove );
167
- this.setState( { isDragging: false }, () => {
168
- this.props.onChange( this.state.percentages );
169
- } );
170
- this.props.onDragEnd?.( event );
171
- }
172
- onKeyDown( event ) {
121
+ const arrowKeyStep = ( event ) => {
173
122
  const { code, shiftKey } = event;
174
123
  if (
175
124
  ! [ 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight' ].includes(
@@ -179,166 +128,75 @@ export class FocalPointPicker extends Component {
179
128
  return;
180
129
 
181
130
  event.preventDefault();
182
-
183
- const next = { ...this.state.percentages };
131
+ const value = { x, y };
184
132
  const step = shiftKey ? 0.1 : 0.01;
185
133
  const delta =
186
134
  code === 'ArrowUp' || code === 'ArrowLeft' ? -1 * step : step;
187
135
  const axis = code === 'ArrowUp' || code === 'ArrowDown' ? 'y' : 'x';
188
- const value = parseFloat( next[ axis ] ) + delta;
189
-
190
- next[ axis ] = roundClamp( value, 0, 1, step );
191
-
192
- this.updateValue( next, () => {
193
- this.props.onChange( this.state.percentages );
194
- } );
195
- }
196
- doDrag( event ) {
197
- // Prevents text-selection when dragging.
198
- event.preventDefault();
199
- const value = this.getValueFromPoint(
200
- { x: event.pageX, y: event.pageY },
201
- event.shiftKey
202
- );
203
- this.updateValue( value );
204
- this.props.onDrag?.( value, event );
205
- }
206
- getValueFromPoint( point, byTenths ) {
207
- const { bounds } = this.state;
208
-
209
- const pickerDimensions = this.pickerDimensions();
210
- const relativePoint = {
211
- left: point.x - pickerDimensions.left,
212
- top: point.y - pickerDimensions.top,
213
- };
214
-
215
- const left = Math.max(
216
- bounds.left,
217
- Math.min( relativePoint.left, bounds.right )
218
- );
219
- const top = Math.max(
220
- bounds.top,
221
- Math.min( relativePoint.top, bounds.bottom )
222
- );
223
-
224
- let nextX =
225
- ( left - bounds.left ) /
226
- ( pickerDimensions.width - bounds.left * 2 );
227
- let nextY =
228
- ( top - bounds.top ) / ( pickerDimensions.height - bounds.top * 2 );
229
-
230
- // Enables holding shift to jump values by 10%
231
- const step = byTenths ? 0.1 : 0.01;
232
-
233
- nextX = roundClamp( nextX, 0, 1, step );
234
- nextY = roundClamp( nextY, 0, 1, step );
235
-
236
- return { x: nextX, y: nextY };
237
- }
238
- pickerDimensions() {
239
- const containerNode = this.containerRef.current;
240
-
241
- if ( ! containerNode ) {
242
- return {
243
- width: 0,
244
- height: 0,
245
- left: 0,
246
- top: 0,
247
- };
248
- }
249
-
250
- const { clientHeight, clientWidth } = containerNode;
251
- const { top, left } = containerNode.getBoundingClientRect();
252
-
253
- return {
254
- width: clientWidth,
255
- height: clientHeight,
256
- top: top + document.body.scrollTop,
257
- left,
258
- };
259
- }
260
- iconCoordinates() {
261
- const {
262
- bounds,
263
- percentages: { x, y },
264
- } = this.state;
265
-
266
- if ( bounds.left === undefined || bounds.top === undefined ) {
267
- return {
268
- left: '50%',
269
- top: '50%',
270
- };
271
- }
272
-
273
- const { width, height } = this.pickerDimensions();
274
- return {
275
- left: x * ( width - bounds.left * 2 ) + bounds.left,
276
- top: y * ( height - bounds.top * 2 ) + bounds.top,
277
- };
278
- }
279
- render() {
280
- const { autoPlay, className, help, instanceId, label, url } =
281
- this.props;
282
- const { bounds, isDragging, percentages } = this.state;
283
- const iconCoordinates = this.iconCoordinates();
284
-
285
- const classes = classnames(
286
- 'components-focal-point-picker-control',
287
- className
288
- );
289
-
290
- const id = `inspector-focal-point-picker-control-${ instanceId }`;
291
-
292
- return (
293
- <BaseControl
294
- label={ label }
295
- id={ id }
296
- help={ help }
297
- className={ classes }
298
- >
299
- <MediaWrapper className="components-focal-point-picker-wrapper">
300
- <MediaContainer
301
- className="components-focal-point-picker"
302
- onKeyDown={ this.onKeyDown }
303
- onMouseDown={ this.onMouseDown }
304
- onBlur={ this.ifDraggingStop }
305
- ref={ this.containerRef }
306
- role="button"
307
- tabIndex="-1"
308
- >
309
- <Grid
310
- bounds={ bounds }
311
- value={ percentages.x + percentages.y }
312
- />
313
- <Media
314
- alt={ __( 'Media preview' ) }
315
- autoPlay={ autoPlay }
316
- mediaRef={ this.mediaRef }
317
- onLoad={ this.updateBounds }
318
- src={ url }
319
- />
320
- <FocalPoint
321
- coordinates={ iconCoordinates }
322
- isDragging={ isDragging }
323
- />
324
- </MediaContainer>
325
- </MediaWrapper>
326
- <Controls
327
- percentages={ percentages }
328
- onChange={ this.onChangeAtControls }
329
- />
330
- </BaseControl>
331
- );
332
- }
136
+ value[ axis ] = parseFloat( value[ axis ] ) + delta;
137
+ onChange?.( getFinalValue( value ) );
138
+ };
139
+
140
+ const focalPointPosition = {
141
+ left: x * bounds.width,
142
+ top: y * bounds.height,
143
+ };
144
+
145
+ const classes = classnames(
146
+ 'components-focal-point-picker-control',
147
+ className
148
+ );
149
+
150
+ const instanceId = useInstanceId( FocalPointPicker );
151
+ const id = `inspector-focal-point-picker-control-${ instanceId }`;
152
+
153
+ useUpdateEffect( () => {
154
+ setShowGridOverlay( true );
155
+ const timeout = window.setTimeout( () => {
156
+ setShowGridOverlay( false );
157
+ }, GRID_OVERLAY_TIMEOUT );
158
+
159
+ return () => window.clearTimeout( timeout );
160
+ }, [ x, y ] );
161
+
162
+ return (
163
+ <BaseControl
164
+ label={ label }
165
+ id={ id }
166
+ help={ help }
167
+ className={ classes }
168
+ >
169
+ <MediaWrapper className="components-focal-point-picker-wrapper">
170
+ <MediaContainer
171
+ className="components-focal-point-picker"
172
+ onKeyDown={ arrowKeyStep }
173
+ onMouseDown={ startDrag }
174
+ onBlur={ () => {
175
+ if ( isDragging ) endDrag();
176
+ } }
177
+ ref={ dragAreaRef }
178
+ role="button"
179
+ tabIndex="-1"
180
+ >
181
+ <Grid bounds={ bounds } showOverlay={ showGridOverlay } />
182
+ <Media
183
+ alt={ __( 'Media preview' ) }
184
+ autoPlay={ autoPlay }
185
+ onLoad={ refUpdateBounds.current }
186
+ src={ url }
187
+ />
188
+ <FocalPoint
189
+ { ...focalPointPosition }
190
+ isDragging={ isDragging }
191
+ />
192
+ </MediaContainer>
193
+ </MediaWrapper>
194
+ <Controls
195
+ point={ { x, y } }
196
+ onChange={ ( value ) => {
197
+ onChange?.( getFinalValue( value ) );
198
+ } }
199
+ />
200
+ </BaseControl>
201
+ );
333
202
  }
334
-
335
- FocalPointPicker.defaultProps = {
336
- autoPlay: true,
337
- value: {
338
- x: 0.5,
339
- y: 0.5,
340
- },
341
- url: null,
342
- };
343
-
344
- export default withInstanceId( FocalPointPicker );
@@ -1,21 +1,14 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useRef, useLayoutEffect } from '@wordpress/element';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
9
4
  import { MediaPlaceholder } from './styles/focal-point-picker-style';
10
5
  import { isVideoType } from './utils';
11
6
 
12
- const noop = () => {};
13
-
14
7
  export default function Media( {
15
8
  alt,
16
9
  autoPlay,
17
10
  src,
18
- onLoad = noop,
11
+ onLoad,
19
12
  mediaRef,
20
13
  // Exposing muted prop for test rendering purposes
21
14
  // https://github.com/testing-library/react-testing-library/issues/470
@@ -24,10 +17,10 @@ export default function Media( {
24
17
  } ) {
25
18
  if ( ! src ) {
26
19
  return (
27
- <MediaPlaceholderElement
20
+ <MediaPlaceholder
28
21
  className="components-focal-point-picker__media components-focal-point-picker__media--placeholder"
29
- onLoad={ onLoad }
30
- mediaRef={ mediaRef }
22
+ ref={ mediaRef }
23
+ { ...props }
31
24
  />
32
25
  );
33
26
  }
@@ -56,20 +49,3 @@ export default function Media( {
56
49
  />
57
50
  );
58
51
  }
59
-
60
- function MediaPlaceholderElement( { mediaRef, onLoad = noop, ...props } ) {
61
- const onLoadRef = useRef( onLoad );
62
-
63
- /**
64
- * This async callback mimics the onLoad (img) / onLoadedData (video) callback
65
- * for media elements. It is used in the main <FocalPointPicker /> component
66
- * to calculate the dimensions + boundaries for positioning.
67
- */
68
- useLayoutEffect( () => {
69
- window.requestAnimationFrame( () => {
70
- onLoadRef.current();
71
- } );
72
- }, [] );
73
-
74
- return <MediaPlaceholder ref={ mediaRef } { ...props } />;
75
- }
@@ -9,6 +9,7 @@ import styled from '@emotion/styled';
9
9
  import { Flex } from '../../flex';
10
10
  import BaseUnitControl from '../../unit-control';
11
11
  import { COLORS } from '../../utils';
12
+ import { INITIAL_BOUNDS } from '../utils';
12
13
 
13
14
  export const MediaWrapper = styled.div`
14
15
  background-color: transparent;
@@ -42,9 +43,10 @@ export const MediaContainer = styled.div`
42
43
 
43
44
  export const MediaPlaceholder = styled.div`
44
45
  background: ${ COLORS.lightGray[ 300 ] };
45
- height: 170px;
46
+ box-sizing: border-box;
47
+ height: ${ INITIAL_BOUNDS.height }px;
46
48
  max-width: 280px;
47
- min-width: 200px;
49
+ min-width: ${ INITIAL_BOUNDS.width }px;
48
50
  width: 100%;
49
51
  `;
50
52
 
@@ -59,7 +61,6 @@ export const ControlWrapper = styled( Flex )`
59
61
 
60
62
  export const GridView = styled.div`
61
63
  left: 50%;
62
- opacity: 0;
63
64
  overflow: hidden;
64
65
  pointer-events: none;
65
66
  position: absolute;
@@ -68,11 +69,7 @@ export const GridView = styled.div`
68
69
  transition: opacity 120ms linear;
69
70
  z-index: 1;
70
71
 
71
- ${ ( { isActive } ) =>
72
- isActive &&
73
- `
74
- opacity: 1;
75
- ` }
72
+ opacity: ${ ( { showOverlay } ) => ( showOverlay ? 1 : 0 ) };
76
73
  `;
77
74
 
78
75
  export const GridLine = styled.div`
@@ -137,7 +137,7 @@ describe( 'FocalPointPicker', () => {
137
137
  render(
138
138
  <Picker value={ { x: 0.14, y: 0.62 } } onChange={ spyChange } />
139
139
  );
140
- // Click and press arrow up
140
+ // Focus and press arrow up
141
141
  const dragArea = screen.getByRole( 'button' );
142
142
 
143
143
  await user.click( dragArea );
@@ -1,10 +1,6 @@
1
1
  export const INITIAL_BOUNDS = {
2
- top: 0,
3
- left: 0,
4
- bottom: 0,
5
- right: 0,
6
- width: 0,
7
- height: 0,
2
+ width: 200,
3
+ height: 170,
8
4
  };
9
5
 
10
6
  const VIDEO_EXTENSIONS = [
@@ -4,7 +4,12 @@
4
4
  import { useMergeRefs, useFocusableIframe } from '@wordpress/compose';
5
5
  import deprecated from '@wordpress/deprecated';
6
6
 
7
+ /**
8
+ * @param {Object} props
9
+ * @param {import('react').Ref<HTMLIFrameElement>} props.iframeRef
10
+ */
7
11
  export default function FocusableIframe( { iframeRef, ...props } ) {
12
+ // @ts-expect-error: Return type for useFocusableIframe() is incorrect.
8
13
  const ref = useMergeRefs( [ iframeRef, useFocusableIframe() ] );
9
14
  deprecated( 'wp.components.FocusableIframe', {
10
15
  since: '5.9',