@wordpress/components 19.1.5 → 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 (384) hide show
  1. package/CHANGELOG.md +40 -3
  2. package/build/angle-picker-control/index.js +2 -0
  3. package/build/angle-picker-control/index.js.map +1 -1
  4. package/build/button/index.native.js +13 -3
  5. package/build/button/index.native.js.map +1 -1
  6. package/build/checkbox-control/index.js +1 -1
  7. package/build/checkbox-control/index.js.map +1 -1
  8. package/build/clipboard-button/index.js +1 -2
  9. package/build/clipboard-button/index.js.map +1 -1
  10. package/build/color-palette/index.js +12 -0
  11. package/build/color-palette/index.js.map +1 -1
  12. package/build/color-picker/color-display.js +4 -2
  13. package/build/color-picker/color-display.js.map +1 -1
  14. package/build/color-picker/hex-input.js +3 -1
  15. package/build/color-picker/hex-input.js.map +1 -1
  16. package/build/color-picker/input-with-slider.js +3 -1
  17. package/build/color-picker/input-with-slider.js.map +1 -1
  18. package/build/confirm-dialog/component.js +103 -0
  19. package/build/confirm-dialog/component.js.map +1 -0
  20. package/build/confirm-dialog/index.js +16 -0
  21. package/build/confirm-dialog/index.js.map +1 -0
  22. package/build/confirm-dialog/types.js +6 -0
  23. package/build/confirm-dialog/types.js.map +1 -0
  24. package/build/custom-gradient-picker/index.js +1 -0
  25. package/build/custom-gradient-picker/index.js.map +1 -1
  26. package/build/date-time/date.js +63 -86
  27. package/build/date-time/date.js.map +1 -1
  28. package/build/date-time/utils.js +32 -0
  29. package/build/date-time/utils.js.map +1 -0
  30. package/build/divider/component.js +8 -7
  31. package/build/divider/component.js.map +1 -1
  32. package/build/divider/styles.js +38 -13
  33. package/build/divider/styles.js.map +1 -1
  34. package/build/drop-zone/index.js +14 -6
  35. package/build/drop-zone/index.js.map +1 -1
  36. package/build/drop-zone/provider.js +1 -0
  37. package/build/drop-zone/provider.js.map +1 -1
  38. package/build/flyout/styles.js +2 -2
  39. package/build/flyout/styles.js.map +1 -1
  40. package/build/focusable-iframe/index.js +1 -0
  41. package/build/focusable-iframe/index.js.map +1 -1
  42. package/build/font-size-picker/index.js +10 -9
  43. package/build/font-size-picker/index.js.map +1 -1
  44. package/build/font-size-picker/utils.js +28 -17
  45. package/build/font-size-picker/utils.js.map +1 -1
  46. package/build/higher-order/with-focus-outside/index.js +2 -0
  47. package/build/higher-order/with-focus-outside/index.js.map +1 -1
  48. package/build/index.js +8 -0
  49. package/build/index.js.map +1 -1
  50. package/build/input-control/styles/input-control-styles.js +44 -32
  51. package/build/input-control/styles/input-control-styles.js.map +1 -1
  52. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -3
  53. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  54. package/build/mobile/color-settings/index.native.js +4 -2
  55. package/build/mobile/color-settings/index.native.js.map +1 -1
  56. package/build/mobile/color-settings/palette.screen.native.js +7 -6
  57. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  58. package/build/mobile/global-styles-context/utils.native.js +1 -1
  59. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  60. package/build/mobile/gridicons/index.native.js +3 -1
  61. package/build/mobile/gridicons/index.native.js.map +1 -1
  62. package/build/mobile/link-picker/index.native.js +45 -4
  63. package/build/mobile/link-picker/index.native.js.map +1 -1
  64. package/build/mobile/link-settings/index.native.js +10 -0
  65. package/build/mobile/link-settings/index.native.js.map +1 -1
  66. package/build/modal/aria-helper.js +2 -0
  67. package/build/modal/aria-helper.js.map +1 -1
  68. package/build/modal/index.js +17 -8
  69. package/build/modal/index.js.map +1 -1
  70. package/build/select-control/styles/select-control-styles.js +33 -9
  71. package/build/select-control/styles/select-control-styles.js.map +1 -1
  72. package/build/style-provider/index.js +2 -0
  73. package/build/style-provider/index.js.map +1 -1
  74. package/build/toggle-group-control/toggle-group-control/component.js +7 -2
  75. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  76. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +25 -14
  77. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  78. package/build/tools-panel/styles.js +12 -10
  79. package/build/tools-panel/styles.js.map +1 -1
  80. package/build/tools-panel/tools-panel/component.js +6 -8
  81. package/build/tools-panel/tools-panel/component.js.map +1 -1
  82. package/build/tools-panel/tools-panel/hook.js +48 -17
  83. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  84. package/build/tools-panel/tools-panel-item/hook.js +5 -1
  85. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  86. package/build/unit-control/styles/unit-control-styles.js +23 -41
  87. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  88. package/build/z-stack/component.js.map +1 -1
  89. package/build/z-stack/styles.js +10 -8
  90. package/build/z-stack/styles.js.map +1 -1
  91. package/build-module/angle-picker-control/index.js +2 -0
  92. package/build-module/angle-picker-control/index.js.map +1 -1
  93. package/build-module/button/index.native.js +13 -3
  94. package/build-module/button/index.native.js.map +1 -1
  95. package/build-module/checkbox-control/index.js +1 -1
  96. package/build-module/checkbox-control/index.js.map +1 -1
  97. package/build-module/clipboard-button/index.js +1 -2
  98. package/build-module/clipboard-button/index.js.map +1 -1
  99. package/build-module/color-palette/index.js +13 -1
  100. package/build-module/color-palette/index.js.map +1 -1
  101. package/build-module/color-picker/color-display.js +3 -2
  102. package/build-module/color-picker/color-display.js.map +1 -1
  103. package/build-module/color-picker/hex-input.js +2 -1
  104. package/build-module/color-picker/hex-input.js.map +1 -1
  105. package/build-module/color-picker/input-with-slider.js +2 -1
  106. package/build-module/color-picker/input-with-slider.js.map +1 -1
  107. package/build-module/confirm-dialog/component.js +84 -0
  108. package/build-module/confirm-dialog/component.js.map +1 -0
  109. package/build-module/confirm-dialog/index.js +6 -0
  110. package/build-module/confirm-dialog/index.js.map +1 -0
  111. package/build-module/confirm-dialog/types.js +2 -0
  112. package/build-module/confirm-dialog/types.js.map +1 -0
  113. package/build-module/custom-gradient-picker/index.js +1 -0
  114. package/build-module/custom-gradient-picker/index.js.map +1 -1
  115. package/build-module/date-time/date.js +63 -87
  116. package/build-module/date-time/date.js.map +1 -1
  117. package/build-module/date-time/utils.js +20 -0
  118. package/build-module/date-time/utils.js.map +1 -0
  119. package/build-module/divider/component.js +8 -7
  120. package/build-module/divider/component.js.map +1 -1
  121. package/build-module/divider/styles.js +37 -13
  122. package/build-module/divider/styles.js.map +1 -1
  123. package/build-module/drop-zone/index.js +14 -6
  124. package/build-module/drop-zone/index.js.map +1 -1
  125. package/build-module/drop-zone/provider.js +1 -0
  126. package/build-module/drop-zone/provider.js.map +1 -1
  127. package/build-module/flyout/styles.js +2 -2
  128. package/build-module/flyout/styles.js.map +1 -1
  129. package/build-module/focusable-iframe/index.js +1 -0
  130. package/build-module/focusable-iframe/index.js.map +1 -1
  131. package/build-module/font-size-picker/index.js +10 -9
  132. package/build-module/font-size-picker/index.js.map +1 -1
  133. package/build-module/font-size-picker/utils.js +28 -17
  134. package/build-module/font-size-picker/utils.js.map +1 -1
  135. package/build-module/higher-order/with-focus-outside/index.js +1 -0
  136. package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
  137. package/build-module/index.js +1 -0
  138. package/build-module/index.js.map +1 -1
  139. package/build-module/input-control/styles/input-control-styles.js +44 -32
  140. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  141. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -4
  142. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  143. package/build-module/mobile/color-settings/index.native.js +4 -2
  144. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  145. package/build-module/mobile/color-settings/palette.screen.native.js +7 -6
  146. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  147. package/build-module/mobile/global-styles-context/utils.native.js +1 -1
  148. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  149. package/build-module/mobile/gridicons/index.native.js +1 -0
  150. package/build-module/mobile/gridicons/index.native.js.map +1 -1
  151. package/build-module/mobile/link-picker/index.native.js +50 -8
  152. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  153. package/build-module/mobile/link-settings/index.native.js +10 -0
  154. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  155. package/build-module/modal/aria-helper.js +2 -0
  156. package/build-module/modal/aria-helper.js.map +1 -1
  157. package/build-module/modal/index.js +15 -8
  158. package/build-module/modal/index.js.map +1 -1
  159. package/build-module/select-control/styles/select-control-styles.js +33 -9
  160. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  161. package/build-module/style-provider/index.js +1 -0
  162. package/build-module/style-provider/index.js.map +1 -1
  163. package/build-module/toggle-group-control/toggle-group-control/component.js +8 -3
  164. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  165. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +25 -14
  166. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  167. package/build-module/tools-panel/styles.js +12 -11
  168. package/build-module/tools-panel/styles.js.map +1 -1
  169. package/build-module/tools-panel/tools-panel/component.js +5 -8
  170. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  171. package/build-module/tools-panel/tools-panel/hook.js +48 -17
  172. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  173. package/build-module/tools-panel/tools-panel-item/hook.js +5 -1
  174. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  175. package/build-module/unit-control/styles/unit-control-styles.js +23 -41
  176. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  177. package/build-module/z-stack/component.js.map +1 -1
  178. package/build-module/z-stack/styles.js +13 -8
  179. package/build-module/z-stack/styles.js.map +1 -1
  180. package/build-style/style-rtl.css +23 -11
  181. package/build-style/style.css +23 -11
  182. package/build-types/base-field/hook.d.ts +16 -16
  183. package/build-types/card/card/hook.d.ts +16 -16
  184. package/build-types/card/card-body/hook.d.ts +16 -16
  185. package/build-types/card/card-divider/hook.d.ts +18 -18
  186. package/build-types/card/card-footer/hook.d.ts +17 -17
  187. package/build-types/card/card-header/hook.d.ts +16 -16
  188. package/build-types/card/card-media/hook.d.ts +16 -16
  189. package/build-types/divider/component.d.ts +8 -7
  190. package/build-types/divider/component.d.ts.map +1 -1
  191. package/build-types/divider/styles.d.ts +2 -2
  192. package/build-types/divider/styles.d.ts.map +1 -1
  193. package/build-types/divider/types.d.ts +5 -5
  194. package/build-types/divider/types.d.ts.map +1 -1
  195. package/build-types/elevation/hook.d.ts +15 -15
  196. package/build-types/flex/flex/hook.d.ts +16 -16
  197. package/build-types/flex/flex-block/hook.d.ts +16 -16
  198. package/build-types/flex/flex-item/hook.d.ts +16 -16
  199. package/build-types/flyout/flyout/hook.d.ts +17 -17
  200. package/build-types/flyout/styles.d.ts +7 -9
  201. package/build-types/flyout/styles.d.ts.map +1 -1
  202. package/build-types/grid/hook.d.ts +16 -16
  203. package/build-types/h-stack/hook.d.ts +16 -16
  204. package/build-types/heading/hook.d.ts +16 -16
  205. package/build-types/input-control/index.d.ts +1 -1
  206. package/build-types/input-control/index.d.ts.map +1 -1
  207. package/build-types/input-control/input-field.d.ts +1 -1
  208. package/build-types/input-control/input-field.d.ts.map +1 -1
  209. package/build-types/input-control/styles/input-control-styles.d.ts +1 -2
  210. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  211. package/build-types/input-control/types.d.ts +2 -1
  212. package/build-types/input-control/types.d.ts.map +1 -1
  213. package/build-types/item-group/item/hook.d.ts +16 -16
  214. package/build-types/item-group/item-group/hook.d.ts +16 -16
  215. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  216. package/build-types/scrollable/hook.d.ts +16 -16
  217. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  218. package/build-types/select-control/types.d.ts +1 -1
  219. package/build-types/select-control/types.d.ts.map +1 -1
  220. package/build-types/spacer/hook.d.ts +16 -16
  221. package/build-types/surface/hook.d.ts +16 -16
  222. package/build-types/text/hook.d.ts +16 -16
  223. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  224. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
  225. package/build-types/tools-panel/styles.d.ts.map +1 -1
  226. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  227. package/build-types/tools-panel/tools-panel/hook.d.ts +16 -16
  228. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  229. package/build-types/tools-panel/tools-panel-header/hook.d.ts +16 -16
  230. package/build-types/tools-panel/tools-panel-item/hook.d.ts +16 -16
  231. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  232. package/build-types/tools-panel/types.d.ts +2 -1
  233. package/build-types/tools-panel/types.d.ts.map +1 -1
  234. package/build-types/truncate/hook.d.ts +16 -16
  235. package/build-types/ui/control-group/hook.d.ts +18 -18
  236. package/build-types/ui/control-label/hook.d.ts +16 -16
  237. package/build-types/ui/form-group/form-group.d.ts +4 -4
  238. package/build-types/ui/form-group/use-form-group.d.ts +55 -55
  239. package/build-types/unit-control/index.d.ts +1 -1
  240. package/build-types/unit-control/index.d.ts.map +1 -1
  241. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -0
  242. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  243. package/build-types/unit-control/types.d.ts +2 -2
  244. package/build-types/unit-control/types.d.ts.map +1 -1
  245. package/build-types/v-stack/hook.d.ts +16 -16
  246. package/build-types/z-stack/component.d.ts +1 -1
  247. package/build-types/z-stack/styles.d.ts.map +1 -1
  248. package/package.json +21 -23
  249. package/src/alignment-matrix-control/stories/index.js +1 -1
  250. package/src/angle-picker-control/index.js +2 -0
  251. package/src/base-control/stories/index.js +1 -1
  252. package/src/button/index.native.js +15 -1
  253. package/src/button/stories/index.js +1 -1
  254. package/src/button/style.scss +14 -0
  255. package/src/card/card/README.md +3 -3
  256. package/src/card/stories/index.js +1 -1
  257. package/src/card/test/__snapshots__/index.js.snap +6 -6
  258. package/src/checkbox-control/index.js +1 -1
  259. package/src/checkbox-control/stories/index.js +1 -1
  260. package/src/clipboard-button/index.js +1 -2
  261. package/src/color-indicator/stories/index.js +1 -1
  262. package/src/color-indicator/style.scss +5 -8
  263. package/src/color-palette/index.js +10 -1
  264. package/src/color-palette/stories/index.js +1 -1
  265. package/src/color-palette/test/__snapshots__/index.js.snap +1 -0
  266. package/src/color-picker/color-display.tsx +3 -2
  267. package/src/color-picker/hex-input.tsx +2 -1
  268. package/src/color-picker/input-with-slider.tsx +2 -1
  269. package/src/color-picker/stories/index.js +1 -1
  270. package/src/combobox-control/README.md +2 -2
  271. package/src/confirm-dialog/README.md +128 -0
  272. package/src/confirm-dialog/component.tsx +114 -0
  273. package/src/confirm-dialog/index.tsx +6 -0
  274. package/src/confirm-dialog/stories/index.js +120 -0
  275. package/src/confirm-dialog/test/index.js +302 -0
  276. package/src/confirm-dialog/types.ts +26 -0
  277. package/src/custom-gradient-picker/index.js +1 -0
  278. package/src/custom-gradient-picker/style.scss +0 -4
  279. package/src/date-time/README.md +7 -0
  280. package/src/date-time/date.js +67 -84
  281. package/src/date-time/stories/index.js +1 -1
  282. package/src/date-time/stories/time.js +1 -1
  283. package/src/date-time/test/date.js +3 -29
  284. package/src/date-time/test/utils.js +32 -0
  285. package/src/date-time/utils.js +18 -0
  286. package/src/dimension-control/README.md +1 -1
  287. package/src/divider/README.md +33 -5
  288. package/src/divider/component.tsx +8 -7
  289. package/src/divider/stories/index.js +43 -17
  290. package/src/divider/styles.ts +53 -16
  291. package/src/divider/test/__snapshots__/index.js.snap +11 -11
  292. package/src/divider/test/index.js +4 -4
  293. package/src/divider/types.ts +5 -5
  294. package/src/drop-zone/index.js +14 -6
  295. package/src/drop-zone/provider.js +1 -0
  296. package/src/dropdown-menu/stories/index.js +1 -1
  297. package/src/duotone-picker/README.md +1 -1
  298. package/src/elevation/stories/index.js +1 -1
  299. package/src/external-link/stories/index.js +1 -1
  300. package/src/flyout/styles.ts +4 -2
  301. package/src/focusable-iframe/index.js +1 -0
  302. package/src/font-size-picker/index.js +27 -13
  303. package/src/font-size-picker/stories/index.js +63 -1
  304. package/src/font-size-picker/test/index.js +87 -0
  305. package/src/font-size-picker/test/util.js +74 -0
  306. package/src/font-size-picker/utils.js +31 -17
  307. package/src/form-token-field/stories/index.js +1 -1
  308. package/src/gradient-picker/stories/index.js +1 -1
  309. package/src/grid/stories/index.js +1 -1
  310. package/src/guide/stories/index.js +1 -1
  311. package/src/higher-order/with-focus-outside/index.js +2 -0
  312. package/src/icon/stories/index.js +1 -1
  313. package/src/index.js +1 -0
  314. package/src/input-control/stories/index.js +2 -1
  315. package/src/input-control/styles/input-control-styles.tsx +16 -6
  316. package/src/input-control/types.ts +3 -1
  317. package/src/item-group/stories/index.js +84 -2
  318. package/src/menu-item/README.md +2 -2
  319. package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +6 -2
  320. package/src/mobile/color-settings/index.native.js +2 -0
  321. package/src/mobile/color-settings/palette.screen.native.js +8 -5
  322. package/src/mobile/color-settings/style.native.scss +1 -1
  323. package/src/mobile/global-styles-context/utils.native.js +1 -1
  324. package/src/mobile/gridicons/index.native.js +3 -3
  325. package/src/mobile/inserter-button/style.native.scss +1 -0
  326. package/src/mobile/link-picker/index.native.js +41 -7
  327. package/src/mobile/link-settings/index.native.js +11 -0
  328. package/src/mobile/link-settings/test/edit.native.js +432 -0
  329. package/src/modal/README.md +10 -0
  330. package/src/modal/aria-helper.js +2 -0
  331. package/src/modal/index.js +72 -55
  332. package/src/modal/stories/index.js +6 -1
  333. package/src/modal/style.scss +9 -0
  334. package/src/modal/test/index.js +11 -0
  335. package/src/navigation/README.md +0 -9
  336. package/src/notice/stories/index.js +1 -1
  337. package/src/number-control/stories/index.js +1 -1
  338. package/src/panel/stories/index.js +1 -1
  339. package/src/placeholder/stories/index.js +1 -1
  340. package/src/popover/stories/index.js +1 -1
  341. package/src/query-controls/README.md +138 -6
  342. package/src/radio-group/README.md +4 -1
  343. package/src/range-control/stories/index.js +1 -1
  344. package/src/resizable-box/stories/index.js +1 -1
  345. package/src/scrollable/stories/index.js +1 -1
  346. package/src/search-control/stories/index.js +1 -1
  347. package/src/select-control/stories/index.js +2 -1
  348. package/src/select-control/styles/select-control-styles.ts +25 -2
  349. package/src/select-control/types.ts +1 -1
  350. package/src/slot-fill/stories/index.js +1 -1
  351. package/src/snackbar/stories/index.js +1 -1
  352. package/src/spacer/stories/index.js +1 -1
  353. package/src/style-provider/index.js +2 -0
  354. package/src/surface/stories/index.js +1 -1
  355. package/src/tab-panel/stories/index.js +1 -1
  356. package/src/text-control/stories/index.js +1 -1
  357. package/src/text-highlight/stories/index.js +1 -1
  358. package/src/textarea-control/stories/index.js +1 -1
  359. package/src/tip/stories/index.js +1 -1
  360. package/src/toggle-control/stories/index.js +1 -1
  361. package/src/toggle-group-control/stories/index.js +1 -1
  362. package/src/toggle-group-control/toggle-group-control/component.tsx +7 -2
  363. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +24 -9
  364. package/src/toolbar-button/stories/index.js +1 -1
  365. package/src/tools-panel/stories/index.js +237 -0
  366. package/src/tools-panel/styles.ts +41 -1
  367. package/src/tools-panel/test/index.js +234 -1
  368. package/src/tools-panel/tools-panel/README.md +9 -0
  369. package/src/tools-panel/tools-panel/component.tsx +2 -5
  370. package/src/tools-panel/tools-panel/hook.ts +50 -18
  371. package/src/tools-panel/tools-panel-item/hook.ts +5 -1
  372. package/src/tools-panel/types.ts +5 -1
  373. package/src/tooltip/stories/index.js +1 -1
  374. package/src/tree-select/stories/index.js +1 -1
  375. package/src/truncate/stories/index.js +1 -1
  376. package/src/unit-control/stories/index.js +19 -1
  377. package/src/unit-control/styles/unit-control-styles.ts +33 -46
  378. package/src/unit-control/types.ts +5 -2
  379. package/src/z-stack/README.md +1 -1
  380. package/src/z-stack/component.tsx +1 -1
  381. package/src/z-stack/stories/index.js +1 -1
  382. package/src/z-stack/styles.ts +7 -2
  383. package/tsconfig.json +6 -2
  384. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,18 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import moment from 'moment';
5
+
6
+ /**
7
+ * Create a Moment object from a date string. With no date supplied, default to a Moment
8
+ * object representing now. If a null value is passed, return a null value.
9
+ *
10
+ * @param {?string} date Date representing the currently selected date or null to signify no selection.
11
+ * @return {?moment.Moment} Moment object for selected date or null.
12
+ */
13
+ export const getMomentDate = ( date ) => {
14
+ if ( null === date ) {
15
+ return null;
16
+ }
17
+ return date ? moment( date ) : moment();
18
+ };
@@ -13,7 +13,7 @@ In a block's `edit` implementation, render a `<DimensionControl />` component.
13
13
  ```jsx
14
14
  import { registerBlockType } from '@wordpress/blocks';
15
15
  import { __ } from '@wordpress/i18n';
16
- import { DimensionControl } from '@wordpress/block-editor';
16
+ import { DimensionControl } from '@wordpress/components';
17
17
 
18
18
  registerBlockType( 'my-plugin/my-block', {
19
19
  // ...
@@ -9,15 +9,43 @@ This feature is still experimental. “Experimental” means this is an early im
9
9
  ## Usage
10
10
 
11
11
  ```jsx
12
- import { Divider, FormGroup, ListGroup } from '@wordpress/components/ui';
12
+ import {
13
+ __experimentalDivider as Divider,
14
+ __experimentalText as Text,
15
+ __experimentalVStack as VStack,
16
+ } from `@wordpress/components`;
13
17
 
14
18
  function Example() {
15
19
  return (
16
- <ListGroup>
17
- <FormGroup>...</FormGroup>
20
+ <VStack spacing={4}>
21
+ <Text>Some text here</Text>
18
22
  <Divider />
19
- <FormGroup>...</FormGroup>
20
- </ListGroup>
23
+ <Text>Some more text here</Text>
24
+ </VStack>
21
25
  );
22
26
  }
23
27
  ```
28
+
29
+ ## Props
30
+
31
+ ### `margin`: `number`
32
+
33
+ Adjusts all margins on the inline dimension.
34
+
35
+ - Required: No
36
+
37
+ ### `marginStart`: `number`
38
+
39
+ Adjusts the inline-start margin.
40
+
41
+ - Required: No
42
+
43
+ ### `marginEnd`: `number`
44
+
45
+ Adjusts the inline-end margin.
46
+
47
+ - Required: No
48
+
49
+ ### Inherited props
50
+
51
+ `Divider` also inherits all of the [`Separator` props](https://reakit.io/docs/separator/).
@@ -38,17 +38,18 @@ function Divider(
38
38
  * @example
39
39
  * ```js
40
40
  * import {
41
- * __experimentalDivider as Divider,
42
- * __experimentalText as Text }
43
- * from `@wordpress/components`;
41
+ * __experimentalDivider as Divider,
42
+ * __experimentalText as Text,
43
+ * __experimentalVStack as VStack,
44
+ * } from `@wordpress/components`;
44
45
  *
45
46
  * function Example() {
46
47
  * return (
47
- * <ListGroup>
48
- * <FormGroup>...</FormGroup>
48
+ * <VStack spacing={4}>
49
+ * <Text>Some text here</Text>
49
50
  * <Divider />
50
- * <FormGroup>...</FormGroup>
51
- * </ListGroup>
51
+ * <Text>Some more text here</Text>
52
+ * </VStack>
52
53
  * );
53
54
  * }
54
55
  * ```
@@ -1,38 +1,64 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { number } from '@storybook/addon-knobs';
4
+ import { css } from '@emotion/react';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
+ import { useCx } from '../../utils';
10
+ import { Text } from '../../text';
9
11
  import { Divider } from '..';
10
12
 
11
13
  export default {
12
14
  component: Divider,
13
15
  title: 'Components (Experimental)/Divider',
14
- parameters: {
15
- knobs: { disabled: false },
16
+ argTypes: {
17
+ margin: {
18
+ control: { type: 'number' },
19
+ },
20
+ marginStart: {
21
+ control: { type: 'number' },
22
+ },
23
+ marginEnd: {
24
+ control: { type: 'number' },
25
+ },
16
26
  },
17
27
  };
18
28
 
19
- const BlackDivider = ( props ) => (
20
- <Divider { ...props } style={ { borderColor: 'black' } } />
29
+ const HorizontalTemplate = ( args ) => (
30
+ <div>
31
+ <Text>Some text before the divider</Text>
32
+ <Divider { ...args } />
33
+ <Text>Some text after the divider</Text>
34
+ </div>
21
35
  );
22
36
 
23
- export const _default = () => {
24
- const props = {
25
- margin: number( 'margin', 0 ),
26
- };
27
- // make the border color black to give higher contrast and help it appear in storybook better
28
- return <BlackDivider { ...props } />;
37
+ const VerticalTemplate = ( args ) => {
38
+ const cx = useCx();
39
+ const wrapperClassName = cx( css`
40
+ display: flex;
41
+ align-items: stretch;
42
+ justify-content: start;
43
+ ` );
44
+
45
+ return (
46
+ <div className={ wrapperClassName }>
47
+ <Text>Some text before the divider</Text>
48
+ <Divider orientation="vertical" { ...args } />
49
+ <Text>Some text after the divider</Text>
50
+ </div>
51
+ );
29
52
  };
30
53
 
31
- export const splitMargins = () => {
32
- const props = {
33
- marginTop: number( 'marginTop', 0 ),
34
- marginBottom: number( 'marginBottom', 0 ),
35
- };
54
+ export const Horizontal = HorizontalTemplate.bind( {} );
55
+ Horizontal.args = {
56
+ margin: 2,
57
+ marginStart: undefined,
58
+ marginEnd: undefined,
59
+ };
36
60
 
37
- return <BlackDivider { ...props } />;
61
+ export const Vertical = VerticalTemplate.bind( {} );
62
+ Vertical.args = {
63
+ ...Horizontal.args,
38
64
  };
@@ -8,29 +8,66 @@ import { css } from '@emotion/react';
8
8
  * Internal dependencies
9
9
  */
10
10
  import { space } from '../ui/utils/space';
11
- import CONFIG from '../utils/config-values';
12
- import type { OwnProps } from './types';
11
+ import { rtl } from '../utils';
12
+ import type { Props } from './types';
13
13
 
14
- const renderMargin = ( { margin, marginTop, marginBottom }: OwnProps ) => {
15
- if ( typeof margin !== 'undefined' ) {
16
- return css( {
17
- marginBottom: space( margin ),
18
- marginTop: space( margin ),
19
- } );
20
- }
14
+ const MARGIN_DIRECTIONS: Record<
15
+ NonNullable< Props[ 'orientation' ] >,
16
+ Record< 'start' | 'end', string >
17
+ > = {
18
+ vertical: {
19
+ start: 'marginLeft',
20
+ end: 'marginRight',
21
+ },
22
+ horizontal: {
23
+ start: 'marginTop',
24
+ end: 'marginBottom',
25
+ },
26
+ };
27
+
28
+ // Renders the correct margins given the Divider's `orientation` and the writing direction.
29
+ // When both the generic `margin` and the specific `marginStart|marginEnd` props are defined,
30
+ // the latter will take priority.
31
+ const renderMargin = ( {
32
+ 'aria-orientation': orientation = 'horizontal',
33
+ margin,
34
+ marginStart,
35
+ marginEnd,
36
+ }: Props ) =>
37
+ css(
38
+ rtl( {
39
+ [ MARGIN_DIRECTIONS[ orientation ].start ]: space(
40
+ marginStart ?? margin
41
+ ),
42
+ [ MARGIN_DIRECTIONS[ orientation ].end ]: space(
43
+ marginEnd ?? margin
44
+ ),
45
+ } )()
46
+ );
21
47
 
48
+ const renderBorder = ( {
49
+ 'aria-orientation': orientation = 'horizontal',
50
+ }: Props ) => {
22
51
  return css( {
23
- marginTop: space( marginTop ),
24
- marginBottom: space( marginBottom ),
52
+ [ orientation === 'vertical'
53
+ ? 'borderRight'
54
+ : 'borderBottom' ]: '1px solid currentColor',
25
55
  } );
26
56
  };
27
57
 
28
- export const DividerView = styled.hr< OwnProps >`
29
- border-color: ${ CONFIG.colorDivider };
30
- border-width: 0 0 1px 0;
31
- height: 0;
58
+ const renderSize = ( {
59
+ 'aria-orientation': orientation = 'horizontal',
60
+ }: Props ) =>
61
+ css( {
62
+ height: orientation === 'vertical' ? 'auto' : 0,
63
+ width: orientation === 'vertical' ? 0 : 'auto',
64
+ } );
65
+
66
+ export const DividerView = styled.hr< Props >`
67
+ border: 0;
32
68
  margin: 0;
33
- width: auto;
34
69
 
70
+ ${ renderBorder }
71
+ ${ renderSize }
35
72
  ${ renderMargin }
36
73
  `;
@@ -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
+ };