@wordpress/components 28.10.0 → 28.11.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 (576) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/build/autocomplete/autocompleter-ui.js +2 -6
  3. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  4. package/build/autocomplete/autocompleter-ui.native.js +2 -4
  5. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  6. package/build/autocomplete/index.js +4 -5
  7. package/build/autocomplete/index.js.map +1 -1
  8. package/build/base-control/types.js.map +1 -1
  9. package/build/border-box-control/border-box-control/component.js +1 -0
  10. package/build/border-box-control/border-box-control/component.js.map +1 -1
  11. package/build/border-box-control/border-box-control/hook.js +6 -0
  12. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  13. package/build/border-control/border-control/component.js +1 -0
  14. package/build/border-control/border-control/component.js.map +1 -1
  15. package/build/border-control/border-control/hook.js +6 -0
  16. package/build/border-control/border-control/hook.js.map +1 -1
  17. package/build/border-control/border-control-dropdown/component.js +12 -12
  18. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  19. package/build/color-palette/index.js +1 -1
  20. package/build/color-palette/index.js.map +1 -1
  21. package/build/color-palette/index.native.js +1 -2
  22. package/build/color-palette/index.native.js.map +1 -1
  23. package/build/color-picker/index.native.js +0 -1
  24. package/build/color-picker/index.native.js.map +1 -1
  25. package/build/composite/legacy/index.js +5 -2
  26. package/build/composite/legacy/index.js.map +1 -1
  27. package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -1
  28. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  29. package/build/date-time/date/index.js +0 -1
  30. package/build/date-time/date/index.js.map +1 -1
  31. package/build/font-size-picker/index.native.js +6 -6
  32. package/build/font-size-picker/index.native.js.map +1 -1
  33. package/build/form-token-field/index.js +0 -3
  34. package/build/form-token-field/index.js.map +1 -1
  35. package/build/form-token-field/suggestions-list.js +7 -3
  36. package/build/form-token-field/suggestions-list.js.map +1 -1
  37. package/build/{dropdown-menu-v2 → menu}/checkbox-item.js +8 -8
  38. package/build/menu/checkbox-item.js.map +1 -0
  39. package/build/{dropdown-menu-v2 → menu}/context.js +2 -2
  40. package/build/menu/context.js.map +1 -0
  41. package/build/{dropdown-menu-v2 → menu}/group-label.js +5 -5
  42. package/build/menu/group-label.js.map +1 -0
  43. package/build/{dropdown-menu-v2 → menu}/group.js +5 -5
  44. package/build/menu/group.js.map +1 -0
  45. package/build/{dropdown-menu-v2 → menu}/index.js +38 -38
  46. package/build/menu/index.js.map +1 -0
  47. package/build/{dropdown-menu-v2 → menu}/item-help-text.js +3 -3
  48. package/build/menu/item-help-text.js.map +1 -0
  49. package/build/{dropdown-menu-v2 → menu}/item-label.js +3 -3
  50. package/build/menu/item-label.js.map +1 -0
  51. package/build/{dropdown-menu-v2 → menu}/item.js +7 -7
  52. package/build/menu/item.js.map +1 -0
  53. package/build/{dropdown-menu-v2 → menu}/radio-item.js +8 -8
  54. package/build/menu/radio-item.js.map +1 -0
  55. package/build/{dropdown-menu-v2 → menu}/separator.js +6 -6
  56. package/build/menu/separator.js.map +1 -0
  57. package/build/menu/styles.js +150 -0
  58. package/build/menu/styles.js.map +1 -0
  59. package/build/menu/types.js.map +1 -0
  60. package/build/menu/use-temporary-focus-visible-fix.js.map +1 -0
  61. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
  62. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  63. package/build/mobile/bottom-sheet/range-cell.native.js +1 -1
  64. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  65. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  66. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  67. package/build/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  68. package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  69. package/build/mobile/bottom-sheet-select-control/index.native.js +2 -2
  70. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  71. package/build/mobile/color-settings/index.native.js +1 -3
  72. package/build/mobile/color-settings/index.native.js.map +1 -1
  73. package/build/mobile/color-settings/picker-screen.native.js +1 -3
  74. package/build/mobile/color-settings/picker-screen.native.js.map +1 -1
  75. package/build/mobile/image/index.native.js +1 -3
  76. package/build/mobile/image/index.native.js.map +1 -1
  77. package/build/mobile/keyboard-avoiding-view/index.ios.js +1 -3
  78. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  79. package/build/mobile/link-picker/link-picker-results.native.js +2 -5
  80. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  81. package/build/mobile/link-picker/link-picker-screen.native.js +1 -3
  82. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  83. package/build/mobile/link-settings/index.native.js +6 -18
  84. package/build/mobile/link-settings/index.native.js.map +1 -1
  85. package/build/mobile/link-settings/link-settings-screen.native.js +1 -3
  86. package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  87. package/build/mobile/segmented-control/index.native.js +2 -6
  88. package/build/mobile/segmented-control/index.native.js.map +1 -1
  89. package/build/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  90. package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  91. package/build/navigation/index.js +1 -2
  92. package/build/navigation/index.js.map +1 -1
  93. package/build/navigation/item/use-navigation-tree-item.js +2 -2
  94. package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
  95. package/build/navigation/menu/menu-title-search.js +2 -2
  96. package/build/navigation/menu/menu-title-search.js.map +1 -1
  97. package/build/navigation/menu/use-navigation-tree-menu.js +2 -2
  98. package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  99. package/build/palette-edit/index.js +4 -2
  100. package/build/palette-edit/index.js.map +1 -1
  101. package/build/palette-edit/styles.js +13 -28
  102. package/build/palette-edit/styles.js.map +1 -1
  103. package/build/private-apis.js +4 -4
  104. package/build/private-apis.js.map +1 -1
  105. package/build/radio-group/index.js +3 -1
  106. package/build/radio-group/index.js.map +1 -1
  107. package/build/sandbox/index.js +3 -6
  108. package/build/sandbox/index.js.map +1 -1
  109. package/build/sandbox/index.native.js +1 -3
  110. package/build/sandbox/index.native.js.map +1 -1
  111. package/build/search-control/index.native.js +1 -3
  112. package/build/search-control/index.native.js.map +1 -1
  113. package/build/slot-fill/bubbles-virtually/slot.js +1 -2
  114. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  115. package/build/slot-fill/fill.js +3 -6
  116. package/build/slot-fill/fill.js.map +1 -1
  117. package/build/spacer/hook.js +5 -3
  118. package/build/spacer/hook.js.map +1 -1
  119. package/build/tab-panel/index.js +4 -1
  120. package/build/tab-panel/index.js.map +1 -1
  121. package/build/tabs/index.js +48 -113
  122. package/build/tabs/index.js.map +1 -1
  123. package/build/tabs/styles.js +12 -12
  124. package/build/tabs/styles.js.map +1 -1
  125. package/build/tabs/tab.js +23 -6
  126. package/build/tabs/tab.js.map +1 -1
  127. package/build/tabs/tablist.js +24 -12
  128. package/build/tabs/tablist.js.map +1 -1
  129. package/build/tabs/types.js.map +1 -1
  130. package/build/toggle-group-control/toggle-group-control/component.js +2 -1
  131. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  132. package/build/toolbar/toolbar/index.js +3 -0
  133. package/build/toolbar/toolbar/index.js.map +1 -1
  134. package/build/tools-panel/tools-panel-header/component.js +1 -1
  135. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  136. package/build/tools-panel/tools-panel-item/hook.js +0 -2
  137. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  138. package/build/tooltip/index.native.js +5 -15
  139. package/build/tooltip/index.native.js.map +1 -1
  140. package/build/unit-control/index.native.js +2 -6
  141. package/build/unit-control/index.native.js.map +1 -1
  142. package/build/utils/deprecated-36px-size.js +27 -0
  143. package/build/utils/deprecated-36px-size.js.map +1 -0
  144. package/build/utils/element-rect.js +13 -2
  145. package/build/utils/element-rect.js.map +1 -1
  146. package/build/utils/hooks/use-animated-offset-rect.js +3 -2
  147. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -1
  148. package/build/utils/hooks/use-update-effect.js +0 -2
  149. package/build/utils/hooks/use-update-effect.js.map +1 -1
  150. package/build-module/autocomplete/autocompleter-ui.js +2 -6
  151. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  152. package/build-module/autocomplete/autocompleter-ui.native.js +2 -4
  153. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  154. package/build-module/autocomplete/index.js +4 -5
  155. package/build-module/autocomplete/index.js.map +1 -1
  156. package/build-module/base-control/types.js.map +1 -1
  157. package/build-module/border-box-control/border-box-control/component.js +1 -0
  158. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  159. package/build-module/border-box-control/border-box-control/hook.js +6 -0
  160. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  161. package/build-module/border-control/border-control/component.js +1 -0
  162. package/build-module/border-control/border-control/component.js.map +1 -1
  163. package/build-module/border-control/border-control/hook.js +7 -0
  164. package/build-module/border-control/border-control/hook.js.map +1 -1
  165. package/build-module/border-control/border-control-dropdown/component.js +12 -12
  166. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  167. package/build-module/color-palette/index.js +1 -1
  168. package/build-module/color-palette/index.js.map +1 -1
  169. package/build-module/color-palette/index.native.js +1 -2
  170. package/build-module/color-palette/index.native.js.map +1 -1
  171. package/build-module/color-picker/index.native.js +0 -1
  172. package/build-module/color-picker/index.native.js.map +1 -1
  173. package/build-module/composite/legacy/index.js +5 -2
  174. package/build-module/composite/legacy/index.js.map +1 -1
  175. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -1
  176. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  177. package/build-module/date-time/date/index.js +0 -1
  178. package/build-module/date-time/date/index.js.map +1 -1
  179. package/build-module/font-size-picker/index.native.js +7 -7
  180. package/build-module/font-size-picker/index.native.js.map +1 -1
  181. package/build-module/form-token-field/index.js +0 -3
  182. package/build-module/form-token-field/index.js.map +1 -1
  183. package/build-module/form-token-field/suggestions-list.js +7 -3
  184. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  185. package/build-module/{dropdown-menu-v2 → menu}/checkbox-item.js +8 -8
  186. package/build-module/menu/checkbox-item.js.map +1 -0
  187. package/build-module/{dropdown-menu-v2 → menu}/context.js +1 -1
  188. package/build-module/menu/context.js.map +1 -0
  189. package/build-module/{dropdown-menu-v2 → menu}/group-label.js +5 -5
  190. package/build-module/menu/group-label.js.map +1 -0
  191. package/build-module/menu/group.js +21 -0
  192. package/build-module/menu/group.js.map +1 -0
  193. package/build-module/{dropdown-menu-v2 → menu}/index.js +46 -46
  194. package/build-module/menu/index.js.map +1 -0
  195. package/build-module/{dropdown-menu-v2 → menu}/item-help-text.js +2 -2
  196. package/build-module/menu/item-help-text.js.map +1 -0
  197. package/build-module/{dropdown-menu-v2 → menu}/item-label.js +2 -2
  198. package/build-module/menu/item-label.js.map +1 -0
  199. package/build-module/{dropdown-menu-v2 → menu}/item.js +7 -7
  200. package/build-module/menu/item.js.map +1 -0
  201. package/build-module/{dropdown-menu-v2 → menu}/radio-item.js +8 -8
  202. package/build-module/menu/radio-item.js.map +1 -0
  203. package/build-module/menu/separator.js +22 -0
  204. package/build-module/menu/separator.js.map +1 -0
  205. package/build-module/menu/styles.js +143 -0
  206. package/build-module/menu/styles.js.map +1 -0
  207. package/build-module/menu/types.js.map +1 -0
  208. package/build-module/menu/use-temporary-focus-visible-fix.js.map +1 -0
  209. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
  210. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  211. package/build-module/mobile/bottom-sheet/range-cell.native.js +1 -1
  212. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  213. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  214. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  215. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  216. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  217. package/build-module/mobile/bottom-sheet-select-control/index.native.js +2 -2
  218. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  219. package/build-module/mobile/color-settings/index.native.js +1 -3
  220. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  221. package/build-module/mobile/color-settings/picker-screen.native.js +1 -3
  222. package/build-module/mobile/color-settings/picker-screen.native.js.map +1 -1
  223. package/build-module/mobile/image/index.native.js +1 -3
  224. package/build-module/mobile/image/index.native.js.map +1 -1
  225. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +1 -3
  226. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  227. package/build-module/mobile/link-picker/link-picker-results.native.js +2 -5
  228. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  229. package/build-module/mobile/link-picker/link-picker-screen.native.js +1 -3
  230. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  231. package/build-module/mobile/link-settings/index.native.js +6 -18
  232. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  233. package/build-module/mobile/link-settings/link-settings-screen.native.js +1 -3
  234. package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  235. package/build-module/mobile/segmented-control/index.native.js +2 -6
  236. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  237. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  238. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  239. package/build-module/navigation/index.js +1 -2
  240. package/build-module/navigation/index.js.map +1 -1
  241. package/build-module/navigation/item/use-navigation-tree-item.js +2 -2
  242. package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
  243. package/build-module/navigation/menu/menu-title-search.js +2 -2
  244. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  245. package/build-module/navigation/menu/use-navigation-tree-menu.js +2 -2
  246. package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  247. package/build-module/palette-edit/index.js +6 -4
  248. package/build-module/palette-edit/index.js.map +1 -1
  249. package/build-module/palette-edit/styles.js +13 -29
  250. package/build-module/palette-edit/styles.js.map +1 -1
  251. package/build-module/private-apis.js +3 -3
  252. package/build-module/private-apis.js.map +1 -1
  253. package/build-module/radio-group/index.js +3 -1
  254. package/build-module/radio-group/index.js.map +1 -1
  255. package/build-module/sandbox/index.js +3 -6
  256. package/build-module/sandbox/index.js.map +1 -1
  257. package/build-module/sandbox/index.native.js +1 -3
  258. package/build-module/sandbox/index.native.js.map +1 -1
  259. package/build-module/search-control/index.native.js +1 -3
  260. package/build-module/search-control/index.native.js.map +1 -1
  261. package/build-module/slot-fill/bubbles-virtually/slot.js +1 -2
  262. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  263. package/build-module/slot-fill/fill.js +3 -6
  264. package/build-module/slot-fill/fill.js.map +1 -1
  265. package/build-module/spacer/hook.js +5 -3
  266. package/build-module/spacer/hook.js.map +1 -1
  267. package/build-module/tab-panel/index.js +4 -1
  268. package/build-module/tab-panel/index.js.map +1 -1
  269. package/build-module/tabs/index.js +47 -112
  270. package/build-module/tabs/index.js.map +1 -1
  271. package/build-module/tabs/styles.js +11 -11
  272. package/build-module/tabs/styles.js.map +1 -1
  273. package/build-module/tabs/tab.js +21 -6
  274. package/build-module/tabs/tab.js.map +1 -1
  275. package/build-module/tabs/tablist.js +24 -12
  276. package/build-module/tabs/tablist.js.map +1 -1
  277. package/build-module/tabs/types.js.map +1 -1
  278. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -1
  279. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  280. package/build-module/toolbar/toolbar/index.js +3 -0
  281. package/build-module/toolbar/toolbar/index.js.map +1 -1
  282. package/build-module/tools-panel/tools-panel-header/component.js +1 -1
  283. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  284. package/build-module/tools-panel/tools-panel-item/hook.js +0 -2
  285. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  286. package/build-module/tooltip/index.native.js +5 -15
  287. package/build-module/tooltip/index.native.js.map +1 -1
  288. package/build-module/unit-control/index.native.js +2 -6
  289. package/build-module/unit-control/index.native.js.map +1 -1
  290. package/build-module/utils/deprecated-36px-size.js +19 -0
  291. package/build-module/utils/deprecated-36px-size.js.map +1 -0
  292. package/build-module/utils/element-rect.js +13 -2
  293. package/build-module/utils/element-rect.js.map +1 -1
  294. package/build-module/utils/hooks/use-animated-offset-rect.js +3 -2
  295. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -1
  296. package/build-module/utils/hooks/use-update-effect.js +0 -2
  297. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  298. package/build-style/style-rtl.css +6 -6
  299. package/build-style/style.css +6 -6
  300. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  301. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  302. package/build-types/autocomplete/index.d.ts.map +1 -1
  303. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  304. package/build-types/base-control/types.d.ts +3 -0
  305. package/build-types/base-control/types.d.ts.map +1 -1
  306. package/build-types/border-box-control/border-box-control/component.d.ts +1 -0
  307. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  308. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  309. package/build-types/border-control/border-control/component.d.ts +1 -0
  310. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  311. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  312. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  313. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  314. package/build-types/button/stories/index.story.d.ts.map +1 -1
  315. package/build-types/card/stories/index.story.d.ts.map +1 -1
  316. package/build-types/composite/legacy/index.d.ts.map +1 -1
  317. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  318. package/build-types/date-time/date/index.d.ts.map +1 -1
  319. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  320. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  321. package/build-types/form-token-field/index.d.ts.map +1 -1
  322. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  323. package/build-types/item-group/stories/index.story.d.ts +1 -1
  324. package/build-types/item-group/stories/index.story.d.ts.map +1 -1
  325. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  326. package/build-types/menu/checkbox-item.d.ts +3 -0
  327. package/build-types/menu/checkbox-item.d.ts.map +1 -0
  328. package/build-types/menu/context.d.ts +6 -0
  329. package/build-types/menu/context.d.ts.map +1 -0
  330. package/build-types/menu/group-label.d.ts +3 -0
  331. package/build-types/menu/group-label.d.ts.map +1 -0
  332. package/build-types/menu/group.d.ts +3 -0
  333. package/build-types/menu/group.d.ts.map +1 -0
  334. package/build-types/menu/index.d.ts +40 -0
  335. package/build-types/menu/index.d.ts.map +1 -0
  336. package/build-types/{dropdown-menu-v2 → menu}/item-help-text.d.ts +1 -1
  337. package/build-types/menu/item-help-text.d.ts.map +1 -0
  338. package/build-types/{dropdown-menu-v2 → menu}/item-label.d.ts +1 -1
  339. package/build-types/menu/item-label.d.ts.map +1 -0
  340. package/build-types/menu/item.d.ts +3 -0
  341. package/build-types/menu/item.d.ts.map +1 -0
  342. package/build-types/menu/radio-item.d.ts +3 -0
  343. package/build-types/menu/radio-item.d.ts.map +1 -0
  344. package/build-types/menu/separator.d.ts +3 -0
  345. package/build-types/menu/separator.d.ts.map +1 -0
  346. package/build-types/menu/stories/index.story.d.ts +16 -0
  347. package/build-types/menu/stories/index.story.d.ts.map +1 -0
  348. package/build-types/{dropdown-menu-v2 → menu}/styles.d.ts +13 -13
  349. package/build-types/menu/styles.d.ts.map +1 -0
  350. package/build-types/menu/test/index.d.ts.map +1 -0
  351. package/build-types/{dropdown-menu-v2 → menu}/types.d.ts +22 -21
  352. package/build-types/menu/types.d.ts.map +1 -0
  353. package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +1 -0
  354. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
  355. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
  356. package/build-types/navigation/index.d.ts.map +1 -1
  357. package/build-types/palette-edit/index.d.ts.map +1 -1
  358. package/build-types/palette-edit/styles.d.ts +0 -256
  359. package/build-types/palette-edit/styles.d.ts.map +1 -1
  360. package/build-types/panel/stories/index.story.d.ts.map +1 -1
  361. package/build-types/radio-group/index.d.ts.map +1 -1
  362. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  363. package/build-types/sandbox/index.d.ts.map +1 -1
  364. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  365. package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
  366. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  367. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  368. package/build-types/slot-fill/fill.d.ts.map +1 -1
  369. package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
  370. package/build-types/spacer/hook.d.ts.map +1 -1
  371. package/build-types/tab-panel/index.d.ts.map +1 -1
  372. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  373. package/build-types/tabs/index.d.ts +21 -8
  374. package/build-types/tabs/index.d.ts.map +1 -1
  375. package/build-types/tabs/stories/index.story.d.ts +1 -1
  376. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  377. package/build-types/tabs/styles.d.ts +6 -3
  378. package/build-types/tabs/styles.d.ts.map +1 -1
  379. package/build-types/tabs/tab.d.ts +0 -3
  380. package/build-types/tabs/tab.d.ts.map +1 -1
  381. package/build-types/tabs/tablist.d.ts.map +1 -1
  382. package/build-types/tabs/types.d.ts +85 -48
  383. package/build-types/tabs/types.d.ts.map +1 -1
  384. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  385. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  386. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  387. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  388. package/build-types/utils/deprecated-36px-size.d.ts +6 -0
  389. package/build-types/utils/deprecated-36px-size.d.ts.map +1 -0
  390. package/build-types/utils/element-rect.d.ts +1 -1
  391. package/build-types/utils/element-rect.d.ts.map +1 -1
  392. package/build-types/utils/hooks/use-animated-offset-rect.d.ts +8 -1
  393. package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -1
  394. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  395. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
  396. package/package.json +20 -19
  397. package/src/alignment-matrix-control/README.md +1 -2
  398. package/src/angle-picker-control/README.md +1 -2
  399. package/src/animate/stories/index.story.tsx +2 -1
  400. package/src/autocomplete/autocompleter-ui.native.js +2 -4
  401. package/src/autocomplete/autocompleter-ui.tsx +2 -6
  402. package/src/autocomplete/index.tsx +4 -5
  403. package/src/base-control/README.md +58 -47
  404. package/src/base-control/docs-manifest.json +12 -0
  405. package/src/base-control/stories/index.story.tsx +4 -0
  406. package/src/base-control/types.ts +3 -0
  407. package/src/border-box-control/border-box-control/README.md +1 -0
  408. package/src/border-box-control/border-box-control/component.tsx +1 -0
  409. package/src/border-box-control/border-box-control/hook.ts +7 -0
  410. package/src/border-box-control/stories/index.story.tsx +1 -0
  411. package/src/border-box-control/test/index.tsx +1 -0
  412. package/src/border-control/border-control/README.md +1 -0
  413. package/src/border-control/border-control/component.tsx +1 -0
  414. package/src/border-control/border-control/hook.ts +7 -1
  415. package/src/border-control/border-control-dropdown/component.tsx +24 -12
  416. package/src/border-control/stories/index.story.tsx +1 -0
  417. package/src/border-control/test/index.js +1 -0
  418. package/src/button/stories/index.story.tsx +2 -1
  419. package/src/card/stories/index.story.tsx +2 -1
  420. package/src/color-palette/index.native.js +1 -2
  421. package/src/color-palette/index.tsx +1 -1
  422. package/src/color-palette/style.scss +2 -4
  423. package/src/color-picker/index.native.js +0 -1
  424. package/src/composite/legacy/index.tsx +5 -2
  425. package/src/composite/stories/index.story.tsx +2 -1
  426. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +1 -1
  427. package/src/date-time/date/index.tsx +0 -1
  428. package/src/disabled/stories/index.story.tsx +2 -1
  429. package/src/draggable/stories/index.story.tsx +2 -1
  430. package/src/font-size-picker/index.native.js +7 -7
  431. package/src/form-token-field/index.tsx +0 -3
  432. package/src/form-token-field/style.scss +4 -1
  433. package/src/form-token-field/suggestions-list.tsx +6 -0
  434. package/src/item-group/stories/index.story.tsx +8 -4
  435. package/src/keyboard-shortcuts/stories/index.story.tsx +2 -1
  436. package/src/{dropdown-menu-v2 → menu}/README.md +34 -34
  437. package/src/{dropdown-menu-v2 → menu}/checkbox-item.tsx +14 -14
  438. package/src/menu/context.tsx +13 -0
  439. package/src/{dropdown-menu-v2 → menu}/group-label.tsx +8 -8
  440. package/src/menu/group.tsx +26 -0
  441. package/src/{dropdown-menu-v2 → menu}/index.tsx +65 -70
  442. package/src/{dropdown-menu-v2 → menu}/item-help-text.tsx +3 -7
  443. package/src/{dropdown-menu-v2 → menu}/item-label.tsx +3 -7
  444. package/src/{dropdown-menu-v2 → menu}/item.tsx +13 -13
  445. package/src/{dropdown-menu-v2 → menu}/radio-item.tsx +14 -14
  446. package/src/menu/separator.tsx +27 -0
  447. package/src/menu/stories/index.story.tsx +542 -0
  448. package/src/{dropdown-menu-v2 → menu}/styles.ts +17 -17
  449. package/src/{dropdown-menu-v2 → menu}/test/index.tsx +145 -225
  450. package/src/{dropdown-menu-v2 → menu}/types.ts +24 -23
  451. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
  452. package/src/mobile/bottom-sheet/range-cell.native.js +1 -1
  453. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  454. package/src/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  455. package/src/mobile/bottom-sheet-select-control/index.native.js +2 -2
  456. package/src/mobile/color-settings/index.native.js +1 -3
  457. package/src/mobile/color-settings/picker-screen.native.js +1 -3
  458. package/src/mobile/image/index.native.js +1 -3
  459. package/src/mobile/keyboard-avoiding-view/index.ios.js +1 -3
  460. package/src/mobile/link-picker/link-picker-results.native.js +2 -5
  461. package/src/mobile/link-picker/link-picker-screen.native.js +1 -3
  462. package/src/mobile/link-settings/index.native.js +6 -18
  463. package/src/mobile/link-settings/link-settings-screen.native.js +1 -3
  464. package/src/mobile/segmented-control/index.native.js +2 -6
  465. package/src/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  466. package/src/navigable-container/stories/navigable-menu.story.tsx +2 -1
  467. package/src/navigable-container/stories/tabbable-container.story.tsx +2 -1
  468. package/src/navigation/index.tsx +1 -2
  469. package/src/navigation/item/use-navigation-tree-item.tsx +2 -2
  470. package/src/navigation/menu/menu-title-search.tsx +2 -2
  471. package/src/navigation/menu/use-navigation-tree-menu.tsx +2 -2
  472. package/src/palette-edit/index.tsx +4 -5
  473. package/src/palette-edit/styles.ts +1 -67
  474. package/src/panel/stories/index.story.tsx +2 -1
  475. package/src/private-apis.ts +3 -3
  476. package/src/radio-group/index.tsx +2 -0
  477. package/src/resizable-box/stories/index.story.tsx +2 -1
  478. package/src/sandbox/index.native.js +1 -3
  479. package/src/sandbox/index.tsx +3 -6
  480. package/src/sandbox/stories/index.story.tsx +2 -1
  481. package/src/scroll-lock/stories/index.story.tsx +2 -1
  482. package/src/search-control/index.native.js +1 -3
  483. package/src/shortcut/stories/index.story.tsx +2 -1
  484. package/src/slot-fill/bubbles-virtually/slot.tsx +1 -2
  485. package/src/slot-fill/fill.ts +3 -6
  486. package/src/slot-fill/stories/index.story.tsx +2 -1
  487. package/src/spacer/hook.ts +3 -2
  488. package/src/tab-panel/index.tsx +3 -0
  489. package/src/tab-panel/stories/index.story.tsx +2 -1
  490. package/src/tab-panel/style.scss +1 -3
  491. package/src/tabs/README.md +63 -21
  492. package/src/tabs/index.tsx +112 -189
  493. package/src/tabs/stories/index.story.tsx +5 -2
  494. package/src/tabs/styles.ts +13 -5
  495. package/src/tabs/tab.tsx +23 -3
  496. package/src/tabs/tablist.tsx +31 -15
  497. package/src/tabs/test/index.tsx +131 -118
  498. package/src/tabs/types.ts +89 -49
  499. package/src/theme/stories/index.story.tsx +2 -1
  500. package/src/toggle-group-control/toggle-group-control/component.tsx +1 -0
  501. package/src/toolbar/toolbar/index.tsx +3 -0
  502. package/src/tools-panel/tools-panel-header/component.tsx +1 -1
  503. package/src/tools-panel/tools-panel-item/hook.ts +0 -2
  504. package/src/tooltip/index.native.js +5 -15
  505. package/src/unit-control/index.native.js +2 -6
  506. package/src/utils/deprecated-36px-size.ts +24 -0
  507. package/src/utils/element-rect.ts +14 -2
  508. package/src/utils/hooks/use-animated-offset-rect.ts +13 -1
  509. package/src/utils/hooks/use-update-effect.js +0 -2
  510. package/src/visually-hidden/stories/index.story.tsx +2 -1
  511. package/tsconfig.tsbuildinfo +1 -1
  512. package/build/dropdown-menu-v2/checkbox-item.js.map +0 -1
  513. package/build/dropdown-menu-v2/context.js.map +0 -1
  514. package/build/dropdown-menu-v2/group-label.js.map +0 -1
  515. package/build/dropdown-menu-v2/group.js.map +0 -1
  516. package/build/dropdown-menu-v2/index.js.map +0 -1
  517. package/build/dropdown-menu-v2/item-help-text.js.map +0 -1
  518. package/build/dropdown-menu-v2/item-label.js.map +0 -1
  519. package/build/dropdown-menu-v2/item.js.map +0 -1
  520. package/build/dropdown-menu-v2/radio-item.js.map +0 -1
  521. package/build/dropdown-menu-v2/separator.js.map +0 -1
  522. package/build/dropdown-menu-v2/styles.js +0 -150
  523. package/build/dropdown-menu-v2/styles.js.map +0 -1
  524. package/build/dropdown-menu-v2/types.js.map +0 -1
  525. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
  526. package/build-module/dropdown-menu-v2/checkbox-item.js.map +0 -1
  527. package/build-module/dropdown-menu-v2/context.js.map +0 -1
  528. package/build-module/dropdown-menu-v2/group-label.js.map +0 -1
  529. package/build-module/dropdown-menu-v2/group.js +0 -21
  530. package/build-module/dropdown-menu-v2/group.js.map +0 -1
  531. package/build-module/dropdown-menu-v2/index.js.map +0 -1
  532. package/build-module/dropdown-menu-v2/item-help-text.js.map +0 -1
  533. package/build-module/dropdown-menu-v2/item-label.js.map +0 -1
  534. package/build-module/dropdown-menu-v2/item.js.map +0 -1
  535. package/build-module/dropdown-menu-v2/radio-item.js.map +0 -1
  536. package/build-module/dropdown-menu-v2/separator.js +0 -22
  537. package/build-module/dropdown-menu-v2/separator.js.map +0 -1
  538. package/build-module/dropdown-menu-v2/styles.js +0 -143
  539. package/build-module/dropdown-menu-v2/styles.js.map +0 -1
  540. package/build-module/dropdown-menu-v2/types.js.map +0 -1
  541. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
  542. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +0 -3
  543. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +0 -1
  544. package/build-types/dropdown-menu-v2/context.d.ts +0 -6
  545. package/build-types/dropdown-menu-v2/context.d.ts.map +0 -1
  546. package/build-types/dropdown-menu-v2/group-label.d.ts +0 -3
  547. package/build-types/dropdown-menu-v2/group-label.d.ts.map +0 -1
  548. package/build-types/dropdown-menu-v2/group.d.ts +0 -3
  549. package/build-types/dropdown-menu-v2/group.d.ts.map +0 -1
  550. package/build-types/dropdown-menu-v2/index.d.ts +0 -40
  551. package/build-types/dropdown-menu-v2/index.d.ts.map +0 -1
  552. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +0 -1
  553. package/build-types/dropdown-menu-v2/item-label.d.ts.map +0 -1
  554. package/build-types/dropdown-menu-v2/item.d.ts +0 -3
  555. package/build-types/dropdown-menu-v2/item.d.ts.map +0 -1
  556. package/build-types/dropdown-menu-v2/radio-item.d.ts +0 -3
  557. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +0 -1
  558. package/build-types/dropdown-menu-v2/separator.d.ts +0 -3
  559. package/build-types/dropdown-menu-v2/separator.d.ts.map +0 -1
  560. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +0 -16
  561. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +0 -1
  562. package/build-types/dropdown-menu-v2/styles.d.ts.map +0 -1
  563. package/build-types/dropdown-menu-v2/test/index.d.ts.map +0 -1
  564. package/build-types/dropdown-menu-v2/types.d.ts.map +0 -1
  565. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +0 -1
  566. package/src/dropdown-menu-v2/context.tsx +0 -13
  567. package/src/dropdown-menu-v2/group.tsx +0 -26
  568. package/src/dropdown-menu-v2/separator.tsx +0 -27
  569. package/src/dropdown-menu-v2/stories/index.story.tsx +0 -639
  570. /package/build/{dropdown-menu-v2 → menu}/types.js +0 -0
  571. /package/build/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
  572. /package/build-module/{dropdown-menu-v2 → menu}/types.js +0 -0
  573. /package/build-module/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
  574. /package/build-types/{dropdown-menu-v2 → menu}/test/index.d.ts +0 -0
  575. /package/build-types/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.d.ts +0 -0
  576. /package/src/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.ts +0 -0
@@ -165,9 +165,8 @@ export function getAutoCompleterUI( autocompleter: WPCompleter ) {
165
165
  useLayoutEffect( () => {
166
166
  onChangeOptions( items );
167
167
  announce( items );
168
- // Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.
168
+ // We want to avoid introducing unexpected side effects.
169
169
  // See https://github.com/WordPress/gutenberg/pull/41820
170
- // eslint-disable-next-line react-hooks/exhaustive-deps
171
170
  }, [ items ] );
172
171
 
173
172
  if ( items.length === 0 ) {
@@ -235,8 +234,5 @@ function useOnClickOutside(
235
234
  document.removeEventListener( 'mousedown', listener );
236
235
  document.removeEventListener( 'touchstart', listener );
237
236
  };
238
- // Disable reason: `ref` is a ref object and should not be included in a
239
- // hook's dependency list.
240
- // eslint-disable-next-line react-hooks/exhaustive-deps
241
- }, [ handler ] );
237
+ }, [ handler, ref ] );
242
238
  }
@@ -97,7 +97,7 @@ export function useAutocomplete( {
97
97
  ( ( props: AutocompleterUIProps ) => JSX.Element | null ) | null
98
98
  >( null );
99
99
 
100
- const backspacing = useRef( false );
100
+ const backspacingRef = useRef( false );
101
101
 
102
102
  function insertCompletion( replacement: React.ReactNode ) {
103
103
  if ( autocompleter === null ) {
@@ -177,7 +177,7 @@ export function useAutocomplete( {
177
177
  }
178
178
 
179
179
  function handleKeyDown( event: KeyboardEvent ) {
180
- backspacing.current = event.key === 'Backspace';
180
+ backspacingRef.current = event.key === 'Backspace';
181
181
 
182
182
  if ( ! autocompleter ) {
183
183
  return;
@@ -323,7 +323,7 @@ export function useAutocomplete( {
323
323
  // Ex: "Some text @marcelo sekkkk" <--- "kkkk" caused a mismatch, but
324
324
  // if the user presses backspace here, it will show the completion popup again.
325
325
  const matchingWhileBackspacing =
326
- backspacing.current && wordsFromTrigger.length <= 3;
326
+ backspacingRef.current && wordsFromTrigger.length <= 3;
327
327
 
328
328
  if ( mismatch && ! ( matchingWhileBackspacing || hasOneTriggerWord ) ) {
329
329
  if ( autocompleter ) {
@@ -380,9 +380,8 @@ export function useAutocomplete( {
380
380
  : AutocompleterUI
381
381
  );
382
382
  setFilterValue( query === null ? '' : query );
383
- // Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.
383
+ // We want to avoid introducing unexpected side effects.
384
384
  // See https://github.com/WordPress/gutenberg/pull/41820
385
- // eslint-disable-next-line react-hooks/exhaustive-deps
386
385
  }, [ textContent ] );
387
386
 
388
387
  const { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};
@@ -1,8 +1,10 @@
1
1
  # BaseControl
2
2
 
3
- `BaseControl` is a component used to generate labels and help text for components handling user inputs.
3
+ <!-- This file is generated automatically and cannot be edited directly. Make edits via TypeScript types and TSDocs. -->
4
+
5
+ <p class="callout callout-info">See the <a href="https://wordpress.github.io/gutenberg/?path=/docs/components-basecontrol--docs">WordPress Storybook</a> for more detailed, interactive documentation.</p>
4
6
 
5
- ## Usage
7
+ `BaseControl` is a component used to generate labels and help text for components handling user inputs.
6
8
 
7
9
  ```jsx
8
10
  import { BaseControl, useBaseControlProps } from '@wordpress/components';
@@ -23,70 +25,80 @@ const MyCustomTextareaControl = ({ children, ...baseProps }) => (
23
25
  );
24
26
  );
25
27
  ```
26
-
27
28
  ## Props
28
29
 
29
- The component accepts the following props:
30
+ ### `__nextHasNoMarginBottom`
30
31
 
31
- ### id
32
+ Start opting into the new margin-free styles that will become the default in a future version.
32
33
 
33
- The HTML `id` of the control element (passed in as a child to `BaseControl`) to which labels and help text are being generated. This is necessary to accessibly associate the label with that element.
34
+ - Type: `boolean`
35
+ - Required: No
36
+ - Default: `false`
34
37
 
35
- The recommended way is to use the `useBaseControlProps` hook, which takes care of generating a unique `id` for you. Otherwise, if you choose to pass an explicit `id` to this prop, you are responsible for ensuring the uniqueness of the `id`.
38
+ ### `as`
36
39
 
37
- - Type: `String`
38
- - Required: No
40
+ The HTML element or React component to render the component as.
39
41
 
40
- ### label
42
+ - Type: `"symbol" | "object" | "label" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | ... 516 more ... | ("view" & FunctionComponent<...>)`
43
+ - Required: No
41
44
 
42
- If this property is added, a label will be generated using label property as the content.
45
+ ### `className`
43
46
 
44
- - Type: `String`
45
- - Required: No
46
47
 
47
- ### hideLabelFromVision
48
+ - Type: `string`
49
+ - Required: No
48
50
 
49
- If true, the label will only be visible to screen readers.
51
+ ### `children`
52
+
53
+ The content to be displayed within the `BaseControl`.
50
54
 
51
- - Type: `Boolean`
52
- - Required: No
55
+ - Type: `ReactNode`
56
+ - Required: Yes
53
57
 
54
- ### help
58
+ ### `help`
55
59
 
56
- Additional description for the control. Only use for meaningful description or instructions for the control. An element containing the description will be programmatically associated to the BaseControl by the means of an `aria-describedby` attribute.
60
+ Additional description for the control.
57
61
 
58
- - Type: `ReactNode`
59
- - Required: No
62
+ Only use for meaningful description or instructions for the control. An element containing the description will be programmatically associated to the BaseControl by the means of an `aria-describedby` attribute.
60
63
 
61
- ### className
64
+ - Type: `ReactNode`
65
+ - Required: No
62
66
 
63
- Any other classes to add to the wrapper div.
67
+ ### `hideLabelFromVision`
64
68
 
65
- - Type: `String`
66
- - Required: No
69
+ If true, the label will only be visible to screen readers.
67
70
 
68
- ### children
71
+ - Type: `boolean`
72
+ - Required: No
73
+ - Default: `false`
69
74
 
70
- The content to be displayed within the BaseControl.
75
+ ### `id`
71
76
 
72
- - Type: `Element`
73
- - Required: Yes
77
+ The HTML `id` of the control element (passed in as a child to `BaseControl`) to which labels and help text are being generated.
78
+ This is necessary to accessibly associate the label with that element.
74
79
 
75
- ### __nextHasNoMarginBottom
80
+ The recommended way is to use the `useBaseControlProps` hook, which takes care of generating a unique `id` for you.
81
+ Otherwise, if you choose to pass an explicit `id` to this prop, you are responsible for ensuring the uniqueness of the `id`.
76
82
 
77
- Start opting into the new margin-free styles that will become the default in a future version.
83
+ - Type: `string`
84
+ - Required: No
78
85
 
79
- - Type: `Boolean`
80
- - Required: No
81
- - Default: `false`
86
+ ### `label`
82
87
 
83
- ## BaseControl.VisualLabel
88
+ If this property is added, a label will be generated using label property as the content.
84
89
 
85
- `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.
90
+ - Type: `ReactNode`
91
+ - Required: No
86
92
 
87
- It should only be used in cases where the children being rendered inside BaseControl are already accessibly labeled, e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would otherwise use if the `label` prop was passed.
93
+ ## Subcomponents
88
94
 
89
- ## Usage
95
+ ### BaseControl.VisualLabel
96
+
97
+ `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.
98
+
99
+ It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,
100
+ e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would
101
+ otherwise use if the `label` prop was passed.
90
102
 
91
103
  ```jsx
92
104
  import { BaseControl } from '@wordpress/components';
@@ -101,19 +113,18 @@ const MyBaseControl = () => (
101
113
  </BaseControl>
102
114
  );
103
115
  ```
116
+ #### Props
104
117
 
105
- ### Props
106
-
107
- #### className
118
+ ##### `as`
108
119
 
109
- Any other classes to add to the wrapper div.
120
+ The HTML element or React component to render the component as.
110
121
 
111
- - Type: `String`
112
- - Required: No
122
+ - Type: `"symbol" | "object" | "label" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | ...`
123
+ - Required: No
113
124
 
114
- #### children
125
+ ##### `children`
115
126
 
116
127
  The content to be displayed within the `BaseControl.VisualLabel`.
117
128
 
118
- - Type: `Element`
119
- - Required: Yes
129
+ - Type: `ReactNode`
130
+ - Required: Yes
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "../../schemas/docs-manifest.json",
3
+ "displayName": "BaseControl",
4
+ "filePath": "./index.tsx",
5
+ "subcomponents": [
6
+ {
7
+ "displayName": "VisualLabel",
8
+ "preferredDisplayName": "BaseControl.VisualLabel",
9
+ "filePath": "./index.tsx"
10
+ }
11
+ ]
12
+ }
@@ -12,6 +12,10 @@ import Button from '../../button';
12
12
  const meta: Meta< typeof BaseControl > = {
13
13
  title: 'Components/BaseControl',
14
14
  component: BaseControl,
15
+ subcomponents: {
16
+ // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
17
+ 'BaseControl.VisualLabel': BaseControl.VisualLabel,
18
+ },
15
19
  argTypes: {
16
20
  children: { control: { type: null } },
17
21
  help: { control: { type: 'text' } },
@@ -49,5 +49,8 @@ export type BaseControlProps = {
49
49
  };
50
50
 
51
51
  export type BaseControlVisualLabelProps = {
52
+ /**
53
+ * The content to be displayed within the `BaseControl.VisualLabel`.
54
+ */
52
55
  children: ReactNode;
53
56
  };
@@ -47,6 +47,7 @@ const MyBorderBoxControl = () => {
47
47
 
48
48
  return (
49
49
  <BorderBoxControl
50
+ __next40pxDefaultSize
50
51
  colors={ colors }
51
52
  label={ __( 'Borders' ) }
52
53
  onChange={ onChange }
@@ -175,6 +175,7 @@ const UnconnectedBorderBoxControl = (
175
175
  *
176
176
  * return (
177
177
  * <BorderBoxControl
178
+ * __next40pxDefaultSize
178
179
  * colors={ colors }
179
180
  * label={ __( 'Borders' ) }
180
181
  * onChange={ onChange }
@@ -19,6 +19,7 @@ import {
19
19
  import type { WordPressComponentProps } from '../../context';
20
20
  import { useContextSystem } from '../../context';
21
21
  import { useCx } from '../../utils/hooks/use-cx';
22
+ import { maybeWarnDeprecated36pxSize } from '../../utils/deprecated-36px-size';
22
23
 
23
24
  import type { Border } from '../../border-control/types';
24
25
  import type { Borders, BorderSide, BorderBoxControlProps } from '../types';
@@ -39,6 +40,12 @@ export function useBorderBoxControl(
39
40
  ...otherProps
40
41
  } = useContextSystem( props, 'BorderBoxControl' );
41
42
 
43
+ maybeWarnDeprecated36pxSize( {
44
+ componentName: 'BorderBoxControl',
45
+ __next40pxDefaultSize,
46
+ size,
47
+ } );
48
+
42
49
  const computedSize =
43
50
  size === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;
44
51
 
@@ -84,4 +84,5 @@ Default.args = {
84
84
  colors,
85
85
  label: 'Borders',
86
86
  enableStyle: true,
87
+ __next40pxDefaultSize: true,
87
88
  };
@@ -44,6 +44,7 @@ const props = {
44
44
  props.value = newValue;
45
45
  } ),
46
46
  value: undefined,
47
+ __next40pxDefaultSize: true,
47
48
  };
48
49
 
49
50
  const toggleLabelRegex = /Border color( and style)* picker/;
@@ -30,6 +30,7 @@ const MyBorderControl = () => {
30
30
 
31
31
  return (
32
32
  <BorderControl
33
+ __next40pxDefaultSize
33
34
  colors={ colors }
34
35
  label={ __( 'Border' ) }
35
36
  onChange={ setBorder }
@@ -154,6 +154,7 @@ const UnconnectedBorderControl = (
154
154
  *
155
155
  * return (
156
156
  * <BorderControl
157
+ * __next40pxDefaultSize
157
158
  * colors={ colors }
158
159
  * label={ __( 'Border' ) }
159
160
  * onChange={ onChange }
@@ -11,8 +11,8 @@ import { parseQuantityAndUnitFromRawValue } from '../../unit-control/utils';
11
11
  import type { WordPressComponentProps } from '../../context';
12
12
  import { useContextSystem } from '../../context';
13
13
  import { useCx } from '../../utils/hooks/use-cx';
14
-
15
14
  import type { Border, BorderControlProps } from '../types';
15
+ import { maybeWarnDeprecated36pxSize } from '../../utils/deprecated-36px-size';
16
16
 
17
17
  // If either width or color are defined, the border is considered valid
18
18
  // and a border style can be set as well.
@@ -41,6 +41,12 @@ export function useBorderControl(
41
41
  ...otherProps
42
42
  } = useContextSystem( props, 'BorderControl' );
43
43
 
44
+ maybeWarnDeprecated36pxSize( {
45
+ componentName: 'BorderControl',
46
+ __next40pxDefaultSize,
47
+ size,
48
+ } );
49
+
44
50
  const computedSize =
45
51
  size === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;
46
52
 
@@ -73,15 +73,19 @@ const getToggleAriaLabel = (
73
73
  const ariaLabelValue = getAriaLabelColorValue( colorObject.color );
74
74
  return style
75
75
  ? sprintf(
76
- // translators: %1$s: The name of the color e.g. "vivid red". %2$s: The color's hex code e.g.: "#f00:". %3$s: The current border style selection e.g. "solid".
77
- 'Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".',
76
+ // translators: 1: The name of the color e.g. "vivid red". 2: The color's hex code e.g.: "#f00:". 3: The current border style selection e.g. "solid".
77
+ __(
78
+ 'Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".'
79
+ ),
78
80
  colorObject.name,
79
81
  ariaLabelValue,
80
82
  style
81
83
  )
82
84
  : sprintf(
83
- // translators: %1$s: The name of the color e.g. "vivid red". %2$s: The color's hex code e.g.: "#f00:".
84
- 'Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".',
85
+ // translators: 1: The name of the color e.g. "vivid red". 2: The color's hex code e.g.: "#f00:".
86
+ __(
87
+ 'Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".'
88
+ ),
85
89
  colorObject.name,
86
90
  ariaLabelValue
87
91
  );
@@ -91,14 +95,18 @@ const getToggleAriaLabel = (
91
95
  const ariaLabelValue = getAriaLabelColorValue( colorValue );
92
96
  return style
93
97
  ? sprintf(
94
- // translators: %1$s: The color's hex code e.g.: "#f00:". %2$s: The current border style selection e.g. "solid".
95
- 'Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".',
98
+ // translators: 1: The color's hex code e.g.: "#f00:". 2: The current border style selection e.g. "solid".
99
+ __(
100
+ 'Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".'
101
+ ),
96
102
  ariaLabelValue,
97
103
  style
98
104
  )
99
105
  : sprintf(
100
- // translators: %1$s: The color's hex code e.g: "#f00".
101
- 'Border color and style picker. The currently selected color has a value of "%1$s".',
106
+ // translators: %s: The color's hex code e.g: "#f00".
107
+ __(
108
+ 'Border color and style picker. The currently selected color has a value of "%s".'
109
+ ),
102
110
  ariaLabelValue
103
111
  );
104
112
  }
@@ -108,8 +116,10 @@ const getToggleAriaLabel = (
108
116
 
109
117
  if ( colorObject ) {
110
118
  return sprintf(
111
- // translators: %1$s: The name of the color e.g. "vivid red". %2$s: The color's hex code e.g: "#f00".
112
- 'Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".',
119
+ // translators: 1: The name of the color e.g. "vivid red". 2: The color's hex code e.g: "#f00".
120
+ __(
121
+ 'Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'
122
+ ),
113
123
  colorObject.name,
114
124
  getAriaLabelColorValue( colorObject.color )
115
125
  );
@@ -117,8 +127,10 @@ const getToggleAriaLabel = (
117
127
 
118
128
  if ( colorValue ) {
119
129
  return sprintf(
120
- // translators: %1$s: The color's hex code e.g: "#f00".
121
- 'Border color picker. The currently selected color has a value of "%1$s".',
130
+ // translators: %s: The color's hex code e.g: "#f00".
131
+ __(
132
+ 'Border color picker. The currently selected color has a value of "%s".'
133
+ ),
122
134
  getAriaLabelColorValue( colorValue )
123
135
  );
124
136
  }
@@ -93,6 +93,7 @@ export const Default = Template.bind( {} );
93
93
  Default.args = {
94
94
  colors,
95
95
  label: 'Border',
96
+ __next40pxDefaultSize: true,
96
97
  enableAlpha: true,
97
98
  enableStyle: true,
98
99
  shouldSanitizeBorder: true,
@@ -31,6 +31,7 @@ function createProps( customProps ) {
31
31
  props.value = newValue;
32
32
  } ),
33
33
  value: defaultBorder,
34
+ __next40pxDefaultSize: true,
34
35
  ...customProps,
35
36
  };
36
37
  return props;
@@ -22,7 +22,8 @@ import './style.css';
22
22
  import Button from '..';
23
23
 
24
24
  const meta: Meta< typeof Button > = {
25
- title: 'Components/Button',
25
+ title: 'Components/Actions/Button',
26
+ id: 'components-button',
26
27
  component: Button,
27
28
  argTypes: {
28
29
  // Overrides a limitation of the docgen interpreting our TS types for this as required.
@@ -22,7 +22,8 @@ const meta: Meta< typeof Card > = {
22
22
  component: Card,
23
23
  // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
24
24
  subcomponents: { CardHeader, CardBody, CardDivider, CardMedia, CardFooter },
25
- title: 'Components/Card',
25
+ title: 'Components/Containers/Card',
26
+ id: 'components-card',
26
27
  argTypes: {
27
28
  as: {
28
29
  control: { type: null },
@@ -115,9 +115,8 @@ function ColorPalette( {
115
115
  scrollViewRef.current.scrollTo( { x: 0, y: 0 } );
116
116
  }
117
117
  }
118
- // Temporarily disabling exhuastive-deps until the component can be refactored and updated safely.
118
+ // Not adding additional dependencies until the component can be refactored and updated safely.
119
119
  // Please see https://github.com/WordPress/gutenberg/pull/41253 for discussion and details.
120
- // eslint-disable-next-line react-hooks/exhaustive-deps
121
120
  }, [ currentSegment ] );
122
121
 
123
122
  function isSelectedCustom() {
@@ -233,7 +233,7 @@ function UnforwardedColorPalette(
233
233
  const displayValue = value?.replace( /^var\((.+)\)$/, '$1' );
234
234
  const customColorAccessibleLabel = !! displayValue
235
235
  ? sprintf(
236
- // translators: %1$s: The name of the color e.g: "vivid red". %2$s: The color's hex code e.g: "#f00".
236
+ // translators: 1: The name of the color e.g: "vivid red". 2: The color's hex code e.g: "#f00".
237
237
  __(
238
238
  'Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'
239
239
  ),
@@ -26,10 +26,7 @@ $border-as-box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.2);
26
26
  &::after {
27
27
  content: "";
28
28
  position: absolute;
29
- top: 0;
30
- left: 0;
31
- width: 100%;
32
- height: 100%;
29
+ inset: $border-width;
33
30
  z-index: -1;
34
31
  // The background image creates a checkerboard pattern. Ignore rtlcss to
35
32
  // make it work both in LTR and RTL.
@@ -41,6 +38,7 @@ $border-as-box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.2);
41
38
  background-position: 0 0, 24px 24px;
42
39
  /*rtl:end:ignore*/
43
40
  background-size: calc(2 * 24px) calc(2 * 24px);
41
+ border-radius: $radius-medium - $border-width $radius-medium - $border-width 0 0;
44
42
  }
45
43
  }
46
44
 
@@ -111,7 +111,6 @@ function ColorPicker( {
111
111
  // the hook’s dependencies and running it a single time. Ideally there
112
112
  // may be a way to refactor and obviate the disabled lint rule. If not,
113
113
  // this comment should be replaced by one that explains the reasoning.
114
- // eslint-disable-next-line react-hooks/exhaustive-deps
115
114
  }, [] );
116
115
 
117
116
  function onButtonPress( action ) {
@@ -151,8 +151,11 @@ function proxyComposite< C extends Component >(
151
151
 
152
152
  const { store, ...rest } =
153
153
  mapLegacyStatePropsToComponentProps( legacyProps );
154
- const props = rest as ComponentProps< C >;
155
- props.id = useInstanceId( store, props.baseId, props.id );
154
+ let props = rest as ComponentProps< C >;
155
+ props = {
156
+ ...props,
157
+ id: useInstanceId( store, props.baseId, props.id ),
158
+ };
156
159
 
157
160
  Object.entries( propMap ).forEach( ( [ from, to ] ) => {
158
161
  if ( props.hasOwnProperty( from ) ) {
@@ -16,7 +16,8 @@ import { Composite } from '..';
16
16
  import { Tooltip } from '../../tooltip';
17
17
 
18
18
  const meta: Meta< typeof Composite > = {
19
- title: 'Components/Composite',
19
+ title: 'Components/Utilities/Composite',
20
+ id: 'components-composite',
20
21
  component: Composite,
21
22
  subcomponents: {
22
23
  // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
@@ -56,7 +56,7 @@ function ControlPointButton( {
56
56
  <>
57
57
  <Button
58
58
  aria-label={ sprintf(
59
- // translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151).
59
+ // translators: 1: gradient position e.g: 70. 2: gradient color code e.g: rgb(52,121,151).
60
60
  __(
61
61
  'Gradient control point at position %1$s%% with color code %2$s.'
62
62
  ),
@@ -302,7 +302,6 @@ function Day( {
302
302
  }
303
303
  // isFocusAllowed is not a dep as there is no point calling focus() on
304
304
  // an already focused element.
305
- // eslint-disable-next-line react-hooks/exhaustive-deps
306
305
  }, [ isFocusable ] );
307
306
 
308
307
  return (
@@ -18,7 +18,8 @@ import TextareaControl from '../../textarea-control/';
18
18
  import { VStack } from '../../v-stack/';
19
19
 
20
20
  const meta: Meta< typeof Disabled > = {
21
- title: 'Components/Disabled',
21
+ title: 'Components/Utilities/Disabled',
22
+ id: 'components-disabled',
22
23
  component: Disabled,
23
24
  argTypes: {
24
25
  as: { control: { type: null } },
@@ -18,7 +18,8 @@ import Draggable from '..';
18
18
 
19
19
  const meta: Meta< typeof Draggable > = {
20
20
  component: Draggable,
21
- title: 'Components/Draggable',
21
+ title: 'Components/Utilities/Draggable',
22
+ id: 'components-draggable',
22
23
  argTypes: {
23
24
  elementId: { control: { type: null } },
24
25
  __experimentalDragComponent: { control: { type: null } },
@@ -9,7 +9,7 @@ import { View, useWindowDimensions } from 'react-native';
9
9
  import { useNavigation } from '@react-navigation/native';
10
10
  import { useState } from '@wordpress/element';
11
11
  import { Icon, chevronRight, check } from '@wordpress/icons';
12
- import { __, sprintf } from '@wordpress/i18n';
12
+ import { __, _x, sprintf } from '@wordpress/i18n';
13
13
 
14
14
  /**
15
15
  * Internal dependencies
@@ -63,8 +63,8 @@ function FontSizePicker( {
63
63
  } );
64
64
 
65
65
  const accessibilityLabel = sprintf(
66
- // translators: %1$s: Font size name e.g. Small
67
- __( 'Font Size, %1$s' ),
66
+ // translators: %s: Font size name e.g. Small
67
+ __( 'Font Size, %s' ),
68
68
  selectedOption.name
69
69
  );
70
70
 
@@ -77,8 +77,8 @@ function FontSizePicker( {
77
77
  value={
78
78
  selectedValue
79
79
  ? sprintf(
80
- // translators: %1$s: Select control font size name e.g. Small, %2$s: Select control font size e.g. 12px
81
- __( '%1$s (%2$s)' ),
80
+ // translators: 1: Select control font size name e.g. Small. 2: Select control font size e.g. 12px
81
+ _x( '%1$s (%2$s)', 'font size' ),
82
82
  selectedOption.name,
83
83
  selectedPxValue
84
84
  )
@@ -88,7 +88,7 @@ function FontSizePicker( {
88
88
  accessibilityRole="button"
89
89
  accessibilityLabel={ accessibilityLabel }
90
90
  accessibilityHint={ sprintf(
91
- // translators: %s: Select control button label e.g. Small
91
+ // translators: %s: Select control button label e.g. "Button width"
92
92
  __( 'Navigates to select %s' ),
93
93
  selectedOption.name
94
94
  ) }
@@ -143,7 +143,7 @@ function FontSizePicker( {
143
143
  accessibilityLabel={
144
144
  item.sizePx === selectedValue
145
145
  ? sprintf(
146
- // translators: %s: Select font size option value e.g: "Selected: Large".
146
+ // translators: %s: The selected option.
147
147
  __( 'Selected: %s' ),
148
148
  item.name
149
149
  )