@wordpress/components 28.13.0 → 28.14.1-next.cd6172eb0.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 (371) hide show
  1. package/CHANGELOG.md +43 -1
  2. package/build/angle-picker-control/index.js +1 -1
  3. package/build/angle-picker-control/index.js.map +1 -1
  4. package/build/autocomplete/index.js +0 -1
  5. package/build/autocomplete/index.js.map +1 -1
  6. package/build/border-box-control/border-box-control-split-controls/component.js +1 -1
  7. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  8. package/build/border-control/border-control/component.js +2 -0
  9. package/build/border-control/border-control/component.js.map +1 -1
  10. package/build/box-control/all-input-control.js +1 -0
  11. package/build/box-control/all-input-control.js.map +1 -1
  12. package/build/box-control/axial-input-controls.js +1 -0
  13. package/build/box-control/axial-input-controls.js.map +1 -1
  14. package/build/box-control/index.js +9 -2
  15. package/build/box-control/index.js.map +1 -1
  16. package/build/box-control/input-controls.js +1 -0
  17. package/build/box-control/input-controls.js.map +1 -1
  18. package/build/box-control/types.js.map +1 -1
  19. package/build/clipboard-button/index.js +5 -3
  20. package/build/clipboard-button/index.js.map +1 -1
  21. package/build/color-palette/index.native.js +0 -1
  22. package/build/color-palette/index.native.js.map +1 -1
  23. package/build/color-picker/input-with-slider.js +2 -2
  24. package/build/color-picker/input-with-slider.js.map +1 -1
  25. package/build/composite/item.js +0 -9
  26. package/build/composite/item.js.map +1 -1
  27. package/build/context/context-connect.js +0 -1
  28. package/build/context/context-connect.js.map +1 -1
  29. package/build/custom-gradient-picker/index.js +2 -0
  30. package/build/custom-gradient-picker/index.js.map +1 -1
  31. package/build/custom-gradient-picker/types.js.map +1 -1
  32. package/build/custom-select-control/index.js +8 -0
  33. package/build/custom-select-control/index.js.map +1 -1
  34. package/build/custom-select-control/types.js.map +1 -1
  35. package/build/drop-zone/index.js +19 -13
  36. package/build/drop-zone/index.js.map +1 -1
  37. package/build/drop-zone/types.js.map +1 -1
  38. package/build/dropdown-menu/index.js +1 -0
  39. package/build/dropdown-menu/index.js.map +1 -1
  40. package/build/duotone-picker/color-list-picker/index.js +9 -14
  41. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  42. package/build/external-link/index.js +0 -1
  43. package/build/external-link/index.js.map +1 -1
  44. package/build/font-size-picker/font-size-picker-select.js +1 -0
  45. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  46. package/build/font-size-picker/index.js +1 -0
  47. package/build/font-size-picker/index.js.map +1 -1
  48. package/build/form-file-upload/index.js +11 -1
  49. package/build/form-file-upload/index.js.map +1 -1
  50. package/build/form-file-upload/types.js.map +1 -1
  51. package/build/form-token-field/index.js +6 -1
  52. package/build/form-token-field/index.js.map +1 -1
  53. package/build/gradient-picker/index.js +2 -0
  54. package/build/gradient-picker/index.js.map +1 -1
  55. package/build/gradient-picker/types.js.map +1 -1
  56. package/build/menu/checkbox-item.js +5 -9
  57. package/build/menu/checkbox-item.js.map +1 -1
  58. package/build/menu/group-label.js +4 -1
  59. package/build/menu/group-label.js.map +1 -1
  60. package/build/menu/group.js +4 -1
  61. package/build/menu/group.js.map +1 -1
  62. package/build/menu/item-help-text.js +5 -0
  63. package/build/menu/item-help-text.js.map +1 -1
  64. package/build/menu/item-label.js +5 -0
  65. package/build/menu/item-label.js.map +1 -1
  66. package/build/menu/item.js +4 -8
  67. package/build/menu/item.js.map +1 -1
  68. package/build/menu/radio-item.js +5 -9
  69. package/build/menu/radio-item.js.map +1 -1
  70. package/build/menu/separator.js +5 -2
  71. package/build/menu/separator.js.map +1 -1
  72. package/build/modal/aria-helper.js +0 -1
  73. package/build/modal/aria-helper.js.map +1 -1
  74. package/build/modal/index.js +0 -1
  75. package/build/modal/index.js.map +1 -1
  76. package/build/number-control/index.js +8 -0
  77. package/build/number-control/index.js.map +1 -1
  78. package/build/number-control/types.js.map +1 -1
  79. package/build/range-control/index.js +2 -1
  80. package/build/range-control/index.js.map +1 -1
  81. package/build/resizable-box/index.js +9 -1
  82. package/build/resizable-box/index.js.map +1 -1
  83. package/build/slot-fill/bubbles-virtually/fill.js +8 -12
  84. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  85. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +6 -10
  86. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  87. package/build/slot-fill/bubbles-virtually/slot.js +4 -10
  88. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  89. package/build/slot-fill/types.js.map +1 -1
  90. package/build/style-provider/index.js +0 -1
  91. package/build/style-provider/index.js.map +1 -1
  92. package/build/tabs/tab.js +0 -17
  93. package/build/tabs/tab.js.map +1 -1
  94. package/build/toolbar/toolbar-button/index.js +2 -0
  95. package/build/toolbar/toolbar-button/index.js.map +1 -1
  96. package/build/tools-panel/tools-panel/component.js +2 -0
  97. package/build/tools-panel/tools-panel/component.js.map +1 -1
  98. package/build/unit-control/index.js +10 -1
  99. package/build/unit-control/index.js.map +1 -1
  100. package/build/unit-control/types.js.map +1 -1
  101. package/build-module/angle-picker-control/index.js +1 -1
  102. package/build-module/angle-picker-control/index.js.map +1 -1
  103. package/build-module/autocomplete/index.js +0 -1
  104. package/build-module/autocomplete/index.js.map +1 -1
  105. package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -1
  106. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  107. package/build-module/border-control/border-control/component.js +2 -0
  108. package/build-module/border-control/border-control/component.js.map +1 -1
  109. package/build-module/box-control/all-input-control.js +1 -0
  110. package/build-module/box-control/all-input-control.js.map +1 -1
  111. package/build-module/box-control/axial-input-controls.js +1 -0
  112. package/build-module/box-control/axial-input-controls.js.map +1 -1
  113. package/build-module/box-control/index.js +9 -2
  114. package/build-module/box-control/index.js.map +1 -1
  115. package/build-module/box-control/input-controls.js +1 -0
  116. package/build-module/box-control/input-controls.js.map +1 -1
  117. package/build-module/box-control/types.js.map +1 -1
  118. package/build-module/clipboard-button/index.js +5 -3
  119. package/build-module/clipboard-button/index.js.map +1 -1
  120. package/build-module/color-palette/index.native.js +0 -1
  121. package/build-module/color-palette/index.native.js.map +1 -1
  122. package/build-module/color-picker/input-with-slider.js +2 -2
  123. package/build-module/color-picker/input-with-slider.js.map +1 -1
  124. package/build-module/composite/item.js +0 -9
  125. package/build-module/composite/item.js.map +1 -1
  126. package/build-module/context/context-connect.js +0 -1
  127. package/build-module/context/context-connect.js.map +1 -1
  128. package/build-module/custom-gradient-picker/index.js +2 -0
  129. package/build-module/custom-gradient-picker/index.js.map +1 -1
  130. package/build-module/custom-gradient-picker/types.js.map +1 -1
  131. package/build-module/custom-select-control/index.js +8 -0
  132. package/build-module/custom-select-control/index.js.map +1 -1
  133. package/build-module/custom-select-control/types.js.map +1 -1
  134. package/build-module/drop-zone/index.js +19 -13
  135. package/build-module/drop-zone/index.js.map +1 -1
  136. package/build-module/drop-zone/types.js.map +1 -1
  137. package/build-module/dropdown-menu/index.js +1 -0
  138. package/build-module/dropdown-menu/index.js.map +1 -1
  139. package/build-module/duotone-picker/color-list-picker/index.js +10 -15
  140. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  141. package/build-module/external-link/index.js +0 -1
  142. package/build-module/external-link/index.js.map +1 -1
  143. package/build-module/font-size-picker/font-size-picker-select.js +1 -0
  144. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  145. package/build-module/font-size-picker/index.js +1 -0
  146. package/build-module/font-size-picker/index.js.map +1 -1
  147. package/build-module/form-file-upload/index.js +13 -2
  148. package/build-module/form-file-upload/index.js.map +1 -1
  149. package/build-module/form-file-upload/types.js.map +1 -1
  150. package/build-module/form-token-field/index.js +6 -1
  151. package/build-module/form-token-field/index.js.map +1 -1
  152. package/build-module/gradient-picker/index.js +2 -0
  153. package/build-module/gradient-picker/index.js.map +1 -1
  154. package/build-module/gradient-picker/types.js.map +1 -1
  155. package/build-module/menu/checkbox-item.js +5 -9
  156. package/build-module/menu/checkbox-item.js.map +1 -1
  157. package/build-module/menu/group-label.js +4 -1
  158. package/build-module/menu/group-label.js.map +1 -1
  159. package/build-module/menu/group.js +4 -1
  160. package/build-module/menu/group.js.map +1 -1
  161. package/build-module/menu/item-help-text.js +6 -1
  162. package/build-module/menu/item-help-text.js.map +1 -1
  163. package/build-module/menu/item-label.js +6 -1
  164. package/build-module/menu/item-label.js.map +1 -1
  165. package/build-module/menu/item.js +4 -8
  166. package/build-module/menu/item.js.map +1 -1
  167. package/build-module/menu/radio-item.js +5 -9
  168. package/build-module/menu/radio-item.js.map +1 -1
  169. package/build-module/menu/separator.js +5 -2
  170. package/build-module/menu/separator.js.map +1 -1
  171. package/build-module/modal/aria-helper.js +0 -1
  172. package/build-module/modal/aria-helper.js.map +1 -1
  173. package/build-module/modal/index.js +0 -1
  174. package/build-module/modal/index.js.map +1 -1
  175. package/build-module/number-control/index.js +8 -0
  176. package/build-module/number-control/index.js.map +1 -1
  177. package/build-module/number-control/types.js.map +1 -1
  178. package/build-module/range-control/index.js +2 -1
  179. package/build-module/range-control/index.js.map +1 -1
  180. package/build-module/resizable-box/index.js +9 -1
  181. package/build-module/resizable-box/index.js.map +1 -1
  182. package/build-module/slot-fill/bubbles-virtually/fill.js +9 -13
  183. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  184. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +6 -10
  185. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  186. package/build-module/slot-fill/bubbles-virtually/slot.js +4 -10
  187. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  188. package/build-module/slot-fill/types.js.map +1 -1
  189. package/build-module/style-provider/index.js +0 -1
  190. package/build-module/style-provider/index.js.map +1 -1
  191. package/build-module/tabs/tab.js +0 -15
  192. package/build-module/tabs/tab.js.map +1 -1
  193. package/build-module/toolbar/toolbar-button/index.js +2 -0
  194. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  195. package/build-module/tools-panel/tools-panel/component.js +2 -0
  196. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  197. package/build-module/unit-control/index.js +10 -1
  198. package/build-module/unit-control/index.js.map +1 -1
  199. package/build-module/unit-control/types.js.map +1 -1
  200. package/build-style/style-rtl.css +9 -5
  201. package/build-style/style.css +9 -5
  202. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  203. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  204. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  205. package/build-types/box-control/index.d.ts +1 -0
  206. package/build-types/box-control/index.d.ts.map +1 -1
  207. package/build-types/box-control/input-controls.d.ts.map +1 -1
  208. package/build-types/box-control/stories/index.story.d.ts +42 -6
  209. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  210. package/build-types/box-control/styles/box-control-styles.d.ts +3 -2
  211. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  212. package/build-types/box-control/types.d.ts +14 -2
  213. package/build-types/box-control/types.d.ts.map +1 -1
  214. package/build-types/clipboard-button/index.d.ts.map +1 -1
  215. package/build-types/color-picker/styles.d.ts +3 -2
  216. package/build-types/color-picker/styles.d.ts.map +1 -1
  217. package/build-types/composite/item.d.ts.map +1 -1
  218. package/build-types/custom-gradient-picker/index.d.ts +1 -1
  219. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  220. package/build-types/custom-gradient-picker/types.d.ts +6 -0
  221. package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
  222. package/build-types/custom-select-control/index.d.ts.map +1 -1
  223. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  224. package/build-types/custom-select-control/types.d.ts +7 -0
  225. package/build-types/custom-select-control/types.d.ts.map +1 -1
  226. package/build-types/date-time/time/styles.d.ts +8 -4
  227. package/build-types/date-time/time/styles.d.ts.map +1 -1
  228. package/build-types/drop-zone/index.d.ts +1 -1
  229. package/build-types/drop-zone/index.d.ts.map +1 -1
  230. package/build-types/drop-zone/types.d.ts +5 -0
  231. package/build-types/drop-zone/types.d.ts.map +1 -1
  232. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  233. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  234. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -1
  235. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  236. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  237. package/build-types/font-size-picker/index.d.ts.map +1 -1
  238. package/build-types/form-file-upload/index.d.ts +2 -1
  239. package/build-types/form-file-upload/index.d.ts.map +1 -1
  240. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  241. package/build-types/form-file-upload/types.d.ts +10 -8
  242. package/build-types/form-file-upload/types.d.ts.map +1 -1
  243. package/build-types/form-token-field/index.d.ts.map +1 -1
  244. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  245. package/build-types/gradient-picker/index.d.ts +1 -1
  246. package/build-types/gradient-picker/index.d.ts.map +1 -1
  247. package/build-types/gradient-picker/types.d.ts +6 -0
  248. package/build-types/gradient-picker/types.d.ts.map +1 -1
  249. package/build-types/lock-unlock.d.ts +2 -2
  250. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  251. package/build-types/menu/group-label.d.ts.map +1 -1
  252. package/build-types/menu/group.d.ts.map +1 -1
  253. package/build-types/menu/index.d.ts.map +1 -1
  254. package/build-types/menu/item-help-text.d.ts.map +1 -1
  255. package/build-types/menu/item-label.d.ts.map +1 -1
  256. package/build-types/menu/item.d.ts.map +1 -1
  257. package/build-types/menu/radio-item.d.ts.map +1 -1
  258. package/build-types/menu/separator.d.ts.map +1 -1
  259. package/build-types/number-control/index.d.ts +2 -1
  260. package/build-types/number-control/index.d.ts.map +1 -1
  261. package/build-types/number-control/stories/index.story.d.ts +2 -1
  262. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  263. package/build-types/number-control/types.d.ts +7 -0
  264. package/build-types/number-control/types.d.ts.map +1 -1
  265. package/build-types/range-control/index.d.ts +1 -1
  266. package/build-types/range-control/index.d.ts.map +1 -1
  267. package/build-types/range-control/styles/range-control-styles.d.ts +2 -1
  268. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  269. package/build-types/resizable-box/index.d.ts.map +1 -1
  270. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  271. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  272. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  273. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
  274. package/build-types/slot-fill/types.d.ts +4 -3
  275. package/build-types/slot-fill/types.d.ts.map +1 -1
  276. package/build-types/tabs/tab.d.ts +3 -0
  277. package/build-types/tabs/tab.d.ts.map +1 -1
  278. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  279. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  280. package/build-types/tools-panel/tools-panel/component.d.ts +2 -0
  281. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  282. package/build-types/unit-control/index.d.ts +3 -2
  283. package/build-types/unit-control/index.d.ts.map +1 -1
  284. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  285. package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -1
  286. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  287. package/build-types/unit-control/types.d.ts +7 -0
  288. package/build-types/unit-control/types.d.ts.map +1 -1
  289. package/package.json +20 -20
  290. package/src/angle-picker-control/index.tsx +1 -1
  291. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -1
  292. package/src/border-control/border-control/component.tsx +2 -0
  293. package/src/box-control/README.md +1 -0
  294. package/src/box-control/all-input-control.tsx +1 -0
  295. package/src/box-control/axial-input-controls.tsx +1 -0
  296. package/src/box-control/index.tsx +10 -2
  297. package/src/box-control/input-controls.tsx +1 -0
  298. package/src/box-control/stories/index.story.tsx +1 -0
  299. package/src/box-control/test/index.tsx +33 -26
  300. package/src/box-control/types.ts +71 -56
  301. package/src/clipboard-button/index.tsx +5 -3
  302. package/src/color-picker/input-with-slider.tsx +1 -1
  303. package/src/composite/item.tsx +1 -19
  304. package/src/custom-gradient-picker/index.tsx +2 -0
  305. package/src/custom-gradient-picker/types.ts +6 -0
  306. package/src/custom-select-control/README.md +2 -0
  307. package/src/custom-select-control/index.tsx +9 -0
  308. package/src/custom-select-control/stories/index.story.tsx +1 -0
  309. package/src/custom-select-control/test/index.tsx +13 -9
  310. package/src/custom-select-control/types.ts +7 -0
  311. package/src/drop-zone/index.tsx +21 -24
  312. package/src/drop-zone/types.ts +5 -0
  313. package/src/dropdown-menu/index.tsx +1 -0
  314. package/src/dropdown-menu/style.scss +1 -1
  315. package/src/duotone-picker/color-list-picker/index.tsx +8 -8
  316. package/src/duotone-picker/color-list-picker/style.scss +0 -6
  317. package/src/font-size-picker/font-size-picker-select.tsx +1 -0
  318. package/src/font-size-picker/index.tsx +1 -0
  319. package/src/form-file-upload/README.md +58 -48
  320. package/src/form-file-upload/docs-manifest.json +5 -0
  321. package/src/form-file-upload/index.tsx +12 -1
  322. package/src/form-file-upload/stories/index.story.tsx +1 -0
  323. package/src/form-file-upload/test/index.tsx +5 -1
  324. package/src/form-file-upload/types.ts +10 -8
  325. package/src/form-token-field/README.md +1 -0
  326. package/src/form-token-field/index.tsx +7 -0
  327. package/src/form-token-field/stories/index.story.tsx +2 -0
  328. package/src/form-token-field/test/index.tsx +5 -1
  329. package/src/gradient-picker/README.md +8 -0
  330. package/src/gradient-picker/index.tsx +2 -0
  331. package/src/gradient-picker/types.ts +6 -0
  332. package/src/menu/checkbox-item.tsx +9 -7
  333. package/src/menu/group-label.tsx +8 -1
  334. package/src/menu/group.tsx +8 -1
  335. package/src/menu/item-help-text.tsx +10 -1
  336. package/src/menu/item-label.tsx +10 -1
  337. package/src/menu/item.tsx +8 -6
  338. package/src/menu/radio-item.tsx +9 -7
  339. package/src/menu/separator.tsx +9 -2
  340. package/src/menu-items-choice/style.scss +1 -0
  341. package/src/number-control/README.md +2 -1
  342. package/src/number-control/index.tsx +9 -0
  343. package/src/number-control/stories/index.story.tsx +1 -0
  344. package/src/number-control/test/index.tsx +5 -1
  345. package/src/number-control/types.ts +7 -0
  346. package/src/range-control/index.tsx +1 -0
  347. package/src/resizable-box/index.tsx +10 -0
  348. package/src/resizable-box/style.scss +8 -0
  349. package/src/slot-fill/bubbles-virtually/fill.tsx +7 -11
  350. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +2 -13
  351. package/src/slot-fill/bubbles-virtually/slot.tsx +4 -7
  352. package/src/slot-fill/types.ts +4 -3
  353. package/src/tabs/tab.tsx +0 -18
  354. package/src/tabs/test/index.tsx +1492 -947
  355. package/src/toolbar/toolbar-button/index.tsx +2 -0
  356. package/src/tools-panel/stories/index.story.tsx +12 -0
  357. package/src/tools-panel/tools-panel/README.md +4 -0
  358. package/src/tools-panel/tools-panel/component.tsx +2 -0
  359. package/src/unit-control/README.md +3 -3
  360. package/src/unit-control/index.tsx +11 -1
  361. package/src/unit-control/stories/index.story.tsx +1 -0
  362. package/src/unit-control/test/index.tsx +5 -1
  363. package/src/unit-control/types.ts +7 -0
  364. package/tsconfig.tsbuildinfo +1 -1
  365. package/build/menu/use-temporary-focus-visible-fix.js +0 -27
  366. package/build/menu/use-temporary-focus-visible-fix.js.map +0 -1
  367. package/build-module/menu/use-temporary-focus-visible-fix.js +0 -20
  368. package/build-module/menu/use-temporary-focus-visible-fix.js.map +0 -1
  369. package/build-types/menu/use-temporary-focus-visible-fix.d.ts +0 -8
  370. package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +0 -1
  371. package/src/menu/use-temporary-focus-visible-fix.ts +0 -22
@@ -15,7 +15,7 @@ import { __experimentalUseDropZone as useDropZone } from '@wordpress/compose';
15
15
  /**
16
16
  * Internal dependencies
17
17
  */
18
- import type { DropType, DropZoneProps } from './types';
18
+ import type { DropZoneProps } from './types';
19
19
  import type { WordPressComponentProps } from '../context';
20
20
 
21
21
  /**
@@ -47,19 +47,22 @@ export function DropZoneComponent( {
47
47
  onFilesDrop,
48
48
  onHTMLDrop,
49
49
  onDrop,
50
+ isEligible = () => true,
50
51
  ...restProps
51
52
  }: WordPressComponentProps< DropZoneProps, 'div', false > ) {
52
53
  const [ isDraggingOverDocument, setIsDraggingOverDocument ] =
53
54
  useState< boolean >();
54
55
  const [ isDraggingOverElement, setIsDraggingOverElement ] =
55
56
  useState< boolean >();
56
- const [ type, setType ] = useState< DropType >();
57
+ const [ isActive, setIsActive ] = useState< boolean >();
57
58
  const ref = useDropZone( {
58
59
  onDrop( event ) {
59
- const files = event.dataTransfer
60
- ? getFilesFromDataTransfer( event.dataTransfer )
61
- : [];
62
- const html = event.dataTransfer?.getData( 'text/html' );
60
+ if ( ! event.dataTransfer ) {
61
+ return;
62
+ }
63
+
64
+ const files = getFilesFromDataTransfer( event.dataTransfer );
65
+ const html = event.dataTransfer.getData( 'text/html' );
63
66
 
64
67
  /**
65
68
  * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
@@ -76,32 +79,31 @@ export function DropZoneComponent( {
76
79
  onDragStart( event ) {
77
80
  setIsDraggingOverDocument( true );
78
81
 
79
- let _type: DropType = 'default';
82
+ if ( ! event.dataTransfer ) {
83
+ return;
84
+ }
80
85
 
81
86
  /**
82
87
  * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
83
88
  * The order of the checks is important to recognize the HTML drop.
84
89
  */
85
- if ( event.dataTransfer?.types.includes( 'text/html' ) ) {
86
- _type = 'html';
90
+ if ( event.dataTransfer.types.includes( 'text/html' ) ) {
91
+ setIsActive( !! onHTMLDrop );
87
92
  } else if (
88
93
  // Check for the types because sometimes the files themselves
89
94
  // are only available on drop.
90
- event.dataTransfer?.types.includes( 'Files' ) ||
91
- ( event.dataTransfer
92
- ? getFilesFromDataTransfer( event.dataTransfer )
93
- : []
94
- ).length > 0
95
+ event.dataTransfer.types.includes( 'Files' ) ||
96
+ getFilesFromDataTransfer( event.dataTransfer ).length > 0
95
97
  ) {
96
- _type = 'file';
98
+ setIsActive( !! onFilesDrop );
99
+ } else {
100
+ setIsActive( !! onDrop && isEligible( event.dataTransfer ) );
97
101
  }
98
-
99
- setType( _type );
100
102
  },
101
103
  onDragEnd() {
102
104
  setIsDraggingOverElement( false );
103
105
  setIsDraggingOverDocument( false );
104
- setType( undefined );
106
+ setIsActive( undefined );
105
107
  },
106
108
  onDragEnter() {
107
109
  setIsDraggingOverElement( true );
@@ -112,14 +114,9 @@ export function DropZoneComponent( {
112
114
  } );
113
115
 
114
116
  const classes = clsx( 'components-drop-zone', className, {
115
- 'is-active':
116
- ( isDraggingOverDocument || isDraggingOverElement ) &&
117
- ( ( type === 'file' && onFilesDrop ) ||
118
- ( type === 'html' && onHTMLDrop ) ||
119
- ( type === 'default' && onDrop ) ),
117
+ 'is-active': isActive,
120
118
  'is-dragging-over-document': isDraggingOverDocument,
121
119
  'is-dragging-over-element': isDraggingOverElement,
122
- [ `is-dragging-${ type }` ]: !! type,
123
120
  } );
124
121
 
125
122
  return (
@@ -26,4 +26,9 @@ export type DropZoneProps = {
26
26
  * It receives the HTML being dropped as an argument.
27
27
  */
28
28
  onHTMLDrop?: ( html: string ) => void;
29
+ /**
30
+ * A function to determine if the drop zone is eligible to handle the drop
31
+ * data transfer items.
32
+ */
33
+ isEligible?: ( dataTransfer: DataTransfer ) => boolean;
29
34
  };
@@ -164,6 +164,7 @@ function UnconnectedDropdownMenu( dropdownMenuProps: DropdownMenuProps ) {
164
164
  { controlSets?.flatMap( ( controlSet, indexOfSet ) =>
165
165
  controlSet.map( ( control, indexOfControl ) => (
166
166
  <Button
167
+ __next40pxDefaultSize
167
168
  key={ [
168
169
  indexOfSet,
169
170
  indexOfControl,
@@ -53,7 +53,7 @@
53
53
 
54
54
  .components-menu-item__button,
55
55
  .components-menu-item__button.components-button {
56
- min-height: $button-size;
56
+ min-height: $button-size-next-default-40px;
57
57
  height: auto;
58
58
  text-align: left;
59
59
  padding-left: $grid-unit-10;
@@ -12,7 +12,6 @@ import Button from '../../button';
12
12
  import ColorPalette from '../../color-palette';
13
13
  import ColorIndicator from '../../color-indicator';
14
14
  import Icon from '../../icon';
15
- import { HStack } from '../../h-stack';
16
15
  import type { ColorListPickerProps, ColorOptionProps } from './types';
17
16
  import { useInstanceId } from '@wordpress/compose';
18
17
 
@@ -32,23 +31,24 @@ function ColorOption( {
32
31
  return (
33
32
  <>
34
33
  <Button
34
+ __next40pxDefaultSize
35
35
  className="components-color-list-picker__swatch-button"
36
+ id={ labelId }
36
37
  onClick={ () => setIsOpen( ( prev ) => ! prev ) }
37
38
  aria-expanded={ isOpen }
38
39
  aria-controls={ contentId }
39
- >
40
- <HStack justify="flex-start" spacing={ 2 }>
41
- { value ? (
40
+ icon={
41
+ value ? (
42
42
  <ColorIndicator
43
43
  colorValue={ value }
44
44
  className="components-color-list-picker__swatch-color"
45
45
  />
46
46
  ) : (
47
47
  <Icon icon={ swatch } />
48
- ) }
49
- <span id={ labelId }>{ label }</span>
50
- </HStack>
51
- </Button>
48
+ )
49
+ }
50
+ text={ label }
51
+ />
52
52
  <div
53
53
  role="group"
54
54
  id={ contentId }
@@ -7,12 +7,6 @@
7
7
  margin: $grid-unit-10 0;
8
8
  }
9
9
 
10
- .components-color-list-picker__swatch-button {
11
- // Used to simulate styles as a .button.has-icon (which this component can't
12
- // opt into, because it has to show more than a simple SVG as the "icon")
13
- padding: 6px;
14
- }
15
-
16
10
  .components-color-list-picker__swatch-color {
17
11
  // Match the 24px size of the `swatch` icon (used when no color is set)
18
12
  margin: 2px;
@@ -69,6 +69,7 @@ const FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {
69
69
  return (
70
70
  <CustomSelectControl
71
71
  __next40pxDefaultSize={ __next40pxDefaultSize }
72
+ __shouldNotWarnDeprecated36pxSize
72
73
  className="components-font-size-picker__select"
73
74
  label={ __( 'Font size' ) }
74
75
  hideLabelFromVision
@@ -212,6 +212,7 @@ const UnforwardedFontSizePicker = (
212
212
  <FlexItem isBlock>
213
213
  <UnitControl
214
214
  __next40pxDefaultSize={ __next40pxDefaultSize }
215
+ __shouldNotWarnDeprecated36pxSize
215
216
  label={ __( 'Custom' ) }
216
217
  labelPosition="top"
217
218
  hideLabelFromVision
@@ -1,95 +1,105 @@
1
1
  # FormFileUpload
2
2
 
3
- FormFileUpload is a component that allows users to select files from their local device.
3
+ <!-- This file is generated automatically and cannot be edited directly. Make edits via TypeScript types and TSDocs. -->
4
4
 
5
- ## Usage
5
+ <p class="callout callout-info">See the <a href="https://wordpress.github.io/gutenberg/?path=/docs/components-formfileupload--docs">WordPress Storybook</a> for more detailed, interactive documentation.</p>
6
+
7
+ FormFileUpload allows users to select files from their local device.
6
8
 
7
9
  ```jsx
8
10
  import { FormFileUpload } from '@wordpress/components';
9
11
 
10
12
  const MyFormFileUpload = () => (
11
- <FormFileUpload
12
- accept="image/*"
13
- onChange={ ( event ) => console.log( event.currentTarget.files ) }
14
- >
15
- Upload
16
- </FormFileUpload>
13
+ <FormFileUpload
14
+ __next40pxDefaultSize
15
+ accept="image/*"
16
+ onChange={ ( event ) => console.log( event.currentTarget.files ) }
17
+ >
18
+ Upload
19
+ </FormFileUpload>
17
20
  );
18
21
  ```
19
-
20
22
  ## Props
21
23
 
22
- The component accepts the following props. Props not included in this set will be passed to the `Button` component.
24
+ ### `__next40pxDefaultSize`
25
+
26
+ Start opting into the larger default height that will become the default size in a future version.
27
+
28
+ - Type: `boolean`
29
+ - Required: No
30
+ - Default: `false`
23
31
 
24
- ### accept
32
+ ### `accept`
25
33
 
26
- A string passed to `input` element that tells the browser which file types can be upload to the upload by the user use. e.g: `image/*,video/*`.
27
- More information about this string is available in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers.
34
+ A string passed to the `input` element that tells the browser which
35
+ [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers)
36
+ can be uploaded by the user. e.g: `image/*,video/*`.
28
37
 
29
- - Type: `String`
30
- - Required: No
38
+ - Type: `string`
39
+ - Required: No
31
40
 
32
- ### children
41
+ ### `children`
33
42
 
34
43
  Children are passed as children of `Button`.
35
44
 
36
- - Type: `Boolean`
37
- - Required: No
45
+ - Type: `ReactNode`
46
+ - Required: No
38
47
 
39
- ### icon
48
+ ### `icon`
40
49
 
41
- The icon to render. Supported values are: Dashicons (specified as strings), functions, Component instances and `null`.
50
+ The icon to render in the default button.
42
51
 
43
- - Type: `String|Function|Component|null`
44
- - Required: No
45
- - Default: `null`
52
+ See the `Icon` component docs for more information.
46
53
 
47
- ### multiple
54
+ - Type: `IconType`
55
+ - Required: No
56
+
57
+ ### `multiple`
48
58
 
49
59
  Whether to allow multiple selection of files or not.
50
60
 
51
- - Type: `Boolean`
52
- - Required: No
53
- - Default: `false`
61
+ - Type: `boolean`
62
+ - Required: No
63
+ - Default: `false`
54
64
 
55
- ### onChange
65
+ ### `onChange`
56
66
 
57
67
  Callback function passed directly to the `input` file element.
58
68
 
59
69
  Select files will be available in `event.currentTarget.files`.
60
70
 
61
- - Type: `Function`
62
- - Required: Yes
71
+ - Type: `ChangeEventHandler<HTMLInputElement>`
72
+ - Required: Yes
63
73
 
64
- ### onClick
74
+ ### `onClick`
65
75
 
66
76
  Callback function passed directly to the `input` file element.
67
77
 
68
- This can be useful when you want to force a `change` event to fire when the user chooses the same file again. To do this, set the target value to an empty string in the `onClick` function.
78
+ This can be useful when you want to force a `change` event to fire when
79
+ the user chooses the same file again. To do this, set the target value to
80
+ an empty string in the `onClick` function.
69
81
 
70
82
  ```jsx
71
83
  <FormFileUpload
72
- onClick={ ( event ) => ( event.target.value = '' ) }
73
- onChange={ onChange }
84
+ __next40pxDefaultSize
85
+ onClick={ ( event ) => ( event.target.value = '' ) }
86
+ onChange={ onChange }
74
87
  >
75
- Upload
88
+ Upload
76
89
  </FormFileUpload>
77
90
  ```
78
91
 
79
- - Type: `Function`
80
- - Required: No
81
-
82
- ### render
92
+ - Type: `MouseEventHandler<HTMLInputElement>`
93
+ - Required: No
83
94
 
84
- Optional callback function used to render the UI. If passed, the component does not render the default UI (a button) and calls this function to render it. The function receives an object with property `openFileDialog`, a function that, when called, opens the browser native file upload modal window.
95
+ ### `render`
85
96
 
86
- - Type: `Function`
87
- - Required: No
97
+ Optional callback function used to render the UI.
88
98
 
89
- ### __next40pxDefaultSize
90
-
91
- Start opting into the larger default height that will become the default size in a future version.
99
+ If passed, the component does not render the default UI (a button) and
100
+ calls this function to render it. The function receives an object with
101
+ property `openFileDialog`, a function that, when called, opens the browser
102
+ native file upload modal window.
92
103
 
93
- - Type: `Boolean`
94
- - Required: No
95
- - Default: `false`
104
+ - Type: `(arg: { openFileDialog: () => void; }) => ReactNode`
105
+ - Required: No
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "../../schemas/docs-manifest.json",
3
+ "displayName": "FormFileUpload",
4
+ "filePath": "./index.tsx"
5
+ }
@@ -9,15 +9,17 @@ import { useRef } from '@wordpress/element';
9
9
  import Button from '../button';
10
10
  import type { WordPressComponentProps } from '../context';
11
11
  import type { FormFileUploadProps } from './types';
12
+ import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
12
13
 
13
14
  /**
14
- * FormFileUpload is a component that allows users to select files from their local device.
15
+ * FormFileUpload allows users to select files from their local device.
15
16
  *
16
17
  * ```jsx
17
18
  * import { FormFileUpload } from '@wordpress/components';
18
19
  *
19
20
  * const MyFormFileUpload = () => (
20
21
  * <FormFileUpload
22
+ * __next40pxDefaultSize
21
23
  * accept="image/*"
22
24
  * onChange={ ( event ) => console.log( event.currentTarget.files ) }
23
25
  * >
@@ -40,6 +42,15 @@ export function FormFileUpload( {
40
42
  ref.current?.click();
41
43
  };
42
44
 
45
+ if ( ! render ) {
46
+ maybeWarnDeprecated36pxSize( {
47
+ componentName: 'FormFileUpload',
48
+ __next40pxDefaultSize: props.__next40pxDefaultSize,
49
+ // @ts-expect-error - We don't "officially" support all Button props but this likely happens.
50
+ size: props.size,
51
+ } );
52
+ }
53
+
43
54
  const ui = render ? (
44
55
  render( { openFileDialog } )
45
56
  ) : (
@@ -36,6 +36,7 @@ const Template: StoryFn< typeof FormFileUpload > = ( props ) => {
36
36
  export const Default = Template.bind( {} );
37
37
  Default.args = {
38
38
  children: 'Select file',
39
+ __next40pxDefaultSize: true,
39
40
  };
40
41
 
41
42
  export const RestrictFileTypes = Template.bind( {} );
@@ -7,13 +7,17 @@ import userEvent from '@testing-library/user-event';
7
7
  /**
8
8
  * Internal dependencies
9
9
  */
10
- import FormFileUpload from '..';
10
+ import _FormFileUpload from '..';
11
11
 
12
12
  /**
13
13
  * Browser dependencies
14
14
  */
15
15
  const { File } = window;
16
16
 
17
+ const FormFileUpload = (
18
+ props: React.ComponentProps< typeof _FormFileUpload >
19
+ ) => <_FormFileUpload __next40pxDefaultSize { ...props } />;
20
+
17
21
  // @testing-library/user-event considers changing <input type="file"> to a string as a change, but it do not occur on real browsers, so the comparisons will be against this result
18
22
  const fakePath = expect.objectContaining( {
19
23
  target: expect.objectContaining( {
@@ -17,10 +17,9 @@ export type FormFileUploadProps = {
17
17
  */
18
18
  __next40pxDefaultSize?: boolean;
19
19
  /**
20
- * A string passed to `input` element that tells the browser which file types can be
21
- * upload to the upload by the user use. e.g: `image/*,video/*`.
22
- *
23
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers.
20
+ * A string passed to the `input` element that tells the browser which
21
+ * [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers)
22
+ * can be uploaded by the user. e.g: `image/*,video/*`.
24
23
  */
25
24
  accept?: InputHTMLAttributes< HTMLInputElement >[ 'accept' ];
26
25
  /**
@@ -28,7 +27,9 @@ export type FormFileUploadProps = {
28
27
  */
29
28
  children?: ReactNode;
30
29
  /**
31
- * The icon to render in the `Button`.
30
+ * The icon to render in the default button.
31
+ *
32
+ * See the `Icon` component docs for more information.
32
33
  */
33
34
  icon?: ComponentProps< typeof Icon >[ 'icon' ];
34
35
  /**
@@ -50,10 +51,11 @@ export type FormFileUploadProps = {
50
51
  *
51
52
  * ```jsx
52
53
  * <FormFileUpload
53
- * onClick={ ( event ) => ( event.target.value = '' ) }
54
- * onChange={ onChange }
54
+ * __next40pxDefaultSize
55
+ * onClick={ ( event ) => ( event.target.value = '' ) }
56
+ * onChange={ onChange }
55
57
  * >
56
- * Upload
58
+ * Upload
57
59
  * </FormFileUpload>
58
60
  * ```
59
61
  */
@@ -85,6 +85,7 @@ const MyFormTokenField = () => {
85
85
 
86
86
  return (
87
87
  <FormTokenField
88
+ __next40pxDefaultSize
88
89
  value={ selectedContinents }
89
90
  suggestions={ continents }
90
91
  onChange={ ( tokens ) => setSelectedContinents( tokens ) }
@@ -30,6 +30,7 @@ import {
30
30
  import { Spacer } from '../spacer';
31
31
  import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
32
32
  import { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';
33
+ import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
33
34
 
34
35
  const identity = ( value: string ) => value;
35
36
 
@@ -86,6 +87,12 @@ export function FormTokenField( props: FormTokenFieldProps ) {
86
87
  } );
87
88
  }
88
89
 
90
+ maybeWarnDeprecated36pxSize( {
91
+ componentName: 'FormTokenField',
92
+ size: undefined,
93
+ __next40pxDefaultSize,
94
+ } );
95
+
89
96
  const instanceId = useInstanceId( FormTokenField );
90
97
 
91
98
  // We reset to these initial values again in the onBlur
@@ -64,6 +64,7 @@ Default.args = {
64
64
  label: 'Type a continent',
65
65
  suggestions: continents,
66
66
  __nextHasNoMarginBottom: true,
67
+ __next40pxDefaultSize: true,
67
68
  };
68
69
 
69
70
  export const Async: StoryFn< typeof FormTokenField > = ( {
@@ -102,6 +103,7 @@ Async.args = {
102
103
  label: 'Type a continent',
103
104
  suggestions: continents,
104
105
  __nextHasNoMarginBottom: true,
106
+ __next40pxDefaultSize: true,
105
107
  };
106
108
 
107
109
  export const DropdownSelector: StoryFn< typeof FormTokenField > =
@@ -21,7 +21,11 @@ import { useState } from '@wordpress/element';
21
21
  /**
22
22
  * Internal dependencies
23
23
  */
24
- import FormTokenField from '../';
24
+ import _FormTokenField from '../';
25
+
26
+ const FormTokenField = ( props: ComponentProps< typeof _FormTokenField > ) => (
27
+ <_FormTokenField __next40pxDefaultSize { ...props } />
28
+ );
25
29
 
26
30
  const FormTokenFieldWithState = ( {
27
31
  onChange,
@@ -100,6 +100,14 @@ gradients from `gradients` will be shown.
100
100
  - Required: No
101
101
  - Default: `false`
102
102
 
103
+ ### `enableAlpha`
104
+
105
+ Whether to enable alpha transparency options in the picker.
106
+
107
+ - Type: `boolean`
108
+ - Required: No
109
+ - Default: `true`
110
+
103
111
  ### `gradients`
104
112
 
105
113
  An array of objects as predefined gradients displayed above the gradient
@@ -213,6 +213,7 @@ export function GradientPicker( {
213
213
  onChange,
214
214
  value,
215
215
  clearable = true,
216
+ enableAlpha = true,
216
217
  disableCustomGradients = false,
217
218
  __experimentalIsRenderedInSidebar,
218
219
  headingLevel = 2,
@@ -230,6 +231,7 @@ export function GradientPicker( {
230
231
  __experimentalIsRenderedInSidebar={
231
232
  __experimentalIsRenderedInSidebar
232
233
  }
234
+ enableAlpha={ enableAlpha }
233
235
  value={ value }
234
236
  onChange={ onChange }
235
237
  />
@@ -56,6 +56,12 @@ type GradientPickerBaseProps = {
56
56
  * @default true
57
57
  */
58
58
  loop?: boolean;
59
+ /**
60
+ * Whether to enable alpha transparency options in the picker.
61
+ *
62
+ * @default true
63
+ */
64
+ enableAlpha?: boolean;
59
65
  } & (
60
66
  | {
61
67
  // TODO: [#54055] Either this or `aria-labelledby` should be required
@@ -16,30 +16,32 @@ import type { WordPressComponentProps } from '../context';
16
16
  import { MenuContext } from './context';
17
17
  import type { MenuCheckboxItemProps } from './types';
18
18
  import * as Styled from './styles';
19
- import { useTemporaryFocusVisibleFix } from './use-temporary-focus-visible-fix';
20
19
 
21
20
  export const MenuCheckboxItem = forwardRef<
22
21
  HTMLDivElement,
23
22
  WordPressComponentProps< MenuCheckboxItemProps, 'div', false >
24
23
  >( function MenuCheckboxItem(
25
- { suffix, children, onBlur, hideOnClick = false, ...props },
24
+ { suffix, children, hideOnClick = false, ...props },
26
25
  ref
27
26
  ) {
28
- // TODO: Remove when https://github.com/ariakit/ariakit/issues/4083 is fixed
29
- const focusVisibleFixProps = useTemporaryFocusVisibleFix( { onBlur } );
30
27
  const menuContext = useContext( MenuContext );
31
28
 
29
+ if ( ! menuContext?.store ) {
30
+ throw new Error(
31
+ 'Menu.CheckboxItem can only be rendered inside a Menu component'
32
+ );
33
+ }
34
+
32
35
  return (
33
36
  <Styled.MenuCheckboxItem
34
37
  ref={ ref }
35
38
  { ...props }
36
- { ...focusVisibleFixProps }
37
39
  accessibleWhenDisabled
38
40
  hideOnClick={ hideOnClick }
39
- store={ menuContext?.store }
41
+ store={ menuContext.store }
40
42
  >
41
43
  <Ariakit.MenuItemCheck
42
- store={ menuContext?.store }
44
+ store={ menuContext.store }
43
45
  render={ <Styled.ItemPrefixWrapper /> }
44
46
  // Override some ariakit inline styles
45
47
  style={ { width: 'auto', height: 'auto' } }
@@ -17,6 +17,13 @@ export const MenuGroupLabel = forwardRef<
17
17
  WordPressComponentProps< MenuGroupLabelProps, 'div', false >
18
18
  >( function MenuGroup( props, ref ) {
19
19
  const menuContext = useContext( MenuContext );
20
+
21
+ if ( ! menuContext?.store ) {
22
+ throw new Error(
23
+ 'Menu.GroupLabel can only be rendered inside a Menu component'
24
+ );
25
+ }
26
+
20
27
  return (
21
28
  <Styled.MenuGroupLabel
22
29
  ref={ ref }
@@ -31,7 +38,7 @@ export const MenuGroupLabel = forwardRef<
31
38
  />
32
39
  }
33
40
  { ...props }
34
- store={ menuContext?.store }
41
+ store={ menuContext.store }
35
42
  />
36
43
  );
37
44
  } );
@@ -16,11 +16,18 @@ export const MenuGroup = forwardRef<
16
16
  WordPressComponentProps< MenuGroupProps, 'div', false >
17
17
  >( function MenuGroup( props, ref ) {
18
18
  const menuContext = useContext( MenuContext );
19
+
20
+ if ( ! menuContext?.store ) {
21
+ throw new Error(
22
+ 'Menu.Group can only be rendered inside a Menu component'
23
+ );
24
+ }
25
+
19
26
  return (
20
27
  <Styled.MenuGroup
21
28
  ref={ ref }
22
29
  { ...props }
23
- store={ menuContext?.store }
30
+ store={ menuContext.store }
24
31
  />
25
32
  );
26
33
  } );