@wordpress/components 19.4.1 → 19.5.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 (396) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/CONTRIBUTING.md +69 -2
  3. package/build/box-control/unit-control.js +2 -2
  4. package/build/box-control/unit-control.js.map +1 -1
  5. package/build/card/card/component.js +2 -2
  6. package/build/card/card/component.js.map +1 -1
  7. package/build/card/card-body/component.js +1 -1
  8. package/build/card/card-body/component.js.map +1 -1
  9. package/build/card/card-divider/component.js +1 -1
  10. package/build/card/card-divider/component.js.map +1 -1
  11. package/build/card/card-footer/component.js +1 -1
  12. package/build/card/card-footer/component.js.map +1 -1
  13. package/build/card/card-header/component.js +1 -1
  14. package/build/card/card-header/component.js.map +1 -1
  15. package/build/card/card-media/component.js +1 -1
  16. package/build/card/card-media/component.js.map +1 -1
  17. package/build/color-palette/index.native.js +35 -30
  18. package/build/color-palette/index.native.js.map +1 -1
  19. package/build/color-picker/component.js.map +1 -1
  20. package/build/color-picker/hex-input.js +6 -9
  21. package/build/color-picker/hex-input.js.map +1 -1
  22. package/build/confirm-dialog/component.js.map +1 -1
  23. package/build/divider/component.js.map +1 -1
  24. package/build/elevation/component.js +1 -1
  25. package/build/elevation/component.js.map +1 -1
  26. package/build/flex/flex/component.js +1 -1
  27. package/build/flex/flex/component.js.map +1 -1
  28. package/build/flex/flex-block/component.js +1 -1
  29. package/build/flex/flex-block/component.js.map +1 -1
  30. package/build/flex/flex-item/component.js +1 -1
  31. package/build/flex/flex-item/component.js.map +1 -1
  32. package/build/flyout/flyout/component.js +1 -1
  33. package/build/flyout/flyout/component.js.map +1 -1
  34. package/build/flyout/flyout-content/component.js +1 -1
  35. package/build/flyout/flyout-content/component.js.map +1 -1
  36. package/build/focal-point-picker/index.js +18 -12
  37. package/build/focal-point-picker/index.js.map +1 -1
  38. package/build/font-size-picker/index.js +0 -1
  39. package/build/font-size-picker/index.js.map +1 -1
  40. package/build/grid/component.js +1 -1
  41. package/build/grid/component.js.map +1 -1
  42. package/build/h-stack/component.js +1 -1
  43. package/build/h-stack/component.js.map +1 -1
  44. package/build/heading/component.js.map +1 -1
  45. package/build/index.js +12 -0
  46. package/build/index.js.map +1 -1
  47. package/build/index.native.js +15 -1
  48. package/build/index.native.js.map +1 -1
  49. package/build/input-control/index.js.map +1 -1
  50. package/build/input-control/input-base.js.map +1 -1
  51. package/build/input-control/input-field.js +7 -7
  52. package/build/input-control/input-field.js.map +1 -1
  53. package/build/input-control/reducer/reducer.js +3 -0
  54. package/build/input-control/reducer/reducer.js.map +1 -1
  55. package/build/item-group/item/component.js.map +1 -1
  56. package/build/item-group/item-group/component.js.map +1 -1
  57. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  58. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  59. package/build/mobile/color-settings/palette.screen.native.js +26 -9
  60. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  61. package/build/mobile/global-styles-context/utils.native.js +63 -9
  62. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  63. package/build/navigator/index.js +16 -0
  64. package/build/navigator/index.js.map +1 -1
  65. package/build/navigator/navigator-back-button/component.js +72 -0
  66. package/build/navigator/navigator-back-button/component.js.map +1 -0
  67. package/build/navigator/navigator-back-button/hook.js +49 -0
  68. package/build/navigator/navigator-back-button/hook.js.map +1 -0
  69. package/build/navigator/navigator-back-button/index.js +16 -0
  70. package/build/navigator/navigator-back-button/index.js.map +1 -0
  71. package/build/navigator/navigator-button/component.js +71 -0
  72. package/build/navigator/navigator-button/component.js.map +1 -0
  73. package/build/navigator/navigator-button/hook.js +59 -0
  74. package/build/navigator/navigator-button/hook.js.map +1 -0
  75. package/build/navigator/navigator-button/index.js +16 -0
  76. package/build/navigator/navigator-button/index.js.map +1 -0
  77. package/build/navigator/navigator-provider/component.js +11 -21
  78. package/build/navigator/navigator-provider/component.js.map +1 -1
  79. package/build/navigator/navigator-screen/component.js +14 -22
  80. package/build/navigator/navigator-screen/component.js.map +1 -1
  81. package/build/resizable-box/index.js.map +1 -1
  82. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  83. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  84. package/build/scrollable/component.js +1 -1
  85. package/build/scrollable/component.js.map +1 -1
  86. package/build/select-control/index.js.map +1 -1
  87. package/build/spacer/component.js.map +1 -1
  88. package/build/surface/component.js +1 -1
  89. package/build/surface/component.js.map +1 -1
  90. package/build/text/component.js +1 -1
  91. package/build/text/component.js.map +1 -1
  92. package/build/text-control/index.js +2 -2
  93. package/build/text-control/index.js.map +1 -1
  94. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  95. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  96. package/build/tools-panel/tools-panel/component.js.map +1 -1
  97. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  98. package/build/tools-panel/tools-panel-item/component.js.map +1 -1
  99. package/build/tree-grid/index.js +50 -6
  100. package/build/tree-grid/index.js.map +1 -1
  101. package/build/truncate/component.js +1 -1
  102. package/build/truncate/component.js.map +1 -1
  103. package/build/ui/control-group/component.js +1 -1
  104. package/build/ui/control-group/component.js.map +1 -1
  105. package/build/ui/control-label/component.js +1 -1
  106. package/build/ui/control-label/component.js.map +1 -1
  107. package/build/ui/form-group/form-group.js +1 -1
  108. package/build/ui/form-group/form-group.js.map +1 -1
  109. package/build/ui/shortcut/component.js.map +1 -1
  110. package/build/ui/spinner/component.js +1 -1
  111. package/build/ui/spinner/component.js.map +1 -1
  112. package/build/ui/tooltip/component.js +1 -1
  113. package/build/ui/tooltip/component.js.map +1 -1
  114. package/build/ui/tooltip/content.js +1 -1
  115. package/build/ui/tooltip/content.js.map +1 -1
  116. package/build/unit-control/index.js.map +1 -1
  117. package/build/v-stack/component.js +1 -1
  118. package/build/v-stack/component.js.map +1 -1
  119. package/build/visually-hidden/component.js +1 -1
  120. package/build/visually-hidden/component.js.map +1 -1
  121. package/build/z-stack/component.js.map +1 -1
  122. package/build-module/box-control/unit-control.js +1 -1
  123. package/build-module/box-control/unit-control.js.map +1 -1
  124. package/build-module/card/card/component.js +2 -2
  125. package/build-module/card/card/component.js.map +1 -1
  126. package/build-module/card/card-body/component.js +1 -1
  127. package/build-module/card/card-body/component.js.map +1 -1
  128. package/build-module/card/card-divider/component.js +1 -1
  129. package/build-module/card/card-divider/component.js.map +1 -1
  130. package/build-module/card/card-footer/component.js +1 -1
  131. package/build-module/card/card-footer/component.js.map +1 -1
  132. package/build-module/card/card-header/component.js +1 -1
  133. package/build-module/card/card-header/component.js.map +1 -1
  134. package/build-module/card/card-media/component.js +1 -1
  135. package/build-module/card/card-media/component.js.map +1 -1
  136. package/build-module/color-palette/index.native.js +36 -31
  137. package/build-module/color-palette/index.native.js.map +1 -1
  138. package/build-module/color-picker/component.js.map +1 -1
  139. package/build-module/color-picker/hex-input.js +6 -9
  140. package/build-module/color-picker/hex-input.js.map +1 -1
  141. package/build-module/confirm-dialog/component.js.map +1 -1
  142. package/build-module/divider/component.js.map +1 -1
  143. package/build-module/elevation/component.js +1 -1
  144. package/build-module/elevation/component.js.map +1 -1
  145. package/build-module/flex/flex/component.js +1 -1
  146. package/build-module/flex/flex/component.js.map +1 -1
  147. package/build-module/flex/flex-block/component.js +1 -1
  148. package/build-module/flex/flex-block/component.js.map +1 -1
  149. package/build-module/flex/flex-item/component.js +1 -1
  150. package/build-module/flex/flex-item/component.js.map +1 -1
  151. package/build-module/flyout/flyout/component.js +1 -1
  152. package/build-module/flyout/flyout/component.js.map +1 -1
  153. package/build-module/flyout/flyout-content/component.js +1 -1
  154. package/build-module/flyout/flyout-content/component.js.map +1 -1
  155. package/build-module/focal-point-picker/index.js +18 -12
  156. package/build-module/focal-point-picker/index.js.map +1 -1
  157. package/build-module/font-size-picker/index.js +0 -1
  158. package/build-module/font-size-picker/index.js.map +1 -1
  159. package/build-module/grid/component.js +1 -1
  160. package/build-module/grid/component.js.map +1 -1
  161. package/build-module/h-stack/component.js +1 -1
  162. package/build-module/h-stack/component.js.map +1 -1
  163. package/build-module/heading/component.js.map +1 -1
  164. package/build-module/index.js +1 -1
  165. package/build-module/index.js.map +1 -1
  166. package/build-module/index.native.js +1 -1
  167. package/build-module/index.native.js.map +1 -1
  168. package/build-module/input-control/index.js.map +1 -1
  169. package/build-module/input-control/input-base.js.map +1 -1
  170. package/build-module/input-control/input-field.js +6 -6
  171. package/build-module/input-control/input-field.js.map +1 -1
  172. package/build-module/input-control/reducer/reducer.js +3 -0
  173. package/build-module/input-control/reducer/reducer.js.map +1 -1
  174. package/build-module/item-group/item/component.js.map +1 -1
  175. package/build-module/item-group/item-group/component.js.map +1 -1
  176. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  177. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  178. package/build-module/mobile/color-settings/palette.screen.native.js +27 -10
  179. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  180. package/build-module/mobile/global-styles-context/utils.native.js +60 -10
  181. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  182. package/build-module/navigator/index.js +2 -0
  183. package/build-module/navigator/index.js.map +1 -1
  184. package/build-module/navigator/navigator-back-button/component.js +59 -0
  185. package/build-module/navigator/navigator-back-button/component.js.map +1 -0
  186. package/build-module/navigator/navigator-back-button/hook.js +36 -0
  187. package/build-module/navigator/navigator-back-button/hook.js.map +1 -0
  188. package/build-module/navigator/navigator-back-button/index.js +2 -0
  189. package/build-module/navigator/navigator-back-button/index.js.map +1 -0
  190. package/build-module/navigator/navigator-button/component.js +58 -0
  191. package/build-module/navigator/navigator-button/component.js.map +1 -0
  192. package/build-module/navigator/navigator-button/hook.js +46 -0
  193. package/build-module/navigator/navigator-button/hook.js.map +1 -0
  194. package/build-module/navigator/navigator-button/index.js +2 -0
  195. package/build-module/navigator/navigator-button/index.js.map +1 -0
  196. package/build-module/navigator/navigator-provider/component.js +11 -21
  197. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  198. package/build-module/navigator/navigator-screen/component.js +13 -22
  199. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  200. package/build-module/resizable-box/index.js.map +1 -1
  201. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  202. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  203. package/build-module/scrollable/component.js +1 -1
  204. package/build-module/scrollable/component.js.map +1 -1
  205. package/build-module/select-control/index.js +1 -1
  206. package/build-module/select-control/index.js.map +1 -1
  207. package/build-module/spacer/component.js.map +1 -1
  208. package/build-module/surface/component.js +1 -1
  209. package/build-module/surface/component.js.map +1 -1
  210. package/build-module/text/component.js +1 -1
  211. package/build-module/text/component.js.map +1 -1
  212. package/build-module/text-control/index.js +2 -2
  213. package/build-module/text-control/index.js.map +1 -1
  214. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  215. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  216. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  217. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  218. package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
  219. package/build-module/tree-grid/index.js +51 -7
  220. package/build-module/tree-grid/index.js.map +1 -1
  221. package/build-module/truncate/component.js +1 -1
  222. package/build-module/truncate/component.js.map +1 -1
  223. package/build-module/ui/control-group/component.js +1 -1
  224. package/build-module/ui/control-group/component.js.map +1 -1
  225. package/build-module/ui/control-label/component.js +1 -1
  226. package/build-module/ui/control-label/component.js.map +1 -1
  227. package/build-module/ui/form-group/form-group.js +1 -1
  228. package/build-module/ui/form-group/form-group.js.map +1 -1
  229. package/build-module/ui/shortcut/component.js.map +1 -1
  230. package/build-module/ui/spinner/component.js +1 -1
  231. package/build-module/ui/spinner/component.js.map +1 -1
  232. package/build-module/ui/tooltip/component.js +1 -1
  233. package/build-module/ui/tooltip/component.js.map +1 -1
  234. package/build-module/ui/tooltip/content.js +1 -1
  235. package/build-module/ui/tooltip/content.js.map +1 -1
  236. package/build-module/unit-control/index.js.map +1 -1
  237. package/build-module/v-stack/component.js +1 -1
  238. package/build-module/v-stack/component.js.map +1 -1
  239. package/build-module/visually-hidden/component.js +1 -1
  240. package/build-module/visually-hidden/component.js.map +1 -1
  241. package/build-module/z-stack/component.js.map +1 -1
  242. package/build-types/card/card-divider/hook.d.ts +0 -1
  243. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  244. package/build-types/color-picker/styles.d.ts +2 -4
  245. package/build-types/color-picker/styles.d.ts.map +1 -1
  246. package/build-types/confirm-dialog/component.d.ts +2 -6
  247. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  248. package/build-types/flyout/flyout/hook.d.ts +0 -1
  249. package/build-types/flyout/flyout/hook.d.ts.map +1 -1
  250. package/build-types/input-control/index.d.ts +3 -3
  251. package/build-types/input-control/index.d.ts.map +1 -1
  252. package/build-types/input-control/input-base.d.ts +2 -2
  253. package/build-types/input-control/input-base.d.ts.map +1 -1
  254. package/build-types/input-control/input-field.d.ts +1 -3
  255. package/build-types/input-control/input-field.d.ts.map +1 -1
  256. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  257. package/build-types/input-control/types.d.ts +1 -1
  258. package/build-types/input-control/types.d.ts.map +1 -1
  259. package/build-types/navigator/index.d.ts +2 -0
  260. package/build-types/navigator/index.d.ts.map +1 -1
  261. package/build-types/navigator/navigator-back-button/component.d.ts +38 -0
  262. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -0
  263. package/build-types/navigator/navigator-back-button/hook.d.ts +282 -0
  264. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -0
  265. package/build-types/navigator/navigator-back-button/index.d.ts +2 -0
  266. package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -0
  267. package/build-types/navigator/navigator-button/component.d.ts +37 -0
  268. package/build-types/navigator/navigator-button/component.d.ts.map +1 -0
  269. package/build-types/navigator/navigator-button/hook.d.ts +282 -0
  270. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -0
  271. package/build-types/navigator/navigator-button/index.d.ts +2 -0
  272. package/build-types/navigator/navigator-button/index.d.ts.map +1 -0
  273. package/build-types/navigator/navigator-provider/component.d.ts +10 -20
  274. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  275. package/build-types/navigator/navigator-screen/component.d.ts +10 -20
  276. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  277. package/build-types/navigator/types.d.ts +21 -0
  278. package/build-types/navigator/types.d.ts.map +1 -1
  279. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  280. package/build-types/resizable-box/index.d.ts +2 -2
  281. package/build-types/resizable-box/index.d.ts.map +1 -1
  282. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  283. package/build-types/select-control/index.d.ts +1 -3
  284. package/build-types/select-control/index.d.ts.map +1 -1
  285. package/build-types/ui/context/wordpress-component.d.ts +2 -6
  286. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  287. package/build-types/unit-control/index.d.ts +1 -3
  288. package/build-types/unit-control/index.d.ts.map +1 -1
  289. package/build-types/z-stack/component.d.ts.map +1 -1
  290. package/package.json +8 -7
  291. package/src/alignment-matrix-control/README.md +4 -0
  292. package/src/alignment-matrix-control/stories/index.js +1 -1
  293. package/src/base-control/stories/index.js +65 -22
  294. package/src/box-control/stories/index.js +4 -1
  295. package/src/box-control/unit-control.js +1 -1
  296. package/src/card/card/component.js +1 -1
  297. package/src/card/card-body/component.js +1 -1
  298. package/src/card/card-divider/component.js +1 -1
  299. package/src/card/card-footer/component.js +1 -1
  300. package/src/card/card-header/component.js +1 -1
  301. package/src/card/card-media/component.js +1 -1
  302. package/src/color-palette/index.native.js +92 -75
  303. package/src/color-palette/style.native.scss +10 -5
  304. package/src/color-picker/component.tsx +2 -2
  305. package/src/color-picker/hex-input.tsx +9 -9
  306. package/src/confirm-dialog/component.tsx +2 -2
  307. package/src/divider/component.tsx +2 -2
  308. package/src/elevation/component.js +1 -1
  309. package/src/flex/flex/component.js +1 -1
  310. package/src/flex/flex-block/component.js +1 -1
  311. package/src/flex/flex-item/component.js +1 -1
  312. package/src/flyout/flyout/component.js +1 -1
  313. package/src/flyout/flyout-content/component.js +1 -1
  314. package/src/focal-point-picker/README.md +7 -0
  315. package/src/focal-point-picker/index.js +12 -7
  316. package/src/focal-point-picker/stories/index.js +30 -0
  317. package/src/focal-point-picker/test/index.js +44 -0
  318. package/src/font-size-picker/index.js +0 -1
  319. package/src/form-file-upload/README.md +1 -1
  320. package/src/form-file-upload/stories/index.js +51 -0
  321. package/src/grid/component.js +1 -1
  322. package/src/h-stack/component.js +1 -1
  323. package/src/heading/component.tsx +2 -2
  324. package/src/index.js +2 -0
  325. package/src/index.native.js +5 -1
  326. package/src/input-control/index.tsx +2 -2
  327. package/src/input-control/input-base.tsx +2 -2
  328. package/src/input-control/input-field.tsx +4 -6
  329. package/src/input-control/reducer/reducer.ts +3 -0
  330. package/src/input-control/stories/index.js +1 -1
  331. package/src/input-control/types.ts +1 -1
  332. package/src/item-group/item/component.tsx +2 -2
  333. package/src/item-group/item-group/component.tsx +2 -2
  334. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -1
  335. package/src/mobile/color-settings/palette.screen.native.js +39 -9
  336. package/src/mobile/color-settings/style.native.scss +4 -0
  337. package/src/mobile/global-styles-context/test/fixtures/theme.native.js +27 -0
  338. package/src/mobile/global-styles-context/test/utils.native.js +2 -2
  339. package/src/mobile/global-styles-context/utils.native.js +75 -6
  340. package/src/navigation/stories/index.js +1 -1
  341. package/src/navigator/index.ts +2 -0
  342. package/src/navigator/navigator-back-button/README.md +31 -0
  343. package/src/navigator/navigator-back-button/component.tsx +62 -0
  344. package/src/navigator/navigator-back-button/hook.ts +40 -0
  345. package/src/navigator/navigator-back-button/index.ts +1 -0
  346. package/src/navigator/navigator-button/README.md +38 -0
  347. package/src/navigator/navigator-button/component.tsx +61 -0
  348. package/src/navigator/navigator-button/hook.ts +55 -0
  349. package/src/navigator/navigator-button/index.ts +1 -0
  350. package/src/navigator/navigator-provider/README.md +20 -33
  351. package/src/navigator/navigator-provider/component.tsx +12 -22
  352. package/src/navigator/navigator-screen/README.md +1 -1
  353. package/src/navigator/navigator-screen/component.tsx +14 -23
  354. package/src/navigator/stories/index.js +24 -37
  355. package/src/navigator/test/index.js +89 -34
  356. package/src/navigator/types.ts +26 -0
  357. package/src/number-control/stories/index.js +1 -1
  358. package/src/radio/stories/index.js +1 -1
  359. package/src/radio-group/stories/index.js +4 -1
  360. package/src/resizable-box/index.tsx +2 -2
  361. package/src/resizable-box/resize-tooltip/index.tsx +2 -2
  362. package/src/resizable-box/resize-tooltip/label.tsx +2 -2
  363. package/src/scrollable/component.js +1 -1
  364. package/src/select-control/index.tsx +2 -3
  365. package/src/spacer/component.tsx +2 -2
  366. package/src/surface/component.js +1 -1
  367. package/src/text/component.js +1 -1
  368. package/src/text-control/index.js +2 -2
  369. package/src/toggle-group-control/stories/index.js +1 -1
  370. package/src/toggle-group-control/toggle-group-control/component.tsx +2 -2
  371. package/src/toggle-group-control/toggle-group-control-option/component.tsx +2 -2
  372. package/src/tools-panel/stories/index.js +0 -1
  373. package/src/tools-panel/tools-panel/component.tsx +2 -2
  374. package/src/tools-panel/tools-panel-header/component.tsx +2 -2
  375. package/src/tools-panel/tools-panel-item/component.tsx +2 -2
  376. package/src/tree-grid/README.md +24 -1
  377. package/src/tree-grid/index.js +66 -7
  378. package/src/tree-grid/stories/index.js +4 -1
  379. package/src/tree-grid/test/__snapshots__/index.js.snap +1 -14
  380. package/src/tree-grid/test/index.js +226 -7
  381. package/src/truncate/component.js +1 -1
  382. package/src/ui/context/wordpress-component.ts +2 -2
  383. package/src/ui/control-group/component.js +1 -1
  384. package/src/ui/control-label/component.js +1 -1
  385. package/src/ui/form-group/form-group.js +1 -1
  386. package/src/ui/shortcut/component.tsx +2 -2
  387. package/src/ui/spinner/component.js +1 -1
  388. package/src/ui/tooltip/component.js +1 -1
  389. package/src/ui/tooltip/content.js +1 -1
  390. package/src/unit-control/index.tsx +2 -2
  391. package/src/unit-control/stories/index.js +1 -1
  392. package/src/v-stack/component.js +1 -1
  393. package/src/visually-hidden/component.js +1 -1
  394. package/src/z-stack/component.tsx +2 -2
  395. package/tsconfig.tsbuildinfo +1 -1
  396. package/src/tools-panel/stories/typography-panel.js +0 -215
@@ -7,7 +7,7 @@ import { useCardMedia } from './hook';
7
7
 
8
8
  /**
9
9
  * @param {import('../../ui/context').WordPressComponentProps<{ children: import('react').ReactNode }, 'div'>} props
10
- * @param {import('react').Ref<any>} forwardedRef
10
+ * @param {import('react').ForwardedRef<any>} forwardedRef
11
11
  */
12
12
  function CardMedia( props, forwardedRef ) {
13
13
  const cardMediaProps = useCardMedia( props );
@@ -34,6 +34,7 @@ let scrollPosition = 0;
34
34
  let customIndicatorWidth = 0;
35
35
 
36
36
  function ColorPalette( {
37
+ enableCustomColor = true,
37
38
  setColor,
38
39
  activeColor,
39
40
  isGradientColor,
@@ -46,6 +47,7 @@ function ColorPalette( {
46
47
  shouldShowCustomVerticalSeparator = true,
47
48
  customColorIndicatorStyles,
48
49
  customIndicatorWrapperStyles,
50
+ label,
49
51
  } ) {
50
52
  const customSwatchGradients = [
51
53
  'linear-gradient(120deg, rgba(255,0,0,.8) 0%, rgba(255,255,255,1) 70.71%)',
@@ -62,6 +64,7 @@ function ColorPalette( {
62
64
  const opacity = useRef( new Animated.Value( 1 ) ).current;
63
65
 
64
66
  const defaultColors = uniq( map( defaultSettings.colors, 'color' ) );
67
+ const mergedColors = uniq( map( defaultSettings.allColors, 'color' ) );
65
68
  const defaultGradientColors = uniq(
66
69
  map( defaultSettings.gradients, 'gradient' )
67
70
  );
@@ -72,6 +75,7 @@ function ColorPalette( {
72
75
  : customSwatchGradients;
73
76
  const isCustomGradientColor = isGradientColor && isSelectedCustom();
74
77
  const shouldShowCustomIndicator =
78
+ enableCustomColor &&
75
79
  shouldShowCustomIndicatorOption &&
76
80
  ( ! isGradientSegment || isCustomGradientColor );
77
81
 
@@ -92,8 +96,8 @@ function ColorPalette( {
92
96
 
93
97
  function isSelectedCustom() {
94
98
  const isWithinColors =
95
- activeColor && colors && colors.includes( activeColor );
96
- if ( activeColor ) {
99
+ activeColor && mergedColors && mergedColors.includes( activeColor );
100
+ if ( enableCustomColor && activeColor ) {
97
101
  if ( isGradientSegment ) {
98
102
  return isGradientColor && ! isWithinColors;
99
103
  }
@@ -206,93 +210,106 @@ function ColorPalette( {
206
210
  ];
207
211
 
208
212
  return (
209
- <ScrollView
210
- contentContainerStyle={ styles.contentContainer }
211
- style={ styles.container }
212
- horizontal
213
- showsHorizontalScrollIndicator={ false }
214
- keyboardShouldPersistTaps="always"
215
- disableScrollViewPanResponder
216
- scrollEventThrottle={ 16 }
217
- onScroll={ onScroll }
218
- onContentSizeChange={ onContentSizeChange }
219
- onScrollBeginDrag={ () => shouldEnableBottomSheetScroll( false ) }
220
- onScrollEndDrag={ () => shouldEnableBottomSheetScroll( true ) }
221
- ref={ scrollViewRef }
222
- testID="color-palette"
223
- >
224
- { shouldShowCustomIndicator && (
225
- <View
226
- style={ customIndicatorWrapperStyle }
227
- onLayout={ onCustomIndicatorLayout }
228
- >
229
- { shouldShowCustomVerticalSeparator && (
230
- <View style={ verticalSeparatorStyle } />
231
- ) }
232
- <TouchableWithoutFeedback
233
- onPress={ onCustomPress }
234
- accessibilityRole={ 'button' }
235
- accessibilityState={ { selected: isSelectedCustom() } }
236
- accessibilityHint={ accessibilityHint }
237
- >
238
- <View style={ customIndicatorWrapperStyle }>
239
- <ColorIndicator
240
- withCustomPicker={ ! isGradientSegment }
241
- color={ customIndicatorColor }
242
- isSelected={ isSelectedCustom() }
243
- style={ [
244
- styles.colorIndicator,
245
- customColorIndicatorStyles,
246
- ] }
247
- />
248
- { shouldShowCustomLabel && (
249
- <Text style={ customTextStyle }>
250
- { isIOS
251
- ? customText
252
- : customText.toUpperCase() }
253
- </Text>
254
- ) }
255
- </View>
256
- </TouchableWithoutFeedback>
257
- </View>
213
+ <>
214
+ { label && (
215
+ <Text accessibilityRole="header" style={ styles.headerText }>
216
+ { label }
217
+ </Text>
258
218
  ) }
259
- { colors.map( ( color ) => {
260
- const scaleValue = isSelected( color ) ? scaleInterpolation : 1;
261
- return (
262
- <View key={ `${ color }-${ isSelected( color ) }` }>
219
+
220
+ <ScrollView
221
+ contentContainerStyle={ styles.contentContainer }
222
+ horizontal
223
+ showsHorizontalScrollIndicator={ false }
224
+ keyboardShouldPersistTaps="always"
225
+ disableScrollViewPanResponder
226
+ scrollEventThrottle={ 16 }
227
+ onScroll={ onScroll }
228
+ onContentSizeChange={ onContentSizeChange }
229
+ onScrollBeginDrag={ () =>
230
+ shouldEnableBottomSheetScroll( false )
231
+ }
232
+ onScrollEndDrag={ () => shouldEnableBottomSheetScroll( true ) }
233
+ ref={ scrollViewRef }
234
+ testID={ `color-palette${ label ? '-' + label : '' }` }
235
+ >
236
+ { colors.map( ( color ) => {
237
+ const scaleValue = isSelected( color )
238
+ ? scaleInterpolation
239
+ : 1;
240
+ return (
241
+ <View key={ `${ color }-${ isSelected( color ) }` }>
242
+ <TouchableWithoutFeedback
243
+ onPress={ () => onColorPress( color ) }
244
+ accessibilityRole={ 'button' }
245
+ accessibilityState={ {
246
+ selected: isSelected( color ),
247
+ } }
248
+ accessibilityHint={ color }
249
+ testID={ color }
250
+ >
251
+ <Animated.View
252
+ style={ {
253
+ transform: [
254
+ {
255
+ scale: scaleValue,
256
+ },
257
+ ],
258
+ } }
259
+ >
260
+ <ColorIndicator
261
+ color={ color }
262
+ isSelected={ isSelected( color ) }
263
+ opacity={ opacity }
264
+ style={ [
265
+ styles.colorIndicator,
266
+ customColorIndicatorStyles,
267
+ ] }
268
+ />
269
+ </Animated.View>
270
+ </TouchableWithoutFeedback>
271
+ </View>
272
+ );
273
+ } ) }
274
+ { shouldShowCustomIndicator && (
275
+ <View
276
+ style={ customIndicatorWrapperStyle }
277
+ onLayout={ onCustomIndicatorLayout }
278
+ >
279
+ { shouldShowCustomVerticalSeparator && (
280
+ <View style={ verticalSeparatorStyle } />
281
+ ) }
263
282
  <TouchableWithoutFeedback
264
- onPress={ () => onColorPress( color ) }
283
+ onPress={ onCustomPress }
265
284
  accessibilityRole={ 'button' }
266
285
  accessibilityState={ {
267
- selected: isSelected( color ),
286
+ selected: isSelectedCustom(),
268
287
  } }
269
- accessibilityHint={ color }
270
- testID={ color }
288
+ accessibilityHint={ accessibilityHint }
271
289
  >
272
- <Animated.View
273
- style={ {
274
- transform: [
275
- {
276
- scale: scaleValue,
277
- },
278
- ],
279
- } }
280
- >
290
+ <View style={ customIndicatorWrapperStyle }>
281
291
  <ColorIndicator
282
- color={ color }
283
- isSelected={ isSelected( color ) }
284
- opacity={ opacity }
292
+ withCustomPicker={ ! isGradientSegment }
293
+ color={ customIndicatorColor }
294
+ isSelected={ isSelectedCustom() }
285
295
  style={ [
286
296
  styles.colorIndicator,
287
297
  customColorIndicatorStyles,
288
298
  ] }
289
299
  />
290
- </Animated.View>
300
+ { shouldShowCustomLabel && (
301
+ <Text style={ customTextStyle }>
302
+ { isIOS
303
+ ? customText
304
+ : customText.toUpperCase() }
305
+ </Text>
306
+ ) }
307
+ </View>
291
308
  </TouchableWithoutFeedback>
292
309
  </View>
293
- );
294
- } ) }
295
- </ScrollView>
310
+ ) }
311
+ </ScrollView>
312
+ </>
296
313
  );
297
314
  }
298
315
 
@@ -1,12 +1,8 @@
1
1
  .contentContainer {
2
- flex-direction: row-reverse;
2
+ flex-direction: row;
3
3
  padding: 0 $grid-unit-20;
4
4
  }
5
5
 
6
- .container {
7
- padding-bottom: $grid-unit-20;
8
- }
9
-
10
6
  .verticalSeparator {
11
7
  border-width: $border-width * 0.5;
12
8
  border-color: $light-gray-400;
@@ -42,3 +38,12 @@
42
38
  letter-spacing: 1.25;
43
39
  font-weight: 500;
44
40
  }
41
+
42
+ .headerText {
43
+ color: $gray;
44
+ padding-top: 8;
45
+ font-size: 14;
46
+ font-weight: 500;
47
+ padding-left: $grid-unit-20;
48
+ padding-right: $grid-unit-20;
49
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { Ref } from 'react';
4
+ import type { ForwardedRef } from 'react';
5
5
  import { colord, extend, Colord } from 'colord';
6
6
  import namesPlugin from 'colord/plugins/names';
7
7
 
@@ -54,7 +54,7 @@ const options = [
54
54
 
55
55
  const ColorPicker = (
56
56
  props: WordPressComponentProps< ColorPickerProps, 'div', false >,
57
- forwardedRef: Ref< any >
57
+ forwardedRef: ForwardedRef< any >
58
58
  ) => {
59
59
  const {
60
60
  enableAlpha = false,
@@ -24,10 +24,13 @@ interface HexInputProps {
24
24
  }
25
25
 
26
26
  export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
27
- const handleValidate = ( value: string ) => {
28
- if ( ! colord( '#' + value ).isValid() ) {
29
- throw new Error( 'Invalid hex color input' );
30
- }
27
+ const handleChange = ( nextValue: string | undefined ) => {
28
+ if ( ! nextValue ) return;
29
+ const hexValue = nextValue.startsWith( '#' )
30
+ ? nextValue
31
+ : '#' + nextValue;
32
+
33
+ onChange( colord( hexValue ) );
31
34
  };
32
35
 
33
36
  return (
@@ -43,11 +46,8 @@ export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
43
46
  </Spacer>
44
47
  }
45
48
  value={ color.toHex().slice( 1 ).toUpperCase() }
46
- onChange={ ( nextValue ) => {
47
- onChange( colord( '#' + nextValue ) );
48
- } }
49
- onValidate={ handleValidate }
50
- maxLength={ enableAlpha ? 8 : 6 }
49
+ onChange={ handleChange }
50
+ maxLength={ enableAlpha ? 9 : 7 }
51
51
  label={ __( 'Hex color' ) }
52
52
  hideLabelFromVision
53
53
  />
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { Ref, KeyboardEvent } from 'react';
4
+ import type { ForwardedRef, KeyboardEvent } from 'react';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -28,7 +28,7 @@ import { useCx } from '../utils/hooks/use-cx';
28
28
 
29
29
  function ConfirmDialog(
30
30
  props: WordPressComponentProps< OwnProps, 'div', false >,
31
- forwardedRef: Ref< any >
31
+ forwardedRef: ForwardedRef< any >
32
32
  ) {
33
33
  const {
34
34
  isOpen: isOpenProp,
@@ -3,7 +3,7 @@
3
3
  */
4
4
  // eslint-disable-next-line no-restricted-imports
5
5
  import { Separator } from 'reakit';
6
- import type { Ref } from 'react';
6
+ import type { ForwardedRef } from 'react';
7
7
 
8
8
  /**
9
9
  * Internal dependencies
@@ -18,7 +18,7 @@ import type { Props } from './types';
18
18
 
19
19
  function Divider(
20
20
  props: WordPressComponentProps< Props, 'hr', false >,
21
- forwardedRef: Ref< any >
21
+ forwardedRef: ForwardedRef< any >
22
22
  ) {
23
23
  const contextProps = useContextSystem( props, 'Divider' );
24
24
 
@@ -7,7 +7,7 @@ import { useElevation } from './hook';
7
7
 
8
8
  /**
9
9
  * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props
10
- * @param {import('react').Ref<any>} forwardedRef
10
+ * @param {import('react').ForwardedRef<any>} forwardedRef
11
11
  */
12
12
  function Elevation( props, forwardedRef ) {
13
13
  const elevationProps = useElevation( props );
@@ -8,7 +8,7 @@ import { View } from '../../view';
8
8
 
9
9
  /**
10
10
  * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexProps, 'div'>} props
11
- * @param {import('react').Ref<any>} forwardedRef
11
+ * @param {import('react').ForwardedRef<any>} forwardedRef
12
12
  */
13
13
  function Flex( props, forwardedRef ) {
14
14
  const { children, isColumn, ...otherProps } = useFlex( props );
@@ -7,7 +7,7 @@ import { useFlexBlock } from './hook';
7
7
 
8
8
  /**
9
9
  * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexBlockProps, 'div'>} props
10
- * @param {import('react').Ref<any>} forwardedRef
10
+ * @param {import('react').ForwardedRef<any>} forwardedRef
11
11
  */
12
12
  function FlexBlock( props, forwardedRef ) {
13
13
  const flexBlockProps = useFlexBlock( props );
@@ -7,7 +7,7 @@ import { useFlexItem } from './hook';
7
7
 
8
8
  /**
9
9
  * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexItemProps, 'div'>} props
10
- * @param {import('react').Ref<any>} forwardedRef
10
+ * @param {import('react').ForwardedRef<any>} forwardedRef
11
11
  */
12
12
  function FlexItem( props, forwardedRef ) {
13
13
  const flexItemProps = useFlexItem( props );
@@ -22,7 +22,7 @@ import { useFlyout } from './hook';
22
22
  /**
23
23
  *
24
24
  * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div', false>} props
25
- * @param {import('react').Ref<any>} forwardedRef
25
+ * @param {import('react').ForwardedRef<any>} forwardedRef
26
26
  */
27
27
  function Flyout( props, forwardedRef ) {
28
28
  const {
@@ -8,7 +8,7 @@ import { contextConnect, useContextSystem } from '../../ui/context';
8
8
  /**
9
9
  *
10
10
  * @param {import('../../ui/context').WordPressComponentProps<import('../types').ContentProps, 'div', false>} props
11
- * @param {import('react').Ref<any>} forwardedRef
11
+ * @param {import('react').ForwardedRef<any>} forwardedRef forwardedRef
12
12
  */
13
13
  function FlyoutContent( props, forwardedRef ) {
14
14
  const {
@@ -94,3 +94,10 @@ Callback which is called at the end of drag operations.
94
94
  - Required: No
95
95
 
96
96
  Callback which is called at the start of drag operations.
97
+
98
+ ### `resolvePoint`
99
+
100
+ - Type: `Function`
101
+ - Required: No
102
+
103
+ Function which is called before internal updates to the value state. It receives the upcoming value and may return a modified one.
@@ -49,8 +49,9 @@ export class FocalPointPicker extends Component {
49
49
  }
50
50
  };
51
51
  this.onChangeAtControls = ( value ) => {
52
- this.updateValue( value );
53
- this.props.onChange( value );
52
+ this.updateValue( value, () => {
53
+ this.props.onChange( this.state.percentages );
54
+ } );
54
55
  };
55
56
 
56
57
  this.updateBounds = this.updateBounds.bind( this );
@@ -128,15 +129,18 @@ export class FocalPointPicker extends Component {
128
129
  }
129
130
  return bounds;
130
131
  }
131
- updateValue( nextValue = {} ) {
132
- const { x, y } = nextValue;
132
+ updateValue( nextValue = {}, callback ) {
133
+ const resolvedValue =
134
+ this.props.resolvePoint?.( nextValue ) ?? nextValue;
135
+
136
+ const { x, y } = resolvedValue;
133
137
 
134
138
  const nextPercentage = {
135
139
  x: parseFloat( x ).toFixed( 2 ),
136
140
  y: parseFloat( y ).toFixed( 2 ),
137
141
  };
138
142
 
139
- this.setState( { percentages: nextPercentage } );
143
+ this.setState( { percentages: nextPercentage }, callback );
140
144
  }
141
145
  updateBounds() {
142
146
  this.setState( {
@@ -180,8 +184,9 @@ export class FocalPointPicker extends Component {
180
184
 
181
185
  next[ axis ] = roundClamp( value, 0, 1, step );
182
186
 
183
- this.updateValue( next );
184
- this.props.onChange( next );
187
+ this.updateValue( next, () => {
188
+ this.props.onChange( this.state.percentages );
189
+ } );
185
190
  }
186
191
  doDrag( event ) {
187
192
  // Prevents text-selection when dragging.
@@ -44,3 +44,33 @@ export const video = () => {
44
44
 
45
45
  return <Example url={ url } />;
46
46
  };
47
+
48
+ export const snapping = () => {
49
+ const snapValues = {
50
+ x: [ 0, 0.33, 0.66, 1 ],
51
+ y: [ 0, 0.33, 0.66, 1 ],
52
+ };
53
+
54
+ const threshold = 0.05;
55
+
56
+ const maybeSnapFocalPoint = ( value ) => {
57
+ let x = parseFloat( value.x );
58
+ let y = parseFloat( value.y );
59
+
60
+ snapValues.x.forEach( ( snapValue ) => {
61
+ if ( snapValue - threshold < x && x < snapValue + threshold ) {
62
+ x = snapValue;
63
+ }
64
+ } );
65
+
66
+ snapValues.y.forEach( ( snapValue ) => {
67
+ if ( snapValue - threshold < y && y < snapValue + threshold ) {
68
+ y = snapValue;
69
+ }
70
+ } );
71
+
72
+ return { x, y };
73
+ };
74
+
75
+ return <Example resolvePoint={ maybeSnapFocalPoint } />;
76
+ };
@@ -62,6 +62,34 @@ describe( 'FocalPointPicker', () => {
62
62
  } );
63
63
  } );
64
64
 
65
+ describe( 'resolvePoint handling', () => {
66
+ it( 'should allow value altering', async () => {
67
+ const spyChange = jest.fn();
68
+ const spy = jest.fn();
69
+ const { getByRole } = render(
70
+ <Picker
71
+ value={ { x: 0.25, y: 0.25 } }
72
+ onChange={ spyChange }
73
+ resolvePoint={ () => {
74
+ spy();
75
+ return { x: 0.91, y: 0.42 };
76
+ } }
77
+ />
78
+ );
79
+ // Click and press arrow up
80
+ const dragArea = getByRole( 'button' );
81
+ act( () => {
82
+ fireEvent.mouseDown( dragArea );
83
+ fireEvent.keyDown( dragArea, { charCode: 0, keyCode: 38 } );
84
+ } );
85
+ expect( spy ).toHaveBeenCalled();
86
+ expect( spyChange ).toHaveBeenCalledWith( {
87
+ x: '0.91',
88
+ y: '0.42',
89
+ } );
90
+ } );
91
+ } );
92
+
65
93
  describe( 'controllability', () => {
66
94
  it( 'should update value from props', () => {
67
95
  const { rerender, getByRole } = render(
@@ -71,5 +99,21 @@ describe( 'FocalPointPicker', () => {
71
99
  rerender( <Picker value={ { x: 0.93, y: 0.5 } } /> );
72
100
  expect( xInput.value ).toBe( '93' );
73
101
  } );
102
+ it( 'call onChange with the expected values', async () => {
103
+ const spyChange = jest.fn();
104
+ const { getByRole } = render(
105
+ <Picker value={ { x: 0.14, y: 0.62 } } onChange={ spyChange } />
106
+ );
107
+ // Click and press arrow up
108
+ const dragArea = getByRole( 'button' );
109
+ act( () => {
110
+ fireEvent.mouseDown( dragArea );
111
+ fireEvent.keyDown( dragArea, { charCode: 0, keyCode: 38 } );
112
+ } );
113
+ expect( spyChange ).toHaveBeenCalledWith( {
114
+ x: '0.14',
115
+ y: '0.61',
116
+ } );
117
+ } );
74
118
  } );
75
119
  } );
@@ -144,7 +144,6 @@ function FontSizePicker(
144
144
  ? __( 'Use size preset' )
145
145
  : __( 'Set custom size' )
146
146
  }
147
- showTooltip={ false }
148
147
  icon={ settings }
149
148
  onClick={ () => {
150
149
  setShowCustomValueControl(
@@ -8,7 +8,7 @@ import { FormFileUpload } from '@wordpress/components';
8
8
  const MyFormFileUpload = () => (
9
9
  <FormFileUpload
10
10
  accept="image/*"
11
- onChange={ () => console.log( 'new image' ) }
11
+ onChange={ ( event ) => console.log( event.target.files ) }
12
12
  >
13
13
  Upload
14
14
  </FormFileUpload>
@@ -0,0 +1,51 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { upload as uploadIcon } from '@wordpress/icons';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import FormFileUpload from '../';
10
+
11
+ export default {
12
+ title: 'Components/FormFileUpload',
13
+ component: FormFileUpload,
14
+ };
15
+
16
+ export const Default = FormFileUpload.bind( {} );
17
+ Default.args = {
18
+ accept: '',
19
+ children: 'Select file',
20
+ multiple: false,
21
+ };
22
+
23
+ export const RestrictFileTypes = FormFileUpload.bind( {} );
24
+ RestrictFileTypes.args = {
25
+ ...Default.args,
26
+ accept: 'image/*',
27
+ children: 'Select image',
28
+ multiple: false,
29
+ };
30
+
31
+ export const AllowMultipleFiles = FormFileUpload.bind( {} );
32
+ AllowMultipleFiles.args = {
33
+ ...Default.args,
34
+ children: 'Select files',
35
+ multiple: true,
36
+ };
37
+
38
+ export const WithIcon = FormFileUpload.bind( {} );
39
+ WithIcon.args = {
40
+ ...Default.args,
41
+ children: 'Upload',
42
+ icon: uploadIcon,
43
+ };
44
+
45
+ export const WithCustomRender = FormFileUpload.bind( {} );
46
+ WithCustomRender.args = {
47
+ ...Default.args,
48
+ render: ( { openFileDialog } ) => (
49
+ <button onClick={ openFileDialog }>Custom Upload Button</button>
50
+ ),
51
+ };
@@ -7,7 +7,7 @@ import useGrid from './hook';
7
7
 
8
8
  /**
9
9
  * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props
10
- * @param {import('react').Ref<any>} forwardedRef
10
+ * @param {import('react').ForwardedRef<any>} forwardedRef
11
11
  */
12
12
  function Grid( props, forwardedRef ) {
13
13
  const gridProps = useGrid( props );
@@ -7,7 +7,7 @@ import { useHStack } from './hook';
7
7
 
8
8
  /**
9
9
  * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props
10
- * @param {import('react').Ref<any>} forwardedRef
10
+ * @param {import('react').ForwardedRef<any>} forwardedRef
11
11
  */
12
12
  function HStack( props, forwardedRef ) {
13
13
  const hStackProps = useHStack( props );
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { Ref } from 'react';
4
+ import type { ForwardedRef } from 'react';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -12,7 +12,7 @@ import { useHeading, HeadingProps } from './hook';
12
12
 
13
13
  function Heading(
14
14
  props: WordPressComponentProps< HeadingProps, 'h1' >,
15
- forwardedRef: Ref< any >
15
+ forwardedRef: ForwardedRef< any >
16
16
  ) {
17
17
  const headerProps = useHeading( props );
18
18
 
package/src/index.js CHANGED
@@ -100,6 +100,8 @@ export { default as __experimentalNavigationMenu } from './navigation/menu';
100
100
  export {
101
101
  NavigatorProvider as __experimentalNavigatorProvider,
102
102
  NavigatorScreen as __experimentalNavigatorScreen,
103
+ NavigatorButton as __experimentalNavigatorButton,
104
+ NavigatorBackButton as __experimentalNavigatorBackButton,
103
105
  useNavigator as __experimentalUseNavigator,
104
106
  } from './navigator';
105
107
  export { default as Notice } from './notice';