@wordpress/components 23.5.0 → 23.7.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 (1131) hide show
  1. package/CHANGELOG.md +69 -8
  2. package/build/angle-picker-control/angle-circle.js +1 -4
  3. package/build/angle-picker-control/angle-circle.js.map +1 -1
  4. package/build/angle-picker-control/index.js +10 -22
  5. package/build/angle-picker-control/index.js.map +1 -1
  6. package/build/angle-picker-control/styles/angle-picker-control-styles.js +24 -15
  7. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  8. package/build/animate/index.js +29 -19
  9. package/build/animate/index.js.map +1 -1
  10. package/build/animate/types.js.map +1 -0
  11. package/build/animation/index.js.map +1 -1
  12. package/build/autocomplete/autocompleter-ui.js +5 -5
  13. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  14. package/build/autocomplete/get-default-use-items.js.map +1 -1
  15. package/build/autocomplete/index.js +25 -91
  16. package/build/autocomplete/index.js.map +1 -1
  17. package/build/autocomplete/types.js +6 -0
  18. package/build/autocomplete/types.js.map +1 -0
  19. package/build/box-control/axial-input-controls.js.map +1 -1
  20. package/build/color-picker/color-input.js +0 -4
  21. package/build/color-picker/color-input.js.map +1 -1
  22. package/build/color-picker/component.js +5 -4
  23. package/build/color-picker/component.js.map +1 -1
  24. package/build/color-picker/hex-input.js.map +1 -1
  25. package/build/color-picker/hsl-input.js.map +1 -1
  26. package/build/color-picker/input-with-slider.js.map +1 -1
  27. package/build/color-picker/legacy-adapter.js.map +1 -1
  28. package/build/color-picker/picker.js.map +1 -1
  29. package/build/color-picker/rgb-input.js.map +1 -1
  30. package/build/color-picker/use-deprecated-props.js.map +1 -1
  31. package/build/custom-gradient-picker/constants.js +1 -1
  32. package/build/custom-gradient-picker/constants.js.map +1 -1
  33. package/build/custom-gradient-picker/gradient-bar/constants.js.map +1 -1
  34. package/build/custom-gradient-picker/gradient-bar/control-points.js +9 -3
  35. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  36. package/build/custom-gradient-picker/gradient-bar/index.js +14 -7
  37. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  38. package/build/custom-gradient-picker/gradient-bar/utils.js +34 -52
  39. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  40. package/build/custom-gradient-picker/index.js +45 -14
  41. package/build/custom-gradient-picker/index.js.map +1 -1
  42. package/build/custom-gradient-picker/serializer.js +14 -3
  43. package/build/custom-gradient-picker/serializer.js.map +1 -1
  44. package/build/custom-gradient-picker/styles/custom-gradient-picker-styles.js +6 -6
  45. package/build/custom-gradient-picker/styles/custom-gradient-picker-styles.js.map +1 -1
  46. package/build/custom-gradient-picker/types.js +6 -0
  47. package/build/custom-gradient-picker/types.js.map +1 -0
  48. package/build/custom-gradient-picker/utils.js +17 -10
  49. package/build/custom-gradient-picker/utils.js.map +1 -1
  50. package/build/dimension-control/index.js +31 -5
  51. package/build/dimension-control/index.js.map +1 -1
  52. package/build/dimension-control/sizes.js +2 -4
  53. package/build/dimension-control/sizes.js.map +1 -1
  54. package/build/dimension-control/types.js +6 -0
  55. package/build/dimension-control/types.js.map +1 -0
  56. package/build/{color-list-picker → duotone-picker/color-list-picker}/index.js +5 -5
  57. package/build/duotone-picker/color-list-picker/index.js.map +1 -0
  58. package/build/duotone-picker/color-list-picker/types.js +6 -0
  59. package/build/duotone-picker/color-list-picker/types.js.map +1 -0
  60. package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
  61. package/build/duotone-picker/duotone-picker.js +39 -2
  62. package/build/duotone-picker/duotone-picker.js.map +1 -1
  63. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  64. package/build/duotone-picker/index.js.map +1 -1
  65. package/build/duotone-picker/types.js +6 -0
  66. package/build/duotone-picker/types.js.map +1 -0
  67. package/build/duotone-picker/utils.js +13 -11
  68. package/build/duotone-picker/utils.js.map +1 -1
  69. package/build/flex/flex/hook.js +3 -3
  70. package/build/flex/flex/hook.js.map +1 -1
  71. package/build/font-size-picker/index.js +2 -1
  72. package/build/font-size-picker/index.js.map +1 -1
  73. package/build/form-token-field/index.js +10 -4
  74. package/build/form-token-field/index.js.map +1 -1
  75. package/build/gradient-picker/index.js +61 -7
  76. package/build/gradient-picker/index.js.map +1 -1
  77. package/build/gradient-picker/types.js +6 -0
  78. package/build/gradient-picker/types.js.map +1 -0
  79. package/build/guide/icons.js.map +1 -1
  80. package/build/guide/index.js +46 -8
  81. package/build/guide/index.js.map +1 -1
  82. package/build/guide/page-control.js.map +1 -1
  83. package/build/guide/page.js.map +1 -1
  84. package/build/guide/types.js +6 -0
  85. package/build/guide/types.js.map +1 -0
  86. package/build/h-stack/utils.js +5 -5
  87. package/build/h-stack/utils.js.map +1 -1
  88. package/build/higher-order/navigate-regions/index.js +33 -3
  89. package/build/higher-order/navigate-regions/index.js.map +1 -1
  90. package/build/higher-order/with-fallback-styles/index.js +2 -2
  91. package/build/higher-order/with-fallback-styles/index.js.map +1 -1
  92. package/build/higher-order/with-filters/index.js +31 -7
  93. package/build/higher-order/with-filters/index.js.map +1 -1
  94. package/build/higher-order/with-focus-return/index.js +10 -10
  95. package/build/higher-order/with-focus-return/index.js.map +1 -1
  96. package/build/higher-order/with-notices/index.js +28 -25
  97. package/build/higher-order/with-notices/index.js.map +1 -1
  98. package/build/higher-order/with-notices/types.js +6 -0
  99. package/build/higher-order/with-notices/types.js.map +1 -0
  100. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  101. package/build/icon/index.js +1 -8
  102. package/build/icon/index.js.map +1 -1
  103. package/build/index.native.js +18 -9
  104. package/build/index.native.js.map +1 -1
  105. package/build/mobile/bottom-sheet/cell.native.js +1 -1
  106. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  107. package/build/mobile/bottom-sheet-text-control/index.native.js +4 -3
  108. package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  109. package/build/navigation/back-button/index.js +6 -5
  110. package/build/navigation/back-button/index.js.map +1 -1
  111. package/build/navigation/constants.js.map +1 -1
  112. package/build/navigation/context.js +7 -4
  113. package/build/navigation/context.js.map +1 -1
  114. package/build/navigation/group/context.js.map +1 -1
  115. package/build/navigation/group/index.js +5 -1
  116. package/build/navigation/group/index.js.map +1 -1
  117. package/build/navigation/index.js +49 -3
  118. package/build/navigation/index.js.map +1 -1
  119. package/build/navigation/item/base-content.js +0 -1
  120. package/build/navigation/item/base-content.js.map +1 -1
  121. package/build/navigation/item/base.js.map +1 -1
  122. package/build/navigation/item/index.js +5 -1
  123. package/build/navigation/item/index.js.map +1 -1
  124. package/build/navigation/item/use-navigation-tree-item.js +1 -1
  125. package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
  126. package/build/navigation/menu/context.js.map +1 -1
  127. package/build/navigation/menu/index.js +5 -1
  128. package/build/navigation/menu/index.js.map +1 -1
  129. package/build/navigation/menu/menu-title-search.js +8 -6
  130. package/build/navigation/menu/menu-title-search.js.map +1 -1
  131. package/build/navigation/menu/menu-title.js +4 -2
  132. package/build/navigation/menu/menu-title.js.map +1 -1
  133. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  134. package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  135. package/build/navigation/styles/navigation-styles.js +36 -36
  136. package/build/navigation/styles/navigation-styles.js.map +1 -1
  137. package/build/navigation/types.js +6 -0
  138. package/build/navigation/types.js.map +1 -0
  139. package/build/navigation/use-create-navigation-tree.js +7 -0
  140. package/build/navigation/use-create-navigation-tree.js.map +1 -1
  141. package/build/navigation/use-navigation-tree-nodes.js +3 -5
  142. package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
  143. package/build/navigation/utils.js.map +1 -1
  144. package/build/navigator/navigator-screen/component.js +5 -3
  145. package/build/navigator/navigator-screen/component.js.map +1 -1
  146. package/build/number-control/index.js +1 -3
  147. package/build/number-control/index.js.map +1 -1
  148. package/build/palette-edit/index.js +65 -26
  149. package/build/palette-edit/index.js.map +1 -1
  150. package/build/palette-edit/types.js +6 -0
  151. package/build/palette-edit/types.js.map +1 -0
  152. package/build/panel/body.js +15 -17
  153. package/build/panel/body.js.map +1 -1
  154. package/build/placeholder/index.js.map +1 -1
  155. package/build/query-controls/author-select.js +0 -4
  156. package/build/query-controls/author-select.js.map +1 -1
  157. package/build/query-controls/category-select.js +0 -4
  158. package/build/query-controls/category-select.js.map +1 -1
  159. package/build/query-controls/terms.js +30 -15
  160. package/build/query-controls/terms.js.map +1 -1
  161. package/build/range-control/index.js.map +1 -1
  162. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  163. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  164. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  165. package/build/responsive-wrapper/index.js +12 -13
  166. package/build/responsive-wrapper/index.js.map +1 -1
  167. package/build/sandbox/index.native.js +80 -67
  168. package/build/sandbox/index.native.js.map +1 -1
  169. package/build/select-control/index.js +19 -16
  170. package/build/select-control/index.js.map +1 -1
  171. package/build/tab-panel/index.js +1 -1
  172. package/build/tab-panel/index.js.map +1 -1
  173. package/build/toolbar/toolbar-button/index.js +32 -10
  174. package/build/toolbar/toolbar-button/index.js.map +1 -1
  175. package/build/toolbar/toolbar-button/toolbar-button-container.js +12 -4
  176. package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  177. package/build/toolbar/toolbar-button/types.js +6 -0
  178. package/build/toolbar/toolbar-button/types.js.map +1 -0
  179. package/build/toolbar/toolbar-context/index.js +4 -2
  180. package/build/toolbar/toolbar-context/index.js.map +1 -1
  181. package/build/tools-panel/tools-panel/hook.js +45 -6
  182. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  183. package/build/tooltip/index.js +18 -6
  184. package/build/tooltip/index.js.map +1 -1
  185. package/build/tree-select/index.js.map +1 -1
  186. package/build/ui/context/get-styled-class-name-from-key.js +2 -2
  187. package/build/ui/context/get-styled-class-name-from-key.js.map +1 -1
  188. package/build/utils/font.js +3 -7
  189. package/build/utils/font.js.map +1 -1
  190. package/build/utils/input/input-control.js +1 -1
  191. package/build/utils/input/input-control.js.map +1 -1
  192. package/build/v-stack/hook.js +2 -0
  193. package/build/v-stack/hook.js.map +1 -1
  194. package/build-module/angle-picker-control/angle-circle.js +1 -4
  195. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  196. package/build-module/angle-picker-control/index.js +12 -21
  197. package/build-module/angle-picker-control/index.js.map +1 -1
  198. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +20 -13
  199. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  200. package/build-module/animate/index.js +27 -17
  201. package/build-module/animate/index.js.map +1 -1
  202. package/build-module/animation/index.js.map +1 -1
  203. package/build-module/autocomplete/autocompleter-ui.js +6 -6
  204. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  205. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  206. package/build-module/autocomplete/index.js +28 -94
  207. package/build-module/autocomplete/index.js.map +1 -1
  208. package/build-module/autocomplete/types.js +2 -0
  209. package/build-module/box-control/axial-input-controls.js.map +1 -1
  210. package/build-module/color-picker/color-input.js +0 -4
  211. package/build-module/color-picker/color-input.js.map +1 -1
  212. package/build-module/color-picker/component.js +3 -3
  213. package/build-module/color-picker/component.js.map +1 -1
  214. package/build-module/color-picker/hex-input.js.map +1 -1
  215. package/build-module/color-picker/hsl-input.js.map +1 -1
  216. package/build-module/color-picker/input-with-slider.js.map +1 -1
  217. package/build-module/color-picker/legacy-adapter.js.map +1 -1
  218. package/build-module/color-picker/picker.js +4 -0
  219. package/build-module/color-picker/picker.js.map +1 -1
  220. package/build-module/color-picker/rgb-input.js.map +1 -1
  221. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  222. package/build-module/custom-gradient-picker/constants.js +1 -1
  223. package/build-module/custom-gradient-picker/constants.js.map +1 -1
  224. package/build-module/custom-gradient-picker/gradient-bar/constants.js.map +1 -1
  225. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +9 -3
  226. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  227. package/build-module/custom-gradient-picker/gradient-bar/index.js +14 -7
  228. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  229. package/build-module/custom-gradient-picker/gradient-bar/utils.js +34 -52
  230. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  231. package/build-module/custom-gradient-picker/index.js +44 -16
  232. package/build-module/custom-gradient-picker/index.js.map +1 -1
  233. package/build-module/custom-gradient-picker/serializer.js +14 -3
  234. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  235. package/build-module/custom-gradient-picker/styles/custom-gradient-picker-styles.js +6 -6
  236. package/build-module/custom-gradient-picker/styles/custom-gradient-picker-styles.js.map +1 -1
  237. package/build-module/custom-gradient-picker/types.js +2 -0
  238. package/build-module/custom-gradient-picker/types.js.map +1 -0
  239. package/build-module/custom-gradient-picker/utils.js +17 -10
  240. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  241. package/build-module/dimension-control/index.js +28 -3
  242. package/build-module/dimension-control/index.js.map +1 -1
  243. package/build-module/dimension-control/sizes.js +6 -5
  244. package/build-module/dimension-control/sizes.js.map +1 -1
  245. package/build-module/dimension-control/types.js +2 -0
  246. package/build-module/dimension-control/types.js.map +1 -0
  247. package/build-module/{color-list-picker → duotone-picker/color-list-picker}/index.js +5 -5
  248. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -0
  249. package/build-module/duotone-picker/color-list-picker/types.js +2 -0
  250. package/build-module/duotone-picker/color-list-picker/types.js.map +1 -0
  251. package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
  252. package/build-module/duotone-picker/duotone-picker.js +38 -2
  253. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  254. package/build-module/duotone-picker/duotone-swatch.js.map +1 -1
  255. package/build-module/duotone-picker/index.js.map +1 -1
  256. package/build-module/duotone-picker/types.js +2 -0
  257. package/build-module/duotone-picker/types.js.map +1 -0
  258. package/build-module/duotone-picker/utils.js +17 -11
  259. package/build-module/duotone-picker/utils.js.map +1 -1
  260. package/build-module/flex/flex/hook.js +3 -3
  261. package/build-module/flex/flex/hook.js.map +1 -1
  262. package/build-module/font-size-picker/index.js +2 -1
  263. package/build-module/font-size-picker/index.js.map +1 -1
  264. package/build-module/form-token-field/index.js +10 -5
  265. package/build-module/form-token-field/index.js.map +1 -1
  266. package/build-module/gradient-picker/index.js +61 -9
  267. package/build-module/gradient-picker/index.js.map +1 -1
  268. package/build-module/gradient-picker/types.js +2 -0
  269. package/build-module/gradient-picker/types.js.map +1 -0
  270. package/build-module/guide/icons.js.map +1 -1
  271. package/build-module/guide/index.js +45 -8
  272. package/build-module/guide/index.js.map +1 -1
  273. package/build-module/guide/page-control.js.map +1 -1
  274. package/build-module/guide/page.js +4 -0
  275. package/build-module/guide/page.js.map +1 -1
  276. package/build-module/guide/types.js +2 -0
  277. package/build-module/guide/types.js.map +1 -0
  278. package/build-module/h-stack/utils.js +5 -5
  279. package/build-module/h-stack/utils.js.map +1 -1
  280. package/build-module/higher-order/navigate-regions/index.js +33 -3
  281. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  282. package/build-module/higher-order/with-fallback-styles/index.js +2 -2
  283. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  284. package/build-module/higher-order/with-filters/index.js +31 -7
  285. package/build-module/higher-order/with-filters/index.js.map +1 -1
  286. package/build-module/higher-order/with-focus-return/index.js +10 -10
  287. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  288. package/build-module/higher-order/with-notices/index.js +29 -26
  289. package/build-module/higher-order/with-notices/index.js.map +1 -1
  290. package/build-module/higher-order/with-notices/types.js +2 -0
  291. package/build-module/higher-order/with-notices/types.js.map +1 -0
  292. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  293. package/build-module/icon/index.js +2 -9
  294. package/build-module/icon/index.js.map +1 -1
  295. package/build-module/index.native.js +1 -0
  296. package/build-module/index.native.js.map +1 -1
  297. package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
  298. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  299. package/build-module/mobile/bottom-sheet-text-control/index.native.js +4 -3
  300. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  301. package/build-module/navigation/back-button/index.js +4 -3
  302. package/build-module/navigation/back-button/index.js.map +1 -1
  303. package/build-module/navigation/constants.js.map +1 -1
  304. package/build-module/navigation/context.js +7 -4
  305. package/build-module/navigation/context.js.map +1 -1
  306. package/build-module/navigation/group/context.js +4 -0
  307. package/build-module/navigation/group/context.js.map +1 -1
  308. package/build-module/navigation/group/index.js +2 -1
  309. package/build-module/navigation/group/index.js.map +1 -1
  310. package/build-module/navigation/index.js +46 -3
  311. package/build-module/navigation/index.js.map +1 -1
  312. package/build-module/navigation/item/base-content.js +0 -1
  313. package/build-module/navigation/item/base-content.js.map +1 -1
  314. package/build-module/navigation/item/base.js.map +1 -1
  315. package/build-module/navigation/item/index.js +2 -1
  316. package/build-module/navigation/item/index.js.map +1 -1
  317. package/build-module/navigation/item/use-navigation-tree-item.js +1 -1
  318. package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
  319. package/build-module/navigation/menu/context.js +4 -0
  320. package/build-module/navigation/menu/context.js.map +1 -1
  321. package/build-module/navigation/menu/index.js +2 -1
  322. package/build-module/navigation/menu/index.js.map +1 -1
  323. package/build-module/navigation/menu/menu-title-search.js +8 -6
  324. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  325. package/build-module/navigation/menu/menu-title.js +4 -2
  326. package/build-module/navigation/menu/menu-title.js.map +1 -1
  327. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  328. package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  329. package/build-module/navigation/styles/navigation-styles.js +36 -36
  330. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  331. package/build-module/navigation/types.js +2 -0
  332. package/build-module/navigation/types.js.map +1 -0
  333. package/build-module/navigation/use-create-navigation-tree.js +7 -0
  334. package/build-module/navigation/use-create-navigation-tree.js.map +1 -1
  335. package/build-module/navigation/use-navigation-tree-nodes.js +2 -2
  336. package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
  337. package/build-module/navigation/utils.js.map +1 -1
  338. package/build-module/navigator/navigator-screen/component.js +5 -3
  339. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  340. package/build-module/number-control/index.js +1 -3
  341. package/build-module/number-control/index.js.map +1 -1
  342. package/build-module/palette-edit/index.js +63 -26
  343. package/build-module/palette-edit/index.js.map +1 -1
  344. package/build-module/palette-edit/types.js +2 -0
  345. package/build-module/palette-edit/types.js.map +1 -0
  346. package/build-module/panel/body.js +12 -12
  347. package/build-module/panel/body.js.map +1 -1
  348. package/build-module/placeholder/index.js.map +1 -1
  349. package/build-module/query-controls/author-select.js +0 -4
  350. package/build-module/query-controls/author-select.js.map +1 -1
  351. package/build-module/query-controls/category-select.js +1 -5
  352. package/build-module/query-controls/category-select.js.map +1 -1
  353. package/build-module/query-controls/terms.js +29 -16
  354. package/build-module/query-controls/terms.js.map +1 -1
  355. package/build-module/range-control/index.js.map +1 -1
  356. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
  357. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  358. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  359. package/build-module/responsive-wrapper/index.js +12 -12
  360. package/build-module/responsive-wrapper/index.js.map +1 -1
  361. package/build-module/sandbox/index.native.js +70 -58
  362. package/build-module/sandbox/index.native.js.map +1 -1
  363. package/build-module/select-control/index.js +20 -17
  364. package/build-module/select-control/index.js.map +1 -1
  365. package/build-module/tab-panel/index.js +2 -2
  366. package/build-module/tab-panel/index.js.map +1 -1
  367. package/build-module/toolbar/toolbar-button/index.js +32 -9
  368. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  369. package/build-module/toolbar/toolbar-button/toolbar-button-container.js +12 -4
  370. package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  371. package/build-module/toolbar/toolbar-button/types.js +2 -0
  372. package/build-module/toolbar/toolbar-button/types.js.map +1 -0
  373. package/build-module/toolbar/toolbar-context/index.js +4 -2
  374. package/build-module/toolbar/toolbar-context/index.js.map +1 -1
  375. package/build-module/tools-panel/tools-panel/hook.js +45 -6
  376. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  377. package/build-module/tooltip/index.js +16 -6
  378. package/build-module/tooltip/index.js.map +1 -1
  379. package/build-module/tree-select/index.js.map +1 -1
  380. package/build-module/ui/context/get-styled-class-name-from-key.js +1 -1
  381. package/build-module/ui/context/get-styled-class-name-from-key.js.map +1 -1
  382. package/build-module/utils/font.js +3 -6
  383. package/build-module/utils/font.js.map +1 -1
  384. package/build-module/utils/input/input-control.js +1 -1
  385. package/build-module/utils/input/input-control.js.map +1 -1
  386. package/build-module/v-stack/hook.js +2 -0
  387. package/build-module/v-stack/hook.js.map +1 -1
  388. package/build-style/style-rtl.css +54 -39
  389. package/build-style/style.css +56 -39
  390. package/build-types/alignment-matrix-control/types.d.ts +4 -4
  391. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  392. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  393. package/build-types/angle-picker-control/index.d.ts.map +1 -1
  394. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +5 -0
  395. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  396. package/build-types/angle-picker-control/types.d.ts +2 -2
  397. package/build-types/angle-picker-control/types.d.ts.map +1 -1
  398. package/build-types/animate/index.d.ts +27 -22
  399. package/build-types/animate/index.d.ts.map +1 -1
  400. package/build-types/animate/stories/index.d.ts +18 -0
  401. package/build-types/animate/stories/index.d.ts.map +1 -0
  402. package/build-types/animate/types.d.ts +30 -0
  403. package/build-types/animate/types.d.ts.map +1 -0
  404. package/build-types/animation/index.d.ts +8 -1
  405. package/build-types/animation/index.d.ts.map +1 -1
  406. package/build-types/autocomplete/autocompleter-ui.d.ts +4 -0
  407. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -0
  408. package/build-types/autocomplete/get-default-use-items.d.ts +3 -0
  409. package/build-types/autocomplete/get-default-use-items.d.ts.map +1 -0
  410. package/build-types/autocomplete/index.d.ts +23 -0
  411. package/build-types/autocomplete/index.d.ts.map +1 -0
  412. package/build-types/autocomplete/test/index.d.ts +2 -0
  413. package/build-types/autocomplete/test/index.d.ts.map +1 -0
  414. package/build-types/autocomplete/types.d.ts +201 -0
  415. package/build-types/autocomplete/types.d.ts.map +1 -0
  416. package/build-types/base-control/types.d.ts +2 -2
  417. package/build-types/base-control/types.d.ts.map +1 -1
  418. package/build-types/border-box-control/border-box-control/hook.d.ts +1 -1
  419. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  420. package/build-types/border-box-control/styles.d.ts +3 -3
  421. package/build-types/border-box-control/styles.d.ts.map +1 -1
  422. package/build-types/border-box-control/types.d.ts +8 -8
  423. package/build-types/border-box-control/types.d.ts.map +1 -1
  424. package/build-types/border-box-control/utils.d.ts +5 -5
  425. package/build-types/border-box-control/utils.d.ts.map +1 -1
  426. package/build-types/border-control/border-control/hook.d.ts +3 -3
  427. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  428. package/build-types/border-control/border-control-dropdown/hook.d.ts +2 -2
  429. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  430. package/build-types/border-control/styles.d.ts +4 -4
  431. package/build-types/border-control/styles.d.ts.map +1 -1
  432. package/build-types/border-control/types.d.ts +6 -6
  433. package/build-types/border-control/types.d.ts.map +1 -1
  434. package/build-types/box-control/types.d.ts +6 -6
  435. package/build-types/box-control/types.d.ts.map +1 -1
  436. package/build-types/button/deprecated.d.ts +6 -6
  437. package/build-types/button/types.d.ts +10 -10
  438. package/build-types/button/types.d.ts.map +1 -1
  439. package/build-types/button-group/types.d.ts +1 -1
  440. package/build-types/button-group/types.d.ts.map +1 -1
  441. package/build-types/card/card/hook.d.ts +1 -1
  442. package/build-types/card/card/hook.d.ts.map +1 -1
  443. package/build-types/card/types.d.ts +10 -10
  444. package/build-types/card/types.d.ts.map +1 -1
  445. package/build-types/checkbox-control/types.d.ts +1 -1
  446. package/build-types/checkbox-control/types.d.ts.map +1 -1
  447. package/build-types/circular-option-picker/types.d.ts +4 -4
  448. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  449. package/build-types/color-indicator/types.d.ts +1 -1
  450. package/build-types/color-indicator/types.d.ts.map +1 -1
  451. package/build-types/color-palette/types.d.ts +7 -7
  452. package/build-types/color-palette/types.d.ts.map +1 -1
  453. package/build-types/color-palette/utils.d.ts +1 -1
  454. package/build-types/color-palette/utils.d.ts.map +1 -1
  455. package/build-types/color-picker/color-input.d.ts +1 -11
  456. package/build-types/color-picker/color-input.d.ts.map +1 -1
  457. package/build-types/color-picker/component.d.ts +8 -9
  458. package/build-types/color-picker/component.d.ts.map +1 -1
  459. package/build-types/color-picker/hex-input.d.ts +1 -10
  460. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  461. package/build-types/color-picker/hsl-input.d.ts +1 -10
  462. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  463. package/build-types/color-picker/input-with-slider.d.ts +1 -9
  464. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  465. package/build-types/color-picker/legacy-adapter.d.ts +1 -3
  466. package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
  467. package/build-types/color-picker/picker.d.ts +4 -7
  468. package/build-types/color-picker/picker.d.ts.map +1 -1
  469. package/build-types/color-picker/rgb-input.d.ts +1 -10
  470. package/build-types/color-picker/rgb-input.d.ts.map +1 -1
  471. package/build-types/color-picker/stories/index.d.ts +19 -0
  472. package/build-types/color-picker/stories/index.d.ts.map +1 -0
  473. package/build-types/color-picker/styles.d.ts +3 -3
  474. package/build-types/color-picker/test/index.d.ts +2 -0
  475. package/build-types/color-picker/test/index.d.ts.map +1 -0
  476. package/build-types/color-picker/types.d.ts +107 -3
  477. package/build-types/color-picker/types.d.ts.map +1 -1
  478. package/build-types/color-picker/use-deprecated-props.d.ts +1 -44
  479. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  480. package/build-types/combobox-control/types.d.ts +2 -2
  481. package/build-types/combobox-control/types.d.ts.map +1 -1
  482. package/build-types/confirm-dialog/component.d.ts +4 -4
  483. package/build-types/confirm-dialog/types.d.ts +5 -5
  484. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  485. package/build-types/custom-gradient-picker/constants.d.ts +25 -0
  486. package/build-types/custom-gradient-picker/constants.d.ts.map +1 -0
  487. package/build-types/custom-gradient-picker/gradient-bar/constants.d.ts +8 -0
  488. package/build-types/custom-gradient-picker/gradient-bar/constants.d.ts.map +1 -0
  489. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +8 -0
  490. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -0
  491. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +4 -0
  492. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -0
  493. package/build-types/custom-gradient-picker/gradient-bar/test/utils.d.ts +2 -0
  494. package/build-types/custom-gradient-picker/gradient-bar/test/utils.d.ts.map +1 -0
  495. package/build-types/custom-gradient-picker/gradient-bar/utils.d.ts +90 -0
  496. package/build-types/custom-gradient-picker/gradient-bar/utils.d.ts.map +1 -0
  497. package/build-types/custom-gradient-picker/index.d.ts +28 -0
  498. package/build-types/custom-gradient-picker/index.d.ts.map +1 -0
  499. package/build-types/custom-gradient-picker/serializer.d.ts +14 -0
  500. package/build-types/custom-gradient-picker/serializer.d.ts.map +1 -0
  501. package/build-types/custom-gradient-picker/stories/index.d.ts +12 -0
  502. package/build-types/custom-gradient-picker/stories/index.d.ts.map +1 -0
  503. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +12 -0
  504. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts.map +1 -0
  505. package/build-types/custom-gradient-picker/test/serializer.d.ts +2 -0
  506. package/build-types/custom-gradient-picker/test/serializer.d.ts.map +1 -0
  507. package/build-types/custom-gradient-picker/types.d.ts +120 -0
  508. package/build-types/custom-gradient-picker/types.d.ts.map +1 -0
  509. package/build-types/custom-gradient-picker/utils.d.ts +13 -0
  510. package/build-types/custom-gradient-picker/utils.d.ts.map +1 -0
  511. package/build-types/custom-select-control/styles.d.ts +1 -1
  512. package/build-types/custom-select-control/styles.d.ts.map +1 -1
  513. package/build-types/dashicon/types.d.ts +2 -2
  514. package/build-types/dashicon/types.d.ts.map +1 -1
  515. package/build-types/date-time/date-time/styles.d.ts +1 -4
  516. package/build-types/date-time/date-time/styles.d.ts.map +1 -1
  517. package/build-types/date-time/time/styles.d.ts +1 -1
  518. package/build-types/date-time/types.d.ts +4 -4
  519. package/build-types/date-time/types.d.ts.map +1 -1
  520. package/build-types/dimension-control/index.d.ts +28 -0
  521. package/build-types/dimension-control/index.d.ts.map +1 -0
  522. package/build-types/dimension-control/sizes.d.ts +26 -0
  523. package/build-types/dimension-control/sizes.d.ts.map +1 -0
  524. package/build-types/dimension-control/stories/index.d.ts +12 -0
  525. package/build-types/dimension-control/stories/index.d.ts.map +1 -0
  526. package/build-types/dimension-control/types.d.ts +47 -0
  527. package/build-types/dimension-control/types.d.ts.map +1 -0
  528. package/build-types/divider/types.d.ts +1 -1
  529. package/build-types/divider/types.d.ts.map +1 -1
  530. package/build-types/draggable/types.d.ts +1 -1
  531. package/build-types/draggable/types.d.ts.map +1 -1
  532. package/build-types/drop-zone/types.d.ts +2 -2
  533. package/build-types/drop-zone/types.d.ts.map +1 -1
  534. package/build-types/dropdown/types.d.ts +3 -3
  535. package/build-types/dropdown/types.d.ts.map +1 -1
  536. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -0
  537. package/build-types/{color-list-picker → duotone-picker/color-list-picker}/types.d.ts +4 -4
  538. package/build-types/duotone-picker/color-list-picker/types.d.ts.map +1 -0
  539. package/build-types/duotone-picker/custom-duotone-bar.d.ts +6 -0
  540. package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -0
  541. package/build-types/duotone-picker/duotone-picker.d.ts +38 -0
  542. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -0
  543. package/build-types/duotone-picker/duotone-swatch.d.ts +5 -0
  544. package/build-types/duotone-picker/duotone-swatch.d.ts.map +1 -0
  545. package/build-types/duotone-picker/index.d.ts +3 -0
  546. package/build-types/duotone-picker/index.d.ts.map +1 -0
  547. package/build-types/duotone-picker/stories/duotone-picker.d.ts +12 -0
  548. package/build-types/duotone-picker/stories/duotone-picker.d.ts.map +1 -0
  549. package/build-types/duotone-picker/stories/duotone-swatch.d.ts +14 -0
  550. package/build-types/duotone-picker/stories/duotone-swatch.d.ts.map +1 -0
  551. package/build-types/duotone-picker/types.d.ts +60 -0
  552. package/build-types/duotone-picker/types.d.ts.map +1 -0
  553. package/build-types/duotone-picker/utils.d.ts +52 -0
  554. package/build-types/duotone-picker/utils.d.ts.map +1 -0
  555. package/build-types/elevation/types.d.ts +1 -1
  556. package/build-types/elevation/types.d.ts.map +1 -1
  557. package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
  558. package/build-types/external-link/types.d.ts +1 -1
  559. package/build-types/external-link/types.d.ts.map +1 -1
  560. package/build-types/flex/types.d.ts +4 -4
  561. package/build-types/flex/types.d.ts.map +1 -1
  562. package/build-types/focal-point-picker/types.d.ts +7 -7
  563. package/build-types/focal-point-picker/types.d.ts.map +1 -1
  564. package/build-types/font-size-picker/index.d.ts.map +1 -1
  565. package/build-types/font-size-picker/stories/index.d.ts.map +1 -1
  566. package/build-types/font-size-picker/types.d.ts +9 -5
  567. package/build-types/font-size-picker/types.d.ts.map +1 -1
  568. package/build-types/form-file-upload/types.d.ts +1 -1
  569. package/build-types/form-file-upload/types.d.ts.map +1 -1
  570. package/build-types/form-toggle/types.d.ts +1 -1
  571. package/build-types/form-toggle/types.d.ts.map +1 -1
  572. package/build-types/form-token-field/index.d.ts.map +1 -1
  573. package/build-types/form-token-field/stories/index.d.ts +6 -0
  574. package/build-types/form-token-field/stories/index.d.ts.map +1 -1
  575. package/build-types/form-token-field/styles.d.ts +1 -1
  576. package/build-types/form-token-field/styles.d.ts.map +1 -1
  577. package/build-types/form-token-field/types.d.ts +7 -1
  578. package/build-types/form-token-field/types.d.ts.map +1 -1
  579. package/build-types/gradient-picker/index.d.ts +50 -0
  580. package/build-types/gradient-picker/index.d.ts.map +1 -0
  581. package/build-types/gradient-picker/stories/index.d.ts +14 -0
  582. package/build-types/gradient-picker/stories/index.d.ts.map +1 -0
  583. package/build-types/gradient-picker/types.d.ts +87 -0
  584. package/build-types/gradient-picker/types.d.ts.map +1 -0
  585. package/build-types/grid/types.d.ts +2 -2
  586. package/build-types/grid/types.d.ts.map +1 -1
  587. package/build-types/guide/icons.d.ts +5 -0
  588. package/build-types/guide/icons.d.ts.map +1 -0
  589. package/build-types/guide/index.d.ts +37 -0
  590. package/build-types/guide/index.d.ts.map +1 -0
  591. package/build-types/guide/page-control.d.ts +4 -0
  592. package/build-types/guide/page-control.d.ts.map +1 -0
  593. package/build-types/guide/page.d.ts +7 -0
  594. package/build-types/guide/page.d.ts.map +1 -0
  595. package/build-types/guide/stories/index.d.ts +9 -0
  596. package/build-types/guide/stories/index.d.ts.map +1 -0
  597. package/build-types/guide/test/index.d.ts +2 -0
  598. package/build-types/guide/test/index.d.ts.map +1 -0
  599. package/build-types/guide/types.d.ts +65 -0
  600. package/build-types/guide/types.d.ts.map +1 -0
  601. package/build-types/h-stack/types.d.ts +6 -6
  602. package/build-types/h-stack/types.d.ts.map +1 -1
  603. package/build-types/heading/hook.d.ts +1 -1
  604. package/build-types/heading/types.d.ts +2 -2
  605. package/build-types/heading/types.d.ts.map +1 -1
  606. package/build-types/higher-order/navigate-regions/index.d.ts +46 -0
  607. package/build-types/higher-order/navigate-regions/index.d.ts.map +1 -0
  608. package/build-types/higher-order/with-fallback-styles/index.d.ts +44 -0
  609. package/build-types/higher-order/with-fallback-styles/index.d.ts.map +1 -0
  610. package/build-types/higher-order/with-filters/index.d.ts +89 -0
  611. package/build-types/higher-order/with-filters/index.d.ts.map +1 -0
  612. package/build-types/higher-order/with-filters/test/index.d.ts +2 -0
  613. package/build-types/higher-order/with-filters/test/index.d.ts.map +1 -0
  614. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  615. package/build-types/higher-order/with-focus-return/index.d.ts +20 -0
  616. package/build-types/higher-order/with-focus-return/index.d.ts.map +1 -0
  617. package/build-types/higher-order/with-focus-return/test/index.d.ts +2 -0
  618. package/build-types/higher-order/with-focus-return/test/index.d.ts.map +1 -0
  619. package/build-types/higher-order/with-notices/index.d.ts +37 -0
  620. package/build-types/higher-order/with-notices/index.d.ts.map +1 -0
  621. package/build-types/higher-order/with-notices/test/index.d.ts +2 -0
  622. package/build-types/higher-order/with-notices/test/index.d.ts.map +1 -0
  623. package/build-types/higher-order/with-notices/types.d.ts +34 -0
  624. package/build-types/higher-order/with-notices/types.d.ts.map +1 -0
  625. package/build-types/higher-order/with-spoken-messages/index.d.ts +13 -2
  626. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
  627. package/build-types/higher-order/with-spoken-messages/test/index.d.ts +2 -0
  628. package/build-types/higher-order/with-spoken-messages/test/index.d.ts.map +1 -0
  629. package/build-types/icon/index.d.ts +10 -6
  630. package/build-types/icon/index.d.ts.map +1 -1
  631. package/build-types/icon/test/index.d.ts +2 -0
  632. package/build-types/icon/test/index.d.ts.map +1 -0
  633. package/build-types/input-control/reducer/actions.d.ts +15 -15
  634. package/build-types/input-control/reducer/actions.d.ts.map +1 -1
  635. package/build-types/input-control/reducer/state.d.ts +1 -1
  636. package/build-types/input-control/reducer/state.d.ts.map +1 -1
  637. package/build-types/input-control/styles/input-control-styles.d.ts +4 -4
  638. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  639. package/build-types/input-control/types.d.ts +7 -7
  640. package/build-types/input-control/types.d.ts.map +1 -1
  641. package/build-types/item-group/item/hook.d.ts +1 -1
  642. package/build-types/item-group/types.d.ts +2 -2
  643. package/build-types/item-group/types.d.ts.map +1 -1
  644. package/build-types/keyboard-shortcuts/types.d.ts +3 -3
  645. package/build-types/keyboard-shortcuts/types.d.ts.map +1 -1
  646. package/build-types/menu-group/types.d.ts +1 -1
  647. package/build-types/menu-group/types.d.ts.map +1 -1
  648. package/build-types/menu-item/index.d.ts +1 -1
  649. package/build-types/menu-items-choice/types.d.ts +2 -2
  650. package/build-types/menu-items-choice/types.d.ts.map +1 -1
  651. package/build-types/modal/types.d.ts +1 -1
  652. package/build-types/modal/types.d.ts.map +1 -1
  653. package/build-types/navigable-container/container.d.ts +1 -1
  654. package/build-types/navigable-container/menu.d.ts +1 -1
  655. package/build-types/navigable-container/tabbable.d.ts +1 -1
  656. package/build-types/navigation/back-button/index.d.ts +5 -0
  657. package/build-types/navigation/back-button/index.d.ts.map +1 -0
  658. package/build-types/navigation/constants.d.ts +3 -0
  659. package/build-types/navigation/constants.d.ts.map +1 -0
  660. package/build-types/navigation/context.d.ts +5 -0
  661. package/build-types/navigation/context.d.ts.map +1 -0
  662. package/build-types/navigation/group/context.d.ts +8 -0
  663. package/build-types/navigation/group/context.d.ts.map +1 -0
  664. package/build-types/navigation/group/index.d.ts +5 -0
  665. package/build-types/navigation/group/index.d.ts.map +1 -0
  666. package/build-types/navigation/index.d.ts +46 -0
  667. package/build-types/navigation/index.d.ts.map +1 -0
  668. package/build-types/navigation/item/base-content.d.ts +4 -0
  669. package/build-types/navigation/item/base-content.d.ts.map +1 -0
  670. package/build-types/navigation/item/base.d.ts +4 -0
  671. package/build-types/navigation/item/base.d.ts.map +1 -0
  672. package/build-types/navigation/item/index.d.ts +5 -0
  673. package/build-types/navigation/item/index.d.ts.map +1 -0
  674. package/build-types/navigation/item/use-navigation-tree-item.d.ts +3 -0
  675. package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +1 -0
  676. package/build-types/navigation/menu/context.d.ts +8 -0
  677. package/build-types/navigation/menu/context.d.ts.map +1 -0
  678. package/build-types/navigation/menu/index.d.ts +5 -0
  679. package/build-types/navigation/menu/index.d.ts.map +1 -0
  680. package/build-types/navigation/menu/menu-title-search.d.ts +4 -0
  681. package/build-types/navigation/menu/menu-title-search.d.ts.map +1 -0
  682. package/build-types/navigation/menu/menu-title.d.ts +4 -0
  683. package/build-types/navigation/menu/menu-title.d.ts.map +1 -0
  684. package/build-types/navigation/menu/search-no-results-found.d.ts +4 -0
  685. package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -0
  686. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +3 -0
  687. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +1 -0
  688. package/build-types/navigation/stories/index.d.ts +18 -0
  689. package/build-types/navigation/stories/index.d.ts.map +1 -0
  690. package/build-types/navigation/stories/utils/controlled-state.d.ts +7 -0
  691. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -0
  692. package/build-types/navigation/stories/utils/default.d.ts +10 -0
  693. package/build-types/navigation/stories/utils/default.d.ts.map +1 -0
  694. package/build-types/navigation/stories/utils/group.d.ts +10 -0
  695. package/build-types/navigation/stories/utils/group.d.ts.map +1 -0
  696. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +10 -0
  697. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -0
  698. package/build-types/navigation/stories/utils/more-examples.d.ts +10 -0
  699. package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -0
  700. package/build-types/navigation/stories/utils/search.d.ts +10 -0
  701. package/build-types/navigation/stories/utils/search.d.ts.map +1 -0
  702. package/build-types/navigation/styles/navigation-styles.d.ts +58 -0
  703. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -0
  704. package/build-types/navigation/test/index.d.ts +2 -0
  705. package/build-types/navigation/test/index.d.ts.map +1 -0
  706. package/build-types/navigation/types.d.ts +267 -0
  707. package/build-types/navigation/types.d.ts.map +1 -0
  708. package/build-types/navigation/use-create-navigation-tree.d.ts +15 -0
  709. package/build-types/navigation/use-create-navigation-tree.d.ts.map +1 -0
  710. package/build-types/navigation/use-navigation-tree-nodes.d.ts +11 -0
  711. package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +1 -0
  712. package/build-types/navigation/utils.d.ts +3 -0
  713. package/build-types/navigation/utils.d.ts.map +1 -0
  714. package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
  715. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
  716. package/build-types/navigator/navigator-button/component.d.ts +1 -1
  717. package/build-types/navigator/navigator-button/hook.d.ts +1 -1
  718. package/build-types/navigator/navigator-screen/component.d.ts +1 -1
  719. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  720. package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -1
  721. package/build-types/navigator/types.d.ts +12 -12
  722. package/build-types/navigator/types.d.ts.map +1 -1
  723. package/build-types/notice/types.d.ts +7 -7
  724. package/build-types/notice/types.d.ts.map +1 -1
  725. package/build-types/number-control/index.d.ts.map +1 -1
  726. package/build-types/number-control/types.d.ts +1 -1
  727. package/build-types/number-control/types.d.ts.map +1 -1
  728. package/build-types/palette-edit/index.d.ts +37 -0
  729. package/build-types/palette-edit/index.d.ts.map +1 -0
  730. package/build-types/palette-edit/stories/index.d.ts +13 -0
  731. package/build-types/palette-edit/stories/index.d.ts.map +1 -0
  732. package/build-types/palette-edit/styles.d.ts +51 -0
  733. package/build-types/palette-edit/styles.d.ts.map +1 -0
  734. package/build-types/palette-edit/test/index.d.ts +2 -0
  735. package/build-types/palette-edit/test/index.d.ts.map +1 -0
  736. package/build-types/palette-edit/types.d.ts +114 -0
  737. package/build-types/palette-edit/types.d.ts.map +1 -0
  738. package/build-types/panel/body.d.ts +9 -0
  739. package/build-types/panel/body.d.ts.map +1 -0
  740. package/build-types/panel/stories/index.d.ts +19 -0
  741. package/build-types/panel/stories/index.d.ts.map +1 -0
  742. package/build-types/panel/test/body.d.ts +2 -0
  743. package/build-types/panel/test/body.d.ts.map +1 -0
  744. package/build-types/panel/types.d.ts +73 -3
  745. package/build-types/panel/types.d.ts.map +1 -1
  746. package/build-types/placeholder/index.d.ts +1 -1
  747. package/build-types/placeholder/index.d.ts.map +1 -1
  748. package/build-types/placeholder/types.d.ts +2 -2
  749. package/build-types/placeholder/types.d.ts.map +1 -1
  750. package/build-types/popover/limit-shift.d.ts +2 -2
  751. package/build-types/popover/limit-shift.d.ts.map +1 -1
  752. package/build-types/popover/types.d.ts +10 -10
  753. package/build-types/popover/types.d.ts.map +1 -1
  754. package/build-types/popover/utils.d.ts +2 -2
  755. package/build-types/popover/utils.d.ts.map +1 -1
  756. package/build-types/query-controls/author-select.d.ts.map +1 -1
  757. package/build-types/query-controls/category-select.d.ts.map +1 -1
  758. package/build-types/query-controls/terms.d.ts.map +1 -1
  759. package/build-types/query-controls/types.d.ts +12 -12
  760. package/build-types/query-controls/types.d.ts.map +1 -1
  761. package/build-types/radio-control/types.d.ts +1 -1
  762. package/build-types/radio-control/types.d.ts.map +1 -1
  763. package/build-types/radio-group/index.d.ts +1 -1
  764. package/build-types/radio-group/radio/index.d.ts +1 -1
  765. package/build-types/range-control/index.d.ts +2 -2
  766. package/build-types/range-control/index.d.ts.map +1 -1
  767. package/build-types/range-control/types.d.ts +17 -17
  768. package/build-types/range-control/types.d.ts.map +1 -1
  769. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  770. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  771. package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
  772. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  773. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  774. package/build-types/resizable-box/resize-tooltip/utils.d.ts +2 -2
  775. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  776. package/build-types/responsive-wrapper/index.d.ts.map +1 -1
  777. package/build-types/responsive-wrapper/stories/index.d.ts +10 -0
  778. package/build-types/responsive-wrapper/stories/index.d.ts.map +1 -1
  779. package/build-types/responsive-wrapper/types.d.ts +3 -3
  780. package/build-types/responsive-wrapper/types.d.ts.map +1 -1
  781. package/build-types/sandbox/types.d.ts +1 -1
  782. package/build-types/sandbox/types.d.ts.map +1 -1
  783. package/build-types/scrollable/types.d.ts +2 -2
  784. package/build-types/scrollable/types.d.ts.map +1 -1
  785. package/build-types/search-control/types.d.ts +1 -1
  786. package/build-types/search-control/types.d.ts.map +1 -1
  787. package/build-types/select-control/index.d.ts +2 -1
  788. package/build-types/select-control/index.d.ts.map +1 -1
  789. package/build-types/select-control/stories/index.d.ts +3 -3
  790. package/build-types/select-control/stories/index.d.ts.map +1 -1
  791. package/build-types/select-control/types.d.ts +44 -20
  792. package/build-types/select-control/types.d.ts.map +1 -1
  793. package/build-types/shortcut/types.d.ts +1 -1
  794. package/build-types/shortcut/types.d.ts.map +1 -1
  795. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
  796. package/build-types/slot-fill/provider.d.ts +1 -0
  797. package/build-types/slot-fill/provider.d.ts.map +1 -1
  798. package/build-types/snackbar/types.d.ts +3 -3
  799. package/build-types/snackbar/types.d.ts.map +1 -1
  800. package/build-types/spacer/types.d.ts +1 -1
  801. package/build-types/spacer/types.d.ts.map +1 -1
  802. package/build-types/spinner/index.d.ts +1 -1
  803. package/build-types/style-provider/types.d.ts +1 -1
  804. package/build-types/style-provider/types.d.ts.map +1 -1
  805. package/build-types/surface/types.d.ts +2 -2
  806. package/build-types/surface/types.d.ts.map +1 -1
  807. package/build-types/tab-panel/index.d.ts.map +1 -1
  808. package/build-types/tab-panel/types.d.ts +5 -5
  809. package/build-types/tab-panel/types.d.ts.map +1 -1
  810. package/build-types/text/types.d.ts +3 -3
  811. package/build-types/text/types.d.ts.map +1 -1
  812. package/build-types/text-control/types.d.ts +1 -1
  813. package/build-types/text-control/types.d.ts.map +1 -1
  814. package/build-types/text-highlight/types.d.ts +1 -1
  815. package/build-types/text-highlight/types.d.ts.map +1 -1
  816. package/build-types/textarea-control/types.d.ts +1 -1
  817. package/build-types/textarea-control/types.d.ts.map +1 -1
  818. package/build-types/theme/types.d.ts +3 -3
  819. package/build-types/theme/types.d.ts.map +1 -1
  820. package/build-types/tip/types.d.ts +1 -1
  821. package/build-types/tip/types.d.ts.map +1 -1
  822. package/build-types/toggle-control/types.d.ts +1 -1
  823. package/build-types/toggle-control/types.d.ts.map +1 -1
  824. package/build-types/toggle-group-control/types.d.ts +10 -10
  825. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  826. package/build-types/toolbar/toolbar/types.d.ts +1 -1
  827. package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
  828. package/build-types/toolbar/toolbar-button/index.d.ts +165 -11
  829. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  830. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +6 -1
  831. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
  832. package/build-types/toolbar/toolbar-button/types.d.ts +45 -0
  833. package/build-types/toolbar/toolbar-button/types.d.ts.map +1 -0
  834. package/build-types/toolbar/toolbar-context/index.d.ts +6 -1
  835. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
  836. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +1 -1
  837. package/build-types/toolbar/toolbar-item/index.d.ts +1 -1
  838. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  839. package/build-types/tools-panel/types.d.ts +12 -11
  840. package/build-types/tools-panel/types.d.ts.map +1 -1
  841. package/build-types/tooltip/index.d.ts.map +1 -1
  842. package/build-types/tree-grid/types.d.ts +5 -5
  843. package/build-types/tree-grid/types.d.ts.map +1 -1
  844. package/build-types/tree-select/index.d.ts.map +1 -1
  845. package/build-types/tree-select/types.d.ts +4 -10
  846. package/build-types/tree-select/types.d.ts.map +1 -1
  847. package/build-types/truncate/types.d.ts +2 -2
  848. package/build-types/truncate/types.d.ts.map +1 -1
  849. package/build-types/ui/context/context-connect.d.ts +1 -1
  850. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  851. package/build-types/ui/context/wordpress-component.d.ts +3 -3
  852. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  853. package/build-types/ui/control-group/types.d.ts +2 -2
  854. package/build-types/ui/control-group/types.d.ts.map +1 -1
  855. package/build-types/ui/control-label/types.d.ts +1 -1
  856. package/build-types/ui/control-label/types.d.ts.map +1 -1
  857. package/build-types/ui/form-group/form-group-content.d.ts +1 -1
  858. package/build-types/ui/form-group/form-group-help.d.ts +1 -1
  859. package/build-types/ui/form-group/form-group-label.d.ts +1 -1
  860. package/build-types/ui/form-group/types.d.ts +5 -5
  861. package/build-types/ui/form-group/types.d.ts.map +1 -1
  862. package/build-types/ui/form-group/use-form-group.d.ts +3 -3
  863. package/build-types/ui/spinner/component.d.ts +1 -1
  864. package/build-types/ui/tooltip/content.d.ts +1 -1
  865. package/build-types/ui/tooltip/types.d.ts +2 -2
  866. package/build-types/ui/tooltip/types.d.ts.map +1 -1
  867. package/build-types/ui/utils/font-size.d.ts +1 -1
  868. package/build-types/ui/utils/font-size.d.ts.map +1 -1
  869. package/build-types/ui/utils/space.d.ts +1 -1
  870. package/build-types/ui/utils/space.d.ts.map +1 -1
  871. package/build-types/ui/utils/types.d.ts +4 -4
  872. package/build-types/ui/utils/types.d.ts.map +1 -1
  873. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  874. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  875. package/build-types/unit-control/types.d.ts +5 -5
  876. package/build-types/unit-control/types.d.ts.map +1 -1
  877. package/build-types/utils/breakpoint-values.d.ts +1 -1
  878. package/build-types/utils/colors-values.d.ts +1 -1
  879. package/build-types/utils/config-values.d.ts +9 -9
  880. package/build-types/utils/events.d.ts +1 -1
  881. package/build-types/utils/events.d.ts.map +1 -1
  882. package/build-types/utils/font-values.d.ts +1 -1
  883. package/build-types/utils/font.d.ts.map +1 -1
  884. package/build-types/utils/hooks/use-controlled-value.d.ts +1 -1
  885. package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
  886. package/build-types/utils/input/input-control.d.ts.map +1 -1
  887. package/build-types/utils/types.d.ts +4 -4
  888. package/build-types/utils/types.d.ts.map +1 -1
  889. package/build-types/v-stack/component.d.ts +1 -4
  890. package/build-types/v-stack/component.d.ts.map +1 -1
  891. package/build-types/v-stack/hook.d.ts.map +1 -1
  892. package/build-types/v-stack/stories/index.d.ts +1 -4
  893. package/build-types/v-stack/stories/index.d.ts.map +1 -1
  894. package/build-types/v-stack/types.d.ts +5 -3
  895. package/build-types/v-stack/types.d.ts.map +1 -1
  896. package/build-types/view/types.d.ts +1 -1
  897. package/build-types/view/types.d.ts.map +1 -1
  898. package/build-types/visually-hidden/types.d.ts +1 -1
  899. package/build-types/visually-hidden/types.d.ts.map +1 -1
  900. package/build-types/z-stack/types.d.ts +1 -1
  901. package/build-types/z-stack/types.d.ts.map +1 -1
  902. package/package.json +20 -20
  903. package/src/angle-picker-control/angle-circle.tsx +0 -1
  904. package/src/angle-picker-control/index.tsx +14 -27
  905. package/src/angle-picker-control/styles/angle-picker-control-styles.tsx +16 -9
  906. package/src/animate/index.tsx +75 -0
  907. package/src/animate/stories/index.tsx +102 -0
  908. package/src/animate/types.ts +32 -0
  909. package/src/autocomplete/README.md +51 -0
  910. package/src/autocomplete/{autocompleter-ui.js → autocompleter-ui.tsx} +21 -10
  911. package/src/autocomplete/{get-default-use-items.js → get-default-use-items.tsx} +11 -6
  912. package/src/autocomplete/{index.js → index.tsx} +77 -111
  913. package/src/autocomplete/test/{index.js → index.tsx} +31 -20
  914. package/src/autocomplete/types.ts +220 -0
  915. package/src/border-box-control/stories/index.tsx +1 -1
  916. package/src/border-control/test/index.js +0 -2
  917. package/src/box-control/axial-input-controls.tsx +1 -1
  918. package/src/button/style.scss +12 -1
  919. package/src/button/types.ts +2 -2
  920. package/src/circular-option-picker/style.scss +10 -0
  921. package/src/circular-option-picker/types.ts +1 -1
  922. package/src/color-indicator/style.scss +1 -0
  923. package/src/color-palette/test/__snapshots__/index.tsx.snap +16 -14
  924. package/src/color-picker/README.md +2 -2
  925. package/src/color-picker/color-input.tsx +1 -12
  926. package/src/color-picker/component.tsx +9 -18
  927. package/src/color-picker/hex-input.tsx +2 -7
  928. package/src/color-picker/hsl-input.tsx +2 -7
  929. package/src/color-picker/input-with-slider.tsx +1 -9
  930. package/src/color-picker/legacy-adapter.tsx +1 -2
  931. package/src/color-picker/picker.tsx +5 -6
  932. package/src/color-picker/rgb-input.tsx +2 -7
  933. package/src/color-picker/stories/index.tsx +51 -0
  934. package/src/color-picker/test/{index.js → index.tsx} +36 -18
  935. package/src/color-picker/types.ts +128 -1
  936. package/src/color-picker/use-deprecated-props.ts +2 -53
  937. package/src/combobox-control/stories/index.tsx +1 -1
  938. package/src/custom-gradient-picker/{constants.js → constants.ts} +2 -2
  939. package/src/custom-gradient-picker/gradient-bar/{control-points.js → control-points.tsx} +171 -132
  940. package/src/custom-gradient-picker/gradient-bar/{index.js → index.tsx} +32 -8
  941. package/src/custom-gradient-picker/gradient-bar/test/{utils.js → utils.ts} +58 -31
  942. package/src/custom-gradient-picker/gradient-bar/utils.ts +193 -0
  943. package/src/custom-gradient-picker/{index.js → index.tsx} +63 -20
  944. package/src/custom-gradient-picker/serializer.ts +82 -0
  945. package/src/custom-gradient-picker/stories/index.tsx +45 -0
  946. package/src/custom-gradient-picker/style.scss +25 -4
  947. package/src/custom-gradient-picker/test/{serializer.js → serializer.ts} +39 -33
  948. package/src/custom-gradient-picker/types.ts +137 -0
  949. package/src/custom-gradient-picker/{utils.js → utils.ts} +37 -20
  950. package/src/custom-select-control/test/index.js +6 -4
  951. package/src/dimension-control/README.md +22 -55
  952. package/src/dimension-control/index.tsx +101 -0
  953. package/src/dimension-control/{sizes.js → sizes.ts} +8 -5
  954. package/src/dimension-control/stories/index.tsx +48 -0
  955. package/src/dimension-control/types.ts +48 -0
  956. package/src/{color-list-picker → duotone-picker/color-list-picker}/index.tsx +7 -6
  957. package/src/{color-list-picker → duotone-picker/color-list-picker}/types.ts +2 -2
  958. package/src/duotone-picker/{custom-duotone-bar.js → custom-duotone-bar.tsx} +7 -1
  959. package/src/duotone-picker/{duotone-picker.js → duotone-picker.tsx} +39 -2
  960. package/src/duotone-picker/{duotone-swatch.js → duotone-swatch.tsx} +2 -1
  961. package/src/duotone-picker/stories/{duotone-picker.js → duotone-picker.tsx} +15 -8
  962. package/src/duotone-picker/stories/{duotone-swatch.js → duotone-swatch.tsx} +9 -3
  963. package/src/duotone-picker/types.ts +61 -0
  964. package/src/duotone-picker/{utils.js → utils.ts} +29 -14
  965. package/src/flex/flex/hook.ts +2 -2
  966. package/src/flex/flex-item/README.md +1 -1
  967. package/src/font-size-picker/README.md +26 -20
  968. package/src/font-size-picker/index.tsx +2 -1
  969. package/src/font-size-picker/stories/index.tsx +1 -0
  970. package/src/font-size-picker/test/index.tsx +23 -0
  971. package/src/font-size-picker/types.ts +4 -0
  972. package/src/form-token-field/README.md +1 -0
  973. package/src/form-token-field/index.tsx +14 -4
  974. package/src/form-token-field/stories/index.tsx +13 -0
  975. package/src/form-token-field/style.scss +0 -7
  976. package/src/form-token-field/test/index.tsx +81 -0
  977. package/src/form-token-field/types.ts +6 -0
  978. package/src/gradient-picker/README.md +16 -23
  979. package/src/gradient-picker/{index.js → index.tsx} +70 -14
  980. package/src/gradient-picker/stories/{index.js → index.tsx} +19 -8
  981. package/src/gradient-picker/types.ts +89 -0
  982. package/src/guide/README.md +17 -15
  983. package/src/guide/{icons.js → icons.tsx} +1 -1
  984. package/src/guide/{index.js → index.tsx} +47 -7
  985. package/src/guide/{page-control.js → page-control.tsx} +2 -1
  986. package/src/guide/{page.js → page.tsx} +8 -1
  987. package/src/guide/stories/{index.js → index.tsx} +11 -5
  988. package/src/guide/test/{index.js → index.tsx} +22 -4
  989. package/src/guide/types.ts +68 -0
  990. package/src/h-stack/README.md +2 -2
  991. package/src/h-stack/types.ts +2 -2
  992. package/src/h-stack/utils.ts +3 -3
  993. package/src/higher-order/navigate-regions/{index.js → index.tsx} +47 -11
  994. package/src/higher-order/with-fallback-styles/{index.js → index.tsx} +22 -5
  995. package/src/higher-order/with-filters/{index.js → index.tsx} +44 -12
  996. package/src/higher-order/with-filters/test/{index.js → index.tsx} +5 -1
  997. package/src/higher-order/with-focus-return/index.tsx +74 -0
  998. package/src/higher-order/with-focus-return/test/{index.js → index.tsx} +2 -2
  999. package/src/higher-order/with-notices/README.md +4 -1
  1000. package/src/higher-order/with-notices/index.tsx +116 -0
  1001. package/src/higher-order/with-notices/test/{index.js → index.tsx} +11 -6
  1002. package/src/higher-order/with-notices/types.ts +35 -0
  1003. package/src/higher-order/with-spoken-messages/test/{index.js → index.tsx} +2 -1
  1004. package/src/icon/index.tsx +11 -15
  1005. package/src/icon/test/{index.js → index.tsx} +6 -2
  1006. package/src/index.native.js +1 -0
  1007. package/src/item-group/test/index.js +5 -3
  1008. package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +1 -1
  1009. package/src/mobile/bottom-sheet/cell.native.js +1 -1
  1010. package/src/mobile/bottom-sheet-text-control/README.md +8 -1
  1011. package/src/mobile/bottom-sheet-text-control/index.native.js +2 -1
  1012. package/src/mobile/link-settings/test/link-settings-navigation.native.js +1 -1
  1013. package/src/navigation/README.md +16 -2
  1014. package/src/navigation/back-button/{index.js → index.tsx} +22 -6
  1015. package/src/navigation/{context.js → context.tsx} +8 -5
  1016. package/src/navigation/group/context.tsx +15 -0
  1017. package/src/navigation/group/{index.js → index.tsx} +9 -1
  1018. package/src/navigation/{index.js → index.tsx} +63 -7
  1019. package/src/navigation/item/{base-content.js → base-content.tsx} +5 -2
  1020. package/src/navigation/item/{base.js → base.tsx} +3 -1
  1021. package/src/navigation/item/{index.js → index.tsx} +8 -2
  1022. package/src/navigation/item/{use-navigation-tree-item.js → use-navigation-tree-item.tsx} +9 -2
  1023. package/src/navigation/menu/context.tsx +18 -0
  1024. package/src/navigation/menu/{index.js → index.tsx} +5 -1
  1025. package/src/navigation/menu/{menu-title-search.js → menu-title-search.tsx} +11 -7
  1026. package/src/navigation/menu/{menu-title.js → menu-title.tsx} +5 -3
  1027. package/src/navigation/menu/{search-no-results-found.js → search-no-results-found.tsx} +5 -1
  1028. package/src/navigation/menu/{use-navigation-tree-menu.js → use-navigation-tree-menu.tsx} +3 -1
  1029. package/src/navigation/stories/index.tsx +53 -0
  1030. package/src/navigation/stories/utils/{controlled-state.js → controlled-state.tsx} +32 -13
  1031. package/src/navigation/stories/utils/{default.js → default.tsx} +20 -6
  1032. package/src/navigation/stories/utils/{group.js → group.tsx} +21 -7
  1033. package/src/navigation/stories/utils/{hide-if-empty.js → hide-if-empty.tsx} +19 -6
  1034. package/src/navigation/stories/utils/{more-examples.js → more-examples.tsx} +30 -12
  1035. package/src/navigation/stories/utils/{search.js → search.tsx} +21 -7
  1036. package/src/navigation/test/{index.js → index.tsx} +17 -4
  1037. package/src/navigation/types.ts +325 -0
  1038. package/src/navigation/{use-create-navigation-tree.js → use-create-navigation-tree.tsx} +37 -25
  1039. package/src/navigation/{use-navigation-tree-nodes.js → use-navigation-tree-nodes.tsx} +10 -6
  1040. package/src/navigation/{utils.js → utils.tsx} +2 -2
  1041. package/src/navigator/navigator-screen/component.tsx +13 -7
  1042. package/src/navigator/test/index.tsx +65 -22
  1043. package/src/number-control/index.tsx +0 -2
  1044. package/src/palette-edit/{index.js → index.tsx} +114 -48
  1045. package/src/palette-edit/stories/index.tsx +82 -0
  1046. package/src/palette-edit/test/{index.js → index.tsx} +15 -3
  1047. package/src/palette-edit/types.ts +126 -0
  1048. package/src/panel/README.md +53 -35
  1049. package/src/panel/{body.js → body.tsx} +31 -17
  1050. package/src/panel/stories/{index.js → index.tsx} +16 -6
  1051. package/src/panel/test/{body.js → body.tsx} +12 -17
  1052. package/src/panel/types.ts +78 -0
  1053. package/src/placeholder/index.tsx +2 -6
  1054. package/src/placeholder/test/index.tsx +1 -1
  1055. package/src/placeholder/types.ts +2 -2
  1056. package/src/popover/test/index.tsx +5 -2
  1057. package/src/query-controls/author-select.tsx +1 -6
  1058. package/src/query-controls/category-select.tsx +1 -6
  1059. package/src/query-controls/terms.ts +29 -18
  1060. package/src/range-control/index.tsx +2 -6
  1061. package/src/range-control/types.ts +3 -3
  1062. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -1
  1063. package/src/resizable-box/resize-tooltip/utils.ts +1 -1
  1064. package/src/responsive-wrapper/README.md +8 -2
  1065. package/src/responsive-wrapper/index.tsx +18 -17
  1066. package/src/responsive-wrapper/stories/index.tsx +41 -0
  1067. package/src/responsive-wrapper/style.scss +5 -11
  1068. package/src/responsive-wrapper/types.ts +2 -2
  1069. package/src/sandbox/index.native.js +71 -78
  1070. package/src/select-control/index.tsx +16 -16
  1071. package/src/select-control/stories/index.tsx +24 -12
  1072. package/src/select-control/types.ts +68 -40
  1073. package/src/slot-fill/test/slot.js +8 -6
  1074. package/src/style.scss +1 -1
  1075. package/src/tab-panel/index.tsx +7 -2
  1076. package/src/tab-panel/types.ts +4 -4
  1077. package/src/toolbar/toolbar-button/README.md +13 -1
  1078. package/src/toolbar/toolbar-button/{index.js → index.tsx} +55 -20
  1079. package/src/toolbar/toolbar-button/toolbar-button-container.tsx +13 -0
  1080. package/src/toolbar/toolbar-button/types.ts +46 -0
  1081. package/src/toolbar/toolbar-context/index.ts +15 -0
  1082. package/src/tools-panel/test/index.tsx +86 -0
  1083. package/src/tools-panel/tools-panel/hook.ts +44 -4
  1084. package/src/tools-panel/types.ts +1 -0
  1085. package/src/tooltip/index.js +11 -1
  1086. package/src/tooltip/test/index.js +251 -301
  1087. package/src/tree-select/index.tsx +5 -2
  1088. package/src/tree-select/types.ts +6 -13
  1089. package/src/ui/context/get-styled-class-name-from-key.ts +1 -1
  1090. package/src/utils/font.js +1 -6
  1091. package/src/utils/input/input-control.js +1 -0
  1092. package/src/v-stack/README.md +2 -2
  1093. package/src/v-stack/hook.ts +6 -4
  1094. package/src/v-stack/stories/index.tsx +28 -7
  1095. package/src/v-stack/test/__snapshots__/index.tsx.snap +20 -18
  1096. package/src/v-stack/types.ts +5 -3
  1097. package/tsconfig.json +1 -15
  1098. package/tsconfig.tsbuildinfo +1 -1
  1099. package/build/color-list-picker/index.js.map +0 -1
  1100. package/build-module/color-list-picker/index.js.map +0 -1
  1101. package/build-types/color-list-picker/index.d.ts.map +0 -1
  1102. package/build-types/color-list-picker/types.d.ts.map +0 -1
  1103. package/src/animate/index.js +0 -58
  1104. package/src/animate/stories/index.js +0 -53
  1105. package/src/color-picker/stories/index.js +0 -41
  1106. package/src/custom-gradient-picker/gradient-bar/utils.js +0 -187
  1107. package/src/custom-gradient-picker/serializer.js +0 -46
  1108. package/src/custom-gradient-picker/stories/index.js +0 -33
  1109. package/src/dimension-control/index.js +0 -73
  1110. package/src/higher-order/with-focus-return/index.js +0 -64
  1111. package/src/higher-order/with-notices/index.js +0 -104
  1112. package/src/navigation/group/context.js +0 -9
  1113. package/src/navigation/menu/context.js +0 -11
  1114. package/src/navigation/stories/index.js +0 -33
  1115. package/src/toolbar/toolbar-button/toolbar-button-container.js +0 -6
  1116. package/src/toolbar/toolbar-context/index.js +0 -10
  1117. /package/build/{color-list-picker → animate}/types.js +0 -0
  1118. /package/build-module/{color-list-picker → animate}/types.js +0 -0
  1119. /package/build-module/{color-list-picker → animate}/types.js.map +0 -0
  1120. /package/{build/color-list-picker → build-module/autocomplete}/types.js.map +0 -0
  1121. /package/build-types/{color-list-picker → duotone-picker/color-list-picker}/index.d.ts +0 -0
  1122. /package/src/animation/{index.js → index.tsx} +0 -0
  1123. /package/src/custom-gradient-picker/gradient-bar/{constants.js → constants.ts} +0 -0
  1124. /package/src/custom-gradient-picker/styles/{custom-gradient-picker-styles.js → custom-gradient-picker-styles.tsx} +0 -0
  1125. /package/src/{color-list-picker → duotone-picker/color-list-picker}/style.scss +0 -0
  1126. /package/src/duotone-picker/{index.js → index.ts} +0 -0
  1127. /package/src/higher-order/with-filters/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1128. /package/src/higher-order/with-spoken-messages/{index.js → index.tsx} +0 -0
  1129. /package/src/navigation/{constants.js → constants.tsx} +0 -0
  1130. /package/src/navigation/styles/{navigation-styles.js → navigation-styles.tsx} +0 -0
  1131. /package/src/panel/test/__snapshots__/{body.js.snap → body.tsx.snap} +0 -0
@@ -4,10 +4,10 @@ import { createElement } from "@wordpress/element";
4
4
  * External dependencies
5
5
  */
6
6
  import classnames from 'classnames';
7
+
7
8
  /**
8
9
  * WordPress dependencies
9
10
  */
10
-
11
11
  import deprecated from '@wordpress/deprecated';
12
12
  import { __ } from '@wordpress/i18n';
13
13
  /**
@@ -21,7 +21,7 @@ import SelectControl from '../select-control';
21
21
  import { VStack } from '../v-stack';
22
22
  import { getGradientAstWithDefault, getLinearGradientRepresentation, getGradientAstWithControlPoints, getStopCssColor } from './utils';
23
23
  import { serializeGradient } from './serializer';
24
- import { DEFAULT_LINEAR_GRADIENT_ANGLE, HORIZONTAL_GRADIENT_ORIENTATION, GRADIENT_OPTIONS, DEFAULT_GRADIENT } from './constants';
24
+ import { DEFAULT_LINEAR_GRADIENT_ANGLE, HORIZONTAL_GRADIENT_ORIENTATION, GRADIENT_OPTIONS } from './constants';
25
25
  import { AccessoryWrapper, SelectWrapper } from './styles/custom-gradient-picker-styles';
26
26
 
27
27
  const GradientAnglePicker = _ref => {
@@ -38,7 +38,7 @@ const GradientAnglePicker = _ref => {
38
38
  onChange(serializeGradient({ ...gradientAST,
39
39
  orientation: {
40
40
  type: 'angular',
41
- value: newAngle
41
+ value: `${newAngle}`
42
42
  }
43
43
  }));
44
44
  };
@@ -62,9 +62,7 @@ const GradientTypePicker = _ref2 => {
62
62
 
63
63
  const onSetLinearGradient = () => {
64
64
  onChange(serializeGradient({ ...gradientAST,
65
- ...(gradientAST.orientation ? {} : {
66
- orientation: HORIZONTAL_GRADIENT_ORIENTATION
67
- }),
65
+ orientation: gradientAST.orientation ? undefined : HORIZONTAL_GRADIENT_ORIENTATION,
68
66
  type: 'linear-gradient'
69
67
  }));
70
68
  };
@@ -97,30 +95,59 @@ const GradientTypePicker = _ref2 => {
97
95
  onChange: handleOnChange,
98
96
  options: GRADIENT_OPTIONS,
99
97
  size: "__unstable-large",
100
- value: hasGradient && type
98
+ value: hasGradient ? type : undefined
101
99
  });
102
100
  };
101
+ /**
102
+ * CustomGradientPicker is a React component that renders a UI for specifying
103
+ * linear or radial gradients. Radial gradients are displayed in the picker as
104
+ * a slice of the gradient from the center to the outside.
105
+ *
106
+ * ```jsx
107
+ * import { CustomGradientPicker } from '@wordpress/components';
108
+ * import { useState } from '@wordpress/element';
109
+ *
110
+ * const MyCustomGradientPicker = () => {
111
+ * const [ gradient, setGradient ] = useState();
112
+ *
113
+ * return (
114
+ * <CustomGradientPicker
115
+ * value={ gradient }
116
+ * onChange={ setGradient }
117
+ * />
118
+ * );
119
+ * };
120
+ * ```
121
+ */
103
122
 
104
- export default function CustomGradientPicker(_ref3) {
123
+
124
+ export function CustomGradientPicker(_ref3) {
105
125
  let {
106
126
  /** Start opting into the new margin-free styles that will become the default in a future version. */
107
127
  __nextHasNoMargin = false,
108
128
  value,
109
129
  onChange,
110
- __experimentalIsRenderedInSidebar
130
+ __experimentalIsRenderedInSidebar = false
111
131
  } = _ref3;
112
- const gradientAST = getGradientAstWithDefault(value); // On radial gradients the bar should display a linear gradient.
132
+ const {
133
+ gradientAST,
134
+ hasGradient
135
+ } = getGradientAstWithDefault(value); // On radial gradients the bar should display a linear gradient.
113
136
  // On radial gradients the bar represents a slice of the gradient from the center until the outside.
114
137
  // On liner gradients the bar represents the color stops from left to right independently of the angle.
115
138
 
116
- const background = getLinearGradientRepresentation(gradientAST);
117
- const hasGradient = gradientAST.value !== DEFAULT_GRADIENT; // Control points color option may be hex from presets, custom colors will be rgb.
139
+ const background = getLinearGradientRepresentation(gradientAST); // Control points color option may be hex from presets, custom colors will be rgb.
118
140
  // The position should always be a percentage.
119
141
 
120
- const controlPoints = gradientAST.colorStops.map(colorStop => ({
121
- color: getStopCssColor(colorStop),
122
- position: parseInt(colorStop.length.value)
123
- }));
142
+ const controlPoints = gradientAST.colorStops.map(colorStop => {
143
+ return {
144
+ color: getStopCssColor(colorStop),
145
+ // Although it's already been checked by `hasUnsupportedLength` in `getGradientAstWithDefault`,
146
+ // TypeScript doesn't know that `colorStop.length` is not undefined here.
147
+ // @ts-expect-error
148
+ position: parseInt(colorStop.length.value)
149
+ };
150
+ });
124
151
 
125
152
  if (!__nextHasNoMargin) {
126
153
  deprecated('Outer margin styles for wp.components.CustomGradientPicker', {
@@ -156,4 +183,5 @@ export default function CustomGradientPicker(_ref3) {
156
183
  onChange: onChange
157
184
  }))));
158
185
  }
186
+ export default CustomGradientPicker;
159
187
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/custom-gradient-picker/index.js"],"names":["classnames","deprecated","__","AnglePickerControl","CustomGradientBar","Flex","SelectControl","VStack","getGradientAstWithDefault","getLinearGradientRepresentation","getGradientAstWithControlPoints","getStopCssColor","serializeGradient","DEFAULT_LINEAR_GRADIENT_ANGLE","HORIZONTAL_GRADIENT_ORIENTATION","GRADIENT_OPTIONS","DEFAULT_GRADIENT","AccessoryWrapper","SelectWrapper","GradientAnglePicker","gradientAST","hasGradient","onChange","angle","orientation","value","onAngleChange","newAngle","type","GradientTypePicker","onSetLinearGradient","onSetRadialGradient","restGradientAST","handleOnChange","next","CustomGradientPicker","__nextHasNoMargin","__experimentalIsRenderedInSidebar","background","controlPoints","colorStops","map","colorStop","color","position","parseInt","length","since","version","hint","newControlPoints"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA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B,IACD,cAAC,mBAAD;AACC,IAAA,WAAW,EAAGR,WADf;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IAFF,CAXD,CAxBD,CADD;AAgDA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AnglePickerControl from '../angle-picker-control';\nimport CustomGradientBar from './gradient-bar';\nimport { Flex } from '../flex';\nimport SelectControl from '../select-control';\nimport { VStack } from '../v-stack';\nimport {\n\tgetGradientAstWithDefault,\n\tgetLinearGradientRepresentation,\n\tgetGradientAstWithControlPoints,\n\tgetStopCssColor,\n} from './utils';\nimport { serializeGradient } from './serializer';\nimport {\n\tDEFAULT_LINEAR_GRADIENT_ANGLE,\n\tHORIZONTAL_GRADIENT_ORIENTATION,\n\tGRADIENT_OPTIONS,\n\tDEFAULT_GRADIENT,\n} from './constants';\nimport {\n\tAccessoryWrapper,\n\tSelectWrapper,\n} from './styles/custom-gradient-picker-styles';\n\nconst GradientAnglePicker = ( { gradientAST, hasGradient, onChange } ) => {\n\tconst angle =\n\t\tgradientAST?.orientation?.value ?? DEFAULT_LINEAR_GRADIENT_ANGLE;\n\tconst onAngleChange = ( newAngle ) => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: {\n\t\t\t\t\ttype: 'angular',\n\t\t\t\t\tvalue: newAngle,\n\t\t\t\t},\n\t\t\t} )\n\t\t);\n\t};\n\treturn (\n\t\t<AnglePickerControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tonChange={ onAngleChange }\n\t\t\tvalue={ hasGradient ? angle : '' }\n\t\t/>\n\t);\n};\n\nconst GradientTypePicker = ( { gradientAST, hasGradient, onChange } ) => {\n\tconst { type } = gradientAST;\n\tconst onSetLinearGradient = () => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\t...( gradientAST.orientation\n\t\t\t\t\t? {}\n\t\t\t\t\t: { orientation: HORIZONTAL_GRADIENT_ORIENTATION } ),\n\t\t\t\ttype: 'linear-gradient',\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst onSetRadialGradient = () => {\n\t\tconst { orientation, ...restGradientAST } = gradientAST;\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...restGradientAST,\n\t\t\t\ttype: 'radial-gradient',\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst handleOnChange = ( next ) => {\n\t\tif ( next === 'linear-gradient' ) {\n\t\t\tonSetLinearGradient();\n\t\t}\n\t\tif ( next === 'radial-gradient' ) {\n\t\t\tonSetRadialGradient();\n\t\t}\n\t};\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"components-custom-gradient-picker__type-picker\"\n\t\t\tlabel={ __( 'Type' ) }\n\t\t\tlabelPosition=\"top\"\n\t\t\tonChange={ handleOnChange }\n\t\t\toptions={ GRADIENT_OPTIONS }\n\t\t\tsize=\"__unstable-large\"\n\t\t\tvalue={ hasGradient && type }\n\t\t/>\n\t);\n};\n\nexport default function CustomGradientPicker( {\n\t/** Start opting into the new margin-free styles that will become the default in a future version. */\n\t__nextHasNoMargin = false,\n\tvalue,\n\tonChange,\n\t__experimentalIsRenderedInSidebar,\n} ) {\n\tconst gradientAST = getGradientAstWithDefault( value );\n\t// On radial gradients the bar should display a linear gradient.\n\t// On radial gradients the bar represents a slice of the gradient from the center until the outside.\n\t// On liner gradients the bar represents the color stops from left to right independently of the angle.\n\tconst background = getLinearGradientRepresentation( gradientAST );\n\tconst hasGradient = gradientAST.value !== DEFAULT_GRADIENT;\n\t// Control points color option may be hex from presets, custom colors will be rgb.\n\t// The position should always be a percentage.\n\tconst controlPoints = gradientAST.colorStops.map( ( colorStop ) => ( {\n\t\tcolor: getStopCssColor( colorStop ),\n\t\tposition: parseInt( colorStop.length.value ),\n\t} ) );\n\n\tif ( ! __nextHasNoMargin ) {\n\t\tdeprecated(\n\t\t\t'Outer margin styles for wp.components.CustomGradientPicker',\n\t\t\t{\n\t\t\t\tsince: '6.1',\n\t\t\t\tversion: '6.4',\n\t\t\t\thint: 'Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version',\n\t\t\t}\n\t\t);\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing={ 4 }\n\t\t\tclassName={ classnames( 'components-custom-gradient-picker', {\n\t\t\t\t'is-next-has-no-margin': __nextHasNoMargin,\n\t\t\t} ) }\n\t\t>\n\t\t\t<CustomGradientBar\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tbackground={ background }\n\t\t\t\thasGradient={ hasGradient }\n\t\t\t\tvalue={ controlPoints }\n\t\t\t\tonChange={ ( newControlPoints ) => {\n\t\t\t\t\tonChange(\n\t\t\t\t\t\tserializeGradient(\n\t\t\t\t\t\t\tgetGradientAstWithControlPoints(\n\t\t\t\t\t\t\t\tgradientAST,\n\t\t\t\t\t\t\t\tnewControlPoints\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<Flex\n\t\t\t\tgap={ 3 }\n\t\t\t\tclassName=\"components-custom-gradient-picker__ui-line\"\n\t\t\t>\n\t\t\t\t<SelectWrapper>\n\t\t\t\t\t<GradientTypePicker\n\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</SelectWrapper>\n\t\t\t\t<AccessoryWrapper>\n\t\t\t\t\t{ gradientAST.type === 'linear-gradient' && (\n\t\t\t\t\t\t<GradientAnglePicker\n\t\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</AccessoryWrapper>\n\t\t\t</Flex>\n\t\t</VStack>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/custom-gradient-picker/index.tsx"],"names":["classnames","deprecated","__","AnglePickerControl","CustomGradientBar","Flex","SelectControl","VStack","getGradientAstWithDefault","getLinearGradientRepresentation","getGradientAstWithControlPoints","getStopCssColor","serializeGradient","DEFAULT_LINEAR_GRADIENT_ANGLE","HORIZONTAL_GRADIENT_ORIENTATION","GRADIENT_OPTIONS","AccessoryWrapper","SelectWrapper","GradientAnglePicker","gradientAST","hasGradient","onChange","angle","orientation","value","onAngleChange","newAngle","type","GradientTypePicker","onSetLinearGradient","undefined","onSetRadialGradient","restGradientAST","handleOnChange","next","CustomGradientPicker","__nextHasNoMargin","__experimentalIsRenderedInSidebar","background","controlPoints","colorStops","map","colorStop","color","position","parseInt","length","since","version","hint","newControlPoints"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;;AAGA;AACA;AACA;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AACA,OAAOC,iBAAP,MAA8B,gBAA9B;AACA,SAASC,IAAT,QAAqB,SAArB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,SAASC,MAAT,QAAuB,YAAvB;AACA,SACCC,yBADD,EAECC,+BAFD,EAGCC,+BAHD,EAICC,eAJD,QAKO,SALP;AAMA,SAASC,iBAAT,QAAkC,cAAlC;AACA,SACCC,6BADD,EAECC,+BAFD,EAGCC,gBAHD,QAIO,aAJP;AAKA,SACCC,gBADD,EAECC,aAFD,QAGO,wCAHP;;AAUA,MAAMC,mBAAmB,GAAG,QAIK;AAAA;;AAAA,MA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,GARqB,CAAtB;;AAUA,MAAK,CAAEY,iBAAP,EAA2B;AAC1BnC,IAAAA,UAAU,CACT,4DADS,EAET;AACC8C,MAAAA,KAAK,EAAE,KADR;AAECC,MAAAA,OAAO,EAAE,KAFV;AAGCC,MAAAA,IAAI,EAAE;AAHP,KAFS,CAAV;AAQA;;AAED,SACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAGjD,UAAU,CAAE,mCAAF,EAAuC;AAC5D,+BAAyBoC;AADmC,KAAvC;AAFvB,KAMC,cAAC,iBAAD;AACC,IAAA,iCAAiC,EAChCC,iCAFF;AAIC,IAAA,UAAU,EAAGC,UAJd;AAKC,IAAA,WAAW,EAAGlB,WALf;AAMC,IAAA,KAAK,EAAGmB,aANT;AAOC,IAAA,QAAQ,EAAKW,gBAAF,IAAwB;AAClC7B,MAAAA,QAAQ,CACPT,iBAAiB,CAChBF,+BAA+B,CAC9BS,WAD8B,EAE9B+B,gBAF8B,CADf,CADV,CAAR;AAQA;AAhBF,IAND,EAwBC,cAAC,IAAD;AACC,IAAA,GAAG,EAAG,CADP;AAEC,IAAA,SAAS,EAAC;AAFX,KAIC,cAAC,aAAD,QACC,cAAC,kBAAD;AACC,IAAA,WAAW,EAAG/B,WADf;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IADD,CAJD,EAWC,cAAC,gBAAD,QACGF,WAAW,CAACQ,IAAZ,KAAqB,iBAArB,IACD,cAAC,mBAAD;AACC,IAAA,WAAW,EAAGR,WADf;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IAFF,CAXD,CAxBD,CADD;AAgDA;AAED,eAAec,oBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type gradientParser from 'gradient-parser';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AnglePickerControl from '../angle-picker-control';\nimport CustomGradientBar from './gradient-bar';\nimport { Flex } from '../flex';\nimport SelectControl from '../select-control';\nimport { VStack } from '../v-stack';\nimport {\n\tgetGradientAstWithDefault,\n\tgetLinearGradientRepresentation,\n\tgetGradientAstWithControlPoints,\n\tgetStopCssColor,\n} from './utils';\nimport { serializeGradient } from './serializer';\nimport {\n\tDEFAULT_LINEAR_GRADIENT_ANGLE,\n\tHORIZONTAL_GRADIENT_ORIENTATION,\n\tGRADIENT_OPTIONS,\n} from './constants';\nimport {\n\tAccessoryWrapper,\n\tSelectWrapper,\n} from './styles/custom-gradient-picker-styles';\nimport type {\n\tCustomGradientPickerProps,\n\tGradientAnglePickerProps,\n\tGradientTypePickerProps,\n} from './types';\n\nconst GradientAnglePicker = ( {\n\tgradientAST,\n\thasGradient,\n\tonChange,\n}: GradientAnglePickerProps ) => {\n\tconst angle =\n\t\tgradientAST?.orientation?.value ?? DEFAULT_LINEAR_GRADIENT_ANGLE;\n\tconst onAngleChange = ( newAngle: number ) => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: {\n\t\t\t\t\ttype: 'angular',\n\t\t\t\t\tvalue: `${ newAngle }`,\n\t\t\t\t},\n\t\t\t} )\n\t\t);\n\t};\n\treturn (\n\t\t<AnglePickerControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tonChange={ onAngleChange }\n\t\t\tvalue={ hasGradient ? angle : '' }\n\t\t/>\n\t);\n};\n\nconst GradientTypePicker = ( {\n\tgradientAST,\n\thasGradient,\n\tonChange,\n}: GradientTypePickerProps ) => {\n\tconst { type } = gradientAST;\n\n\tconst onSetLinearGradient = () => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: gradientAST.orientation\n\t\t\t\t\t? undefined\n\t\t\t\t\t: HORIZONTAL_GRADIENT_ORIENTATION,\n\t\t\t\ttype: 'linear-gradient',\n\t\t\t} as gradientParser.LinearGradientNode )\n\t\t);\n\t};\n\n\tconst onSetRadialGradient = () => {\n\t\tconst { orientation, ...restGradientAST } = gradientAST;\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...restGradientAST,\n\t\t\t\ttype: 'radial-gradient',\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst handleOnChange = ( next: string ) => {\n\t\tif ( next === 'linear-gradient' ) {\n\t\t\tonSetLinearGradient();\n\t\t}\n\t\tif ( next === 'radial-gradient' ) {\n\t\t\tonSetRadialGradient();\n\t\t}\n\t};\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"components-custom-gradient-picker__type-picker\"\n\t\t\tlabel={ __( 'Type' ) }\n\t\t\tlabelPosition=\"top\"\n\t\t\tonChange={ handleOnChange }\n\t\t\toptions={ GRADIENT_OPTIONS }\n\t\t\tsize=\"__unstable-large\"\n\t\t\tvalue={ hasGradient ? type : undefined }\n\t\t/>\n\t);\n};\n\n/**\n * CustomGradientPicker is a React component that renders a UI for specifying\n * linear or radial gradients. Radial gradients are displayed in the picker as\n * a slice of the gradient from the center to the outside.\n *\n * ```jsx\n * import { CustomGradientPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCustomGradientPicker = () => {\n * const [ gradient, setGradient ] = useState();\n *\n * return (\n * <CustomGradientPicker\n *\t\t\tvalue={ gradient }\n *\t\t\tonChange={ setGradient }\n * />\n * );\n * };\n * ```\n */\nexport function CustomGradientPicker( {\n\t/** Start opting into the new margin-free styles that will become the default in a future version. */\n\t__nextHasNoMargin = false,\n\tvalue,\n\tonChange,\n\t__experimentalIsRenderedInSidebar = false,\n}: CustomGradientPickerProps ) {\n\tconst { gradientAST, hasGradient } = getGradientAstWithDefault( value );\n\n\t// On radial gradients the bar should display a linear gradient.\n\t// On radial gradients the bar represents a slice of the gradient from the center until the outside.\n\t// On liner gradients the bar represents the color stops from left to right independently of the angle.\n\tconst background = getLinearGradientRepresentation( gradientAST );\n\n\t// Control points color option may be hex from presets, custom colors will be rgb.\n\t// The position should always be a percentage.\n\tconst controlPoints = gradientAST.colorStops.map( ( colorStop ) => {\n\t\treturn {\n\t\t\tcolor: getStopCssColor( colorStop ),\n\t\t\t// Although it's already been checked by `hasUnsupportedLength` in `getGradientAstWithDefault`,\n\t\t\t// TypeScript doesn't know that `colorStop.length` is not undefined here.\n\t\t\t// @ts-expect-error\n\t\t\tposition: parseInt( colorStop.length.value ),\n\t\t};\n\t} );\n\n\tif ( ! __nextHasNoMargin ) {\n\t\tdeprecated(\n\t\t\t'Outer margin styles for wp.components.CustomGradientPicker',\n\t\t\t{\n\t\t\t\tsince: '6.1',\n\t\t\t\tversion: '6.4',\n\t\t\t\thint: 'Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version',\n\t\t\t}\n\t\t);\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing={ 4 }\n\t\t\tclassName={ classnames( 'components-custom-gradient-picker', {\n\t\t\t\t'is-next-has-no-margin': __nextHasNoMargin,\n\t\t\t} ) }\n\t\t>\n\t\t\t<CustomGradientBar\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tbackground={ background }\n\t\t\t\thasGradient={ hasGradient }\n\t\t\t\tvalue={ controlPoints }\n\t\t\t\tonChange={ ( newControlPoints ) => {\n\t\t\t\t\tonChange(\n\t\t\t\t\t\tserializeGradient(\n\t\t\t\t\t\t\tgetGradientAstWithControlPoints(\n\t\t\t\t\t\t\t\tgradientAST,\n\t\t\t\t\t\t\t\tnewControlPoints\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<Flex\n\t\t\t\tgap={ 3 }\n\t\t\t\tclassName=\"components-custom-gradient-picker__ui-line\"\n\t\t\t>\n\t\t\t\t<SelectWrapper>\n\t\t\t\t\t<GradientTypePicker\n\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</SelectWrapper>\n\t\t\t\t<AccessoryWrapper>\n\t\t\t\t\t{ gradientAST.type === 'linear-gradient' && (\n\t\t\t\t\t\t<GradientAnglePicker\n\t\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</AccessoryWrapper>\n\t\t\t</Flex>\n\t\t</VStack>\n\t);\n}\n\nexport default CustomGradientPicker;\n"]}
@@ -1,3 +1,10 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+
5
+ /**
6
+ * Internal dependencies
7
+ */
1
8
  export function serializeGradientColor(_ref) {
2
9
  let {
3
10
  type,
@@ -37,7 +44,7 @@ export function serializeGradientColorStop(_ref2) {
37
44
  })} ${serializeGradientPosition(length)}`;
38
45
  }
39
46
  export function serializeGradientOrientation(orientation) {
40
- if (!orientation || orientation.type !== 'angular') {
47
+ if (Array.isArray(orientation) || !orientation || orientation.type !== 'angular') {
41
48
  return;
42
49
  }
43
50
 
@@ -51,9 +58,13 @@ export function serializeGradient(_ref3) {
51
58
  } = _ref3;
52
59
  const serializedOrientation = serializeGradientOrientation(orientation);
53
60
  const serializedColorStops = colorStops.sort((colorStop1, colorStop2) => {
54
- var _colorStop1$length$va, _colorStop1$length, _colorStop2$length$va, _colorStop2$length;
61
+ const getNumericStopValue = colorStop => {
62
+ var _colorStop$length;
63
+
64
+ return (colorStop === null || colorStop === void 0 ? void 0 : (_colorStop$length = colorStop.length) === null || _colorStop$length === void 0 ? void 0 : _colorStop$length.value) === undefined ? 0 : parseInt(colorStop.length.value);
65
+ };
55
66
 
56
- return ((_colorStop1$length$va = colorStop1 === null || colorStop1 === void 0 ? void 0 : (_colorStop1$length = colorStop1.length) === null || _colorStop1$length === void 0 ? void 0 : _colorStop1$length.value) !== null && _colorStop1$length$va !== void 0 ? _colorStop1$length$va : 0) - ((_colorStop2$length$va = colorStop2 === null || colorStop2 === void 0 ? void 0 : (_colorStop2$length = colorStop2.length) === null || _colorStop2$length === void 0 ? void 0 : _colorStop2$length.value) !== null && _colorStop2$length$va !== void 0 ? _colorStop2$length$va : 0);
67
+ return getNumericStopValue(colorStop1) - getNumericStopValue(colorStop2);
57
68
  }).map(serializeGradientColorStop);
58
69
  return `${type}(${[serializedOrientation, ...serializedColorStops].filter(Boolean).join(',')})`;
59
70
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/custom-gradient-picker/serializer.js"],"names":["serializeGradientColor","type","value","join","serializeGradientPosition","position","serializeGradientColorStop","length","serializeGradientOrientation","orientation","serializeGradient","colorStops","serializedOrientation","serializedColorStops","sort","colorStop1","colorStop2","map","filter","Boolean"],"mappings":"AAAA,OAAO,SAASA,sBAAT,OAAmD;AAAA,MAAlB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAkB;;AACzD,MAAKD,IAAI,KAAK,SAAd,EAA0B;AACzB,WAAOC,KAAP;AACA;;AACD,MAAKD,IAAI,KAAK,KAAd,EAAsB;AACrB,WAAQ,IAAIC,KAAO,EAAnB;AACA;;AACD,SAAQ,GAAGD,IAAM,IAAIC,KAAK,CAACC,IAAN,CAAY,GAAZ,CAAmB,GAAxC;AACA;AAED,OAAO,SAASC,yBAAT,CAAoCC,QAApC,EAA+C;AACrD,MAAK,CAAEA,QAAP,EAAkB;AACjB,WAAO,EAAP;AACA;;AACD,QAAM;AAAEH,IAAAA,KAAF;AAASD,IAAAA;AAAT,MAAkBI,QAAxB;AACA,SAAQ,GAAGH,KAAO,GAAGD,IAAM,EAA3B;AACA;AAED,OAAO,SAASK,0BAAT,QAA+D;AAAA,MAA1B;AAAEL,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeK,IAAAA;AAAf,GAA0B;AACrE,SAAQ,GAAGP,sBAAsB,CAAE;AAClCC,IAAAA,IADkC;AAElCC,IAAAA;AAFkC,GAAF,CAG5B,IAAIE,yBAAyB,CAAEG,MAAF,CAAY,EAH9C;AAIA;AAED,OAAO,SAASC,4BAAT,CAAuCC,WAAvC,EAAqD;AAC3D,MAAK,CAAEA,WAAF,IAAiBA,WAAW,CAACR,IAAZ,KAAqB,SAA3C,EAAuD;AACtD;AACA;;AACD,SAAQ,GAAGQ,WAAW,CAACP,KAAO,KAA9B;AACA;AAED,OAAO,SAASQ,iBAAT,QAAgE;AAAA,MAApC;AAAET,IAAAA,IAAF;AAAQQ,IAAAA,WAAR;AAAqBE,IAAAA;AAArB,GAAoC;AACtE,QAAMC,qBAAqB,GAAGJ,4BAA4B,CAAEC,WAAF,CAA1D;AACA,QAAMI,oBAAoB,GAAGF,UAAU,CACrCG,IAD2B,CACrB,CAAEC,UAAF,EAAcC,UAAd,KAA8B;AAAA;;AACpC,WACC,0BAAED,UAAF,aAAEA,UAAF,6CAAEA,UAAU,CAAER,MAAd,uDAAE,mBAAoBL,KAAtB,yEAA+B,CAA/B,8BACEc,UADF,aACEA,UADF,6CACEA,UAAU,CAAET,MADd,uDACE,mBAAoBL,KADtB,yEAC+B,CAD/B,CADD;AAIA,GAN2B,EAO3Be,GAP2B,CAOtBX,0BAPsB,CAA7B;AAQA,SAAQ,GAAGL,IAAM,IAAI,CAAEW,qBAAF,EAAyB,GAAGC,oBAA5B,EACnBK,MADmB,CACXC,OADW,EAEnBhB,IAFmB,CAEb,GAFa,CAEN,GAFf;AAGA","sourcesContent":["export function serializeGradientColor( { type, value } ) {\n\tif ( type === 'literal' ) {\n\t\treturn value;\n\t}\n\tif ( type === 'hex' ) {\n\t\treturn `#${ value }`;\n\t}\n\treturn `${ type }(${ value.join( ',' ) })`;\n}\n\nexport function serializeGradientPosition( position ) {\n\tif ( ! position ) {\n\t\treturn '';\n\t}\n\tconst { value, type } = position;\n\treturn `${ value }${ type }`;\n}\n\nexport function serializeGradientColorStop( { type, value, length } ) {\n\treturn `${ serializeGradientColor( {\n\t\ttype,\n\t\tvalue,\n\t} ) } ${ serializeGradientPosition( length ) }`;\n}\n\nexport function serializeGradientOrientation( orientation ) {\n\tif ( ! orientation || orientation.type !== 'angular' ) {\n\t\treturn;\n\t}\n\treturn `${ orientation.value }deg`;\n}\n\nexport function serializeGradient( { type, orientation, colorStops } ) {\n\tconst serializedOrientation = serializeGradientOrientation( orientation );\n\tconst serializedColorStops = colorStops\n\t\t.sort( ( colorStop1, colorStop2 ) => {\n\t\t\treturn (\n\t\t\t\t( colorStop1?.length?.value ?? 0 ) -\n\t\t\t\t( colorStop2?.length?.value ?? 0 )\n\t\t\t);\n\t\t} )\n\t\t.map( serializeGradientColorStop );\n\treturn `${ type }(${ [ serializedOrientation, ...serializedColorStops ]\n\t\t.filter( Boolean )\n\t\t.join( ',' ) })`;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/custom-gradient-picker/serializer.ts"],"names":["serializeGradientColor","type","value","join","serializeGradientPosition","position","serializeGradientColorStop","length","serializeGradientOrientation","orientation","Array","isArray","serializeGradient","colorStops","serializedOrientation","serializedColorStops","sort","colorStop1","colorStop2","getNumericStopValue","colorStop","undefined","parseInt","map","filter","Boolean"],"mappings":"AAAA;AACA;AACA;;AAEA;AACA;AACA;AAGA,OAAO,SAASA,sBAAT,OAGoB;AAAA,MAHa;AACvCC,IAAAA,IADuC;AAEvCC,IAAAA;AAFuC,GAGb;;AAC1B,MAAKD,IAAI,KAAK,SAAd,EAA0B;AACzB,WAAOC,KAAP;AACA;;AACD,MAAKD,IAAI,KAAK,KAAd,EAAsB;AACrB,WAAQ,IAAIC,KAAO,EAAnB;AACA;;AACD,SAAQ,GAAGD,IAAM,IAAIC,KAAK,CAACC,IAAN,CAAY,GAAZ,CAAmB,GAAxC;AACA;AAED,OAAO,SAASC,yBAAT,CACNC,Q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A,GAd2B,EAe3BK,GAf2B,CAetBjB,0BAfsB,CAA7B;AAgBA,SAAQ,GAAGL,IAAM,IAAI,CAAEa,qBAAF,EAAyB,GAAGC,oBAA5B,EACnBS,MADmB,CACXC,OADW,EAEnBtB,IAFmB,CAEb,GAFa,CAEN,GAFf;AAGA","sourcesContent":["/**\n * External dependencies\n */\nimport type gradientParser from 'gradient-parser';\n/**\n * Internal dependencies\n */\nimport type { ColorStopTypeAndValue } from './types';\n\nexport function serializeGradientColor( {\n\ttype,\n\tvalue,\n}: ColorStopTypeAndValue ) {\n\tif ( type === 'literal' ) {\n\t\treturn value;\n\t}\n\tif ( type === 'hex' ) {\n\t\treturn `#${ value }`;\n\t}\n\treturn `${ type }(${ value.join( ',' ) })`;\n}\n\nexport function serializeGradientPosition(\n\tposition: gradientParser.ColorStop[ 'length' ]\n) {\n\tif ( ! position ) {\n\t\treturn '';\n\t}\n\tconst { value, type } = position;\n\treturn `${ value }${ type }`;\n}\n\nexport function serializeGradientColorStop( {\n\ttype,\n\tvalue,\n\tlength,\n}: gradientParser.ColorStop ) {\n\treturn `${ serializeGradientColor( {\n\t\ttype,\n\t\tvalue,\n\t} as ColorStopTypeAndValue ) } ${ serializeGradientPosition( length ) }`;\n}\n\nexport function serializeGradientOrientation(\n\torientation: gradientParser.GradientNode[ 'orientation' ]\n) {\n\tif (\n\t\tArray.isArray( orientation ) ||\n\t\t! orientation ||\n\t\torientation.type !== 'angular'\n\t) {\n\t\treturn;\n\t}\n\treturn `${ orientation.value }deg`;\n}\n\nexport function serializeGradient( {\n\ttype,\n\torientation,\n\tcolorStops,\n}: gradientParser.GradientNode ) {\n\tconst serializedOrientation = serializeGradientOrientation( orientation );\n\tconst serializedColorStops = colorStops\n\t\t.sort( ( colorStop1, colorStop2 ) => {\n\t\t\tconst getNumericStopValue = (\n\t\t\t\tcolorStop: gradientParser.ColorStop\n\t\t\t) => {\n\t\t\t\treturn colorStop?.length?.value === undefined\n\t\t\t\t\t? 0\n\t\t\t\t\t: parseInt( colorStop.length.value );\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\tgetNumericStopValue( colorStop1 ) -\n\t\t\t\tgetNumericStopValue( colorStop2 )\n\t\t\t);\n\t\t} )\n\t\t.map( serializeGradientColorStop );\n\treturn `${ type }(${ [ serializedOrientation, ...serializedColorStops ]\n\t\t.filter( Boolean )\n\t\t.join( ',' ) })`;\n}\n"]}
@@ -11,9 +11,9 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
11
11
  */
12
12
  import { FlexBlock } from '../../flex';
13
13
  export const SelectWrapper = /*#__PURE__*/_styled(FlexBlock, process.env.NODE_ENV === "production" ? {
14
- target: "e99xvul1"
14
+ target: "e10bzpgi1"
15
15
  } : {
16
- target: "e99xvul1",
16
+ target: "e10bzpgi1",
17
17
  label: "SelectWrapper"
18
18
  })(process.env.NODE_ENV === "production" ? {
19
19
  name: "1gvx10y",
@@ -21,13 +21,13 @@ export const SelectWrapper = /*#__PURE__*/_styled(FlexBlock, process.env.NODE_EN
21
21
  } : {
22
22
  name: "1gvx10y",
23
23
  styles: "flex-grow:5",
24
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLWdyYWRpZW50LXBpY2tlci9zdHlsZXMvY3VzdG9tLWdyYWRpZW50LXBpY2tlci1zdHlsZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBU2dEIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLWdyYWRpZW50LXBpY2tlci9zdHlsZXMvY3VzdG9tLWdyYWRpZW50LXBpY2tlci1zdHlsZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW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kKCBGbGV4QmxvY2sgKWBcblx0ZmxleC1ncm93OiA1O1xuYDtcbiJdfQ== */",
25
25
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
26
26
  });
27
27
  export const AccessoryWrapper = /*#__PURE__*/_styled(FlexBlock, process.env.NODE_ENV === "production" ? {
28
- target: "e99xvul0"
28
+ target: "e10bzpgi0"
29
29
  } : {
30
- target: "e99xvul0",
30
+ target: "e10bzpgi0",
31
31
  label: "AccessoryWrapper"
32
32
  })(process.env.NODE_ENV === "production" ? {
33
33
  name: "1gvx10y",
@@ -35,7 +35,7 @@ export const AccessoryWrapper = /*#__PURE__*/_styled(FlexBlock, process.env.NODE
35
35
  } : {
36
36
  name: "1gvx10y",
37
37
  styles: "flex-grow:5",
38
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLWdyYWRpZW50LXBpY2tlci9zdHlsZXMvY3VzdG9tLWdyYWRpZW50LXBpY2tlci1zdHlsZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBYW1EIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLWdyYWRpZW50LXBpY2tlci9zdHlsZXMvY3VzdG9tLWdyYWRpZW50LXBpY2tlci1zdHlsZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBGbGV4QmxvY2sgfSBmcm9tICcuLi8uLi9mbGV4JztcblxuZXhwb3J0IGNvbnN0IFNlbGVjdFdyYXBwZXIgPSBzdHlsZWQoIEZsZXhCbG9jayApYFxuXHRmbGV4LWdyb3c6IDU7XG5gO1xuXG5leHBvcnQgY29uc3QgQWNjZXNzb3J5V3JhcHBlciA9IHN0eWxlZCggRmxleEJsb2NrIClgXG5cdGZsZXgtZ3JvdzogNTtcbmA7XG4iXX0= */",
38
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLWdyYWRpZW50LXBpY2tlci9zdHlsZXMvY3VzdG9tLWdyYWRpZW50LXBpY2tlci1zdHlsZXMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWFtRCIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL2N1c3RvbS1ncmFkaWVudC1waWNrZXIvc3R5bGVzL2N1c3RvbS1ncmFkaWVudC1waWNrZXItc3R5bGVzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IEZsZXhCbG9jayB9IGZyb20gJy4uLy4uL2ZsZXgnO1xuXG5leHBvcnQgY29uc3QgU2VsZWN0V3JhcHBlciA9IHN0eWxlZCggRmxleEJsb2NrIClgXG5cdGZsZXgtZ3JvdzogNTtcbmA7XG5cbmV4cG9ydCBjb25zdCBBY2Nlc3NvcnlXcmFwcGVyID0gc3R5bGVkKCBGbGV4QmxvY2sgKWBcblx0ZmxleC1ncm93OiA1O1xuYDtcbiJdfQ== */",
39
39
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
40
40
  });
41
41
  //# sourceMappingURL=custom-gradient-picker-styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/custom-gradient-picker/styles/custom-gradient-picker-styles.js"],"names":["FlexBlock","SelectWrapper","AccessoryWrapper"],"mappings":";;;;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,YAA1B;AAEA,OAAO,MAAMC,aAAa,GAAG,qBAAQD,SAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAnB;AAIP,OAAO,MAAME,gBAAgB,GAAG,qBAAQF,SAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n/**\n * Internal dependencies\n */\nimport { FlexBlock } from '../../flex';\n\nexport const SelectWrapper = styled( FlexBlock )`\n\tflex-grow: 5;\n`;\n\nexport const AccessoryWrapper = styled( FlexBlock )`\n\tflex-grow: 5;\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/custom-gradient-picker/styles/custom-gradient-picker-styles.tsx"],"names":["FlexBlock","SelectWrapper","AccessoryWrapper"],"mappings":";;;;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,YAA1B;AAEA,OAAO,MAAMC,aAAa,GAAG,qBAAQD,SAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAnB;AAIP,OAAO,MAAME,gBAAgB,GAAG,qBAAQF,SAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n/**\n * Internal dependencies\n */\nimport { FlexBlock } from '../../flex';\n\nexport const SelectWrapper = styled( FlexBlock )`\n\tflex-grow: 5;\n`;\n\nexport const AccessoryWrapper = styled( FlexBlock )`\n\tflex-grow: 5;\n`;\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -29,18 +29,23 @@ export function getGradientAstWithDefault(value) {
29
29
  // gradientAST will contain the gradient AST as parsed by gradient-parser npm module.
30
30
  // More information of its structure available at https://www.npmjs.com/package/gradient-parser#ast.
31
31
  let gradientAST;
32
+ let hasGradient = !!value;
33
+ const valueToParse = value !== null && value !== void 0 ? value : DEFAULT_GRADIENT;
32
34
 
33
35
  try {
34
- gradientAST = gradientParser.parse(value)[0];
35
- gradientAST.value = value;
36
+ gradientAST = gradientParser.parse(valueToParse)[0];
36
37
  } catch (error) {
38
+ // eslint-disable-next-line no-console
39
+ console.warn('wp.components.CustomGradientPicker failed to parse the gradient with error', error);
37
40
  gradientAST = gradientParser.parse(DEFAULT_GRADIENT)[0];
38
- gradientAST.value = DEFAULT_GRADIENT;
41
+ hasGradient = false;
39
42
  }
40
43
 
41
- if (((_gradientAST$orientat = gradientAST.orientation) === null || _gradientAST$orientat === void 0 ? void 0 : _gradientAST$orientat.type) === 'directional') {
42
- gradientAST.orientation.type = 'angular';
43
- gradientAST.orientation.value = DIRECTIONAL_ORIENTATION_ANGLE_MAP[gradientAST.orientation.value].toString();
44
+ if (!Array.isArray(gradientAST.orientation) && ((_gradientAST$orientat = gradientAST.orientation) === null || _gradientAST$orientat === void 0 ? void 0 : _gradientAST$orientat.type) === 'directional') {
45
+ gradientAST.orientation = {
46
+ type: 'angular',
47
+ value: DIRECTIONAL_ORIENTATION_ANGLE_MAP[gradientAST.orientation.value].toString()
48
+ };
44
49
  }
45
50
 
46
51
  if (gradientAST.colorStops.some(hasUnsupportedLength)) {
@@ -50,14 +55,16 @@ export function getGradientAstWithDefault(value) {
50
55
  const step = 100 / (colorStops.length - 1);
51
56
  colorStops.forEach((stop, index) => {
52
57
  stop.length = {
53
- value: step * index,
58
+ value: `${step * index}`,
54
59
  type: '%'
55
60
  };
56
61
  });
57
- gradientAST.value = serializeGradient(gradientAST);
58
62
  }
59
63
 
60
- return gradientAST;
64
+ return {
65
+ gradientAST,
66
+ hasGradient
67
+ };
61
68
  }
62
69
  export function getGradientAstWithControlPoints(gradientAST, newControlPoints) {
63
70
  return { ...gradientAST,
@@ -78,7 +85,7 @@ export function getGradientAstWithControlPoints(gradientAST, newControlPoints) {
78
85
  value: position === null || position === void 0 ? void 0 : position.toString()
79
86
  },
80
87
  type: a < 1 ? 'rgba' : 'rgb',
81
- value: a < 1 ? [r, g, b, a] : [r, g, b]
88
+ value: a < 1 ? [`${r}`, `${g}`, `${b}`, `${a}`] : [`${r}`, `${g}`, `${b}`]
82
89
  };
83
90
  })
84
91
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/custom-gradient-picker/utils.js"],"names":["gradientParser","colord","extend","namesPlugin","DEFAULT_GRADIENT","HORIZONTAL_GRADIENT_ORIENTATION","DIRECTIONAL_ORIENTATION_ANGLE_MAP","serializeGradient","getLinearGradientRepresentation","gradientAST","type","orientation","colorStops","hasUnsupportedLength","item","length","undefined","getGradientAstWithDefault","value","parse","error","toString","some","step","forEach","stop","index","getGradientAstWithControlPoints","newControlPoints","map","position","color","r","g","b","a","toRgb","getStopCssColor","colorStop","join"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,iBAA3B;AACA,SAASC,MAAT,EAAiBC,MAAjB,QAA+B,QAA/B;AACA,OAAOC,WAAP,MAAwB,sBAAxB;AAEA;AACA;AACA;;AACA,SACCC,gBADD,EAECC,+BAFD,EAGCC,iCAHD,QAIO,aAJP;AAKA,SAASC,iBAAT,QAAkC,cAAlC;AAEAL,MAAM,CAAE,CAAEC,WAAF,CAAF,CAAN;AAEA,OAAO,SAASK,+BAAT,CAA0CC,WAA1C,EAAwD;AAC9D,SAAOF,iBAAiB,CAAE;AACzBG,IAAAA,IAAI,EAAE,iBADmB;AAEzBC,IAAAA,W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oB,SAAS,CAAC5B,IAAM,IAAI4B,SAAS,CAACpB,KAAV,CAAgBqB,IAAhB,CAAsB,GAAtB,CAA6B,GAA5D;;AACD;AACC;AACA;AACA,aAAO,aAAP;AAXF;AAaA","sourcesContent":["/**\n * External dependencies\n */\nimport gradientParser from 'gradient-parser';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * Internal dependencies\n */\nimport {\n\tDEFAULT_GRADIENT,\n\tHORIZONTAL_GRADIENT_ORIENTATION,\n\tDIRECTIONAL_ORIENTATION_ANGLE_MAP,\n} from './constants';\nimport { serializeGradient } from './serializer';\n\nextend( [ namesPlugin ] );\n\nexport function getLinearGradientRepresentation( gradientAST ) {\n\treturn serializeGradient( {\n\t\ttype: 'linear-gradient',\n\t\torientation: HORIZONTAL_GRADIENT_ORIENTATION,\n\t\tcolorStops: gradientAST.colorStops,\n\t} );\n}\n\nfunction hasUnsupportedLength( item ) {\n\treturn item.length === undefined || item.length.type !== '%';\n}\n\nexport function getGradientAstWithDefault( value ) {\n\t// gradientAST will contain the gradient AST as parsed by gradient-parser npm module.\n\t// More information of its structure available at https://www.npmjs.com/package/gradient-parser#ast.\n\tlet gradientAST;\n\n\ttry {\n\t\tgradientAST = gradientParser.parse( value )[ 0 ];\n\t\tgradientAST.value = value;\n\t} catch ( error ) {\n\t\tgradientAST = gradientParser.parse( DEFAULT_GRADIENT )[ 0 ];\n\t\tgradientAST.value = DEFAULT_GRADIENT;\n\t}\n\n\tif ( gradientAST.orientation?.type === 'directional' ) {\n\t\tgradientAST.orientation.type = 'angular';\n\t\tgradientAST.orientation.value =\n\t\t\tDIRECTIONAL_ORIENTATION_ANGLE_MAP[\n\t\t\t\tgradientAST.orientation.value\n\t\t\t].toString();\n\t}\n\n\tif ( gradientAST.colorStops.some( hasUnsupportedLength ) ) {\n\t\tconst { colorStops } = gradientAST;\n\t\tconst step = 100 / ( colorStops.length - 1 );\n\t\tcolorStops.forEach( ( stop, index ) => {\n\t\t\tstop.length = {\n\t\t\t\tvalue: step * index,\n\t\t\t\ttype: '%',\n\t\t\t};\n\t\t} );\n\t\tgradientAST.value = serializeGradient( gradientAST );\n\t}\n\n\treturn gradientAST;\n}\n\nexport function getGradientAstWithControlPoints(\n\tgradientAST,\n\tnewControlPoints\n) {\n\treturn {\n\t\t...gradientAST,\n\t\tcolorStops: newControlPoints.map( ( { position, color } ) => {\n\t\t\tconst { r, g, b, a } = colord( color ).toRgb();\n\t\t\treturn {\n\t\t\t\tlength: {\n\t\t\t\t\ttype: '%',\n\t\t\t\t\tvalue: position?.toString(),\n\t\t\t\t},\n\t\t\t\ttype: a < 1 ? 'rgba' : 'rgb',\n\t\t\t\tvalue: a < 1 ? [ r, g, b, a ] : [ r, g, b ],\n\t\t\t};\n\t\t} ),\n\t};\n}\n\nexport function getStopCssColor( colorStop ) {\n\tswitch ( colorStop.type ) {\n\t\tcase 'hex':\n\t\t\treturn `#${ colorStop.value }`;\n\t\tcase 'literal':\n\t\t\treturn colorStop.value;\n\t\tcase 'rgb':\n\t\tcase 'rgba':\n\t\t\treturn `${ colorStop.type }(${ colorStop.value.join( ',' ) })`;\n\t\tdefault:\n\t\t\t// Should be unreachable if passing an AST from gradient-parser.\n\t\t\t// See https://github.com/rafaelcaricio/gradient-parser#ast.\n\t\t\treturn 'transparent';\n\t}\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/custom-gradient-picker/utils.ts"],"names":["gradientParser","colord","extend","namesPlugin","DEFAULT_GRADIENT","HORIZONTAL_GRADIENT_ORIENTATION","DIRECTIONAL_ORIENTATION_ANGLE_MAP","serializeGradient","getLinearGradientRepresentation","gradientAST","type","orientation","colorStops","hasUnsupportedLength","item","length","undefined","getGradientAstWithDefault","value","hasGradient","valueToParse","parse","error","console","warn","Array","isArray","toString","some","step","forEach","stop","index","getGradientAstWithControlPoints","newControlPoints","map","position","color","r","g","b","a","toRgb","getStopCssColor","colorStop","join"],"mappings":"AAAA;AACA;AACA;AACA,OA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,SADF;AAKNjB,QAAAA,IAAI,EAAE+B,CAAC,GAAG,CAAJ,GAAQ,MAAR,GAAiB,KALjB;AAMNvB,QAAAA,KAAK,EACJuB,CAAC,GAAG,CAAJ,GACG,CAAG,GAAGH,CAAG,EAAT,EAAa,GAAGC,CAAG,EAAnB,EAAuB,GAAGC,CAAG,EAA7B,EAAiC,GAAGC,CAAG,EAAvC,CADH,GAEG,CAAG,GAAGH,CAAG,EAAT,EAAa,GAAGC,CAAG,EAAnB,EAAuB,GAAGC,CAAG,EAA7B;AATE,OAAP;AAWA,KAbW;AAFN,GAAP;AAiBA;AAED,OAAO,SAASG,eAAT,CAA0BC,SAA1B,EAAgE;AACtE,UAASA,SAAS,CAAClC,IAAnB;AACC,SAAK,KAAL;AACC,aAAQ,IAAIkC,SAAS,CAAC1B,KAAO,EAA7B;;AACD,SAAK,SAAL;AACC,aAAO0B,SAAS,CAAC1B,KAAjB;;AACD,SAAK,KAAL;AACA,SAAK,MAAL;AACC,aAAQ,GAAG0B,SAAS,CAAClC,IAAM,IAAIkC,SAAS,CAAC1B,KAAV,CAAgB2B,IAAhB,CAAsB,GAAtB,CAA6B,GAA5D;;AACD;AACC;AACA;AACA,aAAO,aAAP;AAXF;AAaA","sourcesContent":["/**\n * External dependencies\n */\nimport gradientParser from 'gradient-parser';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * Internal dependencies\n */\nimport {\n\tDEFAULT_GRADIENT,\n\tHORIZONTAL_GRADIENT_ORIENTATION,\n\tDIRECTIONAL_ORIENTATION_ANGLE_MAP,\n} from './constants';\nimport { serializeGradient } from './serializer';\nimport type { ControlPoint } from './types';\n\nextend( [ namesPlugin ] );\n\nexport function getLinearGradientRepresentation(\n\tgradientAST: gradientParser.GradientNode\n) {\n\treturn serializeGradient( {\n\t\ttype: 'linear-gradient',\n\t\torientation: HORIZONTAL_GRADIENT_ORIENTATION,\n\t\tcolorStops: gradientAST.colorStops,\n\t} );\n}\n\nfunction hasUnsupportedLength( item: gradientParser.ColorStop ) {\n\treturn item.length === undefined || item.length.type !== '%';\n}\n\nexport function getGradientAstWithDefault( value?: string | null ) {\n\t// gradientAST will contain the gradient AST as parsed by gradient-parser npm module.\n\t// More information of its structure available at https://www.npmjs.com/package/gradient-parser#ast.\n\tlet gradientAST: gradientParser.GradientNode | undefined;\n\tlet hasGradient = !! value;\n\n\tconst valueToParse = value ?? DEFAULT_GRADIENT;\n\n\ttry {\n\t\tgradientAST = gradientParser.parse( valueToParse )[ 0 ];\n\t} catch ( error ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t'wp.components.CustomGradientPicker failed to parse the gradient with error',\n\t\t\terror\n\t\t);\n\n\t\tgradientAST = gradientParser.parse( DEFAULT_GRADIENT )[ 0 ];\n\t\thasGradient = false;\n\t}\n\n\tif (\n\t\t! Array.isArray( gradientAST.orientation ) &&\n\t\tgradientAST.orientation?.type === 'directional'\n\t) {\n\t\tgradientAST.orientation = {\n\t\t\ttype: 'angular',\n\t\t\tvalue: DIRECTIONAL_ORIENTATION_ANGLE_MAP[\n\t\t\t\tgradientAST.orientation.value\n\t\t\t].toString(),\n\t\t};\n\t}\n\n\tif ( gradientAST.colorStops.some( hasUnsupportedLength ) ) {\n\t\tconst { colorStops } = gradientAST;\n\t\tconst step = 100 / ( colorStops.length - 1 );\n\t\tcolorStops.forEach( ( stop, index ) => {\n\t\t\tstop.length = {\n\t\t\t\tvalue: `${ step * index }`,\n\t\t\t\ttype: '%',\n\t\t\t};\n\t\t} );\n\t}\n\n\treturn { gradientAST, hasGradient };\n}\n\nexport function getGradientAstWithControlPoints(\n\tgradientAST: gradientParser.GradientNode,\n\tnewControlPoints: ControlPoint[]\n) {\n\treturn {\n\t\t...gradientAST,\n\t\tcolorStops: newControlPoints.map( ( { position, color } ) => {\n\t\t\tconst { r, g, b, a } = colord( color ).toRgb();\n\t\t\treturn {\n\t\t\t\tlength: {\n\t\t\t\t\ttype: '%',\n\t\t\t\t\tvalue: position?.toString(),\n\t\t\t\t},\n\t\t\t\ttype: a < 1 ? 'rgba' : 'rgb',\n\t\t\t\tvalue:\n\t\t\t\t\ta < 1\n\t\t\t\t\t\t? [ `${ r }`, `${ g }`, `${ b }`, `${ a }` ]\n\t\t\t\t\t\t: [ `${ r }`, `${ g }`, `${ b }` ],\n\t\t\t};\n\t\t} ),\n\t} as gradientParser.GradientNode;\n}\n\nexport function getStopCssColor( colorStop: gradientParser.ColorStop ) {\n\tswitch ( colorStop.type ) {\n\t\tcase 'hex':\n\t\t\treturn `#${ colorStop.value }`;\n\t\tcase 'literal':\n\t\t\treturn colorStop.value;\n\t\tcase 'rgb':\n\t\tcase 'rgba':\n\t\t\treturn `${ colorStop.type }(${ colorStop.value.join( ',' ) })`;\n\t\tdefault:\n\t\t\t// Should be unreachable if passing an AST from gradient-parser.\n\t\t\t// See https://github.com/rafaelcaricio/gradient-parser#ast.\n\t\t\treturn 'transparent';\n\t}\n}\n"]}
@@ -13,8 +13,33 @@ import { __ } from '@wordpress/i18n';
13
13
  * Internal dependencies
14
14
  */
15
15
 
16
- import { Icon, SelectControl } from '../';
16
+ import Icon from '../icon';
17
+ import SelectControl from '../select-control';
17
18
  import sizesTable, { findSizeBySlug } from './sizes';
19
+
20
+ /**
21
+ * `DimensionControl` is a component designed to provide a UI to control spacing and/or dimensions.
22
+ *
23
+ * This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
24
+ *
25
+ * ```jsx
26
+ * import { useState } from 'react';
27
+ * import { __experimentalDimensionControl as DimensionControl } from '@wordpress/components';
28
+ *
29
+ * export default function MyCustomDimensionControl() {
30
+ * const [ paddingSize, setPaddingSize ] = useState( '' );
31
+ *
32
+ * return (
33
+ * <DimensionControl
34
+ * label={ 'Padding' }
35
+ * icon={ 'desktop' }
36
+ * onChange={ ( value ) => setPaddingSize( value ) }
37
+ * value={ paddingSize }
38
+ * />
39
+ * );
40
+ * }
41
+ * ```
42
+ */
18
43
  export function DimensionControl(props) {
19
44
  const {
20
45
  label,
@@ -29,7 +54,7 @@ export function DimensionControl(props) {
29
54
  const theSize = findSizeBySlug(sizes, val);
30
55
 
31
56
  if (!theSize || value === theSize.slug) {
32
- onChange(undefined);
57
+ onChange === null || onChange === void 0 ? void 0 : onChange(undefined);
33
58
  } else if (typeof onChange === 'function') {
34
59
  onChange(theSize.slug);
35
60
  }
@@ -49,7 +74,7 @@ export function DimensionControl(props) {
49
74
  return [{
50
75
  label: __('Default'),
51
76
  value: ''
52
- }].concat(options);
77
+ }, ...options];
53
78
  };
54
79
 
55
80
  const selectLabel = createElement(Fragment, null, icon && createElement(Icon, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/dimension-control/index.js"],"names":["classnames","__","Icon","SelectControl","sizesTable","findSizeBySlug","DimensionControl","props","label","value","sizes","icon","onChange","className","onChangeSpacingSize","val","theSize","slug","undefined","formatSizesAsOptions","theSizes","options","map","name","concat","selectLabel"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,EAAeC,aAAf,QAAoC,KAApC;AACA,OAAOC,UAAP,IAAqBC,cAArB,QAA2C,SAA3C;AAEA,OAAO,SAASC,gBAAT,CAA2BC,KAA3B,EAAmC;AACzC,QAAM;AACLC,IAAAA,KADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,KAAK,GAAGN,UAHH;AAILO,IAAAA,IAJK;AAKLC,IAAAA,QALK;AAMLC,IAAAA,SAAS,GAAG;AANP,MAOFN,KAPJ;;AASA,QAAMO,mBAAmB,GAAKC,GAAF,IAAW;AACtC,UAAMC,OAAO,GAAGX,cAAc,CAAEK,KAAF,EAASK,GAAT,CAA9B;;AAEA,QAAK,CAAEC,OAAF,IAAaP,KAAK,KAAKO,OAAO,CAACC,IAApC,EAA2C;AAC1CL,MAAAA,QAAQ,CAAEM,SAAF,CAAR;AACA,KAFD,MAEO,IAAK,OAAON,QAAP,KAAoB,UAAzB,EAAsC;AAC5CA,MAAAA,QAAQ,CAAEI,OAAO,CAACC,IAAV,CAAR;AACA;AACD,GARD;;AAUA,QAAME,oBAAoB,GAAKC,QAAF,IAAgB;AAC5C,UAAMC,OAAO,GAAGD,QAAQ,CAACE,GAAT,CAAc;AAAA,UAAE;AAAEC,QAAAA,IAAF;AAAQN,QAAAA;AAAR,OAAF;AAAA,aAAwB;AACrDT,QAAAA,KAAK,EAAEe,IAD8C;AAErDd,QAAAA,KAAK,EAAEQ;AAF8C,OAAxB;AAAA,KAAd,CAAhB;AAKA,WAAO,CACN;AACCT,MAAAA,KAAK,EAAEP,EAAE,CAAE,SAAF,CADV;AAECQ,MAAAA,KAAK,EAAE;AAFR,KADM,EAKLe,MALK,CAKGH,OALH,CAAP;AAMA,GAZD;;AAcA,QAAMI,WAAW,GAChB,8BACGd,IAAI,IAAI,cAAC,IAAD;AAAM,IAAA,IAAI,EAAGA;AAAb,IADX,EAEGH,KAFH,CADD;AAOA,SACC,cAAC,aAAD;AACC,IAAA,SAAS,EAAGR,UAAU,CACrBa,SADqB,EAErB,gCAFqB,CADvB;AAKC,IAAA,KAAK,EAAGY,WALT;AAMC,IAAA,mBAAmB,EAAG,KANvB;AAOC,IAAA,KAAK,EAAGhB,KAPT;AAQC,IAAA,QAAQ,EAAGK,mBARZ;AASC,IAAA,OAAO,EAAGK,oBAAoB,CAAET,KAAF;AAT/B,IADD;AAaA;AAED,eAAeJ,gBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Icon, SelectControl } from '../';\nimport sizesTable, { findSizeBySlug } from './sizes';\n\nexport function DimensionControl( props ) {\n\tconst {\n\t\tlabel,\n\t\tvalue,\n\t\tsizes = sizesTable,\n\t\ticon,\n\t\tonChange,\n\t\tclassName = '',\n\t} = props;\n\n\tconst onChangeSpacingSize = ( val ) => {\n\t\tconst theSize = findSizeBySlug( sizes, val );\n\n\t\tif ( ! theSize || value === theSize.slug ) {\n\t\t\tonChange( undefined );\n\t\t} else if ( typeof onChange === 'function' ) {\n\t\t\tonChange( theSize.slug );\n\t\t}\n\t};\n\n\tconst formatSizesAsOptions = ( theSizes ) => {\n\t\tconst options = theSizes.map( ( { name, slug } ) => ( {\n\t\t\tlabel: name,\n\t\t\tvalue: slug,\n\t\t} ) );\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: __( 'Default' ),\n\t\t\t\tvalue: '',\n\t\t\t},\n\t\t].concat( options );\n\t};\n\n\tconst selectLabel = (\n\t\t<>\n\t\t\t{ icon && <Icon icon={ icon } /> }\n\t\t\t{ label }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<SelectControl\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'block-editor-dimension-control'\n\t\t\t) }\n\t\t\tlabel={ selectLabel }\n\t\t\thideLabelFromVision={ false }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChangeSpacingSize }\n\t\t\toptions={ formatSizesAsOptions( sizes ) }\n\t\t/>\n\t);\n}\n\nexport default DimensionControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/dimension-control/index.tsx"],"names":["classnames","__","Icon","SelectControl","sizesTable","findSizeBySlug","DimensionControl","props","label","value","sizes","icon","onChange","className","onChangeSpacingSize","val","theSize","slug","undefined","formatSizesAsOptions","theSizes","options","map","name","selectLabel"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,UAAP,IAAqBC,cAArB,QAA2C,SAA3C;;AAIA;AACA;AACA;AACA;AACA;A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A,SAAS,EAAGR,UAAU,CACrBa,SADqB,EAErB,gCAFqB,CADvB;AAKC,IAAA,KAAK,EAAGW,WALT;AAMC,IAAA,mBAAmB,EAAG,KANvB;AAOC,IAAA,KAAK,EAAGf,KAPT;AAQC,IAAA,QAAQ,EAAGK,mBARZ;AASC,IAAA,OAAO,EAAGK,oBAAoB,CAAET,KAAF;AAT/B,IADD;AAaA;AAED,eAAeJ,gBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Icon from '../icon';\nimport SelectControl from '../select-control';\nimport sizesTable, { findSizeBySlug } from './sizes';\nimport type { DimensionControlProps, Size } from './types';\nimport type { SelectControlSingleSelectionProps } from '../select-control/types';\n\n/**\n * `DimensionControl` is a component designed to provide a UI to control spacing and/or dimensions.\n *\n * This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.\n *\n * ```jsx\n * import { useState } from 'react';\n * import { __experimentalDimensionControl as DimensionControl } from '@wordpress/components';\n *\n * export default function MyCustomDimensionControl() {\n * \tconst [ paddingSize, setPaddingSize ] = useState( '' );\n *\n * \treturn (\n * \t\t<DimensionControl\n * \t\t\tlabel={ 'Padding' }\n * \t\t\ticon={ 'desktop' }\n * \t\t\tonChange={ ( value ) => setPaddingSize( value ) }\n * \t\t\tvalue={ paddingSize }\n * \t\t/>\n * \t);\n * }\n * ```\n */\nexport function DimensionControl( props: DimensionControlProps ) {\n\tconst {\n\t\tlabel,\n\t\tvalue,\n\t\tsizes = sizesTable,\n\t\ticon,\n\t\tonChange,\n\t\tclassName = '',\n\t} = props;\n\n\tconst onChangeSpacingSize: SelectControlSingleSelectionProps[ 'onChange' ] =\n\t\t( val ) => {\n\t\t\tconst theSize = findSizeBySlug( sizes, val );\n\n\t\t\tif ( ! theSize || value === theSize.slug ) {\n\t\t\t\tonChange?.( undefined );\n\t\t\t} else if ( typeof onChange === 'function' ) {\n\t\t\t\tonChange( theSize.slug );\n\t\t\t}\n\t\t};\n\n\tconst formatSizesAsOptions = ( theSizes: Size[] ) => {\n\t\tconst options = theSizes.map( ( { name, slug } ) => ( {\n\t\t\tlabel: name,\n\t\t\tvalue: slug,\n\t\t} ) );\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: __( 'Default' ),\n\t\t\t\tvalue: '',\n\t\t\t},\n\t\t\t...options,\n\t\t];\n\t};\n\n\tconst selectLabel = (\n\t\t<>\n\t\t\t{ icon && <Icon icon={ icon } /> }\n\t\t\t{ label }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<SelectControl\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'block-editor-dimension-control'\n\t\t\t) }\n\t\t\tlabel={ selectLabel }\n\t\t\thideLabelFromVision={ false }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChangeSpacingSize }\n\t\t\toptions={ formatSizesAsOptions( sizes ) }\n\t\t/>\n\t);\n}\n\nexport default DimensionControl;\n"]}
@@ -11,16 +11,17 @@
11
11
  * WordPress dependencies
12
12
  */
13
13
  import { _x } from '@wordpress/i18n';
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+
14
18
  /**
15
19
  * Finds the correct size object from the provided sizes
16
20
  * table by size slug (eg: `medium`)
17
21
  *
18
- * @param {Array} sizes containing objects for each size definition.
19
- * @param {string} slug a string representation of the size (eg: `medium`).
20
- *
21
- * @return {Object} the matching size definition.
22
+ * @param sizes containing objects for each size definition.
23
+ * @param slug a string representation of the size (eg: `medium`).
22
24
  */
23
-
24
25
  export const findSizeBySlug = (sizes, slug) => sizes.find(size => slug === size.slug);
25
26
  export default [{
26
27
  name: _x('None', 'Size of a UI element'),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/dimension-control/sizes.js"],"names":["_x","findSizeBySlug","sizes","slug","find","size","name"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,cAAc,GAAG,CAAEC,KAAF,EAASC,IAAT,KAC7BD,KAAK,CAACE,IAAN,CAAcC,IAAF,IAAYF,IAAI,KAAKE,IAAI,CAACF,IAAtC,CADM;AAGP,eAAe,CACd;AACCG,EAAAA,IAAI,EAAEN,EAAE,CAAE,MAAF,EAAU,sBAAV,CADT;AAECG,EAAAA,IAAI,EAAE;AAFP,CADc,EAKd;AACCG,EAAAA,IAAI,EAAEN,EAAE,CAAE,OAAF,EAAW,sBAAX,CADT;AAECG,EAAAA,IAAI,EAAE;AAFP,CALc,EASd;AACCG,EAAAA,IAAI,EAAEN,EAAE,CAAE,QAAF,EAAY,sBAAZ,CADT;AAECG,EAAAA,IAAI,EAAE;AAFP,CATc,EAad;AACCG,EAAAA,IAAI,EAAEN,EAAE,CAAE,OAAF,EAAW,sBAAX,CADT;AAECG,EAAAA,IAAI,EAAE;AAFP,CAbc,EAiBd;AACCG,EAAAA,IAAI,EAAEN,EAAE,CAAE,aAAF,EAAiB,sBAAjB,CADT;AAECG,EAAAA,IAAI,EAAE;AAFP,CAjBc,CAAf","sourcesContent":["/**\n * Sizes\n *\n * defines the sizes used in dimension controls\n * all hardcoded `size` values are based on the value of\n * the Sass variable `$block-padding` from\n * `packages/block-editor/src/components/dimension-control/sizes.js`.\n */\n\n/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Finds the correct size object from the provided sizes\n * table by size slug (eg: `medium`)\n *\n * @param {Array} sizes containing objects for each size definition.\n * @param {string} slug a string representation of the size (eg: `medium`).\n *\n * @return {Object} the matching size definition.\n */\nexport const findSizeBySlug = ( sizes, slug ) =>\n\tsizes.find( ( size ) => slug === size.slug );\n\nexport default [\n\t{\n\t\tname: _x( 'None', 'Size of a UI element' ),\n\t\tslug: 'none',\n\t},\n\t{\n\t\tname: _x( 'Small', 'Size of a UI element' ),\n\t\tslug: 'small',\n\t},\n\t{\n\t\tname: _x( 'Medium', 'Size of a UI element' ),\n\t\tslug: 'medium',\n\t},\n\t{\n\t\tname: _x( 'Large', 'Size of a UI element' ),\n\t\tslug: 'large',\n\t},\n\t{\n\t\tname: _x( 'Extra Large', 'Size of a UI element' ),\n\t\tslug: 'xlarge',\n\t},\n];\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/dimension-control/sizes.ts"],"names":["_x","findSizeBySlug","sizes","slug","find","size","name"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG,CAAEC,KAAF,EAAiBC,IAAjB,KAC7BD,KAAK,CAACE,IAAN,CAAcC,IAAF,IAAYF,IAAI,KAAKE,IAAI,CAACF,IAAtC,CADM;AAGP,eAAe,CACd;AACCG,EAAAA,IAAI,EAAEN,EAAE,CAAE,MAAF,EAAU,sBAAV,CADT;AAECG,EAAAA,IAAI,EAAE;AAFP,CADc,EAKd;AACCG,EAAAA,IAAI,EAAEN,EAAE,CAAE,OAAF,EAAW,sBAAX,CADT;AAECG,EAAAA,IAAI,EAAE;AAFP,CALc,EASd;AACCG,EAAAA,IAAI,EAAEN,EAAE,CAAE,QAAF,EAAY,sBAAZ,CADT;AAECG,EAAAA,IAAI,EAAE;AAFP,CATc,EAad;AACCG,EAAAA,IAAI,EAAEN,EAAE,CAAE,OAAF,EAAW,sBAAX,CADT;AAECG,EAAAA,IAAI,EAAE;AAFP,CAbc,EAiBd;AACCG,EAAAA,IAAI,EAAEN,EAAE,CAAE,aAAF,EAAiB,sBAAjB,CADT;AAECG,EAAAA,IAAI,EAAE;AAFP,CAjBc,CAAf","sourcesContent":["/**\n * Sizes\n *\n * defines the sizes used in dimension controls\n * all hardcoded `size` values are based on the value of\n * the Sass variable `$block-padding` from\n * `packages/block-editor/src/components/dimension-control/sizes.js`.\n */\n\n/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { Size } from './types';\n\n/**\n * Finds the correct size object from the provided sizes\n * table by size slug (eg: `medium`)\n *\n * @param sizes containing objects for each size definition.\n * @param slug a string representation of the size (eg: `medium`).\n */\nexport const findSizeBySlug = ( sizes: Size[], slug: string ) =>\n\tsizes.find( ( size ) => slug === size.slug );\n\nexport default [\n\t{\n\t\tname: _x( 'None', 'Size of a UI element' ),\n\t\tslug: 'none',\n\t},\n\t{\n\t\tname: _x( 'Small', 'Size of a UI element' ),\n\t\tslug: 'small',\n\t},\n\t{\n\t\tname: _x( 'Medium', 'Size of a UI element' ),\n\t\tslug: 'medium',\n\t},\n\t{\n\t\tname: _x( 'Large', 'Size of a UI element' ),\n\t\tslug: 'large',\n\t},\n\t{\n\t\tname: _x( 'Extra Large', 'Size of a UI element' ),\n\t\tslug: 'xlarge',\n\t},\n];\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -9,11 +9,11 @@ import { swatch } from '@wordpress/icons';
9
9
  * Internal dependencies
10
10
  */
11
11
 
12
- import Button from '../button';
13
- import ColorPalette from '../color-palette';
14
- import ColorIndicator from '../color-indicator';
15
- import Icon from '../icon';
16
- import { HStack } from '../h-stack';
12
+ import Button from '../../button';
13
+ import ColorPalette from '../../color-palette';
14
+ import ColorIndicator from '../../color-indicator';
15
+ import Icon from '../../icon';
16
+ import { HStack } from '../../h-stack';
17
17
 
18
18
  function ColorOption(_ref) {
19
19
  let {
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/components/src/duotone-picker/color-list-picker/index.tsx"],"names":["useState","swatch","Button","ColorPalette","ColorIndicator","Icon","HStack","ColorOption","label","value","colors","disableCustomColors","enableAlpha","onChange","isOpen","setIsOpen","prev","ColorListPicker","labels","map","index","newColor","newColors","slice"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,oBAAzB;AACA,SAASC,MAAT,QAAuB,kBAAvB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,OAAOC,YAAP,MAAyB,qBAAzB;AACA,OAAOC,cAAP,MAA2B,uBAA3B;AACA,OAAOC,IAAP,MAAiB,YAAjB;AACA,SAASC,MAAT,QAAuB,eAAvB;;AAGA,SAASC,WAAT,OAOsB;AAAA,MAPA;AACrBC,IAAAA,KADqB;AAErBC,IAAAA,KAFqB;AAGrBC,IAAAA,MAHqB;AAIrBC,IAAAA,mBAJqB;AAKrBC,IAAAA,WALqB;AAMrBC,IAAAA;AANqB,GAOA;AACrB,QAAM,CAAEC,MAAF,EAAUC,SAAV,IAAwBf,QAAQ,CAAE,KAAF,CAAtC;AACA,SACC,8BACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,6CADX;AAEC,IAAA,OAAO,EAAG,MAAMe,SAAS,CAAIC,IAAF,IAAY,CAAEA,IAAhB;AAF1B,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC,YAAhB;AAA6B,IAAA,OAAO,EAAG;AAAvC,KACGP,KAAK,GACN,cAAC,cAAD;AACC,IAAA,UAAU,EAAGA,KADd;AAEC,IAAA,SAAS,EAAC;AAFX,IADM,GAMN,cAAC,IAAD;AAAM,IAAA,IAAI,EAAGR;AAAb,IAPF,EASC,4BAAQO,KAAR,CATD,CAJD,CADD,EAiBGM,MAAM,IACP,cAAC,YAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,MAAM,EAAGJ,MAFV;AAGC,IAAA,KAAK,EAAGD,KAHT;AAIC,IAAA,SAAS,EAAG,KAJb;AAKC,IAAA,QAAQ,EAAGI,QALZ;AAMC,IAAA,mBAAmB,EAAGF,mBANvB;AAOC,IAAA,WAAW,EAAGC;AAPf,IAlBF,CADD;AA+BA;;AAED,SAASK,eAAT,QAO0B;AAAA,MAPA;AACzBP,IAAAA,MADyB;AAEzBQ,IAAAA,MAFyB;AAGzBT,IAAAA,KAAK,GAAG,EAHiB;AAIzBE,IAAAA,mBAJyB;AAKzBC,IAAAA,WALyB;AAMzBC,IAAAA;AANyB,GAOA;AACzB,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGK,MAAM,CAACC,GAAP,CAAY,CAAEX,KAAF,EAASY,KAAT,KACb,cAAC,WAAD;AACC,IAAA,GAAG,EAAGA,KADP;AAEC,IAAA,KAAK,EAAGZ,KAFT;AAGC,IAAA,KAAK,EAAGC,KAAK,CAAEW,KAAF,CAHd;AAIC,IAAA,MAAM,EAAGV,MAJV;AAKC,IAAA,mBAAmB,EAAGC,mBALvB;AAMC,IAAA,WAAW,EAAGC,WANf;AAOC,IAAA,QAAQ,EAAKS,QAAF,IAAgB;AAC1B,YAAMC,SAAmC,GACxCb,KAAK,CAACc,KAAN,EADD;AAEAD,MAAAA,SAAS,CAAEF,KAAF,CAAT,GAAqBC,QAArB;AACAR,MAAAA,QAAQ,CAAES,SAAF,CAAR;AACA;AAZF,IADC,CADH,CADD;AAoBA;;AAED,eAAeL,eAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { swatch } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport ColorPalette from '../../color-palette';\nimport ColorIndicator from '../../color-indicator';\nimport Icon from '../../icon';\nimport { HStack } from '../../h-stack';\nimport type { ColorListPickerProps, ColorOptionProps } from './types';\n\nfunction ColorOption( {\n\tlabel,\n\tvalue,\n\tcolors,\n\tdisableCustomColors,\n\tenableAlpha,\n\tonChange,\n}: ColorOptionProps ) {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tclassName=\"components-color-list-picker__swatch-button\"\n\t\t\t\tonClick={ () => setIsOpen( ( prev ) => ! prev ) }\n\t\t\t>\n\t\t\t\t<HStack justify=\"flex-start\" spacing={ 2 }>\n\t\t\t\t\t{ value ? (\n\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\tcolorValue={ value }\n\t\t\t\t\t\t\tclassName=\"components-color-list-picker__swatch-color\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Icon icon={ swatch } />\n\t\t\t\t\t) }\n\t\t\t\t\t<span>{ label }</span>\n\t\t\t\t</HStack>\n\t\t\t</Button>\n\t\t\t{ isOpen && (\n\t\t\t\t<ColorPalette\n\t\t\t\t\tclassName=\"components-color-list-picker__color-picker\"\n\t\t\t\t\tcolors={ colors }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tclearable={ false }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction ColorListPicker( {\n\tcolors,\n\tlabels,\n\tvalue = [],\n\tdisableCustomColors,\n\tenableAlpha,\n\tonChange,\n}: ColorListPickerProps ) {\n\treturn (\n\t\t<div className=\"components-color-list-picker\">\n\t\t\t{ labels.map( ( label, index ) => (\n\t\t\t\t<ColorOption\n\t\t\t\t\tkey={ index }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tvalue={ value[ index ] }\n\t\t\t\t\tcolors={ colors }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\tonChange={ ( newColor ) => {\n\t\t\t\t\t\tconst newColors: ( string | undefined )[] =\n\t\t\t\t\t\t\tvalue.slice();\n\t\t\t\t\t\tnewColors[ index ] = newColor;\n\t\t\t\t\t\tonChange( newColors );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n\nexport default ColorListPicker;\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/duotone-picker/custom-duotone-bar.js"],"names":["CustomGradientBar","getColorStopsFromColors","getGradientFromCSSColors","getColorsFromColorStops","PLACEHOLDER_VALUES","CustomDuotoneBar","value","onChange","hasGradient","values","background","controlPoints","newColorStops","newValue"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,iBAAP,MAA8B,wCAA9B;AAEA,SACCC,uBADD,EAECC,wBAFD,EAGCC,uBAHD,QAIO,SAJP;AAMA,MAAMC,kBAAkB,GAAG,CAAE,MAAF,EAAU,MAAV,CAA3B;AAEA,eAAe,SAASC,gBAAT,OAAiD;AAAA,MAAtB;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAsB;AAC/D,QAAMC,WAAW,GAAG,CAAC,CAAEF,KAAvB;AACA,QAAMG,MAAM,GAAGD,WAAW,GAAGF,KAAH,GAAWF,kBAArC;AACA,QAAMM,UAAU,GAAGR,wBAAwB,CAAEO,MAAF,CAA3C;AACA,QAAME,aAAa,GAAGV,uBAAuB,CAAEQ,MAAF,CAA7C;AACA,SACC,cAAC,iBAAD;AACC,IAAA,eAAe,MADhB;AAEC,IAAA,UAAU,EAAGC,UAFd;AAGC,IAAA,WAAW,EAAGF,WAHf;AAIC,IAAA,KAAK,EAAGG,aAJT;AAKC,IAAA,QAAQ,EAAKC,aAAF,IAAqB;AAC/B,YAAMC,QAAQ,GAAGV,uBAAuB,CAAES,aAAF,CAAxC;AACAL,MAAAA,QAAQ,CAAEM,QAAF,CAAR;AACA;AARF,IADD;AAYA","sourcesContent":["/**\n * Internal dependencies\n */\nimport CustomGradientBar from '../custom-gradient-picker/gradient-bar';\n\nimport {\n\tgetColorStopsFromColors,\n\tgetGradientFromCSSColors,\n\tgetColorsFromColorStops,\n} from './utils';\n\nconst PLACEHOLDER_VALUES = [ '#333', '#CCC' ];\n\nexport default function CustomDuotoneBar( { value, onChange } ) {\n\tconst hasGradient = !! value;\n\tconst values = hasGradient ? value : PLACEHOLDER_VALUES;\n\tconst background = getGradientFromCSSColors( values );\n\tconst controlPoints = getColorStopsFromColors( values );\n\treturn (\n\t\t<CustomGradientBar\n\t\t\tdisableInserter\n\t\t\tbackground={ background }\n\t\t\thasGradient={ hasGradient }\n\t\t\tvalue={ controlPoints }\n\t\t\tonChange={ ( newColorStops ) => {\n\t\t\t\tconst newValue = getColorsFromColorStops( newColorStops );\n\t\t\t\tonChange( newValue );\n\t\t\t} }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/duotone-picker/custom-duotone-bar.tsx"],"names":["CustomGradientBar","getColorStopsFromColors","getGradientFromCSSColors","getColorsFromColorStops","PLACEHOLDER_VALUES","CustomDuotoneBar","value","onChange","hasGradient","values","background","controlPoints","newColorStops","newValue"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,iBAAP,MAA8B,wCAA9B;AAEA,SACCC,uBADD,EAECC,wBAFD,EAGCC,uBAHD,QAIO,SAJP;AAMA,MAAMC,kBAAkB,GAAG,CAAE,MAAF,EAAU,MAAV,CAA3B;AAEA,eAAe,SAASC,gBAAT,OAMX;AAAA,MANsC;AACzCC,IAAAA,KADyC;AAEzCC,IAAAA;AAFyC,GAMtC;AACH,QAAMC,WAAW,GAAG,CAAC,CAAEF,KAAvB;AACA,QAAMG,MAAM,GAAGD,WAAW,GAAGF,KAAH,GAAWF,kBAArC;AACA,QAAMM,UAAU,GAAGR,wBAAwB,CAAEO,MAAF,CAA3C;AACA,QAAME,aAAa,GAAGV,uBAAuB,CAAEQ,MAAF,CAA7C;AACA,SACC,cAAC,iBAAD;AACC,IAAA,eAAe,MADhB;AAEC,IAAA,UAAU,EAAGC,UAFd;AAGC,IAAA,WAAW,EAAGF,WAHf;AAIC,IAAA,KAAK,EAAGG,aAJT;AAKC,IAAA,QAAQ,EAAKC,aAAF,IAAqB;AAC/B,YAAMC,QAAQ,GAAGV,uBAAuB,CAAES,aAAF,CAAxC;AACAL,MAAAA,QAAQ,CAAEM,QAAF,CAAR;AACA;AARF,IADD;AAYA","sourcesContent":["/**\n * Internal dependencies\n */\nimport CustomGradientBar from '../custom-gradient-picker/gradient-bar';\n\nimport {\n\tgetColorStopsFromColors,\n\tgetGradientFromCSSColors,\n\tgetColorsFromColorStops,\n} from './utils';\n\nconst PLACEHOLDER_VALUES = [ '#333', '#CCC' ];\n\nexport default function CustomDuotoneBar( {\n\tvalue,\n\tonChange,\n}: {\n\tvalue?: string[];\n\tonChange: ( value?: string[] ) => void;\n} ) {\n\tconst hasGradient = !! value;\n\tconst values = hasGradient ? value : PLACEHOLDER_VALUES;\n\tconst background = getGradientFromCSSColors( values );\n\tconst controlPoints = getColorStopsFromColors( values );\n\treturn (\n\t\t<CustomGradientBar\n\t\t\tdisableInserter\n\t\t\tbackground={ background }\n\t\t\thasGradient={ hasGradient }\n\t\t\tvalue={ controlPoints }\n\t\t\tonChange={ ( newColorStops ) => {\n\t\t\t\tconst newValue = getColorsFromColorStops( newColorStops );\n\t\t\t\tonChange( newValue );\n\t\t\t} }\n\t\t/>\n\t);\n}\n"]}