@wordpress/components 19.2.1-next.33ec3857e2.0 → 19.2.1

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 (368) hide show
  1. package/CHANGELOG.md +6 -29
  2. package/build/angle-picker-control/index.js +0 -2
  3. package/build/angle-picker-control/index.js.map +1 -1
  4. package/build/button/index.native.js +3 -13
  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 +2 -1
  9. package/build/clipboard-button/index.js.map +1 -1
  10. package/build/color-palette/index.js +1 -13
  11. package/build/color-palette/index.js.map +1 -1
  12. package/build/color-picker/color-display.js +2 -4
  13. package/build/color-picker/color-display.js.map +1 -1
  14. package/build/color-picker/hex-input.js +1 -3
  15. package/build/color-picker/hex-input.js.map +1 -1
  16. package/build/color-picker/input-with-slider.js +1 -3
  17. package/build/color-picker/input-with-slider.js.map +1 -1
  18. package/build/custom-gradient-picker/index.js +0 -1
  19. package/build/custom-gradient-picker/index.js.map +1 -1
  20. package/build/date-time/date.js +86 -63
  21. package/build/date-time/date.js.map +1 -1
  22. package/build/divider/component.js +7 -8
  23. package/build/divider/component.js.map +1 -1
  24. package/build/divider/styles.js +13 -38
  25. package/build/divider/styles.js.map +1 -1
  26. package/build/drop-zone/index.js +6 -14
  27. package/build/drop-zone/index.js.map +1 -1
  28. package/build/drop-zone/provider.js +0 -1
  29. package/build/drop-zone/provider.js.map +1 -1
  30. package/build/flyout/styles.js +2 -2
  31. package/build/flyout/styles.js.map +1 -1
  32. package/build/focusable-iframe/index.js +0 -1
  33. package/build/focusable-iframe/index.js.map +1 -1
  34. package/build/higher-order/with-focus-outside/index.js +0 -2
  35. package/build/higher-order/with-focus-outside/index.js.map +1 -1
  36. package/build/index.js +0 -8
  37. package/build/index.js.map +1 -1
  38. package/build/input-control/styles/input-control-styles.js +32 -44
  39. package/build/input-control/styles/input-control-styles.js.map +1 -1
  40. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +3 -10
  41. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  42. package/build/mobile/color-settings/index.native.js +2 -4
  43. package/build/mobile/color-settings/index.native.js.map +1 -1
  44. package/build/mobile/color-settings/palette.screen.native.js +6 -7
  45. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  46. package/build/mobile/global-styles-context/utils.native.js +1 -1
  47. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  48. package/build/mobile/gridicons/index.native.js +1 -3
  49. package/build/mobile/gridicons/index.native.js.map +1 -1
  50. package/build/mobile/link-picker/index.native.js +4 -45
  51. package/build/mobile/link-picker/index.native.js.map +1 -1
  52. package/build/mobile/link-settings/index.native.js +0 -10
  53. package/build/mobile/link-settings/index.native.js.map +1 -1
  54. package/build/modal/aria-helper.js +0 -2
  55. package/build/modal/aria-helper.js.map +1 -1
  56. package/build/modal/index.js +8 -17
  57. package/build/modal/index.js.map +1 -1
  58. package/build/palette-edit/index.js +31 -27
  59. package/build/palette-edit/index.js.map +1 -1
  60. package/build/select-control/styles/select-control-styles.js +9 -33
  61. package/build/select-control/styles/select-control-styles.js.map +1 -1
  62. package/build/style-provider/index.js +0 -2
  63. package/build/style-provider/index.js.map +1 -1
  64. package/build/toggle-group-control/toggle-group-control/component.js +2 -7
  65. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  66. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +14 -25
  67. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  68. package/build/tools-panel/styles.js +10 -12
  69. package/build/tools-panel/styles.js.map +1 -1
  70. package/build/tools-panel/tools-panel/component.js +8 -6
  71. package/build/tools-panel/tools-panel/component.js.map +1 -1
  72. package/build/tools-panel/tools-panel-item/hook.js +8 -6
  73. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  74. package/build/unit-control/styles/unit-control-styles.js +41 -23
  75. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  76. package/build/z-stack/component.js.map +1 -1
  77. package/build/z-stack/styles.js +8 -10
  78. package/build/z-stack/styles.js.map +1 -1
  79. package/build-module/angle-picker-control/index.js +0 -2
  80. package/build-module/angle-picker-control/index.js.map +1 -1
  81. package/build-module/button/index.native.js +3 -13
  82. package/build-module/button/index.native.js.map +1 -1
  83. package/build-module/checkbox-control/index.js +1 -1
  84. package/build-module/checkbox-control/index.js.map +1 -1
  85. package/build-module/clipboard-button/index.js +2 -1
  86. package/build-module/clipboard-button/index.js.map +1 -1
  87. package/build-module/color-palette/index.js +2 -14
  88. package/build-module/color-palette/index.js.map +1 -1
  89. package/build-module/color-picker/color-display.js +2 -3
  90. package/build-module/color-picker/color-display.js.map +1 -1
  91. package/build-module/color-picker/hex-input.js +1 -2
  92. package/build-module/color-picker/hex-input.js.map +1 -1
  93. package/build-module/color-picker/input-with-slider.js +1 -2
  94. package/build-module/color-picker/input-with-slider.js.map +1 -1
  95. package/build-module/custom-gradient-picker/index.js +0 -1
  96. package/build-module/custom-gradient-picker/index.js.map +1 -1
  97. package/build-module/date-time/date.js +87 -63
  98. package/build-module/date-time/date.js.map +1 -1
  99. package/build-module/divider/component.js +7 -8
  100. package/build-module/divider/component.js.map +1 -1
  101. package/build-module/divider/styles.js +13 -37
  102. package/build-module/divider/styles.js.map +1 -1
  103. package/build-module/drop-zone/index.js +6 -14
  104. package/build-module/drop-zone/index.js.map +1 -1
  105. package/build-module/drop-zone/provider.js +0 -1
  106. package/build-module/drop-zone/provider.js.map +1 -1
  107. package/build-module/flyout/styles.js +2 -2
  108. package/build-module/flyout/styles.js.map +1 -1
  109. package/build-module/focusable-iframe/index.js +0 -1
  110. package/build-module/focusable-iframe/index.js.map +1 -1
  111. package/build-module/higher-order/with-focus-outside/index.js +0 -1
  112. package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
  113. package/build-module/index.js +0 -1
  114. package/build-module/index.js.map +1 -1
  115. package/build-module/input-control/styles/input-control-styles.js +32 -44
  116. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  117. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +4 -10
  118. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  119. package/build-module/mobile/color-settings/index.native.js +2 -4
  120. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  121. package/build-module/mobile/color-settings/palette.screen.native.js +6 -7
  122. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  123. package/build-module/mobile/global-styles-context/utils.native.js +1 -1
  124. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  125. package/build-module/mobile/gridicons/index.native.js +0 -1
  126. package/build-module/mobile/gridicons/index.native.js.map +1 -1
  127. package/build-module/mobile/link-picker/index.native.js +8 -50
  128. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  129. package/build-module/mobile/link-settings/index.native.js +0 -10
  130. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  131. package/build-module/modal/aria-helper.js +0 -2
  132. package/build-module/modal/aria-helper.js.map +1 -1
  133. package/build-module/modal/index.js +8 -15
  134. package/build-module/modal/index.js.map +1 -1
  135. package/build-module/palette-edit/index.js +30 -27
  136. package/build-module/palette-edit/index.js.map +1 -1
  137. package/build-module/select-control/styles/select-control-styles.js +9 -33
  138. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  139. package/build-module/style-provider/index.js +0 -1
  140. package/build-module/style-provider/index.js.map +1 -1
  141. package/build-module/toggle-group-control/toggle-group-control/component.js +3 -8
  142. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  143. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +14 -25
  144. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  145. package/build-module/tools-panel/styles.js +11 -12
  146. package/build-module/tools-panel/styles.js.map +1 -1
  147. package/build-module/tools-panel/tools-panel/component.js +8 -5
  148. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  149. package/build-module/tools-panel/tools-panel-item/hook.js +8 -6
  150. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  151. package/build-module/unit-control/styles/unit-control-styles.js +41 -23
  152. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  153. package/build-module/z-stack/component.js.map +1 -1
  154. package/build-module/z-stack/styles.js +8 -13
  155. package/build-module/z-stack/styles.js.map +1 -1
  156. package/build-style/style-rtl.css +11 -23
  157. package/build-style/style.css +11 -23
  158. package/build-types/base-field/hook.d.ts +16 -16
  159. package/build-types/card/card/hook.d.ts +16 -16
  160. package/build-types/card/card-body/hook.d.ts +16 -16
  161. package/build-types/card/card-divider/hook.d.ts +18 -18
  162. package/build-types/card/card-footer/hook.d.ts +17 -17
  163. package/build-types/card/card-header/hook.d.ts +16 -16
  164. package/build-types/card/card-media/hook.d.ts +16 -16
  165. package/build-types/divider/component.d.ts +7 -8
  166. package/build-types/divider/component.d.ts.map +1 -1
  167. package/build-types/divider/styles.d.ts +2 -2
  168. package/build-types/divider/styles.d.ts.map +1 -1
  169. package/build-types/divider/types.d.ts +5 -5
  170. package/build-types/divider/types.d.ts.map +1 -1
  171. package/build-types/elevation/hook.d.ts +15 -15
  172. package/build-types/flex/flex/hook.d.ts +16 -16
  173. package/build-types/flex/flex-block/hook.d.ts +16 -16
  174. package/build-types/flex/flex-item/hook.d.ts +16 -16
  175. package/build-types/flyout/flyout/hook.d.ts +17 -17
  176. package/build-types/flyout/styles.d.ts +9 -7
  177. package/build-types/flyout/styles.d.ts.map +1 -1
  178. package/build-types/grid/hook.d.ts +16 -16
  179. package/build-types/h-stack/hook.d.ts +16 -16
  180. package/build-types/heading/hook.d.ts +16 -16
  181. package/build-types/input-control/index.d.ts +1 -1
  182. package/build-types/input-control/index.d.ts.map +1 -1
  183. package/build-types/input-control/input-field.d.ts +1 -1
  184. package/build-types/input-control/input-field.d.ts.map +1 -1
  185. package/build-types/input-control/styles/input-control-styles.d.ts +2 -1
  186. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  187. package/build-types/input-control/types.d.ts +1 -2
  188. package/build-types/input-control/types.d.ts.map +1 -1
  189. package/build-types/item-group/item/hook.d.ts +16 -16
  190. package/build-types/item-group/item-group/hook.d.ts +16 -16
  191. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  192. package/build-types/scrollable/hook.d.ts +16 -16
  193. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  194. package/build-types/select-control/types.d.ts +1 -1
  195. package/build-types/select-control/types.d.ts.map +1 -1
  196. package/build-types/spacer/hook.d.ts +16 -16
  197. package/build-types/surface/hook.d.ts +16 -16
  198. package/build-types/text/hook.d.ts +16 -16
  199. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  200. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
  201. package/build-types/tools-panel/styles.d.ts.map +1 -1
  202. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  203. package/build-types/tools-panel/tools-panel/hook.d.ts +16 -16
  204. package/build-types/tools-panel/tools-panel-header/hook.d.ts +16 -16
  205. package/build-types/tools-panel/tools-panel-item/hook.d.ts +16 -16
  206. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  207. package/build-types/truncate/hook.d.ts +16 -16
  208. package/build-types/ui/control-group/hook.d.ts +18 -18
  209. package/build-types/ui/control-label/hook.d.ts +16 -16
  210. package/build-types/ui/form-group/form-group.d.ts +4 -4
  211. package/build-types/ui/form-group/use-form-group.d.ts +55 -55
  212. package/build-types/unit-control/index.d.ts +1 -1
  213. package/build-types/unit-control/index.d.ts.map +1 -1
  214. package/build-types/unit-control/styles/unit-control-styles.d.ts +0 -1
  215. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  216. package/build-types/unit-control/types.d.ts +2 -2
  217. package/build-types/unit-control/types.d.ts.map +1 -1
  218. package/build-types/v-stack/hook.d.ts +16 -16
  219. package/build-types/z-stack/component.d.ts +1 -1
  220. package/build-types/z-stack/styles.d.ts.map +1 -1
  221. package/package.json +23 -21
  222. package/src/alignment-matrix-control/stories/index.js +1 -1
  223. package/src/angle-picker-control/index.js +0 -2
  224. package/src/base-control/stories/index.js +1 -1
  225. package/src/button/index.native.js +1 -15
  226. package/src/button/stories/index.js +1 -1
  227. package/src/button/style.scss +0 -14
  228. package/src/card/card/README.md +3 -3
  229. package/src/card/stories/index.js +1 -1
  230. package/src/card/test/__snapshots__/index.js.snap +6 -6
  231. package/src/checkbox-control/index.js +1 -1
  232. package/src/checkbox-control/stories/index.js +1 -1
  233. package/src/clipboard-button/index.js +2 -1
  234. package/src/color-indicator/stories/index.js +1 -1
  235. package/src/color-indicator/style.scss +8 -5
  236. package/src/color-palette/index.js +5 -13
  237. package/src/color-palette/stories/index.js +1 -1
  238. package/src/color-palette/test/__snapshots__/index.js.snap +0 -1
  239. package/src/color-picker/color-display.tsx +2 -3
  240. package/src/color-picker/hex-input.tsx +1 -2
  241. package/src/color-picker/input-with-slider.tsx +1 -2
  242. package/src/color-picker/stories/index.js +1 -1
  243. package/src/combobox-control/README.md +2 -2
  244. package/src/custom-gradient-picker/index.js +0 -1
  245. package/src/custom-gradient-picker/style.scss +4 -0
  246. package/src/date-time/README.md +0 -7
  247. package/src/date-time/date.js +84 -67
  248. package/src/date-time/stories/index.js +1 -1
  249. package/src/date-time/stories/time.js +1 -1
  250. package/src/date-time/test/date.js +29 -3
  251. package/src/dimension-control/README.md +1 -1
  252. package/src/divider/README.md +5 -33
  253. package/src/divider/component.tsx +7 -8
  254. package/src/divider/stories/index.js +17 -43
  255. package/src/divider/styles.ts +16 -53
  256. package/src/divider/test/__snapshots__/index.js.snap +11 -11
  257. package/src/divider/test/index.js +4 -4
  258. package/src/divider/types.ts +5 -5
  259. package/src/drop-zone/index.js +6 -14
  260. package/src/drop-zone/provider.js +0 -1
  261. package/src/dropdown-menu/stories/index.js +1 -1
  262. package/src/duotone-picker/README.md +1 -1
  263. package/src/elevation/stories/index.js +1 -1
  264. package/src/external-link/stories/index.js +1 -1
  265. package/src/flyout/styles.ts +2 -4
  266. package/src/focusable-iframe/index.js +0 -1
  267. package/src/font-size-picker/stories/index.js +1 -1
  268. package/src/form-token-field/stories/index.js +1 -1
  269. package/src/gradient-picker/stories/index.js +1 -1
  270. package/src/grid/stories/index.js +1 -1
  271. package/src/guide/stories/index.js +1 -1
  272. package/src/higher-order/with-focus-outside/index.js +0 -2
  273. package/src/icon/stories/index.js +1 -1
  274. package/src/index.js +0 -1
  275. package/src/input-control/stories/index.js +1 -2
  276. package/src/input-control/styles/input-control-styles.tsx +6 -16
  277. package/src/input-control/types.ts +1 -3
  278. package/src/item-group/stories/index.js +2 -84
  279. package/src/menu-item/README.md +2 -2
  280. package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +2 -6
  281. package/src/mobile/color-settings/index.native.js +0 -2
  282. package/src/mobile/color-settings/palette.screen.native.js +5 -8
  283. package/src/mobile/color-settings/style.native.scss +1 -1
  284. package/src/mobile/global-styles-context/utils.native.js +1 -1
  285. package/src/mobile/gridicons/index.native.js +3 -3
  286. package/src/mobile/inserter-button/style.native.scss +0 -1
  287. package/src/mobile/link-picker/index.native.js +7 -41
  288. package/src/mobile/link-settings/index.native.js +0 -11
  289. package/src/modal/README.md +0 -10
  290. package/src/modal/aria-helper.js +0 -2
  291. package/src/modal/index.js +55 -72
  292. package/src/modal/stories/index.js +1 -6
  293. package/src/modal/style.scss +0 -9
  294. package/src/modal/test/index.js +0 -11
  295. package/src/navigation/README.md +9 -0
  296. package/src/notice/stories/index.js +1 -1
  297. package/src/number-control/stories/index.js +1 -1
  298. package/src/palette-edit/index.js +106 -73
  299. package/src/panel/stories/index.js +1 -1
  300. package/src/placeholder/stories/index.js +1 -1
  301. package/src/popover/stories/index.js +1 -1
  302. package/src/query-controls/README.md +6 -138
  303. package/src/radio-group/README.md +1 -4
  304. package/src/range-control/stories/index.js +1 -1
  305. package/src/resizable-box/stories/index.js +1 -1
  306. package/src/scrollable/stories/index.js +1 -1
  307. package/src/search-control/stories/index.js +1 -1
  308. package/src/select-control/stories/index.js +1 -2
  309. package/src/select-control/styles/select-control-styles.ts +2 -25
  310. package/src/select-control/types.ts +1 -1
  311. package/src/slot-fill/stories/index.js +1 -1
  312. package/src/snackbar/stories/index.js +1 -1
  313. package/src/spacer/stories/index.js +1 -1
  314. package/src/style-provider/index.js +0 -2
  315. package/src/surface/stories/index.js +1 -1
  316. package/src/tab-panel/stories/index.js +1 -1
  317. package/src/text-control/stories/index.js +1 -1
  318. package/src/text-highlight/stories/index.js +1 -1
  319. package/src/textarea-control/stories/index.js +1 -1
  320. package/src/tip/stories/index.js +1 -1
  321. package/src/toggle-control/stories/index.js +1 -1
  322. package/src/toggle-group-control/stories/index.js +1 -1
  323. package/src/toggle-group-control/toggle-group-control/component.tsx +2 -7
  324. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +9 -24
  325. package/src/toolbar-button/stories/index.js +1 -1
  326. package/src/tools-panel/stories/index.js +0 -54
  327. package/src/tools-panel/styles.ts +1 -41
  328. package/src/tools-panel/test/index.js +137 -19
  329. package/src/tools-panel/tools-panel/README.md +3 -11
  330. package/src/tools-panel/tools-panel/component.tsx +5 -2
  331. package/src/tools-panel/tools-panel-item/hook.ts +14 -6
  332. package/src/tooltip/stories/index.js +1 -1
  333. package/src/tree-select/stories/index.js +1 -1
  334. package/src/truncate/stories/index.js +1 -1
  335. package/src/unit-control/stories/index.js +1 -19
  336. package/src/unit-control/styles/unit-control-styles.ts +46 -33
  337. package/src/unit-control/types.ts +2 -5
  338. package/src/z-stack/README.md +1 -1
  339. package/src/z-stack/component.tsx +1 -1
  340. package/src/z-stack/stories/index.js +1 -1
  341. package/src/z-stack/styles.ts +2 -7
  342. package/tsconfig.json +2 -6
  343. package/tsconfig.tsbuildinfo +1 -1
  344. package/build/confirm-dialog/component.js +0 -103
  345. package/build/confirm-dialog/component.js.map +0 -1
  346. package/build/confirm-dialog/index.js +0 -16
  347. package/build/confirm-dialog/index.js.map +0 -1
  348. package/build/confirm-dialog/types.js +0 -6
  349. package/build/confirm-dialog/types.js.map +0 -1
  350. package/build/date-time/utils.js +0 -32
  351. package/build/date-time/utils.js.map +0 -1
  352. package/build-module/confirm-dialog/component.js +0 -84
  353. package/build-module/confirm-dialog/component.js.map +0 -1
  354. package/build-module/confirm-dialog/index.js +0 -6
  355. package/build-module/confirm-dialog/index.js.map +0 -1
  356. package/build-module/confirm-dialog/types.js +0 -2
  357. package/build-module/confirm-dialog/types.js.map +0 -1
  358. package/build-module/date-time/utils.js +0 -20
  359. package/build-module/date-time/utils.js.map +0 -1
  360. package/src/confirm-dialog/README.md +0 -128
  361. package/src/confirm-dialog/component.tsx +0 -114
  362. package/src/confirm-dialog/index.tsx +0 -6
  363. package/src/confirm-dialog/stories/index.js +0 -120
  364. package/src/confirm-dialog/test/index.js +0 -302
  365. package/src/confirm-dialog/types.ts +0 -26
  366. package/src/date-time/test/utils.js +0 -32
  367. package/src/date-time/utils.js +0 -18
  368. package/src/mobile/link-settings/test/edit.native.js +0 -432
@@ -12,7 +12,7 @@ export default {
12
12
  title: 'Components/Notice',
13
13
  component: Notice,
14
14
  parameters: {
15
- knobs: { disable: false },
15
+ knobs: { disabled: 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: { disable: false },
20
+ knobs: { disabled: false },
21
21
  },
22
22
  };
23
23
 
@@ -40,6 +40,8 @@ import { NavigableMenu } from '../navigable-container';
40
40
  import { DEFAULT_GRADIENT } from '../custom-gradient-picker/constants';
41
41
  import CustomGradientPicker from '../custom-gradient-picker';
42
42
 
43
+ const DEFAULT_COLOR = '#000';
44
+
43
45
  function NameInput( { value, onChange, label } ) {
44
46
  return (
45
47
  <NameInputControl
@@ -51,6 +53,14 @@ function NameInput( { value, onChange, label } ) {
51
53
  );
52
54
  }
53
55
 
56
+ function getNameForPosition( position ) {
57
+ return sprintf(
58
+ /* translators: %s: is a temporary id for a custom color */
59
+ __( 'Color %s ' ),
60
+ position + 1
61
+ );
62
+ }
63
+
54
64
  function Option( {
55
65
  canOnlyChangeValues,
56
66
  element,
@@ -143,6 +153,14 @@ function Option( {
143
153
  );
144
154
  }
145
155
 
156
+ function isTemporaryElement( slugPrefix, { slug, color, gradient }, index ) {
157
+ return (
158
+ slug === slugPrefix + kebabCase( getNameForPosition( index ) ) &&
159
+ ( ( !! color && color === DEFAULT_COLOR ) ||
160
+ ( !! gradient && gradient === DEFAULT_GRADIENT ) )
161
+ );
162
+ }
163
+
146
164
  function PaletteEditListView( {
147
165
  elements,
148
166
  onChange,
@@ -159,9 +177,14 @@ function PaletteEditListView( {
159
177
  }, [ elements ] );
160
178
  useEffect( () => {
161
179
  return () => {
162
- if ( elementsReference.current.some( ( { slug } ) => ! slug ) ) {
180
+ if (
181
+ elementsReference.current.some( ( element, index ) =>
182
+ isTemporaryElement( slugPrefix, element, index )
183
+ )
184
+ ) {
163
185
  const newElements = elementsReference.current.filter(
164
- ( { slug } ) => slug
186
+ ( element, index ) =>
187
+ ! isTemporaryElement( slugPrefix, element, index )
165
188
  );
166
189
  onChange( newElements.length ? newElements : undefined );
167
190
  }
@@ -272,19 +295,19 @@ export default function PaletteEdit( {
272
295
  : __( 'Add color' )
273
296
  }
274
297
  onClick={ () => {
275
- const tempOptionName = sprintf(
276
- /* translators: %s: is a temporary id for a custom color */
277
- __( 'Color %s ' ),
278
- elementsLength + 1
298
+ const tempOptionName = getNameForPosition(
299
+ elementsLength
279
300
  );
280
301
  onChange( [
281
302
  ...elements,
282
303
  {
283
304
  ...( isGradient
284
305
  ? { gradient: DEFAULT_GRADIENT }
285
- : { color: '#000' } ),
306
+ : { color: DEFAULT_COLOR } ),
286
307
  name: tempOptionName,
287
- slug: '',
308
+ slug:
309
+ slugPrefix +
310
+ kebabCase( tempOptionName ),
288
311
  },
289
312
  ] );
290
313
  setIsEditing( true );
@@ -293,71 +316,81 @@ export default function PaletteEdit( {
293
316
  />
294
317
  ) }
295
318
 
296
- { hasElements && ( canReset || ! canOnlyChangeValues ) && (
297
- <DropdownMenu
298
- icon={ moreVertical }
299
- label={
300
- isGradient
301
- ? __( 'Gradient options' )
302
- : __( 'Color options' )
303
- }
304
- toggleProps={ {
305
- isSmall: true,
306
- } }
307
- >
308
- { ( { onClose } ) => (
309
- <>
310
- <NavigableMenu role="menu">
311
- <Button
312
- variant="tertiary"
313
- disabled={ isEditing }
314
- onClick={ () => {
315
- setIsEditing( true );
316
- onClose();
317
- } }
318
- className="components-palette-edit__menu-button"
319
- >
320
- { __( 'Edit custom colors' ) }
321
- </Button>
322
- { ! canOnlyChangeValues && (
323
- <Button
324
- variant="tertiary"
325
- onClick={ () => {
326
- setEditingElement( null );
327
- setIsEditing( false );
328
- onChange();
329
- onClose();
330
- } }
331
- className="components-palette-edit__menu-button"
332
- >
333
- { isGradient
334
- ? __(
335
- 'Remove all gradients'
336
- )
337
- : __(
338
- 'Remove all colors'
339
- ) }
340
- </Button>
341
- ) }
342
- { canReset && (
343
- <Button
344
- variant="tertiary"
345
- onClick={ () => {
346
- setEditingElement( null );
347
- onChange();
348
- onClose();
349
- } }
350
- >
351
- { isGradient
352
- ? __( 'Reset gradient' )
353
- : __( 'Reset colors' ) }
354
- </Button>
355
- ) }
356
- </NavigableMenu>
357
- </>
358
- ) }
359
- </DropdownMenu>
360
- ) }
319
+ { hasElements &&
320
+ ( ! isEditing ||
321
+ ! canOnlyChangeValues ||
322
+ canReset ) && (
323
+ <DropdownMenu
324
+ icon={ moreVertical }
325
+ label={
326
+ isGradient
327
+ ? __( 'Gradient options' )
328
+ : __( 'Color options' )
329
+ }
330
+ toggleProps={ {
331
+ isSmall: true,
332
+ } }
333
+ >
334
+ { ( { onClose } ) => (
335
+ <>
336
+ <NavigableMenu role="menu">
337
+ { ! isEditing && (
338
+ <Button
339
+ variant="tertiary"
340
+ onClick={ () => {
341
+ setIsEditing( true );
342
+ onClose();
343
+ } }
344
+ className="components-palette-edit__menu-button"
345
+ >
346
+ { isGradient
347
+ ? __( 'Edit gradients' )
348
+ : __( 'Edit colors' ) }
349
+ </Button>
350
+ ) }
351
+ { ! canOnlyChangeValues && (
352
+ <Button
353
+ variant="tertiary"
354
+ onClick={ () => {
355
+ setEditingElement(
356
+ null
357
+ );
358
+ setIsEditing( false );
359
+ onChange();
360
+ onClose();
361
+ } }
362
+ className="components-palette-edit__menu-button"
363
+ >
364
+ { isGradient
365
+ ? __(
366
+ 'Remove all gradients'
367
+ )
368
+ : __(
369
+ 'Remove all colors'
370
+ ) }
371
+ </Button>
372
+ ) }
373
+ { canReset && (
374
+ <Button
375
+ variant="tertiary"
376
+ onClick={ () => {
377
+ setEditingElement(
378
+ null
379
+ );
380
+ onChange();
381
+ onClose();
382
+ } }
383
+ >
384
+ { isGradient
385
+ ? __( 'Reset gradient' )
386
+ : __( 'Reset colors' ) }
387
+ </Button>
388
+ ) }
389
+ </NavigableMenu>
390
+ </>
391
+ ) }
392
+ </DropdownMenu>
393
+ ) }
361
394
  </PaletteActionsContainer>
362
395
  </PaletteHStackHeader>
363
396
  { hasElements && (
@@ -19,7 +19,7 @@ export default {
19
19
  title: 'Components/Panel',
20
20
  component: Panel,
21
21
  parameters: {
22
- knobs: { disable: false },
22
+ knobs: { disabled: 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: { disable: false },
16
+ knobs: { disabled: 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: { disable: false },
22
+ knobs: { disabled: false },
23
23
  },
24
24
  };
25
25
 
@@ -1,14 +1,14 @@
1
1
  # QueryControls
2
2
 
3
- ## Development Guidelines
4
-
5
- ### Usage
3
+ ## Usage
6
4
 
7
5
  ```jsx
8
6
  import { QueryControls } from '@wordpress/components';
9
7
  import { useState } from '@wordpress/element';
10
8
 
11
9
  const QUERY_DEFAULTS = {
10
+ orderBy: 'title',
11
+ order: 'asc',
12
12
  category: 1,
13
13
  categories: [
14
14
  {
@@ -27,16 +27,12 @@ const QUERY_DEFAULTS = {
27
27
  parent: 0,
28
28
  },
29
29
  ],
30
- maxItems: 20,
31
- minItems: 1,
32
30
  numberOfItems: 10,
33
- order: 'asc',
34
- orderBy: 'title',
35
31
  };
36
32
 
37
33
  const MyQueryControls = () => {
38
34
  const [ query, setQuery ] = useState( QUERY_DEFAULTS );
39
- const { category, categories, maxItems, minItems, numberOfItems, order, orderBy } = query;
35
+ const { orderBy, order, category, categories, numberOfItems } = query;
40
36
 
41
37
  const updateQuery = ( newQuery ) => {
42
38
  setQuery( { ...query, ...newQuery } );
@@ -44,7 +40,7 @@ const MyQueryControls = () => {
44
40
 
45
41
  return (
46
42
  <QueryControls
47
- { ...{ maxItems, minItems, numberOfItems, order, orderBy } }
43
+ { ...{ orderBy, order, numberOfItems } }
48
44
  onOrderByChange={ ( newOrderBy ) => updateQuery( { orderBy: newOrderBy } ) }
49
45
  onOrderChange={ ( newOrder ) => updateQuery( { order: newOrder } ) }
50
46
  categoriesList={ categories }
@@ -58,7 +54,7 @@ const MyQueryControls = () => {
58
54
  };
59
55
  ```
60
56
 
61
- ### Multiple category selector
57
+ ## Multiple category selector
62
58
 
63
59
  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:
64
60
 
@@ -112,131 +108,3 @@ const MyQueryControls = () => {
112
108
  ```
113
109
 
114
110
  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,10 +49,7 @@ 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 {
53
- __experimentalRadio as Radio,
54
- __experimentalRadioGroup as RadioGroup,
55
- } from '@wordpress/components';
52
+ import { Radio, RadioGroup } from '@wordpress/components';
56
53
  import { useState } from '@wordpress/element';
57
54
 
58
55
  const MyControlledRadioRadioGroup = () => {
@@ -20,7 +20,7 @@ export default {
20
20
  title: 'Components/RangeControl',
21
21
  component: RangeControl,
22
22
  parameters: {
23
- knobs: { disable: false },
23
+ knobs: { disabled: 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: { disable: false },
20
+ knobs: { disabled: 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: { disable: false },
18
+ knobs: { disabled: 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: { disable: false },
20
+ knobs: { disabled: 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: { disable: false },
20
+ knobs: { disabled: false },
21
21
  },
22
22
  };
23
23
 
@@ -60,7 +60,6 @@ export const _default = () => {
60
60
  {
61
61
  default: 'default',
62
62
  small: 'small',
63
- '__unstable-large': '__unstable-large',
64
63
  },
65
64
  'default'
66
65
  ),
@@ -27,7 +27,6 @@ const fontSizeStyles = ( { selectSize }: SelectProps ) => {
27
27
  const sizes = {
28
28
  default: '13px',
29
29
  small: '11px',
30
- '__unstable-large': '13px',
31
30
  };
32
31
 
33
32
  const fontSize = sizes[ selectSize as Size ];
@@ -56,11 +55,6 @@ const sizeStyles = ( { selectSize }: SelectProps ) => {
56
55
  lineHeight: 1,
57
56
  minHeight: 24,
58
57
  },
59
- '__unstable-large': {
60
- height: 40,
61
- lineHeight: 1,
62
- minHeight: 40,
63
- },
64
58
  };
65
59
 
66
60
  const style = sizes[ selectSize as Size ] || sizes.default;
@@ -68,24 +62,6 @@ const sizeStyles = ( { selectSize }: SelectProps ) => {
68
62
  return css( style );
69
63
  };
70
64
 
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
-
89
65
  // TODO: Resolve need to use &&& to increase specificity
90
66
  // https://github.com/WordPress/gutenberg/issues/18483
91
67
 
@@ -104,7 +80,8 @@ export const Select = styled.select< SelectProps >`
104
80
  ${ disabledStyles };
105
81
  ${ fontSizeStyles };
106
82
  ${ sizeStyles };
107
- ${ sizePaddings };
83
+
84
+ ${ rtl( { paddingLeft: 8, paddingRight: 24 } ) }
108
85
  }
109
86
  `;
110
87
 
@@ -1 +1 @@
1
- export type Size = 'default' | 'small' | '__unstable-large';
1
+ export type Size = 'default' | 'small';
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/SlotFill',
18
18
  component: Slot,
19
19
  parameters: {
20
- knobs: { disable: false },
20
+ knobs: { disabled: 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: { disable: false },
15
+ knobs: { disabled: 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: { disable: false },
18
+ knobs: { disabled: false },
19
19
  },
20
20
  };
21
21
 
@@ -1,5 +1,3 @@
1
- //@ts-nocheck
2
-
3
1
  /**
4
2
  * External dependencies
5
3
  */
@@ -13,7 +13,7 @@ export default {
13
13
  component: Surface,
14
14
  title: 'Components (Experimental)/Surface',
15
15
  parameters: {
16
- knobs: { disable: false },
16
+ knobs: { disabled: 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: { disable: false },
15
+ knobs: { disabled: 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: { disable: false },
20
+ knobs: { disabled: 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: { disable: false },
15
+ knobs: { disabled: false },
16
16
  },
17
17
  };
18
18
 
@@ -17,7 +17,7 @@ export default {
17
17
  title: 'Components/TextareaControl',
18
18
  component: TextareaControl,
19
19
  parameters: {
20
- knobs: { disable: false },
20
+ knobs: { disabled: false },
21
21
  },
22
22
  };
23
23