@wordpress/components 19.16.0 → 19.17.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 (434) hide show
  1. package/CHANGELOG.md +40 -4
  2. package/build/base-control/index.js +6 -3
  3. package/build/base-control/index.js.map +1 -1
  4. package/build/base-control/styles/base-control-styles.js +8 -8
  5. package/build/base-control/styles/base-control-styles.js.map +1 -1
  6. package/build/border-control/styles.js +17 -25
  7. package/build/border-control/styles.js.map +1 -1
  8. package/build/box-control/all-input-control.js +2 -27
  9. package/build/box-control/all-input-control.js.map +1 -1
  10. package/build/box-control/index.js +10 -5
  11. package/build/box-control/index.js.map +1 -1
  12. package/build/box-control/styles/box-control-styles.js +17 -9
  13. package/build/box-control/styles/box-control-styles.js.map +1 -1
  14. package/build/box-control/utils.js +35 -0
  15. package/build/box-control/utils.js.map +1 -1
  16. package/build/color-picker/styles.js +10 -8
  17. package/build/color-picker/styles.js.map +1 -1
  18. package/build/combobox-control/index.js +14 -6
  19. package/build/combobox-control/index.js.map +1 -1
  20. package/build/custom-select-control/index.js +3 -1
  21. package/build/custom-select-control/index.js.map +1 -1
  22. package/build/date-time/time/index.js +6 -2
  23. package/build/date-time/time/index.js.map +1 -1
  24. package/build/date-time/time/styles.js +17 -24
  25. package/build/date-time/time/styles.js.map +1 -1
  26. package/build/external-link/index.js +6 -0
  27. package/build/external-link/index.js.map +1 -1
  28. package/build/flex/flex/component.js +9 -9
  29. package/build/flex/flex/component.js.map +1 -1
  30. package/build/flex/flex/hook.js +6 -16
  31. package/build/flex/flex/hook.js.map +1 -1
  32. package/build/flex/flex/index.js.map +1 -1
  33. package/build/flex/flex-block/component.js +9 -9
  34. package/build/flex/flex-block/component.js.map +1 -1
  35. package/build/flex/flex-block/hook.js +0 -4
  36. package/build/flex/flex-block/hook.js.map +1 -1
  37. package/build/flex/flex-block/index.js.map +1 -1
  38. package/build/flex/flex-item/component.js +9 -9
  39. package/build/flex/flex-item/component.js.map +1 -1
  40. package/build/flex/flex-item/hook.js +1 -5
  41. package/build/flex/flex-item/hook.js.map +1 -1
  42. package/build/flex/flex-item/index.js.map +1 -1
  43. package/build/flex/index.js.map +1 -1
  44. package/build/flex/styles.js +5 -5
  45. package/build/flex/styles.js.map +1 -1
  46. package/build/focal-point-picker/styles/focal-point-picker-style.js +22 -22
  47. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  48. package/build/focal-point-picker/styles/focal-point-style.js +5 -5
  49. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  50. package/build/font-size-picker/index.js +15 -6
  51. package/build/font-size-picker/index.js.map +1 -1
  52. package/build/form-token-field/index.js +6 -2
  53. package/build/form-token-field/index.js.map +1 -1
  54. package/build/form-token-field/suggestions-list.js +19 -6
  55. package/build/form-token-field/suggestions-list.js.map +1 -1
  56. package/build/index.js +7 -1
  57. package/build/index.js.map +1 -1
  58. package/build/input-control/input-base.js +1 -2
  59. package/build/input-control/input-base.js.map +1 -1
  60. package/build/input-control/reducer/actions.js +3 -1
  61. package/build/input-control/reducer/actions.js.map +1 -1
  62. package/build/input-control/reducer/reducer.js +28 -11
  63. package/build/input-control/reducer/reducer.js.map +1 -1
  64. package/build/input-control/reducer/state.js.map +1 -1
  65. package/build/input-control/styles/input-control-styles.js +26 -26
  66. package/build/input-control/styles/input-control-styles.js.map +1 -1
  67. package/build/mobile/global-styles-context/utils.native.js +23 -3
  68. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  69. package/build/mobile/image/index.native.js +23 -2
  70. package/build/mobile/image/index.native.js.map +1 -1
  71. package/build/mobile/link-picker/link-picker-screen.native.js +10 -4
  72. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  73. package/build/mobile/picker/index.ios.js +16 -3
  74. package/build/mobile/picker/index.ios.js.map +1 -1
  75. package/build/placeholder/index.js +11 -14
  76. package/build/placeholder/index.js.map +1 -1
  77. package/build/placeholder/types.js +6 -0
  78. package/build/placeholder/types.js.map +1 -0
  79. package/build/popover/index.js +113 -62
  80. package/build/popover/index.js.map +1 -1
  81. package/build/range-control/styles/range-control-styles.js +40 -40
  82. package/build/range-control/styles/range-control-styles.js.map +1 -1
  83. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  84. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  85. package/build/select-control/styles/select-control-styles.js +6 -6
  86. package/build/select-control/styles/select-control-styles.js.map +1 -1
  87. package/build/style-provider/index.js +10 -7
  88. package/build/style-provider/index.js.map +1 -1
  89. package/build/style-provider/types.js +6 -0
  90. package/build/style-provider/types.js.map +1 -0
  91. package/build/swatch/index.js +2 -0
  92. package/build/swatch/index.js.map +1 -1
  93. package/build/swatch/types.js +6 -0
  94. package/build/swatch/types.js.map +1 -0
  95. package/build/text/hook.js +5 -8
  96. package/build/text/hook.js.map +1 -1
  97. package/build/tools-panel/styles.js +13 -10
  98. package/build/tools-panel/styles.js.map +1 -1
  99. package/build/tools-panel/tools-panel/hook.js +1 -1
  100. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  101. package/build/ui/tooltip/styles.js +4 -4
  102. package/build/ui/tooltip/styles.js.map +1 -1
  103. package/build/unit-control/styles/unit-control-styles.js +34 -9
  104. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  105. package/build/utils/base-label.js +24 -0
  106. package/build/utils/base-label.js.map +1 -0
  107. package/build/utils/box-sizing.js +22 -0
  108. package/build/utils/box-sizing.js.map +1 -0
  109. package/build/utils/style-mixins.js +16 -0
  110. package/build/utils/style-mixins.js.map +1 -1
  111. package/build-module/base-control/index.js +7 -5
  112. package/build-module/base-control/index.js.map +1 -1
  113. package/build-module/base-control/styles/base-control-styles.js +9 -9
  114. package/build-module/base-control/styles/base-control-styles.js.map +1 -1
  115. package/build-module/border-control/styles.js +18 -26
  116. package/build-module/border-control/styles.js.map +1 -1
  117. package/build-module/box-control/all-input-control.js +3 -28
  118. package/build-module/box-control/all-input-control.js.map +1 -1
  119. package/build-module/box-control/index.js +4 -4
  120. package/build-module/box-control/index.js.map +1 -1
  121. package/build-module/box-control/styles/box-control-styles.js +18 -10
  122. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  123. package/build-module/box-control/utils.js +33 -0
  124. package/build-module/box-control/utils.js.map +1 -1
  125. package/build-module/color-picker/styles.js +9 -8
  126. package/build-module/color-picker/styles.js.map +1 -1
  127. package/build-module/combobox-control/index.js +13 -6
  128. package/build-module/combobox-control/index.js.map +1 -1
  129. package/build-module/custom-select-control/index.js +2 -1
  130. package/build-module/custom-select-control/index.js.map +1 -1
  131. package/build-module/date-time/time/index.js +6 -3
  132. package/build-module/date-time/time/index.js.map +1 -1
  133. package/build-module/date-time/time/styles.js +15 -21
  134. package/build-module/date-time/time/styles.js.map +1 -1
  135. package/build-module/external-link/index.js +6 -0
  136. package/build-module/external-link/index.js.map +1 -1
  137. package/build-module/flex/flex/component.js +9 -9
  138. package/build-module/flex/flex/component.js.map +1 -1
  139. package/build-module/flex/flex/hook.js +6 -15
  140. package/build-module/flex/flex/hook.js.map +1 -1
  141. package/build-module/flex/flex/index.js.map +1 -1
  142. package/build-module/flex/flex-block/component.js +9 -9
  143. package/build-module/flex/flex-block/component.js.map +1 -1
  144. package/build-module/flex/flex-block/hook.js +0 -4
  145. package/build-module/flex/flex-block/hook.js.map +1 -1
  146. package/build-module/flex/flex-block/index.js.map +1 -1
  147. package/build-module/flex/flex-item/component.js +9 -9
  148. package/build-module/flex/flex-item/component.js.map +1 -1
  149. package/build-module/flex/flex-item/hook.js +1 -5
  150. package/build-module/flex/flex-item/hook.js.map +1 -1
  151. package/build-module/flex/flex-item/index.js.map +1 -1
  152. package/build-module/flex/index.js.map +1 -1
  153. package/build-module/flex/styles.js +5 -5
  154. package/build-module/flex/styles.js.map +1 -1
  155. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +22 -22
  156. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  157. package/build-module/focal-point-picker/styles/focal-point-style.js +5 -5
  158. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  159. package/build-module/font-size-picker/index.js +14 -6
  160. package/build-module/font-size-picker/index.js.map +1 -1
  161. package/build-module/form-token-field/index.js +5 -2
  162. package/build-module/form-token-field/index.js.map +1 -1
  163. package/build-module/form-token-field/suggestions-list.js +19 -6
  164. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  165. package/build-module/index.js +1 -1
  166. package/build-module/index.js.map +1 -1
  167. package/build-module/input-control/input-base.js +1 -2
  168. package/build-module/input-control/input-base.js.map +1 -1
  169. package/build-module/input-control/reducer/actions.js +1 -0
  170. package/build-module/input-control/reducer/actions.js.map +1 -1
  171. package/build-module/input-control/reducer/reducer.js +28 -11
  172. package/build-module/input-control/reducer/reducer.js.map +1 -1
  173. package/build-module/input-control/reducer/state.js.map +1 -1
  174. package/build-module/input-control/styles/input-control-styles.js +27 -27
  175. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  176. package/build-module/mobile/global-styles-context/utils.native.js +23 -4
  177. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  178. package/build-module/mobile/image/index.native.js +25 -4
  179. package/build-module/mobile/image/index.native.js.map +1 -1
  180. package/build-module/mobile/link-picker/link-picker-screen.native.js +11 -4
  181. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  182. package/build-module/mobile/picker/index.ios.js +14 -3
  183. package/build-module/mobile/picker/index.ios.js.map +1 -1
  184. package/build-module/placeholder/index.js +10 -15
  185. package/build-module/placeholder/index.js.map +1 -1
  186. package/build-module/placeholder/types.js +2 -0
  187. package/build-module/placeholder/types.js.map +1 -0
  188. package/build-module/popover/index.js +112 -62
  189. package/build-module/popover/index.js.map +1 -1
  190. package/build-module/range-control/styles/range-control-styles.js +40 -40
  191. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  192. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  193. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  194. package/build-module/select-control/styles/select-control-styles.js +6 -6
  195. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  196. package/build-module/style-provider/index.js +10 -5
  197. package/build-module/style-provider/index.js.map +1 -1
  198. package/build-module/style-provider/types.js +2 -0
  199. package/build-module/style-provider/types.js.map +1 -0
  200. package/build-module/swatch/index.js +2 -0
  201. package/build-module/swatch/index.js.map +1 -1
  202. package/build-module/swatch/types.js +2 -0
  203. package/build-module/swatch/types.js.map +1 -0
  204. package/build-module/text/hook.js +5 -7
  205. package/build-module/text/hook.js.map +1 -1
  206. package/build-module/tools-panel/styles.js +12 -11
  207. package/build-module/tools-panel/styles.js.map +1 -1
  208. package/build-module/tools-panel/tools-panel/hook.js +1 -1
  209. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  210. package/build-module/ui/tooltip/styles.js +4 -4
  211. package/build-module/ui/tooltip/styles.js.map +1 -1
  212. package/build-module/unit-control/styles/unit-control-styles.js +35 -9
  213. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  214. package/build-module/utils/base-label.js +18 -0
  215. package/build-module/utils/base-label.js.map +1 -0
  216. package/build-module/utils/box-sizing.js +16 -0
  217. package/build-module/utils/box-sizing.js.map +1 -0
  218. package/build-module/utils/style-mixins.js +2 -0
  219. package/build-module/utils/style-mixins.js.map +1 -1
  220. package/build-style/style-rtl.css +50 -30
  221. package/build-style/style.css +52 -30
  222. package/build-types/base-control/index.d.ts +4 -3
  223. package/build-types/base-control/index.d.ts.map +1 -1
  224. package/build-types/base-control/stories/index.d.ts +1 -1
  225. package/build-types/base-control/stories/index.d.ts.map +1 -1
  226. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  227. package/build-types/base-control/types.d.ts +0 -1
  228. package/build-types/base-control/types.d.ts.map +1 -1
  229. package/build-types/border-control/styles.d.ts.map +1 -1
  230. package/build-types/color-picker/color-display.d.ts +13 -0
  231. package/build-types/color-picker/color-display.d.ts.map +1 -0
  232. package/build-types/color-picker/styles.d.ts.map +1 -1
  233. package/build-types/date-time/time/index.d.ts.map +1 -1
  234. package/build-types/date-time/time/styles.d.ts +0 -4
  235. package/build-types/date-time/time/styles.d.ts.map +1 -1
  236. package/build-types/external-link/index.d.ts.map +1 -1
  237. package/build-types/flex/flex/component.d.ts +5 -4
  238. package/build-types/flex/flex/component.d.ts.map +1 -1
  239. package/build-types/flex/flex/hook.d.ts +5 -2
  240. package/build-types/flex/flex/hook.d.ts.map +1 -1
  241. package/build-types/flex/flex/index.d.ts +2 -2
  242. package/build-types/flex/flex/index.d.ts.map +1 -1
  243. package/build-types/flex/flex-block/component.d.ts +5 -4
  244. package/build-types/flex/flex-block/component.d.ts.map +1 -1
  245. package/build-types/flex/flex-block/hook.d.ts +6 -3
  246. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  247. package/build-types/flex/flex-block/index.d.ts +2 -2
  248. package/build-types/flex/flex-block/index.d.ts.map +1 -1
  249. package/build-types/flex/flex-item/component.d.ts +5 -4
  250. package/build-types/flex/flex-item/component.d.ts.map +1 -1
  251. package/build-types/flex/flex-item/hook.d.ts +6 -3
  252. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  253. package/build-types/flex/flex-item/index.d.ts +2 -2
  254. package/build-types/flex/flex-item/index.d.ts.map +1 -1
  255. package/build-types/flex/index.d.ts +3 -3
  256. package/build-types/flex/index.d.ts.map +1 -1
  257. package/build-types/flex/stories/index.d.ts +13 -0
  258. package/build-types/flex/stories/index.d.ts.map +1 -0
  259. package/build-types/flex/styles.d.ts +5 -5
  260. package/build-types/flex/styles.d.ts.map +1 -1
  261. package/build-types/flex/test/index.d.ts +2 -0
  262. package/build-types/flex/test/index.d.ts.map +1 -0
  263. package/build-types/flex/types.d.ts +15 -11
  264. package/build-types/flex/types.d.ts.map +1 -1
  265. package/build-types/flyout/context.d.ts +6 -0
  266. package/build-types/flyout/context.d.ts.map +1 -0
  267. package/build-types/flyout/flyout/component.d.ts +21 -0
  268. package/build-types/flyout/flyout/component.d.ts.map +1 -0
  269. package/build-types/flyout/flyout/hook.d.ts +270 -0
  270. package/build-types/flyout/flyout/hook.d.ts.map +1 -0
  271. package/build-types/flyout/flyout/index.d.ts +3 -0
  272. package/build-types/flyout/flyout/index.d.ts.map +1 -0
  273. package/build-types/flyout/flyout-content/component.d.ts +3 -0
  274. package/build-types/flyout/flyout-content/component.d.ts.map +1 -0
  275. package/build-types/flyout/flyout-content/index.d.ts +2 -0
  276. package/build-types/flyout/flyout-content/index.d.ts.map +1 -0
  277. package/build-types/flyout/index.d.ts +2 -0
  278. package/build-types/flyout/index.d.ts.map +1 -0
  279. package/build-types/flyout/styles.d.ts +22 -0
  280. package/build-types/flyout/styles.d.ts.map +1 -0
  281. package/build-types/flyout/types.d.ts +80 -0
  282. package/build-types/flyout/types.d.ts.map +1 -0
  283. package/build-types/flyout/utils.d.ts +8 -0
  284. package/build-types/flyout/utils.d.ts.map +1 -0
  285. package/build-types/form-token-field/index.d.ts.map +1 -1
  286. package/build-types/form-token-field/stories/index.d.ts +6 -0
  287. package/build-types/form-token-field/stories/index.d.ts.map +1 -1
  288. package/build-types/form-token-field/suggestions-list.d.ts +1 -1
  289. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  290. package/build-types/form-token-field/types.d.ts +15 -3
  291. package/build-types/form-token-field/types.d.ts.map +1 -1
  292. package/build-types/input-control/input-base.d.ts.map +1 -1
  293. package/build-types/input-control/reducer/actions.d.ts +3 -1
  294. package/build-types/input-control/reducer/actions.d.ts.map +1 -1
  295. package/build-types/input-control/reducer/reducer.d.ts +2 -2
  296. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  297. package/build-types/input-control/reducer/state.d.ts +2 -2
  298. package/build-types/input-control/reducer/state.d.ts.map +1 -1
  299. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  300. package/build-types/placeholder/index.d.ts +16 -0
  301. package/build-types/placeholder/index.d.ts.map +1 -0
  302. package/build-types/placeholder/stories/index.d.ts +12 -0
  303. package/build-types/placeholder/stories/index.d.ts.map +1 -0
  304. package/build-types/placeholder/types.d.ts +47 -0
  305. package/build-types/placeholder/types.d.ts.map +1 -0
  306. package/build-types/popover/index.d.ts +1 -1
  307. package/build-types/popover/index.d.ts.map +1 -1
  308. package/build-types/popover/utils.d.ts +70 -0
  309. package/build-types/popover/utils.d.ts.map +1 -0
  310. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  311. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  312. package/build-types/style-provider/index.d.ts +7 -4
  313. package/build-types/style-provider/index.d.ts.map +1 -1
  314. package/build-types/style-provider/types.d.ts +15 -0
  315. package/build-types/style-provider/types.d.ts.map +1 -0
  316. package/build-types/swatch/index.d.ts +5 -0
  317. package/build-types/swatch/index.d.ts.map +1 -0
  318. package/build-types/swatch/types.d.ts +11 -0
  319. package/build-types/swatch/types.d.ts.map +1 -0
  320. package/build-types/text/hook.d.ts.map +1 -1
  321. package/build-types/tools-panel/styles.d.ts +1 -1
  322. package/build-types/tools-panel/styles.d.ts.map +1 -1
  323. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  324. package/build-types/ui/tooltip/styles.d.ts.map +1 -1
  325. package/build-types/unit-control/index.d.ts +1 -1
  326. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  327. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  328. package/build-types/unit-control/types.d.ts +1 -7
  329. package/build-types/unit-control/types.d.ts.map +1 -1
  330. package/build-types/utils/base-label.d.ts +2 -0
  331. package/build-types/utils/base-label.d.ts.map +1 -0
  332. package/build-types/utils/box-sizing.d.ts +2 -0
  333. package/build-types/utils/box-sizing.d.ts.map +1 -0
  334. package/build-types/utils/hooks/use-combined-ref.d.ts +8 -0
  335. package/build-types/utils/hooks/use-combined-ref.d.ts.map +1 -0
  336. package/build-types/utils/style-mixins.d.ts +2 -0
  337. package/package.json +17 -17
  338. package/src/base-control/index.tsx +5 -3
  339. package/src/base-control/stories/index.tsx +1 -0
  340. package/src/base-control/styles/base-control-styles.ts +9 -5
  341. package/src/base-control/types.ts +0 -1
  342. package/src/border-control/styles.ts +2 -1
  343. package/src/box-control/all-input-control.js +3 -27
  344. package/src/box-control/index.js +5 -6
  345. package/src/box-control/styles/box-control-styles.js +1 -2
  346. package/src/box-control/utils.js +32 -0
  347. package/src/color-picker/styles.ts +3 -0
  348. package/src/combobox-control/README.md +7 -0
  349. package/src/combobox-control/index.js +14 -4
  350. package/src/combobox-control/stories/index.js +49 -5
  351. package/src/custom-gradient-picker/style.scss +0 -12
  352. package/src/custom-select-control/index.js +3 -2
  353. package/src/custom-select-control/style.scss +1 -5
  354. package/src/date-time/time/index.tsx +7 -5
  355. package/src/date-time/time/styles.ts +3 -6
  356. package/src/external-link/index.tsx +10 -0
  357. package/src/flex/flex/README.md +19 -13
  358. package/src/flex/flex/{component.js → component.tsx} +15 -10
  359. package/src/flex/flex/{hook.js → hook.ts} +14 -13
  360. package/src/flex/flex/{index.js → index.ts} +0 -0
  361. package/src/flex/flex-block/README.md +3 -3
  362. package/src/flex/flex-block/{component.js → component.tsx} +15 -10
  363. package/src/flex/flex-block/{hook.js → hook.ts} +5 -5
  364. package/src/flex/flex-block/{index.js → index.ts} +0 -0
  365. package/src/flex/flex-item/README.md +6 -5
  366. package/src/flex/flex-item/{component.js → component.tsx} +15 -10
  367. package/src/flex/flex-item/{hook.js → hook.ts} +10 -7
  368. package/src/flex/flex-item/{index.js → index.ts} +0 -0
  369. package/src/flex/{index.js → index.ts} +0 -0
  370. package/src/flex/stories/index.tsx +81 -0
  371. package/src/flex/{styles.js → styles.ts} +0 -0
  372. package/src/flex/test/__snapshots__/{index.js.snap → index.tsx.snap} +49 -9
  373. package/src/flex/test/index.tsx +84 -0
  374. package/src/flex/types.ts +15 -11
  375. package/src/focal-point-picker/styles/focal-point-picker-style.js +0 -5
  376. package/src/focal-point-picker/styles/focal-point-style.js +0 -1
  377. package/src/font-size-picker/index.js +18 -7
  378. package/src/font-size-picker/stories/index.js +6 -0
  379. package/src/form-token-field/README.md +2 -1
  380. package/src/form-token-field/index.tsx +5 -2
  381. package/src/form-token-field/stories/index.tsx +14 -0
  382. package/src/form-token-field/style.scss +0 -5
  383. package/src/form-token-field/suggestions-list.tsx +21 -12
  384. package/src/form-token-field/types.ts +16 -2
  385. package/src/index.js +4 -1
  386. package/src/input-control/input-base.tsx +0 -1
  387. package/src/input-control/reducer/actions.ts +3 -1
  388. package/src/input-control/reducer/reducer.ts +27 -10
  389. package/src/input-control/reducer/state.ts +7 -2
  390. package/src/input-control/styles/input-control-styles.tsx +3 -1
  391. package/src/input-control/test/index.js +20 -4
  392. package/src/mobile/global-styles-context/utils.native.js +21 -4
  393. package/src/mobile/image/index.native.js +27 -2
  394. package/src/mobile/link-picker/link-picker-screen.native.js +12 -4
  395. package/src/mobile/picker/index.ios.js +16 -0
  396. package/src/mobile/picker/styles.native.scss +8 -0
  397. package/src/panel/style.scss +4 -1
  398. package/src/placeholder/README.md +49 -9
  399. package/src/placeholder/{index.js → index.tsx} +27 -23
  400. package/src/placeholder/stories/index.tsx +64 -0
  401. package/src/placeholder/style.scss +0 -4
  402. package/src/placeholder/types.ts +48 -0
  403. package/src/popover/README.md +7 -0
  404. package/src/popover/index.js +144 -70
  405. package/src/popover/stories/index.js +199 -98
  406. package/src/popover/style.scss +60 -6
  407. package/src/popover/test/index.js +23 -1
  408. package/src/range-control/styles/range-control-styles.ts +0 -12
  409. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +1 -1
  410. package/src/select-control/styles/select-control-styles.ts +0 -1
  411. package/src/style-provider/index.tsx +41 -0
  412. package/src/style-provider/types.ts +15 -0
  413. package/src/swatch/{index.js → index.tsx} +4 -1
  414. package/src/swatch/types.ts +11 -0
  415. package/src/text/hook.js +5 -3
  416. package/src/toggle-group-control/test/__snapshots__/index.js.snap +24 -0
  417. package/src/tools-panel/styles.ts +7 -16
  418. package/src/tools-panel/test/__snapshots__/index.js.snap +2 -11
  419. package/src/tools-panel/tools-panel/hook.ts +6 -1
  420. package/src/ui/tooltip/styles.js +1 -0
  421. package/src/ui/tooltip/test/__snapshots__/index.js.snap +1 -0
  422. package/src/unit-control/stories/index.tsx +16 -23
  423. package/src/unit-control/styles/unit-control-styles.ts +93 -41
  424. package/src/unit-control/types.ts +1 -7
  425. package/src/utils/base-label.ts +13 -0
  426. package/src/utils/box-sizing.ts +14 -0
  427. package/src/utils/style-mixins.js +2 -0
  428. package/tsconfig.json +2 -0
  429. package/tsconfig.tsbuildinfo +1 -1
  430. package/src/flex/stories/index.js +0 -29
  431. package/src/flex/test/index.js +0 -77
  432. package/src/placeholder/stories/index.js +0 -44
  433. package/src/popover/stories/_utils.js +0 -64
  434. package/src/style-provider/index.js +0 -31
@@ -1,24 +1,29 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ForwardedRef } from 'react';
5
+
1
6
  /**
2
7
  * Internal dependencies
3
8
  */
4
- import { contextConnect } from '../../ui/context';
9
+ import { contextConnect, WordPressComponentProps } from '../../ui/context';
5
10
  import { View } from '../../view';
11
+ import type { FlexBlockProps } from '../types';
6
12
  import { useFlexBlock } from './hook';
7
13
 
8
- /**
9
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexBlockProps, 'div'>} props
10
- * @param {import('react').ForwardedRef<any>} forwardedRef
11
- */
12
- function FlexBlock( props, forwardedRef ) {
14
+ function UnconnectedFlexBlock(
15
+ props: WordPressComponentProps< FlexBlockProps, 'div' >,
16
+ forwardedRef: ForwardedRef< any >
17
+ ) {
13
18
  const flexBlockProps = useFlexBlock( props );
14
19
 
15
20
  return <View { ...flexBlockProps } ref={ forwardedRef } />;
16
21
  }
17
22
 
18
23
  /**
19
- * `FlexBlock` is a primitive layout component that adaptively resizes content within layout containers like `Flex`.
24
+ * `FlexBlock` is a primitive layout component that adaptively resizes content
25
+ * within layout containers like `Flex`.
20
26
  *
21
- * @example
22
27
  * ```jsx
23
28
  * import { Flex, FlexBlock } from '@wordpress/components';
24
29
  *
@@ -31,6 +36,6 @@ function FlexBlock( props, forwardedRef ) {
31
36
  * }
32
37
  * ```
33
38
  */
34
- const ConnectedFlexBlock = contextConnect( FlexBlock, 'FlexBlock' );
39
+ export const FlexBlock = contextConnect( UnconnectedFlexBlock, 'FlexBlock' );
35
40
 
36
- export default ConnectedFlexBlock;
41
+ export default FlexBlock;
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import { useContextSystem } from '../../ui/context';
4
+ import { useContextSystem, WordPressComponentProps } from '../../ui/context';
5
5
  import { useFlexItem } from '../flex-item';
6
+ import type { FlexBlockProps } from '../types';
6
7
 
7
- /**
8
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexBlockProps, 'div'>} props
9
- */
10
- export function useFlexBlock( props ) {
8
+ export function useFlexBlock(
9
+ props: WordPressComponentProps< FlexBlockProps, 'div' >
10
+ ) {
11
11
  const otherProps = useContextSystem( props, 'FlexBlock' );
12
12
  const flexItemProps = useFlexItem( { isBlock: true, ...otherProps } );
13
13
 
File without changes
@@ -8,14 +8,15 @@ See [`flex/README.md#usage`](/packages/components/src/flex/flex/README.md#usage)
8
8
 
9
9
  ## Props
10
10
 
11
- ### display
12
-
13
- **Type**: `[CSSProperties['display']]`
11
+ ### `display`: `CSSProperties['display']`
14
12
 
15
13
  The CSS display property of `FlexItem`.
16
14
 
17
- ### isBlock
15
+ - Required: No
18
16
 
19
- **Type**: `[boolean]`
17
+ ### `isBlock`: `boolean`
20
18
 
21
19
  Determins if `FlexItem` should render as an adaptive full-width block.
20
+
21
+ - Required: No
22
+ - Default: `false`
@@ -1,24 +1,29 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ForwardedRef } from 'react';
5
+
1
6
  /**
2
7
  * Internal dependencies
3
8
  */
4
- import { contextConnect } from '../../ui/context';
9
+ import { contextConnect, WordPressComponentProps } from '../../ui/context';
5
10
  import { View } from '../../view';
6
11
  import { useFlexItem } from './hook';
12
+ import type { FlexItemProps } from '../types';
7
13
 
8
- /**
9
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexItemProps, 'div'>} props
10
- * @param {import('react').ForwardedRef<any>} forwardedRef
11
- */
12
- function FlexItem( props, forwardedRef ) {
14
+ function UnconnectedFlexItem(
15
+ props: WordPressComponentProps< FlexItemProps, 'div' >,
16
+ forwardedRef: ForwardedRef< any >
17
+ ) {
13
18
  const flexItemProps = useFlexItem( props );
14
19
 
15
20
  return <View { ...flexItemProps } ref={ forwardedRef } />;
16
21
  }
17
22
 
18
23
  /**
19
- * `FlexItem` is a primitive layout component that aligns content within layout containers like `Flex`.
24
+ * `FlexItem` is a primitive layout component that aligns content within layout
25
+ * containers like `Flex`.
20
26
  *
21
- * @example
22
27
  * ```jsx
23
28
  * import { Flex, FlexItem } from '@wordpress/components';
24
29
  *
@@ -31,6 +36,6 @@ function FlexItem( props, forwardedRef ) {
31
36
  * }
32
37
  * ```
33
38
  */
34
- const ConnectedFlexItem = contextConnect( FlexItem, 'FlexItem' );
39
+ export const FlexItem = contextConnect( UnconnectedFlexItem, 'FlexItem' );
35
40
 
36
- export default ConnectedFlexItem;
41
+ export default FlexItem;
@@ -1,27 +1,30 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { css } from '@emotion/react';
4
+ import { css, SerializedStyles } from '@emotion/react';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import { useContextSystem } from '../../ui/context';
9
+ import { useContextSystem, WordPressComponentProps } from '../../ui/context';
10
10
  import { useFlexContext } from '../context';
11
11
  import * as styles from '../styles';
12
12
  import { useCx } from '../../utils/hooks/use-cx';
13
+ import type { FlexItemProps } from '../types';
13
14
 
14
- /**
15
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexItemProps, 'div'>} props
16
- */
17
- export function useFlexItem( props ) {
15
+ export function useFlexItem(
16
+ props: WordPressComponentProps< FlexItemProps, 'div' >
17
+ ) {
18
18
  const {
19
19
  className,
20
20
  display: displayProp,
21
21
  isBlock = false,
22
22
  ...otherProps
23
23
  } = useContextSystem( props, 'FlexItem' );
24
- const sx = {};
24
+
25
+ const sx: {
26
+ Base?: SerializedStyles;
27
+ } = {};
25
28
 
26
29
  const contextDisplay = useFlexContext().flexItemDisplay;
27
30
 
File without changes
File without changes
@@ -0,0 +1,81 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ComponentMeta, ComponentStory } from '@storybook/react';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { Flex, FlexItem, FlexBlock } from '../';
10
+ import { View } from '../../view';
11
+
12
+ const meta: ComponentMeta< typeof Flex > = {
13
+ component: Flex,
14
+ title: 'Components/Flex',
15
+ subcomponents: { FlexBlock, FlexItem },
16
+ argTypes: {
17
+ align: { control: { type: 'text' } },
18
+ as: { control: { type: 'text' } },
19
+ children: { control: { type: null } },
20
+ gap: { control: { type: 'text' } },
21
+ justify: { control: { type: 'text' } },
22
+ // Disabled isReversed because it's deprecated.
23
+ isReversed: {
24
+ table: {
25
+ disable: true,
26
+ },
27
+ },
28
+ },
29
+ parameters: {
30
+ controls: {
31
+ expanded: true,
32
+ },
33
+ docs: { source: { state: 'open' } },
34
+ },
35
+ };
36
+ export default meta;
37
+
38
+ const GrayBox = ( { children }: { children: string } ) => (
39
+ <View style={ { backgroundColor: '#eee', padding: 10 } }>{ children }</View>
40
+ );
41
+
42
+ export const Default: ComponentStory< typeof Flex > = ( { ...args } ) => {
43
+ return (
44
+ <Flex { ...args }>
45
+ <FlexItem>
46
+ <GrayBox>Item 1</GrayBox>
47
+ </FlexItem>
48
+ <FlexItem>
49
+ <GrayBox>Item 2</GrayBox>
50
+ </FlexItem>
51
+ <FlexItem>
52
+ <GrayBox>Item 3</GrayBox>
53
+ </FlexItem>
54
+ </Flex>
55
+ );
56
+ };
57
+ Default.args = {};
58
+
59
+ export const ResponsiveDirection: ComponentStory< typeof Flex > = ( {
60
+ ...args
61
+ } ) => {
62
+ return (
63
+ <Flex { ...args }>
64
+ <FlexItem>
65
+ <GrayBox>Item 1</GrayBox>
66
+ </FlexItem>
67
+ <FlexBlock>
68
+ <GrayBox>Item 2</GrayBox>
69
+ </FlexBlock>
70
+ <FlexItem>
71
+ <GrayBox>Item 3</GrayBox>
72
+ </FlexItem>
73
+ <FlexItem>
74
+ <GrayBox>Item 4</GrayBox>
75
+ </FlexItem>
76
+ </Flex>
77
+ );
78
+ };
79
+ ResponsiveDirection.args = {
80
+ direction: [ 'column', 'row' ],
81
+ };
File without changes
@@ -5,21 +5,30 @@ Snapshot Diff:
5
5
  - First value
6
6
  + Second value
7
7
 
8
- @@ -7,14 +7,10 @@
8
+ @@ -1,22 +1,18 @@
9
+ <div
10
+ class="components-flex css-1giw1wa-View-Flex-sx-Base-sx-Items-ItemsRow em57xhy0"
11
+ - data-testid="flex"
12
+ + data-testid="base-flex"
13
+ data-wp-c16t="true"
14
+ data-wp-component="Flex"
15
+ >
16
+ <div
9
17
  class="components-flex-item css-mw3lhz-View-Item-sx-Base em57xhy0"
10
18
  data-wp-c16t="true"
11
19
  data-wp-component="FlexItem"
12
- />
13
- <div
20
+ >
21
+ Item
22
+ </div>
23
+ - <div
14
24
  - class="css-1mm2cvy-View em57xhy0"
15
25
  - />
16
26
  - <div />
17
- - <div
27
+ <div
18
28
  class="components-flex-item components-flex-block css-14wzr73-View-Item-sx-Base-block em57xhy0"
19
29
  data-wp-c16t="true"
20
30
  data-wp-component="FlexBlock"
21
- />
22
- </div>
31
+ >
23
32
  `;
24
33
 
25
34
  exports[`props should render align 1`] = `
@@ -97,6 +106,7 @@ exports[`props should render correctly 1`] = `
97
106
 
98
107
  <div
99
108
  class="components-flex emotion-0 emotion-1"
109
+ data-testid="base-flex"
100
110
  data-wp-c16t="true"
101
111
  data-wp-component="Flex"
102
112
  >
@@ -104,12 +114,16 @@ exports[`props should render correctly 1`] = `
104
114
  class="components-flex-item emotion-2 emotion-1"
105
115
  data-wp-c16t="true"
106
116
  data-wp-component="FlexItem"
107
- />
117
+ >
118
+ Item
119
+ </div>
108
120
  <div
109
121
  class="components-flex-item components-flex-block emotion-4 emotion-1"
110
122
  data-wp-c16t="true"
111
123
  data-wp-component="FlexBlock"
112
- />
124
+ >
125
+ Item
126
+ </div>
113
127
  </div>
114
128
  `;
115
129
 
@@ -142,5 +156,31 @@ Snapshot Diff:
142
156
 
143
157
  exports[`props should render spacing 1`] = `
144
158
  Snapshot Diff:
145
- Compared values have no visual difference.
159
+ - Received styles
160
+ + Base styles
161
+
162
+ Array [
163
+ Object {
164
+ - "margin-left": "calc(4px * 2)",
165
+ - },
166
+ - Object {
167
+ - "min-width": "0",
168
+ - },
169
+ - Object {
170
+ "-ms-flex": "1",
171
+ "-webkit-flex": "1",
172
+ "display": "block",
173
+ "flex": "1",
174
+ "max-height": "100%",
175
+ "max-width": "100%",
176
+ "min-height": "0",
177
+ + "min-width": "0",
178
+ + },
179
+ + Object {
180
+ + "margin-left": "calc(4px * 5)",
181
+ + },
182
+ + Object {
183
+ "min-width": "0",
184
+ },
185
+ ]
146
186
  `;
@@ -0,0 +1,84 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render, screen } from '@testing-library/react';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { View } from '../../view';
10
+ import { Flex, FlexBlock, FlexItem } from '../';
11
+
12
+ describe( 'props', () => {
13
+ beforeEach( () => {
14
+ render(
15
+ <Flex data-testid="base-flex">
16
+ <FlexItem>Item</FlexItem>
17
+ <FlexBlock>Item</FlexBlock>
18
+ </Flex>
19
+ );
20
+ } );
21
+
22
+ test( 'should render correctly', () => {
23
+ expect( screen.getByTestId( 'base-flex' ) ).toMatchSnapshot();
24
+ } );
25
+
26
+ test( 'should render + wrap non Flex children', () => {
27
+ render(
28
+ <Flex data-testid="flex">
29
+ <FlexItem>Item</FlexItem>
30
+ <View />
31
+ <div />
32
+ <FlexBlock>Item</FlexBlock>
33
+ </Flex>
34
+ );
35
+
36
+ expect( screen.getByTestId( 'flex' ) ).toMatchDiffSnapshot(
37
+ screen.getByTestId( 'base-flex' )
38
+ );
39
+ } );
40
+
41
+ test( 'should render align', () => {
42
+ render(
43
+ <Flex align="flex-start" data-testid="flex">
44
+ <FlexItem>Item</FlexItem>
45
+ <FlexBlock>Item</FlexBlock>
46
+ </Flex>
47
+ );
48
+ expect( screen.getByTestId( 'flex' ) ).toMatchStyleDiffSnapshot(
49
+ screen.getByTestId( 'base-flex' )
50
+ );
51
+ } );
52
+
53
+ test( 'should render justify', () => {
54
+ render(
55
+ <Flex justify="flex-start" data-testid="flex">
56
+ <FlexItem>Item</FlexItem>
57
+ <FlexBlock>Item</FlexBlock>
58
+ </Flex>
59
+ );
60
+ expect( screen.getByTestId( 'flex' ) ).toMatchStyleDiffSnapshot(
61
+ screen.getByTestId( 'base-flex' )
62
+ );
63
+ } );
64
+
65
+ test( 'should render spacing', () => {
66
+ render(
67
+ <>
68
+ <Flex>
69
+ <FlexItem>Item</FlexItem>
70
+ <FlexBlock data-testid="flex-block">Item</FlexBlock>
71
+ </Flex>
72
+ <Flex gap={ 5 }>
73
+ <FlexItem>Item</FlexItem>
74
+ <FlexBlock data-testid="flex-block-with-gap">
75
+ Item
76
+ </FlexBlock>
77
+ </Flex>
78
+ </>
79
+ );
80
+ expect( screen.getByTestId( 'flex-block' ) ).toMatchStyleDiffSnapshot(
81
+ screen.getByTestId( 'flex-block-with-gap' )
82
+ );
83
+ } );
84
+ } );
package/src/flex/types.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { CSSProperties } from 'react';
4
+ import type { CSSProperties, ReactNode } from 'react';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -15,21 +15,24 @@ export type FlexDirection = ResponsiveCSSValue<
15
15
 
16
16
  export type FlexProps = {
17
17
  /**
18
- * Aligns children using CSS Flexbox `align-items`. Vertically aligns content if the `direction` is `row`, or horizontally aligns content if the `direction` is `column`.
19
- *
20
- * In the example below, `flex-start` will align the children content to the top.
18
+ * Aligns children using CSS Flexbox `align-items`. Vertically aligns
19
+ * content if the `direction` is `row`, or horizontally aligns content if
20
+ * the `direction` is `column`.
21
21
  *
22
22
  * @default 'center'
23
23
  */
24
24
  align?: CSSProperties[ 'alignItems' ];
25
25
  /**
26
- * The direction flow of the children content can be adjusted with `direction`. `column` will align children vertically and `row` will align children horizontally.
26
+ * The direction flow of the children content can be adjusted with
27
+ * `direction`. `column` will align children vertically and `row` will align
28
+ * children horizontally.
27
29
  *
28
30
  * @default 'row'
29
31
  */
30
32
  direction?: FlexDirection;
31
33
  /**
32
- * Expands to the maximum available width (if horizontal) or height (if vertical).
34
+ * Expands to the maximum available width (if horizontal) or height (if
35
+ * vertical).
33
36
  *
34
37
  * @default true
35
38
  */
@@ -37,14 +40,15 @@ export type FlexProps = {
37
40
  /**
38
41
  * Spacing in between each child can be adjusted by using `gap`.
39
42
  *
40
- * Can either be a number (which will act as a multiplier to the library's grid system base of 4px),
41
- * or a literal CSS value string.
43
+ * Can either be a number (which will act as a multiplier to the library's
44
+ * grid system base of 4px), or a literal CSS value string.
42
45
  *
43
46
  * @default 2
44
47
  */
45
48
  gap?: SpaceInput;
46
49
  /**
47
- * Horizontally aligns content if the `direction` is `row`, or vertically aligns content if the `direction` is `column`.
50
+ * Horizontally aligns content if the `direction` is `row`, or vertically
51
+ * aligns content if the `direction` is `column`.
48
52
  *
49
53
  * @default 'space-between'
50
54
  */
@@ -58,7 +62,7 @@ export type FlexProps = {
58
62
  /**
59
63
  * The children elements.
60
64
  */
61
- children: React.ReactNode;
65
+ children: ReactNode;
62
66
  /**
63
67
  * @deprecated
64
68
  */
@@ -79,7 +83,7 @@ export type FlexItemProps = {
79
83
  /**
80
84
  * The children elements.
81
85
  */
82
- children: React.ReactNode;
86
+ children?: ReactNode;
83
87
  };
84
88
 
85
89
  export type FlexBlockProps = Omit< FlexItemProps, 'isBlock' >;
@@ -12,14 +12,12 @@ import { COLORS } from '../../utils';
12
12
 
13
13
  export const MediaWrapper = styled.div`
14
14
  background-color: transparent;
15
- box-sizing: border-box;
16
15
  text-align: center;
17
16
  width: 100%;
18
17
  `;
19
18
 
20
19
  export const MediaContainer = styled.div`
21
20
  align-items: center;
22
- box-sizing: border-box;
23
21
  box-shadow: 0 0 0 1px rgba( 0, 0, 0, 0.2 );
24
22
  cursor: pointer;
25
23
  display: inline-flex;
@@ -44,7 +42,6 @@ export const MediaContainer = styled.div`
44
42
 
45
43
  export const MediaPlaceholder = styled.div`
46
44
  background: ${ COLORS.lightGray[ 300 ] };
47
- box-sizing: border-box;
48
45
  height: 170px;
49
46
  max-width: 280px;
50
47
  min-width: 200px;
@@ -61,7 +58,6 @@ export const ControlWrapper = styled( Flex )`
61
58
  `;
62
59
 
63
60
  export const GridView = styled.div`
64
- box-sizing: border-box;
65
61
  left: 50%;
66
62
  opacity: 0;
67
63
  overflow: hidden;
@@ -80,7 +76,6 @@ export const GridView = styled.div`
80
76
  `;
81
77
 
82
78
  export const GridLine = styled.div`
83
- box-sizing: border-box;
84
79
  background: white;
85
80
  box-shadow: 0 0 2px rgba( 0, 0, 0, 0.6 );
86
81
  position: absolute;
@@ -15,7 +15,6 @@ import { COLORS } from '../../utils';
15
15
 
16
16
  export const FocalPointWrapper = styled.div`
17
17
  background-color: transparent;
18
- box-sizing: border-box;
19
18
  cursor: grab;
20
19
  height: 30px;
21
20
  margin: -15px 0 0 -15px;
@@ -8,6 +8,7 @@ import { useState, useMemo, forwardRef } from '@wordpress/element';
8
8
  /**
9
9
  * Internal dependencies
10
10
  */
11
+ import { BaseControl } from '../base-control';
11
12
  import Button from '../button';
12
13
  import RangeControl from '../range-control';
13
14
  import { Flex, FlexItem } from '../flex';
@@ -32,6 +33,8 @@ function FontSizePicker(
32
33
  fontSizes = [],
33
34
  disableCustomFontSizes = false,
34
35
  onChange,
36
+ /** @type {'default' | '__unstable-large'} */
37
+ size = 'default',
35
38
  value,
36
39
  withSlider = false,
37
40
  withReset = true,
@@ -52,7 +55,7 @@ function FontSizePicker(
52
55
  * than six and a select control when they are more.
53
56
  */
54
57
  const fontSizesContainComplexValues = fontSizes.some(
55
- ( { size } ) => ! isSimpleCssValue( size )
58
+ ( { size: sizeArg } ) => ! isSimpleCssValue( sizeArg )
56
59
  );
57
60
  const shouldUseSelectControl = fontSizes.length > 5;
58
61
  const options = useMemo(
@@ -131,12 +134,16 @@ function FontSizePicker(
131
134
  className={ `${ baseClassName }__header` }
132
135
  >
133
136
  <FlexItem>
134
- { __( 'Size' ) }
135
- { headerHint && (
136
- <span className={ `${ baseClassName }__header__hint` }>
137
- { headerHint }
138
- </span>
139
- ) }
137
+ <BaseControl.VisualLabel>
138
+ { __( 'Size' ) }
139
+ { headerHint && (
140
+ <span
141
+ className={ `${ baseClassName }__header__hint` }
142
+ >
143
+ { headerHint }
144
+ </span>
145
+ ) }
146
+ </BaseControl.VisualLabel>
140
147
  </FlexItem>
141
148
  { ! disableCustomFontSizes && (
142
149
  <FlexItem>
@@ -163,6 +170,7 @@ function FontSizePicker(
163
170
  shouldUseSelectControl &&
164
171
  ! showCustomValueControl && (
165
172
  <CustomSelectControl
173
+ __nextUnconstrainedWidth
166
174
  className={ `${ baseClassName }__select` }
167
175
  label={ __( 'Font size' ) }
168
176
  hideLabelFromVision
@@ -181,6 +189,7 @@ function FontSizePicker(
181
189
  setShowCustomValueControl( true );
182
190
  }
183
191
  } }
192
+ size={ size }
184
193
  />
185
194
  ) }
186
195
  { ! shouldUseSelectControl && ! showCustomValueControl && (
@@ -194,6 +203,7 @@ function FontSizePicker(
194
203
  );
195
204
  } }
196
205
  isBlock
206
+ size={ size }
197
207
  >
198
208
  { options.map( ( option ) => (
199
209
  <ToggleGroupControlOption
@@ -233,6 +243,7 @@ function FontSizePicker(
233
243
  );
234
244
  }
235
245
  } }
246
+ size={ size }
236
247
  units={ hasUnits ? units : [] }
237
248
  />
238
249
  </FlexItem>
@@ -17,6 +17,12 @@ export default {
17
17
  description:
18
18
  'If no value exists, this prop defines the starting position for the font size picker slider. Only relevant if `withSlider` is `true`.',
19
19
  },
20
+ size: {
21
+ control: {
22
+ type: 'radio',
23
+ options: [ 'default', '__unstable-large' ],
24
+ },
25
+ },
20
26
  withReset: {
21
27
  description:
22
28
  'If `true`, a reset button will be displayed alongside the input field when a custom font size is active. Has no effect when `disableCustomFontSizes` or `withSlider` is `true`.',
@@ -56,6 +56,7 @@ The `value` property is handled in a manner similar to controlled form component
56
56
  - `removed` - The user removed an existing token.
57
57
  - `remove` - The user focused the button to remove the token.
58
58
  - `__experimentalInvalid` - The user tried to add a token that didn't pass the validation.
59
+ - `__experimentalRenderItem` - Custom renderer invoked for each option in the suggestion list. The render prop receives as its argument an object containing, under the `item` key, the single option's data (directly from the array of data passed to the `options` prop).
59
60
  - `__experimentalExpandOnFocus` - If true, the suggestions list will be always expanded when the input field has the focus.
60
61
  - `__experimentalShowHowTo` - If false, the text on how to use the select (ie: _Separate with commas or the Enter key._) will be hidden.
61
62
  - `__experimentalValidateInput` - If passed, all introduced values will be validated before being added as tokens.
@@ -78,7 +79,7 @@ const continents = [
78
79
  const MyFormTokenField = () => {
79
80
  const [ selectedContinents, setSelectedContinents ] = useState( [] );
80
81
 
81
- return(
82
+ return (
82
83
  <FormTokenField
83
84
  value={ selectedContinents }
84
85
  suggestions={ continents }