@wordpress/components 19.1.2 → 19.2.1-next.33ec3857e2.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 (418) hide show
  1. package/CHANGELOG.md +53 -4
  2. package/README.md +0 -1
  3. package/build/angle-picker-control/index.js +2 -0
  4. package/build/angle-picker-control/index.js.map +1 -1
  5. package/build/button/index.native.js +13 -3
  6. package/build/button/index.native.js.map +1 -1
  7. package/build/checkbox-control/index.js +1 -1
  8. package/build/checkbox-control/index.js.map +1 -1
  9. package/build/clipboard-button/index.js +1 -2
  10. package/build/clipboard-button/index.js.map +1 -1
  11. package/build/color-palette/index.js +36 -9
  12. package/build/color-palette/index.js.map +1 -1
  13. package/build/color-picker/color-display.js +4 -2
  14. package/build/color-picker/color-display.js.map +1 -1
  15. package/build/color-picker/hex-input.js +3 -1
  16. package/build/color-picker/hex-input.js.map +1 -1
  17. package/build/color-picker/input-with-slider.js +3 -1
  18. package/build/color-picker/input-with-slider.js.map +1 -1
  19. package/build/confirm-dialog/component.js +103 -0
  20. package/build/confirm-dialog/component.js.map +1 -0
  21. package/build/confirm-dialog/index.js +16 -0
  22. package/build/confirm-dialog/index.js.map +1 -0
  23. package/build/confirm-dialog/types.js +6 -0
  24. package/build/confirm-dialog/types.js.map +1 -0
  25. package/build/custom-gradient-bar/constants.js +1 -6
  26. package/build/custom-gradient-bar/constants.js.map +1 -1
  27. package/build/custom-gradient-bar/control-points.js +52 -21
  28. package/build/custom-gradient-bar/control-points.js.map +1 -1
  29. package/build/custom-gradient-bar/index.js +5 -1
  30. package/build/custom-gradient-bar/index.js.map +1 -1
  31. package/build/custom-gradient-picker/index.js +4 -1
  32. package/build/custom-gradient-picker/index.js.map +1 -1
  33. package/build/date-time/date.js +63 -86
  34. package/build/date-time/date.js.map +1 -1
  35. package/build/date-time/utils.js +32 -0
  36. package/build/date-time/utils.js.map +1 -0
  37. package/build/divider/component.js +8 -7
  38. package/build/divider/component.js.map +1 -1
  39. package/build/divider/styles.js +38 -13
  40. package/build/divider/styles.js.map +1 -1
  41. package/build/drop-zone/index.js +14 -6
  42. package/build/drop-zone/index.js.map +1 -1
  43. package/build/drop-zone/provider.js +1 -0
  44. package/build/drop-zone/provider.js.map +1 -1
  45. package/build/flyout/styles.js +2 -2
  46. package/build/flyout/styles.js.map +1 -1
  47. package/build/focusable-iframe/index.js +1 -0
  48. package/build/focusable-iframe/index.js.map +1 -1
  49. package/build/font-size-picker/index.js +10 -9
  50. package/build/font-size-picker/index.js.map +1 -1
  51. package/build/font-size-picker/utils.js +28 -17
  52. package/build/font-size-picker/utils.js.map +1 -1
  53. package/build/gradient-picker/index.js +3 -1
  54. package/build/gradient-picker/index.js.map +1 -1
  55. package/build/higher-order/with-focus-outside/index.js +2 -0
  56. package/build/higher-order/with-focus-outside/index.js.map +1 -1
  57. package/build/index.js +8 -0
  58. package/build/index.js.map +1 -1
  59. package/build/input-control/styles/input-control-styles.js +44 -32
  60. package/build/input-control/styles/input-control-styles.js.map +1 -1
  61. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -3
  62. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  63. package/build/mobile/color-settings/index.native.js +4 -2
  64. package/build/mobile/color-settings/index.native.js.map +1 -1
  65. package/build/mobile/color-settings/palette.screen.native.js +7 -6
  66. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  67. package/build/mobile/global-styles-context/utils.native.js +1 -1
  68. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  69. package/build/mobile/gridicons/index.native.js +3 -1
  70. package/build/mobile/gridicons/index.native.js.map +1 -1
  71. package/build/mobile/link-picker/index.native.js +45 -4
  72. package/build/mobile/link-picker/index.native.js.map +1 -1
  73. package/build/mobile/link-settings/index.native.js +10 -0
  74. package/build/mobile/link-settings/index.native.js.map +1 -1
  75. package/build/modal/aria-helper.js +2 -0
  76. package/build/modal/aria-helper.js.map +1 -1
  77. package/build/modal/index.js +17 -8
  78. package/build/modal/index.js.map +1 -1
  79. package/build/palette-edit/index.js +13 -11
  80. package/build/palette-edit/index.js.map +1 -1
  81. package/build/select-control/styles/select-control-styles.js +33 -9
  82. package/build/select-control/styles/select-control-styles.js.map +1 -1
  83. package/build/style-provider/index.js +2 -0
  84. package/build/style-provider/index.js.map +1 -1
  85. package/build/toggle-group-control/toggle-group-control/component.js +7 -2
  86. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  87. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +25 -14
  88. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  89. package/build/toggle-group-control/toggle-group-control-option/styles.js +8 -8
  90. package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  91. package/build/tools-panel/styles.js +12 -10
  92. package/build/tools-panel/styles.js.map +1 -1
  93. package/build/tools-panel/tools-panel/component.js +6 -8
  94. package/build/tools-panel/tools-panel/component.js.map +1 -1
  95. package/build/tools-panel/tools-panel/hook.js +48 -17
  96. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  97. package/build/tools-panel/tools-panel-item/hook.js +5 -1
  98. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  99. package/build/unit-control/styles/unit-control-styles.js +23 -41
  100. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  101. package/build/z-stack/component.js.map +1 -1
  102. package/build/z-stack/styles.js +10 -8
  103. package/build/z-stack/styles.js.map +1 -1
  104. package/build-module/angle-picker-control/index.js +2 -0
  105. package/build-module/angle-picker-control/index.js.map +1 -1
  106. package/build-module/button/index.native.js +13 -3
  107. package/build-module/button/index.native.js.map +1 -1
  108. package/build-module/checkbox-control/index.js +1 -1
  109. package/build-module/checkbox-control/index.js.map +1 -1
  110. package/build-module/clipboard-button/index.js +1 -2
  111. package/build-module/clipboard-button/index.js.map +1 -1
  112. package/build-module/color-palette/index.js +34 -10
  113. package/build-module/color-palette/index.js.map +1 -1
  114. package/build-module/color-picker/color-display.js +3 -2
  115. package/build-module/color-picker/color-display.js.map +1 -1
  116. package/build-module/color-picker/hex-input.js +2 -1
  117. package/build-module/color-picker/hex-input.js.map +1 -1
  118. package/build-module/color-picker/input-with-slider.js +2 -1
  119. package/build-module/color-picker/input-with-slider.js.map +1 -1
  120. package/build-module/confirm-dialog/component.js +84 -0
  121. package/build-module/confirm-dialog/component.js.map +1 -0
  122. package/build-module/confirm-dialog/index.js +6 -0
  123. package/build-module/confirm-dialog/index.js.map +1 -0
  124. package/build-module/confirm-dialog/types.js +2 -0
  125. package/build-module/confirm-dialog/types.js.map +1 -0
  126. package/build-module/custom-gradient-bar/constants.js +0 -4
  127. package/build-module/custom-gradient-bar/constants.js.map +1 -1
  128. package/build-module/custom-gradient-bar/control-points.js +54 -23
  129. package/build-module/custom-gradient-bar/control-points.js.map +1 -1
  130. package/build-module/custom-gradient-bar/index.js +5 -1
  131. package/build-module/custom-gradient-bar/index.js.map +1 -1
  132. package/build-module/custom-gradient-picker/index.js +4 -1
  133. package/build-module/custom-gradient-picker/index.js.map +1 -1
  134. package/build-module/date-time/date.js +63 -87
  135. package/build-module/date-time/date.js.map +1 -1
  136. package/build-module/date-time/utils.js +20 -0
  137. package/build-module/date-time/utils.js.map +1 -0
  138. package/build-module/divider/component.js +8 -7
  139. package/build-module/divider/component.js.map +1 -1
  140. package/build-module/divider/styles.js +37 -13
  141. package/build-module/divider/styles.js.map +1 -1
  142. package/build-module/drop-zone/index.js +14 -6
  143. package/build-module/drop-zone/index.js.map +1 -1
  144. package/build-module/drop-zone/provider.js +1 -0
  145. package/build-module/drop-zone/provider.js.map +1 -1
  146. package/build-module/flyout/styles.js +2 -2
  147. package/build-module/flyout/styles.js.map +1 -1
  148. package/build-module/focusable-iframe/index.js +1 -0
  149. package/build-module/focusable-iframe/index.js.map +1 -1
  150. package/build-module/font-size-picker/index.js +10 -9
  151. package/build-module/font-size-picker/index.js.map +1 -1
  152. package/build-module/font-size-picker/utils.js +28 -17
  153. package/build-module/font-size-picker/utils.js.map +1 -1
  154. package/build-module/gradient-picker/index.js +3 -1
  155. package/build-module/gradient-picker/index.js.map +1 -1
  156. package/build-module/higher-order/with-focus-outside/index.js +1 -0
  157. package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
  158. package/build-module/index.js +1 -0
  159. package/build-module/index.js.map +1 -1
  160. package/build-module/input-control/styles/input-control-styles.js +44 -32
  161. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  162. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -4
  163. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  164. package/build-module/mobile/color-settings/index.native.js +4 -2
  165. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  166. package/build-module/mobile/color-settings/palette.screen.native.js +7 -6
  167. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  168. package/build-module/mobile/global-styles-context/utils.native.js +1 -1
  169. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  170. package/build-module/mobile/gridicons/index.native.js +1 -0
  171. package/build-module/mobile/gridicons/index.native.js.map +1 -1
  172. package/build-module/mobile/link-picker/index.native.js +50 -8
  173. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  174. package/build-module/mobile/link-settings/index.native.js +10 -0
  175. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  176. package/build-module/modal/aria-helper.js +2 -0
  177. package/build-module/modal/aria-helper.js.map +1 -1
  178. package/build-module/modal/index.js +15 -8
  179. package/build-module/modal/index.js.map +1 -1
  180. package/build-module/palette-edit/index.js +13 -11
  181. package/build-module/palette-edit/index.js.map +1 -1
  182. package/build-module/select-control/styles/select-control-styles.js +33 -9
  183. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  184. package/build-module/style-provider/index.js +1 -0
  185. package/build-module/style-provider/index.js.map +1 -1
  186. package/build-module/toggle-group-control/toggle-group-control/component.js +8 -3
  187. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  188. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +25 -14
  189. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  190. package/build-module/toggle-group-control/toggle-group-control-option/styles.js +8 -8
  191. package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  192. package/build-module/tools-panel/styles.js +12 -11
  193. package/build-module/tools-panel/styles.js.map +1 -1
  194. package/build-module/tools-panel/tools-panel/component.js +5 -8
  195. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  196. package/build-module/tools-panel/tools-panel/hook.js +48 -17
  197. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  198. package/build-module/tools-panel/tools-panel-item/hook.js +5 -1
  199. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  200. package/build-module/unit-control/styles/unit-control-styles.js +23 -41
  201. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  202. package/build-module/z-stack/component.js.map +1 -1
  203. package/build-module/z-stack/styles.js +13 -8
  204. package/build-module/z-stack/styles.js.map +1 -1
  205. package/build-style/style-rtl.css +34 -12
  206. package/build-style/style.css +34 -12
  207. package/build-types/base-field/hook.d.ts +16 -16
  208. package/build-types/card/card/hook.d.ts +16 -16
  209. package/build-types/card/card-body/hook.d.ts +16 -16
  210. package/build-types/card/card-divider/hook.d.ts +18 -18
  211. package/build-types/card/card-footer/hook.d.ts +17 -17
  212. package/build-types/card/card-header/hook.d.ts +16 -16
  213. package/build-types/card/card-media/hook.d.ts +16 -16
  214. package/build-types/divider/component.d.ts +8 -7
  215. package/build-types/divider/component.d.ts.map +1 -1
  216. package/build-types/divider/styles.d.ts +2 -2
  217. package/build-types/divider/styles.d.ts.map +1 -1
  218. package/build-types/divider/types.d.ts +5 -5
  219. package/build-types/divider/types.d.ts.map +1 -1
  220. package/build-types/elevation/hook.d.ts +15 -15
  221. package/build-types/flex/flex/hook.d.ts +16 -16
  222. package/build-types/flex/flex-block/hook.d.ts +16 -16
  223. package/build-types/flex/flex-item/hook.d.ts +16 -16
  224. package/build-types/flyout/flyout/hook.d.ts +17 -17
  225. package/build-types/flyout/styles.d.ts +7 -9
  226. package/build-types/flyout/styles.d.ts.map +1 -1
  227. package/build-types/grid/hook.d.ts +16 -16
  228. package/build-types/h-stack/hook.d.ts +16 -16
  229. package/build-types/heading/hook.d.ts +16 -16
  230. package/build-types/input-control/index.d.ts +1 -1
  231. package/build-types/input-control/index.d.ts.map +1 -1
  232. package/build-types/input-control/input-field.d.ts +1 -1
  233. package/build-types/input-control/input-field.d.ts.map +1 -1
  234. package/build-types/input-control/styles/input-control-styles.d.ts +1 -2
  235. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  236. package/build-types/input-control/types.d.ts +2 -1
  237. package/build-types/input-control/types.d.ts.map +1 -1
  238. package/build-types/item-group/item/hook.d.ts +16 -16
  239. package/build-types/item-group/item-group/hook.d.ts +16 -16
  240. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  241. package/build-types/scrollable/hook.d.ts +16 -16
  242. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  243. package/build-types/select-control/types.d.ts +1 -1
  244. package/build-types/select-control/types.d.ts.map +1 -1
  245. package/build-types/spacer/hook.d.ts +16 -16
  246. package/build-types/surface/hook.d.ts +16 -16
  247. package/build-types/text/hook.d.ts +16 -16
  248. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  249. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
  250. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
  251. package/build-types/tools-panel/styles.d.ts.map +1 -1
  252. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  253. package/build-types/tools-panel/tools-panel/hook.d.ts +16 -16
  254. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  255. package/build-types/tools-panel/tools-panel-header/hook.d.ts +16 -16
  256. package/build-types/tools-panel/tools-panel-item/hook.d.ts +16 -16
  257. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  258. package/build-types/tools-panel/types.d.ts +2 -1
  259. package/build-types/tools-panel/types.d.ts.map +1 -1
  260. package/build-types/truncate/hook.d.ts +16 -16
  261. package/build-types/ui/control-group/hook.d.ts +18 -18
  262. package/build-types/ui/control-label/hook.d.ts +16 -16
  263. package/build-types/ui/form-group/form-group.d.ts +4 -4
  264. package/build-types/ui/form-group/use-form-group.d.ts +55 -55
  265. package/build-types/unit-control/index.d.ts +1 -1
  266. package/build-types/unit-control/index.d.ts.map +1 -1
  267. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -0
  268. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  269. package/build-types/unit-control/types.d.ts +2 -2
  270. package/build-types/unit-control/types.d.ts.map +1 -1
  271. package/build-types/v-stack/hook.d.ts +16 -16
  272. package/build-types/z-stack/component.d.ts +1 -1
  273. package/build-types/z-stack/styles.d.ts.map +1 -1
  274. package/package.json +21 -23
  275. package/src/alignment-matrix-control/stories/index.js +1 -1
  276. package/src/angle-picker-control/index.js +2 -0
  277. package/src/base-control/stories/index.js +1 -1
  278. package/src/button/index.native.js +15 -1
  279. package/src/button/stories/index.js +1 -1
  280. package/src/button/style.scss +14 -0
  281. package/src/card/card/README.md +3 -3
  282. package/src/card/stories/index.js +1 -1
  283. package/src/card/test/__snapshots__/index.js.snap +6 -6
  284. package/src/checkbox-control/index.js +1 -1
  285. package/src/checkbox-control/stories/index.js +1 -1
  286. package/src/clipboard-button/index.js +1 -2
  287. package/src/color-indicator/stories/index.js +1 -1
  288. package/src/color-indicator/style.scss +5 -8
  289. package/src/color-palette/index.js +37 -9
  290. package/src/color-palette/stories/index.js +1 -1
  291. package/src/color-palette/style.scss +10 -1
  292. package/src/color-palette/test/__snapshots__/index.js.snap +30 -21
  293. package/src/color-picker/color-display.tsx +3 -2
  294. package/src/color-picker/hex-input.tsx +2 -1
  295. package/src/color-picker/input-with-slider.tsx +2 -1
  296. package/src/color-picker/stories/index.js +1 -1
  297. package/src/combobox-control/README.md +2 -2
  298. package/src/confirm-dialog/README.md +128 -0
  299. package/src/confirm-dialog/component.tsx +114 -0
  300. package/src/confirm-dialog/index.tsx +6 -0
  301. package/src/confirm-dialog/stories/index.js +120 -0
  302. package/src/confirm-dialog/test/index.js +302 -0
  303. package/src/confirm-dialog/types.ts +26 -0
  304. package/src/custom-gradient-bar/constants.js +0 -5
  305. package/src/custom-gradient-bar/control-points.js +40 -9
  306. package/src/custom-gradient-bar/index.js +8 -0
  307. package/src/custom-gradient-picker/index.js +9 -1
  308. package/src/custom-gradient-picker/style.scss +0 -4
  309. package/src/date-time/README.md +7 -0
  310. package/src/date-time/date.js +67 -84
  311. package/src/date-time/stories/index.js +1 -1
  312. package/src/date-time/stories/time.js +1 -1
  313. package/src/date-time/test/date.js +3 -29
  314. package/src/date-time/test/utils.js +32 -0
  315. package/src/date-time/utils.js +18 -0
  316. package/src/dimension-control/README.md +1 -1
  317. package/src/divider/README.md +33 -5
  318. package/src/divider/component.tsx +8 -7
  319. package/src/divider/stories/index.js +43 -17
  320. package/src/divider/styles.ts +53 -16
  321. package/src/divider/test/__snapshots__/index.js.snap +11 -11
  322. package/src/divider/test/index.js +4 -4
  323. package/src/divider/types.ts +5 -5
  324. package/src/drop-zone/index.js +14 -6
  325. package/src/drop-zone/provider.js +1 -0
  326. package/src/dropdown-menu/stories/index.js +1 -1
  327. package/src/duotone-picker/README.md +1 -1
  328. package/src/elevation/stories/index.js +1 -1
  329. package/src/external-link/stories/index.js +1 -1
  330. package/src/flyout/styles.ts +4 -2
  331. package/src/focusable-iframe/index.js +1 -0
  332. package/src/font-size-picker/index.js +27 -13
  333. package/src/font-size-picker/stories/index.js +63 -1
  334. package/src/font-size-picker/test/index.js +87 -0
  335. package/src/font-size-picker/test/util.js +74 -0
  336. package/src/font-size-picker/utils.js +31 -17
  337. package/src/form-token-field/stories/index.js +1 -1
  338. package/src/gradient-picker/index.js +4 -0
  339. package/src/gradient-picker/stories/index.js +1 -1
  340. package/src/grid/stories/index.js +1 -1
  341. package/src/guide/stories/index.js +1 -1
  342. package/src/higher-order/with-focus-outside/index.js +2 -0
  343. package/src/icon/stories/index.js +1 -1
  344. package/src/index.js +1 -0
  345. package/src/input-control/stories/index.js +2 -1
  346. package/src/input-control/styles/input-control-styles.tsx +16 -6
  347. package/src/input-control/types.ts +3 -1
  348. package/src/item-group/stories/index.js +84 -2
  349. package/src/menu-item/README.md +2 -2
  350. package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +6 -2
  351. package/src/mobile/color-settings/index.native.js +2 -0
  352. package/src/mobile/color-settings/palette.screen.native.js +8 -5
  353. package/src/mobile/color-settings/style.native.scss +1 -1
  354. package/src/mobile/global-styles-context/utils.native.js +1 -1
  355. package/src/mobile/gridicons/index.native.js +3 -3
  356. package/src/mobile/inserter-button/style.native.scss +1 -0
  357. package/src/mobile/link-picker/index.native.js +41 -7
  358. package/src/mobile/link-settings/index.native.js +11 -0
  359. package/src/mobile/link-settings/test/edit.native.js +432 -0
  360. package/src/modal/README.md +10 -0
  361. package/src/modal/aria-helper.js +2 -0
  362. package/src/modal/index.js +72 -55
  363. package/src/modal/stories/index.js +6 -1
  364. package/src/modal/style.scss +9 -0
  365. package/src/modal/test/index.js +11 -0
  366. package/src/navigation/README.md +0 -9
  367. package/src/notice/stories/index.js +1 -1
  368. package/src/number-control/stories/index.js +1 -1
  369. package/src/palette-edit/index.js +15 -16
  370. package/src/palette-edit/style.scss +5 -0
  371. package/src/panel/stories/index.js +1 -1
  372. package/src/placeholder/stories/index.js +1 -1
  373. package/src/popover/stories/index.js +1 -1
  374. package/src/query-controls/README.md +138 -6
  375. package/src/radio-group/README.md +4 -1
  376. package/src/range-control/stories/index.js +1 -1
  377. package/src/resizable-box/stories/index.js +1 -1
  378. package/src/scrollable/stories/index.js +1 -1
  379. package/src/search-control/stories/index.js +1 -1
  380. package/src/select-control/stories/index.js +2 -1
  381. package/src/select-control/styles/select-control-styles.ts +25 -2
  382. package/src/select-control/types.ts +1 -1
  383. package/src/slot-fill/stories/index.js +1 -1
  384. package/src/snackbar/stories/index.js +1 -1
  385. package/src/spacer/stories/index.js +1 -1
  386. package/src/style-provider/index.js +2 -0
  387. package/src/surface/stories/index.js +1 -1
  388. package/src/tab-panel/stories/index.js +1 -1
  389. package/src/text-control/stories/index.js +1 -1
  390. package/src/text-highlight/stories/index.js +1 -1
  391. package/src/textarea-control/stories/index.js +1 -1
  392. package/src/tip/stories/index.js +1 -1
  393. package/src/toggle-control/stories/index.js +1 -1
  394. package/src/toggle-group-control/stories/index.js +1 -1
  395. package/src/toggle-group-control/toggle-group-control/component.tsx +7 -2
  396. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +24 -9
  397. package/src/toggle-group-control/toggle-group-control-option/styles.ts +3 -0
  398. package/src/toolbar-button/stories/index.js +1 -1
  399. package/src/tools-panel/stories/index.js +237 -0
  400. package/src/tools-panel/styles.ts +41 -1
  401. package/src/tools-panel/test/index.js +234 -1
  402. package/src/tools-panel/tools-panel/README.md +9 -0
  403. package/src/tools-panel/tools-panel/component.tsx +2 -5
  404. package/src/tools-panel/tools-panel/hook.ts +50 -18
  405. package/src/tools-panel/tools-panel-item/hook.ts +5 -1
  406. package/src/tools-panel/types.ts +5 -1
  407. package/src/tooltip/stories/index.js +1 -1
  408. package/src/tree-select/stories/index.js +1 -1
  409. package/src/truncate/stories/index.js +1 -1
  410. package/src/unit-control/stories/index.js +19 -1
  411. package/src/unit-control/styles/unit-control-styles.ts +33 -46
  412. package/src/unit-control/types.ts +5 -2
  413. package/src/z-stack/README.md +1 -1
  414. package/src/z-stack/component.tsx +1 -1
  415. package/src/z-stack/stories/index.js +1 -1
  416. package/src/z-stack/styles.ts +7 -2
  417. package/tsconfig.json +6 -2
  418. package/tsconfig.tsbuildinfo +1 -1
@@ -2,10 +2,10 @@
2
2
 
3
3
  exports[`props should render correctly 1`] = `
4
4
  .emotion-0 {
5
- border-color: rgba(0, 0, 0, 0.1);
6
- border-width: 0 0 1px 0;
7
- height: 0;
5
+ border: 0;
8
6
  margin: 0;
7
+ border-bottom: 1px solid currentColor;
8
+ height: 0;
9
9
  width: auto;
10
10
  }
11
11
 
@@ -25,8 +25,8 @@ Snapshot Diff:
25
25
 
26
26
  @@ -2,10 +2,8 @@
27
27
  Object {
28
- "border-color": "rgba(0, 0, 0, 0.1)",
29
- "border-width": "0 0 1px 0",
28
+ "border": "0",
29
+ "border-bottom": "1px solid currentColor",
30
30
  "height": "0",
31
31
  "margin": "0",
32
32
  - "margin-bottom": "calc(4px * 7)",
@@ -36,15 +36,15 @@ Snapshot Diff:
36
36
  ]
37
37
  `;
38
38
 
39
- exports[`props should render marginBottom 1`] = `
39
+ exports[`props should render marginEnd 1`] = `
40
40
  Snapshot Diff:
41
41
  - Received styles
42
42
  + Base styles
43
43
 
44
44
  @@ -2,9 +2,8 @@
45
45
  Object {
46
- "border-color": "rgba(0, 0, 0, 0.1)",
47
- "border-width": "0 0 1px 0",
46
+ "border": "0",
47
+ "border-bottom": "1px solid currentColor",
48
48
  "height": "0",
49
49
  "margin": "0",
50
50
  - "margin-bottom": "calc(4px * 5)",
@@ -53,15 +53,15 @@ Snapshot Diff:
53
53
  ]
54
54
  `;
55
55
 
56
- exports[`props should render marginTop 1`] = `
56
+ exports[`props should render marginStart 1`] = `
57
57
  Snapshot Diff:
58
58
  - Received styles
59
59
  + Base styles
60
60
 
61
61
  @@ -2,9 +2,8 @@
62
62
  Object {
63
- "border-color": "rgba(0, 0, 0, 0.1)",
64
- "border-width": "0 0 1px 0",
63
+ "border": "0",
64
+ "border-bottom": "1px solid currentColor",
65
65
  "height": "0",
66
66
  "margin": "0",
67
67
  - "margin-top": "calc(4px * 5)",
@@ -18,15 +18,15 @@ describe( 'props', () => {
18
18
  expect( base.container.firstChild ).toMatchSnapshot();
19
19
  } );
20
20
 
21
- test( 'should render marginTop', () => {
22
- const { container } = render( <Divider marginTop={ 5 } /> );
21
+ test( 'should render marginStart', () => {
22
+ const { container } = render( <Divider marginStart={ 5 } /> );
23
23
  expect( container.firstChild ).toMatchStyleDiffSnapshot(
24
24
  base.container.firstChild
25
25
  );
26
26
  } );
27
27
 
28
- test( 'should render marginBottom', () => {
29
- const { container } = render( <Divider marginBottom={ 5 } /> );
28
+ test( 'should render marginEnd', () => {
29
+ const { container } = render( <Divider marginEnd={ 5 } /> );
30
30
  expect( container.firstChild ).toMatchStyleDiffSnapshot(
31
31
  base.container.firstChild
32
32
  );
@@ -11,17 +11,17 @@ import type { SpaceInput } from '../ui/utils/space';
11
11
 
12
12
  export interface OwnProps {
13
13
  /**
14
- * Adjusts all margins.
14
+ * Adjusts all margins on the inline dimension.
15
15
  */
16
16
  margin?: SpaceInput;
17
17
  /**
18
- * Adjusts top margins.
18
+ * Adjusts the inline-start margin.
19
19
  */
20
- marginTop?: SpaceInput;
20
+ marginStart?: SpaceInput;
21
21
  /**
22
- * Adjusts bottom margins.
22
+ * Adjusts the inline-end margin.
23
23
  */
24
- marginBottom?: SpaceInput;
24
+ marginEnd?: SpaceInput;
25
25
  }
26
26
 
27
27
  export interface Props extends Omit< SeparatorProps, 'children' >, OwnProps {}
@@ -39,10 +39,14 @@ export default function DropZoneComponent( {
39
39
  const files = getFilesFromDataTransfer( event.dataTransfer );
40
40
  const html = event.dataTransfer.getData( 'text/html' );
41
41
 
42
- if ( files.length && onFilesDrop ) {
43
- onFilesDrop( files );
44
- } else if ( html && onHTMLDrop ) {
42
+ /**
43
+ * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
44
+ * The order of the checks is important to recognise the HTML drop.
45
+ */
46
+ if ( html && onHTMLDrop ) {
45
47
  onHTMLDrop( html );
48
+ } else if ( files.length && onFilesDrop ) {
49
+ onFilesDrop( files );
46
50
  } else if ( onDrop ) {
47
51
  onDrop( event );
48
52
  }
@@ -52,15 +56,19 @@ export default function DropZoneComponent( {
52
56
 
53
57
  let _type = 'default';
54
58
 
55
- if (
59
+ /**
60
+ * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
61
+ * The order of the checks is important to recognise the HTML drop.
62
+ */
63
+ if ( includes( event.dataTransfer.types, 'text/html' ) ) {
64
+ _type = 'html';
65
+ } else if (
56
66
  // Check for the types because sometimes the files themselves
57
67
  // are only available on drop.
58
68
  includes( event.dataTransfer.types, 'Files' ) ||
59
69
  getFilesFromDataTransfer( event.dataTransfer ).length > 0
60
70
  ) {
61
71
  _type = 'file';
62
- } else if ( includes( event.dataTransfer.types, 'text/html' ) ) {
63
- _type = 'html';
64
72
  }
65
73
 
66
74
  setType( _type );
@@ -5,6 +5,7 @@ import deprecated from '@wordpress/deprecated';
5
5
 
6
6
  export default function DropZoneProvider( { children } ) {
7
7
  deprecated( 'wp.components.DropZoneProvider', {
8
+ since: '5.8',
8
9
  hint:
9
10
  'wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code.',
10
11
  } );
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/DropdownMenu',
18
18
  component: DropdownMenu,
19
19
  parameters: {
20
- knobs: { disabled: false },
20
+ knobs: { disable: false },
21
21
  },
22
22
  };
23
23
 
@@ -22,7 +22,7 @@ const Example = () => {
22
22
  const [ duotone, setDuotone ] = useState( [ '#000000', '#ffffff' ] );
23
23
  return (
24
24
  <>
25
- <DuotoneControl
25
+ <DuotonePicker
26
26
  duotonePalette={ DUOTONE_PALETTE }
27
27
  colorPalette={ COLOR_PALETTE }
28
28
  value={ duotone }
@@ -26,7 +26,7 @@ export default {
26
26
  component: Elevation,
27
27
  title: 'Components (Experimental)/Elevation',
28
28
  parameters: {
29
- knobs: { disabled: false },
29
+ knobs: { disable: false },
30
30
  },
31
31
  };
32
32
 
@@ -11,7 +11,7 @@ export default {
11
11
  title: 'Components/ExternalLink',
12
12
  component: ExternalLink,
13
13
  parameters: {
14
- knobs: { disabled: false },
14
+ knobs: { disable: false },
15
15
  },
16
16
  };
17
17
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import styled from '@emotion/styled';
4
+ import styled, { StyledComponent } from '@emotion/styled';
5
5
  // eslint-disable-next-line no-restricted-imports
6
6
  import { Popover as ReakitPopover } from 'reakit';
7
7
 
@@ -12,7 +12,9 @@ import { Card, CardBody } from '../card';
12
12
  import * as ZIndex from '../utils/z-index';
13
13
  import CONFIG from '../utils/config-values';
14
14
 
15
- export const FlyoutContentView = styled( ReakitPopover )`
15
+ export const FlyoutContentView: StyledComponent<
16
+ React.ComponentPropsWithoutRef< typeof ReakitPopover >
17
+ > = styled( ReakitPopover )`
16
18
  z-index: ${ ZIndex.Flyout };
17
19
  box-sizing: border-box;
18
20
  opacity: 0;
@@ -7,6 +7,7 @@ import deprecated from '@wordpress/deprecated';
7
7
  export default function FocusableIframe( { iframeRef, ...props } ) {
8
8
  const ref = useMergeRefs( [ iframeRef, useFocusableIframe() ] );
9
9
  deprecated( 'wp.components.FocusableIframe', {
10
+ since: '5.9',
10
11
  alternative: 'wp.compose.useFocusableIframe',
11
12
  } );
12
13
  // Disable reason: The rendered iframe is a pass-through component,
@@ -47,23 +47,28 @@ function FontSizePicker(
47
47
  availableUnits: [ 'px', 'em', 'rem' ],
48
48
  } );
49
49
 
50
- // The main font size UI displays a toggle group when the presets are less
51
- // than six and a select control when they are more.
52
- //
53
- // A select control is also used when the value of a preset cannot be
54
- // immediately computed (eg. 'calc', 'var').
55
- const shouldUseSelectControl =
56
- fontSizes.length > 5 ||
57
- fontSizes.some( ( { size } ) => ! isSimpleCssValue( size ) );
58
-
50
+ /**
51
+ * The main font size UI displays a toggle group when the presets are less
52
+ * than six and a select control when they are more.
53
+ */
54
+ const fontSizesContainComplexValues = fontSizes.some(
55
+ ( { size } ) => ! isSimpleCssValue( size )
56
+ );
57
+ const shouldUseSelectControl = fontSizes.length > 5;
59
58
  const options = useMemo(
60
59
  () =>
61
60
  getFontSizeOptions(
62
61
  shouldUseSelectControl,
63
62
  fontSizes,
64
- disableCustomFontSizes
63
+ disableCustomFontSizes,
64
+ fontSizesContainComplexValues
65
65
  ),
66
- [ shouldUseSelectControl, fontSizes, disableCustomFontSizes ]
66
+ [
67
+ shouldUseSelectControl,
68
+ fontSizes,
69
+ disableCustomFontSizes,
70
+ fontSizesContainComplexValues,
71
+ ]
67
72
  );
68
73
  const selectedOption = getSelectedOption( fontSizes, value );
69
74
  const isCustomValue = selectedOption.slug === CUSTOM_FONT_SIZE;
@@ -88,12 +93,21 @@ function FontSizePicker(
88
93
  }
89
94
  // Calculate the `hint` for toggle group control.
90
95
  let hint = selectedOption.name;
91
- if ( typeof selectedOption.size === 'string' ) {
96
+ if (
97
+ ! fontSizesContainComplexValues &&
98
+ typeof selectedOption.size === 'string'
99
+ ) {
92
100
  const [ , unit ] = splitValueAndUnitFromSize( selectedOption.size );
93
101
  hint += `(${ unit })`;
94
102
  }
95
103
  return hint;
96
- }, [ showCustomValueControl, selectedOption?.slug, value, isCustomValue ] );
104
+ }, [
105
+ showCustomValueControl,
106
+ selectedOption?.slug,
107
+ value,
108
+ isCustomValue,
109
+ fontSizesContainComplexValues,
110
+ ] );
97
111
 
98
112
  if ( ! options ) {
99
113
  return null;
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/FontSizePicker',
18
18
  component: FontSizePicker,
19
19
  parameters: {
20
- knobs: { disabled: false },
20
+ knobs: { disable: false },
21
21
  },
22
22
  };
23
23
 
@@ -156,3 +156,65 @@ export const differentControlBySize = () => {
156
156
  <FontSizePickerWithState fontSizes={ fontSizes } initialValue={ 8 } />
157
157
  );
158
158
  };
159
+
160
+ export const withComplexCSSValues = () => {
161
+ const options = [
162
+ {
163
+ name: 'Small',
164
+ slug: 'small',
165
+ size: '0.65rem',
166
+ },
167
+ {
168
+ name: 'Medium',
169
+ slug: 'medium',
170
+ size: '1.125rem',
171
+ },
172
+ {
173
+ name: 'Large',
174
+ slug: 'large',
175
+ size: '1.7rem',
176
+ },
177
+ {
178
+ name: 'Extra Large',
179
+ slug: 'extra-large',
180
+ size: '1.95rem',
181
+ },
182
+ {
183
+ name: 'Extra Extra Large',
184
+ slug: 'extra-extra-large',
185
+ size: '2.5rem',
186
+ },
187
+ {
188
+ name: 'Huge',
189
+ slug: 'huge',
190
+ size: '2.8rem',
191
+ },
192
+ ];
193
+ const showMoreFontSizes = boolean( 'Add more font sizes', false );
194
+ const addComplexCssValues = boolean(
195
+ 'Add some complex css values(calc, var, etc..)',
196
+ true
197
+ );
198
+
199
+ const _options = options.map( ( option, index ) => {
200
+ const _option = { ...option };
201
+ // Adding just one complex css value is enough (first element);
202
+ if ( addComplexCssValues && ! index ) {
203
+ _option.size = 'clamp(1.75rem, 3vw, 2.25rem)';
204
+ }
205
+ return _option;
206
+ } );
207
+
208
+ const fontSizes = _options.slice(
209
+ 0,
210
+ showMoreFontSizes ? _options.length : 5
211
+ );
212
+ return (
213
+ <div style={ { maxWidth: '248px' } }>
214
+ <FontSizePickerWithState
215
+ fontSizes={ fontSizes }
216
+ initialValue={ '1.125rem' }
217
+ />
218
+ </div>
219
+ );
220
+ };
@@ -141,4 +141,91 @@ describe( 'FontSizePicker', () => {
141
141
  expect( fontSize ).toBe( '16px' );
142
142
  } );
143
143
  } );
144
+ describe( 'renders different control', () => {
145
+ const options = [
146
+ {
147
+ name: 'Small',
148
+ slug: 'small',
149
+ size: '0.65rem',
150
+ },
151
+ {
152
+ name: 'Medium',
153
+ slug: 'medium',
154
+ size: '1.125rem',
155
+ },
156
+ {
157
+ name: 'Large',
158
+ slug: 'large',
159
+ size: '1.7rem',
160
+ },
161
+ ];
162
+ it( 'should render select control when we have more than five font sizes', () => {
163
+ const extraOptions = [
164
+ {
165
+ name: 'Extra Large',
166
+ slug: 'extra-large',
167
+ size: '1.95rem',
168
+ },
169
+ {
170
+ name: 'Extra Extra Large',
171
+ slug: 'extra-extra-large',
172
+ size: '2.5rem',
173
+ },
174
+ {
175
+ name: 'Huge',
176
+ slug: 'huge',
177
+ size: '2.8rem',
178
+ },
179
+ ];
180
+ const fontSizes = [ ...options, ...extraOptions ];
181
+ render(
182
+ <FontSizePicker
183
+ fontSizes={ fontSizes }
184
+ value={ fontSizes[ 0 ].size }
185
+ />
186
+ );
187
+ // Trigger click to open the select menu and take into account
188
+ // the two extra options (default, custom);
189
+ fireEvent.click(
190
+ screen.getByLabelText( 'Font size', { selector: 'button' } )
191
+ );
192
+ const element = screen.getAllByRole( 'option' );
193
+ expect( element ).toHaveLength( fontSizes.length + 2 );
194
+ } );
195
+ describe( 'segmented control', () => {
196
+ it( 'should use numeric labels for simple css values', () => {
197
+ const fontSizes = [ ...options ];
198
+ render(
199
+ <FontSizePicker
200
+ fontSizes={ fontSizes }
201
+ value={ fontSizes[ 0 ].size }
202
+ />
203
+ );
204
+ const element = screen.getByLabelText( 'Large' );
205
+ expect( element ).toBeInTheDocument();
206
+ expect( element.children ).toHaveLength( 2 );
207
+ expect( element.children[ 0 ].textContent ).toBe( '1.7' );
208
+ } );
209
+ it( 'should use incremental sequence of numbers as labels if we have complex css', () => {
210
+ const fontSizes = [
211
+ ...options,
212
+ {
213
+ name: 'Extra Large',
214
+ slug: 'extra-large',
215
+ size: 'clamp(1.75rem, 3vw, 2.25rem)',
216
+ },
217
+ ];
218
+ render(
219
+ <FontSizePicker
220
+ fontSizes={ fontSizes }
221
+ value={ fontSizes[ 0 ].size }
222
+ />
223
+ );
224
+ const element = screen.getByLabelText( 'Large' );
225
+ expect( element ).toBeInTheDocument();
226
+ expect( element.children ).toHaveLength( 2 );
227
+ expect( element.children[ 0 ].textContent ).toBe( '3' );
228
+ } );
229
+ } );
230
+ } );
144
231
  } );
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { isSimpleCssValue, splitValueAndUnitFromSize } from '../utils';
5
+
6
+ const simpleCSSCases = [
7
+ // Test integers and non-integers.
8
+ [ 1, true ],
9
+ [ 1.25, true ],
10
+ [ '123', true ],
11
+ [ '1.5', true ],
12
+ [ '0.75', true ],
13
+ // CSS unit tests.
14
+ [ '20px', true ],
15
+ [ '0.8em', true ],
16
+ [ '2rem', true ],
17
+ [ '1.4vw', true ],
18
+ [ '0.4vh', true ],
19
+ // Invalid negative values,
20
+ [ '-5px', false ],
21
+ // Complex CSS values that should fail.
22
+ [ 'abs(-10px)', false ],
23
+ [ 'calc(10px + 1)', false ],
24
+ [ 'clamp(2.5rem, 4vw, 3rem)', false ],
25
+ [ 'max(4.5em, 3vh)', false ],
26
+ [ 'min(10px, 1rem)', false ],
27
+ [ 'minmax(30px, auto)', false ],
28
+ [ 'var(--wp--font-size)', false ],
29
+ ];
30
+
31
+ describe( 'isSimpleCssValue', () => {
32
+ test.each( simpleCSSCases )(
33
+ 'given %p as argument, returns %p',
34
+ ( cssValue, result ) => {
35
+ expect( isSimpleCssValue( cssValue ) ).toBe( result );
36
+ }
37
+ );
38
+ } );
39
+
40
+ const splitValuesCases = [
41
+ // Test integers and non-integers.
42
+ [ 1, '1', undefined ],
43
+ [ 1.25, '1.25', undefined ],
44
+ [ '123', '123', undefined ],
45
+ [ '1.5', '1.5', undefined ],
46
+ [ '0.75', '0.75', undefined ],
47
+ // Valid simple CSS values.
48
+ [ '20px', '20', 'px' ],
49
+ [ '0.8em', '0.8', 'em' ],
50
+ [ '2rem', '2', 'rem' ],
51
+ [ '1.4vw', '1.4', 'vw' ],
52
+ [ '0.4vh', '0.4', 'vh' ],
53
+ // Invalid negative values,
54
+ [ '-5px', undefined, undefined ],
55
+ // Complex CSS values that shouldn't parse.
56
+ [ 'abs(-15px)', undefined, undefined ],
57
+ [ 'calc(10px + 1)', undefined, undefined ],
58
+ [ 'clamp(2.5rem, 4vw, 3rem)', undefined, undefined ],
59
+ [ 'max(4.5em, 3vh)', undefined, undefined ],
60
+ [ 'min(10px, 1rem)', undefined, undefined ],
61
+ [ 'minmax(30px, auto)', undefined, undefined ],
62
+ [ 'var(--wp--font-size)', undefined, undefined ],
63
+ ];
64
+
65
+ describe( 'splitValueAndUnitFromSize', () => {
66
+ test.each( splitValuesCases )(
67
+ 'given %p as argument, returns value = %p and unit = %p',
68
+ ( cssValue, expectedValue, expectedUnit ) => {
69
+ const [ value, unit ] = splitValueAndUnitFromSize( cssValue );
70
+ expect( value ).toBe( expectedValue );
71
+ expect( unit ).toBe( expectedUnit );
72
+ }
73
+ );
74
+ } );
@@ -14,6 +14,15 @@ const CUSTOM_FONT_SIZE_OPTION = {
14
14
  name: __( 'Custom' ),
15
15
  };
16
16
 
17
+ /**
18
+ * In case we have at most five font sizes, where at least one the them
19
+ * contain a complex css value(clamp, var, etc..) show a incremental sequence
20
+ * of numbers as a label of the font size. We do this because complex css values
21
+ * cannot be caluclated properly and the incremental sequence of numbers as labels
22
+ * can help the user better mentally map the different available font sizes.
23
+ */
24
+ const FONT_SIZES_ALIASES = [ '1', '2', '3', '4', '5' ];
25
+
17
26
  /**
18
27
  * Helper util to split a font size to its numeric value
19
28
  * and its `unit`, if exists.
@@ -22,12 +31,13 @@ const CUSTOM_FONT_SIZE_OPTION = {
22
31
  * @return {[number, string]} An array with the numeric value and the unit if exists.
23
32
  */
24
33
  export function splitValueAndUnitFromSize( size ) {
25
- /**
26
- * The first matched result is ignored as it's the left
27
- * hand side of the capturing group in the regex.
28
- */
29
- const [ , numericValue, unit ] = size.split( /(\d+)/ );
30
- return [ numericValue, unit ];
34
+ const [ numericValue, unit ] = `${ size }`.match( /[\d\.]+|\D+/g );
35
+
36
+ if ( ! isNaN( parseFloat( numericValue ) ) && isFinite( numericValue ) ) {
37
+ return [ numericValue, unit ];
38
+ }
39
+
40
+ return [];
31
41
  }
32
42
 
33
43
  /**
@@ -38,7 +48,7 @@ export function splitValueAndUnitFromSize( size ) {
38
48
  * @return {boolean} Whether the value is a simple css value.
39
49
  */
40
50
  export function isSimpleCssValue( value ) {
41
- const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;
51
+ const sizeRegex = /^[\d\.]+(px|em|rem|vw|vh|%)?$/i;
42
52
  return sizeRegex.test( value );
43
53
  }
44
54
 
@@ -46,22 +56,24 @@ export function isSimpleCssValue( value ) {
46
56
  * Return font size options in the proper format depending
47
57
  * on the currently used control (select, toggle group).
48
58
  *
49
- * @param {boolean} useSelectControl Whether to use a select control.
50
- * @param {Object[]} optionsArray Array of available font sizes objects.
51
- * @param {*} disableCustomFontSizes Flag that indicates if custom font sizes are disabled.
59
+ * @param {boolean} useSelectControl Whether to use a select control.
60
+ * @param {Object[]} optionsArray Array of available font sizes objects.
61
+ * @param {*} disableCustomFontSizes Flag that indicates if custom font sizes are disabled.
62
+ * @param {boolean} optionsContainComplexCssValues Whether font sizes contain at least one complex css value(clamp, var, etc..).
52
63
  * @return {Object[]|null} Array of font sizes in proper format for the used control.
53
64
  */
54
65
  export function getFontSizeOptions(
55
66
  useSelectControl,
56
67
  optionsArray,
57
- disableCustomFontSizes
68
+ disableCustomFontSizes,
69
+ optionsContainComplexCssValues
58
70
  ) {
59
71
  if ( disableCustomFontSizes && ! optionsArray.length ) {
60
72
  return null;
61
73
  }
62
74
  return useSelectControl
63
75
  ? getSelectOptions( optionsArray, disableCustomFontSizes )
64
- : getToggleGroupOptions( optionsArray );
76
+ : getToggleGroupOptions( optionsArray, optionsContainComplexCssValues );
65
77
  }
66
78
 
67
79
  function getSelectOptions( optionsArray, disableCustomFontSizes ) {
@@ -75,14 +87,16 @@ function getSelectOptions( optionsArray, disableCustomFontSizes ) {
75
87
  name,
76
88
  size,
77
89
  __experimentalHint:
78
- size && isSimpleCssValue( size ) && parseInt( size ),
90
+ size && isSimpleCssValue( size ) && parseFloat( size ),
79
91
  } ) );
80
92
  }
81
93
 
82
- function getToggleGroupOptions( optionsArray ) {
83
- return optionsArray.map( ( { slug, size, name } ) => {
84
- let label = size;
85
- if ( typeof size === 'string' ) {
94
+ function getToggleGroupOptions( optionsArray, optionsContainComplexCssValues ) {
95
+ return optionsArray.map( ( { slug, size, name }, index ) => {
96
+ let label = optionsContainComplexCssValues
97
+ ? FONT_SIZES_ALIASES[ index ]
98
+ : size;
99
+ if ( ! optionsContainComplexCssValues && typeof size === 'string' ) {
86
100
  const [ numericValue ] = splitValueAndUnitFromSize( size );
87
101
  label = numericValue;
88
102
  }
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/FormTokenField',
18
18
  component: FormTokenField,
19
19
  parameters: {
20
- knobs: { disabled: false },
20
+ knobs: { disable: false },
21
21
  },
22
22
  };
23
23
 
@@ -106,6 +106,7 @@ export default function GradientPicker( {
106
106
  clearable = true,
107
107
  disableCustomGradients = false,
108
108
  __experimentalHasMultipleOrigins,
109
+ __experimentalIsRenderedInSidebar,
109
110
  } ) {
110
111
  const clearGradient = useCallback( () => onChange( undefined ), [
111
112
  onChange,
@@ -136,6 +137,9 @@ export default function GradientPicker( {
136
137
  content={
137
138
  ! disableCustomGradients && (
138
139
  <CustomGradientPicker
140
+ __experimentalIsRenderedInSidebar={
141
+ __experimentalIsRenderedInSidebar
142
+ }
139
143
  value={ value }
140
144
  onChange={ onChange }
141
145
  />
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/GradientPicker',
18
18
  component: GradientPicker,
19
19
  parameters: {
20
- knobs: { disabled: false },
20
+ knobs: { disable: false },
21
21
  },
22
22
  };
23
23
 
@@ -13,7 +13,7 @@ export default {
13
13
  component: Grid,
14
14
  title: 'Components (Experimental)/Grid',
15
15
  parameters: {
16
- knobs: { disabled: false },
16
+ knobs: { disable: false },
17
17
  },
18
18
  };
19
19