@wordpress/components 28.12.0 → 28.13.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 (442) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/CONTRIBUTING.md +16 -16
  3. package/build/autocomplete/autocompleter-ui.js +1 -0
  4. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  5. package/build/border-box-control/border-box-control/component.js +1 -0
  6. package/build/border-box-control/border-box-control/component.js.map +1 -1
  7. package/build/border-box-control/border-box-control-split-controls/component.js +2 -1
  8. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  9. package/build/border-control/border-control/component.js +2 -1
  10. package/build/border-control/border-control/component.js.map +1 -1
  11. package/build/border-control/border-control/hook.js +3 -1
  12. package/build/border-control/border-control/hook.js.map +1 -1
  13. package/build/border-control/types.js.map +1 -1
  14. package/build/box-control/all-input-control.js +1 -0
  15. package/build/box-control/all-input-control.js.map +1 -1
  16. package/build/box-control/axial-input-controls.js +1 -0
  17. package/build/box-control/axial-input-controls.js.map +1 -1
  18. package/build/box-control/index.js +13 -13
  19. package/build/box-control/index.js.map +1 -1
  20. package/build/box-control/input-controls.js +1 -0
  21. package/build/box-control/input-controls.js.map +1 -1
  22. package/build/box-control/types.js.map +1 -1
  23. package/build/circular-option-picker/circular-option-picker-actions.js +1 -0
  24. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  25. package/build/circular-option-picker/circular-option-picker-option.js +1 -0
  26. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  27. package/build/color-palette/index.js +2 -0
  28. package/build/color-palette/index.js.map +1 -1
  29. package/build/color-picker/color-copy-button.js +6 -4
  30. package/build/color-picker/color-copy-button.js.map +1 -1
  31. package/build/color-picker/component.js +1 -0
  32. package/build/color-picker/component.js.map +1 -1
  33. package/build/color-picker/styles.js +21 -28
  34. package/build/color-picker/styles.js.map +1 -1
  35. package/build/combobox-control/index.js +17 -12
  36. package/build/combobox-control/index.js.map +1 -1
  37. package/build/composite/hover.js +1 -1
  38. package/build/composite/hover.js.map +1 -1
  39. package/build/composite/typeahead.js +1 -1
  40. package/build/composite/typeahead.js.map +1 -1
  41. package/build/custom-gradient-picker/gradient-bar/control-points.js +2 -0
  42. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  43. package/build/dashicon/types.js.map +1 -1
  44. package/build/dimension-control/index.js +7 -0
  45. package/build/dimension-control/index.js.map +1 -1
  46. package/build/disabled/index.js +8 -1
  47. package/build/disabled/index.js.map +1 -1
  48. package/build/duotone-picker/duotone-picker.js +2 -0
  49. package/build/duotone-picker/duotone-picker.js.map +1 -1
  50. package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
  51. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  52. package/build/font-size-picker/index.js +7 -0
  53. package/build/font-size-picker/index.js.map +1 -1
  54. package/build/form-file-upload/index.js +3 -1
  55. package/build/form-file-upload/index.js.map +1 -1
  56. package/build/gradient-picker/index.js +34 -32
  57. package/build/gradient-picker/index.js.map +1 -1
  58. package/build/gradient-picker/types.js.map +1 -1
  59. package/build/icon/index.js +9 -0
  60. package/build/icon/index.js.map +1 -1
  61. package/build/menu/styles.js +16 -16
  62. package/build/menu/styles.js.map +1 -1
  63. package/build/modal/index.js +2 -2
  64. package/build/modal/index.js.map +1 -1
  65. package/build/private-apis.js +0 -2
  66. package/build/private-apis.js.map +1 -1
  67. package/build/range-control/index.js +11 -0
  68. package/build/range-control/index.js.map +1 -1
  69. package/build/range-control/types.js.map +1 -1
  70. package/build/slot-fill/bubbles-virtually/fill.js +14 -31
  71. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  72. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +13 -4
  73. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  74. package/build/slot-fill/bubbles-virtually/slot.js +11 -9
  75. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  76. package/build/slot-fill/bubbles-virtually/use-slot.js +1 -8
  77. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  78. package/build/slot-fill/fill.js +7 -24
  79. package/build/slot-fill/fill.js.map +1 -1
  80. package/build/slot-fill/index.js +5 -10
  81. package/build/slot-fill/index.js.map +1 -1
  82. package/build/slot-fill/provider.js +2 -2
  83. package/build/slot-fill/provider.js.map +1 -1
  84. package/build/slot-fill/slot.js +37 -77
  85. package/build/slot-fill/slot.js.map +1 -1
  86. package/build/slot-fill/types.js.map +1 -1
  87. package/build/text-control/index.js +7 -0
  88. package/build/text-control/index.js.map +1 -1
  89. package/build/toggle-group-control/toggle-group-control/component.js +9 -0
  90. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  91. package/build/toggle-group-control/toggle-group-control-option/component.js +1 -0
  92. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  93. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  94. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  95. package/build/toggle-group-control/types.js.map +1 -1
  96. package/build/utils/deprecated-36px-size.js +3 -2
  97. package/build/utils/deprecated-36px-size.js.map +1 -1
  98. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  99. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  100. package/build-module/border-box-control/border-box-control/component.js +1 -0
  101. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  102. package/build-module/border-box-control/border-box-control-split-controls/component.js +2 -1
  103. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  104. package/build-module/border-control/border-control/component.js +2 -1
  105. package/build-module/border-control/border-control/component.js.map +1 -1
  106. package/build-module/border-control/border-control/hook.js +3 -1
  107. package/build-module/border-control/border-control/hook.js.map +1 -1
  108. package/build-module/border-control/types.js.map +1 -1
  109. package/build-module/box-control/all-input-control.js +1 -0
  110. package/build-module/box-control/all-input-control.js.map +1 -1
  111. package/build-module/box-control/axial-input-controls.js +1 -0
  112. package/build-module/box-control/axial-input-controls.js.map +1 -1
  113. package/build-module/box-control/index.js +13 -13
  114. package/build-module/box-control/index.js.map +1 -1
  115. package/build-module/box-control/input-controls.js +1 -0
  116. package/build-module/box-control/input-controls.js.map +1 -1
  117. package/build-module/box-control/types.js.map +1 -1
  118. package/build-module/circular-option-picker/circular-option-picker-actions.js +1 -0
  119. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  120. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -0
  121. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  122. package/build-module/color-palette/index.js +2 -0
  123. package/build-module/color-palette/index.js.map +1 -1
  124. package/build-module/color-picker/color-copy-button.js +6 -4
  125. package/build-module/color-picker/color-copy-button.js.map +1 -1
  126. package/build-module/color-picker/component.js +1 -0
  127. package/build-module/color-picker/component.js.map +1 -1
  128. package/build-module/color-picker/styles.js +20 -27
  129. package/build-module/color-picker/styles.js.map +1 -1
  130. package/build-module/combobox-control/index.js +18 -13
  131. package/build-module/combobox-control/index.js.map +1 -1
  132. package/build-module/composite/hover.js +1 -1
  133. package/build-module/composite/hover.js.map +1 -1
  134. package/build-module/composite/typeahead.js +1 -1
  135. package/build-module/composite/typeahead.js.map +1 -1
  136. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +2 -0
  137. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  138. package/build-module/dashicon/types.js.map +1 -1
  139. package/build-module/dimension-control/index.js +7 -0
  140. package/build-module/dimension-control/index.js.map +1 -1
  141. package/build-module/disabled/index.js +8 -1
  142. package/build-module/disabled/index.js.map +1 -1
  143. package/build-module/duotone-picker/duotone-picker.js +2 -0
  144. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  145. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
  146. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  147. package/build-module/font-size-picker/index.js +7 -0
  148. package/build-module/font-size-picker/index.js.map +1 -1
  149. package/build-module/form-file-upload/index.js +3 -1
  150. package/build-module/form-file-upload/index.js.map +1 -1
  151. package/build-module/gradient-picker/index.js +34 -32
  152. package/build-module/gradient-picker/index.js.map +1 -1
  153. package/build-module/gradient-picker/types.js.map +1 -1
  154. package/build-module/icon/index.js +9 -0
  155. package/build-module/icon/index.js.map +1 -1
  156. package/build-module/menu/styles.js +16 -16
  157. package/build-module/menu/styles.js.map +1 -1
  158. package/build-module/modal/index.js +2 -2
  159. package/build-module/modal/index.js.map +1 -1
  160. package/build-module/private-apis.js +0 -2
  161. package/build-module/private-apis.js.map +1 -1
  162. package/build-module/range-control/index.js +11 -0
  163. package/build-module/range-control/index.js.map +1 -1
  164. package/build-module/range-control/types.js.map +1 -1
  165. package/build-module/slot-fill/bubbles-virtually/fill.js +15 -32
  166. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  167. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +13 -4
  168. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  169. package/build-module/slot-fill/bubbles-virtually/slot.js +11 -9
  170. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  171. package/build-module/slot-fill/bubbles-virtually/use-slot.js +2 -9
  172. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  173. package/build-module/slot-fill/fill.js +7 -24
  174. package/build-module/slot-fill/fill.js.map +1 -1
  175. package/build-module/slot-fill/index.js +5 -8
  176. package/build-module/slot-fill/index.js.map +1 -1
  177. package/build-module/slot-fill/provider.js +2 -3
  178. package/build-module/slot-fill/provider.js.map +1 -1
  179. package/build-module/slot-fill/slot.js +38 -78
  180. package/build-module/slot-fill/slot.js.map +1 -1
  181. package/build-module/slot-fill/types.js.map +1 -1
  182. package/build-module/text-control/index.js +7 -0
  183. package/build-module/text-control/index.js.map +1 -1
  184. package/build-module/toggle-group-control/toggle-group-control/component.js +9 -0
  185. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  186. package/build-module/toggle-group-control/toggle-group-control-option/component.js +1 -0
  187. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  188. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  189. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  190. package/build-module/toggle-group-control/types.js.map +1 -1
  191. package/build-module/utils/deprecated-36px-size.js +3 -2
  192. package/build-module/utils/deprecated-36px-size.js.map +1 -1
  193. package/build-style/style-rtl.css +3 -10
  194. package/build-style/style.css +3 -10
  195. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  196. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  197. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  198. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  199. package/build-types/border-control/border-control/component.d.ts +1 -0
  200. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  201. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  202. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  203. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  204. package/build-types/border-control/stories/index.story.d.ts +10 -5
  205. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  206. package/build-types/border-control/types.d.ts +7 -0
  207. package/build-types/border-control/types.d.ts.map +1 -1
  208. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  209. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  210. package/build-types/box-control/index.d.ts +13 -13
  211. package/build-types/box-control/input-controls.d.ts.map +1 -1
  212. package/build-types/box-control/styles/box-control-styles.d.ts +2 -1
  213. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  214. package/build-types/box-control/types.d.ts +2 -0
  215. package/build-types/box-control/types.d.ts.map +1 -1
  216. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  217. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  218. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  219. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  220. package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
  221. package/build-types/color-palette/index.d.ts.map +1 -1
  222. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  223. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  224. package/build-types/color-picker/component.d.ts.map +1 -1
  225. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  226. package/build-types/color-picker/styles.d.ts +2 -4
  227. package/build-types/color-picker/styles.d.ts.map +1 -1
  228. package/build-types/combobox-control/index.d.ts +1 -0
  229. package/build-types/combobox-control/index.d.ts.map +1 -1
  230. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  231. package/build-types/composite/typeahead.d.ts.map +1 -1
  232. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  233. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  234. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  235. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  236. package/build-types/dashicon/types.d.ts +1 -1
  237. package/build-types/dashicon/types.d.ts.map +1 -1
  238. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  239. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  240. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  241. package/build-types/dimension-control/index.d.ts +1 -0
  242. package/build-types/dimension-control/index.d.ts.map +1 -1
  243. package/build-types/disabled/index.d.ts +8 -1
  244. package/build-types/disabled/index.d.ts.map +1 -1
  245. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  246. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  247. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  248. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  249. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  250. package/build-types/font-size-picker/index.d.ts.map +1 -1
  251. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  252. package/build-types/form-file-upload/index.d.ts.map +1 -1
  253. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  254. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  255. package/build-types/gradient-picker/index.d.ts +32 -32
  256. package/build-types/gradient-picker/index.d.ts.map +1 -1
  257. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  258. package/build-types/gradient-picker/types.d.ts +1 -5
  259. package/build-types/gradient-picker/types.d.ts.map +1 -1
  260. package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
  261. package/build-types/icon/index.d.ts +23 -7
  262. package/build-types/icon/index.d.ts.map +1 -1
  263. package/build-types/icon/stories/index.story.d.ts +7 -1
  264. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  265. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  266. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  267. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  268. package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
  269. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  270. package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
  271. package/build-types/private-apis.d.ts.map +1 -1
  272. package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
  273. package/build-types/range-control/index.d.ts +3 -1
  274. package/build-types/range-control/index.d.ts.map +1 -1
  275. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  276. package/build-types/range-control/types.d.ts +7 -0
  277. package/build-types/range-control/types.d.ts.map +1 -1
  278. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  279. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  280. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  281. package/build-types/slot-fill/bubbles-virtually/fill.d.ts +1 -1
  282. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  283. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  284. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  285. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
  286. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
  287. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts +3 -7
  288. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  289. package/build-types/slot-fill/fill.d.ts.map +1 -1
  290. package/build-types/slot-fill/index.d.ts +5 -12
  291. package/build-types/slot-fill/index.d.ts.map +1 -1
  292. package/build-types/slot-fill/provider.d.ts.map +1 -1
  293. package/build-types/slot-fill/slot.d.ts +1 -1
  294. package/build-types/slot-fill/slot.d.ts.map +1 -1
  295. package/build-types/slot-fill/types.d.ts +15 -18
  296. package/build-types/slot-fill/types.d.ts.map +1 -1
  297. package/build-types/slot-fill/use-slot.d.ts +1 -1
  298. package/build-types/slot-fill/use-slot.d.ts.map +1 -1
  299. package/build-types/text-control/index.d.ts +1 -0
  300. package/build-types/text-control/index.d.ts.map +1 -1
  301. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  302. package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
  303. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  304. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  305. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +2 -0
  306. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  307. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -0
  308. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  309. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  310. package/build-types/toggle-group-control/types.d.ts +7 -0
  311. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  312. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  313. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  314. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  315. package/build-types/utils/deprecated-36px-size.d.ts +2 -1
  316. package/build-types/utils/deprecated-36px-size.d.ts.map +1 -1
  317. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  318. package/package.json +2 -2
  319. package/src/autocomplete/autocompleter-ui.tsx +1 -0
  320. package/src/base-control/stories/index.story.tsx +2 -1
  321. package/src/border-box-control/border-box-control/component.tsx +1 -0
  322. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -0
  323. package/src/border-control/border-control/component.tsx +1 -0
  324. package/src/border-control/border-control/hook.ts +2 -0
  325. package/src/border-control/types.ts +7 -0
  326. package/src/box-control/README.md +79 -60
  327. package/src/box-control/all-input-control.tsx +1 -0
  328. package/src/box-control/axial-input-controls.tsx +1 -0
  329. package/src/box-control/docs-manifest.json +5 -0
  330. package/src/box-control/index.tsx +13 -13
  331. package/src/box-control/input-controls.tsx +1 -0
  332. package/src/box-control/types.ts +2 -0
  333. package/src/checkbox-control/stories/index.story.tsx +2 -1
  334. package/src/circular-option-picker/circular-option-picker-actions.tsx +1 -0
  335. package/src/circular-option-picker/circular-option-picker-option.tsx +1 -0
  336. package/src/circular-option-picker/stories/index.story.tsx +2 -1
  337. package/src/circular-option-picker/style.scss +2 -2
  338. package/src/color-indicator/stories/index.story.tsx +2 -1
  339. package/src/color-palette/index.tsx +5 -1
  340. package/src/color-palette/stories/index.story.tsx +2 -1
  341. package/src/color-picker/color-copy-button.tsx +8 -10
  342. package/src/color-picker/component.tsx +1 -0
  343. package/src/color-picker/stories/index.story.tsx +2 -1
  344. package/src/color-picker/styles.ts +0 -13
  345. package/src/combobox-control/README.md +1 -0
  346. package/src/combobox-control/index.tsx +19 -13
  347. package/src/combobox-control/stories/index.story.tsx +3 -1
  348. package/src/combobox-control/style.scss +0 -6
  349. package/src/combobox-control/test/index.tsx +7 -1
  350. package/src/composite/hover.tsx +1 -1
  351. package/src/composite/typeahead.tsx +3 -1
  352. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +2 -0
  353. package/src/custom-gradient-picker/stories/index.story.tsx +2 -1
  354. package/src/custom-gradient-picker/style.scss +1 -1
  355. package/src/custom-select-control/stories/index.story.tsx +2 -1
  356. package/src/custom-select-control-v2/stories/index.story.tsx +2 -1
  357. package/src/dashicon/types.ts +0 -2
  358. package/src/date-time/stories/date-time.story.tsx +2 -1
  359. package/src/date-time/stories/date.story.tsx +2 -1
  360. package/src/date-time/stories/time.story.tsx +2 -1
  361. package/src/dimension-control/README.md +1 -0
  362. package/src/dimension-control/index.tsx +8 -0
  363. package/src/dimension-control/stories/index.story.tsx +1 -0
  364. package/src/dimension-control/test/__snapshots__/index.test.js.snap +24 -24
  365. package/src/dimension-control/test/index.test.js +7 -1
  366. package/src/disabled/README.md +9 -7
  367. package/src/disabled/index.tsx +8 -1
  368. package/src/disabled/stories/index.story.tsx +1 -0
  369. package/src/drop-zone/stories/index.story.tsx +2 -1
  370. package/src/dropdown-menu/stories/index.story.tsx +2 -1
  371. package/src/duotone-picker/duotone-picker.tsx +2 -0
  372. package/src/font-size-picker/README.md +1 -0
  373. package/src/font-size-picker/font-size-picker-toggle-group.tsx +1 -0
  374. package/src/font-size-picker/index.tsx +8 -0
  375. package/src/font-size-picker/stories/index.story.tsx +1 -0
  376. package/src/font-size-picker/test/index.tsx +5 -1
  377. package/src/form-file-upload/index.tsx +9 -3
  378. package/src/form-file-upload/stories/index.story.tsx +2 -1
  379. package/src/form-token-field/stories/index.story.tsx +2 -1
  380. package/src/gradient-picker/README.md +107 -69
  381. package/src/gradient-picker/docs-manifest.json +5 -0
  382. package/src/gradient-picker/index.tsx +34 -32
  383. package/src/gradient-picker/stories/index.story.tsx +2 -1
  384. package/src/gradient-picker/types.ts +3 -5
  385. package/src/h-stack/stories/index.story.tsx +2 -1
  386. package/src/higher-order/with-constrained-tabbing/README.md +13 -3
  387. package/src/higher-order/with-focus-return/README.md +9 -2
  388. package/src/icon/README.md +22 -65
  389. package/src/icon/docs-manifest.json +5 -0
  390. package/src/icon/index.tsx +28 -13
  391. package/src/icon/stories/index.story.tsx +50 -8
  392. package/src/input-control/stories/index.story.tsx +2 -1
  393. package/src/menu/styles.ts +1 -1
  394. package/src/menu-group/stories/index.story.tsx +2 -1
  395. package/src/menu-item/stories/index.story.tsx +2 -1
  396. package/src/menu-items-choice/stories/index.story.tsx +2 -1
  397. package/src/modal/index.tsx +2 -2
  398. package/src/modal/stories/index.story.tsx +1 -1
  399. package/src/number-control/stories/index.story.tsx +2 -1
  400. package/src/placeholder/stories/index.story.tsx +1 -0
  401. package/src/private-apis.ts +0 -2
  402. package/src/radio-control/stories/index.story.tsx +2 -1
  403. package/src/range-control/README.md +4 -3
  404. package/src/range-control/index.tsx +11 -0
  405. package/src/range-control/stories/index.story.tsx +9 -1
  406. package/src/range-control/test/index.tsx +7 -1
  407. package/src/range-control/types.ts +7 -0
  408. package/src/responsive-wrapper/stories/index.story.tsx +2 -1
  409. package/src/search-control/stories/index.story.tsx +2 -1
  410. package/src/select-control/stories/index.story.tsx +2 -1
  411. package/src/slot-fill/README.md +26 -15
  412. package/src/slot-fill/bubbles-virtually/fill.tsx +18 -28
  413. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +26 -16
  414. package/src/slot-fill/bubbles-virtually/slot.tsx +13 -9
  415. package/src/slot-fill/bubbles-virtually/use-slot.ts +3 -26
  416. package/src/slot-fill/fill.ts +7 -22
  417. package/src/slot-fill/index.tsx +5 -7
  418. package/src/slot-fill/provider.tsx +8 -17
  419. package/src/slot-fill/slot.tsx +48 -85
  420. package/src/slot-fill/types.ts +14 -51
  421. package/src/text-control/README.md +1 -0
  422. package/src/text-control/index.tsx +8 -0
  423. package/src/text-control/stories/index.story.tsx +3 -1
  424. package/src/text-control/test/text-control.tsx +7 -1
  425. package/src/textarea-control/stories/index.story.tsx +2 -1
  426. package/src/toggle-control/stories/index.story.tsx +2 -1
  427. package/src/toggle-group-control/stories/index.story.tsx +3 -1
  428. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +12 -12
  429. package/src/toggle-group-control/test/index.tsx +7 -1
  430. package/src/toggle-group-control/toggle-group-control/README.md +2 -1
  431. package/src/toggle-group-control/toggle-group-control/component.tsx +10 -0
  432. package/src/toggle-group-control/toggle-group-control-option/README.md +1 -1
  433. package/src/toggle-group-control/toggle-group-control-option/component.tsx +1 -0
  434. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
  435. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -1
  436. package/src/toggle-group-control/types.ts +7 -0
  437. package/src/tools-panel/stories/index.story.tsx +3 -0
  438. package/src/tree-select/stories/index.story.tsx +2 -1
  439. package/src/unit-control/stories/index.story.tsx +2 -1
  440. package/src/utils/deprecated-36px-size.ts +3 -0
  441. package/src/v-stack/stories/index.story.tsx +2 -1
  442. package/tsconfig.tsbuildinfo +1 -1
@@ -219,7 +219,6 @@ export type IconKey =
219
219
  | 'insert-before'
220
220
  | 'insert'
221
221
  | 'instagram'
222
- | 'keyboard-hide'
223
222
  | 'laptop'
224
223
  | 'layout'
225
224
  | 'leftright'
@@ -266,7 +265,6 @@ export type IconKey =
266
265
  | 'playlist-audio'
267
266
  | 'playlist-video'
268
267
  | 'plus-alt'
269
- | 'plus-light'
270
268
  | 'plus'
271
269
  | 'portfolio'
272
270
  | 'post-status'
@@ -15,7 +15,8 @@ import DateTimePicker from '../date-time';
15
15
  import { daysFromNow, isWeekend } from './utils';
16
16
 
17
17
  const meta: Meta< typeof DateTimePicker > = {
18
- title: 'Components/DateTimePicker',
18
+ title: 'Components/Selection & Input/Time & Date/DateTimePicker',
19
+ id: 'components-datetimepicker',
19
20
  component: DateTimePicker,
20
21
  argTypes: {
21
22
  currentDate: { control: 'date' },
@@ -15,7 +15,8 @@ import DatePicker from '../date';
15
15
  import { daysFromNow, isWeekend } from './utils';
16
16
 
17
17
  const meta: Meta< typeof DatePicker > = {
18
- title: 'Components/DatePicker',
18
+ title: 'Components/Selection & Input/Time & Date/DatePicker',
19
+ id: 'components-datepicker',
19
20
  component: DatePicker,
20
21
  argTypes: {
21
22
  currentDate: { control: 'date' },
@@ -14,7 +14,8 @@ import { useState, useEffect } from '@wordpress/element';
14
14
  import TimePicker from '../time';
15
15
 
16
16
  const meta: Meta< typeof TimePicker > = {
17
- title: 'Components/TimePicker',
17
+ title: 'Components/Selection & Input/Time & Date/TimePicker',
18
+ id: 'components-timepicker',
18
19
  component: TimePicker,
19
20
  // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
20
21
  subcomponents: { 'TimePicker.TimeInput': TimePicker.TimeInput },
@@ -22,6 +22,7 @@ export default function MyCustomDimensionControl() {
22
22
  return (
23
23
  <DimensionControl
24
24
  __nextHasNoMarginBottom
25
+ __next40pxDefaultSize
25
26
  label={ 'Padding' }
26
27
  icon={ 'desktop' }
27
28
  onChange={ ( value ) => setPaddingSize( value ) }
@@ -18,6 +18,7 @@ import type { DimensionControlProps, Size } from './types';
18
18
  import type { SelectControlSingleSelectionProps } from '../select-control/types';
19
19
  import { ContextSystemProvider } from '../context';
20
20
  import deprecated from '@wordpress/deprecated';
21
+ import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
21
22
 
22
23
  const CONTEXT_VALUE = {
23
24
  BaseControl: {
@@ -41,6 +42,7 @@ const CONTEXT_VALUE = {
41
42
  *
42
43
  * return (
43
44
  * <DimensionControl
45
+ * __next40pxDefaultSize
44
46
  * __nextHasNoMarginBottom
45
47
  * label={ 'Padding' }
46
48
  * icon={ 'desktop' }
@@ -68,6 +70,12 @@ export function DimensionControl( props: DimensionControlProps ) {
68
70
  version: '7.0',
69
71
  } );
70
72
 
73
+ maybeWarnDeprecated36pxSize( {
74
+ componentName: 'DimensionControl',
75
+ __next40pxDefaultSize,
76
+ size: undefined,
77
+ } );
78
+
71
79
  const onChangeSpacingSize: SelectControlSingleSelectionProps[ 'onChange' ] =
72
80
  ( val ) => {
73
81
  const theSize = findSizeBySlug( sizes, val );
@@ -50,6 +50,7 @@ const Template: StoryFn< typeof DimensionControl > = ( args ) => (
50
50
  export const Default = Template.bind( {} );
51
51
  Default.args = {
52
52
  __nextHasNoMarginBottom: true,
53
+ __next40pxDefaultSize: true,
53
54
  label: 'Please select a size',
54
55
  sizes,
55
56
  };
@@ -126,12 +126,12 @@ exports[`DimensionControl rendering renders with custom sizes 1`] = `
126
126
  white-space: nowrap;
127
127
  text-overflow: ellipsis;
128
128
  font-size: 16px;
129
- height: 32px;
130
- min-height: 32px;
129
+ height: 40px;
130
+ min-height: 40px;
131
131
  padding-top: 0;
132
132
  padding-bottom: 0;
133
- padding-left: 8px;
134
- padding-right: 26px;
133
+ padding-left: 12px;
134
+ padding-right: 30px;
135
135
  overflow: hidden;
136
136
  }
137
137
 
@@ -157,8 +157,8 @@ exports[`DimensionControl rendering renders with custom sizes 1`] = `
157
157
  }
158
158
 
159
159
  .emotion-21 {
160
- -webkit-padding-end: 8px;
161
- padding-inline-end: 8px;
160
+ -webkit-padding-end: 12px;
161
+ padding-inline-end: 12px;
162
162
  position: absolute;
163
163
  pointer-events: none;
164
164
  right: 0;
@@ -408,12 +408,12 @@ exports[`DimensionControl rendering renders with defaults 1`] = `
408
408
  white-space: nowrap;
409
409
  text-overflow: ellipsis;
410
410
  font-size: 16px;
411
- height: 32px;
412
- min-height: 32px;
411
+ height: 40px;
412
+ min-height: 40px;
413
413
  padding-top: 0;
414
414
  padding-bottom: 0;
415
- padding-left: 8px;
416
- padding-right: 26px;
415
+ padding-left: 12px;
416
+ padding-right: 30px;
417
417
  overflow: hidden;
418
418
  }
419
419
 
@@ -439,8 +439,8 @@ exports[`DimensionControl rendering renders with defaults 1`] = `
439
439
  }
440
440
 
441
441
  .emotion-21 {
442
- -webkit-padding-end: 8px;
443
- padding-inline-end: 8px;
442
+ -webkit-padding-end: 12px;
443
+ padding-inline-end: 12px;
444
444
  position: absolute;
445
445
  pointer-events: none;
446
446
  right: 0;
@@ -700,12 +700,12 @@ exports[`DimensionControl rendering renders with icon and custom icon label 1`]
700
700
  white-space: nowrap;
701
701
  text-overflow: ellipsis;
702
702
  font-size: 16px;
703
- height: 32px;
704
- min-height: 32px;
703
+ height: 40px;
704
+ min-height: 40px;
705
705
  padding-top: 0;
706
706
  padding-bottom: 0;
707
- padding-left: 8px;
708
- padding-right: 26px;
707
+ padding-left: 12px;
708
+ padding-right: 30px;
709
709
  overflow: hidden;
710
710
  }
711
711
 
@@ -731,8 +731,8 @@ exports[`DimensionControl rendering renders with icon and custom icon label 1`]
731
731
  }
732
732
 
733
733
  .emotion-21 {
734
- -webkit-padding-end: 8px;
735
- padding-inline-end: 8px;
734
+ -webkit-padding-end: 12px;
735
+ padding-inline-end: 12px;
736
736
  position: absolute;
737
737
  pointer-events: none;
738
738
  right: 0;
@@ -1004,12 +1004,12 @@ exports[`DimensionControl rendering renders with icon and default icon label 1`]
1004
1004
  white-space: nowrap;
1005
1005
  text-overflow: ellipsis;
1006
1006
  font-size: 16px;
1007
- height: 32px;
1008
- min-height: 32px;
1007
+ height: 40px;
1008
+ min-height: 40px;
1009
1009
  padding-top: 0;
1010
1010
  padding-bottom: 0;
1011
- padding-left: 8px;
1012
- padding-right: 26px;
1011
+ padding-left: 12px;
1012
+ padding-right: 30px;
1013
1013
  overflow: hidden;
1014
1014
  }
1015
1015
 
@@ -1035,8 +1035,8 @@ exports[`DimensionControl rendering renders with icon and default icon label 1`]
1035
1035
  }
1036
1036
 
1037
1037
  .emotion-21 {
1038
- -webkit-padding-end: 8px;
1039
- padding-inline-end: 8px;
1038
+ -webkit-padding-end: 12px;
1039
+ padding-inline-end: 12px;
1040
1040
  position: absolute;
1041
1041
  pointer-events: none;
1042
1042
  right: 0;
@@ -15,7 +15,13 @@ import { plus } from '@wordpress/icons';
15
15
  import { DimensionControl as _DimensionControl } from '../';
16
16
 
17
17
  const DimensionControl = ( props ) => {
18
- return <_DimensionControl { ...props } __nextHasNoMarginBottom />;
18
+ return (
19
+ <_DimensionControl
20
+ { ...props }
21
+ __next40pxDefaultSize
22
+ __nextHasNoMarginBottom
23
+ />
24
+ );
19
25
  };
20
26
 
21
27
  describe( 'DimensionControl', () => {
@@ -13,7 +13,14 @@ import { Button, Disabled, TextControl } from '@wordpress/components';
13
13
  const MyDisabled = () => {
14
14
  const [ isDisabled, setIsDisabled ] = useState( true );
15
15
 
16
- let input = <TextControl label="Input" onChange={ () => {} } />;
16
+ let input = (
17
+ <TextControl
18
+ __next40pxDefaultSize
19
+ __nextHasNoMarginBottom
20
+ label="Input"
21
+ onChange={ () => {} }
22
+ />
23
+ );
17
24
  if ( isDisabled ) {
18
25
  input = <Disabled>{ input }</Disabled>;
19
26
  }
@@ -38,12 +45,7 @@ A component can detect if it has been wrapped in a `<Disabled />` by accessing i
38
45
  ```jsx
39
46
  function CustomButton( props ) {
40
47
  const isDisabled = useContext( Disabled.Context );
41
- return (
42
- <button
43
- { ...props }
44
- style={ { opacity: isDisabled ? 0.5 : 1 } }
45
- />
46
- );
48
+ return <button { ...props } style={ { opacity: isDisabled ? 0.5 : 1 } } />;
47
49
  }
48
50
  ```
49
51
 
@@ -31,7 +31,14 @@ const { Consumer, Provider } = Context;
31
31
  * const MyDisabled = () => {
32
32
  * const [ isDisabled, setIsDisabled ] = useState( true );
33
33
  *
34
- * let input = <TextControl label="Input" onChange={ () => {} } />;
34
+ * let input = (
35
+ * <TextControl
36
+ * __next40pxDefaultSize
37
+ * __nextHasNoMarginBottom
38
+ * label="Input"
39
+ * onChange={ () => {} }
40
+ * />
41
+ * );
35
42
  * if ( isDisabled ) {
36
43
  * input = <Disabled>{ input }</Disabled>;
37
44
  * }
@@ -42,6 +42,7 @@ const Form = () => {
42
42
  <VStack>
43
43
  <TextControl
44
44
  __nextHasNoMarginBottom
45
+ __next40pxDefaultSize
45
46
  label="Text Control"
46
47
  value={ textControlValue }
47
48
  onChange={ setTextControlValue }
@@ -9,7 +9,8 @@ import DropZone from '..';
9
9
 
10
10
  const meta: Meta< typeof DropZone > = {
11
11
  component: DropZone,
12
- title: 'Components/DropZone',
12
+ id: 'components-dropzone',
13
+ title: 'Components/Selection & Input/File Upload/DropZone',
13
14
  parameters: {
14
15
  actions: { argTypesRegex: '^on.*' },
15
16
  controls: { expanded: true },
@@ -23,8 +23,9 @@ import {
23
23
  } from '@wordpress/icons';
24
24
 
25
25
  const meta: Meta< typeof DropdownMenu > = {
26
- title: 'Components/DropdownMenu',
26
+ title: 'Components/Actions/DropdownMenu',
27
27
  component: DropdownMenu,
28
+ id: 'components-dropdownmenu',
28
29
  parameters: {
29
30
  actions: { argTypesRegex: '^on.*' },
30
31
  controls: { expanded: true },
@@ -168,6 +168,8 @@ function DuotonePicker( {
168
168
  !! clearable && (
169
169
  <CircularOptionPicker.ButtonAction
170
170
  onClick={ () => onChange( undefined ) }
171
+ accessibleWhenDisabled
172
+ disabled={ ! value }
171
173
  >
172
174
  { __( 'Clear' ) }
173
175
  </CircularOptionPicker.ButtonAction>
@@ -29,6 +29,7 @@ const MyFontSizePicker = () => {
29
29
 
30
30
  return (
31
31
  <FontSizePicker
32
+ __next40pxDefaultSize
32
33
  fontSizes={ fontSizes }
33
34
  value={ fontSize }
34
35
  fallbackFontSize={ fallbackFontSize }
@@ -19,6 +19,7 @@ const FontSizePickerToggleGroup = ( props: FontSizePickerToggleGroupProps ) => {
19
19
  <ToggleGroupControl
20
20
  __nextHasNoMarginBottom
21
21
  __next40pxDefaultSize={ __next40pxDefaultSize }
22
+ __shouldNotWarnDeprecated36pxSize
22
23
  label={ __( 'Font size' ) }
23
24
  hideLabelFromVision
24
25
  value={ value }
@@ -35,6 +35,7 @@ import { Spacer } from '../spacer';
35
35
  import FontSizePickerSelect from './font-size-picker-select';
36
36
  import FontSizePickerToggleGroup from './font-size-picker-toggle-group';
37
37
  import { T_SHIRT_NAMES } from './constants';
38
+ import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
38
39
 
39
40
  const DEFAULT_UNITS = [ 'px', 'em', 'rem', 'vw', 'vh' ];
40
41
 
@@ -123,6 +124,12 @@ const UnforwardedFontSizePicker = (
123
124
  !! valueUnit && [ 'em', 'rem', 'vw', 'vh' ].includes( valueUnit );
124
125
  const isDisabled = value === undefined;
125
126
 
127
+ maybeWarnDeprecated36pxSize( {
128
+ componentName: 'FontSizePicker',
129
+ __next40pxDefaultSize,
130
+ size,
131
+ } );
132
+
126
133
  return (
127
134
  <Container ref={ ref } className="components-font-size-picker">
128
135
  <VisuallyHidden as="legend">{ __( 'Font size' ) }</VisuallyHidden>
@@ -235,6 +242,7 @@ const UnforwardedFontSizePicker = (
235
242
  __next40pxDefaultSize={
236
243
  __next40pxDefaultSize
237
244
  }
245
+ __shouldNotWarnDeprecated36pxSize
238
246
  className="components-font-size-picker__custom-input"
239
247
  label={ __( 'Custom Size' ) }
240
248
  hideLabelFromVision
@@ -66,6 +66,7 @@ const TwoFontSizePickersWithState: StoryFn< typeof FontSizePicker > = ( {
66
66
  export const Default: StoryFn< typeof FontSizePicker > =
67
67
  FontSizePickerWithState.bind( {} );
68
68
  Default.args = {
69
+ __next40pxDefaultSize: true,
69
70
  disableCustomFontSizes: false,
70
71
  fontSizes: [
71
72
  {
@@ -8,13 +8,17 @@ import { render } from '@ariakit/test/react';
8
8
  /**
9
9
  * Internal dependencies
10
10
  */
11
- import FontSizePicker from '../';
11
+ import _FontSizePicker from '../';
12
12
  import type { FontSize } from '../types';
13
13
  /**
14
14
  * WordPress dependencies
15
15
  */
16
16
  import { useState } from '@wordpress/element';
17
17
 
18
+ const FontSizePicker = (
19
+ props: React.ComponentProps< typeof _FontSizePicker >
20
+ ) => <_FontSizePicker __next40pxDefaultSize { ...props } />;
21
+
18
22
  const ControlledFontSizePicker = ( {
19
23
  onChange,
20
24
  ...props
@@ -50,9 +50,15 @@ export function FormFileUpload( {
50
50
  // @todo: Temporary fix a bug that prevents Chromium browsers from selecting ".heic" files
51
51
  // from the file upload. See https://core.trac.wordpress.org/ticket/62268#comment:4.
52
52
  // This can be removed once the Chromium fix is in the stable channel.
53
- const compatAccept = !! accept?.includes( 'image/*' )
54
- ? `${ accept }, image/heic, image/heif`
55
- : accept;
53
+ // Prevent Safari from adding "image/heic" and "image/heif" to the accept attribute.
54
+ const isSafari =
55
+ globalThis.window?.navigator.userAgent.includes( 'Safari' ) &&
56
+ ! globalThis.window?.navigator.userAgent.includes( 'Chrome' ) &&
57
+ ! globalThis.window?.navigator.userAgent.includes( 'Chromium' );
58
+ const compatAccept =
59
+ ! isSafari && !! accept?.includes( 'image/*' )
60
+ ? `${ accept }, image/heic, image/heif`
61
+ : accept;
56
62
 
57
63
  return (
58
64
  <div className="components-form-file-upload">
@@ -14,7 +14,8 @@ import { upload as uploadIcon } from '@wordpress/icons';
14
14
  import FormFileUpload from '..';
15
15
 
16
16
  const meta: Meta< typeof FormFileUpload > = {
17
- title: 'Components/FormFileUpload',
17
+ title: 'Components/Selection & Input/File Upload/FormFileUpload',
18
+ id: 'components-formfileupload',
18
19
  component: FormFileUpload,
19
20
  argTypes: {
20
21
  icon: { control: { type: null } },
@@ -15,7 +15,8 @@ import FormTokenField from '../';
15
15
 
16
16
  const meta: Meta< typeof FormTokenField > = {
17
17
  component: FormTokenField,
18
- title: 'Components/FormTokenField',
18
+ title: 'Components/Selection & Input/Common/FormTokenField',
19
+ id: 'components-formtokenfield',
19
20
  argTypes: {
20
21
  value: {
21
22
  control: { type: null },
@@ -1,110 +1,148 @@
1
1
  # GradientPicker
2
2
 
3
- GradientPicker is a React component that renders a color gradient picker to define a multi step gradient. There's either a _linear_ or a _radial_ type available.
3
+ <!-- This file is generated automatically and cannot be edited directly. Make edits via TypeScript types and TSDocs. -->
4
4
 
5
- ![gradient-picker](https://user-images.githubusercontent.com/881729/147505438-3818c4c7-65b5-4394-b97b-af903c62adce.png)
5
+ <p class="callout callout-info">See the <a href="https://wordpress.github.io/gutenberg/?path=/docs/components-gradientpicker--docs">WordPress Storybook</a> for more detailed, interactive documentation.</p>
6
6
 
7
- ## Usage
8
-
9
- Render a GradientPicker.
7
+ GradientPicker is a React component that renders a color gradient picker to
8
+ define a multi step gradient. There's either a _linear_ or a _radial_ type
9
+ available.
10
10
 
11
11
  ```jsx
12
12
  import { useState } from 'react';
13
13
  import { GradientPicker } from '@wordpress/components';
14
14
 
15
- const myGradientPicker = () => {
16
- const [ gradient, setGradient ] = useState( null );
17
-
18
- return (
19
- <GradientPicker
20
- value={ gradient }
21
- onChange={ ( currentGradient ) => setGradient( currentGradient ) }
22
- gradients={ [
23
- {
24
- name: 'JShine',
25
- gradient:
26
- 'linear-gradient(135deg,#12c2e9 0%,#c471ed 50%,#f64f59 100%)',
27
- slug: 'jshine',
28
- },
29
- {
30
- name: 'Moonlit Asteroid',
31
- gradient:
32
- 'linear-gradient(135deg,#0F2027 0%, #203A43 0%, #2c5364 100%)',
33
- slug: 'moonlit-asteroid',
34
- },
35
- {
36
- name: 'Rastafarie',
37
- gradient:
38
- 'linear-gradient(135deg,#1E9600 0%, #FFF200 0%, #FF0000 100%)',
39
- slug: 'rastafari',
40
- },
41
- ] }
42
- />
43
- );
15
+ const MyGradientPicker = () => {
16
+ const [ gradient, setGradient ] = useState( null );
17
+
18
+ return (
19
+ <GradientPicker
20
+ value={ gradient }
21
+ onChange={ ( currentGradient ) => setGradient( currentGradient ) }
22
+ gradients={ [
23
+ {
24
+ name: 'JShine',
25
+ gradient:
26
+ 'linear-gradient(135deg,#12c2e9 0%,#c471ed 50%,#f64f59 100%)',
27
+ slug: 'jshine',
28
+ },
29
+ {
30
+ name: 'Moonlit Asteroid',
31
+ gradient:
32
+ 'linear-gradient(135deg,#0F2027 0%, #203A43 0%, #2c5364 100%)',
33
+ slug: 'moonlit-asteroid',
34
+ },
35
+ {
36
+ name: 'Rastafarie',
37
+ gradient:
38
+ 'linear-gradient(135deg,#1E9600 0%, #FFF200 0%, #FF0000 100%)',
39
+ slug: 'rastafari',
40
+ },
41
+ ] }
42
+ />
43
+ );
44
44
  };
45
45
  ```
46
-
47
46
  ## Props
48
47
 
49
- The component accepts the following props:
48
+ ### `__experimentalIsRenderedInSidebar`
50
49
 
51
- ### `className`: `string`
50
+ Whether this is rendered in the sidebar.
52
51
 
53
- The class name added to the wrapper.
52
+ - Type: `boolean`
53
+ - Required: No
54
+ - Default: `false`
54
55
 
55
- - Required: No
56
+ ### `asButtons`
56
57
 
57
- ### `value`: `string`
58
+ Whether the control should present as a set of buttons,
59
+ each with its own tab stop.
58
60
 
59
- The current value of the gradient. Pass a css gradient like `linear-gradient(90deg, rgb(6, 147, 227) 0%, rgb(155, 81, 224) 100%)`. Optionally pass in a `null` value to specify no gradient is currently selected.
61
+ - Type: `boolean`
62
+ - Required: No
63
+ - Default: `false`
60
64
 
61
- - Required: No
62
- - Default: `linear-gradient(90deg, rgb(6, 147, 227) 0%, rgb(155, 81, 224) 100%)`
65
+ ### `aria-label`
63
66
 
64
- ### `onChange`: `( currentGradient: string | undefined ) => void`
67
+ A label to identify the purpose of the control.
65
68
 
66
- The function called when a new gradient has been defined. It is passed the `currentGradient` as an argument.
69
+ - Type: `string`
70
+ - Required: No
67
71
 
68
- - Required: Yes
72
+ ### `aria-labelledby`
69
73
 
70
- ### `gradients`: `GradientsProp[]`
74
+ An ID of an element to provide a label for the control.
71
75
 
72
- An array of objects of predefined gradients displayed above the gradient selector.
76
+ - Type: `string`
77
+ - Required: No
78
+
79
+ ### `className`
80
+
81
+ The class name added to the wrapper.
73
82
 
74
- - Required: No
75
- - Default: `[]`
83
+ - Type: `string`
84
+ - Required: No
76
85
 
77
- ### `clearable`: `boolean`
86
+ ### `clearable`
78
87
 
79
88
  Whether the palette should have a clearing button or not.
80
89
 
81
- - Required: No
82
- - Default: true
90
+ - Type: `boolean`
91
+ - Required: No
92
+ - Default: `true`
93
+
94
+ ### `disableCustomGradients`
95
+
96
+ If true, the gradient picker will not be displayed and only defined
97
+ gradients from `gradients` will be shown.
98
+
99
+ - Type: `boolean`
100
+ - Required: No
101
+ - Default: `false`
102
+
103
+ ### `gradients`
104
+
105
+ An array of objects as predefined gradients displayed above the gradient
106
+ selector. Alternatively, if there are multiple sets (or 'origins') of
107
+ gradients, you can pass an array of objects each with a `name` and a
108
+ `gradients` array which will in turn contain the predefined gradient objects.
109
+
110
+ - Type: `GradientsProp`
111
+ - Required: No
112
+ - Default: `[]`
83
113
 
84
- ### `disableCustomGradients`: `boolean`
114
+ ### `headingLevel`
85
115
 
86
- If true, the gradient picker will not be displayed and only defined gradients from `gradients` are available.
116
+ The heading level. Only applies in cases where gradients are provided
117
+ from multiple origins (i.e. when the array passed as the `gradients` prop
118
+ contains two or more items).
87
119
 
88
- - Required: No
89
- - Default: false
120
+ - Type: `1 | 2 | 3 | 4 | 5 | 6 | "1" | "2" | "3" | "4" | ...`
121
+ - Required: No
122
+ - Default: `2`
90
123
 
91
- ### `headingLevel`: `1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'`
124
+ ### `loop`
92
125
 
93
- The heading level. Only applies in cases where gradients are provided from multiple origins (ie. when the array passed as the `gradients` prop contains two or more items).
126
+ Prevents keyboard interaction from wrapping around.
127
+ Only used when `asButtons` is not true.
94
128
 
95
- - Required: No
96
- - Default: `2`
129
+ - Type: `boolean`
130
+ - Required: No
131
+ - Default: `true`
97
132
 
98
- ### `asButtons`: `boolean`
133
+ ### `onChange`
99
134
 
100
- Whether the control should present as a set of buttons, each with its own tab stop.
135
+ The function called when a new gradient has been defined. It is passed to
136
+ the `currentGradient` as an argument.
101
137
 
102
- - Required: No
103
- - Default: `false`
138
+ - Type: `(currentGradient: string) => void`
139
+ - Required: Yes
104
140
 
105
- ### `loop`: `boolean`
141
+ ### `value`
106
142
 
107
- Prevents keyboard interaction from wrapping around. Only used when `asButtons` is not true.
143
+ The current value of the gradient. Pass a css gradient string (See default value for example).
144
+ Optionally pass in a `null` value to specify no gradient is currently selected.
108
145
 
109
- - Required: No
110
- - Default: `true`
146
+ - Type: `string`
147
+ - Required: No
148
+ - Default: `'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)'`
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "../../schemas/docs-manifest.json",
3
+ "displayName": "GradientPicker",
4
+ "filePath": "./index.tsx"
5
+ }