@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
@@ -1,3 +1,5 @@
1
+ //@ts-nocheck
2
+
1
3
  /**
2
4
  * External dependencies
3
5
  */
@@ -6,7 +8,12 @@ import classnames from 'classnames';
6
8
  /**
7
9
  * WordPress dependencies
8
10
  */
9
- import { createPortal, useEffect, useRef } from '@wordpress/element';
11
+ import {
12
+ createPortal,
13
+ useEffect,
14
+ useRef,
15
+ forwardRef,
16
+ } from '@wordpress/element';
10
17
  import {
11
18
  useInstanceId,
12
19
  useFocusReturn,
@@ -30,31 +37,34 @@ import StyleProvider from '../style-provider';
30
37
  // Used to count the number of open modals.
31
38
  let openModalCount = 0;
32
39
 
33
- export default function Modal( {
34
- bodyOpenClassName = 'modal-open',
35
- role = 'dialog',
36
- title = null,
37
- focusOnMount = true,
38
- shouldCloseOnEsc = true,
39
- shouldCloseOnClickOutside = true,
40
- isDismissable, // Deprecated
41
- isDismissible = isDismissable || true,
42
- /* accessibility */
43
- aria = {
44
- labelledby: null,
45
- describedby: null,
46
- },
47
- onRequestClose,
48
- icon,
49
- closeButtonLabel,
50
- children,
51
- style,
52
- overlayClassName,
53
- className,
54
- contentLabel,
55
- onKeyDown,
56
- isFullScreen = false,
57
- } ) {
40
+ function Modal( props, forwardedRef ) {
41
+ const {
42
+ bodyOpenClassName = 'modal-open',
43
+ role = 'dialog',
44
+ title = null,
45
+ focusOnMount = true,
46
+ shouldCloseOnEsc = true,
47
+ shouldCloseOnClickOutside = true,
48
+ isDismissable, // Deprecated
49
+ isDismissible = isDismissable || true,
50
+ /* accessibility */
51
+ aria = {
52
+ labelledby: null,
53
+ describedby: null,
54
+ },
55
+ onRequestClose,
56
+ icon,
57
+ closeButtonLabel,
58
+ children,
59
+ style,
60
+ overlayClassName,
61
+ className,
62
+ contentLabel,
63
+ onKeyDown,
64
+ isFullScreen = false,
65
+ __experimentalHideHeader = false,
66
+ } = props;
67
+
58
68
  const ref = useRef();
59
69
  const instanceId = useInstanceId( Modal );
60
70
  const headingId = title
@@ -106,7 +116,7 @@ export default function Modal( {
106
116
  return createPortal(
107
117
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
108
118
  <div
109
- ref={ ref }
119
+ ref={ useMergeRefs( [ ref, forwardedRef ] ) }
110
120
  className={ classnames(
111
121
  'components-modal__screen-overlay',
112
122
  overlayClassName
@@ -139,38 +149,43 @@ export default function Modal( {
139
149
  onKeyDown={ onKeyDown }
140
150
  >
141
151
  <div
142
- className={ 'components-modal__content' }
152
+ className={ classnames( 'components-modal__content', {
153
+ 'hide-header': __experimentalHideHeader,
154
+ } ) }
143
155
  role="document"
144
156
  >
145
- <div className="components-modal__header">
146
- <div className="components-modal__header-heading-container">
147
- { icon && (
148
- <span
149
- className="components-modal__icon-container"
150
- aria-hidden
151
- >
152
- { icon }
153
- </span>
154
- ) }
155
- { title && (
156
- <h1
157
- id={ headingId }
158
- className="components-modal__header-heading"
159
- >
160
- { title }
161
- </h1>
157
+ { ! __experimentalHideHeader && (
158
+ <div className="components-modal__header">
159
+ <div className="components-modal__header-heading-container">
160
+ { icon && (
161
+ <span
162
+ className="components-modal__icon-container"
163
+ aria-hidden
164
+ >
165
+ { icon }
166
+ </span>
167
+ ) }
168
+ { title && (
169
+ <h1
170
+ id={ headingId }
171
+ className="components-modal__header-heading"
172
+ >
173
+ { title }
174
+ </h1>
175
+ ) }
176
+ </div>
177
+ { isDismissible && (
178
+ <Button
179
+ onClick={ onRequestClose }
180
+ icon={ closeSmall }
181
+ label={
182
+ closeButtonLabel ||
183
+ __( 'Close dialog' )
184
+ }
185
+ />
162
186
  ) }
163
187
  </div>
164
- { isDismissible && (
165
- <Button
166
- onClick={ onRequestClose }
167
- icon={ closeSmall }
168
- label={
169
- closeButtonLabel || __( 'Close dialog' )
170
- }
171
- />
172
- ) }
173
- </div>
188
+ ) }
174
189
  { children }
175
190
  </div>
176
191
  </div>
@@ -179,3 +194,5 @@ export default function Modal( {
179
194
  document.body
180
195
  );
181
196
  }
197
+
198
+ export default forwardRef( Modal );
@@ -20,7 +20,7 @@ export default {
20
20
  title: 'Components/Modal',
21
21
  component: Modal,
22
22
  parameters: {
23
- knobs: { disabled: false },
23
+ knobs: { disable: false },
24
24
  },
25
25
  };
26
26
 
@@ -55,6 +55,10 @@ export const _default = () => {
55
55
  'shouldCloseOnClickOutside',
56
56
  true
57
57
  );
58
+ const __experimentalHideHeader = boolean(
59
+ '__experimentalHideHeader',
60
+ false
61
+ );
58
62
 
59
63
  const iconComponent = showIcon ? <Icon icon={ wordpress } /> : null;
60
64
 
@@ -65,6 +69,7 @@ export const _default = () => {
65
69
  shouldCloseOnEsc,
66
70
  shouldCloseOnClickOutside,
67
71
  title,
72
+ __experimentalHideHeader,
68
73
  };
69
74
 
70
75
  return <ModalExample { ...modalProps } />;
@@ -126,4 +126,13 @@
126
126
  display: block;
127
127
  margin-bottom: $grid-unit-30;
128
128
  }
129
+
130
+ &.hide-header {
131
+ margin-top: 0;
132
+ padding-top: $grid-unit-30;
133
+
134
+ &::before {
135
+ content: none;
136
+ }
137
+ }
129
138
  }
@@ -46,4 +46,15 @@ describe( 'Modal', () => {
46
46
  const titleId = within( dialog ).getByText( 'Test Title' ).id;
47
47
  expect( dialog ).toHaveAttribute( 'aria-labelledby', titleId );
48
48
  } );
49
+
50
+ it( 'hides the header when the `__experimentalHideHeader` prop is used', () => {
51
+ render(
52
+ <Modal title="Test Title" __experimentalHideHeader>
53
+ <p>Modal content</p>
54
+ </Modal>
55
+ );
56
+ const dialog = screen.getByRole( 'dialog' );
57
+ const title = within( dialog ).queryByText( 'Test Title' );
58
+ expect( title ).not.toBeInTheDocument();
59
+ } );
49
60
  } );
@@ -44,15 +44,6 @@ const MyNavigation = () => (
44
44
  </Navigation>
45
45
  );
46
46
  ```
47
- ## CSS Classes leveraged
48
-
49
- The structural CSS for the navigation block targets generic classnames across menu items of multiple types including those automatically generated by the Page List block. Here are some of the notable classnames and what they are used for:
50
-
51
- - `.wp-block-navigation__submenu-container` is applied to submenus to main menu items.
52
- - `.wp-block-navigation-item` is applied to every menu item.
53
- - `.wp-block-navigation-item__content` is applied to the link inside a menu item.
54
- - `.wp-block-navigation-item__label` is applied to the innermost container around the menu item text label.
55
- - `.wp-block-navigation__submenu-icon` is applied to the submenu indicator (chevron).
56
47
 
57
48
  ## Navigation Props
58
49
 
@@ -12,7 +12,7 @@ export default {
12
12
  title: 'Components/Notice',
13
13
  component: Notice,
14
14
  parameters: {
15
- knobs: { disabled: false },
15
+ knobs: { disable: false },
16
16
  },
17
17
  };
18
18
 
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/NumberControl',
18
18
  component: NumberControl,
19
19
  parameters: {
20
- knobs: { disabled: false },
20
+ knobs: { disable: false },
21
21
  },
22
22
  };
23
23
 
@@ -19,7 +19,7 @@ export default {
19
19
  title: 'Components/Panel',
20
20
  component: Panel,
21
21
  parameters: {
22
- knobs: { disabled: false },
22
+ knobs: { disable: false },
23
23
  },
24
24
  };
25
25
 
@@ -13,7 +13,7 @@ export default {
13
13
  title: 'Components/Placeholder',
14
14
  component: Placeholder,
15
15
  parameters: {
16
- knobs: { disabled: false },
16
+ knobs: { disable: false },
17
17
  },
18
18
  };
19
19
 
@@ -19,7 +19,7 @@ export default {
19
19
  title: 'Components/Popover',
20
20
  component: Popover,
21
21
  parameters: {
22
- knobs: { disabled: false },
22
+ knobs: { disable: false },
23
23
  },
24
24
  };
25
25
 
@@ -1,14 +1,14 @@
1
1
  # QueryControls
2
2
 
3
- ## Usage
3
+ ## Development Guidelines
4
+
5
+ ### Usage
4
6
 
5
7
  ```jsx
6
8
  import { QueryControls } from '@wordpress/components';
7
9
  import { useState } from '@wordpress/element';
8
10
 
9
11
  const QUERY_DEFAULTS = {
10
- orderBy: 'title',
11
- order: 'asc',
12
12
  category: 1,
13
13
  categories: [
14
14
  {
@@ -27,12 +27,16 @@ const QUERY_DEFAULTS = {
27
27
  parent: 0,
28
28
  },
29
29
  ],
30
+ maxItems: 20,
31
+ minItems: 1,
30
32
  numberOfItems: 10,
33
+ order: 'asc',
34
+ orderBy: 'title',
31
35
  };
32
36
 
33
37
  const MyQueryControls = () => {
34
38
  const [ query, setQuery ] = useState( QUERY_DEFAULTS );
35
- const { orderBy, order, category, categories, numberOfItems } = query;
39
+ const { category, categories, maxItems, minItems, numberOfItems, order, orderBy } = query;
36
40
 
37
41
  const updateQuery = ( newQuery ) => {
38
42
  setQuery( { ...query, ...newQuery } );
@@ -40,7 +44,7 @@ const MyQueryControls = () => {
40
44
 
41
45
  return (
42
46
  <QueryControls
43
- { ...{ orderBy, order, numberOfItems } }
47
+ { ...{ maxItems, minItems, numberOfItems, order, orderBy } }
44
48
  onOrderByChange={ ( newOrderBy ) => updateQuery( { orderBy: newOrderBy } ) }
45
49
  onOrderChange={ ( newOrder ) => updateQuery( { order: newOrder } ) }
46
50
  categoriesList={ categories }
@@ -54,7 +58,7 @@ const MyQueryControls = () => {
54
58
  };
55
59
  ```
56
60
 
57
- ## Multiple category selector
61
+ ### Multiple category selector
58
62
 
59
63
  The `QueryControls` component now supports multiple category selection, to replace the single category selection available so far. To enable it use the component with the new props instead: `categorySuggestions` in place of `categoriesList` and the `selectedCategories` array instead of `selectedCategoryId` like so:
60
64
 
@@ -108,3 +112,131 @@ const MyQueryControls = () => {
108
112
  ```
109
113
 
110
114
  The format of the categories list also needs to be updated to match what `FormTokenField` expects for making suggestions.
115
+
116
+ ### Props
117
+
118
+ #### authorList
119
+
120
+ An array of author IDs that is passed into an `AuthorSelect` sub-component.
121
+
122
+ - Type: `Array`
123
+ - Required: No
124
+ - Platform: Web
125
+
126
+ #### selectedAuthorId
127
+
128
+ The selected author ID.
129
+
130
+ - Type: `Number`
131
+ - Required: No
132
+ - Platform: Web
133
+
134
+ #### categoriesList
135
+
136
+ An array of category IDs; renders a `CategorySelect` sub-component when passed in conjunction with `onCategoryChange`.
137
+
138
+ - Type: `Array`
139
+ - Required: No
140
+ - Platform: Web
141
+
142
+ #### categorySuggestions
143
+
144
+ An array of category names; renders a `FormTokenField` component when passed in conjunction with `onCategoryChange`.
145
+
146
+ - Type: `Array`
147
+ - Required: No
148
+ - Platform: Web
149
+
150
+ #### maxItems
151
+
152
+ - Type: `Number`
153
+ - Required: No
154
+ - Default: 100
155
+ - Platform: Web
156
+
157
+ #### minItems
158
+
159
+ - Type: `Number`
160
+ - Required: No
161
+ - Default: 1
162
+ - Platform: Web
163
+
164
+ #### numberOfItems
165
+
166
+ The selected number of items to retrieve via the query.
167
+
168
+ - Type: `Number`
169
+ - Required: No
170
+ - Platform: Web
171
+
172
+ #### onAuthorChange
173
+
174
+ A function that receives the new author value. If this is not specified, the author controls are not included.
175
+
176
+ - Type: `Function`
177
+ - Required: No
178
+ - Platform: Web
179
+
180
+ #### onCategoryChange
181
+
182
+ A function that receives the new author value. If this is not specified, the category controls are not included.
183
+
184
+ - Type: `Function`
185
+ - Required: No
186
+ - Platform: Web
187
+
188
+ #### onNumberOfItemsChange
189
+
190
+ A function that receives the new number of items value. If this is not specified, then the number of items range control is not included.
191
+
192
+ - Type: `Function`
193
+ - Required: No
194
+ - Platform: Web
195
+
196
+ #### onOrderChange
197
+
198
+ A function that receives the new order value. If this or onOrderByChange are not specified, then the order controls are not included.
199
+
200
+ - Type: `Function`
201
+ - Required: No
202
+ - Platform: Web
203
+
204
+ #### onOrderByChange
205
+
206
+ A function that receives the new orderby value. If this or onOrderChange are not specified, then the order controls are not included.
207
+
208
+ - Type: `Function`
209
+ - Required: No
210
+ - Platform: Web
211
+
212
+ #### order
213
+
214
+ The order in which to retrieve posts. Can be 'asc' or 'desc'.
215
+
216
+ - Type: `String`
217
+ - Required: No
218
+ - Platform: Web
219
+
220
+ #### orderBy
221
+
222
+ The meta key by which to order posts. Can be 'date' or 'title'.
223
+
224
+ - Type: `String`
225
+ - Required: No
226
+ - Platform: Web
227
+
228
+ #### selectedCategories
229
+
230
+ The selected categories for the `categorySuggestions`.
231
+
232
+ - Type: `Array`
233
+ - Required: No
234
+ - Platform: Web
235
+
236
+ #### selectedCategoryId
237
+
238
+ The selected category for the `categoriesList`.
239
+
240
+ - Type: `Number`
241
+ - Required: No
242
+ - Platform: Web
@@ -49,7 +49,10 @@ Radio groups that cannot be selected can either be given a disabled state, or be
49
49
  #### Controlled
50
50
 
51
51
  ```jsx
52
- import { Radio, RadioGroup } from '@wordpress/components';
52
+ import {
53
+ __experimentalRadio as Radio,
54
+ __experimentalRadioGroup as RadioGroup,
55
+ } from '@wordpress/components';
53
56
  import { useState } from '@wordpress/element';
54
57
 
55
58
  const MyControlledRadioRadioGroup = () => {
@@ -20,7 +20,7 @@ export default {
20
20
  title: 'Components/RangeControl',
21
21
  component: RangeControl,
22
22
  parameters: {
23
- knobs: { disabled: false },
23
+ knobs: { disable: false },
24
24
  },
25
25
  };
26
26
 
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/ResizableBox',
18
18
  component: ResizableBox,
19
19
  parameters: {
20
- knobs: { disabled: false },
20
+ knobs: { disable: false },
21
21
  },
22
22
  };
23
23
 
@@ -15,7 +15,7 @@ export default {
15
15
  component: Scrollable,
16
16
  title: 'Components (Experimental)/Scrollable',
17
17
  parameters: {
18
- knobs: { disabled: false },
18
+ knobs: { disable: false },
19
19
  },
20
20
  };
21
21
 
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/SearchControl',
18
18
  component: SearchControl,
19
19
  parameters: {
20
- knobs: { disabled: false },
20
+ knobs: { disable: false },
21
21
  },
22
22
  };
23
23
 
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/SelectControl',
18
18
  component: SelectControl,
19
19
  parameters: {
20
- knobs: { disabled: false },
20
+ knobs: { disable: false },
21
21
  },
22
22
  };
23
23
 
@@ -60,6 +60,7 @@ export const _default = () => {
60
60
  {
61
61
  default: 'default',
62
62
  small: 'small',
63
+ '__unstable-large': '__unstable-large',
63
64
  },
64
65
  'default'
65
66
  ),
@@ -27,6 +27,7 @@ const fontSizeStyles = ( { selectSize }: SelectProps ) => {
27
27
  const sizes = {
28
28
  default: '13px',
29
29
  small: '11px',
30
+ '__unstable-large': '13px',
30
31
  };
31
32
 
32
33
  const fontSize = sizes[ selectSize as Size ];
@@ -55,6 +56,11 @@ const sizeStyles = ( { selectSize }: SelectProps ) => {
55
56
  lineHeight: 1,
56
57
  minHeight: 24,
57
58
  },
59
+ '__unstable-large': {
60
+ height: 40,
61
+ lineHeight: 1,
62
+ minHeight: 40,
63
+ },
58
64
  };
59
65
 
60
66
  const style = sizes[ selectSize as Size ] || sizes.default;
@@ -62,6 +68,24 @@ const sizeStyles = ( { selectSize }: SelectProps ) => {
62
68
  return css( style );
63
69
  };
64
70
 
71
+ const sizePaddings = ( { selectSize = 'default' }: SelectProps ) => {
72
+ const sizes = {
73
+ default: {
74
+ paddingLeft: 8,
75
+ paddingRight: 24,
76
+ },
77
+ small: {
78
+ paddingLeft: 8,
79
+ paddingRight: 24,
80
+ },
81
+ '__unstable-large': {
82
+ paddingLeft: 16,
83
+ paddingRight: 32,
84
+ },
85
+ };
86
+ return rtl( sizes[ selectSize ] );
87
+ };
88
+
65
89
  // TODO: Resolve need to use &&& to increase specificity
66
90
  // https://github.com/WordPress/gutenberg/issues/18483
67
91
 
@@ -80,8 +104,7 @@ export const Select = styled.select< SelectProps >`
80
104
  ${ disabledStyles };
81
105
  ${ fontSizeStyles };
82
106
  ${ sizeStyles };
83
-
84
- ${ rtl( { paddingLeft: 8, paddingRight: 24 } ) }
107
+ ${ sizePaddings };
85
108
  }
86
109
  `;
87
110
 
@@ -1 +1 @@
1
- export type Size = 'default' | 'small';
1
+ export type Size = 'default' | 'small' | '__unstable-large';
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/SlotFill',
18
18
  component: Slot,
19
19
  parameters: {
20
- knobs: { disabled: false },
20
+ knobs: { disable: false },
21
21
  },
22
22
  };
23
23
 
@@ -12,7 +12,7 @@ export default {
12
12
  title: 'Components/Snackbar',
13
13
  component: Snackbar,
14
14
  parameters: {
15
- knobs: { disabled: false },
15
+ knobs: { disable: false },
16
16
  },
17
17
  };
18
18
 
@@ -15,7 +15,7 @@ export default {
15
15
  component: Spacer,
16
16
  title: 'Components (Experimental)/Spacer',
17
17
  parameters: {
18
- knobs: { disabled: false },
18
+ knobs: { disable: false },
19
19
  },
20
20
  };
21
21
 
@@ -1,3 +1,5 @@
1
+ //@ts-nocheck
2
+
1
3
  /**
2
4
  * External dependencies
3
5
  */
@@ -13,7 +13,7 @@ export default {
13
13
  component: Surface,
14
14
  title: 'Components (Experimental)/Surface',
15
15
  parameters: {
16
- knobs: { disabled: false },
16
+ knobs: { disable: false },
17
17
  },
18
18
  };
19
19
 
@@ -12,7 +12,7 @@ export default {
12
12
  title: 'Components/TabPanel',
13
13
  component: TabPanel,
14
14
  parameters: {
15
- knobs: { disabled: false },
15
+ knobs: { disable: false },
16
16
  },
17
17
  };
18
18
 
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/TextControl',
18
18
  component: TextControl,
19
19
  parameters: {
20
- knobs: { disabled: false },
20
+ knobs: { disable: false },
21
21
  },
22
22
  };
23
23
 
@@ -12,7 +12,7 @@ export default {
12
12
  title: 'Components/TextHighlight',
13
13
  component: TextHighlight,
14
14
  parameters: {
15
- knobs: { disabled: false },
15
+ knobs: { disable: false },
16
16
  },
17
17
  };
18
18