@wordpress/components 23.8.0 → 24.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 (389) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/CONTRIBUTING.md +65 -1
  3. package/README.md +1 -3
  4. package/build/autocomplete/autocompleter-ui.js +0 -2
  5. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  6. package/build/autocomplete/index.js +2 -0
  7. package/build/autocomplete/index.js.map +1 -1
  8. package/build/button/index.js +2 -0
  9. package/build/button/index.js.map +1 -1
  10. package/build/card/card-media/component.js +2 -1
  11. package/build/card/card-media/component.js.map +1 -1
  12. package/build/checkbox-control/index.js +2 -2
  13. package/build/checkbox-control/index.js.map +1 -1
  14. package/build/color-palette/index.native.js +12 -0
  15. package/build/color-palette/index.native.js.map +1 -1
  16. package/build/combobox-control/index.js +7 -5
  17. package/build/combobox-control/index.js.map +1 -1
  18. package/build/combobox-control/styles.js +3 -3
  19. package/build/combobox-control/styles.js.map +1 -1
  20. package/build/custom-gradient-picker/index.native.js +3 -1
  21. package/build/custom-gradient-picker/index.native.js.map +1 -1
  22. package/build/dimension-control/index.js +1 -1
  23. package/build/dimension-control/index.js.map +1 -1
  24. package/build/draggable/index.js +8 -8
  25. package/build/draggable/index.js.map +1 -1
  26. package/build/form-token-field/index.js +5 -3
  27. package/build/form-token-field/index.js.map +1 -1
  28. package/build/form-token-field/styles.js +3 -3
  29. package/build/form-token-field/styles.js.map +1 -1
  30. package/build/index.js.map +1 -1
  31. package/build/mobile/bottom-sheet/cell.native.js +6 -6
  32. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  33. package/build/mobile/color-settings/palette.screen.native.js +0 -8
  34. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  35. package/build/mobile/global-styles-context/index.native.js +13 -1
  36. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  37. package/build/mobile/global-styles-context/utils.native.js +21 -4
  38. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  39. package/build/mobile/link-picker/link-picker-results.native.js +3 -1
  40. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  41. package/build/mobile/segmented-control/index.native.js +4 -2
  42. package/build/mobile/segmented-control/index.native.js.map +1 -1
  43. package/build/modal/index.js +2 -1
  44. package/build/modal/index.js.map +1 -1
  45. package/build/navigable-container/container.js +39 -19
  46. package/build/navigable-container/container.js.map +1 -1
  47. package/build/navigable-container/index.js.map +1 -1
  48. package/build/navigable-container/menu.js +37 -5
  49. package/build/navigable-container/menu.js.map +1 -1
  50. package/build/navigable-container/tabbable.js +45 -4
  51. package/build/navigable-container/tabbable.js.map +1 -1
  52. package/build/navigable-container/types.js +6 -0
  53. package/build/navigable-container/types.js.map +1 -0
  54. package/build/navigator/navigator-screen/component.js +1 -1
  55. package/build/navigator/navigator-screen/component.js.map +1 -1
  56. package/build/palette-edit/index.js +34 -12
  57. package/build/palette-edit/index.js.map +1 -1
  58. package/build/popover/index.js +1 -8
  59. package/build/popover/index.js.map +1 -1
  60. package/build/private-apis.js +4 -1
  61. package/build/private-apis.js.map +1 -1
  62. package/build/sandbox/index.native.js +10 -3
  63. package/build/sandbox/index.native.js.map +1 -1
  64. package/build/slot-fill/bubbles-virtually/fill.js +2 -1
  65. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  66. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +45 -35
  67. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  68. package/build/slot-fill/bubbles-virtually/use-slot.js +11 -26
  69. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  70. package/build/slot-fill/fill.js +7 -31
  71. package/build/slot-fill/fill.js.map +1 -1
  72. package/build/slot-fill/index.js +20 -7
  73. package/build/slot-fill/index.js.map +1 -1
  74. package/build/slot-fill/provider.js +0 -6
  75. package/build/slot-fill/provider.js.map +1 -1
  76. package/build/slot-fill/slot.js +0 -5
  77. package/build/slot-fill/slot.js.map +1 -1
  78. package/build/spinner/styles.js +4 -4
  79. package/build/spinner/styles.js.map +1 -1
  80. package/build/tab-panel/index.js.map +1 -1
  81. package/build/theme/color-algorithms.js +1 -1
  82. package/build/theme/color-algorithms.js.map +1 -1
  83. package/build/toolbar/toolbar-button/index.js +1 -2
  84. package/build/toolbar/toolbar-button/index.js.map +1 -1
  85. package/build/toolbar/toolbar-item/index.js +4 -2
  86. package/build/toolbar/toolbar-item/index.js.map +1 -1
  87. package/build/tree-grid/index.js +3 -3
  88. package/build/tree-grid/index.js.map +1 -1
  89. package/build/utils/colors-values.js +3 -3
  90. package/build/utils/colors-values.js.map +1 -1
  91. package/build/utils/use-deprecated-props.js +35 -0
  92. package/build/utils/use-deprecated-props.js.map +1 -0
  93. package/build/view/component.js +1 -2
  94. package/build/view/component.js.map +1 -1
  95. package/build-module/autocomplete/autocompleter-ui.js +1 -3
  96. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  97. package/build-module/autocomplete/index.js +3 -3
  98. package/build-module/autocomplete/index.js.map +1 -1
  99. package/build-module/button/index.js +2 -0
  100. package/build-module/button/index.js.map +1 -1
  101. package/build-module/card/card-media/component.js +2 -1
  102. package/build-module/card/card-media/component.js.map +1 -1
  103. package/build-module/checkbox-control/index.js +2 -2
  104. package/build-module/checkbox-control/index.js.map +1 -1
  105. package/build-module/color-palette/index.native.js +13 -1
  106. package/build-module/color-palette/index.native.js.map +1 -1
  107. package/build-module/combobox-control/index.js +6 -5
  108. package/build-module/combobox-control/index.js.map +1 -1
  109. package/build-module/combobox-control/styles.js +3 -3
  110. package/build-module/combobox-control/styles.js.map +1 -1
  111. package/build-module/custom-gradient-picker/index.native.js +3 -1
  112. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  113. package/build-module/dimension-control/index.js +1 -1
  114. package/build-module/dimension-control/index.js.map +1 -1
  115. package/build-module/draggable/index.js +8 -8
  116. package/build-module/draggable/index.js.map +1 -1
  117. package/build-module/form-token-field/index.js +4 -3
  118. package/build-module/form-token-field/index.js.map +1 -1
  119. package/build-module/form-token-field/styles.js +3 -3
  120. package/build-module/form-token-field/styles.js.map +1 -1
  121. package/build-module/index.js.map +1 -1
  122. package/build-module/mobile/bottom-sheet/cell.native.js +6 -5
  123. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  124. package/build-module/mobile/color-settings/palette.screen.native.js +0 -8
  125. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  126. package/build-module/mobile/global-styles-context/index.native.js +13 -1
  127. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  128. package/build-module/mobile/global-styles-context/utils.native.js +21 -3
  129. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  130. package/build-module/mobile/link-picker/link-picker-results.native.js +3 -1
  131. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  132. package/build-module/mobile/segmented-control/index.native.js +4 -2
  133. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  134. package/build-module/modal/index.js +2 -1
  135. package/build-module/modal/index.js.map +1 -1
  136. package/build-module/navigable-container/container.js +43 -19
  137. package/build-module/navigable-container/container.js.map +1 -1
  138. package/build-module/navigable-container/index.js +0 -2
  139. package/build-module/navigable-container/index.js.map +1 -1
  140. package/build-module/navigable-container/menu.js +36 -4
  141. package/build-module/navigable-container/menu.js.map +1 -1
  142. package/build-module/navigable-container/tabbable.js +44 -3
  143. package/build-module/navigable-container/tabbable.js.map +1 -1
  144. package/build-module/navigable-container/types.js +2 -0
  145. package/build-module/navigable-container/types.js.map +1 -0
  146. package/build-module/navigator/navigator-screen/component.js +1 -1
  147. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  148. package/build-module/palette-edit/index.js +34 -13
  149. package/build-module/palette-edit/index.js.map +1 -1
  150. package/build-module/popover/index.js +1 -8
  151. package/build-module/popover/index.js.map +1 -1
  152. package/build-module/private-apis.js +3 -1
  153. package/build-module/private-apis.js.map +1 -1
  154. package/build-module/sandbox/index.native.js +10 -3
  155. package/build-module/sandbox/index.native.js.map +1 -1
  156. package/build-module/slot-fill/bubbles-virtually/fill.js +2 -1
  157. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  158. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +46 -36
  159. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  160. package/build-module/slot-fill/bubbles-virtually/use-slot.js +12 -27
  161. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  162. package/build-module/slot-fill/fill.js +7 -31
  163. package/build-module/slot-fill/fill.js.map +1 -1
  164. package/build-module/slot-fill/index.js +17 -8
  165. package/build-module/slot-fill/index.js.map +1 -1
  166. package/build-module/slot-fill/provider.js +0 -6
  167. package/build-module/slot-fill/provider.js.map +1 -1
  168. package/build-module/slot-fill/slot.js +0 -5
  169. package/build-module/slot-fill/slot.js.map +1 -1
  170. package/build-module/spinner/styles.js +4 -4
  171. package/build-module/spinner/styles.js.map +1 -1
  172. package/build-module/tab-panel/index.js.map +1 -1
  173. package/build-module/theme/color-algorithms.js +1 -1
  174. package/build-module/theme/color-algorithms.js.map +1 -1
  175. package/build-module/toolbar/toolbar-button/index.js +1 -2
  176. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  177. package/build-module/toolbar/toolbar-item/index.js +5 -2
  178. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  179. package/build-module/tree-grid/index.js +3 -3
  180. package/build-module/tree-grid/index.js.map +1 -1
  181. package/build-module/utils/colors-values.js +3 -3
  182. package/build-module/utils/colors-values.js.map +1 -1
  183. package/build-module/utils/use-deprecated-props.js +25 -0
  184. package/build-module/utils/use-deprecated-props.js.map +1 -0
  185. package/build-module/view/component.js +1 -2
  186. package/build-module/view/component.js.map +1 -1
  187. package/build-style/style-rtl.css +83 -70
  188. package/build-style/style.css +83 -70
  189. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  190. package/build-types/autocomplete/index.d.ts.map +1 -1
  191. package/build-types/autocomplete/types.d.ts +2 -18
  192. package/build-types/autocomplete/types.d.ts.map +1 -1
  193. package/build-types/box-control/styles/box-control-styles.d.ts +1 -1
  194. package/build-types/button/deprecated.d.ts +12 -6
  195. package/build-types/button/deprecated.d.ts.map +1 -1
  196. package/build-types/button/index.d.ts.map +1 -1
  197. package/build-types/button/types.d.ts +7 -0
  198. package/build-types/button/types.d.ts.map +1 -1
  199. package/build-types/card/card-media/component.d.ts +2 -1
  200. package/build-types/card/card-media/component.d.ts.map +1 -1
  201. package/build-types/card/stories/index.d.ts +21 -1
  202. package/build-types/card/stories/index.d.ts.map +1 -1
  203. package/build-types/checkbox-control/index.d.ts.map +1 -1
  204. package/build-types/color-palette/styles.d.ts +1 -1
  205. package/build-types/color-picker/styles.d.ts +3 -3
  206. package/build-types/combobox-control/index.d.ts +1 -1
  207. package/build-types/combobox-control/index.d.ts.map +1 -1
  208. package/build-types/combobox-control/stories/index.d.ts.map +1 -1
  209. package/build-types/combobox-control/styles.d.ts +1 -1
  210. package/build-types/combobox-control/types.d.ts +8 -1
  211. package/build-types/combobox-control/types.d.ts.map +1 -1
  212. package/build-types/date-time/date/styles.d.ts +1 -1
  213. package/build-types/date-time/time/styles.d.ts +4 -4
  214. package/build-types/dimension-control/index.d.ts +1 -1
  215. package/build-types/draggable/index.d.ts +1 -1
  216. package/build-types/draggable/index.d.ts.map +1 -1
  217. package/build-types/draggable/stories/index.d.ts +8 -0
  218. package/build-types/draggable/stories/index.d.ts.map +1 -1
  219. package/build-types/draggable/types.d.ts +7 -0
  220. package/build-types/draggable/types.d.ts.map +1 -1
  221. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  222. package/build-types/form-token-field/index.d.ts.map +1 -1
  223. package/build-types/form-token-field/styles.d.ts +1 -1
  224. package/build-types/form-token-field/types.d.ts +8 -1
  225. package/build-types/form-token-field/types.d.ts.map +1 -1
  226. package/build-types/index.d.ts +1 -0
  227. package/build-types/index.d.ts.map +1 -1
  228. package/build-types/modal/index.d.ts.map +1 -1
  229. package/build-types/navigable-container/container.d.ts +20 -1
  230. package/build-types/navigable-container/container.d.ts.map +1 -1
  231. package/build-types/navigable-container/index.d.ts +5 -2
  232. package/build-types/navigable-container/index.d.ts.map +1 -1
  233. package/build-types/navigable-container/menu.d.ts +45 -11
  234. package/build-types/navigable-container/menu.d.ts.map +1 -1
  235. package/build-types/navigable-container/stories/navigable-menu.d.ts +12 -0
  236. package/build-types/navigable-container/stories/navigable-menu.d.ts.map +1 -0
  237. package/build-types/navigable-container/stories/tabbable-container.d.ts +12 -0
  238. package/build-types/navigable-container/stories/tabbable-container.d.ts.map +1 -0
  239. package/build-types/navigable-container/tabbable.d.ts +52 -9
  240. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  241. package/build-types/navigable-container/test/navigable-menu.d.ts +2 -0
  242. package/build-types/navigable-container/test/navigable-menu.d.ts.map +1 -0
  243. package/build-types/navigable-container/test/tababble-container.d.ts +2 -0
  244. package/build-types/navigable-container/test/tababble-container.d.ts.map +1 -0
  245. package/build-types/navigable-container/types.d.ts +61 -0
  246. package/build-types/navigable-container/types.d.ts.map +1 -0
  247. package/build-types/navigation/styles/navigation-styles.d.ts +1 -1
  248. package/build-types/navigator/navigator-back-button/component.d.ts +2 -1
  249. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  250. package/build-types/navigator/navigator-back-button/hook.d.ts +2 -1
  251. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  252. package/build-types/navigator/navigator-button/component.d.ts +2 -1
  253. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  254. package/build-types/navigator/navigator-button/hook.d.ts +2 -1
  255. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  256. package/build-types/navigator/navigator-screen/component.d.ts +1 -1
  257. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  258. package/build-types/navigator/navigator-to-parent-button/component.d.ts +2 -1
  259. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  260. package/build-types/number-control/index.d.ts +1 -1
  261. package/build-types/number-control/stories/index.d.ts +1 -1
  262. package/build-types/palette-edit/index.d.ts +1 -1
  263. package/build-types/palette-edit/index.d.ts.map +1 -1
  264. package/build-types/palette-edit/stories/index.d.ts.map +1 -1
  265. package/build-types/palette-edit/styles.d.ts +16 -10
  266. package/build-types/palette-edit/styles.d.ts.map +1 -1
  267. package/build-types/palette-edit/types.d.ts +8 -0
  268. package/build-types/palette-edit/types.d.ts.map +1 -1
  269. package/build-types/popover/index.d.ts +1 -1
  270. package/build-types/popover/index.d.ts.map +1 -1
  271. package/build-types/popover/stories/e2e/index.d.ts +1 -1
  272. package/build-types/private-apis.d.ts.map +1 -1
  273. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  274. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  275. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  276. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  277. package/build-types/slot-fill/fill.d.ts +4 -2
  278. package/build-types/slot-fill/fill.d.ts.map +1 -1
  279. package/build-types/slot-fill/index.d.ts +14 -3
  280. package/build-types/slot-fill/index.d.ts.map +1 -1
  281. package/build-types/slot-fill/provider.d.ts +0 -2
  282. package/build-types/slot-fill/provider.d.ts.map +1 -1
  283. package/build-types/slot-fill/slot.d.ts.map +1 -1
  284. package/build-types/spinner/styles.d.ts.map +1 -1
  285. package/build-types/toolbar/stories/index.d.ts.map +1 -1
  286. package/build-types/toolbar/toolbar-button/index.d.ts +12 -6
  287. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  288. package/build-types/toolbar/toolbar-item/index.d.ts +6 -4
  289. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  290. package/build-types/tree-grid/index.d.ts.map +1 -1
  291. package/build-types/tree-grid/types.d.ts +7 -0
  292. package/build-types/tree-grid/types.d.ts.map +1 -1
  293. package/build-types/ui/context/wordpress-component.d.ts +1 -1
  294. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  295. package/build-types/unit-control/index.d.ts +1 -1
  296. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  297. package/build-types/utils/use-deprecated-props.d.ts +9 -0
  298. package/build-types/utils/use-deprecated-props.d.ts.map +1 -0
  299. package/build-types/view/component.d.ts +1 -1
  300. package/build-types/view/component.d.ts.map +1 -1
  301. package/package.json +21 -22
  302. package/src/autocomplete/README.md +82 -54
  303. package/src/autocomplete/autocompleter-ui.tsx +0 -2
  304. package/src/autocomplete/index.tsx +1 -2
  305. package/src/autocomplete/types.ts +3 -19
  306. package/src/button/index.tsx +2 -0
  307. package/src/button/style.scss +13 -6
  308. package/src/button/types.ts +7 -0
  309. package/src/card/card-media/README.md +1 -1
  310. package/src/card/card-media/component.tsx +2 -1
  311. package/src/card/stories/index.tsx +47 -26
  312. package/src/checkbox-control/index.tsx +6 -2
  313. package/src/checkbox-control/style.scss +1 -4
  314. package/src/color-palette/index.native.js +20 -1
  315. package/src/color-picker/test/index.tsx +99 -99
  316. package/src/combobox-control/index.tsx +24 -18
  317. package/src/combobox-control/stories/index.tsx +0 -1
  318. package/src/combobox-control/styles.ts +4 -4
  319. package/src/combobox-control/types.ts +8 -1
  320. package/src/custom-gradient-picker/index.native.js +1 -1
  321. package/src/custom-gradient-picker/style.scss +2 -2
  322. package/src/dimension-control/README.md +1 -1
  323. package/src/dimension-control/index.tsx +1 -1
  324. package/src/draggable/README.md +8 -1
  325. package/src/draggable/index.tsx +7 -10
  326. package/src/draggable/stories/index.tsx +69 -33
  327. package/src/draggable/types.ts +7 -0
  328. package/src/form-toggle/style.scss +1 -5
  329. package/src/form-token-field/index.tsx +7 -3
  330. package/src/form-token-field/styles.ts +4 -4
  331. package/src/form-token-field/types.ts +8 -1
  332. package/src/index.ts +1 -0
  333. package/src/mobile/bottom-sheet/cell.native.js +4 -5
  334. package/src/mobile/color-settings/palette.screen.native.js +0 -7
  335. package/src/mobile/global-styles-context/index.native.js +12 -1
  336. package/src/mobile/global-styles-context/utils.native.js +18 -3
  337. package/src/mobile/link-picker/link-picker-results.native.js +3 -0
  338. package/src/mobile/segmented-control/index.native.js +2 -2
  339. package/src/modal/index.tsx +6 -1
  340. package/src/modal/style.scss +21 -13
  341. package/src/navigable-container/README.md +24 -13
  342. package/src/navigable-container/{container.js → container.tsx} +57 -27
  343. package/src/navigable-container/{index.js → index.tsx} +0 -1
  344. package/src/navigable-container/menu.tsx +100 -0
  345. package/src/navigable-container/stories/{navigable-menu.js → navigable-menu.tsx} +15 -10
  346. package/src/navigable-container/stories/{tabbable-container.js → tabbable-container.tsx} +15 -6
  347. package/src/navigable-container/tabbable.tsx +92 -0
  348. package/src/navigable-container/test/{navigable-menu.js → navigable-menu.tsx} +3 -1
  349. package/src/navigable-container/test/{tababble-container.js → tababble-container.tsx} +53 -24
  350. package/src/navigable-container/types.ts +76 -0
  351. package/src/navigator/navigator-screen/component.tsx +1 -1
  352. package/src/palette-edit/index.tsx +45 -7
  353. package/src/palette-edit/stories/index.tsx +4 -0
  354. package/src/palette-edit/types.ts +11 -0
  355. package/src/popover/index.tsx +2 -15
  356. package/src/private-apis.ts +2 -0
  357. package/src/sandbox/index.native.js +12 -1
  358. package/src/slot-fill/bubbles-virtually/fill.js +2 -1
  359. package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +46 -60
  360. package/src/slot-fill/bubbles-virtually/use-slot.js +14 -41
  361. package/src/slot-fill/fill.js +4 -26
  362. package/src/slot-fill/index.js +14 -8
  363. package/src/slot-fill/provider.js +0 -6
  364. package/src/slot-fill/slot.js +0 -5
  365. package/src/snackbar/style.scss +2 -1
  366. package/src/spinner/styles.ts +2 -0
  367. package/src/style.scss +6 -0
  368. package/src/tab-panel/index.tsx +1 -1
  369. package/src/theme/color-algorithms.ts +1 -1
  370. package/src/theme/stories/index.tsx +1 -1
  371. package/src/theme/test/color-algorithms.ts +2 -2
  372. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +4 -4
  373. package/src/toolbar/stories/index.tsx +26 -24
  374. package/src/toolbar/toolbar-button/index.tsx +10 -13
  375. package/src/toolbar/toolbar-item/{index.js → index.tsx} +12 -3
  376. package/src/tree-grid/README.md +18 -0
  377. package/src/tree-grid/index.tsx +7 -2
  378. package/src/tree-grid/types.ts +7 -0
  379. package/src/ui/context/wordpress-component.ts +1 -1
  380. package/src/utils/colors-values.js +3 -3
  381. package/src/utils/theme-variables.scss +4 -4
  382. package/src/utils/use-deprecated-props.ts +29 -0
  383. package/src/view/component.tsx +2 -2
  384. package/tsconfig.json +3 -2
  385. package/tsconfig.tsbuildinfo +1 -1
  386. package/src/CONTRIBUTING.md +0 -78
  387. package/src/README.md +0 -20
  388. package/src/navigable-container/menu.js +0 -62
  389. package/src/navigable-container/tabbable.js +0 -46
@@ -7,6 +7,7 @@ import type { DragEvent } from 'react';
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
+ import { useInstanceId } from '@wordpress/compose';
10
11
  import { useState } from '@wordpress/element';
11
12
  import { Icon, more } from '@wordpress/icons';
12
13
 
@@ -32,46 +33,68 @@ export default meta;
32
33
 
33
34
  const DefaultTemplate: ComponentStory< typeof Draggable > = ( args ) => {
34
35
  const [ isDragging, setDragging ] = useState( false );
36
+ const instanceId = useInstanceId( DefaultTemplate );
35
37
 
36
38
  // Allow for the use of ID in the example.
37
39
  return (
38
40
  <div>
39
- <p>Is Dragging? { isDragging ? 'Yes' : 'No!' }</p>
41
+ <p
42
+ style={ {
43
+ padding: '1em',
44
+ position: 'relative',
45
+ zIndex: 1000,
46
+ backgroundColor: 'whitesmoke',
47
+ } }
48
+ >
49
+ Is Dragging? { isDragging ? 'Yes' : 'No!' }
50
+ </p>
40
51
  <div
41
- /* eslint-disable no-restricted-syntax, eslint-comments/disable-enable-pair */
42
- id="draggable-example-box"
43
- style={ { display: 'inline-flex' } }
52
+ style={ {
53
+ zIndex: 100,
54
+ position: 'relative',
55
+ } }
44
56
  >
45
- <Draggable { ...args } elementId="draggable-example-box">
46
- { ( { onDraggableStart, onDraggableEnd } ) => {
47
- const handleOnDragStart = ( event: DragEvent ) => {
48
- setDragging( true );
49
- onDraggableStart( event );
50
- };
51
- const handleOnDragEnd = ( event: DragEvent ) => {
52
- setDragging( false );
53
- onDraggableEnd( event );
54
- };
55
-
56
- return (
57
- <div
58
- onDragStart={ handleOnDragStart }
59
- onDragEnd={ handleOnDragEnd }
60
- draggable
61
- style={ {
62
- alignItems: 'center',
63
- display: 'flex',
64
- justifyContent: 'center',
65
- width: 100,
66
- height: 100,
67
- background: '#ddd',
68
- } }
69
- >
70
- <Icon icon={ more } />
71
- </div>
72
- );
57
+ <div
58
+ id={ `draggable-example-box-${ instanceId }` }
59
+ style={ {
60
+ display: 'inline-flex',
61
+ position: 'relative',
73
62
  } }
74
- </Draggable>
63
+ >
64
+ <Draggable
65
+ { ...args }
66
+ elementId={ `draggable-example-box-${ instanceId }` }
67
+ >
68
+ { ( { onDraggableStart, onDraggableEnd } ) => {
69
+ const handleOnDragStart = ( event: DragEvent ) => {
70
+ setDragging( true );
71
+ onDraggableStart( event );
72
+ };
73
+ const handleOnDragEnd = ( event: DragEvent ) => {
74
+ setDragging( false );
75
+ onDraggableEnd( event );
76
+ };
77
+
78
+ return (
79
+ <div
80
+ onDragStart={ handleOnDragStart }
81
+ onDragEnd={ handleOnDragEnd }
82
+ draggable
83
+ style={ {
84
+ alignItems: 'center',
85
+ display: 'flex',
86
+ justifyContent: 'center',
87
+ width: 100,
88
+ height: 100,
89
+ background: '#ddd',
90
+ } }
91
+ >
92
+ <Icon icon={ more } />
93
+ </div>
94
+ );
95
+ } }
96
+ </Draggable>
97
+ </div>
75
98
  </div>
76
99
  </div>
77
100
  );
@@ -81,3 +104,16 @@ export const Default: ComponentStory< typeof Draggable > = DefaultTemplate.bind(
81
104
  {}
82
105
  );
83
106
  Default.args = {};
107
+
108
+ /**
109
+ * `appendToOwnerDocument` is used to append the element being dragged to the body of the owner document.
110
+ *
111
+ * This is useful when the element being dragged should not receive styles from its parent.
112
+ * For example, when the element's parent sets a `z-index` value that would cause the dragged
113
+ * element to be rendered behind other elements.
114
+ */
115
+ export const AppendElementToOwnerDocument: ComponentStory< typeof Draggable > =
116
+ DefaultTemplate.bind( {} );
117
+ AppendElementToOwnerDocument.args = {
118
+ appendToOwnerDocument: true,
119
+ };
@@ -17,6 +17,13 @@ export type DraggableProps = {
17
17
  */
18
18
  onDraggableEnd: ( event: DragEvent ) => void;
19
19
  } ) => JSX.Element | null;
20
+ /**
21
+ * Whether to append the cloned element to the `ownerDocument` body.
22
+ * By default, elements sourced by id are appended to the element's wrapper.
23
+ *
24
+ * @default false
25
+ */
26
+ appendToOwnerDocument?: boolean;
20
27
  /**
21
28
  * Classname for the cloned element.
22
29
  */
@@ -44,11 +44,7 @@ $toggle-border-width: 1px;
44
44
  }
45
45
 
46
46
  .components-form-toggle__input:focus + .components-form-toggle__track {
47
- box-shadow: 0 0 0 2px $white, 0 0 0 (2px + $border-width-focus) $components-color-accent;
48
-
49
- // Windows High Contrast mode will show this outline, but not the box-shadow.
50
- outline: 2px solid transparent;
51
- outline-offset: 2px;
47
+ @include button-style-outset__focus($components-color-accent);
52
48
  }
53
49
 
54
50
  &.is-checked {
@@ -27,6 +27,7 @@ import {
27
27
  StyledLabel,
28
28
  } from '../base-control/styles/base-control-styles';
29
29
  import { Spacer } from '../spacer';
30
+ import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
30
31
 
31
32
  const identity = ( value: string ) => value;
32
33
 
@@ -69,10 +70,13 @@ export function FormTokenField( props: FormTokenFieldProps ) {
69
70
  __experimentalExpandOnFocus = false,
70
71
  __experimentalValidateInput = () => true,
71
72
  __experimentalShowHowTo = true,
72
- __next36pxDefaultSize = false,
73
+ __next40pxDefaultSize = false,
73
74
  __experimentalAutoSelectFirstMatch = false,
74
75
  __nextHasNoMarginBottom = false,
75
- } = props;
76
+ } = useDeprecated36pxDefaultSizeProp< FormTokenFieldProps >(
77
+ props,
78
+ 'wp.components.FormTokenField'
79
+ );
76
80
 
77
81
  const instanceId = useInstanceId( FormTokenField );
78
82
 
@@ -702,7 +706,7 @@ export function FormTokenField( props: FormTokenFieldProps ) {
702
706
  align="center"
703
707
  gap={ 1 }
704
708
  wrap={ true }
705
- __next36pxDefaultSize={ __next36pxDefaultSize }
709
+ __next40pxDefaultSize={ __next40pxDefaultSize }
706
710
  hasTokens={ !! value.length }
707
711
  >
708
712
  { renderTokensAndInput() }
@@ -11,22 +11,22 @@ import { Flex } from '../flex';
11
11
  import { space } from '../ui/utils/space';
12
12
 
13
13
  type TokensAndInputWrapperProps = {
14
- __next36pxDefaultSize: boolean;
14
+ __next40pxDefaultSize: boolean;
15
15
  hasTokens: boolean;
16
16
  };
17
17
 
18
18
  const deprecatedPaddings = ( {
19
- __next36pxDefaultSize,
19
+ __next40pxDefaultSize,
20
20
  hasTokens,
21
21
  }: TokensAndInputWrapperProps ) =>
22
- ! __next36pxDefaultSize &&
22
+ ! __next40pxDefaultSize &&
23
23
  css`
24
24
  padding-top: ${ space( hasTokens ? 1 : 0.5 ) };
25
25
  padding-bottom: ${ space( hasTokens ? 1 : 0.5 ) };
26
26
  `;
27
27
 
28
28
  export const TokensAndInputWrapperFlex = styled( Flex )`
29
- padding: 5px ${ space( 1 ) };
29
+ padding: 7px;
30
30
 
31
31
  ${ deprecatedPaddings }
32
32
  `;
@@ -151,13 +151,20 @@ export interface FormTokenFieldProps
151
151
  * @default true
152
152
  */
153
153
  __experimentalShowHowTo?: boolean;
154
+ /**
155
+ * Deprecated. Use `__next40pxDefaultSize` instead.
156
+ *
157
+ * @default false
158
+ * @deprecated
159
+ */
160
+ __next36pxDefaultSize?: boolean;
154
161
  /**
155
162
  * Start opting into the larger default height that will become the
156
163
  * default size in a future version.
157
164
  *
158
165
  * @default false
159
166
  */
160
- __next36pxDefaultSize?: boolean;
167
+ __next40pxDefaultSize?: boolean;
161
168
  /**
162
169
  * If true, the select the first matching suggestion when the user presses
163
170
  * the Enter key (or space when tokenizeOnSpace is true).
package/src/index.ts CHANGED
@@ -90,6 +90,7 @@ export { default as GuidePage } from './guide/page';
90
90
  export { Heading as __experimentalHeading } from './heading';
91
91
  export { HStack as __experimentalHStack } from './h-stack';
92
92
  export { default as Icon } from './icon';
93
+ export type { IconType } from './icon';
93
94
  export { default as IconButton } from './button/deprecated';
94
95
  export {
95
96
  ItemGroup as __experimentalItemGroup,
@@ -10,7 +10,6 @@ import {
10
10
  AccessibilityInfo,
11
11
  Platform,
12
12
  } from 'react-native';
13
- import { isEmpty, get } from 'lodash';
14
13
 
15
14
  /**
16
15
  * WordPress dependencies
@@ -273,8 +272,8 @@ class BottomSheetCell extends Component {
273
272
  return accessibilityLabel || label;
274
273
  }
275
274
 
276
- if ( isEmpty( value ) ) {
277
- return isEmpty( help )
275
+ if ( ! value ) {
276
+ return ! help
278
277
  ? sprintf(
279
278
  /* translators: accessibility text. Empty state of a inline textinput cell. %s: The cell's title */
280
279
  _x( '%s. Empty', 'inline textinput cell' ),
@@ -288,7 +287,7 @@ class BottomSheetCell extends Component {
288
287
  help
289
288
  );
290
289
  }
291
- return isEmpty( help )
290
+ return ! help
292
291
  ? sprintf(
293
292
  /* translators: accessibility text. Inline textinput title and value.%1: Cell title, %2: cell value. */
294
293
  _x( '%1$s, %2$s', 'inline textinput cell' ),
@@ -323,7 +322,7 @@ class BottomSheetCell extends Component {
323
322
  const opacity =
324
323
  activeOpacity !== undefined
325
324
  ? activeOpacity
326
- : get( platformStyles, 'activeOpacity.opacity' );
325
+ : platformStyles.activeOpacity?.opacity;
327
326
 
328
327
  return (
329
328
  <TouchableRipple
@@ -78,22 +78,15 @@ const PaletteScreen = () => {
78
78
  setCurrentValue( color );
79
79
  if ( isSolidSegment && onColorChange && onGradientChange ) {
80
80
  onColorChange( color );
81
- onGradientChange( '' );
82
81
  } else if ( isSolidSegment && onColorChange ) {
83
82
  onColorChange( color );
84
83
  } else if ( ! isSolidSegment && onGradientChange ) {
85
84
  onGradientChange( color );
86
- onColorChange( '' );
87
85
  }
88
86
  };
89
87
 
90
88
  function onClear() {
91
89
  setCurrentValue( undefined );
92
- if ( isSolidSegment ) {
93
- onColorChange( '' );
94
- } else {
95
- onGradientChange( '' );
96
- }
97
90
 
98
91
  if ( onColorCleared ) {
99
92
  onColorCleared();
@@ -26,9 +26,20 @@ export const getMergedGlobalStyles = (
26
26
  blockName,
27
27
  fontSizes
28
28
  ) => {
29
+ // Current support for general styles and blocks.
29
30
  const baseGlobalColors = {
30
- baseColors: baseGlobalStyles || {},
31
+ baseColors: {
32
+ color: baseGlobalStyles?.color,
33
+ typography: baseGlobalStyles?.typography,
34
+ elements: {
35
+ link: baseGlobalStyles?.elements?.link,
36
+ },
37
+ blocks: {
38
+ 'core/button': baseGlobalStyles?.blocks?.[ 'core/button' ],
39
+ },
40
+ },
31
41
  };
42
+
32
43
  const blockStyleAttributes = Object.fromEntries(
33
44
  Object.entries( blockAttributes ?? {} ).filter( ( [ key ] ) =>
34
45
  BLOCK_STYLE_ATTRIBUTES.includes( key )
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { camelCase } from 'change-case';
5
- import { get } from 'lodash';
6
5
  import { Dimensions } from 'react-native';
7
6
 
8
7
  /**
@@ -191,6 +190,22 @@ export function getBlockTypography(
191
190
  return typographyStyles;
192
191
  }
193
192
 
193
+ /**
194
+ * Return a value from a certain path of the object.
195
+ * Path is specified as an array of properties, like: [ 'parent', 'child' ].
196
+ *
197
+ * @param {Object} object Input object.
198
+ * @param {Array} path Path to the object property.
199
+ * @return {*} Value of the object property at the specified path.
200
+ */
201
+ const getValueFromObjectPath = ( object, path ) => {
202
+ let value = object;
203
+ path.forEach( ( fieldName ) => {
204
+ value = value?.[ fieldName ];
205
+ } );
206
+ return value;
207
+ };
208
+
194
209
  export function parseStylesVariables( styles, mappedValues, customValues ) {
195
210
  let stylesBase = styles;
196
211
  const variables = [ 'preset', 'custom', 'var', 'fontSize' ];
@@ -231,11 +246,11 @@ export function parseStylesVariables( styles, mappedValues, customValues ) {
231
246
  customValuesData
232
247
  )
233
248
  ) {
234
- return get( customValuesData, path );
249
+ return getValueFromObjectPath( customValuesData, path );
235
250
  }
236
251
 
237
252
  // Check for camelcase properties.
238
- return get( customValuesData, [
253
+ return getValueFromObjectPath( customValuesData, [
239
254
  ...path.slice( 0, path.length - 1 ),
240
255
  camelCase( path[ path.length - 1 ] ),
241
256
  ] );
@@ -74,6 +74,9 @@ export default function LinkPickerResults( {
74
74
  return {
75
75
  fetchMoreSuggestions: debounce( fetchMore, REQUEST_DEBOUNCE_DELAY ),
76
76
  };
77
+ // Disable eslint rule for now, to avoid introducing a regression
78
+ // (see https://github.com/WordPress/gutenberg/pull/23922#discussion_r1170634879).
79
+ // eslint-disable-next-line react-hooks/exhaustive-deps
77
80
  }, [] );
78
81
 
79
82
  // Prevent setting state when unmounted.
@@ -140,8 +140,8 @@ const SegmentedControls = ( {
140
140
  styles.selectedDark
141
141
  );
142
142
 
143
- const width = segmentsDimensions[ activeSegmentIndex ].width;
144
- const height = segmentsDimensions[ activeSegmentIndex ].height;
143
+ const width = segmentsDimensions[ activeSegmentIndex ]?.width;
144
+ const height = segmentsDimensions[ activeSegmentIndex ]?.height;
145
145
 
146
146
  const outlineStyle = [ styles.outline, isIOS && styles.outlineIOS ];
147
147
 
@@ -252,7 +252,12 @@ function UnforwardedModal(
252
252
  ) }
253
253
  </div>
254
254
  ) }
255
- <div ref={ childrenContainerRef }>{ children }</div>
255
+ <div
256
+ ref={ childrenContainerRef }
257
+ className="components-modal__children-container"
258
+ >
259
+ { children }
260
+ </div>
256
261
  </div>
257
262
  </div>
258
263
  </StyleProvider>
@@ -16,31 +16,39 @@
16
16
  // The modal window element.
17
17
  .components-modal__frame {
18
18
  // Use the entire viewport on smaller screens.
19
- margin: 0;
19
+ margin: $grid-unit-50 0 0 0;
20
20
  width: 100%;
21
21
  background: $white;
22
22
  box-shadow: $shadow-modal;
23
- border-radius: $radius-block-ui;
23
+ border-radius: $grid-unit-10 $grid-unit-10 0 0;
24
24
  overflow: hidden;
25
25
  // Have the content element fill the vertical space yet not overflow.
26
26
  display: flex;
27
+ // Animate the modal frame/contents appearing on the page.
28
+ animation: components-modal__appear-animation 0.1s ease-out;
29
+ animation-fill-mode: forwards;
30
+ @include reduce-motion("animation");
27
31
 
28
32
  // Show a centered modal on bigger screens.
29
33
  @include break-small() {
34
+ border-radius: $grid-unit-10;
30
35
  margin: auto;
31
36
  width: auto;
32
37
  min-width: $modal-min-width;
33
38
  max-width: calc(100% - #{$grid-unit-20 * 2});
34
39
  max-height: calc(100% - #{$header-height * 2});
35
40
 
36
- // Animate the modal frame/contents appearing on the page.
37
- animation: components-modal__appear-animation 0.1s ease-out;
38
- animation-fill-mode: forwards;
39
- @include reduce-motion("animation");
40
-
41
41
  &.is-full-screen {
42
- width: 90vw;
43
- min-height: 90vh;
42
+ @include break-small() {
43
+ width: calc(100% - #{ $grid-unit-20 * 2 });
44
+ height: calc(100% - #{ $grid-unit-20 * 2 });
45
+ max-height: none;
46
+ }
47
+ @include break-medium() {
48
+ width: calc(100% - #{ $grid-unit-50 * 2 });
49
+ height: calc(100% - #{ $grid-unit-50 * 2 });
50
+ max-width: none;
51
+ }
44
52
  }
45
53
  }
46
54
 
@@ -64,12 +72,12 @@
64
72
  .components-modal__header {
65
73
  box-sizing: border-box;
66
74
  border-bottom: $border-width solid transparent;
67
- padding: 0 $grid-unit-40;
75
+ padding: $grid-unit-30 $grid-unit-40 $grid-unit-15;
68
76
  display: flex;
69
77
  flex-direction: row;
70
78
  justify-content: space-between;
71
79
  align-items: center;
72
- height: $header-height + $grid-unit-20;
80
+ height: $header-height + $grid-unit-15;
73
81
  width: 100%;
74
82
  z-index: z-index(".components-modal__header");
75
83
  position: absolute;
@@ -121,13 +129,13 @@
121
129
  // Modal contents.
122
130
  .components-modal__content {
123
131
  flex: 1;
124
- margin-top: $header-height + $grid-unit-20;
132
+ margin-top: $header-height + $grid-unit-15;
125
133
  padding: 0 $grid-unit-40 $grid-unit-40;
126
134
  overflow: auto;
127
135
 
128
136
  &.hide-header {
129
137
  margin-top: 0;
130
- padding-top: $grid-unit-30;
138
+ padding-top: $grid-unit-40;
131
139
  }
132
140
 
133
141
  &.is-scrollable:focus-visible {
@@ -2,38 +2,49 @@
2
2
 
3
3
  `NavigableContainer` is a React component to render a container navigable using the keyboard. Only things that are focusable can be navigated to. It will currently always be a `div`.
4
4
 
5
- `NavigableContainer` is exported as two classes: `NavigableMenu` and `TabbableContainer`. `NavigableContainer` itself is **not** exported. `NavigableMenu` and `TabbableContainer` have the props listed below. Any other props will be passed through to the `div`.
5
+ `NavigableContainer` is exported as two components: `NavigableMenu` and `TabbableContainer`. `NavigableContainer` itself is **not** exported. `NavigableMenu` and `TabbableContainer` have the props listed below. Any other props will be passed through to the `div`.
6
6
 
7
7
  ---
8
8
 
9
9
  ## Props
10
10
 
11
- These are the props that `NavigableMenu` and `TabbableContainer`. Any props which are specific to one class are labelled appropriately.
11
+ These are the props that `NavigableMenu` and `TabbableContainer`. Any props which are specific to one component are labelled appropriately.
12
12
 
13
- ### onNavigate
13
+ ### `cycle`: `boolean`
14
14
 
15
- A callback invoked when the menu navigates to one of its children passing the index and child as an argument
15
+ A boolean which tells the component whether or not to cycle from the end back to the beginning and vice versa.
16
16
 
17
- - Type: `Function`
18
17
  - Required: No
18
+ - default: `true`
19
19
 
20
- ### cycle
20
+ ### `eventToOffset`: `( event: KeyboardEvent ) => -1 | 0 | 1 | undefined`
21
21
 
22
- A boolean which tells the component whether or not to cycle from the end back to the beginning and vice versa.
22
+ (TabbableContainer only)
23
+ Gets an offset, given an event.
24
+
25
+ - Required: No
26
+
27
+ ### `onKeydown`: `( event: KeyboardEvent ) => void`
28
+
29
+ A callback invoked on the keydown event.
30
+
31
+ - Required: No
32
+
33
+ ### `onNavigate`: `( index: number, focusable: HTMLElement ) => void`
34
+
35
+ A callback invoked when the menu navigates to one of its children passing the index and child as an argument
23
36
 
24
- - Type: `Boolean`
25
37
  - Required: No
26
- - default: true
27
38
 
28
- ### orientation (NavigableMenu only)
39
+ ### `orientation`: `'vertical' | 'horizontal' | 'both'`
29
40
 
30
- The orientation of the menu. It could be "vertical", "horizontal" or "both"
41
+ (NavigableMenu only)
42
+ The orientation of the menu. It could be "vertical", "horizontal", or "both".
31
43
 
32
- - Type: `String`
33
44
  - Required: No
34
45
  - Default: `"vertical"`
35
46
 
36
- ## Classes
47
+ ## Components
37
48
 
38
49
  ### NavigableMenu
39
50