@wordpress/components 27.5.0 → 27.6.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 (938) hide show
  1. package/CHANGELOG.md +25 -5
  2. package/build/alignment-matrix-control/icon.js +2 -2
  3. package/build/alignment-matrix-control/icon.js.map +1 -1
  4. package/build/alignment-matrix-control/index.js +2 -2
  5. package/build/alignment-matrix-control/index.js.map +1 -1
  6. package/build/angle-picker-control/index.js +2 -2
  7. package/build/angle-picker-control/index.js.map +1 -1
  8. package/build/animate/index.js +4 -4
  9. package/build/animate/index.js.map +1 -1
  10. package/build/autocomplete/autocompleter-ui.js +2 -2
  11. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  12. package/build/base-control/hooks.js +1 -4
  13. package/build/base-control/hooks.js.map +1 -1
  14. package/build/base-control/index.js +2 -2
  15. package/build/base-control/index.js.map +1 -1
  16. package/build/base-control/types.js.map +1 -1
  17. package/build/border-control/types.js.map +1 -1
  18. package/build/button/index.js +2 -2
  19. package/build/button/index.js.map +1 -1
  20. package/build/button-group/index.js +2 -2
  21. package/build/button-group/index.js.map +1 -1
  22. package/build/checkbox-control/index.js +2 -2
  23. package/build/checkbox-control/index.js.map +1 -1
  24. package/build/circular-option-picker/circular-option-picker-actions.js +3 -3
  25. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  26. package/build/circular-option-picker/circular-option-picker-option-group.js +2 -2
  27. package/build/circular-option-picker/circular-option-picker-option-group.js.map +1 -1
  28. package/build/circular-option-picker/circular-option-picker-option.js +2 -2
  29. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  30. package/build/circular-option-picker/circular-option-picker.js +2 -2
  31. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  32. package/build/clipboard-button/index.js +2 -2
  33. package/build/clipboard-button/index.js.map +1 -1
  34. package/build/color-indicator/index.js +2 -2
  35. package/build/color-indicator/index.js.map +1 -1
  36. package/build/color-palette/index.js +2 -2
  37. package/build/color-palette/index.js.map +1 -1
  38. package/build/combobox-control/index.js +7 -2
  39. package/build/combobox-control/index.js.map +1 -1
  40. package/build/combobox-control/types.js.map +1 -1
  41. package/build/custom-gradient-picker/gradient-bar/control-points.js +3 -3
  42. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  43. package/build/custom-gradient-picker/gradient-bar/index.js +2 -2
  44. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  45. package/build/custom-gradient-picker/index.js.map +1 -1
  46. package/build/custom-select-control/index.js +3 -3
  47. package/build/custom-select-control/index.js.map +1 -1
  48. package/build/dimension-control/index.js +2 -2
  49. package/build/dimension-control/index.js.map +1 -1
  50. package/build/drop-zone/index.js +2 -2
  51. package/build/drop-zone/index.js.map +1 -1
  52. package/build/dropdown/index.js +2 -2
  53. package/build/dropdown/index.js.map +1 -1
  54. package/build/dropdown-menu/index.js +5 -5
  55. package/build/dropdown-menu/index.js.map +1 -1
  56. package/build/dropdown-menu/index.native.js +4 -4
  57. package/build/dropdown-menu/index.native.js.map +1 -1
  58. package/build/external-link/index.js +2 -2
  59. package/build/external-link/index.js.map +1 -1
  60. package/build/focal-point-picker/focal-point.js +2 -2
  61. package/build/focal-point-picker/focal-point.js.map +1 -1
  62. package/build/focal-point-picker/index.js +2 -2
  63. package/build/focal-point-picker/index.js.map +1 -1
  64. package/build/form-toggle/index.js +2 -2
  65. package/build/form-toggle/index.js.map +1 -1
  66. package/build/form-token-field/index.js +3 -3
  67. package/build/form-token-field/index.js.map +1 -1
  68. package/build/form-token-field/suggestions-list.js +9 -5
  69. package/build/form-token-field/suggestions-list.js.map +1 -1
  70. package/build/form-token-field/token-input.js +2 -2
  71. package/build/form-token-field/token-input.js.map +1 -1
  72. package/build/form-token-field/token.js +2 -2
  73. package/build/form-token-field/token.js.map +1 -1
  74. package/build/guide/index.js +2 -2
  75. package/build/guide/index.js.map +1 -1
  76. package/build/input-control/index.js +3 -6
  77. package/build/input-control/index.js.map +1 -1
  78. package/build/menu-group/index.js +2 -2
  79. package/build/menu-group/index.js.map +1 -1
  80. package/build/menu-item/index.js +3 -3
  81. package/build/menu-item/index.js.map +1 -1
  82. package/build/mobile/color-settings/utils.native.js +1 -1
  83. package/build/mobile/color-settings/utils.native.js.map +1 -1
  84. package/build/modal/index.js +4 -4
  85. package/build/modal/index.js.map +1 -1
  86. package/build/navigation/back-button/index.js +2 -2
  87. package/build/navigation/back-button/index.js.map +1 -1
  88. package/build/navigation/group/index.js +2 -2
  89. package/build/navigation/group/index.js.map +1 -1
  90. package/build/navigation/index.js +3 -3
  91. package/build/navigation/index.js.map +1 -1
  92. package/build/navigation/item/base.js +2 -2
  93. package/build/navigation/item/base.js.map +1 -1
  94. package/build/navigation/item/index.js +2 -2
  95. package/build/navigation/item/index.js.map +1 -1
  96. package/build/navigation/menu/index.js +2 -2
  97. package/build/navigation/menu/index.js.map +1 -1
  98. package/build/notice/index.js +3 -3
  99. package/build/notice/index.js.map +1 -1
  100. package/build/notice/list.js +2 -2
  101. package/build/notice/list.js.map +1 -1
  102. package/build/number-control/index.js +2 -2
  103. package/build/number-control/index.js.map +1 -1
  104. package/build/palette-edit/index.js +5 -5
  105. package/build/palette-edit/index.js.map +1 -1
  106. package/build/palette-edit/styles.js +14 -15
  107. package/build/palette-edit/styles.js.map +1 -1
  108. package/build/panel/body.js +2 -2
  109. package/build/panel/body.js.map +1 -1
  110. package/build/panel/index.js +2 -2
  111. package/build/panel/index.js.map +1 -1
  112. package/build/panel/row.js +2 -2
  113. package/build/panel/row.js.map +1 -1
  114. package/build/placeholder/index.js +3 -3
  115. package/build/placeholder/index.js.map +1 -1
  116. package/build/popover/index.js +2 -2
  117. package/build/popover/index.js.map +1 -1
  118. package/build/radio-control/index.js +2 -2
  119. package/build/radio-control/index.js.map +1 -1
  120. package/build/range-control/index.js +3 -3
  121. package/build/range-control/index.js.map +1 -1
  122. package/build/range-control/mark.js +3 -3
  123. package/build/range-control/mark.js.map +1 -1
  124. package/build/range-control/tooltip.js +2 -2
  125. package/build/range-control/tooltip.js.map +1 -1
  126. package/build/resizable-box/index.js +10 -10
  127. package/build/resizable-box/index.js.map +1 -1
  128. package/build/resizable-box/resize-tooltip/index.js +2 -2
  129. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  130. package/build/responsive-wrapper/index.js +2 -2
  131. package/build/responsive-wrapper/index.js.map +1 -1
  132. package/build/search-control/index.js +2 -2
  133. package/build/search-control/index.js.map +1 -1
  134. package/build/select-control/index.js +2 -2
  135. package/build/select-control/index.js.map +1 -1
  136. package/build/snackbar/index.js +3 -3
  137. package/build/snackbar/index.js.map +1 -1
  138. package/build/snackbar/list.js +2 -2
  139. package/build/snackbar/list.js.map +1 -1
  140. package/build/spinner/index.js +2 -2
  141. package/build/spinner/index.js.map +1 -1
  142. package/build/tab-panel/index.js +2 -2
  143. package/build/tab-panel/index.js.map +1 -1
  144. package/build/text-control/index.js +2 -2
  145. package/build/text-control/index.js.map +1 -1
  146. package/build/toolbar/toolbar/index.js +2 -2
  147. package/build/toolbar/toolbar/index.js.map +1 -1
  148. package/build/toolbar/toolbar-button/index.js +3 -3
  149. package/build/toolbar/toolbar-button/index.js.map +1 -1
  150. package/build/toolbar/toolbar-group/index.js +2 -2
  151. package/build/toolbar/toolbar-group/index.js.map +1 -1
  152. package/build/tools-panel/tools-panel/hook.js +5 -6
  153. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  154. package/build/tools-panel/tools-panel-item/hook.js +6 -8
  155. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  156. package/build/tools-panel/types.js.map +1 -1
  157. package/build/truncate/hook.js +1 -1
  158. package/build/truncate/hook.js.map +1 -1
  159. package/build/unit-control/index.js +2 -2
  160. package/build/unit-control/index.js.map +1 -1
  161. package/build/unit-control/unit-select-control.js +2 -2
  162. package/build/unit-control/unit-select-control.js.map +1 -1
  163. package/build-module/alignment-matrix-control/icon.js +2 -2
  164. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  165. package/build-module/alignment-matrix-control/index.js +2 -2
  166. package/build-module/alignment-matrix-control/index.js.map +1 -1
  167. package/build-module/angle-picker-control/index.js +2 -2
  168. package/build-module/angle-picker-control/index.js.map +1 -1
  169. package/build-module/animate/index.js +4 -4
  170. package/build-module/animate/index.js.map +1 -1
  171. package/build-module/autocomplete/autocompleter-ui.js +2 -2
  172. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  173. package/build-module/base-control/hooks.js +1 -4
  174. package/build-module/base-control/hooks.js.map +1 -1
  175. package/build-module/base-control/index.js +2 -2
  176. package/build-module/base-control/index.js.map +1 -1
  177. package/build-module/base-control/types.js.map +1 -1
  178. package/build-module/border-control/types.js.map +1 -1
  179. package/build-module/button/index.js +2 -2
  180. package/build-module/button/index.js.map +1 -1
  181. package/build-module/button-group/index.js +2 -2
  182. package/build-module/button-group/index.js.map +1 -1
  183. package/build-module/checkbox-control/index.js +2 -2
  184. package/build-module/checkbox-control/index.js.map +1 -1
  185. package/build-module/circular-option-picker/circular-option-picker-actions.js +3 -3
  186. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  187. package/build-module/circular-option-picker/circular-option-picker-option-group.js +2 -2
  188. package/build-module/circular-option-picker/circular-option-picker-option-group.js.map +1 -1
  189. package/build-module/circular-option-picker/circular-option-picker-option.js +2 -2
  190. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  191. package/build-module/circular-option-picker/circular-option-picker.js +2 -2
  192. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  193. package/build-module/clipboard-button/index.js +2 -2
  194. package/build-module/clipboard-button/index.js.map +1 -1
  195. package/build-module/color-indicator/index.js +2 -2
  196. package/build-module/color-indicator/index.js.map +1 -1
  197. package/build-module/color-palette/index.js +2 -2
  198. package/build-module/color-palette/index.js.map +1 -1
  199. package/build-module/combobox-control/index.js +7 -2
  200. package/build-module/combobox-control/index.js.map +1 -1
  201. package/build-module/combobox-control/types.js.map +1 -1
  202. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +3 -3
  203. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  204. package/build-module/custom-gradient-picker/gradient-bar/index.js +2 -2
  205. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  206. package/build-module/custom-gradient-picker/index.js.map +1 -1
  207. package/build-module/custom-select-control/index.js +3 -3
  208. package/build-module/custom-select-control/index.js.map +1 -1
  209. package/build-module/dimension-control/index.js +2 -2
  210. package/build-module/dimension-control/index.js.map +1 -1
  211. package/build-module/drop-zone/index.js +2 -2
  212. package/build-module/drop-zone/index.js.map +1 -1
  213. package/build-module/dropdown/index.js +2 -2
  214. package/build-module/dropdown/index.js.map +1 -1
  215. package/build-module/dropdown-menu/index.js +5 -5
  216. package/build-module/dropdown-menu/index.js.map +1 -1
  217. package/build-module/dropdown-menu/index.native.js +4 -4
  218. package/build-module/dropdown-menu/index.native.js.map +1 -1
  219. package/build-module/external-link/index.js +2 -2
  220. package/build-module/external-link/index.js.map +1 -1
  221. package/build-module/focal-point-picker/focal-point.js +2 -2
  222. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  223. package/build-module/focal-point-picker/index.js +2 -2
  224. package/build-module/focal-point-picker/index.js.map +1 -1
  225. package/build-module/form-toggle/index.js +2 -2
  226. package/build-module/form-toggle/index.js.map +1 -1
  227. package/build-module/form-token-field/index.js +3 -3
  228. package/build-module/form-token-field/index.js.map +1 -1
  229. package/build-module/form-token-field/suggestions-list.js +9 -5
  230. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  231. package/build-module/form-token-field/token-input.js +2 -2
  232. package/build-module/form-token-field/token-input.js.map +1 -1
  233. package/build-module/form-token-field/token.js +2 -2
  234. package/build-module/form-token-field/token.js.map +1 -1
  235. package/build-module/guide/index.js +2 -2
  236. package/build-module/guide/index.js.map +1 -1
  237. package/build-module/input-control/index.js +3 -6
  238. package/build-module/input-control/index.js.map +1 -1
  239. package/build-module/menu-group/index.js +2 -2
  240. package/build-module/menu-group/index.js.map +1 -1
  241. package/build-module/menu-item/index.js +3 -3
  242. package/build-module/menu-item/index.js.map +1 -1
  243. package/build-module/mobile/color-settings/utils.native.js +1 -1
  244. package/build-module/mobile/color-settings/utils.native.js.map +1 -1
  245. package/build-module/modal/index.js +4 -4
  246. package/build-module/modal/index.js.map +1 -1
  247. package/build-module/navigation/back-button/index.js +2 -2
  248. package/build-module/navigation/back-button/index.js.map +1 -1
  249. package/build-module/navigation/group/index.js +2 -2
  250. package/build-module/navigation/group/index.js.map +1 -1
  251. package/build-module/navigation/index.js +3 -3
  252. package/build-module/navigation/index.js.map +1 -1
  253. package/build-module/navigation/item/base.js +2 -2
  254. package/build-module/navigation/item/base.js.map +1 -1
  255. package/build-module/navigation/item/index.js +2 -2
  256. package/build-module/navigation/item/index.js.map +1 -1
  257. package/build-module/navigation/menu/index.js +2 -2
  258. package/build-module/navigation/menu/index.js.map +1 -1
  259. package/build-module/notice/index.js +3 -3
  260. package/build-module/notice/index.js.map +1 -1
  261. package/build-module/notice/list.js +2 -2
  262. package/build-module/notice/list.js.map +1 -1
  263. package/build-module/number-control/index.js +2 -2
  264. package/build-module/number-control/index.js.map +1 -1
  265. package/build-module/palette-edit/index.js +6 -6
  266. package/build-module/palette-edit/index.js.map +1 -1
  267. package/build-module/palette-edit/styles.js +13 -14
  268. package/build-module/palette-edit/styles.js.map +1 -1
  269. package/build-module/panel/body.js +2 -2
  270. package/build-module/panel/body.js.map +1 -1
  271. package/build-module/panel/index.js +2 -2
  272. package/build-module/panel/index.js.map +1 -1
  273. package/build-module/panel/row.js +2 -2
  274. package/build-module/panel/row.js.map +1 -1
  275. package/build-module/placeholder/index.js +3 -3
  276. package/build-module/placeholder/index.js.map +1 -1
  277. package/build-module/popover/index.js +2 -2
  278. package/build-module/popover/index.js.map +1 -1
  279. package/build-module/radio-control/index.js +2 -2
  280. package/build-module/radio-control/index.js.map +1 -1
  281. package/build-module/range-control/index.js +3 -3
  282. package/build-module/range-control/index.js.map +1 -1
  283. package/build-module/range-control/mark.js +3 -3
  284. package/build-module/range-control/mark.js.map +1 -1
  285. package/build-module/range-control/tooltip.js +2 -2
  286. package/build-module/range-control/tooltip.js.map +1 -1
  287. package/build-module/resizable-box/index.js +10 -10
  288. package/build-module/resizable-box/index.js.map +1 -1
  289. package/build-module/resizable-box/resize-tooltip/index.js +2 -2
  290. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  291. package/build-module/responsive-wrapper/index.js +2 -2
  292. package/build-module/responsive-wrapper/index.js.map +1 -1
  293. package/build-module/search-control/index.js +2 -2
  294. package/build-module/search-control/index.js.map +1 -1
  295. package/build-module/select-control/index.js +2 -2
  296. package/build-module/select-control/index.js.map +1 -1
  297. package/build-module/snackbar/index.js +3 -3
  298. package/build-module/snackbar/index.js.map +1 -1
  299. package/build-module/snackbar/list.js +2 -2
  300. package/build-module/snackbar/list.js.map +1 -1
  301. package/build-module/spinner/index.js +2 -2
  302. package/build-module/spinner/index.js.map +1 -1
  303. package/build-module/tab-panel/index.js +2 -2
  304. package/build-module/tab-panel/index.js.map +1 -1
  305. package/build-module/text-control/index.js +2 -2
  306. package/build-module/text-control/index.js.map +1 -1
  307. package/build-module/toolbar/toolbar/index.js +2 -2
  308. package/build-module/toolbar/toolbar/index.js.map +1 -1
  309. package/build-module/toolbar/toolbar-button/index.js +3 -3
  310. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  311. package/build-module/toolbar/toolbar-group/index.js +2 -2
  312. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  313. package/build-module/tools-panel/tools-panel/hook.js +5 -6
  314. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  315. package/build-module/tools-panel/tools-panel-item/hook.js +6 -8
  316. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  317. package/build-module/tools-panel/types.js.map +1 -1
  318. package/build-module/truncate/hook.js +1 -1
  319. package/build-module/truncate/hook.js.map +1 -1
  320. package/build-module/unit-control/index.js +2 -2
  321. package/build-module/unit-control/index.js.map +1 -1
  322. package/build-module/unit-control/unit-select-control.js +2 -2
  323. package/build-module/unit-control/unit-select-control.js.map +1 -1
  324. package/build-style/style-rtl.css +18 -20
  325. package/build-style/style.css +18 -20
  326. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  327. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  328. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  329. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  330. package/build-types/alignment-matrix-control/index.d.ts +1 -1
  331. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  332. package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
  333. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  334. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +4 -4
  335. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +4 -4
  336. package/build-types/angle-picker-control/angle-circle.d.ts +1 -1
  337. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  338. package/build-types/angle-picker-control/index.d.ts +1 -1
  339. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  340. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +4 -4
  341. package/build-types/animate/index.d.ts.map +1 -1
  342. package/build-types/autocomplete/autocompleter-ui.d.ts +1 -1
  343. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  344. package/build-types/autocomplete/index.d.ts +3 -3
  345. package/build-types/autocomplete/index.d.ts.map +1 -1
  346. package/build-types/base-control/hooks.d.ts +1 -0
  347. package/build-types/base-control/hooks.d.ts.map +1 -1
  348. package/build-types/base-control/index.d.ts +2 -2
  349. package/build-types/base-control/index.d.ts.map +1 -1
  350. package/build-types/base-control/styles/base-control-styles.d.ts +5 -5
  351. package/build-types/base-control/types.d.ts +1 -2
  352. package/build-types/base-control/types.d.ts.map +1 -1
  353. package/build-types/border-box-control/border-box-control/hook.d.ts +67 -57
  354. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  355. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +68 -59
  356. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  357. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +67 -57
  358. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  359. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +67 -57
  360. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  361. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  362. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  363. package/build-types/border-control/border-control/component.d.ts +1 -0
  364. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  365. package/build-types/border-control/border-control/hook.d.ts +68 -57
  366. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  367. package/build-types/border-control/border-control-dropdown/hook.d.ts +67 -57
  368. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  369. package/build-types/border-control/border-control-style-picker/component.d.ts +1 -1
  370. package/build-types/border-control/stories/index.story.d.ts +12 -6
  371. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  372. package/build-types/border-control/types.d.ts +4 -0
  373. package/build-types/border-control/types.d.ts.map +1 -1
  374. package/build-types/box-control/all-input-control.d.ts +1 -1
  375. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  376. package/build-types/box-control/axial-input-controls.d.ts +1 -1
  377. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  378. package/build-types/box-control/icon.d.ts +1 -1
  379. package/build-types/box-control/icon.d.ts.map +1 -1
  380. package/build-types/box-control/index.d.ts +1 -1
  381. package/build-types/box-control/index.d.ts.map +1 -1
  382. package/build-types/box-control/input-controls.d.ts +1 -1
  383. package/build-types/box-control/input-controls.d.ts.map +1 -1
  384. package/build-types/box-control/linked-button.d.ts +1 -1
  385. package/build-types/box-control/linked-button.d.ts.map +1 -1
  386. package/build-types/box-control/stories/index.story.d.ts +427 -378
  387. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  388. package/build-types/box-control/styles/box-control-icon-styles.d.ts +6 -6
  389. package/build-types/box-control/styles/box-control-styles.d.ts +5 -5
  390. package/build-types/button/deprecated.d.ts +5 -51
  391. package/build-types/button/deprecated.d.ts.map +1 -1
  392. package/build-types/button/index.d.ts +1 -1
  393. package/build-types/button/index.d.ts.map +1 -1
  394. package/build-types/button/stories/index.story.d.ts +1 -1
  395. package/build-types/button/stories/index.story.d.ts.map +1 -1
  396. package/build-types/button-group/index.d.ts +1 -1
  397. package/build-types/button-group/index.d.ts.map +1 -1
  398. package/build-types/card/card/hook.d.ts +67 -57
  399. package/build-types/card/card/hook.d.ts.map +1 -1
  400. package/build-types/card/card-body/hook.d.ts +67 -57
  401. package/build-types/card/card-body/hook.d.ts.map +1 -1
  402. package/build-types/card/card-divider/hook.d.ts +67 -57
  403. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  404. package/build-types/card/card-footer/hook.d.ts +67 -57
  405. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  406. package/build-types/card/card-header/hook.d.ts +67 -57
  407. package/build-types/card/card-header/hook.d.ts.map +1 -1
  408. package/build-types/card/card-media/hook.d.ts +67 -57
  409. package/build-types/card/card-media/hook.d.ts.map +1 -1
  410. package/build-types/card/stories/index.story.d.ts +2 -2
  411. package/build-types/checkbox-control/index.d.ts +1 -1
  412. package/build-types/checkbox-control/index.d.ts.map +1 -1
  413. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts +2 -2
  414. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  415. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts +1 -1
  416. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts.map +1 -1
  417. package/build-types/circular-option-picker/circular-option-picker-option.d.ts +1 -1
  418. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  419. package/build-types/circular-option-picker/circular-option-picker.d.ts +1 -1
  420. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  421. package/build-types/clipboard-button/index.d.ts +1 -1
  422. package/build-types/clipboard-button/index.d.ts.map +1 -1
  423. package/build-types/color-indicator/index.d.ts +1 -1
  424. package/build-types/color-indicator/index.d.ts.map +1 -1
  425. package/build-types/color-palette/index.d.ts +1 -1
  426. package/build-types/color-palette/index.d.ts.map +1 -1
  427. package/build-types/color-palette/styles.d.ts +1 -1
  428. package/build-types/color-picker/color-copy-button.d.ts +1 -1
  429. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  430. package/build-types/color-picker/color-input.d.ts +1 -1
  431. package/build-types/color-picker/color-input.d.ts.map +1 -1
  432. package/build-types/color-picker/component.d.ts +2 -2
  433. package/build-types/color-picker/component.d.ts.map +1 -1
  434. package/build-types/color-picker/hex-input.d.ts +1 -1
  435. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  436. package/build-types/color-picker/hsl-input.d.ts +1 -1
  437. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  438. package/build-types/color-picker/input-with-slider.d.ts +1 -1
  439. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  440. package/build-types/color-picker/legacy-adapter.d.ts +1 -1
  441. package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
  442. package/build-types/color-picker/picker.d.ts +1 -1
  443. package/build-types/color-picker/picker.d.ts.map +1 -1
  444. package/build-types/color-picker/rgb-input.d.ts +1 -1
  445. package/build-types/color-picker/rgb-input.d.ts.map +1 -1
  446. package/build-types/color-picker/stories/index.story.d.ts +1 -1
  447. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  448. package/build-types/color-picker/styles.d.ts +6 -6
  449. package/build-types/combobox-control/index.d.ts +3 -1
  450. package/build-types/combobox-control/index.d.ts.map +1 -1
  451. package/build-types/combobox-control/stories/index.story.d.ts +22 -2
  452. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  453. package/build-types/combobox-control/styles.d.ts +1 -1
  454. package/build-types/combobox-control/types.d.ts +1 -0
  455. package/build-types/combobox-control/types.d.ts.map +1 -1
  456. package/build-types/composite/current/stories/utils.d.ts +1 -1
  457. package/build-types/composite/current/stories/utils.d.ts.map +1 -1
  458. package/build-types/composite/legacy/stories/utils.d.ts +1 -1
  459. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
  460. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  461. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  462. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +2 -2
  463. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  464. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +1 -1
  465. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  466. package/build-types/custom-gradient-picker/index.d.ts +1 -1
  467. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  468. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +2 -2
  469. package/build-types/custom-select-control/index.d.ts +2 -2
  470. package/build-types/custom-select-control/index.d.ts.map +1 -1
  471. package/build-types/custom-select-control-v2/custom-select.d.ts +1 -1
  472. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  473. package/build-types/custom-select-control-v2/default-component/index.d.ts +1 -1
  474. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
  475. package/build-types/custom-select-control-v2/item.d.ts +1 -1
  476. package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
  477. package/build-types/custom-select-control-v2/legacy-component/index.d.ts +1 -1
  478. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  479. package/build-types/custom-select-control-v2/stories/default.story.d.ts +3 -3
  480. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
  481. package/build-types/custom-select-control-v2/styles.d.ts +8 -8
  482. package/build-types/dashicon/index.d.ts +1 -1
  483. package/build-types/dashicon/index.d.ts.map +1 -1
  484. package/build-types/date-time/date/index.d.ts +1 -1
  485. package/build-types/date-time/date/index.d.ts.map +1 -1
  486. package/build-types/date-time/date/styles.d.ts +5 -5
  487. package/build-types/date-time/date-time/styles.d.ts +1 -1
  488. package/build-types/date-time/time/index.d.ts +1 -1
  489. package/build-types/date-time/time/index.d.ts.map +1 -1
  490. package/build-types/date-time/time/styles.d.ts +10 -10
  491. package/build-types/date-time/time/timezone.d.ts +1 -1
  492. package/build-types/date-time/time/timezone.d.ts.map +1 -1
  493. package/build-types/dimension-control/index.d.ts +1 -1
  494. package/build-types/dimension-control/index.d.ts.map +1 -1
  495. package/build-types/disabled/index.d.ts +1 -1
  496. package/build-types/disabled/index.d.ts.map +1 -1
  497. package/build-types/disclosure/index.d.ts +1 -1
  498. package/build-types/disclosure/index.d.ts.map +1 -1
  499. package/build-types/divider/styles.d.ts +1 -1
  500. package/build-types/draggable/index.d.ts +1 -1
  501. package/build-types/draggable/index.d.ts.map +1 -1
  502. package/build-types/drop-zone/index.d.ts +1 -1
  503. package/build-types/drop-zone/index.d.ts.map +1 -1
  504. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  505. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  506. package/build-types/dropdown/index.d.ts +1 -1
  507. package/build-types/dropdown/index.d.ts.map +1 -1
  508. package/build-types/dropdown/stories/index.story.d.ts +4 -4
  509. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  510. package/build-types/dropdown/styles.d.ts +1 -1
  511. package/build-types/dropdown-menu/index.d.ts +1 -1
  512. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  513. package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
  514. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  515. package/build-types/dropdown-menu-v2/index.d.ts +7 -7
  516. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  517. package/build-types/dropdown-menu-v2/styles.d.ts +12 -12
  518. package/build-types/duotone-picker/color-list-picker/index.d.ts +1 -1
  519. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  520. package/build-types/duotone-picker/custom-duotone-bar.d.ts +1 -1
  521. package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
  522. package/build-types/duotone-picker/duotone-picker.d.ts +1 -1
  523. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  524. package/build-types/duotone-picker/duotone-swatch.d.ts +1 -1
  525. package/build-types/duotone-picker/duotone-swatch.d.ts.map +1 -1
  526. package/build-types/elevation/hook.d.ts +66 -56
  527. package/build-types/elevation/hook.d.ts.map +1 -1
  528. package/build-types/flex/flex/hook.d.ts +67 -57
  529. package/build-types/flex/flex/hook.d.ts.map +1 -1
  530. package/build-types/flex/flex-block/hook.d.ts +67 -57
  531. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  532. package/build-types/flex/flex-item/hook.d.ts +67 -57
  533. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  534. package/build-types/focal-point-picker/controls.d.ts +1 -1
  535. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  536. package/build-types/focal-point-picker/focal-point.d.ts +1 -1
  537. package/build-types/focal-point-picker/focal-point.d.ts.map +1 -1
  538. package/build-types/focal-point-picker/grid.d.ts +1 -1
  539. package/build-types/focal-point-picker/grid.d.ts.map +1 -1
  540. package/build-types/focal-point-picker/index.d.ts +1 -1
  541. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  542. package/build-types/focal-point-picker/media.d.ts +1 -1
  543. package/build-types/focal-point-picker/media.d.ts.map +1 -1
  544. package/build-types/focal-point-picker/stories/index.story.d.ts +8 -8
  545. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  546. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +9 -9
  547. package/build-types/focal-point-picker/styles/focal-point-style.d.ts +1 -1
  548. package/build-types/focal-point-picker/test/index.d.ts +2 -0
  549. package/build-types/focal-point-picker/test/index.d.ts.map +1 -0
  550. package/build-types/focal-point-picker/test/media.d.ts +2 -0
  551. package/build-types/focal-point-picker/test/media.d.ts.map +1 -0
  552. package/build-types/focusable-iframe/index.d.ts +1 -1
  553. package/build-types/focusable-iframe/index.d.ts.map +1 -1
  554. package/build-types/font-size-picker/font-size-picker-select.d.ts +1 -1
  555. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  556. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts +1 -1
  557. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  558. package/build-types/font-size-picker/styles.d.ts +4 -4
  559. package/build-types/form-file-upload/index.d.ts +1 -1
  560. package/build-types/form-file-upload/index.d.ts.map +1 -1
  561. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  562. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  563. package/build-types/form-toggle/index.d.ts +2 -2
  564. package/build-types/form-toggle/index.d.ts.map +1 -1
  565. package/build-types/form-token-field/index.d.ts +1 -1
  566. package/build-types/form-token-field/index.d.ts.map +1 -1
  567. package/build-types/form-token-field/styles.d.ts +1 -1
  568. package/build-types/form-token-field/suggestions-list.d.ts +2 -1
  569. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  570. package/build-types/form-token-field/token-input.d.ts +2 -2
  571. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  572. package/build-types/form-token-field/token.d.ts +1 -1
  573. package/build-types/form-token-field/token.d.ts.map +1 -1
  574. package/build-types/gradient-picker/index.d.ts +1 -1
  575. package/build-types/gradient-picker/index.d.ts.map +1 -1
  576. package/build-types/grid/hook.d.ts +67 -57
  577. package/build-types/grid/hook.d.ts.map +1 -1
  578. package/build-types/guide/icons.d.ts +1 -1
  579. package/build-types/guide/icons.d.ts.map +1 -1
  580. package/build-types/guide/index.d.ts +1 -1
  581. package/build-types/guide/index.d.ts.map +1 -1
  582. package/build-types/guide/page-control.d.ts +1 -1
  583. package/build-types/guide/page-control.d.ts.map +1 -1
  584. package/build-types/guide/page.d.ts +1 -1
  585. package/build-types/guide/page.d.ts.map +1 -1
  586. package/build-types/h-stack/hook.d.ts +67 -57
  587. package/build-types/h-stack/hook.d.ts.map +1 -1
  588. package/build-types/heading/hook.d.ts +67 -57
  589. package/build-types/heading/hook.d.ts.map +1 -1
  590. package/build-types/higher-order/navigate-regions/index.d.ts +1 -1
  591. package/build-types/higher-order/with-constrained-tabbing/index.d.ts +1 -1
  592. package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -1
  593. package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -1
  594. package/build-types/higher-order/with-filters/index.d.ts +2 -2
  595. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  596. package/build-types/higher-order/with-notices/index.d.ts +2 -2
  597. package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -1
  598. package/build-types/icon/index.d.ts +1 -1
  599. package/build-types/icon/index.d.ts.map +1 -1
  600. package/build-types/input-control/backdrop.d.ts +1 -1
  601. package/build-types/input-control/backdrop.d.ts.map +1 -1
  602. package/build-types/input-control/index.d.ts +1 -1
  603. package/build-types/input-control/index.d.ts.map +1 -1
  604. package/build-types/input-control/input-base.d.ts +1 -1
  605. package/build-types/input-control/input-base.d.ts.map +1 -1
  606. package/build-types/input-control/input-field.d.ts +1 -1
  607. package/build-types/input-control/input-field.d.ts.map +1 -1
  608. package/build-types/input-control/label.d.ts +1 -1
  609. package/build-types/input-control/label.d.ts.map +1 -1
  610. package/build-types/input-control/styles/input-control-styles.d.ts +8 -8
  611. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  612. package/build-types/isolated-event-container/index.d.ts +1 -1
  613. package/build-types/isolated-event-container/index.d.ts.map +1 -1
  614. package/build-types/item-group/item/hook.d.ts +67 -57
  615. package/build-types/item-group/item/hook.d.ts.map +1 -1
  616. package/build-types/item-group/item-group/hook.d.ts +67 -57
  617. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  618. package/build-types/keyboard-shortcuts/index.d.ts +1 -1
  619. package/build-types/keyboard-shortcuts/index.d.ts.map +1 -1
  620. package/build-types/menu-group/index.d.ts +1 -1
  621. package/build-types/menu-group/index.d.ts.map +1 -1
  622. package/build-types/menu-item/index.d.ts +1 -1
  623. package/build-types/menu-item/index.d.ts.map +1 -1
  624. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  625. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  626. package/build-types/menu-items-choice/index.d.ts +1 -1
  627. package/build-types/menu-items-choice/index.d.ts.map +1 -1
  628. package/build-types/navigable-container/container.d.ts +1 -1
  629. package/build-types/navigable-container/menu.d.ts +2 -2
  630. package/build-types/navigable-container/menu.d.ts.map +1 -1
  631. package/build-types/navigable-container/tabbable.d.ts +2 -2
  632. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  633. package/build-types/navigation/back-button/index.d.ts.map +1 -1
  634. package/build-types/navigation/group/index.d.ts +1 -1
  635. package/build-types/navigation/group/index.d.ts.map +1 -1
  636. package/build-types/navigation/index.d.ts +1 -1
  637. package/build-types/navigation/index.d.ts.map +1 -1
  638. package/build-types/navigation/item/base-content.d.ts +1 -1
  639. package/build-types/navigation/item/base-content.d.ts.map +1 -1
  640. package/build-types/navigation/item/base.d.ts +1 -1
  641. package/build-types/navigation/item/base.d.ts.map +1 -1
  642. package/build-types/navigation/item/index.d.ts +1 -1
  643. package/build-types/navigation/item/index.d.ts.map +1 -1
  644. package/build-types/navigation/menu/index.d.ts +1 -1
  645. package/build-types/navigation/menu/index.d.ts.map +1 -1
  646. package/build-types/navigation/menu/menu-title-search.d.ts +1 -1
  647. package/build-types/navigation/menu/menu-title.d.ts +1 -1
  648. package/build-types/navigation/menu/menu-title.d.ts.map +1 -1
  649. package/build-types/navigation/menu/search-no-results-found.d.ts +1 -1
  650. package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -1
  651. package/build-types/navigation/styles/navigation-styles.d.ts +11 -11
  652. package/build-types/navigator/navigator-back-button/hook.d.ts +68 -59
  653. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  654. package/build-types/navigator/navigator-button/hook.d.ts +68 -59
  655. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  656. package/build-types/notice/index.d.ts +1 -1
  657. package/build-types/notice/index.d.ts.map +1 -1
  658. package/build-types/notice/list.d.ts +1 -1
  659. package/build-types/notice/list.d.ts.map +1 -1
  660. package/build-types/number-control/index.d.ts +1 -1
  661. package/build-types/number-control/index.d.ts.map +1 -1
  662. package/build-types/number-control/stories/index.story.d.ts +1 -1
  663. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  664. package/build-types/palette-edit/index.d.ts +1 -1
  665. package/build-types/palette-edit/index.d.ts.map +1 -1
  666. package/build-types/palette-edit/styles.d.ts +1007 -756
  667. package/build-types/palette-edit/styles.d.ts.map +1 -1
  668. package/build-types/panel/body.d.ts +1 -1
  669. package/build-types/panel/body.d.ts.map +1 -1
  670. package/build-types/panel/header.d.ts +1 -1
  671. package/build-types/panel/header.d.ts.map +1 -1
  672. package/build-types/placeholder/index.d.ts +1 -1
  673. package/build-types/placeholder/index.d.ts.map +1 -1
  674. package/build-types/popover/index.d.ts +1 -1
  675. package/build-types/popover/index.d.ts.map +1 -1
  676. package/build-types/popover/stories/e2e/index.story.d.ts +2 -2
  677. package/build-types/popover/stories/e2e/index.story.d.ts.map +1 -1
  678. package/build-types/popover/test/utils/index.d.ts +1 -1
  679. package/build-types/popover/test/utils/index.d.ts.map +1 -1
  680. package/build-types/progress-bar/index.d.ts +1 -1
  681. package/build-types/progress-bar/index.d.ts.map +1 -1
  682. package/build-types/progress-bar/styles.d.ts +3 -3
  683. package/build-types/query-controls/author-select.d.ts +1 -1
  684. package/build-types/query-controls/author-select.d.ts.map +1 -1
  685. package/build-types/query-controls/category-select.d.ts +1 -1
  686. package/build-types/query-controls/category-select.d.ts.map +1 -1
  687. package/build-types/query-controls/index.d.ts +1 -1
  688. package/build-types/query-controls/index.d.ts.map +1 -1
  689. package/build-types/radio-control/index.d.ts +1 -1
  690. package/build-types/radio-control/index.d.ts.map +1 -1
  691. package/build-types/radio-group/index.d.ts +1 -1
  692. package/build-types/radio-group/index.d.ts.map +1 -1
  693. package/build-types/radio-group/radio.d.ts +1 -1
  694. package/build-types/radio-group/radio.d.ts.map +1 -1
  695. package/build-types/range-control/index.d.ts +1 -1
  696. package/build-types/range-control/index.d.ts.map +1 -1
  697. package/build-types/range-control/input-range.d.ts +1 -1
  698. package/build-types/range-control/mark.d.ts +1 -1
  699. package/build-types/range-control/mark.d.ts.map +1 -1
  700. package/build-types/range-control/rail.d.ts +1 -1
  701. package/build-types/range-control/rail.d.ts.map +1 -1
  702. package/build-types/range-control/styles/range-control-styles.d.ts +15 -15
  703. package/build-types/range-control/tooltip.d.ts +1 -1
  704. package/build-types/range-control/tooltip.d.ts.map +1 -1
  705. package/build-types/resizable-box/index.d.ts +3 -3
  706. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  707. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  708. package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
  709. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  710. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +4 -4
  711. package/build-types/resizable-box/stories/index.story.d.ts +6 -6
  712. package/build-types/responsive-wrapper/index.d.ts +1 -1
  713. package/build-types/responsive-wrapper/index.d.ts.map +1 -1
  714. package/build-types/sandbox/index.d.ts +1 -1
  715. package/build-types/sandbox/index.d.ts.map +1 -1
  716. package/build-types/scrollable/hook.d.ts +67 -57
  717. package/build-types/scrollable/hook.d.ts.map +1 -1
  718. package/build-types/search-control/index.d.ts.map +1 -1
  719. package/build-types/search-control/styles.d.ts +1 -1
  720. package/build-types/select-control/chevron-down.d.ts +1 -1
  721. package/build-types/select-control/chevron-down.d.ts.map +1 -1
  722. package/build-types/select-control/styles/select-control-styles.d.ts +3 -3
  723. package/build-types/shortcut/index.d.ts +1 -1
  724. package/build-types/shortcut/index.d.ts.map +1 -1
  725. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts +1 -1
  726. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  727. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
  728. package/build-types/slot-fill/index.d.ts +7 -7
  729. package/build-types/slot-fill/index.d.ts.map +1 -1
  730. package/build-types/slot-fill/provider.d.ts +1 -1
  731. package/build-types/slot-fill/provider.d.ts.map +1 -1
  732. package/build-types/slot-fill/slot.d.ts +1 -1
  733. package/build-types/slot-fill/slot.d.ts.map +1 -1
  734. package/build-types/snackbar/index.d.ts +2 -2
  735. package/build-types/snackbar/index.d.ts.map +1 -1
  736. package/build-types/snackbar/list.d.ts +1 -1
  737. package/build-types/snackbar/list.d.ts.map +1 -1
  738. package/build-types/spacer/hook.d.ts +67 -57
  739. package/build-types/spacer/hook.d.ts.map +1 -1
  740. package/build-types/spinner/index.d.ts +2 -2
  741. package/build-types/spinner/index.d.ts.map +1 -1
  742. package/build-types/spinner/styles.d.ts +3 -3
  743. package/build-types/style-provider/index.d.ts +1 -1
  744. package/build-types/style-provider/index.d.ts.map +1 -1
  745. package/build-types/surface/hook.d.ts +67 -57
  746. package/build-types/surface/hook.d.ts.map +1 -1
  747. package/build-types/tab-panel/index.d.ts +1 -1
  748. package/build-types/tab-panel/index.d.ts.map +1 -1
  749. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  750. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  751. package/build-types/tabs/index.d.ts +2 -2
  752. package/build-types/tabs/index.d.ts.map +1 -1
  753. package/build-types/tabs/styles.d.ts +3 -3
  754. package/build-types/tabs/tablist.d.ts +1 -1
  755. package/build-types/tabs/tablist.d.ts.map +1 -1
  756. package/build-types/text/hook.d.ts +66 -57
  757. package/build-types/text/hook.d.ts.map +1 -1
  758. package/build-types/text/stories/index.story.d.ts +3 -3
  759. package/build-types/text-control/index.d.ts +3 -3
  760. package/build-types/text-control/index.d.ts.map +1 -1
  761. package/build-types/text-highlight/index.d.ts +1 -1
  762. package/build-types/text-highlight/index.d.ts.map +1 -1
  763. package/build-types/textarea-control/index.d.ts +2 -2
  764. package/build-types/textarea-control/index.d.ts.map +1 -1
  765. package/build-types/textarea-control/styles/textarea-control-styles.d.ts +1 -1
  766. package/build-types/theme/index.d.ts +1 -1
  767. package/build-types/theme/index.d.ts.map +1 -1
  768. package/build-types/theme/stories/index.story.d.ts +1 -1
  769. package/build-types/theme/styles.d.ts +1 -1
  770. package/build-types/tip/index.d.ts +1 -1
  771. package/build-types/tip/index.d.ts.map +1 -1
  772. package/build-types/toggle-control/index.d.ts +2 -2
  773. package/build-types/toggle-control/index.d.ts.map +1 -1
  774. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  775. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  776. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +1 -1
  777. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  778. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +1 -1
  779. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  780. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -1
  781. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -1
  782. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  783. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +1 -1
  784. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  785. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +2 -2
  786. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  787. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  788. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  789. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  790. package/build-types/toolbar/toolbar/index.d.ts +1 -1
  791. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  792. package/build-types/toolbar/toolbar/toolbar-container.d.ts +1 -1
  793. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  794. package/build-types/toolbar/toolbar-button/index.d.ts +5 -51
  795. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  796. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +1 -1
  797. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
  798. package/build-types/toolbar/toolbar-group/index.d.ts +1 -1
  799. package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -1
  800. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +1 -1
  801. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -1
  802. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +1 -1
  803. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -1
  804. package/build-types/tools-panel/styles.d.ts +1 -1
  805. package/build-types/tools-panel/tools-panel/hook.d.ts +69 -59
  806. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  807. package/build-types/tools-panel/tools-panel-header/hook.d.ts +68 -58
  808. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  809. package/build-types/tools-panel/tools-panel-item/hook.d.ts +67 -57
  810. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  811. package/build-types/tools-panel/types.d.ts +1 -1
  812. package/build-types/tools-panel/types.d.ts.map +1 -1
  813. package/build-types/tree-grid/index.d.ts +1 -1
  814. package/build-types/tree-grid/index.d.ts.map +1 -1
  815. package/build-types/tree-grid/item.d.ts +1 -1
  816. package/build-types/tree-grid/item.d.ts.map +1 -1
  817. package/build-types/tree-grid/roving-tab-index-item.d.ts +1 -1
  818. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
  819. package/build-types/tree-grid/roving-tab-index.d.ts +1 -1
  820. package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -1
  821. package/build-types/tree-grid/row.d.ts +1 -1
  822. package/build-types/tree-grid/row.d.ts.map +1 -1
  823. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  824. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  825. package/build-types/tree-select/index.d.ts +1 -1
  826. package/build-types/tree-select/index.d.ts.map +1 -1
  827. package/build-types/truncate/hook.d.ts +67 -57
  828. package/build-types/truncate/hook.d.ts.map +1 -1
  829. package/build-types/unit-control/index.d.ts +1 -1
  830. package/build-types/unit-control/index.d.ts.map +1 -1
  831. package/build-types/unit-control/styles/unit-control-styles.d.ts +3 -3
  832. package/build-types/unit-control/unit-select-control.d.ts +1 -1
  833. package/build-types/v-stack/hook.d.ts +67 -57
  834. package/build-types/v-stack/hook.d.ts.map +1 -1
  835. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  836. package/build-types/view/component.d.ts +251 -249
  837. package/build-types/view/component.d.ts.map +1 -1
  838. package/build-types/z-stack/styles.d.ts +2 -2
  839. package/package.json +22 -22
  840. package/src/alignment-matrix-control/icon.tsx +2 -2
  841. package/src/alignment-matrix-control/index.tsx +2 -5
  842. package/src/angle-picker-control/index.tsx +2 -2
  843. package/src/animate/index.tsx +4 -7
  844. package/src/autocomplete/autocompleter-ui.tsx +2 -2
  845. package/src/base-control/README.md +1 -1
  846. package/src/base-control/hooks.ts +1 -5
  847. package/src/base-control/index.tsx +2 -5
  848. package/src/base-control/test/index.tsx +3 -3
  849. package/src/base-control/types.ts +1 -2
  850. package/src/border-control/types.ts +4 -0
  851. package/src/button/index.tsx +2 -2
  852. package/src/button/style.scss +4 -6
  853. package/src/button-group/index.tsx +2 -2
  854. package/src/checkbox-control/index.tsx +2 -2
  855. package/src/circular-option-picker/circular-option-picker-actions.tsx +3 -3
  856. package/src/circular-option-picker/circular-option-picker-option-group.tsx +2 -2
  857. package/src/circular-option-picker/circular-option-picker-option.tsx +2 -2
  858. package/src/circular-option-picker/circular-option-picker.tsx +2 -5
  859. package/src/circular-option-picker/style.scss +1 -2
  860. package/src/clipboard-button/index.tsx +2 -2
  861. package/src/color-indicator/index.tsx +2 -2
  862. package/src/color-palette/index.tsx +2 -2
  863. package/src/combobox-control/README.md +1 -1
  864. package/src/combobox-control/index.tsx +8 -5
  865. package/src/combobox-control/stories/index.story.tsx +28 -0
  866. package/src/combobox-control/types.ts +1 -0
  867. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +3 -3
  868. package/src/custom-gradient-picker/gradient-bar/index.tsx +2 -2
  869. package/src/custom-gradient-picker/index.tsx +2 -2
  870. package/src/custom-select-control/index.js +3 -6
  871. package/src/dimension-control/index.tsx +2 -5
  872. package/src/drop-zone/index.tsx +2 -2
  873. package/src/dropdown/index.tsx +2 -2
  874. package/src/dropdown-menu/index.native.js +6 -12
  875. package/src/dropdown-menu/index.tsx +9 -16
  876. package/src/external-link/index.tsx +2 -2
  877. package/src/focal-point-picker/focal-point.tsx +2 -4
  878. package/src/focal-point-picker/index.tsx +2 -5
  879. package/src/focal-point-picker/test/{index.js → index.tsx} +44 -17
  880. package/src/focal-point-picker/test/{media.js → media.tsx} +18 -13
  881. package/src/form-toggle/index.tsx +2 -2
  882. package/src/form-token-field/index.tsx +10 -8
  883. package/src/form-token-field/style.scss +9 -0
  884. package/src/form-token-field/suggestions-list.tsx +16 -10
  885. package/src/form-token-field/token-input.tsx +2 -2
  886. package/src/form-token-field/token.tsx +2 -2
  887. package/src/guide/index.tsx +2 -2
  888. package/src/input-control/index.tsx +3 -6
  889. package/src/input-control/test/index.js +2 -2
  890. package/src/menu-group/index.tsx +2 -2
  891. package/src/menu-item/index.tsx +3 -3
  892. package/src/mobile/color-settings/utils.native.js +1 -1
  893. package/src/modal/index.tsx +4 -4
  894. package/src/navigation/back-button/index.tsx +2 -5
  895. package/src/navigation/group/index.tsx +2 -2
  896. package/src/navigation/index.tsx +3 -3
  897. package/src/navigation/item/base.tsx +2 -2
  898. package/src/navigation/item/index.tsx +2 -2
  899. package/src/navigation/menu/index.tsx +2 -2
  900. package/src/notice/index.tsx +5 -10
  901. package/src/notice/list.tsx +2 -2
  902. package/src/number-control/index.tsx +2 -2
  903. package/src/palette-edit/index.tsx +10 -8
  904. package/src/palette-edit/styles.ts +2 -3
  905. package/src/panel/body.tsx +2 -2
  906. package/src/panel/index.tsx +2 -2
  907. package/src/panel/row.tsx +2 -2
  908. package/src/placeholder/index.tsx +3 -3
  909. package/src/placeholder/style.scss +1 -2
  910. package/src/popover/index.tsx +2 -2
  911. package/src/radio-control/index.tsx +2 -2
  912. package/src/range-control/index.tsx +3 -3
  913. package/src/range-control/mark.tsx +3 -3
  914. package/src/range-control/tooltip.tsx +2 -2
  915. package/src/resizable-box/index.tsx +10 -10
  916. package/src/resizable-box/resize-tooltip/index.tsx +2 -2
  917. package/src/responsive-wrapper/index.tsx +2 -2
  918. package/src/search-control/index.tsx +2 -5
  919. package/src/select-control/index.tsx +2 -2
  920. package/src/snackbar/index.tsx +5 -8
  921. package/src/snackbar/list.tsx +2 -2
  922. package/src/spinner/index.tsx +2 -2
  923. package/src/tab-panel/index.tsx +2 -2
  924. package/src/text-control/index.tsx +2 -2
  925. package/src/theme/stories/index.story.tsx +1 -1
  926. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +0 -2
  927. package/src/toolbar/toolbar/index.tsx +2 -2
  928. package/src/toolbar/toolbar/style.scss +0 -12
  929. package/src/toolbar/toolbar-button/index.tsx +3 -3
  930. package/src/toolbar/toolbar-group/index.tsx +2 -2
  931. package/src/tools-panel/tools-panel/hook.ts +9 -6
  932. package/src/tools-panel/tools-panel-item/hook.ts +12 -8
  933. package/src/tools-panel/types.ts +1 -0
  934. package/src/truncate/hook.ts +1 -1
  935. package/src/unit-control/index.tsx +2 -2
  936. package/src/unit-control/unit-select-control.tsx +2 -2
  937. package/src/utils/theme-variables.scss +4 -0
  938. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useInstanceId","forwardRef","useContext","Icon","check","CircularOptionPickerContext","Button","CompositeItem","Tooltip","UnforwardedOptionAsButton","props","forwardedRef","isPressed","additionalProps","createElement","ref","OptionAsButton","UnforwardedOptionAsOption","id","isSelected","compositeStore","activeId","useState","setActiveId","render","role","store","OptionAsOption","Option","className","selectedIconProps","tooltipText","baseId","commonProps","optionControl","text","icon"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-option.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useContext } from '@wordpress/element';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { CircularOptionPickerContext } from './circular-option-picker-context';\nimport Button from '../button';\nimport { CompositeItem } from '../composite/v2';\nimport Tooltip from '../tooltip';\nimport type { OptionProps, CircularOptionPickerCompositeStore } from './types';\n\nfunction UnforwardedOptionAsButton(\n\tprops: {\n\t\tid?: string;\n\t\tclassName?: string;\n\t\tisPressed?: boolean;\n\t},\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { isPressed, ...additionalProps } = props;\n\treturn (\n\t\t<Button\n\t\t\t{ ...additionalProps }\n\t\t\taria-pressed={ isPressed }\n\t\t\tref={ forwardedRef }\n\t\t/>\n\t);\n}\n\nconst OptionAsButton = forwardRef( UnforwardedOptionAsButton );\n\nfunction UnforwardedOptionAsOption(\n\tprops: {\n\t\tid: string;\n\t\tclassName?: string;\n\t\tisSelected?: boolean;\n\t\tcompositeStore: CircularOptionPickerCompositeStore;\n\t},\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { id, isSelected, compositeStore, ...additionalProps } = props;\n\tconst activeId = compositeStore.useState( 'activeId' );\n\n\tif ( isSelected && ! activeId ) {\n\t\tcompositeStore.setActiveId( id );\n\t}\n\n\treturn (\n\t\t<CompositeItem\n\t\t\trender={\n\t\t\t\t<Button\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\taria-selected={ !! isSelected }\n\t\t\t\t\tref={ forwardedRef }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tstore={ compositeStore }\n\t\t\tid={ id }\n\t\t/>\n\t);\n}\n\nconst OptionAsOption = forwardRef( UnforwardedOptionAsOption );\n\nexport function Option( {\n\tclassName,\n\tisSelected,\n\tselectedIconProps = {},\n\ttooltipText,\n\t...additionalProps\n}: OptionProps ) {\n\tconst { baseId, compositeStore } = useContext(\n\t\tCircularOptionPickerContext\n\t);\n\tconst id = useInstanceId(\n\t\tOption,\n\t\tbaseId || 'components-circular-option-picker__option'\n\t);\n\n\tconst commonProps = {\n\t\tid,\n\t\tclassName: 'components-circular-option-picker__option',\n\t\t...additionalProps,\n\t};\n\n\tconst optionControl = compositeStore ? (\n\t\t<OptionAsOption\n\t\t\t{ ...commonProps }\n\t\t\tcompositeStore={ compositeStore }\n\t\t\tisSelected={ isSelected }\n\t\t/>\n\t) : (\n\t\t<OptionAsButton { ...commonProps } isPressed={ isSelected } />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'components-circular-option-picker__option-wrapper'\n\t\t\t) }\n\t\t>\n\t\t\t{ tooltipText ? (\n\t\t\t\t<Tooltip text={ tooltipText }>{ optionControl }</Tooltip>\n\t\t\t) : (\n\t\t\t\toptionControl\n\t\t\t) }\n\t\t\t{ isSelected && <Icon icon={ check } { ...selectedIconProps } /> }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAGnC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;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AEZ;EAAe,CAAC,GAAGlB,UAAU,CAC5CG,2BACD,CAAC;EACD,MAAMa,EAAE,GAAGlB,aAAa,CACvB4B,MAAM,EACNI,MAAM,IAAI,2CACX,CAAC;EAED,MAAMC,WAAW,GAAG;IACnBf,EAAE;IACFW,SAAS,EAAE,2CAA2C;IACtD,GAAGhB;EACJ,CAAC;EAED,MAAMqB,aAAa,GAAGd,cAAc,GACnCN,aAAA,CAACa,cAAc;IAAA,GACTM,WAAW;IAChBb,cAAc,EAAGA,cAAgB;IACjCD,UAAU,EAAGA;EAAY,CACzB,CAAC,GAEFL,aAAA,CAACE,cAAc;IAAA,GAAMiB,WAAW;IAAGrB,SAAS,EAAGO;EAAY,CAAE,CAC7D;EAED,OACCL,aAAA;IACCe,SAAS,EAAG9B,UAAU,CACrB8B,SAAS,EACT,mDACD;EAAG,GAEDE,WAAW,GACZjB,aAAA,CAACN,OAAO;IAAC2B,IAAI,EAAGJ;EAAa,GAAGG,aAAwB,CAAC,GAEzDA,aACA,EACCf,UAAU,IAAIL,aAAA,CAACX,IAAI;IAACiC,IAAI,EAAGhC,KAAO;IAAA,GAAM0B;EAAiB,CAAI,CAC3D,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useInstanceId","forwardRef","useContext","Icon","check","CircularOptionPickerContext","Button","CompositeItem","Tooltip","UnforwardedOptionAsButton","props","forwardedRef","isPressed","additionalProps","createElement","ref","OptionAsButton","UnforwardedOptionAsOption","id","isSelected","compositeStore","activeId","useState","setActiveId","render","role","store","OptionAsOption","Option","className","selectedIconProps","tooltipText","baseId","commonProps","optionControl","text","icon"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-option.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useContext } from '@wordpress/element';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { CircularOptionPickerContext } from './circular-option-picker-context';\nimport Button from '../button';\nimport { CompositeItem } from '../composite/v2';\nimport Tooltip from '../tooltip';\nimport type { OptionProps, CircularOptionPickerCompositeStore } from './types';\n\nfunction UnforwardedOptionAsButton(\n\tprops: {\n\t\tid?: string;\n\t\tclassName?: string;\n\t\tisPressed?: boolean;\n\t},\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { isPressed, ...additionalProps } = props;\n\treturn (\n\t\t<Button\n\t\t\t{ ...additionalProps }\n\t\t\taria-pressed={ isPressed }\n\t\t\tref={ forwardedRef }\n\t\t/>\n\t);\n}\n\nconst OptionAsButton = forwardRef( UnforwardedOptionAsButton );\n\nfunction UnforwardedOptionAsOption(\n\tprops: {\n\t\tid: string;\n\t\tclassName?: string;\n\t\tisSelected?: boolean;\n\t\tcompositeStore: CircularOptionPickerCompositeStore;\n\t},\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { id, isSelected, compositeStore, ...additionalProps } = props;\n\tconst activeId = compositeStore.useState( 'activeId' );\n\n\tif ( isSelected && ! activeId ) {\n\t\tcompositeStore.setActiveId( id );\n\t}\n\n\treturn (\n\t\t<CompositeItem\n\t\t\trender={\n\t\t\t\t<Button\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\taria-selected={ !! isSelected }\n\t\t\t\t\tref={ forwardedRef }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tstore={ compositeStore }\n\t\t\tid={ id }\n\t\t/>\n\t);\n}\n\nconst OptionAsOption = forwardRef( UnforwardedOptionAsOption );\n\nexport function Option( {\n\tclassName,\n\tisSelected,\n\tselectedIconProps = {},\n\ttooltipText,\n\t...additionalProps\n}: OptionProps ) {\n\tconst { baseId, compositeStore } = useContext(\n\t\tCircularOptionPickerContext\n\t);\n\tconst id = useInstanceId(\n\t\tOption,\n\t\tbaseId || 'components-circular-option-picker__option'\n\t);\n\n\tconst commonProps = {\n\t\tid,\n\t\tclassName: 'components-circular-option-picker__option',\n\t\t...additionalProps,\n\t};\n\n\tconst optionControl = compositeStore ? (\n\t\t<OptionAsOption\n\t\t\t{ ...commonProps }\n\t\t\tcompositeStore={ compositeStore }\n\t\t\tisSelected={ isSelected }\n\t\t/>\n\t) : (\n\t\t<OptionAsButton { ...commonProps } isPressed={ isSelected } />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\tclassName,\n\t\t\t\t'components-circular-option-picker__option-wrapper'\n\t\t\t) }\n\t\t>\n\t\t\t{ tooltipText ? (\n\t\t\t\t<Tooltip text={ tooltipText }>{ optionControl }</Tooltip>\n\t\t\t) : (\n\t\t\t\toptionControl\n\t\t\t) }\n\t\t\t{ isSelected && <Icon icon={ check } { ...selectedIconProps } /> }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;;AAE9C;AACA;AACA;AACA,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,OAAOC,OAAO,MAAM,YAAY;AAGhC,SAASC,yBAAyBA,CACjCC,KAIC,EACDC,YAAiC,EAChC;EACD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAgB,CAAC,GAAGH,KAAK;EAC/C,OACCI,aAAA,CAACR,MAAM;IAAA,GACDO,eAAe;IACpB,gBAAeD,SAAW;IAC1BG,GAAG,EAAGJ;EAAc,CACpB,CAAC;AAEJ;AAEA,MAAMK,cAAc,GAAGf,UAAU,CAAEQ,yBAA0B,CAAC;AAE9D,SAASQ,yBAAyBA,CACjCP,KAKC,EACDC,YAAiC,EAChC;EACD,MAA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mDACD;EAAG,GAEDE,WAAW,GACZjB,aAAA,CAACN,OAAO;IAAC2B,IAAI,EAAGJ;EAAa,GAAGG,aAAwB,CAAC,GAEzDA,aACA,EACCf,UAAU,IAAIL,aAAA,CAACX,IAAI;IAACiC,IAAI,EAAGhC,KAAO;IAAA,GAAM0B;EAAiB,CAAI,CAC3D,CAAC;AAER","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -131,7 +131,7 @@ function CircularOptionPicker(props) {
131
131
  return createElement(OptionPickerImplementation, {
132
132
  ...additionalProps,
133
133
  baseId: baseId,
134
- className: classnames('components-circular-option-picker', className),
134
+ className: clsx('components-circular-option-picker', className),
135
135
  actions: actions,
136
136
  options: options
137
137
  }, children);
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useInstanceId","isRTL","CircularOptionPickerContext","Composite","useCompositeStore","Option","OptionGroup","ButtonAction","DropdownLinkAction","ListboxCircularOptionPicker","props","actions","options","baseId","className","loop","children","additionalProps","compositeStore","focusLoop","rtl","compositeContext","createElement","Provider","value","id","store","role","ButtonsCircularOptionPicker","CircularOptionPicker","asButtons","actionsProp","optionsProp","OptionPickerImplementation","undefined"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { CircularOptionPickerContext } from './circular-option-picker-context';\nimport { Composite, useCompositeStore } from '../composite/v2';\nimport type {\n\tCircularOptionPickerProps,\n\tListboxCircularOptionPickerProps,\n\tButtonsCircularOptionPickerProps,\n} from './types';\nimport { Option } from './circular-option-picker-option';\nimport { OptionGroup } from './circular-option-picker-option-group';\nimport {\n\tButtonAction,\n\tDropdownLinkAction,\n} from './circular-option-picker-actions';\n\n/**\n *`CircularOptionPicker` is a component that displays a set of options as circular buttons.\n *\n * ```jsx\n * import { CircularOptionPicker } from '../circular-option-picker';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ currentColor, setCurrentColor ] = useState();\n * \tconst colors = [\n * \t\t{ color: '#f00', name: 'Red' },\n * \t\t{ color: '#0f0', name: 'Green' },\n * \t\t{ color: '#00f', name: 'Blue' },\n * \t];\n * \tconst colorOptions = (\n * \t\t<>\n * \t\t\t{ colors.map( ( { color, name }, index ) => {\n * \t\t\t\treturn (\n * \t\t\t\t\t<CircularOptionPicker.Option\n * \t\t\t\t\t\tkey={ `${ color }-${ index }` }\n * \t\t\t\t\t\ttooltipText={ name }\n * \t\t\t\t\t\tstyle={ { backgroundColor: color, color } }\n * \t\t\t\t\t\tisSelected={ index === currentColor }\n * \t\t\t\t\t\tonClick={ () => setCurrentColor( index ) }\n * \t\t\t\t\t\taria-label={ name }\n * \t\t\t\t\t/>\n * \t\t\t\t);\n * \t\t\t} ) }\n * \t\t</>\n * \t);\n * \treturn (\n * \t\t<CircularOptionPicker\n * \t\t\t\toptions={ colorOptions }\n * \t\t\t\tactions={\n * \t\t\t\t\t<CircularOptionPicker.ButtonAction\n * \t\t\t\t\t\tonClick={ () => setCurrentColor( undefined ) }\n * \t\t\t\t\t>\n * \t\t\t\t\t\t{ 'Clear' }\n * \t\t\t\t\t</CircularOptionPicker.ButtonAction>\n * \t\t\t\t}\n * \t\t\t/>\n * \t);\n * };\n * ```\n */\n\nfunction ListboxCircularOptionPicker(\n\tprops: ListboxCircularOptionPickerProps\n) {\n\tconst {\n\t\tactions,\n\t\toptions,\n\t\tbaseId,\n\t\tclassName,\n\t\tloop = true,\n\t\tchildren,\n\t\t...additionalProps\n\t} = props;\n\n\tconst compositeStore = useCompositeStore( {\n\t\tfocusLoop: loop,\n\t\trtl: isRTL(),\n\t} );\n\n\tconst compositeContext = {\n\t\tbaseId,\n\t\tcompositeStore,\n\t};\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<CircularOptionPickerContext.Provider value={ compositeContext }>\n\t\t\t\t<Composite\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\tid={ baseId }\n\t\t\t\t\tstore={ compositeStore }\n\t\t\t\t\trole={ 'listbox' }\n\t\t\t\t>\n\t\t\t\t\t{ options }\n\t\t\t\t</Composite>\n\t\t\t\t{ children }\n\t\t\t\t{ actions }\n\t\t\t</CircularOptionPickerContext.Provider>\n\t\t</div>\n\t);\n}\n\nfunction ButtonsCircularOptionPicker(\n\tprops: ButtonsCircularOptionPickerProps\n) {\n\tconst { actions, options, children, baseId, ...additionalProps } = props;\n\n\treturn (\n\t\t<div { ...additionalProps } id={ baseId }>\n\t\t\t<CircularOptionPickerContext.Provider value={ { baseId } }>\n\t\t\t\t{ options }\n\t\t\t\t{ children }\n\t\t\t\t{ actions }\n\t\t\t</CircularOptionPickerContext.Provider>\n\t\t</div>\n\t);\n}\n\nfunction CircularOptionPicker( props: CircularOptionPickerProps ) {\n\tconst {\n\t\tasButtons,\n\t\tactions: actionsProp,\n\t\toptions: optionsProp,\n\t\tchildren,\n\t\tclassName,\n\t\t...additionalProps\n\t} = props;\n\n\tconst baseId = useInstanceId(\n\t\tCircularOptionPicker,\n\t\t'components-circular-option-picker',\n\t\tadditionalProps.id\n\t);\n\n\tconst OptionPickerImplementation = asButtons\n\t\t? ButtonsCircularOptionPicker\n\t\t: ListboxCircularOptionPicker;\n\n\tconst actions = actionsProp ? (\n\t\t<div className=\"components-circular-option-picker__custom-clear-wrapper\">\n\t\t\t{ actionsProp }\n\t\t</div>\n\t) : undefined;\n\n\tconst options = (\n\t\t<div className={ 'components-circular-option-picker__swatches' }>\n\t\t\t{ optionsProp }\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<OptionPickerImplementation\n\t\t\t{ ...additionalProps }\n\t\t\tbaseId={ baseId }\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-circular-option-picker',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tactions={ actions }\n\t\t\toptions={ options }\n\t\t>\n\t\t\t{ children }\n\t\t</OptionPickerImplementation>\n\t);\n}\n\nCircularOptionPicker.Option = Option;\nCircularOptionPicker.OptionGroup = OptionGroup;\nCircularOptionPicker.ButtonAction = ButtonAction;\nCircularOptionPicker.DropdownLinkAction = DropdownLinkAction;\n\nexport default CircularOptionPicker;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,SAAS,EAAEC,iBAAiB,QAAQ,iBAAiB;AAM9D,SAASC,MAAM,QAAQ,iCAAiC;AACxD,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SACCC,YAAY,EACZC,kBAAkB,QACZ,kCAAkC;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASC,2BAA2BA,CACnCC,KAAuC,EACtC;EACD,MAAM;IACLC,OAAO;IACPC,OAAO;IACPC,MAAM;IACNC,SAAS;IACTC,IAAI,GAAG,IAAI;IACXC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGP,KAAK;EAET,MAAMQ,cAAc,GAAGd,iBAAiB,CAAE;IACzCe,SAAS,EAAEJ,IAAI;IACfK,GAAG,EAAEnB,KAAK,CAAC;EACZ,CAAE,CAAC;EAEH,MAAMoB,gBAAgB,GAAG;IACxBR,MAAM;IACNK;EACD,CAAC;EAED,O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BhB,eAAe;IACpBJ,MAAM,EAAGA,MAAQ;IACjBC,SAAS,EAAGf,UAAU,CACrB,mCAAmC,EACnCe,SACD,CAAG;IACHH,OAAO,EAAGA,OAAS;IACnBC,OAAO,EAAGA;EAAS,GAEjBI,QACyB,CAAC;AAE/B;AAEAa,oBAAoB,CAACxB,MAAM,GAAGA,MAAM;AACpCwB,oBAAoB,CAACvB,WAAW,GAAGA,WAAW;AAC9CuB,oBAAoB,CAACtB,YAAY,GAAGA,YAAY;AAChDsB,oBAAoB,CAACrB,kBAAkB,GAAGA,kBAAkB;AAE5D,eAAeqB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useInstanceId","isRTL","CircularOptionPickerContext","Composite","useCompositeStore","Option","OptionGroup","ButtonAction","DropdownLinkAction","ListboxCircularOptionPicker","props","actions","options","baseId","className","loop","children","additionalProps","compositeStore","focusLoop","rtl","compositeContext","createElement","Provider","value","id","store","role","ButtonsCircularOptionPicker","CircularOptionPicker","asButtons","actionsProp","optionsProp","OptionPickerImplementation","undefined"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { CircularOptionPickerContext } from './circular-option-picker-context';\nimport { Composite, useCompositeStore } from '../composite/v2';\nimport type {\n\tCircularOptionPickerProps,\n\tListboxCircularOptionPickerProps,\n\tButtonsCircularOptionPickerProps,\n} from './types';\nimport { Option } from './circular-option-picker-option';\nimport { OptionGroup } from './circular-option-picker-option-group';\nimport {\n\tButtonAction,\n\tDropdownLinkAction,\n} from './circular-option-picker-actions';\n\n/**\n *`CircularOptionPicker` is a component that displays a set of options as circular buttons.\n *\n * ```jsx\n * import { CircularOptionPicker } from '../circular-option-picker';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ currentColor, setCurrentColor ] = useState();\n * \tconst colors = [\n * \t\t{ color: '#f00', name: 'Red' },\n * \t\t{ color: '#0f0', name: 'Green' },\n * \t\t{ color: '#00f', name: 'Blue' },\n * \t];\n * \tconst colorOptions = (\n * \t\t<>\n * \t\t\t{ colors.map( ( { color, name }, index ) => {\n * \t\t\t\treturn (\n * \t\t\t\t\t<CircularOptionPicker.Option\n * \t\t\t\t\t\tkey={ `${ color }-${ index }` }\n * \t\t\t\t\t\ttooltipText={ name }\n * \t\t\t\t\t\tstyle={ { backgroundColor: color, color } }\n * \t\t\t\t\t\tisSelected={ index === currentColor }\n * \t\t\t\t\t\tonClick={ () => setCurrentColor( index ) }\n * \t\t\t\t\t\taria-label={ name }\n * \t\t\t\t\t/>\n * \t\t\t\t);\n * \t\t\t} ) }\n * \t\t</>\n * \t);\n * \treturn (\n * \t\t<CircularOptionPicker\n * \t\t\t\toptions={ colorOptions }\n * \t\t\t\tactions={\n * \t\t\t\t\t<CircularOptionPicker.ButtonAction\n * \t\t\t\t\t\tonClick={ () => setCurrentColor( undefined ) }\n * \t\t\t\t\t>\n * \t\t\t\t\t\t{ 'Clear' }\n * \t\t\t\t\t</CircularOptionPicker.ButtonAction>\n * \t\t\t\t}\n * \t\t\t/>\n * \t);\n * };\n * ```\n */\n\nfunction ListboxCircularOptionPicker(\n\tprops: ListboxCircularOptionPickerProps\n) {\n\tconst {\n\t\tactions,\n\t\toptions,\n\t\tbaseId,\n\t\tclassName,\n\t\tloop = true,\n\t\tchildren,\n\t\t...additionalProps\n\t} = props;\n\n\tconst compositeStore = useCompositeStore( {\n\t\tfocusLoop: loop,\n\t\trtl: isRTL(),\n\t} );\n\n\tconst compositeContext = {\n\t\tbaseId,\n\t\tcompositeStore,\n\t};\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<CircularOptionPickerContext.Provider value={ compositeContext }>\n\t\t\t\t<Composite\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\tid={ baseId }\n\t\t\t\t\tstore={ compositeStore }\n\t\t\t\t\trole={ 'listbox' }\n\t\t\t\t>\n\t\t\t\t\t{ options }\n\t\t\t\t</Composite>\n\t\t\t\t{ children }\n\t\t\t\t{ actions }\n\t\t\t</CircularOptionPickerContext.Provider>\n\t\t</div>\n\t);\n}\n\nfunction ButtonsCircularOptionPicker(\n\tprops: ButtonsCircularOptionPickerProps\n) {\n\tconst { actions, options, children, baseId, ...additionalProps } = props;\n\n\treturn (\n\t\t<div { ...additionalProps } id={ baseId }>\n\t\t\t<CircularOptionPickerContext.Provider value={ { baseId } }>\n\t\t\t\t{ options }\n\t\t\t\t{ children }\n\t\t\t\t{ actions }\n\t\t\t</CircularOptionPickerContext.Provider>\n\t\t</div>\n\t);\n}\n\nfunction CircularOptionPicker( props: CircularOptionPickerProps ) {\n\tconst {\n\t\tasButtons,\n\t\tactions: actionsProp,\n\t\toptions: optionsProp,\n\t\tchildren,\n\t\tclassName,\n\t\t...additionalProps\n\t} = props;\n\n\tconst baseId = useInstanceId(\n\t\tCircularOptionPicker,\n\t\t'components-circular-option-picker',\n\t\tadditionalProps.id\n\t);\n\n\tconst OptionPickerImplementation = asButtons\n\t\t? ButtonsCircularOptionPicker\n\t\t: ListboxCircularOptionPicker;\n\n\tconst actions = actionsProp ? (\n\t\t<div className=\"components-circular-option-picker__custom-clear-wrapper\">\n\t\t\t{ actionsProp }\n\t\t</div>\n\t) : undefined;\n\n\tconst options = (\n\t\t<div className={ 'components-circular-option-picker__swatches' }>\n\t\t\t{ optionsProp }\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<OptionPickerImplementation\n\t\t\t{ ...additionalProps }\n\t\t\tbaseId={ baseId }\n\t\t\tclassName={ clsx( 'components-circular-option-picker', className ) }\n\t\t\tactions={ actions }\n\t\t\toptions={ options }\n\t\t>\n\t\t\t{ children }\n\t\t</OptionPickerImplementation>\n\t);\n}\n\nCircularOptionPicker.Option = Option;\nCircularOptionPicker.OptionGroup = OptionGroup;\nCircularOptionPicker.ButtonAction = ButtonAction;\nCircularOptionPicker.DropdownLinkAction = DropdownLinkAction;\n\nexport default CircularOptionPicker;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,SAAS,EAAEC,iBAAiB,QAAQ,iBAAiB;AAM9D,SAASC,MAAM,QAAQ,iCAAiC;AACxD,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SACCC,YAAY,EACZC,kBAAkB,QACZ,kCAAkC;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASC,2BAA2BA,CACnCC,KAAuC,EACtC;EACD,MAAM;IACLC,OAAO;IACPC,OAAO;IACPC,MAAM;IACNC,SAAS;IACTC,IAAI,GAAG,IAAI;IACXC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGP,KAAK;EAET,MAAMQ,cAAc,GAAGd,iBAAiB,CAAE;IACzCe,SAAS,EAAEJ,IAAI;IACfK,GAAG,EAAEnB,KAAK,CAAC;EACZ,CAAE,CAAC;EAEH,MAAMoB,gBAAgB,GAAG;IACxBR,MAAM;IACNK;EACD,CAAC;EAED,OACCI,aAAA;IAAKR,SAAS,EAAGA;EAAW,GAC3BQ,aAAA,CAACpB,2BAA2B,CAACqB,QAAQ;IAACC,KAAK,EAAGH;EAAkB,GAC/DC,aAAA,CAACnB,SAAS;IAAA,GACJc,eAAe;IACpBQ,EAAE,EAAGZ,MAAQ;IACba,KAAK,EAAGR,cAAgB;IACxBS,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AAM;AACpCwB,oBAAoB,CAACvB,WAAW,GAAGA,WAAW;AAC9CuB,oBAAoB,CAACtB,YAAY,GAAGA,YAAY;AAChDsB,oBAAoB,CAACrB,kBAAkB,GAAGA,kBAAkB;AAE5D,eAAeqB,oBAAoB","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -43,7 +43,7 @@ export default function ClipboardButton({
43
43
  clearTimeout(timeoutId.current);
44
44
  }
45
45
  }, []);
46
- const classes = classnames('components-clipboard-button', className);
46
+ const classes = clsx('components-clipboard-button', className);
47
47
 
48
48
  // Workaround for inconsistent behavior in Safari, where <textarea> is not
49
49
  // the document.activeElement at the moment when the copy event fires.
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useRef","useEffect","useCopyToClipboard","deprecated","Button","TIMEOUT","ClipboardButton","className","children","onCopy","onFinishCopy","text","buttonProps","since","alternative","timeoutId","ref","current","clearTimeout","setTimeout","classes","focusOnCopyEventTarget","event","target","focus","createElement"],"sources":["@wordpress/components/src/clipboard-button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { ClipboardButtonProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst TIMEOUT = 4000;\n\nexport default function ClipboardButton( {\n\tclassName,\n\tchildren,\n\tonCopy,\n\tonFinishCopy,\n\ttext,\n\t...buttonProps\n}: WordPressComponentProps< ClipboardButtonProps, 'button', false > ) {\n\tdeprecated( 'wp.components.ClipboardButton', {\n\t\tsince: '5.8',\n\t\talternative: 'wp.compose.useCopyToClipboard',\n\t} );\n\n\tconst timeoutId = useRef< NodeJS.Timeout >();\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tonCopy();\n\t\tif ( timeoutId.current ) {\n\t\t\tclearTimeout( timeoutId.current );\n\t\t}\n\n\t\tif ( onFinishCopy ) {\n\t\t\ttimeoutId.current = setTimeout( () => onFinishCopy(), TIMEOUT );\n\t\t}\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( timeoutId.current ) {\n\t\t\tclearTimeout( timeoutId.current );\n\t\t}\n\t}, [] );\n\n\tconst classes = classnames( 'components-clipboard-button', className );\n\n\t// Workaround for inconsistent behavior in Safari, where <textarea> is not\n\t// the document.activeElement at the moment when the copy event fires.\n\t// This causes documentHasSelection() in the copy-handler component to\n\t// mistakenly override the ClipboardButton, and copy a serialized string\n\t// of the current block instead.\n\tconst focusOnCopyEventTarget: React.ClipboardEventHandler = ( event ) => {\n\t\t// @ts-expect-error: Should be currentTarget, but not changing because this component is deprecated.\n\t\tevent.target.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\t{ ...buttonProps }\n\t\t\tclassName={ classes }\n\t\t\tref={ ref }\n\t\t\tonCopy={ focusOnCopyEventTarget }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAI9B,MAAMC,OAAO,GAAG,IAAI;AAEpB,eAAe,SAASC,eAAeA,CAAE;EACxCC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,YAAY;EACZC,IAAI;EACJ,GAAGC;AAC8D,CAAC,EAAG;EACrET,UAAU,CAAE,+BAA+B,EAAE;IAC5CU,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EAEH,MAAMC,SAAS,GAAGf,MAAM,CAAmB,CAAC;EAC5C,MAAMgB,GAAG,GAAGd,kBAAkB,CAAES,IAAI,EAAE,MAAM;IAC3CF,MAAM,CAAC,CAAC;IACR,IAAKM,SAAS,CAACE,OAAO,EAAG;MACxBC,YAAY,CAAEH,SAAS,CAACE,OAAQ,CAAC;IAClC;IAEA,IAAKP,YAAY,EAAG;MACnBK,SAAS,CAACE,OAAO,GAAGE,UAAU,CAAE,MAAMT,YAAY,CAAC,CAAC,EAAEL,OAAQ,CAAC;IAChE;EACD,CAAE,CAAC;EAEHJ,SAAS,CAAE,MAAM;IAChB,IAAKc,SAAS,CAACE,OAAO,EAAG;MACxBC,YAAY,CAAEH,SAAS,CAACE,OAAQ,CAAC;IAClC;EACD,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMG,OAAO,GAAGrB,UAAU,CAAE,6BAA6B,EAAEQ,SAAU,CAAC;;EAEtE;EACA;EACA;EACA;EACA;EACA,MAAMc,sBAAmD,GAAKC,KAAK,IAAM;IACxE;IACAA,KAAK,CAACC,MAAM,CAACC,KAAK,CAAC,CAAC;EACrB,CAAC;EAED,OACCC,aAAA,CAACrB,MAAM;IAAA,GACDQ,WAAW;IAChBL,SAAS,EAAGa,OAAS;IACrBJ,GAAG,EAAGA,GAAK;IACXP,MAAM,EAAGY;EAAwB,GAE/Bb,QACK,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useRef","useEffect","useCopyToClipboard","deprecated","Button","TIMEOUT","ClipboardButton","className","children","onCopy","onFinishCopy","text","buttonProps","since","alternative","timeoutId","ref","current","clearTimeout","setTimeout","classes","focusOnCopyEventTarget","event","target","focus","createElement"],"sources":["@wordpress/components/src/clipboard-button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { ClipboardButtonProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst TIMEOUT = 4000;\n\nexport default function ClipboardButton( {\n\tclassName,\n\tchildren,\n\tonCopy,\n\tonFinishCopy,\n\ttext,\n\t...buttonProps\n}: WordPressComponentProps< ClipboardButtonProps, 'button', false > ) {\n\tdeprecated( 'wp.components.ClipboardButton', {\n\t\tsince: '5.8',\n\t\talternative: 'wp.compose.useCopyToClipboard',\n\t} );\n\n\tconst timeoutId = useRef< NodeJS.Timeout >();\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tonCopy();\n\t\tif ( timeoutId.current ) {\n\t\t\tclearTimeout( timeoutId.current );\n\t\t}\n\n\t\tif ( onFinishCopy ) {\n\t\t\ttimeoutId.current = setTimeout( () => onFinishCopy(), TIMEOUT );\n\t\t}\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( timeoutId.current ) {\n\t\t\tclearTimeout( timeoutId.current );\n\t\t}\n\t}, [] );\n\n\tconst classes = clsx( 'components-clipboard-button', className );\n\n\t// Workaround for inconsistent behavior in Safari, where <textarea> is not\n\t// the document.activeElement at the moment when the copy event fires.\n\t// This causes documentHasSelection() in the copy-handler component to\n\t// mistakenly override the ClipboardButton, and copy a serialized string\n\t// of the current block instead.\n\tconst focusOnCopyEventTarget: React.ClipboardEventHandler = ( event ) => {\n\t\t// @ts-expect-error: Should be currentTarget, but not changing because this component is deprecated.\n\t\tevent.target.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\t{ ...buttonProps }\n\t\t\tclassName={ classes }\n\t\t\tref={ ref }\n\t\t\tonCopy={ focusOnCopyEventTarget }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,SAAS,QAAQ,o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AC;AAEX","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -19,7 +19,7 @@ function UnforwardedColorIndicator(props, forwardedRef) {
19
19
  ...additionalProps
20
20
  } = props;
21
21
  return createElement("span", {
22
- className: classnames('component-color-indicator', className),
22
+ className: clsx('component-color-indicator', className),
23
23
  style: {
24
24
  background: colorValue
25
25
  },
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","forwardRef","UnforwardedColorIndicator","props","forwardedRef","className","colorValue","additionalProps","createElement","style","background","ref","ColorIndicator"],"sources":["@wordpress/components/src/color-indicator/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { ColorIndicatorProps } from './types';\n\nfunction UnforwardedColorIndicator(\n\tprops: WordPressComponentProps< ColorIndicatorProps, 'span', false >,\n\tforwardedRef: ForwardedRef< HTMLSpanElement >\n) {\n\tconst { className, colorValue, ...additionalProps } = props;\n\n\treturn (\n\t\t<span\n\t\t\tclassName={ classnames( 'component-color-indicator', className ) }\n\t\t\tstyle={ { background: colorValue } }\n\t\t\tref={ forwardedRef }\n\t\t\t{ ...additionalProps }\n\t\t/>\n\t);\n}\n\n/**\n * ColorIndicator is a React component that renders a specific color in a\n * circle. It's often used to summarize a collection of used colors in a child\n * component.\n *\n * ```jsx\n * import { ColorIndicator } from '@wordpress/components';\n *\n * const MyColorIndicator = () => <ColorIndicator colorValue=\"#0073aa\" />;\n * ```\n */\nexport const ColorIndicator = forwardRef( UnforwardedColorIndicator );\n\nexport default ColorIndicator;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAGnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAIA,SAASC,yBAAyBA,CACjCC,KAAoE,EACpEC,YAA6C,EAC5C;EACD,MAAM;IAAEC,SAAS;IAAEC,UAAU;IAAE,GAAGC;EAAgB,CAAC,GAAGJ,KAAK;EAE3D,OACCK,aAAA;IACCH,SAAS,EAAGL,UAAU,CAAE,2BAA2B,EAAEK,SAAU,CAAG;IAClEI,KAAK,EAAG;MAAEC,UAAU,EAAEJ;IAAW,CAAG;IACpCK,GAAG,EAAGP,YAAc;IAAA,GACfG;EAAe,CACpB,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,cAAc,GAAGX,UAAU,CAAEC,yBAA0B,CAAC;AAErE,eAAeU,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["clsx","forwardRef","UnforwardedColorIndicator","props","forwardedRef","className","colorValue","additionalProps","createElement","style","background","ref","ColorIndicator"],"sources":["@wordpress/components/src/color-indicator/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { ColorIndicatorProps } from './types';\n\nfunction UnforwardedColorIndicator(\n\tprops: WordPressComponentProps< ColorIndicatorProps, 'span', false >,\n\tforwardedRef: ForwardedRef< HTMLSpanElement >\n) {\n\tconst { className, colorValue, ...additionalProps } = props;\n\n\treturn (\n\t\t<span\n\t\t\tclassName={ clsx( 'component-color-indicator', className ) }\n\t\t\tstyle={ { background: colorValue } }\n\t\t\tref={ forwardedRef }\n\t\t\t{ ...additionalProps }\n\t\t/>\n\t);\n}\n\n/**\n * ColorIndicator is a React component that renders a specific color in a\n * circle. It's often used to summarize a collection of used colors in a child\n * component.\n *\n * ```jsx\n * import { ColorIndicator } from '@wordpress/components';\n *\n * const MyColorIndicator = () => <ColorIndicator colorValue=\"#0073aa\" />;\n * ```\n */\nexport const ColorIndicator = forwardRef( UnforwardedColorIndicator );\n\nexport default ColorIndicator;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAIA,SAASC,yBAAyBA,CACjCC,KAAoE,EACpEC,YAA6C,EAC5C;EACD,MAAM;IAAEC,SAAS;IAAEC,UAAU;IAAE,GAAGC;EAAgB,CAAC,GAAGJ,KAAK;EAE3D,OACCK,aAAA;IACCH,SAAS,EAAGL,IAAI,CAAE,2BAA2B,EAAEK,SAAU,CAAG;IAC5DI,KAAK,EAAG;MAAEC,UAAU,EAAEJ;IAAW,CAAG;IACpCK,GAAG,EAAGP,YAAc;IAAA,GACfG;EAAe,CACpB,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,cAAc,GAAGX,UAAU,CAAEC,yBAA0B,CAAC;AAErE,eAAeU,cAAc","ignoreList":[]}
@@ -6,7 +6,7 @@ import { createElement } from "react";
6
6
  import { colord, extend } from 'colord';
7
7
  import namesPlugin from 'colord/plugins/names';
8
8
  import a11yPlugin from 'colord/plugins/a11y';
9
- import classnames from 'classnames';
9
+ import clsx from 'clsx';
10
10
 
11
11
  /**
12
12
  * WordPress dependencies
@@ -236,7 +236,7 @@ function UnforwardedColorPalette(props, forwardedRef) {
236
236
  }, createElement(Truncate, {
237
237
  className: "components-color-palette__custom-color-name"
238
238
  }, value ? buttonLabelName : __('No color selected')), createElement(Truncate, {
239
- className: classnames('components-color-palette__custom-color-value', {
239
+ className: clsx('components-color-palette__custom-color-value', {
240
240
  'components-color-palette__custom-color-value--is-hex': isHex
241
241
  })
242
242
  }, displayValue)))
@@ -1 +1 @@
1
- {"version":3,"names":["colord","extend","namesPlugin","a11yPlugin","classnames","useInstanceId","__","sprintf","useCallback","useMemo","useState","forwardRef","Dropdown","ColorPicker","CircularOptionPicker","VStack","Truncate","ColorHeading","DropdownContentWrapper","extractColorNameFromCurrentValue","isMultiplePaletteArray","normalizeColorValue","SinglePalette","className","clearColor","colors","onChange","value","additionalProps","colorOptions","map","color","name","index","colordColor","isSelected","createElement","Option","key","selectedIconProps","fill","contrast","tooltipText","style","backgroundColor","onClick","OptionGroup","options","MultiplePalettes","headingLevel","instanceId","length","spacing","colorPalette","id","level","newColor","CustomColorPickerDropdown","isRenderedInSidebar","popoverProps","receivedPopoverProps","props","shift","resize","placement","offset","contentClassName","UnforwardedColorPalette","forwardedRef","asButtons","loop","clearable","disableCustomColors","enableAlpha","__experimentalIsRenderedInSidebar","ariaLabel","ariaLabelledby","normalizedColorValue","setNormalizedColorValue","undefined","customColorPaletteCallbackRef","node","hasMultipleColorOrigins","buttonLabelName","renderCustomColorPicker","paddingSize","isHex","startsWith","displayValue","replace","customColorAccessibleLabel","paletteCommonProps","actions","ButtonAction","metaProps","_metaProps","ref","renderContent","renderToggle","isOpen","onToggle","background","type","ColorPalette"],"sources":["@wordpress/components/src/color-palette/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useMemo, useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Dropdown from '../dropdown';\nimport { ColorPicker } from '../color-picker';\nimport CircularOptionPicker from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport { Truncate } from '../truncate';\nimport { ColorHeading } from './styles';\nimport DropdownContentWrapper from '../dropdown/dropdown-content-wrapper';\nimport type {\n\tColorObject,\n\tColorPaletteProps,\n\tCustomColorPickerDropdownProps,\n\tMultiplePalettesProps,\n\tPaletteObject,\n\tSinglePaletteProps,\n} from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { DropdownProps } from '../dropdown/types';\nimport {\n\textractColorNameFromCurrentValue,\n\tisMultiplePaletteArray,\n\tnormalizeColorValue,\n} from './utils';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nfunction SinglePalette( {\n\tclassName,\n\tclearColor,\n\tcolors,\n\tonChange,\n\tvalue,\n\t...additionalProps\n}: SinglePaletteProps ) {\n\tconst colorOptions = useMemo( () => {\n\t\treturn colors.map( ( { color, name }, index ) => {\n\t\t\tconst colordColor = colord( color );\n\t\t\tconst isSelected = value === color;\n\n\t\t\treturn (\n\t\t\t\t<CircularOptionPicker.Option\n\t\t\t\t\tkey={ `${ color }-${ index }` }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tselectedIconProps={\n\t\t\t\t\t\tisSelected\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tfill:\n\t\t\t\t\t\t\t\t\t\tcolordColor.contrast() >\n\t\t\t\t\t\t\t\t\t\tcolordColor.contrast( '#000' )\n\t\t\t\t\t\t\t\t\t\t\t? '#fff'\n\t\t\t\t\t\t\t\t\t\t\t: '#000',\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: {}\n\t\t\t\t\t}\n\t\t\t\t\ttooltipText={\n\t\t\t\t\t\tname ||\n\t\t\t\t\t\t// translators: %s: color hex code e.g: \"#f00\".\n\t\t\t\t\t\tsprintf( __( 'Color code: %s' ), color )\n\t\t\t\t\t}\n\t\t\t\t\tstyle={ { backgroundColor: color, color } }\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tisSelected ? clearColor : () => onChange( color, index )\n\t\t\t\t\t}\n\t\t\t\t\taria-label={\n\t\t\t\t\t\tname\n\t\t\t\t\t\t\t? // translators: %s: The name of the color e.g: \"vivid red\".\n\t\t\t\t\t\t\t sprintf( __( 'Color: %s' ), name )\n\t\t\t\t\t\t\t: // translators: %s: color hex code e.g: \"#f00\".\n\t\t\t\t\t\t\t sprintf( __( 'Color code: %s' ), color )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\t}, [ colors, value, onChange, clearColor ] );\n\n\treturn (\n\t\t<CircularOptionPicker.OptionGroup\n\t\t\tclassName={ className }\n\t\t\toptions={ colorOptions }\n\t\t\t{ ...additionalProps }\n\t\t/>\n\t);\n}\n\nfunction MultiplePalettes( {\n\tclassName,\n\tclearColor,\n\tcolors,\n\tonChange,\n\tvalue,\n\theadingLevel,\n}: MultiplePalettesProps ) {\n\tconst instanceId = useInstanceId( MultiplePalettes, 'color-palette' );\n\n\tif ( colors.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 3 } className={ className }>\n\t\t\t{ colors.map( ( { name, colors: colorPalette }, index ) => {\n\t\t\t\tconst id = `${ instanceId }-${ index }`;\n\t\t\t\treturn (\n\t\t\t\t\t<VStack spacing={ 2 } key={ index }>\n\t\t\t\t\t\t<ColorHeading id={ id } level={ headingLevel }>\n\t\t\t\t\t\t\t{ name }\n\t\t\t\t\t\t</ColorHeading>\n\t\t\t\t\t\t<SinglePalette\n\t\t\t\t\t\t\tclearColor={ clearColor }\n\t\t\t\t\t\t\tcolors={ colorPalette }\n\t\t\t\t\t\t\tonChange={ ( newColor ) =>\n\t\t\t\t\t\t\t\tonChange( newColor, index )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\taria-labelledby={ id }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</VStack>\n\t);\n}\n\nexport function CustomColorPickerDropdown( {\n\tisRenderedInSidebar,\n\tpopoverProps: receivedPopoverProps,\n\t...props\n}: CustomColorPickerDropdownProps ) {\n\tconst popoverProps = useMemo< DropdownProps[ 'popoverProps' ] >(\n\t\t() => ( {\n\t\t\tshift: true,\n\t\t\t// Disabling resize as it would otherwise cause the popover to show\n\t\t\t// scrollbars while dragging the color picker's handle close to the\n\t\t\t// popover edge.\n\t\t\tresize: false,\n\t\t\t...( isRenderedInSidebar\n\t\t\t\t? {\n\t\t\t\t\t\t// When in the sidebar: open to the left (stacking),\n\t\t\t\t\t\t// leaving the same gap as the parent popover.\n\t\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t\toffset: 34,\n\t\t\t\t }\n\t\t\t\t: {\n\t\t\t\t\t\t// Default behavior: open below the anchor\n\t\t\t\t\t\tplacement: 'bottom',\n\t\t\t\t\t\toffset: 8,\n\t\t\t\t } ),\n\t\t\t...receivedPopoverProps,\n\t\t} ),\n\t\t[ isRenderedInSidebar, receivedPopoverProps ]\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tcontentClassName=\"components-color-palette__custom-color-dropdown-content\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction UnforwardedColorPalette(\n\tprops: WordPressComponentProps< ColorPaletteProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tasButtons,\n\t\tloop,\n\t\tclearable = true,\n\t\tcolors = [],\n\t\tdisableCustomColors = false,\n\t\tenableAlpha = false,\n\t\tonChange,\n\t\tvalue,\n\t\t__experimentalIsRenderedInSidebar = false,\n\t\theadingLevel = 2,\n\t\t'aria-label': ariaLabel,\n\t\t'aria-labelledby': ariaLabelledby,\n\t\t...additionalProps\n\t} = props;\n\tconst [ normalizedColorValue, setNormalizedColorValue ] = useState( value );\n\n\tconst clearColor = useCallback( () => onChange( undefined ), [ onChange ] );\n\n\tconst customColorPaletteCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tsetNormalizedColorValue( normalizeColorValue( value, node ) );\n\t\t},\n\t\t[ value ]\n\t);\n\n\tconst hasMultipleColorOrigins = isMultiplePaletteArray( colors );\n\tconst buttonLabelName = useMemo(\n\t\t() =>\n\t\t\textractColorNameFromCurrentValue(\n\t\t\t\tvalue,\n\t\t\t\tcolors,\n\t\t\t\thasMultipleColorOrigins\n\t\t\t),\n\t\t[ value, colors, hasMultipleColorOrigins ]\n\t);\n\n\tconst renderCustomColorPicker = () => (\n\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t<ColorPicker\n\t\t\t\tcolor={ normalizedColorValue }\n\t\t\t\tonChange={ ( color ) => onChange( color ) }\n\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t/>\n\t\t</DropdownContentWrapper>\n\t);\n\tconst isHex = value?.startsWith( '#' );\n\n\t// Leave hex values as-is. Remove the `var()` wrapper from CSS vars.\n\tconst displayValue = value?.replace( /^var\\((.+)\\)$/, '$1' );\n\tconst customColorAccessibleLabel = !! displayValue\n\t\t? sprintf(\n\t\t\t\t// translators: %1$s: The name of the color e.g: \"vivid red\". %2$s: The color's hex code e.g: \"#f00\".\n\t\t\t\t__(\n\t\t\t\t\t'Custom color picker. The currently selected color is called \"%1$s\" and has a value of \"%2$s\".'\n\t\t\t\t),\n\t\t\t\tbuttonLabelName,\n\t\t\t\tdisplayValue\n\t\t )\n\t\t: __( 'Custom color picker.' );\n\n\tconst paletteCommonProps = {\n\t\tclearColor,\n\t\tonChange,\n\t\tvalue,\n\t};\n\n\tconst actions = !! clearable && (\n\t\t<CircularOptionPicker.ButtonAction onClick={ clearColor }>\n\t\t\t{ __( 'Clear' ) }\n\t\t</CircularOptionPicker.ButtonAction>\n\t);\n\n\tlet metaProps:\n\t\t| { asButtons: false; loop?: boolean; 'aria-label': string }\n\t\t| { asButtons: false; loop?: boolean; 'aria-labelledby': string }\n\t\t| { asButtons: true };\n\n\tif ( asButtons ) {\n\t\tmetaProps = { asButtons: true };\n\t} else {\n\t\tconst _metaProps: { asButtons: false; loop?: boolean } = {\n\t\t\tasButtons: false,\n\t\t\tloop,\n\t\t};\n\n\t\tif ( ariaLabel ) {\n\t\t\tmetaProps = { ..._metaProps, 'aria-label': ariaLabel };\n\t\t} else if ( ariaLabelledby ) {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t};\n\t\t} else {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-label': __( 'Custom color picker.' ),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 3 } ref={ forwardedRef } { ...additionalProps }>\n\t\t\t{ ! disableCustomColors && (\n\t\t\t\t<CustomColorPickerDropdown\n\t\t\t\t\tisRenderedInSidebar={ __experimentalIsRenderedInSidebar }\n\t\t\t\t\trenderContent={ renderCustomColorPicker }\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tclassName=\"components-color-palette__custom-color-wrapper\"\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tref={ customColorPaletteCallbackRef }\n\t\t\t\t\t\t\t\tclassName=\"components-color-palette__custom-color-button\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-label={ customColorAccessibleLabel }\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tbackground: value,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\tclassName=\"components-color-palette__custom-color-text-wrapper\"\n\t\t\t\t\t\t\t\tspacing={ 0.5 }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Truncate className=\"components-color-palette__custom-color-name\">\n\t\t\t\t\t\t\t\t\t{ value\n\t\t\t\t\t\t\t\t\t\t? buttonLabelName\n\t\t\t\t\t\t\t\t\t\t: __( 'No color selected' ) }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t{ /*\n\t\t\t\t\t\t\t\tThis `Truncate` is always rendered, even if\n\t\t\t\t\t\t\t\tthere is no `displayValue`, to ensure the layout\n\t\t\t\t\t\t\t\tdoes not shift\n\t\t\t\t\t\t\t\t*/ }\n\t\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'components-color-palette__custom-color-value',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'components-color-palette__custom-color-value--is-hex':\n\t\t\t\t\t\t\t\t\t\t\t\tisHex,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ displayValue }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<CircularOptionPicker\n\t\t\t\t{ ...metaProps }\n\t\t\t\tactions={ actions }\n\t\t\t\toptions={\n\t\t\t\t\thasMultipleColorOrigins ? (\n\t\t\t\t\t\t<MultiplePalettes\n\t\t\t\t\t\t\t{ ...paletteCommonProps }\n\t\t\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t\t\t\tcolors={ colors as PaletteObject[] }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<SinglePalette\n\t\t\t\t\t\t\t{ ...paletteCommonProps }\n\t\t\t\t\t\t\tcolors={ colors as ColorObject[] }\n\t\t\t\t\t\t\tvalue={ value }\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</VStack>\n\t);\n}\n\n/**\n * Allows the user to pick a color from a list of pre-defined color entries.\n *\n * ```jsx\n * import { ColorPalette } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyColorPalette = () => {\n * const [ color, setColor ] = useState ( '#f00' )\n * const colors = [\n * { name: 'red', color: '#f00' },\n * { name: 'white', color: '#fff' },\n * { name: 'blue', color: '#00f' },\n * ];\n * return (\n * <ColorPalette\n * colors={ colors }\n * value={ color }\n * onChange={ ( color ) => setColor( color ) }\n * />\n * );\n * } );\n * ```\n */\nexport const ColorPalette = forwardRef( UnforwardedColorPalette );\n\nexport default ColorPalette;\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACvC,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;;AAE/E;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,YAAY,QAAQ,UAAU;AACvC,OAAOC,sBAAsB,MAAM,sCAAsC;AAWzE,SACCC,gCAAgC,EAChCC,sBAAsB,EACtBC,mBAAmB,QACb,SAAS;AAEhBpB,MAAM,CAAE,CAAEC,WAAW,EAAEC,UAAU,CAAG,CAAC;AAErC,SAASmB,aAAaA,CAAE;EACvBC,SAAS;EACTC,UAAU;EACVC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACL,GAAGC;AACgB,CAAC,E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AAA,GACX2C,kBAAkB;MACvB1C,YAAY,EAAGA,YAAc;MAC7BxB,MAAM,EAAGA,MAA2B;MACpCE,KAAK,EAAGA;IAAO,CACf,CAAC,GAEFS,aAAA,CAACd,aAAa;MAAA,GACRqE,kBAAkB;MACvBlE,MAAM,EAAGA,MAAyB;MAClCE,KAAK,EAAGA;IAAO,CACf;EAEF,CACD,CACM,CAAC;AAEX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM4E,YAAY,GAAG5F,UAAU,CAAEwD,uBAAwB,CAAC;AAEjE,eAAeoC,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["colord","extend","namesPlugin","a11yPlugin","clsx","useInstanceId","__","sprintf","useCallback","useMemo","useState","forwardRef","Dropdown","ColorPicker","CircularOptionPicker","VStack","Truncate","ColorHeading","DropdownContentWrapper","extractColorNameFromCurrentValue","isMultiplePaletteArray","normalizeColorValue","SinglePalette","className","clearColor","colors","onChange","value","additionalProps","colorOptions","map","color","name","index","colordColor","isSelected","createElement","Option","key","selectedIconProps","fill","contrast","tooltipText","style","backgroundColor","onClick","OptionGroup","options","MultiplePalettes","headingLevel","instanceId","length","spacing","colorPalette","id","level","newColor","CustomColorPickerDropdown","isRenderedInSidebar","popoverProps","receivedPopoverProps","props","shift","resize","placement","offset","contentClassName","UnforwardedColorPalette","forwardedRef","asButtons","loop","clearable","disableCustomColors","enableAlpha","__experimentalIsRenderedInSidebar","ariaLabel","ariaLabelledby","normalizedColorValue","setNormalizedColorValue","undefined","customColorPaletteCallbackRef","node","hasMultipleColorOrigins","buttonLabelName","renderCustomColorPicker","paddingSize","isHex","startsWith","displayValue","replace","customColorAccessibleLabel","paletteCommonProps","actions","ButtonAction","metaProps","_metaProps","ref","renderContent","renderToggle","isOpen","onToggle","background","type","ColorPalette"],"sources":["@wordpress/components/src/color-palette/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useMemo, useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Dropdown from '../dropdown';\nimport { ColorPicker } from '../color-picker';\nimport CircularOptionPicker from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport { Truncate } from '../truncate';\nimport { ColorHeading } from './styles';\nimport DropdownContentWrapper from '../dropdown/dropdown-content-wrapper';\nimport type {\n\tColorObject,\n\tColorPaletteProps,\n\tCustomColorPickerDropdownProps,\n\tMultiplePalettesProps,\n\tPaletteObject,\n\tSinglePaletteProps,\n} from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { DropdownProps } from '../dropdown/types';\nimport {\n\textractColorNameFromCurrentValue,\n\tisMultiplePaletteArray,\n\tnormalizeColorValue,\n} from './utils';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nfunction SinglePalette( {\n\tclassName,\n\tclearColor,\n\tcolors,\n\tonChange,\n\tvalue,\n\t...additionalProps\n}: SinglePaletteProps ) {\n\tconst colorOptions = useMemo( () => {\n\t\treturn colors.map( ( { color, name }, index ) => {\n\t\t\tconst colordColor = colord( color );\n\t\t\tconst isSelected = value === color;\n\n\t\t\treturn (\n\t\t\t\t<CircularOptionPicker.Option\n\t\t\t\t\tkey={ `${ color }-${ index }` }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tselectedIconProps={\n\t\t\t\t\t\tisSelected\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tfill:\n\t\t\t\t\t\t\t\t\t\tcolordColor.contrast() >\n\t\t\t\t\t\t\t\t\t\tcolordColor.contrast( '#000' )\n\t\t\t\t\t\t\t\t\t\t\t? '#fff'\n\t\t\t\t\t\t\t\t\t\t\t: '#000',\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: {}\n\t\t\t\t\t}\n\t\t\t\t\ttooltipText={\n\t\t\t\t\t\tname ||\n\t\t\t\t\t\t// translators: %s: color hex code e.g: \"#f00\".\n\t\t\t\t\t\tsprintf( __( 'Color code: %s' ), color )\n\t\t\t\t\t}\n\t\t\t\t\tstyle={ { backgroundColor: color, color } }\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tisSelected ? clearColor : () => onChange( color, index )\n\t\t\t\t\t}\n\t\t\t\t\taria-label={\n\t\t\t\t\t\tname\n\t\t\t\t\t\t\t? // translators: %s: The name of the color e.g: \"vivid red\".\n\t\t\t\t\t\t\t sprintf( __( 'Color: %s' ), name )\n\t\t\t\t\t\t\t: // translators: %s: color hex code e.g: \"#f00\".\n\t\t\t\t\t\t\t sprintf( __( 'Color code: %s' ), color )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\t}, [ colors, value, onChange, clearColor ] );\n\n\treturn (\n\t\t<CircularOptionPicker.OptionGroup\n\t\t\tclassName={ className }\n\t\t\toptions={ colorOptions }\n\t\t\t{ ...additionalProps }\n\t\t/>\n\t);\n}\n\nfunction MultiplePalettes( {\n\tclassName,\n\tclearColor,\n\tcolors,\n\tonChange,\n\tvalue,\n\theadingLevel,\n}: MultiplePalettesProps ) {\n\tconst instanceId = useInstanceId( MultiplePalettes, 'color-palette' );\n\n\tif ( colors.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 3 } className={ className }>\n\t\t\t{ colors.map( ( { name, colors: colorPalette }, index ) => {\n\t\t\t\tconst id = `${ instanceId }-${ index }`;\n\t\t\t\treturn (\n\t\t\t\t\t<VStack spacing={ 2 } key={ index }>\n\t\t\t\t\t\t<ColorHeading id={ id } level={ headingLevel }>\n\t\t\t\t\t\t\t{ name }\n\t\t\t\t\t\t</ColorHeading>\n\t\t\t\t\t\t<SinglePalette\n\t\t\t\t\t\t\tclearColor={ clearColor }\n\t\t\t\t\t\t\tcolors={ colorPalette }\n\t\t\t\t\t\t\tonChange={ ( newColor ) =>\n\t\t\t\t\t\t\t\tonChange( newColor, index )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\taria-labelledby={ id }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</VStack>\n\t);\n}\n\nexport function CustomColorPickerDropdown( {\n\tisRenderedInSidebar,\n\tpopoverProps: receivedPopoverProps,\n\t...props\n}: CustomColorPickerDropdownProps ) {\n\tconst popoverProps = useMemo< DropdownProps[ 'popoverProps' ] >(\n\t\t() => ( {\n\t\t\tshift: true,\n\t\t\t// Disabling resize as it would otherwise cause the popover to show\n\t\t\t// scrollbars while dragging the color picker's handle close to the\n\t\t\t// popover edge.\n\t\t\tresize: false,\n\t\t\t...( isRenderedInSidebar\n\t\t\t\t? {\n\t\t\t\t\t\t// When in the sidebar: open to the left (stacking),\n\t\t\t\t\t\t// leaving the same gap as the parent popover.\n\t\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t\toffset: 34,\n\t\t\t\t }\n\t\t\t\t: {\n\t\t\t\t\t\t// Default behavior: open below the anchor\n\t\t\t\t\t\tplacement: 'bottom',\n\t\t\t\t\t\toffset: 8,\n\t\t\t\t } ),\n\t\t\t...receivedPopoverProps,\n\t\t} ),\n\t\t[ isRenderedInSidebar, receivedPopoverProps ]\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tcontentClassName=\"components-color-palette__custom-color-dropdown-content\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction UnforwardedColorPalette(\n\tprops: WordPressComponentProps< ColorPaletteProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tasButtons,\n\t\tloop,\n\t\tclearable = true,\n\t\tcolors = [],\n\t\tdisableCustomColors = false,\n\t\tenableAlpha = false,\n\t\tonChange,\n\t\tvalue,\n\t\t__experimentalIsRenderedInSidebar = false,\n\t\theadingLevel = 2,\n\t\t'aria-label': ariaLabel,\n\t\t'aria-labelledby': ariaLabelledby,\n\t\t...additionalProps\n\t} = props;\n\tconst [ normalizedColorValue, setNormalizedColorValue ] = useState( value );\n\n\tconst clearColor = useCallback( () => onChange( undefined ), [ onChange ] );\n\n\tconst customColorPaletteCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tsetNormalizedColorValue( normalizeColorValue( value, node ) );\n\t\t},\n\t\t[ value ]\n\t);\n\n\tconst hasMultipleColorOrigins = isMultiplePaletteArray( colors );\n\tconst buttonLabelName = useMemo(\n\t\t() =>\n\t\t\textractColorNameFromCurrentValue(\n\t\t\t\tvalue,\n\t\t\t\tcolors,\n\t\t\t\thasMultipleColorOrigins\n\t\t\t),\n\t\t[ value, colors, hasMultipleColorOrigins ]\n\t);\n\n\tconst renderCustomColorPicker = () => (\n\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t<ColorPicker\n\t\t\t\tcolor={ normalizedColorValue }\n\t\t\t\tonChange={ ( color ) => onChange( color ) }\n\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t/>\n\t\t</DropdownContentWrapper>\n\t);\n\tconst isHex = value?.startsWith( '#' );\n\n\t// Leave hex values as-is. Remove the `var()` wrapper from CSS vars.\n\tconst displayValue = value?.replace( /^var\\((.+)\\)$/, '$1' );\n\tconst customColorAccessibleLabel = !! displayValue\n\t\t? sprintf(\n\t\t\t\t// translators: %1$s: The name of the color e.g: \"vivid red\". %2$s: The color's hex code e.g: \"#f00\".\n\t\t\t\t__(\n\t\t\t\t\t'Custom color picker. The currently selected color is called \"%1$s\" and has a value of \"%2$s\".'\n\t\t\t\t),\n\t\t\t\tbuttonLabelName,\n\t\t\t\tdisplayValue\n\t\t )\n\t\t: __( 'Custom color picker.' );\n\n\tconst paletteCommonProps = {\n\t\tclearColor,\n\t\tonChange,\n\t\tvalue,\n\t};\n\n\tconst actions = !! clearable && (\n\t\t<CircularOptionPicker.ButtonAction onClick={ clearColor }>\n\t\t\t{ __( 'Clear' ) }\n\t\t</CircularOptionPicker.ButtonAction>\n\t);\n\n\tlet metaProps:\n\t\t| { asButtons: false; loop?: boolean; 'aria-label': string }\n\t\t| { asButtons: false; loop?: boolean; 'aria-labelledby': string }\n\t\t| { asButtons: true };\n\n\tif ( asButtons ) {\n\t\tmetaProps = { asButtons: true };\n\t} else {\n\t\tconst _metaProps: { asButtons: false; loop?: boolean } = {\n\t\t\tasButtons: false,\n\t\t\tloop,\n\t\t};\n\n\t\tif ( ariaLabel ) {\n\t\t\tmetaProps = { ..._metaProps, 'aria-label': ariaLabel };\n\t\t} else if ( ariaLabelledby ) {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t};\n\t\t} else {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-label': __( 'Custom color picker.' ),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 3 } ref={ forwardedRef } { ...additionalProps }>\n\t\t\t{ ! disableCustomColors && (\n\t\t\t\t<CustomColorPickerDropdown\n\t\t\t\t\tisRenderedInSidebar={ __experimentalIsRenderedInSidebar }\n\t\t\t\t\trenderContent={ renderCustomColorPicker }\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tclassName=\"components-color-palette__custom-color-wrapper\"\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tref={ customColorPaletteCallbackRef }\n\t\t\t\t\t\t\t\tclassName=\"components-color-palette__custom-color-button\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-label={ customColorAccessibleLabel }\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tbackground: value,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\tclassName=\"components-color-palette__custom-color-text-wrapper\"\n\t\t\t\t\t\t\t\tspacing={ 0.5 }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Truncate className=\"components-color-palette__custom-color-name\">\n\t\t\t\t\t\t\t\t\t{ value\n\t\t\t\t\t\t\t\t\t\t? buttonLabelName\n\t\t\t\t\t\t\t\t\t\t: __( 'No color selected' ) }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t{ /*\n\t\t\t\t\t\t\t\tThis `Truncate` is always rendered, even if\n\t\t\t\t\t\t\t\tthere is no `displayValue`, to ensure the layout\n\t\t\t\t\t\t\t\tdoes not shift\n\t\t\t\t\t\t\t\t*/ }\n\t\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'components-color-palette__custom-color-value',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'components-color-palette__custom-color-value--is-hex':\n\t\t\t\t\t\t\t\t\t\t\t\tisHex,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ displayValue }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<CircularOptionPicker\n\t\t\t\t{ ...metaProps }\n\t\t\t\tactions={ actions }\n\t\t\t\toptions={\n\t\t\t\t\thasMultipleColorOrigins ? (\n\t\t\t\t\t\t<MultiplePalettes\n\t\t\t\t\t\t\t{ ...paletteCommonProps }\n\t\t\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t\t\t\tcolors={ colors as PaletteObject[] }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<SinglePalette\n\t\t\t\t\t\t\t{ ...paletteCommonProps }\n\t\t\t\t\t\t\tcolors={ colors as ColorObject[] }\n\t\t\t\t\t\t\tvalue={ value }\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</VStack>\n\t);\n}\n\n/**\n * Allows the user to pick a color from a list of pre-defined color entries.\n *\n * ```jsx\n * import { ColorPalette } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyColorPalette = () => {\n * const [ color, setColor ] = useState ( '#f00' )\n * const colors = [\n * { name: 'red', color: '#f00' },\n * { name: 'white', color: '#fff' },\n * { name: 'blue', color: '#00f' },\n * ];\n * return (\n * <ColorPalette\n * colors={ colors }\n * value={ color }\n * onChange={ ( color ) => setColor( color ) }\n * />\n * );\n * } );\n * ```\n */\nexport const ColorPalette = forwardRef( UnforwardedColorPalette );\n\nexport default ColorPalette;\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACvC,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;;AAE/E;AACA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AAA,CAACrB,MAAM;MACNQ,SAAS,EAAC,qDAAqD;MAC/D6B,OAAO,EAAG;IAAK,GAEfhB,aAAA,CAACpB,QAAQ;MAACO,SAAS,EAAC;IAA6C,GAC9DI,KAAK,GACJwD,eAAe,GACf7E,EAAE,CAAE,mBAAoB,CAClB,CAAC,EAMX8B,aAAA,CAACpB,QAAQ;MACRO,SAAS,EAAGnB,IAAI,CACf,8CAA8C,EAC9C;QACC,sDAAsD,EACrDkF;MACF,CACD;IAAG,GAEDE,YACO,CACH,CACD;EACN,CACH,CACD,EACDpD,aAAA,CAACtB,oBAAoB;IAAA,GACfgF,SAAS;IACdF,OAAO,EAAGA,OAAS;IACnB7C,OAAO,EACNmC,uBAAuB,GACtB9C,aAAA,CAACY,gBAAgB;MAAA,GACX2C,kBAAkB;MACvB1C,YAAY,EAAGA,YAAc;MAC7BxB,MAAM,EAAGA,MAA2B;MACpCE,KAAK,EAAGA;IAAO,CACf,CAAC,GAEFS,aAAA,CAACd,aAAa;MAAA,GACRqE,kBAAkB;MACvBlE,MAAM,EAAGA,MAAyB;MAClCE,KAAK,EAAGA;IAAO,CACf;EAEF,CACD,CACM,CAAC;AAEX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM4E,YAAY,GAAG5F,UAAU,CAAEwD,uBAAwB,CAAC;AAEjE,eAAeoC,YAAY","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -54,10 +54,12 @@ const getIndexOfMatchingSuggestion = (selectedSuggestion, matchingSuggestions) =
54
54
  * {
55
55
  * value: 'normal',
56
56
  * label: 'Normal',
57
+ * disabled: true,
57
58
  * },
58
59
  * {
59
60
  * value: 'large',
60
61
  * label: 'Large',
62
+ * disabled: false,
61
63
  * },
62
64
  * ];
63
65
  *
@@ -133,6 +135,9 @@ function ComboboxControl(props) {
133
135
  return startsWithMatch.concat(containsMatch);
134
136
  }, [inputValue, options]);
135
137
  const onSuggestionSelected = newSelectedSuggestion => {
138
+ if (newSelectedSuggestion.disabled) {
139
+ return;
140
+ }
136
141
  setValue(newSelectedSuggestion.value);
137
142
  speak(messages.selected, 'assertive');
138
143
  setSelectedSuggestion(newSelectedSuggestion);
@@ -235,7 +240,7 @@ function ComboboxControl(props) {
235
240
  onFocusOutside: onFocusOutside
236
241
  }, createElement(BaseControl, {
237
242
  __nextHasNoMarginBottom: __nextHasNoMarginBottom,
238
- className: classnames(className, 'components-combobox-control'),
243
+ className: clsx(className, 'components-combobox-control'),
239
244
  label: label,
240
245
  id: `components-form-token-input-${instanceId}`,
241
246
  hideLabelFromVision: hideLabelFromVision,
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__","_n","sprintf","Component","useState","useMemo","useRef","useEffect","useInstanceId","speak","closeSmall","InputWrapperFlex","TokenInput","SuggestionsList","BaseControl","Button","FlexBlock","FlexItem","withFocusOutside","useControlledValue","normalizeTextString","useDeprecated36pxDefaultSizeProp","withIgnoreIMEEvents","noop","DetectOutside","handleFocusOutside","event","props","onFocusOutside","render","children","getIndexOfMatchingSuggestion","selectedSuggestion","matchingSuggestions","indexOf","ComboboxControl","_currentOption$label","__nextHasNoMarginBottom","__next40pxDefaultSize","value","valueProp","label","options","onChange","onChangeProp","onFilterValueChange","hideLabelFromVision","help","allowReset","className","messages","selected","__experimentalRenderItem","setValue","currentOption","find","option","currentLabel","instanceId","setSelectedSuggestion","isExpanded","setIsExpanded","inputHasFocus","setInputHasFocus","inputValue","setInputValue","inputContainer","startsWithMatch","containsMatch","match","forEach","index","push","concat","onSuggestionSelected","newSelectedSuggestion","handleArrowNavigation","offset","nextIndex","length","onKeyDown","preventDefault","defaultPrevented","code","onBlur","onFocus","onInputChange","text","handleOnReset","current","focus","hasMatchingSuggestions","hasSelectedMatchingSuggestions","message","createElement","id","tabIndex","ref","selectedSuggestionIndex","icon","disabled","onClick","displayTransform","suggestion","suggestions","selectedIndex","onHover","onSelect","scrollIntoView"],"sources":["@wordpress/components/src/combobox-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tComponent,\n\tuseState,\n\tuseMemo,\n\tuseRef,\n\tuseEffect,\n} from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { InputWrapperFlex } from './styles';\nimport TokenInput from '../form-token-field/token-input';\nimport SuggestionsList from '../form-token-field/suggestions-list';\nimport BaseControl from '../base-control';\nimport Button from '../button';\nimport { FlexBlock, FlexItem } from '../flex';\nimport withFocusOutside from '../higher-order/with-focus-outside';\nimport { useControlledValue } from '../utils/hooks';\nimport { normalizeTextString } from '../utils/strings';\nimport type { ComboboxControlOption, ComboboxControlProps } from './types';\nimport type { TokenInputProps } from '../form-token-field/types';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\n\nconst noop = () => {};\n\ninterface DetectOutsideComponentProps {\n\tonFocusOutside: ( event: React.FocusEvent ) => void;\n\tchildren?: React.ReactNode;\n}\n\nconst DetectOutside = withFocusOutside(\n\tclass extends Component< DetectOutsideComponentProps > {\n\t\thandleFocusOutside( event: React.FocusEvent ) {\n\t\t\tthis.props.onFocusOutside( event );\n\t\t}\n\n\t\trender() {\n\t\t\treturn this.props.children;\n\t\t}\n\t}\n);\n\nconst getIndexOfMatchingSuggestion = (\n\tselectedSuggestion: ComboboxControlOption | null,\n\tmatchingSuggestions: ComboboxControlOption[]\n) =>\n\tselectedSuggestion === null\n\t\t? -1\n\t\t: matchingSuggestions.indexOf( selectedSuggestion );\n\n/**\n * `ComboboxControl` is an enhanced version of a [`SelectControl`](../select-control/README.md) with the addition of\n * being able to search for options using a search input.\n *\n * ```jsx\n * import { ComboboxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const options = [\n * \t{\n * \t\tvalue: 'small',\n * \t\tlabel: 'Small',\n * \t},\n * \t{\n * \t\tvalue: 'normal',\n * \t\tlabel: 'Normal',\n * \t},\n * \t{\n * \t\tvalue: 'large',\n * \t\tlabel: 'Large',\n * \t},\n * ];\n *\n * function MyComboboxControl() {\n * \tconst [ fontSize, setFontSize ] = useState();\n * \tconst [ filteredOptions, setFilteredOptions ] = useState( options );\n * \treturn (\n * \t\t<ComboboxControl\n * \t\t\tlabel=\"Font Size\"\n * \t\t\tvalue={ fontSize }\n * \t\t\tonChange={ setFontSize }\n * \t\t\toptions={ filteredOptions }\n * \t\t\tonFilterValueChange={ ( inputValue ) =>\n * \t\t\t\tsetFilteredOptions(\n * \t\t\t\t\toptions.filter( ( option ) =>\n * \t\t\t\t\t\toption.label\n * \t\t\t\t\t\t\t.toLowerCase()\n * \t\t\t\t\t\t\t.startsWith( inputValue.toLowerCase() )\n * \t\t\t\t\t)\n * \t\t\t\t)\n * \t\t\t}\n * \t\t/>\n * \t);\n * }\n * ```\n */\nfunction ComboboxControl( props: ComboboxControlProps ) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\t__next40pxDefaultSize = false,\n\t\tvalue: valueProp,\n\t\tlabel,\n\t\toptions,\n\t\tonChange: onChangeProp,\n\t\tonFilterValueChange = noop,\n\t\thideLabelFromVision,\n\t\thelp,\n\t\tallowReset = true,\n\t\tclassName,\n\t\tmessages = {\n\t\t\tselected: __( 'Item selected.' ),\n\t\t},\n\t\t__experimentalRenderItem,\n\t} = useDeprecated36pxDefaultSizeProp( props );\n\n\tconst [ value, setValue ] = useControlledValue( {\n\t\tvalue: valueProp,\n\t\tonChange: onChangeProp,\n\t} );\n\n\tconst currentOption = options.find( ( option ) => option.value === value );\n\tconst currentLabel = currentOption?.label ?? '';\n\t// Use a custom prefix when generating the `instanceId` to avoid having\n\t// duplicate input IDs when rendering this component and `FormTokenField`\n\t// in the same page (see https://github.com/WordPress/gutenberg/issues/42112).\n\tconst instanceId = useInstanceId( ComboboxControl, 'combobox-control' );\n\tconst [ selectedSuggestion, setSelectedSuggestion ] = useState(\n\t\tcurrentOption || null\n\t);\n\tconst [ isExpanded, setIsExpanded ] = useState( false );\n\tconst [ inputHasFocus, setInputHasFocus ] = useState( false );\n\tconst [ inputValue, setInputValue ] = useState( '' );\n\tconst inputContainer = useRef< HTMLInputElement >( null );\n\n\tconst matchingSuggestions = useMemo( () => {\n\t\tconst startsWithMatch: ComboboxControlOption[] = [];\n\t\tconst containsMatch: ComboboxControlOption[] = [];\n\t\tconst match = normalizeTextString( inputValue );\n\t\toptions.forEach( ( option ) => {\n\t\t\tconst index = normalizeTextString( option.label ).indexOf( match );\n\t\t\tif ( index === 0 ) {\n\t\t\t\tstartsWithMatch.push( option );\n\t\t\t} else if ( index > 0 ) {\n\t\t\t\tcontainsMatch.push( option );\n\t\t\t}\n\t\t} );\n\n\t\treturn startsWithMatch.concat( containsMatch );\n\t}, [ inputValue, options ] );\n\n\tconst onSuggestionSelected = (\n\t\tnewSelectedSuggestion: ComboboxControlOption\n\t) => {\n\t\tsetValue( newSelectedSuggestion.value );\n\t\tspeak( messages.selected, 'assertive' );\n\t\tsetSelectedSuggestion( newSelectedSuggestion );\n\t\tsetInputValue( '' );\n\t\tsetIsExpanded( false );\n\t};\n\n\tconst handleArrowNavigation = ( offset = 1 ) => {\n\t\tconst index = getIndexOfMatchingSuggestion(\n\t\t\tselectedSuggestion,\n\t\t\tmatchingSuggestions\n\t\t);\n\t\tlet nextIndex = index + offset;\n\t\tif ( nextIndex < 0 ) {\n\t\t\tnextIndex = matchingSuggestions.length - 1;\n\t\t} else if ( nextIndex >= matchingSuggestions.length ) {\n\t\t\tnextIndex = 0;\n\t\t}\n\t\tsetSelectedSuggestion( matchingSuggestions[ nextIndex ] );\n\t\tsetIsExpanded( true );\n\t};\n\n\tconst onKeyDown: React.KeyboardEventHandler< HTMLDivElement > =\n\t\twithIgnoreIMEEvents( ( event ) => {\n\t\t\tlet preventDefault = false;\n\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tswitch ( event.code ) {\n\t\t\t\tcase 'Enter':\n\t\t\t\t\tif ( selectedSuggestion ) {\n\t\t\t\t\t\tonSuggestionSelected( selectedSuggestion );\n\t\t\t\t\t\tpreventDefault = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\thandleArrowNavigation( -1 );\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\thandleArrowNavigation( 1 );\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Escape':\n\t\t\t\t\tsetIsExpanded( false );\n\t\t\t\t\tsetSelectedSuggestion( null );\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( preventDefault ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} );\n\n\tconst onBlur = () => {\n\t\tsetInputHasFocus( false );\n\t};\n\n\tconst onFocus = () => {\n\t\tsetInputHasFocus( true );\n\t\tsetIsExpanded( true );\n\t\tonFilterValueChange( '' );\n\t\tsetInputValue( '' );\n\t};\n\n\tconst onFocusOutside = () => {\n\t\tsetIsExpanded( false );\n\t};\n\n\tconst onInputChange: TokenInputProps[ 'onChange' ] = ( event ) => {\n\t\tconst text = event.value;\n\t\tsetInputValue( text );\n\t\tonFilterValueChange( text );\n\t\tif ( inputHasFocus ) {\n\t\t\tsetIsExpanded( true );\n\t\t}\n\t};\n\n\tconst handleOnReset = () => {\n\t\tsetValue( null );\n\t\tinputContainer.current?.focus();\n\t};\n\n\t// Update current selections when the filter input changes.\n\tuseEffect( () => {\n\t\tconst hasMatchingSuggestions = matchingSuggestions.length > 0;\n\t\tconst hasSelectedMatchingSuggestions =\n\t\t\tgetIndexOfMatchingSuggestion(\n\t\t\t\tselectedSuggestion,\n\t\t\t\tmatchingSuggestions\n\t\t\t) > 0;\n\n\t\tif ( hasMatchingSuggestions && ! hasSelectedMatchingSuggestions ) {\n\t\t\t// If the current selection isn't present in the list of suggestions, then automatically select the first item from the list of suggestions.\n\t\t\tsetSelectedSuggestion( matchingSuggestions[ 0 ] );\n\t\t}\n\t}, [ matchingSuggestions, selectedSuggestion ] );\n\n\t// Announcements.\n\tuseEffect( () => {\n\t\tconst hasMatchingSuggestions = matchingSuggestions.length > 0;\n\t\tif ( isExpanded ) {\n\t\t\tconst message = hasMatchingSuggestions\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\tmatchingSuggestions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmatchingSuggestions.length\n\t\t\t\t )\n\t\t\t\t: __( 'No results.' );\n\n\t\t\tspeak( message, 'polite' );\n\t\t}\n\t}, [ matchingSuggestions, isExpanded ] );\n\n\t// Disable reason: There is no appropriate role which describes the\n\t// input container intended accessible usability.\n\t// TODO: Refactor click detection to use blur to stop propagation.\n\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\treturn (\n\t\t<DetectOutside onFocusOutside={ onFocusOutside }>\n\t\t\t<BaseControl\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\tclassName,\n\t\t\t\t\t'components-combobox-control'\n\t\t\t\t) }\n\t\t\t\tlabel={ label }\n\t\t\t\tid={ `components-form-token-input-${ instanceId }` }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\thelp={ help }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"components-combobox-control__suggestions-container\"\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t>\n\t\t\t\t\t<InputWrapperFlex\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t\t<TokenInput\n\t\t\t\t\t\t\t\tclassName=\"components-combobox-control__input\"\n\t\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\t\tref={ inputContainer }\n\t\t\t\t\t\t\t\tvalue={ isExpanded ? inputValue : currentLabel }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tonBlur={ onBlur }\n\t\t\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\t\t\tselectedSuggestionIndex={ getIndexOfMatchingSuggestion(\n\t\t\t\t\t\t\t\t\tselectedSuggestion,\n\t\t\t\t\t\t\t\t\tmatchingSuggestions\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ onInputChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t\t{ allowReset && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"components-combobox-control__reset\"\n\t\t\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\t\t\tdisabled={ ! value }\n\t\t\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</InputWrapperFlex>\n\t\t\t\t\t{ isExpanded && (\n\t\t\t\t\t\t<SuggestionsList\n\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\t// The empty string for `value` here is not actually used, but is\n\t\t\t\t\t\t\t// just a quick way to satisfy the TypeScript requirements of SuggestionsList.\n\t\t\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/pull/47581/files#r1091089330\n\t\t\t\t\t\t\tmatch={ { label: inputValue, value: '' } }\n\t\t\t\t\t\t\tdisplayTransform={ ( suggestion ) =>\n\t\t\t\t\t\t\t\tsuggestion.label\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsuggestions={ matchingSuggestions }\n\t\t\t\t\t\t\tselectedIndex={ getIndexOfMatchingSuggestion(\n\t\t\t\t\t\t\t\tselectedSuggestion,\n\t\t\t\t\t\t\t\tmatchingSuggestions\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonHover={ setSelectedSuggestion }\n\t\t\t\t\t\t\tonSelect={ onSuggestionSelected }\n\t\t\t\t\t\t\tscrollIntoView\n\t\t\t\t\t\t\t__experimentalRenderItem={\n\t\t\t\t\t\t\t\t__experimentalRenderItem\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</div>\n\t\t\t</BaseControl>\n\t\t</DetectOutside>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n}\n\nexport default ComboboxControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACPC,MAAM,EACNC,SAAS,QACH,oBAAoB;AAC3B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,U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CwE,aAAa,EAAG1E,4BAA4B,CAC3CC,kBAAkB,EAClBC,mBACD,CAAG;IACHyE,OAAO,EAAG/C,qBAAuB;IACjCgD,QAAQ,EAAGjC,oBAAsB;IACjCkC,cAAc;IACdxD,wBAAwB,EACvBA;EACA,CACD,CAEE,CACO,CACC,CAAC;EAEjB;AACD;AAEA,eAAejB,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","_n","sprintf","Component","useState","useMemo","useRef","useEffect","useInstanceId","speak","closeSmall","InputWrapperFlex","TokenInput","SuggestionsList","BaseControl","Button","FlexBlock","FlexItem","withFocusOutside","useControlledValue","normalizeTextString","useDeprecated36pxDefaultSizeProp","withIgnoreIMEEvents","noop","DetectOutside","handleFocusOutside","event","props","onFocusOutside","render","children","getIndexOfMatchingSuggestion","selectedSuggestion","matchingSuggestions","indexOf","ComboboxControl","_currentOption$label","__nextHasNoMarginBottom","__next40pxDefaultSize","value","valueProp","label","options","onChange","onChangeProp","onFilterValueChange","hideLabelFromVision","help","allowReset","className","messages","selected","__experimentalRenderItem","setValue","currentOption","find","option","currentLabel","instanceId","setSelectedSuggestion","isExpanded","setIsExpanded","inputHasFocus","setInputHasFocus","inputValue","setInputValue","inputContainer","startsWithMatch","containsMatch","match","forEach","index","push","concat","onSuggestionSelected","newSelectedSuggestion","disabled","handleArrowNavigation","offset","nextIndex","length","onKeyDown","preventDefault","defaultPrevented","code","onBlur","onFocus","onInputChange","text","handleOnReset","current","focus","hasMatchingSuggestions","hasSelectedMatchingSuggestions","message","createElement","id","tabIndex","ref","selectedSuggestionIndex","icon","onClick","displayTransform","suggestion","suggestions","selectedIndex","onHover","onSelect","scrollIntoView"],"sources":["@wordpress/components/src/combobox-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tComponent,\n\tuseState,\n\tuseMemo,\n\tuseRef,\n\tuseEffect,\n} from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { InputWrapperFlex } from './styles';\nimport TokenInput from '../form-token-field/token-input';\nimport SuggestionsList from '../form-token-field/suggestions-list';\nimport BaseControl from '../base-control';\nimport Button from '../button';\nimport { FlexBlock, FlexItem } from '../flex';\nimport withFocusOutside from '../higher-order/with-focus-outside';\nimport { useControlledValue } from '../utils/hooks';\nimport { normalizeTextString } from '../utils/strings';\nimport type { ComboboxControlOption, ComboboxControlProps } from './types';\nimport type { TokenInputProps } from '../form-token-field/types';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\n\nconst noop = () => {};\n\ninterface DetectOutsideComponentProps {\n\tonFocusOutside: ( event: React.FocusEvent ) => void;\n\tchildren?: React.ReactNode;\n}\n\nconst DetectOutside = withFocusOutside(\n\tclass extends Component< DetectOutsideComponentProps > {\n\t\thandleFocusOutside( event: React.FocusEvent ) {\n\t\t\tthis.props.onFocusOutside( event );\n\t\t}\n\n\t\trender() {\n\t\t\treturn this.props.children;\n\t\t}\n\t}\n);\n\nconst getIndexOfMatchingSuggestion = (\n\tselectedSuggestion: ComboboxControlOption | null,\n\tmatchingSuggestions: ComboboxControlOption[]\n) =>\n\tselectedSuggestion === null\n\t\t? -1\n\t\t: matchingSuggestions.indexOf( selectedSuggestion );\n\n/**\n * `ComboboxControl` is an enhanced version of a [`SelectControl`](../select-control/README.md) with the addition of\n * being able to search for options using a search input.\n *\n * ```jsx\n * import { ComboboxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const options = [\n * \t{\n * \t\tvalue: 'small',\n * \t\tlabel: 'Small',\n * \t},\n * \t{\n * \t\tvalue: 'normal',\n * \t\tlabel: 'Normal',\n * \t\tdisabled: true,\n * \t},\n * \t{\n * \t\tvalue: 'large',\n * \t\tlabel: 'Large',\n * \t\tdisabled: false,\n * \t},\n * ];\n *\n * function MyComboboxControl() {\n * \tconst [ fontSize, setFontSize ] = useState();\n * \tconst [ filteredOptions, setFilteredOptions ] = useState( options );\n * \treturn (\n * \t\t<ComboboxControl\n * \t\t\tlabel=\"Font Size\"\n * \t\t\tvalue={ fontSize }\n * \t\t\tonChange={ setFontSize }\n * \t\t\toptions={ filteredOptions }\n * \t\t\tonFilterValueChange={ ( inputValue ) =>\n * \t\t\t\tsetFilteredOptions(\n * \t\t\t\t\toptions.filter( ( option ) =>\n * \t\t\t\t\t\toption.label\n * \t\t\t\t\t\t\t.toLowerCase()\n * \t\t\t\t\t\t\t.startsWith( inputValue.toLowerCase() )\n * \t\t\t\t\t)\n * \t\t\t\t)\n * \t\t\t}\n * \t\t/>\n * \t);\n * }\n * ```\n */\nfunction ComboboxControl( props: ComboboxControlProps ) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\t__next40pxDefaultSize = false,\n\t\tvalue: valueProp,\n\t\tlabel,\n\t\toptions,\n\t\tonChange: onChangeProp,\n\t\tonFilterValueChange = noop,\n\t\thideLabelFromVision,\n\t\thelp,\n\t\tallowReset = true,\n\t\tclassName,\n\t\tmessages = {\n\t\t\tselected: __( 'Item selected.' ),\n\t\t},\n\t\t__experimentalRenderItem,\n\t} = useDeprecated36pxDefaultSizeProp( props );\n\n\tconst [ value, setValue ] = useControlledValue( {\n\t\tvalue: valueProp,\n\t\tonChange: onChangeProp,\n\t} );\n\n\tconst currentOption = options.find( ( option ) => option.value === value );\n\tconst currentLabel = currentOption?.label ?? '';\n\t// Use a custom prefix when generating the `instanceId` to avoid having\n\t// duplicate input IDs when rendering this component and `FormTokenField`\n\t// in the same page (see https://github.com/WordPress/gutenberg/issues/42112).\n\tconst instanceId = useInstanceId( ComboboxControl, 'combobox-control' );\n\tconst [ selectedSuggestion, setSelectedSuggestion ] = useState(\n\t\tcurrentOption || null\n\t);\n\tconst [ isExpanded, setIsExpanded ] = useState( false );\n\tconst [ inputHasFocus, setInputHasFocus ] = useState( false );\n\tconst [ inputValue, setInputValue ] = useState( '' );\n\tconst inputContainer = useRef< HTMLInputElement >( null );\n\n\tconst matchingSuggestions = useMemo( () => {\n\t\tconst startsWithMatch: ComboboxControlOption[] = [];\n\t\tconst containsMatch: ComboboxControlOption[] = [];\n\t\tconst match = normalizeTextString( inputValue );\n\t\toptions.forEach( ( option ) => {\n\t\t\tconst index = normalizeTextString( option.label ).indexOf( match );\n\t\t\tif ( index === 0 ) {\n\t\t\t\tstartsWithMatch.push( option );\n\t\t\t} else if ( index > 0 ) {\n\t\t\t\tcontainsMatch.push( option );\n\t\t\t}\n\t\t} );\n\n\t\treturn startsWithMatch.concat( containsMatch );\n\t}, [ inputValue, options ] );\n\n\tconst onSuggestionSelected = (\n\t\tnewSelectedSuggestion: ComboboxControlOption\n\t) => {\n\t\tif ( newSelectedSuggestion.disabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetValue( newSelectedSuggestion.value );\n\t\tspeak( messages.selected, 'assertive' );\n\t\tsetSelectedSuggestion( newSelectedSuggestion );\n\t\tsetInputValue( '' );\n\t\tsetIsExpanded( false );\n\t};\n\n\tconst handleArrowNavigation = ( offset = 1 ) => {\n\t\tconst index = getIndexOfMatchingSuggestion(\n\t\t\tselectedSuggestion,\n\t\t\tmatchingSuggestions\n\t\t);\n\t\tlet nextIndex = index + offset;\n\t\tif ( nextIndex < 0 ) {\n\t\t\tnextIndex = matchingSuggestions.length - 1;\n\t\t} else if ( nextIndex >= matchingSuggestions.length ) {\n\t\t\tnextIndex = 0;\n\t\t}\n\t\tsetSelectedSuggestion( matchingSuggestions[ nextIndex ] );\n\t\tsetIsExpanded( true );\n\t};\n\n\tconst onKeyDown: React.KeyboardEventHandler< HTMLDivElement > =\n\t\twithIgnoreIMEEvents( ( event ) => {\n\t\t\tlet preventDefault = false;\n\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tswitch ( event.code ) {\n\t\t\t\tcase 'Enter':\n\t\t\t\t\tif ( selectedSuggestion ) {\n\t\t\t\t\t\tonSuggestionSelected( selectedSuggestion );\n\t\t\t\t\t\tpreventDefault = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\thandleArrowNavigation( -1 );\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\thandleArrowNavigation( 1 );\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Escape':\n\t\t\t\t\tsetIsExpanded( false );\n\t\t\t\t\tsetSelectedSuggestion( null );\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( preventDefault ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} );\n\n\tconst onBlur = () => {\n\t\tsetInputHasFocus( false );\n\t};\n\n\tconst onFocus = () => {\n\t\tsetInputHasFocus( true );\n\t\tsetIsExpanded( true );\n\t\tonFilterValueChange( '' );\n\t\tsetInputValue( '' );\n\t};\n\n\tconst onFocusOutside = () => {\n\t\tsetIsExpanded( false );\n\t};\n\n\tconst onInputChange: TokenInputProps[ 'onChange' ] = ( event ) => {\n\t\tconst text = event.value;\n\t\tsetInputValue( text );\n\t\tonFilterValueChange( text );\n\t\tif ( inputHasFocus ) {\n\t\t\tsetIsExpanded( true );\n\t\t}\n\t};\n\n\tconst handleOnReset = () => {\n\t\tsetValue( null );\n\t\tinputContainer.current?.focus();\n\t};\n\n\t// Update current selections when the filter input changes.\n\tuseEffect( () => {\n\t\tconst hasMatchingSuggestions = matchingSuggestions.length > 0;\n\t\tconst hasSelectedMatchingSuggestions =\n\t\t\tgetIndexOfMatchingSuggestion(\n\t\t\t\tselectedSuggestion,\n\t\t\t\tmatchingSuggestions\n\t\t\t) > 0;\n\n\t\tif ( hasMatchingSuggestions && ! hasSelectedMatchingSuggestions ) {\n\t\t\t// If the current selection isn't present in the list of suggestions, then automatically select the first item from the list of suggestions.\n\t\t\tsetSelectedSuggestion( matchingSuggestions[ 0 ] );\n\t\t}\n\t}, [ matchingSuggestions, selectedSuggestion ] );\n\n\t// Announcements.\n\tuseEffect( () => {\n\t\tconst hasMatchingSuggestions = matchingSuggestions.length > 0;\n\t\tif ( isExpanded ) {\n\t\t\tconst message = hasMatchingSuggestions\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\tmatchingSuggestions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmatchingSuggestions.length\n\t\t\t\t )\n\t\t\t\t: __( 'No results.' );\n\n\t\t\tspeak( message, 'polite' );\n\t\t}\n\t}, [ matchingSuggestions, isExpanded ] );\n\n\t// Disable reason: There is no appropriate role which describes the\n\t// input container intended accessible usability.\n\t// TODO: Refactor click detection to use blur to stop propagation.\n\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\treturn (\n\t\t<DetectOutside onFocusOutside={ onFocusOutside }>\n\t\t\t<BaseControl\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\tclassName={ clsx( className, 'components-combobox-control' ) }\n\t\t\t\tlabel={ label }\n\t\t\t\tid={ `components-form-token-input-${ instanceId }` }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\thelp={ help }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"components-combobox-control__suggestions-container\"\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t>\n\t\t\t\t\t<InputWrapperFlex\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t\t<TokenInput\n\t\t\t\t\t\t\t\tclassName=\"components-combobox-control__input\"\n\t\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\t\tref={ inputContainer }\n\t\t\t\t\t\t\t\tvalue={ isExpanded ? inputValue : currentLabel }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tonBlur={ onBlur }\n\t\t\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\t\t\tselectedSuggestionIndex={ getIndexOfMatchingSuggestion(\n\t\t\t\t\t\t\t\t\tselectedSuggestion,\n\t\t\t\t\t\t\t\t\tmatchingSuggestions\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ onInputChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t\t{ allowReset && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"components-combobox-control__reset\"\n\t\t\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\t\t\tdisabled={ ! value }\n\t\t\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</InputWrapperFlex>\n\t\t\t\t\t{ isExpanded && (\n\t\t\t\t\t\t<SuggestionsList\n\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\t// The empty string for `value` here is not actually used, but is\n\t\t\t\t\t\t\t// just a quick way to satisfy the TypeScript requirements of SuggestionsList.\n\t\t\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/pull/47581/files#r1091089330\n\t\t\t\t\t\t\tmatch={ { label: inputValue, value: '' } }\n\t\t\t\t\t\t\tdisplayTransform={ ( suggestion ) =>\n\t\t\t\t\t\t\t\tsuggestion.label\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsuggestions={ matchingSuggestions }\n\t\t\t\t\t\t\tselectedIndex={ getIndexOfMatchingSuggestion(\n\t\t\t\t\t\t\t\tselectedSuggestion,\n\t\t\t\t\t\t\t\tmatchingSuggestions\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonHover={ setSelectedSuggestion }\n\t\t\t\t\t\t\tonSelect={ onSuggestionSelected }\n\t\t\t\t\t\t\tscrollIntoView\n\t\t\t\t\t\t\t__experimentalRenderItem={\n\t\t\t\t\t\t\t\t__experimentalRenderItem\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</div>\n\t\t\t</BaseControl>\n\t\t</DetectOutside>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n}\n\nexport default ComboboxControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACPC,MAAM,EACNC,SAAS,QACH,oBAAoB;AAC3B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,UAAU;AAC3C,OAAOC,UAAU,MAAM,iCAAiC;AACxD,OAAOC,eAAe,MAAM,sCAAsC;AAClE,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,SAAS,EAAEC,QAAQ,QAAQ,SAAS;AAC7C,OAAOC,gBAAgB,MAAM,oCAAoC;AACjE,S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oreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/combobox-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { BaseControlProps } from '../base-control/types';\n\nexport type ComboboxControlOption = {\n\tlabel: string;\n\tvalue: string;\n\t[ key: string ]: any;\n};\n\nexport type ComboboxControlProps = Pick<\n\tBaseControlProps,\n\t| '__nextHasNoMarginBottom'\n\t| 'className'\n\t| 'label'\n\t| 'hideLabelFromVision'\n\t| 'help'\n> & {\n\t/**\n\t * Custom renderer invoked for each option in the suggestion list.\n\t * The render prop receives as its argument an object containing, under the `item` key,\n\t * the single option's data (directly from the array of data passed to the `options` prop).\n\t */\n\t__experimentalRenderItem?: ( args: {\n\t\titem: ComboboxControlOption;\n\t} ) => React.ReactNode;\n\t/**\n\t * Deprecated. Use `__next40pxDefaultSize` instead.\n\t *\n\t * @default false\n\t * @deprecated\n\t */\n\t__next36pxDefaultSize?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Show a reset button to clear the input.\n\t *\n\t * @default true\n\t */\n\tallowReset?: boolean;\n\t/**\n\t * Customizable UI messages.\n\t */\n\tmessages?: {\n\t\t/**\n\t\t * The message to announce to screen readers when a suggestion is selected.\n\t\t *\n\t\t * @default `__( 'Item selected.' )`\n\t\t */\n\t\tselected: string;\n\t};\n\t/**\n\t * Function called with the selected value changes.\n\t */\n\tonChange?: ( value: ComboboxControlProps[ 'value' ] ) => void;\n\t/**\n\t * Function called when the control's search input value changes. The argument contains the next input value.\n\t *\n\t * @default noop\n\t */\n\tonFilterValueChange?: ( value: string ) => void;\n\t/**\n\t * The options that can be chosen from.\n\t */\n\toptions: ComboboxControlOption[];\n\t/**\n\t * The current value of the control.\n\t */\n\tvalue?: string | null;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/combobox-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { BaseControlProps } from '../base-control/types';\n\nexport type ComboboxControlOption = {\n\tlabel: string;\n\tvalue: string;\n\tdisabled?: boolean;\n\t[ key: string ]: any;\n};\n\nexport type ComboboxControlProps = Pick<\n\tBaseControlProps,\n\t| '__nextHasNoMarginBottom'\n\t| 'className'\n\t| 'label'\n\t| 'hideLabelFromVision'\n\t| 'help'\n> & {\n\t/**\n\t * Custom renderer invoked for each option in the suggestion list.\n\t * The render prop receives as its argument an object containing, under the `item` key,\n\t * the single option's data (directly from the array of data passed to the `options` prop).\n\t */\n\t__experimentalRenderItem?: ( args: {\n\t\titem: ComboboxControlOption;\n\t} ) => React.ReactNode;\n\t/**\n\t * Deprecated. Use `__next40pxDefaultSize` instead.\n\t *\n\t * @default false\n\t * @deprecated\n\t */\n\t__next36pxDefaultSize?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Show a reset button to clear the input.\n\t *\n\t * @default true\n\t */\n\tallowReset?: boolean;\n\t/**\n\t * Customizable UI messages.\n\t */\n\tmessages?: {\n\t\t/**\n\t\t * The message to announce to screen readers when a suggestion is selected.\n\t\t *\n\t\t * @default `__( 'Item selected.' )`\n\t\t */\n\t\tselected: string;\n\t};\n\t/**\n\t * Function called with the selected value changes.\n\t */\n\tonChange?: ( value: ComboboxControlProps[ 'value' ] ) => void;\n\t/**\n\t * Function called when the control's search input value changes. The argument contains the next input value.\n\t *\n\t * @default noop\n\t */\n\tonFilterValueChange?: ( value: string ) => void;\n\t/**\n\t * The options that can be chosen from.\n\t */\n\toptions: ComboboxControlOption[];\n\t/**\n\t * The current value of the control.\n\t */\n\tvalue?: string | null;\n};\n"],"mappings":"","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  import { colord } from 'colord';
7
7
 
8
8
  /**
@@ -39,7 +39,7 @@ function ControlPointButton({
39
39
  "aria-describedby": descriptionId,
40
40
  "aria-haspopup": "true",
41
41
  "aria-expanded": isOpen,
42
- className: classnames('components-custom-gradient-picker__control-point-button', {
42
+ className: clsx('components-custom-gradient-picker__control-point-button', {
43
43
  'is-active': isOpen
44
44
  }),
45
45
  ...additionalProps
@@ -61,7 +61,7 @@ function GradientColorPickerDropdown({
61
61
  // popover edge.
62
62
  resize: false
63
63
  }), []);
64
- const mergedClassName = classnames('components-custom-gradient-picker__control-point-dropdown', className);
64
+ const mergedClassName = clsx('components-custom-gradient-picker__control-point-dropdown', className);
65
65
  return createElement(CustomColorPickerDropdown, {
66
66
  isRenderedInSidebar: isRenderedInSidebar,
67
67
  popoverProps: popoverProps,
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","colord","useInstanceId","useEffect","useRef","useState","useMemo","__","sprintf","plus","Button","HStack","ColorPicker","VisuallyHidden","CustomColorPickerDropdown","addControlPoint","clampPercent","removeControlPoint","updateControlPointColor","updateControlPointColorByPosition","updateControlPointPosition","getHorizontalRelativeGradientPosition","MINIMUM_SIGNIFICANT_MOVE","KEYBOARD_CONTROL_POINT_VARIATION","DropdownContentWrapper","ControlPointButton","isOpen","position","color","additionalProps","instanceId","descriptionId","createElement","Fragment","className","id","GradientColorPickerDropdown","isRenderedInSidebar","props","popoverProps","placement","offset","resize","mergedClassName","ControlPoints","disableRemove","disableAlpha","gradientPickerDomRef","ignoreMarkerPosition","value","controlPoints","onChange","onStartControlPointChange","onStopControlPointChange","__experimentalIsRenderedInSidebar","controlPointMoveState","onMouseMove","event","current","undefined","relativePosition","clientX","initialPosition","index","significantMoveHappened","Math","abs","cleanEventListeners","window","removeEventListener","listenersActivated","cleanEventListenersRef","map","point","key","onClose","renderToggle","onToggle","onClick","onMouseDown","addEventListener","onKeyDown","code","stopPropagation","renderContent","paddingSize","enableAlpha","toRgbString","length","alignment","variant","style","left","transform","InsertPoint","onOpenInserter","onCloseInserter","insertPosition","alreadyInsertedPoint","setAlreadyInsertedPoint","icon"],"sources":["@wordpress/components/src/custom-gradient-picker/gradient-bar/control-points.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useRef, useState, useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport { HStack } from '../../h-stack';\nimport { ColorPicker } from '../../color-picker';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport { CustomColorPickerDropdown } from '../../color-palette';\n\nimport {\n\taddControlPoint,\n\tclampPercent,\n\tremoveControlPoint,\n\tupdateControlPointColor,\n\tupdateControlPointColorByPosition,\n\tupdateControlPointPosition,\n\tgetHorizontalRelativeGradientPosition,\n} from './utils';\nimport {\n\tMINIMUM_SIGNIFICANT_MOVE,\n\tKEYBOARD_CONTROL_POINT_VARIATION,\n} from './constants';\nimport type { WordPressComponentProps } from '../../context';\nimport type {\n\tControlPointButtonProps,\n\tControlPointMoveState,\n\tControlPointsProps,\n\tInsertPointProps,\n} from '../types';\nimport type { CustomColorPickerDropdownProps } from '../../color-palette/types';\nimport DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';\n\nfunction ControlPointButton( {\n\tisOpen,\n\tposition,\n\tcolor,\n\t...additionalProps\n}: WordPressComponentProps< ControlPointButtonProps, 'button', true > ) {\n\tconst instanceId = useInstanceId( ControlPointButton );\n\tconst descriptionId = `components-custom-gradient-picker__control-point-button-description-${ instanceId }`;\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t// translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151).\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Gradient control point at position %1$s%% with color code %2$s.'\n\t\t\t\t\t),\n\t\t\t\t\tposition,\n\t\t\t\t\tcolor\n\t\t\t\t) }\n\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'components-custom-gradient-picker__control-point-button',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isOpen,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n\nfunction GradientColorPickerDropdown( {\n\tisRenderedInSidebar,\n\tclassName,\n\t...props\n}: CustomColorPickerDropdownProps ) {\n\t// Open the popover below the gradient control/insertion point\n\tconst popoverProps = useMemo(\n\t\t() =>\n\t\t\t( {\n\t\t\t\tplacement: 'bottom',\n\t\t\t\toffset: 8,\n\t\t\t\t// Disabling resize as it would otherwise cause the popover to show\n\t\t\t\t// scrollbars while dragging the color picker's handle close to the\n\t\t\t\t// popover edge.\n\t\t\t\tresize: false,\n\t\t\t} ) as const,\n\t\t[]\n\t);\n\n\tconst mergedClassName = classnames(\n\t\t'components-custom-gradient-picker__control-point-dropdown',\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<CustomColorPickerDropdown\n\t\t\tisRenderedInSidebar={ isRenderedInSidebar }\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName={ mergedClassName }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction ControlPoints( {\n\tdisableRemove,\n\tdisableAlpha,\n\tgradientPickerDomRef,\n\tignoreMarkerPosition,\n\tvalue: controlPoints,\n\tonChange,\n\tonStartControlPointChange,\n\tonStopControlPointChange,\n\t__experimentalIsRenderedInSidebar,\n}: ControlPointsProps ) {\n\tconst controlPointMoveState = useRef< ControlPointMoveState >();\n\n\tconst onMouseMove = ( event: MouseEvent ) => {\n\t\tif (\n\t\t\tcontrolPointMoveState.current === undefined ||\n\t\t\tgradientPickerDomRef.current === null\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst relativePosition = getHorizontalRelativeGradientPosition(\n\t\t\tevent.clientX,\n\t\t\tgradientPickerDomRef.current\n\t\t);\n\n\t\tconst { initialPosition, index, significantMoveHappened } =\n\t\t\tcontrolPointMoveState.current;\n\n\t\tif (\n\t\t\t! significantMoveHappened &&\n\t\t\tMath.abs( initialPosition - relativePosition ) >=\n\t\t\t\tMINIMUM_SIGNIFICANT_MOVE\n\t\t) {\n\t\t\tcontrolPointMoveState.current.significantMoveHappened = true;\n\t\t}\n\n\t\tonChange(\n\t\t\tupdateControlPointPosition( controlPoints, index, relativePosition )\n\t\t);\n\t};\n\n\tconst cleanEventListeners = () => {\n\t\tif (\n\t\t\twindow &&\n\t\t\twindow.removeEventListener &&\n\t\t\tcontrolPointMoveState.current &&\n\t\t\tcontrolPointMoveState.current.listenersActivated\n\t\t) {\n\t\t\twindow.removeEventListener( 'mousemove', onMouseMove );\n\t\t\twindow.removeEventListener( 'mouseup', cleanEventListeners );\n\t\t\tonStopControlPointChange();\n\t\t\tcontrolPointMoveState.current.listenersActivated = false;\n\t\t}\n\t};\n\n\t// Adding `cleanEventListeners` to the dependency array below requires the function itself to be wrapped in a `useCallback`\n\t// This memoization would prevent the event listeners from being properly cleaned.\n\t// Instead, we'll pass a ref to the function in our `useEffect` so `cleanEventListeners` itself is no longer a dependency.\n\tconst cleanEventListenersRef = useRef< () => void >();\n\tcleanEventListenersRef.current = cleanEventListeners;\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tcleanEventListenersRef.current?.();\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t{ controlPoints.map( ( point, index ) => {\n\t\t\t\tconst initialPosition = point?.position;\n\t\t\t\treturn (\n\t\t\t\t\tignoreMarkerPosition !== initialPosition && (\n\t\t\t\t\t\t<GradientColorPickerDropdown\n\t\t\t\t\t\t\tisRenderedInSidebar={\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tonClose={ onStopControlPointChange }\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<ControlPointButton\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveState.current &&\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveState.current\n\t\t\t\t\t\t\t\t\t\t\t\t.significantMoveHappened\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\t\t\t\t\tonStopControlPointChange();\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonMouseDown={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\twindow &&\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveState.current = {\n\t\t\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\tsignificantMoveHappened: false,\n\t\t\t\t\t\t\t\t\t\t\t\tlistenersActivated: true,\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mousemove',\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseMove\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mouseup',\n\t\t\t\t\t\t\t\t\t\t\t\tcleanEventListeners\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\tif ( event.code === 'ArrowLeft' ) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\tevent.code === 'ArrowRight'\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tposition={ point.position }\n\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointColor(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolord(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\t\t\t\t\t\t).toRgbString()\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ ! disableRemove &&\n\t\t\t\t\t\t\t\t\t\tcontrolPoints.length > 2 && (\n\t\t\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-custom-gradient-picker__remove-control-point-wrapper\"\n\t\t\t\t\t\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveControlPoint(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove Control Point'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tleft: `${ point.position }%`,\n\t\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\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</>\n\t);\n}\n\nfunction InsertPoint( {\n\tvalue: controlPoints,\n\tonChange,\n\tonOpenInserter,\n\tonCloseInserter,\n\tinsertPosition,\n\tdisableAlpha,\n\t__experimentalIsRenderedInSidebar,\n}: InsertPointProps ) {\n\tconst [ alreadyInsertedPoint, setAlreadyInsertedPoint ] = useState( false );\n\treturn (\n\t\t<GradientColorPickerDropdown\n\t\t\tisRenderedInSidebar={ __experimentalIsRenderedInSidebar }\n\t\t\tclassName=\"components-custom-gradient-picker__inserter\"\n\t\t\tonClose={ () => {\n\t\t\t\tonCloseInserter();\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\tonCloseInserter();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetAlreadyInsertedPoint( false );\n\t\t\t\t\t\t\tonOpenInserter();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t} }\n\t\t\t\t\tclassName=\"components-custom-gradient-picker__insert-point-dropdown\"\n\t\t\t\t\ticon={ plus }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\tif ( ! alreadyInsertedPoint ) {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\taddControlPoint(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsetAlreadyInsertedPoint( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\tupdateControlPointColorByPosition(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\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</DropdownContentWrapper>\n\t\t\t) }\n\t\t\tstyle={\n\t\t\t\tinsertPosition !== null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tleft: `${ insertPosition }%`,\n\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\nControlPoints.InsertPoint = InsertPoint;\n\nexport default ControlPoints;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AACnC,SAASC,MAAM,QAAQ,QAAQ;;AAE/B;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACzE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,IAAI,QAAQ,kBAAkB;;AAEvC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,MAAM,QAAQ,eAAe;AACtC,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,yBAAyB,QAAQ,qBAAqB;AAE/D,SACCC,eAAe,EACf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,CAACR,sBAAsB;MAAC6D,WAAW,EAAC;IAAM,GACzCrD,aAAA,CAACpB,WAAW;MACX0E,WAAW,EAAG,CAAExC,YAAc;MAC9BK,QAAQ,EAAKvB,KAAK,IAAM;QACvB,IAAK,CAAEsE,oBAAoB,EAAG;UAC7B/C,QAAQ,CACPpC,eAAe,CACdmC,aAAa,EACb+C,cAAc,EACdhG,MAAM,CAAE2B,KAAM,CAAC,CAAC2D,WAAW,CAAC,CAC7B,CACD,CAAC;UACDY,uBAAuB,CAAE,IAAK,CAAC;QAChC,CAAC,MAAM;UACNhD,QAAQ,CACPhC,iCAAiC,CAChC+B,aAAa,EACb+C,cAAc,EACdhG,MAAM,CAAE2B,KAAM,CAAC,CAAC2D,WAAW,CAAC,CAC7B,CACD,CAAC;QACF;MACD;IAAG,CACH,CACsB,CACtB;IACHI,KAAK,EACJM,cAAc,KAAK,IAAI,GACpB;MACAL,IAAI,EAAG,GAAGK,cAAgB,GAAE;MAC5BJ,SAAS,EAAE;IACX,CAAC,GACDlC;EACH,CACD,CAAC;AAEJ;AACAf,aAAa,CAACkD,WAAW,GAAGA,WAAW;AAEvC,eAAelD,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["clsx","colord","useInstanceId","useEffect","useRef","useState","useMemo","__","sprintf","plus","Button","HStack","ColorPicker","VisuallyHidden","CustomColorPickerDropdown","addControlPoint","clampPercent","removeControlPoint","updateControlPointColor","updateControlPointColorByPosition","updateControlPointPosition","getHorizontalRelativeGradientPosition","MINIMUM_SIGNIFICANT_MOVE","KEYBOARD_CONTROL_POINT_VARIATION","DropdownContentWrapper","ControlPointButton","isOpen","position","color","additionalProps","instanceId","descriptionId","createElement","Fragment","className","id","GradientColorPickerDropdown","isRenderedInSidebar","props","popoverProps","placement","offset","resize","mergedClassName","ControlPoints","disableRemove","disableAlpha","gradientPickerDomRef","ignoreMarkerPosition","value","controlPoints","onChange","onStartControlPointChange","onStopControlPointChange","__experimentalIsRenderedInSidebar","controlPointMoveState","onMouseMove","event","current","undefined","relativePosition","clientX","initialPosition","index","significantMoveHappened","Math","abs","cleanEventListeners","window","removeEventListener","listenersActivated","cleanEventListenersRef","map","point","key","onClose","renderToggle","onToggle","onClick","onMouseDown","addEventListener","onKeyDown","code","stopPropagation","renderContent","paddingSize","enableAlpha","toRgbString","length","alignment","variant","style","left","transform","InsertPoint","onOpenInserter","onCloseInserter","insertPosition","alreadyInsertedPoint","setAlreadyInsertedPoint","icon"],"sources":["@wordpress/components/src/custom-gradient-picker/gradient-bar/control-points.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useRef, useState, useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport { HStack } from '../../h-stack';\nimport { ColorPicker } from '../../color-picker';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport { CustomColorPickerDropdown } from '../../color-palette';\n\nimport {\n\taddControlPoint,\n\tclampPercent,\n\tremoveControlPoint,\n\tupdateControlPointColor,\n\tupdateControlPointColorByPosition,\n\tupdateControlPointPosition,\n\tgetHorizontalRelativeGradientPosition,\n} from './utils';\nimport {\n\tMINIMUM_SIGNIFICANT_MOVE,\n\tKEYBOARD_CONTROL_POINT_VARIATION,\n} from './constants';\nimport type { WordPressComponentProps } from '../../context';\nimport type {\n\tControlPointButtonProps,\n\tControlPointMoveState,\n\tControlPointsProps,\n\tInsertPointProps,\n} from '../types';\nimport type { CustomColorPickerDropdownProps } from '../../color-palette/types';\nimport DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';\n\nfunction ControlPointButton( {\n\tisOpen,\n\tposition,\n\tcolor,\n\t...additionalProps\n}: WordPressComponentProps< ControlPointButtonProps, 'button', true > ) {\n\tconst instanceId = useInstanceId( ControlPointButton );\n\tconst descriptionId = `components-custom-gradient-picker__control-point-button-description-${ instanceId }`;\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t// translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151).\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Gradient control point at position %1$s%% with color code %2$s.'\n\t\t\t\t\t),\n\t\t\t\t\tposition,\n\t\t\t\t\tcolor\n\t\t\t\t) }\n\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'components-custom-gradient-picker__control-point-button',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isOpen,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n\nfunction GradientColorPickerDropdown( {\n\tisRenderedInSidebar,\n\tclassName,\n\t...props\n}: CustomColorPickerDropdownProps ) {\n\t// Open the popover below the gradient control/insertion point\n\tconst popoverProps = useMemo(\n\t\t() =>\n\t\t\t( {\n\t\t\t\tplacement: 'bottom',\n\t\t\t\toffset: 8,\n\t\t\t\t// Disabling resize as it would otherwise cause the popover to show\n\t\t\t\t// scrollbars while dragging the color picker's handle close to the\n\t\t\t\t// popover edge.\n\t\t\t\tresize: false,\n\t\t\t} ) as const,\n\t\t[]\n\t);\n\n\tconst mergedClassName = clsx(\n\t\t'components-custom-gradient-picker__control-point-dropdown',\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<CustomColorPickerDropdown\n\t\t\tisRenderedInSidebar={ isRenderedInSidebar }\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName={ mergedClassName }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction ControlPoints( {\n\tdisableRemove,\n\tdisableAlpha,\n\tgradientPickerDomRef,\n\tignoreMarkerPosition,\n\tvalue: controlPoints,\n\tonChange,\n\tonStartControlPointChange,\n\tonStopControlPointChange,\n\t__experimentalIsRenderedInSidebar,\n}: ControlPointsProps ) {\n\tconst controlPointMoveState = useRef< ControlPointMoveState >();\n\n\tconst onMouseMove = ( event: MouseEvent ) => {\n\t\tif (\n\t\t\tcontrolPointMoveState.current === undefined ||\n\t\t\tgradientPickerDomRef.current === null\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst relativePosition = getHorizontalRelativeGradientPosition(\n\t\t\tevent.clientX,\n\t\t\tgradientPickerDomRef.current\n\t\t);\n\n\t\tconst { initialPosition, index, significantMoveHappened } =\n\t\t\tcontrolPointMoveState.current;\n\n\t\tif (\n\t\t\t! significantMoveHappened &&\n\t\t\tMath.abs( initialPosition - relativePosition ) >=\n\t\t\t\tMINIMUM_SIGNIFICANT_MOVE\n\t\t) {\n\t\t\tcontrolPointMoveState.current.significantMoveHappened = true;\n\t\t}\n\n\t\tonChange(\n\t\t\tupdateControlPointPosition( controlPoints, index, relativePosition )\n\t\t);\n\t};\n\n\tconst cleanEventListeners = () => {\n\t\tif (\n\t\t\twindow &&\n\t\t\twindow.removeEventListener &&\n\t\t\tcontrolPointMoveState.current &&\n\t\t\tcontrolPointMoveState.current.listenersActivated\n\t\t) {\n\t\t\twindow.removeEventListener( 'mousemove', onMouseMove );\n\t\t\twindow.removeEventListener( 'mouseup', cleanEventListeners );\n\t\t\tonStopControlPointChange();\n\t\t\tcontrolPointMoveState.current.listenersActivated = false;\n\t\t}\n\t};\n\n\t// Adding `cleanEventListeners` to the dependency array below requires the function itself to be wrapped in a `useCallback`\n\t// This memoization would prevent the event listeners from being properly cleaned.\n\t// Instead, we'll pass a ref to the function in our `useEffect` so `cleanEventListeners` itself is no longer a dependency.\n\tconst cleanEventListenersRef = useRef< () => void >();\n\tcleanEventListenersRef.current = cleanEventListeners;\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tcleanEventListenersRef.current?.();\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t{ controlPoints.map( ( point, index ) => {\n\t\t\t\tconst initialPosition = point?.position;\n\t\t\t\treturn (\n\t\t\t\t\tignoreMarkerPosition !== initialPosition && (\n\t\t\t\t\t\t<GradientColorPickerDropdown\n\t\t\t\t\t\t\tisRenderedInSidebar={\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tonClose={ onStopControlPointChange }\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<ControlPointButton\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveState.current &&\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveState.current\n\t\t\t\t\t\t\t\t\t\t\t\t.significantMoveHappened\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\t\t\t\t\tonStopControlPointChange();\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonMouseDown={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\twindow &&\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveState.current = {\n\t\t\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\tsignificantMoveHappened: false,\n\t\t\t\t\t\t\t\t\t\t\t\tlistenersActivated: true,\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mousemove',\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseMove\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mouseup',\n\t\t\t\t\t\t\t\t\t\t\t\tcleanEventListeners\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\tif ( event.code === 'ArrowLeft' ) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\tevent.code === 'ArrowRight'\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tposition={ point.position }\n\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointColor(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolord(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\t\t\t\t\t\t).toRgbString()\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ ! disableRemove &&\n\t\t\t\t\t\t\t\t\t\tcontrolPoints.length > 2 && (\n\t\t\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-custom-gradient-picker__remove-control-point-wrapper\"\n\t\t\t\t\t\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveControlPoint(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove Control Point'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tleft: `${ point.position }%`,\n\t\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\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</>\n\t);\n}\n\nfunction InsertPoint( {\n\tvalue: controlPoints,\n\tonChange,\n\tonOpenInserter,\n\tonCloseInserter,\n\tinsertPosition,\n\tdisableAlpha,\n\t__experimentalIsRenderedInSidebar,\n}: InsertPointProps ) {\n\tconst [ alreadyInsertedPoint, setAlreadyInsertedPoint ] = useState( false );\n\treturn (\n\t\t<GradientColorPickerDropdown\n\t\t\tisRenderedInSidebar={ __experimentalIsRenderedInSidebar }\n\t\t\tclassName=\"components-custom-gradient-picker__inserter\"\n\t\t\tonClose={ () => {\n\t\t\t\tonCloseInserter();\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\tonCloseInserter();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetAlreadyInsertedPoint( false );\n\t\t\t\t\t\t\tonOpenInserter();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t} }\n\t\t\t\t\tclassName=\"components-custom-gradient-picker__insert-point-dropdown\"\n\t\t\t\t\ticon={ plus }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\tif ( ! alreadyInsertedPoint ) {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\taddControlPoint(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsetAlreadyInsertedPoint( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\tupdateControlPointColorByPosition(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\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</DropdownContentWrapper>\n\t\t\t) }\n\t\t\tstyle={\n\t\t\t\tinsertPosition !== null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tleft: `${ insertPosition }%`,\n\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\nControlPoints.InsertPoint = InsertPoint;\n\nexport default ControlPoints;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,MAAM,QAAQ,QAAQ;;AAE/B;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACzE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,IAAI,QAAQ,kBAAkB;;AAEvC;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