@wordpress/components 19.1.2 → 19.2.1-next.33ec3857e2.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 (418) hide show
  1. package/CHANGELOG.md +53 -4
  2. package/README.md +0 -1
  3. package/build/angle-picker-control/index.js +2 -0
  4. package/build/angle-picker-control/index.js.map +1 -1
  5. package/build/button/index.native.js +13 -3
  6. package/build/button/index.native.js.map +1 -1
  7. package/build/checkbox-control/index.js +1 -1
  8. package/build/checkbox-control/index.js.map +1 -1
  9. package/build/clipboard-button/index.js +1 -2
  10. package/build/clipboard-button/index.js.map +1 -1
  11. package/build/color-palette/index.js +36 -9
  12. package/build/color-palette/index.js.map +1 -1
  13. package/build/color-picker/color-display.js +4 -2
  14. package/build/color-picker/color-display.js.map +1 -1
  15. package/build/color-picker/hex-input.js +3 -1
  16. package/build/color-picker/hex-input.js.map +1 -1
  17. package/build/color-picker/input-with-slider.js +3 -1
  18. package/build/color-picker/input-with-slider.js.map +1 -1
  19. package/build/confirm-dialog/component.js +103 -0
  20. package/build/confirm-dialog/component.js.map +1 -0
  21. package/build/confirm-dialog/index.js +16 -0
  22. package/build/confirm-dialog/index.js.map +1 -0
  23. package/build/confirm-dialog/types.js +6 -0
  24. package/build/confirm-dialog/types.js.map +1 -0
  25. package/build/custom-gradient-bar/constants.js +1 -6
  26. package/build/custom-gradient-bar/constants.js.map +1 -1
  27. package/build/custom-gradient-bar/control-points.js +52 -21
  28. package/build/custom-gradient-bar/control-points.js.map +1 -1
  29. package/build/custom-gradient-bar/index.js +5 -1
  30. package/build/custom-gradient-bar/index.js.map +1 -1
  31. package/build/custom-gradient-picker/index.js +4 -1
  32. package/build/custom-gradient-picker/index.js.map +1 -1
  33. package/build/date-time/date.js +63 -86
  34. package/build/date-time/date.js.map +1 -1
  35. package/build/date-time/utils.js +32 -0
  36. package/build/date-time/utils.js.map +1 -0
  37. package/build/divider/component.js +8 -7
  38. package/build/divider/component.js.map +1 -1
  39. package/build/divider/styles.js +38 -13
  40. package/build/divider/styles.js.map +1 -1
  41. package/build/drop-zone/index.js +14 -6
  42. package/build/drop-zone/index.js.map +1 -1
  43. package/build/drop-zone/provider.js +1 -0
  44. package/build/drop-zone/provider.js.map +1 -1
  45. package/build/flyout/styles.js +2 -2
  46. package/build/flyout/styles.js.map +1 -1
  47. package/build/focusable-iframe/index.js +1 -0
  48. package/build/focusable-iframe/index.js.map +1 -1
  49. package/build/font-size-picker/index.js +10 -9
  50. package/build/font-size-picker/index.js.map +1 -1
  51. package/build/font-size-picker/utils.js +28 -17
  52. package/build/font-size-picker/utils.js.map +1 -1
  53. package/build/gradient-picker/index.js +3 -1
  54. package/build/gradient-picker/index.js.map +1 -1
  55. package/build/higher-order/with-focus-outside/index.js +2 -0
  56. package/build/higher-order/with-focus-outside/index.js.map +1 -1
  57. package/build/index.js +8 -0
  58. package/build/index.js.map +1 -1
  59. package/build/input-control/styles/input-control-styles.js +44 -32
  60. package/build/input-control/styles/input-control-styles.js.map +1 -1
  61. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -3
  62. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  63. package/build/mobile/color-settings/index.native.js +4 -2
  64. package/build/mobile/color-settings/index.native.js.map +1 -1
  65. package/build/mobile/color-settings/palette.screen.native.js +7 -6
  66. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  67. package/build/mobile/global-styles-context/utils.native.js +1 -1
  68. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  69. package/build/mobile/gridicons/index.native.js +3 -1
  70. package/build/mobile/gridicons/index.native.js.map +1 -1
  71. package/build/mobile/link-picker/index.native.js +45 -4
  72. package/build/mobile/link-picker/index.native.js.map +1 -1
  73. package/build/mobile/link-settings/index.native.js +10 -0
  74. package/build/mobile/link-settings/index.native.js.map +1 -1
  75. package/build/modal/aria-helper.js +2 -0
  76. package/build/modal/aria-helper.js.map +1 -1
  77. package/build/modal/index.js +17 -8
  78. package/build/modal/index.js.map +1 -1
  79. package/build/palette-edit/index.js +13 -11
  80. package/build/palette-edit/index.js.map +1 -1
  81. package/build/select-control/styles/select-control-styles.js +33 -9
  82. package/build/select-control/styles/select-control-styles.js.map +1 -1
  83. package/build/style-provider/index.js +2 -0
  84. package/build/style-provider/index.js.map +1 -1
  85. package/build/toggle-group-control/toggle-group-control/component.js +7 -2
  86. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  87. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +25 -14
  88. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  89. package/build/toggle-group-control/toggle-group-control-option/styles.js +8 -8
  90. package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  91. package/build/tools-panel/styles.js +12 -10
  92. package/build/tools-panel/styles.js.map +1 -1
  93. package/build/tools-panel/tools-panel/component.js +6 -8
  94. package/build/tools-panel/tools-panel/component.js.map +1 -1
  95. package/build/tools-panel/tools-panel/hook.js +48 -17
  96. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  97. package/build/tools-panel/tools-panel-item/hook.js +5 -1
  98. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  99. package/build/unit-control/styles/unit-control-styles.js +23 -41
  100. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  101. package/build/z-stack/component.js.map +1 -1
  102. package/build/z-stack/styles.js +10 -8
  103. package/build/z-stack/styles.js.map +1 -1
  104. package/build-module/angle-picker-control/index.js +2 -0
  105. package/build-module/angle-picker-control/index.js.map +1 -1
  106. package/build-module/button/index.native.js +13 -3
  107. package/build-module/button/index.native.js.map +1 -1
  108. package/build-module/checkbox-control/index.js +1 -1
  109. package/build-module/checkbox-control/index.js.map +1 -1
  110. package/build-module/clipboard-button/index.js +1 -2
  111. package/build-module/clipboard-button/index.js.map +1 -1
  112. package/build-module/color-palette/index.js +34 -10
  113. package/build-module/color-palette/index.js.map +1 -1
  114. package/build-module/color-picker/color-display.js +3 -2
  115. package/build-module/color-picker/color-display.js.map +1 -1
  116. package/build-module/color-picker/hex-input.js +2 -1
  117. package/build-module/color-picker/hex-input.js.map +1 -1
  118. package/build-module/color-picker/input-with-slider.js +2 -1
  119. package/build-module/color-picker/input-with-slider.js.map +1 -1
  120. package/build-module/confirm-dialog/component.js +84 -0
  121. package/build-module/confirm-dialog/component.js.map +1 -0
  122. package/build-module/confirm-dialog/index.js +6 -0
  123. package/build-module/confirm-dialog/index.js.map +1 -0
  124. package/build-module/confirm-dialog/types.js +2 -0
  125. package/build-module/confirm-dialog/types.js.map +1 -0
  126. package/build-module/custom-gradient-bar/constants.js +0 -4
  127. package/build-module/custom-gradient-bar/constants.js.map +1 -1
  128. package/build-module/custom-gradient-bar/control-points.js +54 -23
  129. package/build-module/custom-gradient-bar/control-points.js.map +1 -1
  130. package/build-module/custom-gradient-bar/index.js +5 -1
  131. package/build-module/custom-gradient-bar/index.js.map +1 -1
  132. package/build-module/custom-gradient-picker/index.js +4 -1
  133. package/build-module/custom-gradient-picker/index.js.map +1 -1
  134. package/build-module/date-time/date.js +63 -87
  135. package/build-module/date-time/date.js.map +1 -1
  136. package/build-module/date-time/utils.js +20 -0
  137. package/build-module/date-time/utils.js.map +1 -0
  138. package/build-module/divider/component.js +8 -7
  139. package/build-module/divider/component.js.map +1 -1
  140. package/build-module/divider/styles.js +37 -13
  141. package/build-module/divider/styles.js.map +1 -1
  142. package/build-module/drop-zone/index.js +14 -6
  143. package/build-module/drop-zone/index.js.map +1 -1
  144. package/build-module/drop-zone/provider.js +1 -0
  145. package/build-module/drop-zone/provider.js.map +1 -1
  146. package/build-module/flyout/styles.js +2 -2
  147. package/build-module/flyout/styles.js.map +1 -1
  148. package/build-module/focusable-iframe/index.js +1 -0
  149. package/build-module/focusable-iframe/index.js.map +1 -1
  150. package/build-module/font-size-picker/index.js +10 -9
  151. package/build-module/font-size-picker/index.js.map +1 -1
  152. package/build-module/font-size-picker/utils.js +28 -17
  153. package/build-module/font-size-picker/utils.js.map +1 -1
  154. package/build-module/gradient-picker/index.js +3 -1
  155. package/build-module/gradient-picker/index.js.map +1 -1
  156. package/build-module/higher-order/with-focus-outside/index.js +1 -0
  157. package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
  158. package/build-module/index.js +1 -0
  159. package/build-module/index.js.map +1 -1
  160. package/build-module/input-control/styles/input-control-styles.js +44 -32
  161. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  162. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -4
  163. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  164. package/build-module/mobile/color-settings/index.native.js +4 -2
  165. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  166. package/build-module/mobile/color-settings/palette.screen.native.js +7 -6
  167. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  168. package/build-module/mobile/global-styles-context/utils.native.js +1 -1
  169. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  170. package/build-module/mobile/gridicons/index.native.js +1 -0
  171. package/build-module/mobile/gridicons/index.native.js.map +1 -1
  172. package/build-module/mobile/link-picker/index.native.js +50 -8
  173. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  174. package/build-module/mobile/link-settings/index.native.js +10 -0
  175. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  176. package/build-module/modal/aria-helper.js +2 -0
  177. package/build-module/modal/aria-helper.js.map +1 -1
  178. package/build-module/modal/index.js +15 -8
  179. package/build-module/modal/index.js.map +1 -1
  180. package/build-module/palette-edit/index.js +13 -11
  181. package/build-module/palette-edit/index.js.map +1 -1
  182. package/build-module/select-control/styles/select-control-styles.js +33 -9
  183. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  184. package/build-module/style-provider/index.js +1 -0
  185. package/build-module/style-provider/index.js.map +1 -1
  186. package/build-module/toggle-group-control/toggle-group-control/component.js +8 -3
  187. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  188. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +25 -14
  189. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  190. package/build-module/toggle-group-control/toggle-group-control-option/styles.js +8 -8
  191. package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  192. package/build-module/tools-panel/styles.js +12 -11
  193. package/build-module/tools-panel/styles.js.map +1 -1
  194. package/build-module/tools-panel/tools-panel/component.js +5 -8
  195. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  196. package/build-module/tools-panel/tools-panel/hook.js +48 -17
  197. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  198. package/build-module/tools-panel/tools-panel-item/hook.js +5 -1
  199. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  200. package/build-module/unit-control/styles/unit-control-styles.js +23 -41
  201. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  202. package/build-module/z-stack/component.js.map +1 -1
  203. package/build-module/z-stack/styles.js +13 -8
  204. package/build-module/z-stack/styles.js.map +1 -1
  205. package/build-style/style-rtl.css +34 -12
  206. package/build-style/style.css +34 -12
  207. package/build-types/base-field/hook.d.ts +16 -16
  208. package/build-types/card/card/hook.d.ts +16 -16
  209. package/build-types/card/card-body/hook.d.ts +16 -16
  210. package/build-types/card/card-divider/hook.d.ts +18 -18
  211. package/build-types/card/card-footer/hook.d.ts +17 -17
  212. package/build-types/card/card-header/hook.d.ts +16 -16
  213. package/build-types/card/card-media/hook.d.ts +16 -16
  214. package/build-types/divider/component.d.ts +8 -7
  215. package/build-types/divider/component.d.ts.map +1 -1
  216. package/build-types/divider/styles.d.ts +2 -2
  217. package/build-types/divider/styles.d.ts.map +1 -1
  218. package/build-types/divider/types.d.ts +5 -5
  219. package/build-types/divider/types.d.ts.map +1 -1
  220. package/build-types/elevation/hook.d.ts +15 -15
  221. package/build-types/flex/flex/hook.d.ts +16 -16
  222. package/build-types/flex/flex-block/hook.d.ts +16 -16
  223. package/build-types/flex/flex-item/hook.d.ts +16 -16
  224. package/build-types/flyout/flyout/hook.d.ts +17 -17
  225. package/build-types/flyout/styles.d.ts +7 -9
  226. package/build-types/flyout/styles.d.ts.map +1 -1
  227. package/build-types/grid/hook.d.ts +16 -16
  228. package/build-types/h-stack/hook.d.ts +16 -16
  229. package/build-types/heading/hook.d.ts +16 -16
  230. package/build-types/input-control/index.d.ts +1 -1
  231. package/build-types/input-control/index.d.ts.map +1 -1
  232. package/build-types/input-control/input-field.d.ts +1 -1
  233. package/build-types/input-control/input-field.d.ts.map +1 -1
  234. package/build-types/input-control/styles/input-control-styles.d.ts +1 -2
  235. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  236. package/build-types/input-control/types.d.ts +2 -1
  237. package/build-types/input-control/types.d.ts.map +1 -1
  238. package/build-types/item-group/item/hook.d.ts +16 -16
  239. package/build-types/item-group/item-group/hook.d.ts +16 -16
  240. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  241. package/build-types/scrollable/hook.d.ts +16 -16
  242. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  243. package/build-types/select-control/types.d.ts +1 -1
  244. package/build-types/select-control/types.d.ts.map +1 -1
  245. package/build-types/spacer/hook.d.ts +16 -16
  246. package/build-types/surface/hook.d.ts +16 -16
  247. package/build-types/text/hook.d.ts +16 -16
  248. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  249. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
  250. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
  251. package/build-types/tools-panel/styles.d.ts.map +1 -1
  252. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  253. package/build-types/tools-panel/tools-panel/hook.d.ts +16 -16
  254. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  255. package/build-types/tools-panel/tools-panel-header/hook.d.ts +16 -16
  256. package/build-types/tools-panel/tools-panel-item/hook.d.ts +16 -16
  257. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  258. package/build-types/tools-panel/types.d.ts +2 -1
  259. package/build-types/tools-panel/types.d.ts.map +1 -1
  260. package/build-types/truncate/hook.d.ts +16 -16
  261. package/build-types/ui/control-group/hook.d.ts +18 -18
  262. package/build-types/ui/control-label/hook.d.ts +16 -16
  263. package/build-types/ui/form-group/form-group.d.ts +4 -4
  264. package/build-types/ui/form-group/use-form-group.d.ts +55 -55
  265. package/build-types/unit-control/index.d.ts +1 -1
  266. package/build-types/unit-control/index.d.ts.map +1 -1
  267. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -0
  268. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  269. package/build-types/unit-control/types.d.ts +2 -2
  270. package/build-types/unit-control/types.d.ts.map +1 -1
  271. package/build-types/v-stack/hook.d.ts +16 -16
  272. package/build-types/z-stack/component.d.ts +1 -1
  273. package/build-types/z-stack/styles.d.ts.map +1 -1
  274. package/package.json +21 -23
  275. package/src/alignment-matrix-control/stories/index.js +1 -1
  276. package/src/angle-picker-control/index.js +2 -0
  277. package/src/base-control/stories/index.js +1 -1
  278. package/src/button/index.native.js +15 -1
  279. package/src/button/stories/index.js +1 -1
  280. package/src/button/style.scss +14 -0
  281. package/src/card/card/README.md +3 -3
  282. package/src/card/stories/index.js +1 -1
  283. package/src/card/test/__snapshots__/index.js.snap +6 -6
  284. package/src/checkbox-control/index.js +1 -1
  285. package/src/checkbox-control/stories/index.js +1 -1
  286. package/src/clipboard-button/index.js +1 -2
  287. package/src/color-indicator/stories/index.js +1 -1
  288. package/src/color-indicator/style.scss +5 -8
  289. package/src/color-palette/index.js +37 -9
  290. package/src/color-palette/stories/index.js +1 -1
  291. package/src/color-palette/style.scss +10 -1
  292. package/src/color-palette/test/__snapshots__/index.js.snap +30 -21
  293. package/src/color-picker/color-display.tsx +3 -2
  294. package/src/color-picker/hex-input.tsx +2 -1
  295. package/src/color-picker/input-with-slider.tsx +2 -1
  296. package/src/color-picker/stories/index.js +1 -1
  297. package/src/combobox-control/README.md +2 -2
  298. package/src/confirm-dialog/README.md +128 -0
  299. package/src/confirm-dialog/component.tsx +114 -0
  300. package/src/confirm-dialog/index.tsx +6 -0
  301. package/src/confirm-dialog/stories/index.js +120 -0
  302. package/src/confirm-dialog/test/index.js +302 -0
  303. package/src/confirm-dialog/types.ts +26 -0
  304. package/src/custom-gradient-bar/constants.js +0 -5
  305. package/src/custom-gradient-bar/control-points.js +40 -9
  306. package/src/custom-gradient-bar/index.js +8 -0
  307. package/src/custom-gradient-picker/index.js +9 -1
  308. package/src/custom-gradient-picker/style.scss +0 -4
  309. package/src/date-time/README.md +7 -0
  310. package/src/date-time/date.js +67 -84
  311. package/src/date-time/stories/index.js +1 -1
  312. package/src/date-time/stories/time.js +1 -1
  313. package/src/date-time/test/date.js +3 -29
  314. package/src/date-time/test/utils.js +32 -0
  315. package/src/date-time/utils.js +18 -0
  316. package/src/dimension-control/README.md +1 -1
  317. package/src/divider/README.md +33 -5
  318. package/src/divider/component.tsx +8 -7
  319. package/src/divider/stories/index.js +43 -17
  320. package/src/divider/styles.ts +53 -16
  321. package/src/divider/test/__snapshots__/index.js.snap +11 -11
  322. package/src/divider/test/index.js +4 -4
  323. package/src/divider/types.ts +5 -5
  324. package/src/drop-zone/index.js +14 -6
  325. package/src/drop-zone/provider.js +1 -0
  326. package/src/dropdown-menu/stories/index.js +1 -1
  327. package/src/duotone-picker/README.md +1 -1
  328. package/src/elevation/stories/index.js +1 -1
  329. package/src/external-link/stories/index.js +1 -1
  330. package/src/flyout/styles.ts +4 -2
  331. package/src/focusable-iframe/index.js +1 -0
  332. package/src/font-size-picker/index.js +27 -13
  333. package/src/font-size-picker/stories/index.js +63 -1
  334. package/src/font-size-picker/test/index.js +87 -0
  335. package/src/font-size-picker/test/util.js +74 -0
  336. package/src/font-size-picker/utils.js +31 -17
  337. package/src/form-token-field/stories/index.js +1 -1
  338. package/src/gradient-picker/index.js +4 -0
  339. package/src/gradient-picker/stories/index.js +1 -1
  340. package/src/grid/stories/index.js +1 -1
  341. package/src/guide/stories/index.js +1 -1
  342. package/src/higher-order/with-focus-outside/index.js +2 -0
  343. package/src/icon/stories/index.js +1 -1
  344. package/src/index.js +1 -0
  345. package/src/input-control/stories/index.js +2 -1
  346. package/src/input-control/styles/input-control-styles.tsx +16 -6
  347. package/src/input-control/types.ts +3 -1
  348. package/src/item-group/stories/index.js +84 -2
  349. package/src/menu-item/README.md +2 -2
  350. package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +6 -2
  351. package/src/mobile/color-settings/index.native.js +2 -0
  352. package/src/mobile/color-settings/palette.screen.native.js +8 -5
  353. package/src/mobile/color-settings/style.native.scss +1 -1
  354. package/src/mobile/global-styles-context/utils.native.js +1 -1
  355. package/src/mobile/gridicons/index.native.js +3 -3
  356. package/src/mobile/inserter-button/style.native.scss +1 -0
  357. package/src/mobile/link-picker/index.native.js +41 -7
  358. package/src/mobile/link-settings/index.native.js +11 -0
  359. package/src/mobile/link-settings/test/edit.native.js +432 -0
  360. package/src/modal/README.md +10 -0
  361. package/src/modal/aria-helper.js +2 -0
  362. package/src/modal/index.js +72 -55
  363. package/src/modal/stories/index.js +6 -1
  364. package/src/modal/style.scss +9 -0
  365. package/src/modal/test/index.js +11 -0
  366. package/src/navigation/README.md +0 -9
  367. package/src/notice/stories/index.js +1 -1
  368. package/src/number-control/stories/index.js +1 -1
  369. package/src/palette-edit/index.js +15 -16
  370. package/src/palette-edit/style.scss +5 -0
  371. package/src/panel/stories/index.js +1 -1
  372. package/src/placeholder/stories/index.js +1 -1
  373. package/src/popover/stories/index.js +1 -1
  374. package/src/query-controls/README.md +138 -6
  375. package/src/radio-group/README.md +4 -1
  376. package/src/range-control/stories/index.js +1 -1
  377. package/src/resizable-box/stories/index.js +1 -1
  378. package/src/scrollable/stories/index.js +1 -1
  379. package/src/search-control/stories/index.js +1 -1
  380. package/src/select-control/stories/index.js +2 -1
  381. package/src/select-control/styles/select-control-styles.ts +25 -2
  382. package/src/select-control/types.ts +1 -1
  383. package/src/slot-fill/stories/index.js +1 -1
  384. package/src/snackbar/stories/index.js +1 -1
  385. package/src/spacer/stories/index.js +1 -1
  386. package/src/style-provider/index.js +2 -0
  387. package/src/surface/stories/index.js +1 -1
  388. package/src/tab-panel/stories/index.js +1 -1
  389. package/src/text-control/stories/index.js +1 -1
  390. package/src/text-highlight/stories/index.js +1 -1
  391. package/src/textarea-control/stories/index.js +1 -1
  392. package/src/tip/stories/index.js +1 -1
  393. package/src/toggle-control/stories/index.js +1 -1
  394. package/src/toggle-group-control/stories/index.js +1 -1
  395. package/src/toggle-group-control/toggle-group-control/component.tsx +7 -2
  396. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +24 -9
  397. package/src/toggle-group-control/toggle-group-control-option/styles.ts +3 -0
  398. package/src/toolbar-button/stories/index.js +1 -1
  399. package/src/tools-panel/stories/index.js +237 -0
  400. package/src/tools-panel/styles.ts +41 -1
  401. package/src/tools-panel/test/index.js +234 -1
  402. package/src/tools-panel/tools-panel/README.md +9 -0
  403. package/src/tools-panel/tools-panel/component.tsx +2 -5
  404. package/src/tools-panel/tools-panel/hook.ts +50 -18
  405. package/src/tools-panel/tools-panel-item/hook.ts +5 -1
  406. package/src/tools-panel/types.ts +5 -1
  407. package/src/tooltip/stories/index.js +1 -1
  408. package/src/tree-select/stories/index.js +1 -1
  409. package/src/truncate/stories/index.js +1 -1
  410. package/src/unit-control/stories/index.js +19 -1
  411. package/src/unit-control/styles/unit-control-styles.ts +33 -46
  412. package/src/unit-control/types.ts +5 -2
  413. package/src/z-stack/README.md +1 -1
  414. package/src/z-stack/component.tsx +1 -1
  415. package/src/z-stack/stories/index.js +1 -1
  416. package/src/z-stack/styles.ts +7 -2
  417. package/tsconfig.json +6 -2
  418. package/tsconfig.tsbuildinfo +1 -1
@@ -7,6 +7,10 @@ import styled from '@emotion/styled';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { useState } from '@wordpress/element';
10
+ import {
11
+ __experimentalToggleGroupControl as ToggleGroupControl,
12
+ __experimentalToggleGroupControlOption as ToggleGroupControlOption,
13
+ } from '@wordpress/components';
10
14
 
11
15
  /**
12
16
  * Internal dependencies
@@ -81,6 +85,56 @@ export const _default = () => {
81
85
  );
82
86
  };
83
87
 
88
+ export const WithNonToolsPanelItems = () => {
89
+ const [ height, setHeight ] = useState();
90
+ const [ width, setWidth ] = useState();
91
+
92
+ const resetAll = () => {
93
+ setHeight( undefined );
94
+ setWidth( undefined );
95
+ };
96
+
97
+ return (
98
+ <PanelWrapperView>
99
+ <Panel>
100
+ <ToolsPanel
101
+ label="ToolsPanel (with non-menu items)"
102
+ resetAll={ resetAll }
103
+ >
104
+ <IntroText>
105
+ This text illustrates not all items must be wrapped in a
106
+ ToolsPanelItem and represented in the panel menu.
107
+ </IntroText>
108
+ <SingleColumnItem
109
+ hasValue={ () => !! width }
110
+ label="Width"
111
+ onDeselect={ () => setWidth( undefined ) }
112
+ isShownByDefault={ true }
113
+ >
114
+ <UnitControl
115
+ label="Width"
116
+ value={ width }
117
+ onChange={ ( next ) => setWidth( next ) }
118
+ />
119
+ </SingleColumnItem>
120
+ <SingleColumnItem
121
+ hasValue={ () => !! height }
122
+ label="Height"
123
+ onDeselect={ () => setHeight( undefined ) }
124
+ isShownByDefault={ true }
125
+ >
126
+ <UnitControl
127
+ label="Height"
128
+ value={ height }
129
+ onChange={ ( next ) => setHeight( next ) }
130
+ />
131
+ </SingleColumnItem>
132
+ </ToolsPanel>
133
+ </Panel>
134
+ </PanelWrapperView>
135
+ );
136
+ };
137
+
84
138
  export const WithOptionalItemsPlusIcon = () => {
85
139
  const [ height, setHeight ] = useState();
86
140
  const [ width, setWidth ] = useState();
@@ -215,6 +269,185 @@ export const WithSlotFillItems = () => {
215
269
  );
216
270
  };
217
271
 
272
+ export const WithConditionalDefaultControl = () => {
273
+ const [ attributes, setAttributes ] = useState( {} );
274
+ const { height, scale } = attributes;
275
+
276
+ const resetAll = ( resetFilters = [] ) => {
277
+ let newAttributes = {};
278
+
279
+ resetFilters.forEach( ( resetFilter ) => {
280
+ newAttributes = {
281
+ ...newAttributes,
282
+ ...resetFilter( newAttributes ),
283
+ };
284
+ } );
285
+
286
+ setAttributes( newAttributes );
287
+ };
288
+
289
+ const updateAttribute = ( name, value ) => {
290
+ setAttributes( {
291
+ ...attributes,
292
+ [ name ]: value,
293
+ } );
294
+ };
295
+
296
+ return (
297
+ <SlotFillProvider>
298
+ <ToolsPanelItems>
299
+ <SingleColumnItem
300
+ hasValue={ () => !! height }
301
+ label="Injected Height"
302
+ onDeselect={ () => updateAttribute( 'height', undefined ) }
303
+ resetAllFilter={ () => ( { height: undefined } ) }
304
+ panelId={ panelId }
305
+ isShownByDefault={ true }
306
+ >
307
+ <UnitControl
308
+ label="Injected Height"
309
+ value={ height }
310
+ onChange={ ( next ) =>
311
+ updateAttribute( 'height', next )
312
+ }
313
+ />
314
+ </SingleColumnItem>
315
+ <ToolsPanelItem
316
+ hasValue={ () => !! scale }
317
+ label="Scale"
318
+ onDeselect={ () => updateAttribute( 'scale', undefined ) }
319
+ resetAllFilter={ () => ( { scale: undefined } ) }
320
+ panelId={ panelId }
321
+ isShownByDefault={ !! height }
322
+ >
323
+ <ToggleGroupControl
324
+ label="Scale"
325
+ value={ scale }
326
+ onChange={ ( next ) =>
327
+ updateAttribute( 'scale', next )
328
+ }
329
+ isBlock
330
+ >
331
+ <ToggleGroupControlOption value="cover" label="Cover" />
332
+ <ToggleGroupControlOption
333
+ value="contain"
334
+ label="Contain"
335
+ />
336
+ <ToggleGroupControlOption value="fill" label="Fill" />
337
+ </ToggleGroupControl>
338
+ </ToolsPanelItem>
339
+ </ToolsPanelItems>
340
+ <PanelWrapperView>
341
+ <Panel>
342
+ <ToolsPanel
343
+ label="Tools Panel With Conditional Default via SlotFill"
344
+ resetAll={ resetAll }
345
+ panelId={ panelId }
346
+ >
347
+ <Slot />
348
+ </ToolsPanel>
349
+ </Panel>
350
+ </PanelWrapperView>
351
+ </SlotFillProvider>
352
+ );
353
+ };
354
+
355
+ export const WithConditionallyRenderedControl = () => {
356
+ const [ attributes, setAttributes ] = useState( {} );
357
+ const { height, scale } = attributes;
358
+
359
+ const resetAll = ( resetFilters = [] ) => {
360
+ let newAttributes = {};
361
+
362
+ resetFilters.forEach( ( resetFilter ) => {
363
+ newAttributes = {
364
+ ...newAttributes,
365
+ ...resetFilter( newAttributes ),
366
+ };
367
+ } );
368
+
369
+ setAttributes( newAttributes );
370
+ };
371
+
372
+ const updateAttribute = ( name, value ) => {
373
+ setAttributes( {
374
+ ...attributes,
375
+ [ name ]: value,
376
+ } );
377
+ };
378
+
379
+ return (
380
+ <SlotFillProvider>
381
+ <ToolsPanelItems>
382
+ <SingleColumnItem
383
+ hasValue={ () => !! height }
384
+ label="Injected Height"
385
+ onDeselect={ () => {
386
+ updateAttribute( 'scale', undefined );
387
+ updateAttribute( 'height', undefined );
388
+ } }
389
+ resetAllFilter={ () => ( { height: undefined } ) }
390
+ panelId={ panelId }
391
+ isShownByDefault={ true }
392
+ >
393
+ <UnitControl
394
+ label="Injected Height"
395
+ value={ height }
396
+ onChange={ ( next ) =>
397
+ updateAttribute( 'height', next )
398
+ }
399
+ />
400
+ </SingleColumnItem>
401
+ { !! height && (
402
+ <ToolsPanelItem
403
+ hasValue={ () => !! scale }
404
+ label="Scale"
405
+ onDeselect={ () =>
406
+ updateAttribute( 'scale', undefined )
407
+ }
408
+ resetAllFilter={ () => ( { scale: undefined } ) }
409
+ panelId={ panelId }
410
+ isShownByDefault={ true }
411
+ >
412
+ <ToggleGroupControl
413
+ label="Scale"
414
+ value={ scale }
415
+ onChange={ ( next ) =>
416
+ updateAttribute( 'scale', next )
417
+ }
418
+ isBlock
419
+ >
420
+ <ToggleGroupControlOption
421
+ value="cover"
422
+ label="Cover"
423
+ />
424
+ <ToggleGroupControlOption
425
+ value="contain"
426
+ label="Contain"
427
+ />
428
+ <ToggleGroupControlOption
429
+ value="fill"
430
+ label="Fill"
431
+ />
432
+ </ToggleGroupControl>
433
+ </ToolsPanelItem>
434
+ ) }
435
+ </ToolsPanelItems>
436
+ <PanelWrapperView>
437
+ <Panel>
438
+ <ToolsPanel
439
+ label="Tools Panel With Conditionally Rendered Item via SlotFill"
440
+ resetAll={ resetAll }
441
+ panelId={ panelId }
442
+ >
443
+ <Slot />
444
+ </ToolsPanel>
445
+ </Panel>
446
+ </PanelWrapperView>
447
+ </SlotFillProvider>
448
+ );
449
+ };
450
+
218
451
  export { TypographyPanel } from './typography-panel';
219
452
 
220
453
  const PanelWrapperView = styled.div`
@@ -229,3 +462,7 @@ const PanelWrapperView = styled.div`
229
462
  const SingleColumnItem = styled( ToolsPanelItem )`
230
463
  grid-column: span 1;
231
464
  `;
465
+
466
+ const IntroText = styled.div`
467
+ grid-column: span 2;
468
+ `;
@@ -8,8 +8,11 @@ import { css } from '@emotion/react';
8
8
  */
9
9
  import {
10
10
  StyledField as BaseControlField,
11
+ StyledHelp as BaseControlHelp,
12
+ StyledLabel as BaseControlLabel,
11
13
  Wrapper as BaseControlWrapper,
12
14
  } from '../base-control/styles/base-control-styles';
15
+ import { LabelWrapper } from '../input-control/styles/input-control-styles';
13
16
  import { COLORS, CONFIG } from '../utils';
14
17
  import { space } from '../ui/utils/space';
15
18
 
@@ -69,6 +72,7 @@ export const ToolsPanelHeader = css`
69
72
  */
70
73
  .components-dropdown-menu {
71
74
  margin: ${ space( -1 ) } 0;
75
+ line-height: 0;
72
76
  }
73
77
  &&&& .components-dropdown-menu__toggle {
74
78
  padding: 0;
@@ -103,10 +107,46 @@ export const ToolsPanelItem = css`
103
107
  && ${ BaseControlWrapper } {
104
108
  margin-bottom: 0;
105
109
 
106
- ${ BaseControlField } {
110
+ /**
111
+ * To maintain proper spacing within a base control, the field's bottom
112
+ * margin should only be removed when there is no help text included and
113
+ * it is therefore the last-child.
114
+ */
115
+ ${ BaseControlField }:last-child {
107
116
  margin-bottom: 0;
108
117
  }
109
118
  }
119
+
120
+ ${ BaseControlHelp } {
121
+ margin-bottom: 0;
122
+ }
123
+
124
+ /**
125
+ * Standardize InputControl and BaseControl labels with other labels when
126
+ * inside ToolsPanel.
127
+ *
128
+ * This is a temporary fix until the different control components have their
129
+ * labels normalized.
130
+ */
131
+ && ${ LabelWrapper } {
132
+ label {
133
+ margin-bottom: ${ space( 2 ) };
134
+ padding-bottom: 0;
135
+ line-height: 1.4em;
136
+ }
137
+ }
138
+
139
+ /**
140
+ * The targeting of .components-custom-select-control__label here is a
141
+ * temporary measure only.
142
+ *
143
+ * It should be replaced once CustomSelectControl component has been
144
+ * refactored and can be targeted via component interpolation.
145
+ */
146
+ .components-custom-select-control__label,
147
+ ${ BaseControlLabel } {
148
+ line-height: 1.4em;
149
+ }
110
150
  `;
111
151
 
112
152
  export const ToolsPanelItemPlaceholder = css`
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { render, screen, fireEvent } from '@testing-library/react';
4
+ import { render, screen, fireEvent, within } from '@testing-library/react';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -168,6 +168,7 @@ const selectMenuItem = async ( label ) => {
168
168
  describe( 'ToolsPanel', () => {
169
169
  afterEach( () => {
170
170
  controlProps.attributes.value = true;
171
+ altControlProps.attributes.value = false;
171
172
  } );
172
173
 
173
174
  describe( 'basic rendering', () => {
@@ -348,6 +349,238 @@ describe( 'ToolsPanel', () => {
348
349
  // there.
349
350
  expect( optionalItem ).not.toBeInTheDocument();
350
351
  } );
352
+
353
+ it( 'should render default controls with conditional isShownByDefault', async () => {
354
+ const linkedControlProps = {
355
+ attributes: { value: false },
356
+ hasValue: jest.fn().mockImplementation( () => {
357
+ return !! linkedControlProps.attributes.value;
358
+ } ),
359
+ label: 'Linked',
360
+ onDeselect: jest.fn(),
361
+ onSelect: jest.fn(),
362
+ };
363
+
364
+ const TestPanel = () => (
365
+ <ToolsPanel { ...defaultProps }>
366
+ <ToolsPanelItem
367
+ { ...altControlProps }
368
+ isShownByDefault={ true }
369
+ >
370
+ <div>Default control</div>
371
+ </ToolsPanelItem>
372
+ <ToolsPanelItem
373
+ { ...linkedControlProps }
374
+ isShownByDefault={ !! altControlProps.attributes.value }
375
+ >
376
+ <div>Linked control</div>
377
+ </ToolsPanelItem>
378
+ </ToolsPanel>
379
+ );
380
+
381
+ const { rerender } = render( <TestPanel /> );
382
+
383
+ // The linked control should start out as an optional control and is
384
+ // not rendered because it does not have a value.
385
+ let linkedItem = screen.queryByText( 'Linked control' );
386
+ expect( linkedItem ).not.toBeInTheDocument();
387
+
388
+ openDropdownMenu();
389
+
390
+ // The linked control should initially appear in the optional controls
391
+ // menu group. There should be three menu groups: default controls,
392
+ // optional controls, and the group to reset all options.
393
+ let menuGroups = screen.getAllByRole( 'group' );
394
+ expect( menuGroups.length ).toEqual( 3 );
395
+
396
+ // The linked control should be in the second group, of optional controls.
397
+ let optionalItem = within( menuGroups[ 1 ] ).getByText( 'Linked' );
398
+ expect( optionalItem ).toBeInTheDocument();
399
+
400
+ // Simulate the main control having a value set which should
401
+ // trigger the linked control becoming a default control via the
402
+ // conditional `isShownByDefault` prop.
403
+ altControlProps.attributes.value = true;
404
+
405
+ rerender( <TestPanel /> );
406
+
407
+ // The linked control should now be a default control and rendered
408
+ // despite not having a value.
409
+ linkedItem = screen.getByText( 'Linked control' );
410
+ expect( linkedItem ).toBeInTheDocument();
411
+
412
+ // The linked control should now appear in the default controls
413
+ // menu group and have been removed from the optional group.
414
+ menuGroups = screen.getAllByRole( 'group' );
415
+
416
+ // There should now only be two groups. The default controls and
417
+ // and the group for the reset all option.
418
+ expect( menuGroups.length ).toEqual( 2 );
419
+
420
+ // The new default control item for the Linked control should be
421
+ // within the first menu group.
422
+ const defaultItem = within( menuGroups[ 0 ] ).getByText( 'Linked' );
423
+ expect( defaultItem ).toBeInTheDocument();
424
+
425
+ // Optional controls have an additional aria-label. This can be used
426
+ // to confirm the conditional default control has been removed from
427
+ // the optional menu item group.
428
+ optionalItem = screen.queryByRole( 'menuitemcheckbox', {
429
+ name: 'Show Linked',
430
+ } );
431
+ expect( optionalItem ).not.toBeInTheDocument();
432
+ } );
433
+
434
+ it( 'should handle conditionally rendered default control', async () => {
435
+ const conditionalControlProps = {
436
+ attributes: { value: false },
437
+ hasValue: jest.fn().mockImplementation( () => {
438
+ return !! conditionalControlProps.attributes.value;
439
+ } ),
440
+ label: 'Conditional',
441
+ onDeselect: jest.fn(),
442
+ onSelect: jest.fn(),
443
+ };
444
+
445
+ const TestPanel = () => (
446
+ <ToolsPanel { ...defaultProps }>
447
+ <ToolsPanelItem
448
+ { ...altControlProps }
449
+ isShownByDefault={ true }
450
+ >
451
+ <div>Default control</div>
452
+ </ToolsPanelItem>
453
+ { !! altControlProps.attributes.value && (
454
+ <ToolsPanelItem
455
+ { ...conditionalControlProps }
456
+ isShownByDefault={ true }
457
+ >
458
+ <div>Conditional control</div>
459
+ </ToolsPanelItem>
460
+ ) }
461
+ </ToolsPanel>
462
+ );
463
+
464
+ const { rerender } = render( <TestPanel /> );
465
+
466
+ // The conditional control should not yet be rendered.
467
+ let conditionalItem = screen.queryByText( 'Conditional control' );
468
+ expect( conditionalItem ).not.toBeInTheDocument();
469
+
470
+ // The conditional control should not yet appear in the default controls
471
+ // menu group.
472
+ openDropdownMenu();
473
+ let menuGroups = screen.getAllByRole( 'group' );
474
+ let defaultItem = within( menuGroups[ 0 ] ).queryByText(
475
+ 'Conditional'
476
+ );
477
+ expect( defaultItem ).not.toBeInTheDocument();
478
+
479
+ // Simulate the main control having a value set which will now
480
+ // render the new default control into the ToolsPanel.
481
+ altControlProps.attributes.value = true;
482
+
483
+ rerender( <TestPanel /> );
484
+
485
+ // The conditional control should now be rendered and included in
486
+ // the panel's menu.
487
+ conditionalItem = screen.getByText( 'Conditional control' );
488
+ expect( conditionalItem ).toBeInTheDocument();
489
+
490
+ // The conditional control should now appear in the default controls
491
+ // menu group.
492
+ menuGroups = screen.getAllByRole( 'group' );
493
+
494
+ // The new default control item for the Conditional control should
495
+ // be within the first menu group.
496
+ defaultItem = within( menuGroups[ 0 ] ).getByText( 'Conditional' );
497
+ expect( defaultItem ).toBeInTheDocument();
498
+ } );
499
+ } );
500
+
501
+ describe( 'registration of panel items', () => {
502
+ it( 'should register and deregister items when panelId changes', () => {
503
+ // This test simulates switching block selection, which causes the
504
+ // `ToolsPanel` to rerender with a new panelId, necessitating the
505
+ // registration and deregistration of appropriate `ToolsPanelItem`
506
+ // children.
507
+ //
508
+ // When the `panelId` changes, only items matching the new ID register
509
+ // themselves, while those for the old panelId deregister.
510
+ //
511
+ // See: https://github.com/WordPress/gutenberg/pull/36588
512
+
513
+ const noop = () => undefined;
514
+ const context = {
515
+ panelId: '1234',
516
+ menuItems: {
517
+ default: {},
518
+ optional: { [ altControlProps.label ]: true },
519
+ },
520
+ hasMenuItems: false,
521
+ isResetting: false,
522
+ shouldRenderPlaceholderItems: false,
523
+ registerPanelItem: jest.fn(),
524
+ deregisterPanelItem: jest.fn(),
525
+ flagItemCustomization: noop,
526
+ areAllOptionalControlsHidden: true,
527
+ };
528
+
529
+ const TestPanel = () => (
530
+ <ToolsPanelContext.Provider value={ context }>
531
+ <ToolsPanelItem { ...altControlProps } panelId="1234">
532
+ <div>Item</div>
533
+ </ToolsPanelItem>
534
+ </ToolsPanelContext.Provider>
535
+ );
536
+
537
+ // On the initial render of the panel, the ToolsPanelItem should
538
+ // be registered.
539
+ const { rerender } = render( <TestPanel /> );
540
+
541
+ expect( context.registerPanelItem ).toHaveBeenCalledWith(
542
+ expect.objectContaining( {
543
+ label: altControlProps.label,
544
+ panelId: '1234',
545
+ } )
546
+ );
547
+ expect( context.deregisterPanelItem ).not.toHaveBeenCalled();
548
+
549
+ // Simulate a change in panel, e.g. a switch of block selection.
550
+ context.panelId = '4321';
551
+ context.menuItems.optional[ altControlProps.label ] = false;
552
+
553
+ // Rerender the panel item. Because we have a new panelId, this
554
+ // panelItem should NOT be registered, but it SHOULD be
555
+ // deregistered.
556
+ rerender( <TestPanel /> );
557
+
558
+ // registerPanelItem has still only been called once.
559
+ expect( context.registerPanelItem ).toHaveBeenCalledTimes( 1 );
560
+ // deregisterPanelItem is called, given that we have switched panels.
561
+ expect( context.deregisterPanelItem ).toBeCalledWith(
562
+ altControlProps.label
563
+ );
564
+
565
+ // Simulate switching back to the original panelId, e.g. by selecting
566
+ // the original block again.
567
+ context.panelId = '1234';
568
+ context.menuItems.optional[ altControlProps.label ] = true;
569
+
570
+ // Rerender the panel and ensure that the panelItem is registered
571
+ // again, and it is not de-registered.
572
+ rerender( <TestPanel /> );
573
+
574
+ expect( context.registerPanelItem ).toHaveBeenCalledWith(
575
+ expect.objectContaining( {
576
+ label: altControlProps.label,
577
+ panelId: '1234',
578
+ } )
579
+ );
580
+ expect( context.registerPanelItem ).toHaveBeenCalledTimes( 2 );
581
+ // deregisterPanelItem has still only been called once.
582
+ expect( context.deregisterPanelItem ).toHaveBeenCalledTimes( 1 );
583
+ } );
351
584
  } );
352
585
 
353
586
  describe( 'callbacks on menu item selection', () => {
@@ -25,6 +25,11 @@ displaying by default through the `isShownByDefault` prop. Determining whether a
25
25
  child has a value is done via the `hasValue` function provided through the
26
26
  child's props.
27
27
 
28
+ Components that are not wrapped within a `ToolsPanelItem` are still rendered
29
+ however they will not be represented within, or controlled by, the `ToolsPanel`
30
+ menu. An example scenario that benefits from this could be displaying
31
+ introduction or help text within a panel.
32
+
28
33
  ## Usage
29
34
 
30
35
  ```jsx
@@ -51,6 +56,10 @@ export function DimensionPanel( props ) {
51
56
 
52
57
  return (
53
58
  <ToolsPanel label={ __( 'Dimensions' ) } resetAll={ resetAll }>
59
+ <p>
60
+ Select dimensions or spacing related settings from the menu for
61
+ additional controls.
62
+ </p>
54
63
  { ! isPaddingDisabled && (
55
64
  <ToolsPanelItem
56
65
  hasValue={ () => hasPaddingValue( props ) }
@@ -24,14 +24,11 @@ const ToolsPanel = (
24
24
  panelContext,
25
25
  resetAllItems,
26
26
  toggleItem,
27
- className,
27
+ ...toolsPanelProps
28
28
  } = useToolsPanel( props );
29
29
 
30
- // Props are not directly passed through to avoid exposing Grid props
31
- // until agreement has been reached on how ToolsPanel layout should be
32
- // handled.
33
30
  return (
34
- <Grid columns={ 2 } className={ className } ref={ forwardedRef }>
31
+ <Grid { ...toolsPanelProps } columns={ 2 } ref={ forwardedRef }>
35
32
  <ToolsPanelContext.Provider value={ panelContext }>
36
33
  <ToolsPanelHeader
37
34
  label={ label }