@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
@@ -4,6 +4,13 @@ exports[`ToggleGroupControl should render correctly with icons 1`] = `
4
4
  .emotion-0 {
5
5
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
6
6
  font-size: 13px;
7
+ box-sizing: border-box;
8
+ }
9
+
10
+ .emotion-0 *,
11
+ .emotion-0 *::before,
12
+ .emotion-0 *::after {
13
+ box-sizing: inherit;
7
14
  }
8
15
 
9
16
  .emotion-2 {
@@ -15,8 +22,13 @@ exports[`ToggleGroupControl should render correctly with icons 1`] = `
15
22
  }
16
23
 
17
24
  .emotion-4 {
25
+ font-size: 11px;
26
+ font-weight: 500;
27
+ line-height: 1.4;
28
+ text-transform: uppercase;
18
29
  display: inline-block;
19
30
  margin-bottom: calc(4px * 2);
31
+ padding: 0;
20
32
  }
21
33
 
22
34
  .emotion-6 {
@@ -257,6 +269,13 @@ exports[`ToggleGroupControl should render correctly with text options 1`] = `
257
269
  .emotion-0 {
258
270
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
259
271
  font-size: 13px;
272
+ box-sizing: border-box;
273
+ }
274
+
275
+ .emotion-0 *,
276
+ .emotion-0 *::before,
277
+ .emotion-0 *::after {
278
+ box-sizing: inherit;
260
279
  }
261
280
 
262
281
  .emotion-2 {
@@ -268,8 +287,13 @@ exports[`ToggleGroupControl should render correctly with text options 1`] = `
268
287
  }
269
288
 
270
289
  .emotion-4 {
290
+ font-size: 11px;
291
+ font-weight: 500;
292
+ line-height: 1.4;
293
+ text-transform: uppercase;
271
294
  display: inline-block;
272
295
  margin-bottom: calc(4px * 2);
296
+ padding: 0;
273
297
  }
274
298
 
275
299
  .emotion-6 {
@@ -9,7 +9,6 @@ import { css } from '@emotion/react';
9
9
  import {
10
10
  StyledField as BaseControlField,
11
11
  StyledHelp as BaseControlHelp,
12
- StyledLabel as BaseControlLabel,
13
12
  Wrapper as BaseControlWrapper,
14
13
  } from '../base-control/styles/base-control-styles';
15
14
  import { LabelWrapper } from '../input-control/styles/input-control-styles';
@@ -17,6 +16,9 @@ import { COLORS, CONFIG } from '../utils';
17
16
  import { space } from '../ui/utils/space';
18
17
 
19
18
  const toolsPanelGrid = {
19
+ columns: ( columns: number ) => css`
20
+ grid-template-columns: ${ `repeat( ${ columns }, minmax(0, 1fr) )` };
21
+ `,
20
22
  spacing: css`
21
23
  column-gap: ${ space( 4 ) };
22
24
  row-gap: ${ space( 6 ) };
@@ -28,8 +30,9 @@ const toolsPanelGrid = {
28
30
  },
29
31
  };
30
32
 
31
- export const ToolsPanel = css`
32
- ${ toolsPanelGrid.spacing };
33
+ export const ToolsPanel = ( columns: number ) => css`
34
+ ${ toolsPanelGrid.columns( columns ) }
35
+ ${ toolsPanelGrid.spacing }
33
36
 
34
37
  border-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 300 ] };
35
38
  margin-top: -1px;
@@ -46,7 +49,7 @@ export const ToolsPanelWithInnerWrapper = ( columns: number ) => {
46
49
  return css`
47
50
  > div:not( :first-of-type ) {
48
51
  display: grid;
49
- grid-template-columns: ${ `repeat( ${ columns }, 1fr )` };
52
+ ${ toolsPanelGrid.columns( columns ) }
50
53
  ${ toolsPanelGrid.spacing }
51
54
  ${ toolsPanelGrid.item.fullWidth }
52
55
  }
@@ -133,18 +136,6 @@ export const ToolsPanelItem = css`
133
136
  line-height: 1.4em;
134
137
  }
135
138
  }
136
-
137
- /**
138
- * The targeting of .components-custom-select-control__label here is a
139
- * temporary measure only.
140
- *
141
- * It should be replaced once CustomSelectControl component has been
142
- * refactored and can be targeted via component interpolation.
143
- */
144
- .components-custom-select-control__label,
145
- ${ BaseControlLabel } {
146
- line-height: 1.4em;
147
- }
148
139
  `;
149
140
 
150
141
  export const ToolsPanelItemPlaceholder = css`
@@ -5,6 +5,7 @@ exports[`ToolsPanel first and last panel items should apply first/last classes t
5
5
  display: grid;
6
6
  gap: calc( 4px * 3 );
7
7
  grid-template-columns: repeat( 2, 1fr );
8
+ grid-template-columns: repeat( 2, minmax(0, 1fr) );
8
9
  -webkit-column-gap: calc(4px * 4);
9
10
  column-gap: calc(4px * 4);
10
11
  row-gap: calc(4px * 6);
@@ -15,7 +16,7 @@ exports[`ToolsPanel first and last panel items should apply first/last classes t
15
16
 
16
17
  .emotion-0>div:not( :first-of-type ) {
17
18
  display: grid;
18
- grid-template-columns: repeat( 2, 1fr );
19
+ grid-template-columns: repeat( 2, minmax(0, 1fr) );
19
20
  -webkit-column-gap: calc(4px * 4);
20
21
  column-gap: calc(4px * 4);
21
22
  row-gap: calc(4px * 6);
@@ -105,11 +106,6 @@ exports[`ToolsPanel first and last panel items should apply first/last classes t
105
106
  line-height: 1.4em;
106
107
  }
107
108
 
108
- .emotion-6 .components-custom-select-control__label,
109
- .emotion-6 .ej5x27r2 {
110
- line-height: 1.4em;
111
- }
112
-
113
109
  .emotion-8 {
114
110
  grid-column: 1/-1;
115
111
  }
@@ -137,11 +133,6 @@ exports[`ToolsPanel first and last panel items should apply first/last classes t
137
133
  line-height: 1.4em;
138
134
  }
139
135
 
140
- .emotion-8 .components-custom-select-control__label,
141
- .emotion-8 .ej5x27r2 {
142
- line-height: 1.4em;
143
- }
144
-
145
136
  <div>
146
137
  <div
147
138
  class="components-grid components-tools-panel emotion-0 emotion-1"
@@ -190,7 +190,12 @@ export function useToolsPanel(
190
190
  areAllOptionalControlsHidden &&
191
191
  styles.ToolsPanelHiddenInnerWrapper;
192
192
 
193
- return cx( styles.ToolsPanel, wrapperStyle, emptyStyle, className );
193
+ return cx(
194
+ styles.ToolsPanel( DEFAULT_COLUMNS ),
195
+ wrapperStyle,
196
+ emptyStyle,
197
+ className
198
+ );
194
199
  }, [
195
200
  areAllOptionalControlsHidden,
196
201
  className,
@@ -20,6 +20,7 @@ export const TooltipContent = css`
20
20
  outline: none;
21
21
  transform-origin: top center;
22
22
  transition: opacity ${ CONFIG.transitionDurationFastest } ease;
23
+ font-size: ${ CONFIG.fontSize };
23
24
 
24
25
  &[data-enter] {
25
26
  opacity: 1;
@@ -9,6 +9,7 @@ exports[`props should render correctly 1`] = `
9
9
  transform-origin: top center;
10
10
  -webkit-transition: opacity 100ms ease;
11
11
  transition: opacity 100ms ease;
12
+ font-size: 13px;
12
13
  }
13
14
 
14
15
  .emotion-0[data-enter] {
@@ -24,9 +24,6 @@ const meta: ComponentMeta< typeof UnitControl > = {
24
24
  __unstableStateReducer: {
25
25
  control: { type: null },
26
26
  },
27
- size: {
28
- control: { type: 'select' },
29
- },
30
27
  onChange: {
31
28
  action: 'onChange',
32
29
  control: { type: null },
@@ -54,16 +51,14 @@ const DefaultTemplate: ComponentStory< typeof UnitControl > = ( {
54
51
  const [ value, setValue ] = useState< string | undefined >( '10px' );
55
52
 
56
53
  return (
57
- <div style={ { maxWidth: '100px' } }>
58
- <UnitControl
59
- { ...args }
60
- value={ value }
61
- onChange={ ( v, extra ) => {
62
- setValue( v );
63
- onChange?.( v, extra );
64
- } }
65
- />
66
- </div>
54
+ <UnitControl
55
+ { ...args }
56
+ value={ value }
57
+ onChange={ ( v, extra ) => {
58
+ setValue( v );
59
+ onChange?.( v, extra );
60
+ } }
61
+ />
67
62
  );
68
63
  };
69
64
 
@@ -125,16 +120,14 @@ export const WithCustomUnits: ComponentStory< typeof UnitControl > = ( {
125
120
  const [ value, setValue ] = useState< string | undefined >( '80km' );
126
121
 
127
122
  return (
128
- <div style={ { maxWidth: '100px' } }>
129
- <UnitControl
130
- { ...args }
131
- value={ value }
132
- onChange={ ( v, extra ) => {
133
- setValue( v );
134
- onChange?.( v, extra );
135
- } }
136
- />
137
- </div>
123
+ <UnitControl
124
+ { ...args }
125
+ value={ value }
126
+ onChange={ ( v, extra ) => {
127
+ setValue( v );
128
+ onChange?.( v, extra );
129
+ } }
130
+ />
138
131
  );
139
132
  };
140
133
  WithCustomUnits.args = {
@@ -10,6 +10,7 @@ import { COLORS, CONFIG, rtl } from '../../utils';
10
10
  import NumberControl from '../../number-control';
11
11
  import { BackdropUI } from '../../input-control/styles/input-control-styles';
12
12
  import type { SelectSize } from '../types';
13
+ import { space } from '../../ui/utils/space';
13
14
 
14
15
  // Using `selectSize` instead of `size` to avoid a type conflict with the
15
16
  // `size` HTML attribute of the `select` element.
@@ -59,62 +60,113 @@ export const ValueInput = styled( NumberControl )`
59
60
  }
60
61
  `;
61
62
 
62
- const baseUnitLabelStyles = css`
63
- appearance: none;
64
- background: transparent;
65
- border-radius: 2px;
66
- border: none;
67
- box-sizing: border-box;
68
- color: ${ COLORS.darkGray[ 500 ] };
69
- display: block;
70
- font-size: 8px;
71
- letter-spacing: -0.5px;
72
- outline: none;
73
- padding: 2px 1px;
74
- text-align-last: center;
75
- text-transform: uppercase;
76
- width: 20px;
77
-
78
- ${ rtl( { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 } )() }
79
- `;
63
+ const baseUnitLabelStyles = ( { selectSize }: SelectProps ) => {
64
+ const sizes = {
65
+ default: css`
66
+ box-sizing: border-box;
67
+ padding: 2px 1px;
68
+ width: 20px;
69
+ color: ${ COLORS.darkGray[ 500 ] };
70
+ font-size: 8px;
71
+ line-height: 1;
72
+ letter-spacing: -0.5px;
73
+ text-transform: uppercase;
74
+ text-align-last: center;
75
+ `,
76
+ large: css`
77
+ box-sizing: border-box;
78
+ min-width: 24px;
79
+ max-width: 48px;
80
+ height: 24px;
81
+ margin-inline-end: ${ space( 2 ) };
82
+ padding: ${ space( 1 ) };
83
+ color: ${ COLORS.ui.theme };
84
+ font-size: 13px;
85
+ line-height: 1;
86
+ text-align-last: center;
87
+ white-space: nowrap;
88
+ overflow: hidden;
89
+ text-overflow: ellipsis;
90
+ `,
91
+ };
92
+
93
+ return selectSize === '__unstable-large' ? sizes.large : sizes.default;
94
+ };
80
95
 
81
96
  export const UnitLabel = styled.div< SelectProps >`
82
97
  &&& {
83
98
  pointer-events: none;
84
99
 
85
100
  ${ baseUnitLabelStyles };
101
+
102
+ color: ${ COLORS.gray[ 900 ] };
86
103
  }
87
104
  `;
88
105
 
89
- export const UnitSelect = styled.select< SelectProps >`
90
- &&& {
91
- ${ baseUnitLabelStyles };
92
- cursor: pointer;
93
- border: 1px solid transparent;
94
- height: 100%;
95
- /* Removing margin ensures focus styles neatly overlay the wrapper. */
96
- margin: 0;
97
- transition: box-shadow 0.1s linear, border 0.1s linear;
106
+ const unitSelectSizes = ( { selectSize = 'default' }: SelectProps ) => {
107
+ const sizes = {
108
+ default: css`
109
+ height: 100%;
110
+ border: 1px solid transparent;
111
+ transition: box-shadow 0.1s linear, border 0.1s linear;
98
112
 
99
- &:hover {
100
- background-color: ${ COLORS.lightGray[ 300 ] };
101
- }
113
+ ${ rtl( { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 } )() }
102
114
 
103
- &:focus {
104
- border: 1px solid ${ COLORS.ui.borderFocus };
105
- box-shadow: inset 0 0 0 ${ CONFIG.borderWidth }
106
- ${ COLORS.ui.borderFocus };
107
- outline-offset: 0;
108
- outline: 2px solid transparent;
109
- z-index: 1;
110
- }
115
+ &:not(:disabled):hover {
116
+ background-color: ${ COLORS.lightGray[ 300 ] };
117
+ }
111
118
 
112
- &:disabled {
113
- cursor: initial;
119
+ &:focus {
120
+ border: 1px solid ${ COLORS.ui.borderFocus };
121
+ box-shadow: inset 0 0 0
122
+ ${ CONFIG.borderWidth + ' ' + COLORS.ui.borderFocus };
123
+ outline-offset: 0;
124
+ outline: 2px solid transparent;
125
+ z-index: 1;
126
+ }
127
+ `,
128
+ large: css`
129
+ display: flex;
130
+ justify-content: center;
131
+ align-items: center;
114
132
 
115
133
  &:hover {
116
- background-color: transparent;
134
+ color: ${ COLORS.ui.borderFocus };
135
+ box-shadow: inset 0 0 0
136
+ ${ CONFIG.borderWidth + ' ' + COLORS.ui.borderFocus };
137
+ outline: ${ CONFIG.borderWidth } solid transparent; // For High Contrast Mode
138
+ }
139
+
140
+ &:focus {
141
+ box-shadow: 0 0 0
142
+ ${ CONFIG.borderWidthFocus + ' ' + COLORS.ui.borderFocus };
143
+ outline: ${ CONFIG.borderWidthFocus } solid transparent; // For High Contrast Mode
117
144
  }
145
+ `,
146
+ };
147
+
148
+ return selectSize === '__unstable-large' ? sizes.large : sizes.default;
149
+ };
150
+
151
+ export const UnitSelect = styled.select< SelectProps >`
152
+ // The && counteracts <select> styles in WP forms.css
153
+ && {
154
+ appearance: none;
155
+ background: transparent;
156
+ border-radius: 2px;
157
+ border: none;
158
+ display: block;
159
+ outline: none;
160
+ /* Removing margin ensures focus styles neatly overlay the wrapper. */
161
+ margin: 0;
162
+ min-height: auto;
163
+ font-family: inherit;
164
+
165
+ &:not( :disabled ) {
166
+ cursor: pointer;
118
167
  }
168
+
169
+ ${ baseUnitLabelStyles };
170
+ ${ unitSelectSizes };
119
171
  }
120
172
  `;
@@ -43,7 +43,7 @@ export type UnitControlOnChangeCallback = InputChangeCallback<
43
43
  { data?: WPUnitControlUnit }
44
44
  >;
45
45
 
46
- export type UnitSelectControlProps = {
46
+ export type UnitSelectControlProps = Pick< InputControlProps, 'size' > & {
47
47
  /**
48
48
  * Whether the control can be focused via keyboard navigation.
49
49
  *
@@ -54,12 +54,6 @@ export type UnitSelectControlProps = {
54
54
  * A callback function invoked when the value is changed.
55
55
  */
56
56
  onChange?: UnitControlOnChangeCallback;
57
- /**
58
- * Size of the control option. Supports "default" and "small".
59
- *
60
- * @default 'default'
61
- */
62
- size?: SelectSize;
63
57
  /**
64
58
  * Current unit.
65
59
  */
@@ -0,0 +1,13 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { css } from '@emotion/react';
5
+
6
+ // This is a very low-level mixin which you shouldn't have to use directly.
7
+ // Try to use BaseControl's StyledLabel or BaseControl.VisualLabel if you can.
8
+ export const baseLabelTypography = css`
9
+ font-size: 11px;
10
+ font-weight: 500;
11
+ line-height: 1.4;
12
+ text-transform: uppercase;
13
+ `;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { css } from '@emotion/react';
5
+
6
+ export const boxSizingReset = css`
7
+ box-sizing: border-box;
8
+
9
+ *,
10
+ *::before,
11
+ *::after {
12
+ box-sizing: inherit;
13
+ }
14
+ `;
@@ -1,3 +1,4 @@
1
+ export { boxSizingReset } from './box-sizing';
1
2
  export { rgba } from './colors';
2
3
  export { reduceMotion } from './reduce-motion';
3
4
  export { rtl } from './rtl';
@@ -5,3 +6,4 @@ export { font } from './font';
5
6
  export { breakpoint } from './breakpoint';
6
7
  export { default as CONFIG } from './config-values';
7
8
  export { COLORS } from './colors-values';
9
+ export { baseLabelTypography } from './base-label';
package/tsconfig.json CHANGED
@@ -72,6 +72,7 @@
72
72
  "src/navigable-container/**/*",
73
73
  "src/navigator/**/*",
74
74
  "src/number-control/**/*",
75
+ "src/placeholder/**/*",
75
76
  "src/popover/**/*",
76
77
  "src/radio-control/**/*",
77
78
  "src/range-control/**/*",
@@ -85,6 +86,7 @@
85
86
  "src/spacer/**/*",
86
87
  "src/spinner/**/*",
87
88
  "src/surface/**/*",
89
+ "src/swatch/**/*",
88
90
  "src/text/**/*",
89
91
  "src/text-control/**/*",
90
92
  "src/text-highlight/**/*",