@wordpress/components 29.0.0 → 29.1.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 (469) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/LICENSE.md +1 -1
  3. package/build/badge/index.js +64 -0
  4. package/build/badge/index.js.map +1 -0
  5. package/build/badge/types.js +6 -0
  6. package/build/badge/types.js.map +1 -0
  7. package/build/box-control/index.js +5 -1
  8. package/build/box-control/index.js.map +1 -1
  9. package/build/box-control/input-control.js +90 -29
  10. package/build/box-control/input-control.js.map +1 -1
  11. package/build/box-control/types.js.map +1 -1
  12. package/build/box-control/utils.js +50 -0
  13. package/build/box-control/utils.js.map +1 -1
  14. package/build/button-group/index.js +10 -0
  15. package/build/button-group/index.js.map +1 -1
  16. package/build/button-group/types.js.map +1 -1
  17. package/build/custom-select-control/index.js +3 -5
  18. package/build/custom-select-control/index.js.map +1 -1
  19. package/build/custom-select-control-v2/custom-select.js +2 -3
  20. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  21. package/build/date-time/date/index.js +1 -0
  22. package/build/date-time/date/index.js.map +1 -1
  23. package/build/dimension-control/index.js +1 -0
  24. package/build/dimension-control/index.js.map +1 -1
  25. package/build/font-size-picker/styles.js +9 -9
  26. package/build/font-size-picker/styles.js.map +1 -1
  27. package/build/heading/hook.js +1 -1
  28. package/build/heading/hook.js.map +1 -1
  29. package/build/input-control/index.js +9 -0
  30. package/build/input-control/index.js.map +1 -1
  31. package/build/input-control/types.js.map +1 -1
  32. package/build/menu/checkbox-item.js +2 -0
  33. package/build/menu/checkbox-item.js.map +1 -1
  34. package/build/menu/index.js +25 -94
  35. package/build/menu/index.js.map +1 -1
  36. package/build/menu/item.js +10 -1
  37. package/build/menu/item.js.map +1 -1
  38. package/build/menu/popover.js +89 -0
  39. package/build/menu/popover.js.map +1 -0
  40. package/build/menu/radio-item.js +2 -0
  41. package/build/menu/radio-item.js.map +1 -1
  42. package/build/menu/submenu-trigger-item.js +58 -0
  43. package/build/menu/submenu-trigger-item.js.map +1 -0
  44. package/build/menu/trigger-button.js +45 -0
  45. package/build/menu/trigger-button.js.map +1 -0
  46. package/build/menu/types.js.map +1 -1
  47. package/build/navigation/back-button/index.js +1 -0
  48. package/build/navigation/back-button/index.js.map +1 -1
  49. package/build/navigation/index.js +6 -0
  50. package/build/navigation/index.js.map +1 -1
  51. package/build/navigation/item/index.js +1 -0
  52. package/build/navigation/item/index.js.map +1 -1
  53. package/build/number-control/index.js +1 -0
  54. package/build/number-control/index.js.map +1 -1
  55. package/build/palette-edit/index.js +1 -0
  56. package/build/palette-edit/index.js.map +1 -1
  57. package/build/private-apis.js +3 -1
  58. package/build/private-apis.js.map +1 -1
  59. package/build/radio-group/index.js +6 -0
  60. package/build/radio-group/index.js.map +1 -1
  61. package/build/radio-group/radio.js +2 -3
  62. package/build/radio-group/radio.js.map +1 -1
  63. package/build/range-control/styles/range-control-styles.js +28 -28
  64. package/build/range-control/styles/range-control-styles.js.map +1 -1
  65. package/build/select-control/index.js +9 -0
  66. package/build/select-control/index.js.map +1 -1
  67. package/build/select-control/types.js.map +1 -1
  68. package/build/slot-fill/context.js +4 -3
  69. package/build/slot-fill/context.js.map +1 -1
  70. package/build/slot-fill/fill.js +10 -15
  71. package/build/slot-fill/fill.js.map +1 -1
  72. package/build/slot-fill/provider.js +41 -55
  73. package/build/slot-fill/provider.js.map +1 -1
  74. package/build/slot-fill/slot.js +31 -23
  75. package/build/slot-fill/slot.js.map +1 -1
  76. package/build/slot-fill/types.js.map +1 -1
  77. package/build/tab-panel/index.js +2 -3
  78. package/build/tab-panel/index.js.map +1 -1
  79. package/build/tabs/index.js +21 -4
  80. package/build/tabs/index.js.map +1 -1
  81. package/build/tabs/types.js.map +1 -1
  82. package/build/text/hook.js +6 -6
  83. package/build/text/hook.js.map +1 -1
  84. package/build/text/styles.js +7 -7
  85. package/build/text/styles.js.map +1 -1
  86. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +2 -3
  87. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  88. package/build/tooltip/index.js +2 -3
  89. package/build/tooltip/index.js.map +1 -1
  90. package/build/tree-select/index.js +10 -2
  91. package/build/tree-select/index.js.map +1 -1
  92. package/build/tree-select/types.js.map +1 -1
  93. package/build-module/badge/index.js +57 -0
  94. package/build-module/badge/index.js.map +1 -0
  95. package/build-module/badge/types.js +2 -0
  96. package/build-module/badge/types.js.map +1 -0
  97. package/build-module/box-control/index.js +5 -1
  98. package/build-module/box-control/index.js.map +1 -1
  99. package/build-module/box-control/input-control.js +92 -31
  100. package/build-module/box-control/input-control.js.map +1 -1
  101. package/build-module/box-control/types.js.map +1 -1
  102. package/build-module/box-control/utils.js +47 -0
  103. package/build-module/box-control/utils.js.map +1 -1
  104. package/build-module/button-group/index.js +10 -0
  105. package/build-module/button-group/index.js.map +1 -1
  106. package/build-module/button-group/types.js.map +1 -1
  107. package/build-module/custom-select-control/index.js +3 -5
  108. package/build-module/custom-select-control/index.js.map +1 -1
  109. package/build-module/custom-select-control-v2/custom-select.js +1 -2
  110. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  111. package/build-module/date-time/date/index.js +1 -0
  112. package/build-module/date-time/date/index.js.map +1 -1
  113. package/build-module/dimension-control/index.js +1 -0
  114. package/build-module/dimension-control/index.js.map +1 -1
  115. package/build-module/font-size-picker/styles.js +9 -9
  116. package/build-module/font-size-picker/styles.js.map +1 -1
  117. package/build-module/heading/hook.js +1 -1
  118. package/build-module/heading/hook.js.map +1 -1
  119. package/build-module/input-control/index.js +9 -0
  120. package/build-module/input-control/index.js.map +1 -1
  121. package/build-module/input-control/types.js.map +1 -1
  122. package/build-module/menu/checkbox-item.js +2 -0
  123. package/build-module/menu/checkbox-item.js.map +1 -1
  124. package/build-module/menu/index.js +28 -97
  125. package/build-module/menu/index.js.map +1 -1
  126. package/build-module/menu/item.js +10 -1
  127. package/build-module/menu/item.js.map +1 -1
  128. package/build-module/menu/popover.js +81 -0
  129. package/build-module/menu/popover.js.map +1 -0
  130. package/build-module/menu/radio-item.js +2 -0
  131. package/build-module/menu/radio-item.js.map +1 -1
  132. package/build-module/menu/submenu-trigger-item.js +50 -0
  133. package/build-module/menu/submenu-trigger-item.js.map +1 -0
  134. package/build-module/menu/trigger-button.js +37 -0
  135. package/build-module/menu/trigger-button.js.map +1 -0
  136. package/build-module/menu/types.js.map +1 -1
  137. package/build-module/navigation/back-button/index.js +1 -0
  138. package/build-module/navigation/back-button/index.js.map +1 -1
  139. package/build-module/navigation/index.js +6 -0
  140. package/build-module/navigation/index.js.map +1 -1
  141. package/build-module/navigation/item/index.js +1 -0
  142. package/build-module/navigation/item/index.js.map +1 -1
  143. package/build-module/number-control/index.js +1 -0
  144. package/build-module/number-control/index.js.map +1 -1
  145. package/build-module/palette-edit/index.js +1 -0
  146. package/build-module/palette-edit/index.js.map +1 -1
  147. package/build-module/private-apis.js +3 -1
  148. package/build-module/private-apis.js.map +1 -1
  149. package/build-module/radio-group/index.js +6 -0
  150. package/build-module/radio-group/index.js.map +1 -1
  151. package/build-module/radio-group/radio.js +1 -2
  152. package/build-module/radio-group/radio.js.map +1 -1
  153. package/build-module/range-control/styles/range-control-styles.js +28 -28
  154. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  155. package/build-module/select-control/index.js +9 -0
  156. package/build-module/select-control/index.js.map +1 -1
  157. package/build-module/select-control/types.js.map +1 -1
  158. package/build-module/slot-fill/context.js +5 -3
  159. package/build-module/slot-fill/context.js.map +1 -1
  160. package/build-module/slot-fill/fill.js +10 -15
  161. package/build-module/slot-fill/fill.js.map +1 -1
  162. package/build-module/slot-fill/provider.js +41 -55
  163. package/build-module/slot-fill/provider.js.map +1 -1
  164. package/build-module/slot-fill/slot.js +32 -24
  165. package/build-module/slot-fill/slot.js.map +1 -1
  166. package/build-module/slot-fill/types.js.map +1 -1
  167. package/build-module/tab-panel/index.js +1 -2
  168. package/build-module/tab-panel/index.js.map +1 -1
  169. package/build-module/tabs/index.js +21 -4
  170. package/build-module/tabs/index.js.map +1 -1
  171. package/build-module/tabs/types.js.map +1 -1
  172. package/build-module/text/hook.js +6 -6
  173. package/build-module/text/hook.js.map +1 -1
  174. package/build-module/text/styles.js +7 -7
  175. package/build-module/text/styles.js.map +1 -1
  176. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +1 -2
  177. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  178. package/build-module/tooltip/index.js +1 -2
  179. package/build-module/tooltip/index.js.map +1 -1
  180. package/build-module/tree-select/index.js +10 -2
  181. package/build-module/tree-select/index.js.map +1 -1
  182. package/build-module/tree-select/types.js.map +1 -1
  183. package/build-style/style-rtl.css +60 -13
  184. package/build-style/style.css +60 -13
  185. package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
  186. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  187. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  188. package/build-types/animate/stories/index.story.d.ts +7 -7
  189. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  190. package/build-types/badge/index.d.ts +8 -0
  191. package/build-types/badge/index.d.ts.map +1 -0
  192. package/build-types/badge/stories/index.story.d.ts +17 -0
  193. package/build-types/badge/stories/index.story.d.ts.map +1 -0
  194. package/build-types/badge/test/index.d.ts +2 -0
  195. package/build-types/badge/test/index.d.ts.map +1 -0
  196. package/build-types/badge/types.d.ts +13 -0
  197. package/build-types/badge/types.d.ts.map +1 -0
  198. package/build-types/base-control/stories/index.story.d.ts +1 -1
  199. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  200. package/build-types/border-control/stories/index.story.d.ts +5 -5
  201. package/build-types/box-control/index.d.ts +1 -1
  202. package/build-types/box-control/index.d.ts.map +1 -1
  203. package/build-types/box-control/input-control.d.ts +1 -1
  204. package/build-types/box-control/input-control.d.ts.map +1 -1
  205. package/build-types/box-control/stories/index.story.d.ts +356 -11
  206. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  207. package/build-types/box-control/styles/box-control-styles.d.ts +2 -2
  208. package/build-types/box-control/types.d.ts +17 -0
  209. package/build-types/box-control/types.d.ts.map +1 -1
  210. package/build-types/box-control/utils.d.ts +27 -1
  211. package/build-types/box-control/utils.d.ts.map +1 -1
  212. package/build-types/button/stories/e2e/index.story.d.ts +1 -1
  213. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  214. package/build-types/button/stories/index.story.d.ts +7 -7
  215. package/build-types/button/stories/index.story.d.ts.map +1 -1
  216. package/build-types/button-group/index.d.ts +3 -1
  217. package/build-types/button-group/index.d.ts.map +1 -1
  218. package/build-types/button-group/stories/index.story.d.ts +6 -0
  219. package/build-types/button-group/stories/index.story.d.ts.map +1 -1
  220. package/build-types/button-group/types.d.ts +7 -0
  221. package/build-types/button-group/types.d.ts.map +1 -1
  222. package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
  223. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  224. package/build-types/color-palette/stories/index.story.d.ts +3 -3
  225. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  226. package/build-types/color-picker/styles.d.ts +2 -2
  227. package/build-types/color-picker/styles.d.ts.map +1 -1
  228. package/build-types/combobox-control/stories/index.story.d.ts +4 -4
  229. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  230. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  231. package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
  232. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  233. package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
  234. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  235. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  236. package/build-types/custom-select-control-v2/stories/index.story.d.ts +3 -3
  237. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  238. package/build-types/date-time/date/index.d.ts.map +1 -1
  239. package/build-types/date-time/stories/time.story.d.ts +1 -1
  240. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  241. package/build-types/date-time/time/styles.d.ts +4 -4
  242. package/build-types/dimension-control/index.d.ts.map +1 -1
  243. package/build-types/dimension-control/stories/index.story.d.ts +1 -1
  244. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  245. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  246. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  247. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
  248. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  249. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
  250. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  251. package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
  252. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  253. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  254. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  255. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  256. package/build-types/gradient-picker/stories/index.story.d.ts +3 -3
  257. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  258. package/build-types/guide/stories/index.story.d.ts +1 -1
  259. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  260. package/build-types/icon/stories/index.story.d.ts +4 -4
  261. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  262. package/build-types/input-control/index.d.ts +1 -0
  263. package/build-types/input-control/index.d.ts.map +1 -1
  264. package/build-types/input-control/stories/index.story.d.ts +7 -7
  265. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  266. package/build-types/input-control/types.d.ts +11 -2
  267. package/build-types/input-control/types.d.ts.map +1 -1
  268. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
  269. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  270. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  271. package/build-types/menu/index.d.ts +10 -1
  272. package/build-types/menu/index.d.ts.map +1 -1
  273. package/build-types/menu/item.d.ts.map +1 -1
  274. package/build-types/menu/popover.d.ts +3 -0
  275. package/build-types/menu/popover.d.ts.map +1 -0
  276. package/build-types/menu/radio-item.d.ts.map +1 -1
  277. package/build-types/menu/stories/index.story.d.ts +9 -9
  278. package/build-types/menu/stories/index.story.d.ts.map +1 -1
  279. package/build-types/menu/submenu-trigger-item.d.ts +3 -0
  280. package/build-types/menu/submenu-trigger-item.d.ts.map +1 -0
  281. package/build-types/menu/trigger-button.d.ts +3 -0
  282. package/build-types/menu/trigger-button.d.ts.map +1 -0
  283. package/build-types/menu/types.d.ts +208 -57
  284. package/build-types/menu/types.d.ts.map +1 -1
  285. package/build-types/menu-group/stories/index.story.d.ts +1 -1
  286. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  287. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  288. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  289. package/build-types/navigation/back-button/index.d.ts.map +1 -1
  290. package/build-types/navigation/index.d.ts.map +1 -1
  291. package/build-types/navigation/item/index.d.ts.map +1 -1
  292. package/build-types/navigation/stories/index.story.d.ts +6 -6
  293. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  294. package/build-types/notice/stories/index.story.d.ts +4 -4
  295. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  296. package/build-types/number-control/index.d.ts +1 -1
  297. package/build-types/number-control/index.d.ts.map +1 -1
  298. package/build-types/number-control/stories/index.story.d.ts +2 -2
  299. package/build-types/palette-edit/index.d.ts.map +1 -1
  300. package/build-types/palette-edit/stories/index.story.d.ts +2 -2
  301. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  302. package/build-types/private-apis.d.ts.map +1 -1
  303. package/build-types/progress-bar/stories/index.story.d.ts +1 -1
  304. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  305. package/build-types/query-controls/stories/index.story.d.ts +1 -1
  306. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  307. package/build-types/radio-group/index.d.ts.map +1 -1
  308. package/build-types/radio-group/radio.d.ts.map +1 -1
  309. package/build-types/range-control/index.d.ts +1 -1
  310. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  311. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  312. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  313. package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
  314. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  315. package/build-types/sandbox/stories/index.story.d.ts +1 -1
  316. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  317. package/build-types/search-control/stories/index.story.d.ts +1 -1
  318. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  319. package/build-types/select-control/index.d.ts +1 -0
  320. package/build-types/select-control/index.d.ts.map +1 -1
  321. package/build-types/select-control/stories/index.story.d.ts +5 -5
  322. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  323. package/build-types/select-control/types.d.ts +1 -1
  324. package/build-types/select-control/types.d.ts.map +1 -1
  325. package/build-types/shortcut/stories/index.story.d.ts +1 -1
  326. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  327. package/build-types/slot-fill/context.d.ts.map +1 -1
  328. package/build-types/slot-fill/fill.d.ts.map +1 -1
  329. package/build-types/slot-fill/provider.d.ts.map +1 -1
  330. package/build-types/slot-fill/slot.d.ts.map +1 -1
  331. package/build-types/slot-fill/types.d.ts +13 -11
  332. package/build-types/slot-fill/types.d.ts.map +1 -1
  333. package/build-types/tab-panel/index.d.ts.map +1 -1
  334. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  335. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  336. package/build-types/tabs/index.d.ts +21 -4
  337. package/build-types/tabs/index.d.ts.map +1 -1
  338. package/build-types/tabs/stories/index.story.d.ts +10 -10
  339. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  340. package/build-types/tabs/types.d.ts +13 -13
  341. package/build-types/tabs/types.d.ts.map +1 -1
  342. package/build-types/text/stories/index.story.d.ts +3 -3
  343. package/build-types/theme/stories/index.story.d.ts +1 -1
  344. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  345. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  346. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  347. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  348. package/build-types/tooltip/index.d.ts.map +1 -1
  349. package/build-types/tooltip/stories/index.story.d.ts +1 -1
  350. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  351. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  352. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  353. package/build-types/tree-select/index.d.ts +3 -2
  354. package/build-types/tree-select/index.d.ts.map +1 -1
  355. package/build-types/tree-select/stories/index.story.d.ts +1 -1
  356. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  357. package/build-types/tree-select/types.d.ts +5 -1
  358. package/build-types/tree-select/types.d.ts.map +1 -1
  359. package/build-types/unit-control/index.d.ts +1 -1
  360. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  361. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  362. package/package.json +19 -19
  363. package/src/alignment-matrix-control/README.md +16 -15
  364. package/src/angle-picker-control/README.md +10 -9
  365. package/src/badge/README.md +24 -0
  366. package/src/badge/docs-manifest.json +5 -0
  367. package/src/badge/index.tsx +67 -0
  368. package/src/badge/stories/index.story.tsx +54 -0
  369. package/src/badge/styles.scss +49 -0
  370. package/src/badge/test/index.tsx +45 -0
  371. package/src/badge/types.ts +12 -0
  372. package/src/base-control/README.md +22 -21
  373. package/src/box-control/README.md +41 -24
  374. package/src/box-control/index.tsx +4 -0
  375. package/src/box-control/input-control.tsx +142 -40
  376. package/src/box-control/stories/index.story.tsx +12 -0
  377. package/src/box-control/types.ts +18 -0
  378. package/src/box-control/utils.ts +60 -0
  379. package/src/button/README.md +51 -50
  380. package/src/button/style.scss +9 -10
  381. package/src/button/test/index.tsx +9 -2
  382. package/src/button-group/README.md +4 -0
  383. package/src/button-group/index.tsx +11 -1
  384. package/src/button-group/stories/index.story.tsx +8 -1
  385. package/src/button-group/types.ts +7 -0
  386. package/src/custom-select-control/index.tsx +3 -3
  387. package/src/custom-select-control-v2/custom-select.tsx +1 -2
  388. package/src/custom-select-control-v2/stories/index.story.tsx +4 -0
  389. package/src/date-time/date/index.tsx +1 -0
  390. package/src/dimension-control/index.tsx +1 -0
  391. package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
  392. package/src/disabled/stories/index.story.tsx +1 -0
  393. package/src/drop-zone/stories/index.story.tsx +7 -1
  394. package/src/font-size-picker/styles.ts +1 -0
  395. package/src/form-file-upload/README.md +22 -21
  396. package/src/gradient-picker/README.md +36 -35
  397. package/src/heading/hook.ts +1 -1
  398. package/src/heading/test/__snapshots__/index.tsx.snap +4 -4
  399. package/src/icon/README.md +9 -8
  400. package/src/input-control/README.md +1 -0
  401. package/src/input-control/index.tsx +10 -0
  402. package/src/input-control/stories/index.story.tsx +6 -1
  403. package/src/input-control/test/index.js +9 -3
  404. package/src/input-control/types.ts +11 -2
  405. package/src/menu/checkbox-item.tsx +2 -1
  406. package/src/menu/index.tsx +61 -165
  407. package/src/menu/item.tsx +17 -2
  408. package/src/menu/popover.tsx +103 -0
  409. package/src/menu/radio-item.tsx +2 -1
  410. package/src/menu/stories/index.story.tsx +533 -381
  411. package/src/menu/submenu-trigger-item.tsx +61 -0
  412. package/src/menu/test/index.tsx +266 -182
  413. package/src/menu/trigger-button.tsx +46 -0
  414. package/src/menu/types.ts +210 -63
  415. package/src/modal/stories/index.story.tsx +4 -1
  416. package/src/navigation/back-button/index.tsx +1 -0
  417. package/src/navigation/index.tsx +7 -0
  418. package/src/navigation/item/index.tsx +2 -0
  419. package/src/navigation/test/index.tsx +4 -0
  420. package/src/navigator/test/index.tsx +4 -0
  421. package/src/number-control/index.tsx +1 -0
  422. package/src/palette-edit/index.tsx +1 -0
  423. package/src/panel/stories/index.story.tsx +3 -3
  424. package/src/private-apis.ts +2 -0
  425. package/src/radio-group/index.tsx +12 -1
  426. package/src/radio-group/radio.tsx +1 -2
  427. package/src/range-control/styles/range-control-styles.ts +8 -4
  428. package/src/select-control/README.md +3 -0
  429. package/src/select-control/index.tsx +10 -0
  430. package/src/select-control/stories/index.story.tsx +2 -0
  431. package/src/select-control/test/select-control.tsx +7 -1
  432. package/src/select-control/types.ts +1 -0
  433. package/src/slot-fill/context.ts +5 -3
  434. package/src/slot-fill/fill.ts +10 -15
  435. package/src/slot-fill/provider.tsx +63 -64
  436. package/src/slot-fill/slot.tsx +40 -27
  437. package/src/slot-fill/types.ts +23 -11
  438. package/src/style.scss +1 -0
  439. package/src/tab-panel/index.tsx +1 -2
  440. package/src/tab-panel/stories/index.story.tsx +4 -0
  441. package/src/tabs/README.md +151 -187
  442. package/src/tabs/docs-manifest.json +22 -0
  443. package/src/tabs/index.tsx +21 -4
  444. package/src/tabs/stories/best-practices.mdx +99 -0
  445. package/src/tabs/stories/index.story.tsx +5 -0
  446. package/src/tabs/types.ts +13 -14
  447. package/src/text/hook.ts +2 -2
  448. package/src/text/styles.ts +1 -1
  449. package/src/text/test/__snapshots__/index.tsx.snap +3 -3
  450. package/src/text/test/index.tsx +1 -1
  451. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +2 -2
  452. package/src/toggle-group-control/test/index.tsx +7 -1
  453. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +1 -2
  454. package/src/tooltip/index.tsx +1 -2
  455. package/src/tree-grid/stories/index.story.tsx +2 -0
  456. package/src/tree-select/README.md +144 -28
  457. package/src/tree-select/docs-manifest.json +5 -0
  458. package/src/tree-select/index.tsx +11 -2
  459. package/src/tree-select/stories/index.story.tsx +1 -0
  460. package/src/tree-select/types.ts +8 -1
  461. package/tsconfig.json +0 -3
  462. package/tsconfig.tsbuildinfo +1 -1
  463. package/build/slot-fill/use-slot.js +0 -32
  464. package/build/slot-fill/use-slot.js.map +0 -1
  465. package/build-module/slot-fill/use-slot.js +0 -24
  466. package/build-module/slot-fill/use-slot.js.map +0 -1
  467. package/build-types/slot-fill/use-slot.d.ts +0 -10
  468. package/build-types/slot-fill/use-slot.d.ts.map +0 -1
  469. package/src/slot-fill/use-slot.ts +0 -27
@@ -8,6 +8,7 @@ import type { ForwardedRef } from 'react';
8
8
  * WordPress dependencies
9
9
  */
10
10
  import { forwardRef } from '@wordpress/element';
11
+ import deprecated from '@wordpress/deprecated';
11
12
 
12
13
  /**
13
14
  * Internal dependencies
@@ -19,9 +20,16 @@ function UnforwardedButtonGroup(
19
20
  props: WordPressComponentProps< ButtonGroupProps, 'div', false >,
20
21
  ref: ForwardedRef< HTMLDivElement >
21
22
  ) {
22
- const { className, ...restProps } = props;
23
+ const { className, __shouldNotWarnDeprecated, ...restProps } = props;
23
24
  const classes = clsx( 'components-button-group', className );
24
25
 
26
+ if ( ! __shouldNotWarnDeprecated ) {
27
+ deprecated( 'wp.components.ButtonGroup', {
28
+ since: '6.8',
29
+ alternative: 'wp.components.__experimentalToggleGroupControl',
30
+ } );
31
+ }
32
+
25
33
  return (
26
34
  <div ref={ ref } role="group" className={ classes } { ...restProps } />
27
35
  );
@@ -31,6 +39,8 @@ function UnforwardedButtonGroup(
31
39
  * ButtonGroup can be used to group any related buttons together. To emphasize
32
40
  * related buttons, a group should share a common container.
33
41
  *
42
+ * @deprecated Use `ToggleGroupControl` instead.
43
+ *
34
44
  * ```jsx
35
45
  * import { Button, ButtonGroup } from '@wordpress/components';
36
46
  *
@@ -9,8 +9,15 @@ import type { Meta, StoryObj } from '@storybook/react';
9
9
  import ButtonGroup from '..';
10
10
  import Button from '../../button';
11
11
 
12
+ /**
13
+ * ButtonGroup can be used to group any related buttons together.
14
+ * To emphasize related buttons, a group should share a common container.
15
+ *
16
+ * This component is deprecated. Use `ToggleGroupControl` instead.
17
+ */
12
18
  const meta: Meta< typeof ButtonGroup > = {
13
- title: 'Components/ButtonGroup',
19
+ title: 'Components (Deprecated)/ButtonGroup',
20
+ id: 'components-buttongroup',
14
21
  component: ButtonGroup,
15
22
  argTypes: {
16
23
  children: { control: false },
@@ -8,4 +8,11 @@ export type ButtonGroupProps = {
8
8
  * The children elements.
9
9
  */
10
10
  children: ReactNode;
11
+ /**
12
+ * Do not throw a warning for component deprecation.
13
+ * For internal components of other components that already throw the warning.
14
+ *
15
+ * @ignore
16
+ */
17
+ __shouldNotWarnDeprecated?: boolean;
11
18
  };
@@ -149,16 +149,16 @@ function CustomSelectControl< T extends CustomSelectOption >(
149
149
  );
150
150
  } );
151
151
 
152
- const { value: currentValue } = store.getState();
152
+ const currentValue = Ariakit.useStoreState( store, 'value' );
153
153
 
154
154
  const renderSelectedValueHint = () => {
155
155
  const selectedOptionHint = options
156
156
  ?.map( applyOptionDeprecations )
157
- ?.find( ( { name } ) => store.getState().value === name )?.hint;
157
+ ?.find( ( { name } ) => currentValue === name )?.hint;
158
158
 
159
159
  return (
160
160
  <Styled.SelectedExperimentalHintWrapper>
161
- { store.getState().value }
161
+ { currentValue }
162
162
  { selectedOptionHint && (
163
163
  <Styled.SelectedExperimentalHintItem
164
164
  // Keeping the classname for legacy reasons
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import * as Ariakit from '@ariakit/react';
5
- import { useStoreState } from '@ariakit/react';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -63,7 +62,7 @@ const CustomSelectButton = ( {
63
62
  CustomSelectStore,
64
63
  'onChange'
65
64
  > ) => {
66
- const { value: currentValue } = useStoreState( store );
65
+ const { value: currentValue } = Ariakit.useStoreState( store );
67
66
 
68
67
  const computedRenderSelectedValue = useMemo(
69
68
  () => renderSelectedValue ?? defaultRenderSelectedValue,
@@ -2,6 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import type { Meta, StoryFn } from '@storybook/react';
5
+ import { fn } from '@storybook/test';
5
6
 
6
7
  /**
7
8
  * WordPress dependencies
@@ -44,6 +45,9 @@ const meta: Meta< typeof CustomSelectControlV2 > = {
44
45
  </div>
45
46
  ),
46
47
  ],
48
+ args: {
49
+ onChange: fn(),
50
+ },
47
51
  };
48
52
  export default meta;
49
53
 
@@ -306,6 +306,7 @@ function Day( {
306
306
 
307
307
  return (
308
308
  <DayButton
309
+ __next40pxDefaultSize
309
310
  ref={ ref }
310
311
  className="components-datetime__date__day" // Unused, for backwards compatibility.
311
312
  disabled={ isInvalid }
@@ -113,6 +113,7 @@ export function DimensionControl( props: DimensionControlProps ) {
113
113
  <ContextSystemProvider value={ CONTEXT_VALUE }>
114
114
  <SelectControl
115
115
  __next40pxDefaultSize={ __next40pxDefaultSize }
116
+ __shouldNotWarnDeprecated36pxSize
116
117
  __nextHasNoMarginBottom={ __nextHasNoMarginBottom }
117
118
  className={ clsx(
118
119
  className,
@@ -63,7 +63,7 @@ exports[`DimensionControl rendering renders with custom sizes 1`] = `
63
63
  }
64
64
 
65
65
  .emotion-12 {
66
- color: #1e1e1e;
66
+ color: var(--wp-components-color-foreground, #1e1e1e);
67
67
  line-height: 1.4;
68
68
  margin: 0;
69
69
  text-wrap: balance;
@@ -345,7 +345,7 @@ exports[`DimensionControl rendering renders with defaults 1`] = `
345
345
  }
346
346
 
347
347
  .emotion-12 {
348
- color: #1e1e1e;
348
+ color: var(--wp-components-color-foreground, #1e1e1e);
349
349
  line-height: 1.4;
350
350
  margin: 0;
351
351
  text-wrap: balance;
@@ -637,7 +637,7 @@ exports[`DimensionControl rendering renders with icon and custom icon label 1`]
637
637
  }
638
638
 
639
639
  .emotion-12 {
640
- color: #1e1e1e;
640
+ color: var(--wp-components-color-foreground, #1e1e1e);
641
641
  line-height: 1.4;
642
642
  margin: 0;
643
643
  text-wrap: balance;
@@ -941,7 +941,7 @@ exports[`DimensionControl rendering renders with icon and default icon label 1`]
941
941
  }
942
942
 
943
943
  .emotion-12 {
944
- color: #1e1e1e;
944
+ color: var(--wp-components-color-foreground, #1e1e1e);
945
945
  line-height: 1.4;
946
946
  margin: 0;
947
947
  text-wrap: balance;
@@ -55,6 +55,7 @@ const Form = () => {
55
55
  />
56
56
  <SelectControl
57
57
  __nextHasNoMarginBottom
58
+ __next40pxDefaultSize
58
59
  label="Select Control"
59
60
  onChange={ () => {} }
60
61
  options={ [
@@ -21,7 +21,13 @@ export default meta;
21
21
 
22
22
  const Template: StoryFn< typeof DropZone > = ( props ) => {
23
23
  return (
24
- <div style={ { background: 'lightgray', padding: 16 } }>
24
+ <div
25
+ style={ {
26
+ background: 'lightgray',
27
+ padding: 32,
28
+ position: 'relative',
29
+ } }
30
+ >
25
31
  Drop something here
26
32
  <DropZone { ...props } />
27
33
  </div>
@@ -16,6 +16,7 @@ export const Container = styled.fieldset`
16
16
  border: 0;
17
17
  margin: 0;
18
18
  padding: 0;
19
+ display: contents;
19
20
  `;
20
21
 
21
22
  export const Header = styled( HStack )`
@@ -19,60 +19,64 @@ const MyFormFileUpload = () => (
19
19
  </FormFileUpload>
20
20
  );
21
21
  ```
22
+
22
23
  ## Props
23
24
 
24
25
  ### `__next40pxDefaultSize`
25
26
 
26
- Start opting into the larger default height that will become the default size in a future version.
27
-
28
27
  - Type: `boolean`
29
28
  - Required: No
30
29
  - Default: `false`
31
30
 
31
+ Start opting into the larger default height that will become the default size in a future version.
32
+
32
33
  ### `accept`
33
34
 
35
+ - Type: `string`
36
+ - Required: No
37
+
34
38
  A string passed to the `input` element that tells the browser which
35
39
  [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers)
36
40
  can be uploaded by the user. e.g: `image/*,video/*`.
37
41
 
38
- - Type: `string`
39
- - Required: No
40
-
41
42
  ### `children`
42
43
 
43
- Children are passed as children of `Button`.
44
-
45
44
  - Type: `ReactNode`
46
45
  - Required: No
47
46
 
47
+ Children are passed as children of `Button`.
48
+
48
49
  ### `icon`
49
50
 
51
+ - Type: `IconType`
52
+ - Required: No
53
+
50
54
  The icon to render in the default button.
51
55
 
52
56
  See the `Icon` component docs for more information.
53
57
 
54
- - Type: `IconType`
55
- - Required: No
56
-
57
58
  ### `multiple`
58
59
 
59
- Whether to allow multiple selection of files or not.
60
-
61
60
  - Type: `boolean`
62
61
  - Required: No
63
62
  - Default: `false`
64
63
 
64
+ Whether to allow multiple selection of files or not.
65
+
65
66
  ### `onChange`
66
67
 
68
+ - Type: `ChangeEventHandler<HTMLInputElement>`
69
+ - Required: Yes
70
+
67
71
  Callback function passed directly to the `input` file element.
68
72
 
69
73
  Select files will be available in `event.currentTarget.files`.
70
74
 
71
- - Type: `ChangeEventHandler<HTMLInputElement>`
72
- - Required: Yes
73
-
74
75
  ### `onClick`
75
76
 
77
+ - Type: `MouseEventHandler<HTMLInputElement>`
78
+ - Required: No
79
+
76
80
  Callback function passed directly to the `input` file element.
77
81
 
78
82
  This can be useful when you want to force a `change` event to fire when
@@ -89,17 +93,14 @@ an empty string in the `onClick` function.
89
93
  </FormFileUpload>
90
94
  ```
91
95
 
92
- - Type: `MouseEventHandler<HTMLInputElement>`
93
- - Required: No
94
-
95
96
  ### `render`
96
97
 
98
+ - Type: `(arg: { openFileDialog: () => void; }) => ReactNode`
99
+ - Required: No
100
+
97
101
  Optional callback function used to render the UI.
98
102
 
99
103
  If passed, the component does not render the default UI (a button) and
100
104
  calls this function to render it. The function receives an object with
101
105
  property `openFileDialog`, a function that, when called, opens the browser
102
106
  native file upload modal window.
103
-
104
- - Type: `(arg: { openFileDialog: () => void; }) => ReactNode`
105
- - Required: No
@@ -43,114 +43,115 @@ const MyGradientPicker = () => {
43
43
  );
44
44
  };
45
45
  ```
46
+
46
47
  ## Props
47
48
 
48
49
  ### `__experimentalIsRenderedInSidebar`
49
50
 
50
- Whether this is rendered in the sidebar.
51
-
52
51
  - Type: `boolean`
53
52
  - Required: No
54
53
  - Default: `false`
55
54
 
56
- ### `asButtons`
55
+ Whether this is rendered in the sidebar.
57
56
 
58
- Whether the control should present as a set of buttons,
59
- each with its own tab stop.
57
+ ### `asButtons`
60
58
 
61
59
  - Type: `boolean`
62
60
  - Required: No
63
61
  - Default: `false`
64
62
 
65
- ### `aria-label`
63
+ Whether the control should present as a set of buttons,
64
+ each with its own tab stop.
66
65
 
67
- A label to identify the purpose of the control.
66
+ ### `aria-label`
68
67
 
69
68
  - Type: `string`
70
69
  - Required: No
71
70
 
72
- ### `aria-labelledby`
71
+ A label to identify the purpose of the control.
73
72
 
74
- An ID of an element to provide a label for the control.
73
+ ### `aria-labelledby`
75
74
 
76
75
  - Type: `string`
77
76
  - Required: No
78
77
 
79
- ### `className`
78
+ An ID of an element to provide a label for the control.
80
79
 
81
- The class name added to the wrapper.
80
+ ### `className`
82
81
 
83
82
  - Type: `string`
84
83
  - Required: No
85
84
 
86
- ### `clearable`
85
+ The class name added to the wrapper.
87
86
 
88
- Whether the palette should have a clearing button or not.
87
+ ### `clearable`
89
88
 
90
89
  - Type: `boolean`
91
90
  - Required: No
92
91
  - Default: `true`
93
92
 
94
- ### `disableCustomGradients`
93
+ Whether the palette should have a clearing button or not.
95
94
 
96
- If true, the gradient picker will not be displayed and only defined
97
- gradients from `gradients` will be shown.
95
+ ### `disableCustomGradients`
98
96
 
99
97
  - Type: `boolean`
100
98
  - Required: No
101
99
  - Default: `false`
102
100
 
103
- ### `enableAlpha`
101
+ If true, the gradient picker will not be displayed and only defined
102
+ gradients from `gradients` will be shown.
104
103
 
105
- Whether to enable alpha transparency options in the picker.
104
+ ### `enableAlpha`
106
105
 
107
106
  - Type: `boolean`
108
107
  - Required: No
109
108
  - Default: `true`
110
109
 
110
+ Whether to enable alpha transparency options in the picker.
111
+
111
112
  ### `gradients`
112
113
 
114
+ - Type: `GradientsProp`
115
+ - Required: No
116
+ - Default: `[]`
117
+
113
118
  An array of objects as predefined gradients displayed above the gradient
114
119
  selector. Alternatively, if there are multiple sets (or 'origins') of
115
120
  gradients, you can pass an array of objects each with a `name` and a
116
121
  `gradients` array which will in turn contain the predefined gradient objects.
117
122
 
118
- - Type: `GradientsProp`
119
- - Required: No
120
- - Default: `[]`
121
-
122
123
  ### `headingLevel`
123
124
 
124
- The heading level. Only applies in cases where gradients are provided
125
- from multiple origins (i.e. when the array passed as the `gradients` prop
126
- contains two or more items).
127
-
128
125
  - Type: `1 | 2 | 3 | 4 | 5 | 6 | "1" | "2" | "3" | "4" | ...`
129
126
  - Required: No
130
127
  - Default: `2`
131
128
 
132
- ### `loop`
129
+ The heading level. Only applies in cases where gradients are provided
130
+ from multiple origins (i.e. when the array passed as the `gradients` prop
131
+ contains two or more items).
133
132
 
134
- Prevents keyboard interaction from wrapping around.
135
- Only used when `asButtons` is not true.
133
+ ### `loop`
136
134
 
137
135
  - Type: `boolean`
138
136
  - Required: No
139
137
  - Default: `true`
140
138
 
141
- ### `onChange`
139
+ Prevents keyboard interaction from wrapping around.
140
+ Only used when `asButtons` is not true.
142
141
 
143
- The function called when a new gradient has been defined. It is passed to
144
- the `currentGradient` as an argument.
142
+ ### `onChange`
145
143
 
146
144
  - Type: `(currentGradient: string) => void`
147
145
  - Required: Yes
148
146
 
149
- ### `value`
147
+ The function called when a new gradient has been defined. It is passed to
148
+ the `currentGradient` as an argument.
150
149
 
151
- The current value of the gradient. Pass a css gradient string (See default value for example).
152
- Optionally pass in a `null` value to specify no gradient is currently selected.
150
+ ### `value`
153
151
 
154
152
  - Type: `string`
155
153
  - Required: No
156
154
  - Default: `'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)'`
155
+
156
+ The current value of the gradient. Pass a css gradient string (See default value for example).
157
+ Optionally pass in a `null` value to specify no gradient is currently selected.
@@ -14,7 +14,7 @@ export function useHeading(
14
14
  const {
15
15
  as: asProp,
16
16
  level = 2,
17
- color = COLORS.gray[ 900 ],
17
+ color = COLORS.theme.foreground,
18
18
  isBlock = true,
19
19
  weight = CONFIG.fontWeightHeading as import('react').CSSProperties[ 'fontWeight' ],
20
20
  ...otherProps
@@ -2,12 +2,12 @@
2
2
 
3
3
  exports[`props should render correctly 1`] = `
4
4
  .emotion-0 {
5
- color: #1e1e1e;
5
+ color: var(--wp-components-color-foreground, #1e1e1e);
6
6
  line-height: 1.4;
7
7
  margin: 0;
8
8
  text-wrap: balance;
9
9
  text-wrap: pretty;
10
- color: #1e1e1e;
10
+ color: var(--wp-components-color-foreground, #1e1e1e);
11
11
  font-size: calc(1.95 * 13px);
12
12
  font-weight: 600;
13
13
  display: block;
@@ -30,7 +30,7 @@ Snapshot Diff:
30
30
  @@ -1,10 +1,10 @@
31
31
  Array [
32
32
  Object {
33
- "color": "#1e1e1e",
33
+ "color": "var(--wp-components-color-foreground, #1e1e1e)",
34
34
  "display": "block",
35
35
  - "font-size": "calc(1.25 * 13px)",
36
36
  + "font-size": "calc(1.95 * 13px)",
@@ -49,7 +49,7 @@ Snapshot Diff:
49
49
  @@ -1,10 +1,10 @@
50
50
  Array [
51
51
  Object {
52
- "color": "#1e1e1e",
52
+ "color": "var(--wp-components-color-foreground, #1e1e1e)",
53
53
  "display": "block",
54
54
  - "font-size": "calc(1.25 * 13px)",
55
55
  + "font-size": "calc(1.95 * 13px)",
@@ -11,10 +11,15 @@ import { wordpress } from '@wordpress/icons';
11
11
 
12
12
  <Icon icon={ wordpress } />
13
13
  ```
14
+
14
15
  ## Props
15
16
 
16
17
  ### `icon`
17
18
 
19
+ - Type: `IconType`
20
+ - Required: No
21
+ - Default: `null`
22
+
18
23
  The icon to render. In most cases, you should use an icon from
19
24
  [the `@wordpress/icons` package](https://wordpress.github.io/gutenberg/?path=/story/icons-icon--library).
20
25
 
@@ -24,16 +29,12 @@ Other supported values are: component instances, functions,
24
29
 
25
30
  The `size` value, as well as any other additional props, will be passed through.
26
31
 
27
- - Type: `IconType`
28
- - Required: No
29
- - Default: `null`
30
-
31
32
  ### `size`
32
33
 
33
- The size (width and height) of the icon.
34
-
35
- Defaults to `20` when `icon` is a string (i.e. a Dashicon id), otherwise `24`.
36
-
37
34
  - Type: `number`
38
35
  - Required: No
39
36
  - Default: `'string' === typeof icon ? 20 : 24`
37
+
38
+ The size (width and height) of the icon.
39
+
40
+ Defaults to `20` when `icon` is a string (i.e. a Dashicon id), otherwise `24`.
@@ -17,6 +17,7 @@ const Example = () => {
17
17
 
18
18
  return (
19
19
  <InputControl
20
+ __next40pxDefaultSize
20
21
  value={ value }
21
22
  onChange={ ( nextValue ) => setValue( nextValue ?? '' ) }
22
23
  />
@@ -20,6 +20,7 @@ import { space } from '../utils/space';
20
20
  import { useDraft } from './utils';
21
21
  import BaseControl from '../base-control';
22
22
  import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
23
+ import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
23
24
 
24
25
  const noop = () => {};
25
26
 
@@ -36,6 +37,7 @@ export function UnforwardedInputControl(
36
37
  ) {
37
38
  const {
38
39
  __next40pxDefaultSize,
40
+ __shouldNotWarnDeprecated36pxSize,
39
41
  __unstableStateReducer: stateReducer = ( state ) => state,
40
42
  __unstableInputWidth,
41
43
  className,
@@ -68,6 +70,13 @@ export function UnforwardedInputControl(
68
70
 
69
71
  const helpProp = !! help ? { 'aria-describedby': `${ id }__help` } : {};
70
72
 
73
+ maybeWarnDeprecated36pxSize( {
74
+ componentName: 'InputControl',
75
+ __next40pxDefaultSize,
76
+ size,
77
+ __shouldNotWarnDeprecated36pxSize,
78
+ } );
79
+
71
80
  return (
72
81
  <BaseControl
73
82
  className={ classes }
@@ -125,6 +134,7 @@ export function UnforwardedInputControl(
125
134
  *
126
135
  * return (
127
136
  * <InputControl
137
+ * __next40pxDefaultSize
128
138
  * value={ value }
129
139
  * onChange={ ( nextValue ) => setValue( nextValue ?? '' ) }
130
140
  * />
@@ -46,6 +46,7 @@ export const Default = Template.bind( {} );
46
46
  Default.args = {
47
47
  label: 'Value',
48
48
  placeholder: 'Placeholder',
49
+ __next40pxDefaultSize: true,
49
50
  };
50
51
 
51
52
  export const WithHelpText = Template.bind( {} );
@@ -117,7 +118,6 @@ export const ShowPassword: StoryFn< typeof InputControl > = ( args ) => {
117
118
  return (
118
119
  <InputControl
119
120
  type={ visible ? 'text' : 'password' }
120
- label="Password"
121
121
  suffix={
122
122
  <InputControlSuffixWrapper variant="control">
123
123
  <Button
@@ -132,3 +132,8 @@ export const ShowPassword: StoryFn< typeof InputControl > = ( args ) => {
132
132
  />
133
133
  );
134
134
  };
135
+ ShowPassword.args = {
136
+ ...Default.args,
137
+ label: 'Password',
138
+ placeholder: undefined,
139
+ };
@@ -17,9 +17,15 @@ import BaseInputControl from '../';
17
17
  const getInput = () => screen.getByTestId( 'input' );
18
18
 
19
19
  describe( 'InputControl', () => {
20
- const InputControl = ( props ) => (
21
- <BaseInputControl { ...props } data-testid="input" />
22
- );
20
+ const InputControl = ( props ) => {
21
+ return (
22
+ <BaseInputControl
23
+ { ...props }
24
+ __next40pxDefaultSize
25
+ data-testid="input"
26
+ />
27
+ );
28
+ };
23
29
 
24
30
  describe( 'Basic rendering', () => {
25
31
  it( 'should render', () => {
@@ -40,6 +40,13 @@ interface BaseProps {
40
40
  * @default false
41
41
  */
42
42
  __next40pxDefaultSize?: boolean;
43
+ /**
44
+ * Do not throw a warning for the deprecated 36px default size.
45
+ * For internal components of other components that already throw the warning.
46
+ *
47
+ * @ignore
48
+ */
49
+ __shouldNotWarnDeprecated36pxSize?: boolean;
43
50
  __unstableInputWidth?: CSSProperties[ 'width' ];
44
51
  /**
45
52
  * If true, the label will only be visible to screen readers.
@@ -129,7 +136,7 @@ export interface InputBaseProps extends BaseProps, FlexProps {
129
136
  * If you want to apply standard padding in accordance with the size variant, wrap the element in
130
137
  * the provided `<InputControlPrefixWrapper>` component.
131
138
  *
132
- * @example
139
+ * ```jsx
133
140
  * import {
134
141
  * __experimentalInputControl as InputControl,
135
142
  * __experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,
@@ -138,6 +145,7 @@ export interface InputBaseProps extends BaseProps, FlexProps {
138
145
  * <InputControl
139
146
  * prefix={<InputControlPrefixWrapper>@</InputControlPrefixWrapper>}
140
147
  * />
148
+ * ```
141
149
  */
142
150
  prefix?: ReactNode;
143
151
  /**
@@ -147,7 +155,7 @@ export interface InputBaseProps extends BaseProps, FlexProps {
147
155
  * If you want to apply standard padding in accordance with the size variant, wrap the element in
148
156
  * the provided `<InputControlSuffixWrapper>` component.
149
157
  *
150
- * @example
158
+ * ```jsx
151
159
  * import {
152
160
  * __experimentalInputControl as InputControl,
153
161
  * __experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,
@@ -156,6 +164,7 @@ export interface InputBaseProps extends BaseProps, FlexProps {
156
164
  * <InputControl
157
165
  * suffix={<InputControlSuffixWrapper>%</InputControlSuffixWrapper>}
158
166
  * />
167
+ * ```
159
168
  */
160
169
  suffix?: ReactNode;
161
170
  /**