@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","_interopRequireDefault","require","_i18n","_element","_icons","_dom","_compose","_animation","backdrop","hidden","opacity","show","transition","type","duration","delay","delayChildren","exit","foreground","scale","DropIndicator","label","disableMotion","useReducedMotion","children","_react","createElement","__unstableMotion","div","variants","initial","animate","className","style","pointerEvents","Icon","icon","upload","__","__unstableAnimatePresence","DropZoneComponent","onFilesDrop","onHTMLDrop","onDrop","restProps","isDraggingOverDocument","setIsDraggingOverDocument","useState","isDraggingOverElement","setIsDraggingOverElement","setType","ref","useDropZone","event","files","dataTransfer","getFilesFromDataTransfer","html","getData","length","onDragStart","_type","types","includes","onDragEnd","undefined","onDragEnter","onDragLeave","classes","classnames","_default","exports","default"],"sources":["@wordpress/components/src/drop-zone/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { upload, Icon } from '@wordpress/icons';\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\nimport {\n\t__experimentalUseDropZone as useDropZone,\n\tuseReducedMotion,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '../animation';\nimport type { DropType, DropZoneProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst backdrop = {\n\thidden: { opacity: 0 },\n\tshow: {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\ttype: 'tween',\n\t\t\tduration: 0.2,\n\t\t\tdelay: 0,\n\t\t\tdelayChildren: 0.1,\n\t\t},\n\t},\n\texit: {\n\t\topacity: 0,\n\t\ttransition: {\n\t\t\tduration: 0.2,\n\t\t\tdelayChildren: 0,\n\t\t},\n\t},\n};\n\nconst foreground = {\n\thidden: { opacity: 0, scale: 0.9 },\n\tshow: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ttransition: {\n\t\t\tduration: 0.1,\n\t\t},\n\t},\n\texit: { opacity: 0, scale: 0.9 },\n};\n\nfunction DropIndicator( { label }: { label?: string } ) {\n\tconst disableMotion = useReducedMotion();\n\tconst children = (\n\t\t<motion.div\n\t\t\tvariants={ backdrop }\n\t\t\tinitial={ disableMotion ? 'show' : 'hidden' }\n\t\t\tanimate=\"show\"\n\t\t\texit={ disableMotion ? 'show' : 'exit' }\n\t\t\tclassName=\"components-drop-zone__content\"\n\t\t\t// Without this, when this div is shown,\n\t\t\t// Safari calls a onDropZoneLeave causing a loop because of this bug\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=66547\n\t\t\tstyle={ { pointerEvents: 'none' } }\n\t\t>\n\t\t\t<motion.div variants={ foreground }>\n\t\t\t\t<Icon\n\t\t\t\t\ticon={ upload }\n\t\t\t\t\tclassName=\"components-drop-zone__content-icon\"\n\t\t\t\t/>\n\t\t\t\t<span className=\"components-drop-zone__content-text\">\n\t\t\t\t\t{ label ? label : __( 'Drop files to upload' ) }\n\t\t\t\t</span>\n\t\t\t</motion.div>\n\t\t</motion.div>\n\t);\n\n\tif ( disableMotion ) {\n\t\treturn children;\n\t}\n\n\treturn <AnimatePresence>{ children }</AnimatePresence>;\n}\n\n/**\n * `DropZone` is a component creating a drop zone area taking the full size of its parent element. It supports dropping files, HTML content or any other HTML drop event.\n *\n * ```jsx\n * import { DropZone } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDropZone = () => {\n * const [ hasDropped, setHasDropped ] = useState( false );\n *\n * return (\n * <div>\n * { hasDropped ? 'Dropped!' : 'Drop something here' }\n * <DropZone\n * onFilesDrop={ () => setHasDropped( true ) }\n * onHTMLDrop={ () => setHasDropped( true ) }\n * onDrop={ () => setHasDropped( true ) }\n * />\n * </div>\n * );\n * }\n * ```\n */\nexport function DropZoneComponent( {\n\tclassName,\n\tlabel,\n\tonFilesDrop,\n\tonHTMLDrop,\n\tonDrop,\n\t...restProps\n}: WordPressComponentProps< DropZoneProps, 'div', false > ) {\n\tconst [ isDraggingOverDocument, setIsDraggingOverDocument ] =\n\t\tuseState< boolean >();\n\tconst [ isDraggingOverElement, setIsDraggingOverElement ] =\n\t\tuseState< boolean >();\n\tconst [ type, setType ] = useState< DropType >();\n\tconst ref = useDropZone( {\n\t\tonDrop( event ) {\n\t\t\tconst files = event.dataTransfer\n\t\t\t\t? getFilesFromDataTransfer( event.dataTransfer )\n\t\t\t\t: [];\n\t\t\tconst html = event.dataTransfer?.getData( 'text/html' );\n\n\t\t\t/**\n\t\t\t * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.\n\t\t\t * The order of the checks is important to recognise the HTML drop.\n\t\t\t */\n\t\t\tif ( html && onHTMLDrop ) {\n\t\t\t\tonHTMLDrop( html );\n\t\t\t} else if ( files.length && onFilesDrop ) {\n\t\t\t\tonFilesDrop( files );\n\t\t\t} else if ( onDrop ) {\n\t\t\t\tonDrop( event );\n\t\t\t}\n\t\t},\n\t\tonDragStart( event ) {\n\t\t\tsetIsDraggingOverDocument( true );\n\n\t\t\tlet _type: DropType = 'default';\n\n\t\t\t/**\n\t\t\t * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.\n\t\t\t * The order of the checks is important to recognise the HTML drop.\n\t\t\t */\n\t\t\tif ( event.dataTransfer?.types.includes( 'text/html' ) ) {\n\t\t\t\t_type = 'html';\n\t\t\t} else if (\n\t\t\t\t// Check for the types because sometimes the files themselves\n\t\t\t\t// are only available on drop.\n\t\t\t\tevent.dataTransfer?.types.includes( 'Files' ) ||\n\t\t\t\t( event.dataTransfer\n\t\t\t\t\t? getFilesFromDataTransfer( event.dataTransfer )\n\t\t\t\t\t: []\n\t\t\t\t).length > 0\n\t\t\t) {\n\t\t\t\t_type = 'file';\n\t\t\t}\n\n\t\t\tsetType( _type );\n\t\t},\n\t\tonDragEnd() {\n\t\t\tsetIsDraggingOverDocument( false );\n\t\t\tsetType( undefined );\n\t\t},\n\t\tonDragEnter() {\n\t\t\tsetIsDraggingOverElement( true );\n\t\t},\n\t\tonDragLeave() {\n\t\t\tsetIsDraggingOverElement( false );\n\t\t},\n\t} );\n\tconst classes = classnames( 'components-drop-zone', className, {\n\t\t'is-active':\n\t\t\t( isDraggingOverDocument || isDraggingOverElement ) &&\n\t\t\t( ( type === 'file' && onFilesDrop ) ||\n\t\t\t\t( type === 'html' && onHTMLDrop ) ||\n\t\t\t\t( type === 'default' && onDrop ) ),\n\t\t'is-dragging-over-document': isDraggingOverDocument,\n\t\t'is-dragging-over-element': isDraggingOverElement,\n\t\t[ `is-dragging-${ type }` ]: !! type,\n\t} );\n\n\treturn (\n\t\t<div { ...restProps } ref={ ref } className={ classes }>\n\t\t\t{ isDraggingOverElement && <DropIndicator label={ label } /> }\n\t\t</div>\n\t);\n}\n\nexport default DropZoneComponent;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAQA,IAAAM,UAAA,GAAAN,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAQA,MAAMO,QAAQ,GAAG;EAChBC,MAAM,EAAE;IAAEC,OAAO,EAAE;EAAE,CAAC;EACtBC,IAAI,EAAE;IACLD,OAAO,EAAE,CAAC;IACVE,UAAU,EAAE;MACXC,IAAI,EAAE,OAAO;MACbC,QAAQ,EAAE,GAAG;MACbC,KAAK,EAAE,CAAC;MACRC,aAAa,EAAE;IAChB;EACD,CAAC;EACDC,IAAI,EAAE;IACLP,OAAO,EAAE,CAAC;IACVE,UAAU,EAAE;MACXE,QAAQ,EAAE,GAAG;MACbE,aAAa,EAAE;IAChB;EACD;AACD,CAAC;AAED,MAAME,UAAU,GAAG;EAClBT,MAAM,EAAE;I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{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_icons","_dom","_compose","_animation","backdrop","hidden","opacity","show","transition","type","duration","delay","delayChildren","exit","foreground","scale","DropIndicator","label","disableMotion","useReducedMotion","children","_react","createElement","__unstableMotion","div","variants","initial","animate","className","style","pointerEvents","Icon","icon","upload","__","__unstableAnimatePresence","DropZoneComponent","onFilesDrop","onHTMLDrop","onDrop","restProps","isDraggingOverDocument","setIsDraggingOverDocument","useState","isDraggingOverElement","setIsDraggingOverElement","setType","ref","useDropZone","event","files","dataTransfer","getFilesFromDataTransfer","html","getData","length","onDragStart","_type","types","includes","onDragEnd","undefined","onDragEnter","onDragLeave","classes","clsx","_default","exports","default"],"sources":["@wordpress/components/src/drop-zone/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { upload, Icon } from '@wordpress/icons';\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\nimport {\n\t__experimentalUseDropZone as useDropZone,\n\tuseReducedMotion,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '../animation';\nimport type { DropType, DropZoneProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst backdrop = {\n\thidden: { opacity: 0 },\n\tshow: {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\ttype: 'tween',\n\t\t\tduration: 0.2,\n\t\t\tdelay: 0,\n\t\t\tdelayChildren: 0.1,\n\t\t},\n\t},\n\texit: {\n\t\topacity: 0,\n\t\ttransition: {\n\t\t\tduration: 0.2,\n\t\t\tdelayChildren: 0,\n\t\t},\n\t},\n};\n\nconst foreground = {\n\thidden: { opacity: 0, scale: 0.9 },\n\tshow: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ttransition: {\n\t\t\tduration: 0.1,\n\t\t},\n\t},\n\texit: { opacity: 0, scale: 0.9 },\n};\n\nfunction DropIndicator( { label }: { label?: string } ) {\n\tconst disableMotion = useReducedMotion();\n\tconst children = (\n\t\t<motion.div\n\t\t\tvariants={ backdrop }\n\t\t\tinitial={ disableMotion ? 'show' : 'hidden' }\n\t\t\tanimate=\"show\"\n\t\t\texit={ disableMotion ? 'show' : 'exit' }\n\t\t\tclassName=\"components-drop-zone__content\"\n\t\t\t// Without this, when this div is shown,\n\t\t\t// Safari calls a onDropZoneLeave causing a loop because of this bug\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=66547\n\t\t\tstyle={ { pointerEvents: 'none' } }\n\t\t>\n\t\t\t<motion.div variants={ foreground }>\n\t\t\t\t<Icon\n\t\t\t\t\ticon={ upload }\n\t\t\t\t\tclassName=\"components-drop-zone__content-icon\"\n\t\t\t\t/>\n\t\t\t\t<span className=\"components-drop-zone__content-text\">\n\t\t\t\t\t{ label ? label : __( 'Drop files to upload' ) }\n\t\t\t\t</span>\n\t\t\t</motion.div>\n\t\t</motion.div>\n\t);\n\n\tif ( disableMotion ) {\n\t\treturn children;\n\t}\n\n\treturn <AnimatePresence>{ children }</AnimatePresence>;\n}\n\n/**\n * `DropZone` is a component creating a drop zone area taking the full size of its parent element. It supports dropping files, HTML content or any other HTML drop event.\n *\n * ```jsx\n * import { DropZone } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDropZone = () => {\n * const [ hasDropped, setHasDropped ] = useState( false );\n *\n * return (\n * <div>\n * { hasDropped ? 'Dropped!' : 'Drop something here' }\n * <DropZone\n * onFilesDrop={ () => setHasDropped( true ) }\n * onHTMLDrop={ () => setHasDropped( true ) }\n * onDrop={ () => setHasDropped( true ) }\n * />\n * </div>\n * );\n * }\n * ```\n */\nexport function DropZoneComponent( {\n\tclassName,\n\tlabel,\n\tonFilesDrop,\n\tonHTMLDrop,\n\tonDrop,\n\t...restProps\n}: WordPressComponentProps< DropZoneProps, 'div', false > ) {\n\tconst [ isDraggingOverDocument, setIsDraggingOverDocument ] =\n\t\tuseState< boolean >();\n\tconst [ isDraggingOverElement, setIsDraggingOverElement ] =\n\t\tuseState< boolean >();\n\tconst [ type, setType ] = useState< DropType >();\n\tconst ref = useDropZone( {\n\t\tonDrop( event ) {\n\t\t\tconst files = event.dataTransfer\n\t\t\t\t? getFilesFromDataTransfer( event.dataTransfer )\n\t\t\t\t: [];\n\t\t\tconst html = event.dataTransfer?.getData( 'text/html' );\n\n\t\t\t/**\n\t\t\t * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.\n\t\t\t * The order of the checks is important to recognise the HTML drop.\n\t\t\t */\n\t\t\tif ( html && onHTMLDrop ) {\n\t\t\t\tonHTMLDrop( html );\n\t\t\t} else if ( files.length && onFilesDrop ) {\n\t\t\t\tonFilesDrop( files );\n\t\t\t} else if ( onDrop ) {\n\t\t\t\tonDrop( event );\n\t\t\t}\n\t\t},\n\t\tonDragStart( event ) {\n\t\t\tsetIsDraggingOverDocument( true );\n\n\t\t\tlet _type: DropType = 'default';\n\n\t\t\t/**\n\t\t\t * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.\n\t\t\t * The order of the checks is important to recognise the HTML drop.\n\t\t\t */\n\t\t\tif ( event.dataTransfer?.types.includes( 'text/html' ) ) {\n\t\t\t\t_type = 'html';\n\t\t\t} else if (\n\t\t\t\t// Check for the types because sometimes the files themselves\n\t\t\t\t// are only available on drop.\n\t\t\t\tevent.dataTransfer?.types.includes( 'Files' ) ||\n\t\t\t\t( event.dataTransfer\n\t\t\t\t\t? getFilesFromDataTransfer( event.dataTransfer )\n\t\t\t\t\t: []\n\t\t\t\t).length > 0\n\t\t\t) {\n\t\t\t\t_type = 'file';\n\t\t\t}\n\n\t\t\tsetType( _type );\n\t\t},\n\t\tonDragEnd() {\n\t\t\tsetIsDraggingOverDocument( false );\n\t\t\tsetType( undefined );\n\t\t},\n\t\tonDragEnter() {\n\t\t\tsetIsDraggingOverElement( true );\n\t\t},\n\t\tonDragLeave() {\n\t\t\tsetIsDraggingOverElement( false );\n\t\t},\n\t} );\n\tconst classes = clsx( 'components-drop-zone', className, {\n\t\t'is-active':\n\t\t\t( isDraggingOverDocument || isDraggingOverElement ) &&\n\t\t\t( ( type === 'file' && onFilesDrop ) ||\n\t\t\t\t( type === 'html' && onHTMLDrop ) ||\n\t\t\t\t( type === 'default' && onDrop ) ),\n\t\t'is-dragging-over-document': isDraggingOverDocument,\n\t\t'is-dragging-over-element': isDraggingOverElement,\n\t\t[ `is-dragging-${ type }` ]: !! type,\n\t} );\n\n\treturn (\n\t\t<div { ...restProps } ref={ ref } className={ classes }>\n\t\t\t{ isDraggingOverElement && <DropIndicator label={ label } /> }\n\t\t</div>\n\t);\n}\n\nexport default DropZoneComponent;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAQA,IAAAM,UAAA,GAAAN,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAQA,MAAMO,QAAQ,GAAG;EAChBC,MAAM,EAAE;IAAEC,OAAO,EAAE;EAAE,CAAC;EACtBC,IAAI,EAAE;IACLD,OAAO,EAAE,CAAC;IACVE,UAAU,EAAE;MACXC,IAAI,EAAE,OAAO;MACbC,QAAQ,EAAE,GAAG;MACbC,KAAK,EAAE,CAAC;MACRC,aAAa,EAAE;IAChB;EACD,CAAC;EACDC,IAAI,EAAE;IACLP,OAAO,EAAE,CAAC;IACVE,UAAU,EAAE;MACXE,QAAQ,EAAE,GAAG;MACbE,aAAa,EAAE;IAChB;EACD;AACD,CAAC;AAED,MAAME,UAAU,GAAG;EAClBT,MAAM,EAAE;IAAEC,OAAO,EAAE,CAAC;IAAES,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Module", {
6
6
  });
7
7
  exports.default = exports.Dropdown = void 0;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _element = require("@wordpress/element");
11
11
  var _compose = require("@wordpress/compose");
12
12
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
@@ -117,7 +117,7 @@ const UnconnectedDropdown = (props, forwardedRef) => {
117
117
  anchor: !popoverPropsHaveAnchor ? fallbackPopoverAnchor : undefined,
118
118
  variant: variant,
119
119
  ...popoverProps,
120
- className: (0, _classnames.default)('components-dropdown__content', popoverProps?.className, contentClassName)
120
+ className: (0, _clsx.default)('components-dropdown__content', popoverProps?.className, contentClassName)
121
121
  }, renderContent(args)));
122
122
  };
123
123
 
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_compose","_deprecated","_context","_hooks","_popover","UnconnectedDropdown","props","forwardedRef","renderContent","renderToggle","className","contentClassName","expandOnMobile","headerTitle","focusOnMount","popoverProps","onClose","onToggle","style","open","defaultOpen","position","variant","useContextSystem","undefined","deprecated","since","alternative","hint","fallbackPopoverAnchor","setFallbackPopoverAnchor","useState","containerRef","useRef","isOpen","setIsOpen","useControlledValue","defaultValue","value","onChange","closeIfFocusOutside","current","ownerDocument","dialog","activeElement","closest","contains","close","args","popoverPropsHaveAnchor","anchor","anchorRef","getAnchorRect","anchorRect","_react","createElement","ref","useMergeRefs","tabIndex","default","onFocusOutside","offset","classnames","Dropdown","exports","contextConnect","_default"],"sources":["@wordpress/components/src/dropdown/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, useContextSystem } from '../context';\nimport { useControlledValue } from '../utils/hooks';\nimport Popover from '../popover';\nimport type { DropdownProps, DropdownInternalContext } from './types';\n\nconst UnconnectedDropdown = (\n\tprops: DropdownProps,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\trenderContent,\n\t\trenderToggle,\n\t\tclassName,\n\t\tcontentClassName,\n\t\texpandOnMobile,\n\t\theaderTitle,\n\t\tfocusOnMount,\n\t\tpopoverProps,\n\t\tonClose,\n\t\tonToggle,\n\t\tstyle,\n\n\t\topen,\n\t\tdefaultOpen,\n\n\t\t// Deprecated props\n\t\tposition,\n\n\t\t// From context system\n\t\tvariant,\n\t} = useContextSystem< DropdownProps & DropdownInternalContext >(\n\t\tprops,\n\t\t'Dropdown'\n\t);\n\n\tif ( position !== undefined ) {\n\t\tdeprecated( '`position` prop in wp.components.Dropdown', {\n\t\t\tsince: '6.2',\n\t\t\talternative: '`popoverProps.placement` prop',\n\t\t\thint: 'Note that the `position` prop will override any values passed through the `popoverProps.placement` prop.',\n\t\t} );\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ fallbackPopoverAnchor, setFallbackPopoverAnchor ] =\n\t\tuseState< HTMLDivElement | null >( null );\n\tconst containerRef = useRef< HTMLDivElement >();\n\n\tconst [ isOpen, setIsOpen ] = useControlledValue( {\n\t\tdefaultValue: defaultOpen,\n\t\tvalue: open,\n\t\tonChange: onToggle,\n\t} );\n\n\t/**\n\t * Closes the popover when focus leaves it unless the toggle was pressed or\n\t * focus has moved to a separate dialog. The former is to let the toggle\n\t * handle closing the popover and the latter is to preserve presence in\n\t * case a dialog has opened, allowing focus to return when it's dismissed.\n\t */\n\tfunction closeIfFocusOutside() {\n\t\tif ( ! containerRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { ownerDocument } = containerRef.current;\n\t\tconst dialog =\n\t\t\townerDocument?.activeElement?.closest( '[role=\"dialog\"]' );\n\t\tif (\n\t\t\t! containerRef.current.contains( ownerDocument.activeElement ) &&\n\t\t\t( ! dialog || dialog.contains( containerRef.current ) )\n\t\t) {\n\t\t\tclose();\n\t\t}\n\t}\n\n\tfunction close() {\n\t\tonClose?.();\n\t\tsetIsOpen( false );\n\t}\n\n\tconst args = {\n\t\tisOpen: !! isOpen,\n\t\tonToggle: () => setIsOpen( ! isOpen ),\n\t\tonClose: close,\n\t};\n\tconst popoverPropsHaveAnchor =\n\t\t!! popoverProps?.anchor ||\n\t\t// Note: `anchorRef`, `getAnchorRect` and `anchorRect` are deprecated and\n\t\t// be removed from `Popover` from WordPress 6.3\n\t\t!! popoverProps?.anchorRef ||\n\t\t!! popoverProps?.getAnchorRect ||\n\t\t!! popoverProps?.anchorRect;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ className }\n\t\t\tref={ useMergeRefs( [\n\t\t\t\tcontainerRef,\n\t\t\t\tforwardedRef,\n\t\t\t\tsetFallbackPopoverAnchor,\n\t\t\t] ) }\n\t\t\t// Some UAs focus the closest focusable parent when the toggle is\n\t\t\t// clicked. Making this div focusable ensures such UAs will focus\n\t\t\t// it and `closeIfFocusOutside` can tell if the toggle was clicked.\n\t\t\ttabIndex={ -1 }\n\t\t\tstyle={ style }\n\t\t>\n\t\t\t{ renderToggle( args ) }\n\t\t\t{ isOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tposition={ position }\n\t\t\t\t\tonClose={ close }\n\t\t\t\t\tonFocusOutside={ closeIfFocusOutside }\n\t\t\t\t\texpandOnMobile={ expandOnMobile }\n\t\t\t\t\theaderTitle={ headerTitle }\n\t\t\t\t\tfocusOnMount={ focusOnMount }\n\t\t\t\t\t// This value is used to ensure that the dropdowns\n\t\t\t\t\t// align with the editor header by default.\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t\tanchor={\n\t\t\t\t\t\t! popoverPropsHaveAnchor\n\t\t\t\t\t\t\t? fallbackPopoverAnchor\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tvariant={ variant }\n\t\t\t\t\t{ ...popoverProps }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'components-dropdown__content',\n\t\t\t\t\t\tpopoverProps?.className,\n\t\t\t\t\t\tcontentClassName\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ renderContent( args ) }\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\n/**\n * Renders a button that opens a floating content modal when clicked.\n *\n * ```jsx\n * import { Button, Dropdown } from '@wordpress/components';\n *\n * const MyDropdown = () => (\n * <Dropdown\n * className=\"my-container-class-name\"\n * contentClassName=\"my-dropdown-content-classname\"\n * popoverProps={ { placement: 'bottom-start' } }\n * renderToggle={ ( { isOpen, onToggle } ) => (\n * <Button\n * variant=\"primary\"\n * onClick={ onToggle }\n * aria-expanded={ isOpen }\n * >\n * Toggle Dropdown!\n * </Button>\n * ) }\n * renderContent={ () => <div>This is the content of the dropdown.</div> }\n * />\n * );\n * ```\n */\nexport const Dropdown = contextConnect( UnconnectedDropdown, 'Dropdown' );\n\nexport default Dropdown;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAP,sBAAA,CAAAC,OAAA;AAlBA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAMA,MAAMO,mBAAmB,GAAGA,CAC3BC,KAAoB,EACpBC,YAAiC,KAC7B;EACJ,MAAM;IACLC,aAAa;IACbC,YAAY;IACZC,SAAS;IACTC,gBAAgB;IAChBC,cAAc;IACdC,WAAW;IACXC,YAAY;IACZC,YAAY;IACZC,OAAO;IACPC,QAAQ;IACRC,KAAK;IAELC,IAAI;IACJC,WAAW;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AD,QAAA,GAAG,IAAAE,uBAAc,EAAE5D,mBAAmB,EAAE,UAAW,CAAC;AAAC,IAAA6D,QAAA,GAAAF,OAAA,CAAAL,OAAA,GAE3DI,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_compose","_deprecated","_context","_hooks","_popover","UnconnectedDropdown","props","forwardedRef","renderContent","renderToggle","className","contentClassName","expandOnMobile","headerTitle","focusOnMount","popoverProps","onClose","onToggle","style","open","defaultOpen","position","variant","useContextSystem","undefined","deprecated","since","alternative","hint","fallbackPopoverAnchor","setFallbackPopoverAnchor","useState","containerRef","useRef","isOpen","setIsOpen","useControlledValue","defaultValue","value","onChange","closeIfFocusOutside","current","ownerDocument","dialog","activeElement","closest","contains","close","args","popoverPropsHaveAnchor","anchor","anchorRef","getAnchorRect","anchorRect","_react","createElement","ref","useMergeRefs","tabIndex","default","onFocusOutside","offset","clsx","Dropdown","exports","contextConnect","_default"],"sources":["@wordpress/components/src/dropdown/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, useContextSystem } from '../context';\nimport { useControlledValue } from '../utils/hooks';\nimport Popover from '../popover';\nimport type { DropdownProps, DropdownInternalContext } from './types';\n\nconst UnconnectedDropdown = (\n\tprops: DropdownProps,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\trenderContent,\n\t\trenderToggle,\n\t\tclassName,\n\t\tcontentClassName,\n\t\texpandOnMobile,\n\t\theaderTitle,\n\t\tfocusOnMount,\n\t\tpopoverProps,\n\t\tonClose,\n\t\tonToggle,\n\t\tstyle,\n\n\t\topen,\n\t\tdefaultOpen,\n\n\t\t// Deprecated props\n\t\tposition,\n\n\t\t// From context system\n\t\tvariant,\n\t} = useContextSystem< DropdownProps & DropdownInternalContext >(\n\t\tprops,\n\t\t'Dropdown'\n\t);\n\n\tif ( position !== undefined ) {\n\t\tdeprecated( '`position` prop in wp.components.Dropdown', {\n\t\t\tsince: '6.2',\n\t\t\talternative: '`popoverProps.placement` prop',\n\t\t\thint: 'Note that the `position` prop will override any values passed through the `popoverProps.placement` prop.',\n\t\t} );\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ fallbackPopoverAnchor, setFallbackPopoverAnchor ] =\n\t\tuseState< HTMLDivElement | null >( null );\n\tconst containerRef = useRef< HTMLDivElement >();\n\n\tconst [ isOpen, setIsOpen ] = useControlledValue( {\n\t\tdefaultValue: defaultOpen,\n\t\tvalue: open,\n\t\tonChange: onToggle,\n\t} );\n\n\t/**\n\t * Closes the popover when focus leaves it unless the toggle was pressed or\n\t * focus has moved to a separate dialog. The former is to let the toggle\n\t * handle closing the popover and the latter is to preserve presence in\n\t * case a dialog has opened, allowing focus to return when it's dismissed.\n\t */\n\tfunction closeIfFocusOutside() {\n\t\tif ( ! containerRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { ownerDocument } = containerRef.current;\n\t\tconst dialog =\n\t\t\townerDocument?.activeElement?.closest( '[role=\"dialog\"]' );\n\t\tif (\n\t\t\t! containerRef.current.contains( ownerDocument.activeElement ) &&\n\t\t\t( ! dialog || dialog.contains( containerRef.current ) )\n\t\t) {\n\t\t\tclose();\n\t\t}\n\t}\n\n\tfunction close() {\n\t\tonClose?.();\n\t\tsetIsOpen( false );\n\t}\n\n\tconst args = {\n\t\tisOpen: !! isOpen,\n\t\tonToggle: () => setIsOpen( ! isOpen ),\n\t\tonClose: close,\n\t};\n\tconst popoverPropsHaveAnchor =\n\t\t!! popoverProps?.anchor ||\n\t\t// Note: `anchorRef`, `getAnchorRect` and `anchorRect` are deprecated and\n\t\t// be removed from `Popover` from WordPress 6.3\n\t\t!! popoverProps?.anchorRef ||\n\t\t!! popoverProps?.getAnchorRect ||\n\t\t!! popoverProps?.anchorRect;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ className }\n\t\t\tref={ useMergeRefs( [\n\t\t\t\tcontainerRef,\n\t\t\t\tforwardedRef,\n\t\t\t\tsetFallbackPopoverAnchor,\n\t\t\t] ) }\n\t\t\t// Some UAs focus the closest focusable parent when the toggle is\n\t\t\t// clicked. Making this div focusable ensures such UAs will focus\n\t\t\t// it and `closeIfFocusOutside` can tell if the toggle was clicked.\n\t\t\ttabIndex={ -1 }\n\t\t\tstyle={ style }\n\t\t>\n\t\t\t{ renderToggle( args ) }\n\t\t\t{ isOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tposition={ position }\n\t\t\t\t\tonClose={ close }\n\t\t\t\t\tonFocusOutside={ closeIfFocusOutside }\n\t\t\t\t\texpandOnMobile={ expandOnMobile }\n\t\t\t\t\theaderTitle={ headerTitle }\n\t\t\t\t\tfocusOnMount={ focusOnMount }\n\t\t\t\t\t// This value is used to ensure that the dropdowns\n\t\t\t\t\t// align with the editor header by default.\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t\tanchor={\n\t\t\t\t\t\t! popoverPropsHaveAnchor\n\t\t\t\t\t\t\t? fallbackPopoverAnchor\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tvariant={ variant }\n\t\t\t\t\t{ ...popoverProps }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-dropdown__content',\n\t\t\t\t\t\tpopoverProps?.className,\n\t\t\t\t\t\tcontentClassName\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ renderContent( args ) }\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\n/**\n * Renders a button that opens a floating content modal when clicked.\n *\n * ```jsx\n * import { Button, Dropdown } from '@wordpress/components';\n *\n * const MyDropdown = () => (\n * <Dropdown\n * className=\"my-container-class-name\"\n * contentClassName=\"my-dropdown-content-classname\"\n * popoverProps={ { placement: 'bottom-start' } }\n * renderToggle={ ( { isOpen, onToggle } ) => (\n * <Button\n * variant=\"primary\"\n * onClick={ onToggle }\n * aria-expanded={ isOpen }\n * >\n * Toggle Dropdown!\n * </Button>\n * ) }\n * renderContent={ () => <div>This is the content of the dropdown.</div> }\n * />\n * );\n * ```\n */\nexport const Dropdown = contextConnect( UnconnectedDropdown, 'Dropdown' );\n\nexport default Dropdown;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAP,sBAAA,CAAAC,OAAA;AAlBA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAMA,MAAMO,mBAAmB,GAAGA,CAC3BC,KAAoB,EACpBC,YAAiC,KAC7B;EACJ,MAAM;IACLC,aAAa;IACbC,YAAY;IACZC,SAAS;IACTC,gBAAgB;IAChBC,cAAc;IACdC,WAAW;IACXC,YAAY;IACZC,YAAY;IACZC,OAAO;IACPC,QAAQ;IACRC,KAAK;IAELC,IAAI;IACJC,WAAW;IAEX;IACAC,QAAQ;IAER;IACAC;EACD,CAAC,GAAG,IAAAC,yBAAgB,EACnBjB,KAAK,EACL,UACD,CAAC;EAED,IAAKe,QAAQ,KAAKG,SAAS,EAAG;IAC7B,IAAAC,mBAAU,EAAE,2CAA2C,EAAE;MACxDC,KAAK,EAAE,KAAK;MACZC,WAAW,EAAE,+BAA+B;MAC5CC,IAAI,EAAE;IACP,CAAE,CAAC;EACJ;;EAEA;EACA;EACA,MAAM,CAAEC,qBAAqB,EAAEC,wBAAwB,CAAE,GACxD,IAAAC,iBAAQ,EAA2B,IAAK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AC,qBAAY,EAAE,CACnBzB,YAAY,EACZzB,YAAY,EACZuB,wBAAwB,CACvB;IACF;IACA;IACA;IAAA;IACA4B,QAAQ,EAAG,CAAC,CAAG;IACfxC,KAAK,EAAGA;EAAO,GAEbT,YAAY,CAAEuC,IAAK,CAAC,EACpBd,MAAM,IACP,IAAAoB,MAAA,CAAAC,aAAA,EAACnD,QAAA,CAAAuD,OAAO;IACPtC,QAAQ,EAAGA,QAAU;IACrBL,OAAO,EAAG+B,KAAO;IACjBa,cAAc,EAAGpB,mBAAqB;IACtC5B,cAAc,EAAGA,cAAgB;IACjCC,WAAW,EAAGA,WAAa;IAC3BC,YAAY,EAAGA;IACf;IACA;IAAA;IACA+C,MAAM,EAAG,EAAI;IACbX,MAAM,EACL,CAAED,sBAAsB,GACrBpB,qBAAqB,GACrBL,SACH;IACDF,OAAO,EAAGA,OAAS;IAAA,GACdP,YAAY;IACjBL,SAAS,EAAG,IAAAoD,aAAI,EACf,8BAA8B,EAC9B/C,YAAY,EAAEL,SAAS,EACvBC,gBACD;EAAG,GAEDH,aAAa,CAAEwC,IAAK,CACd,CAEN,CAAC;AAER,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMe,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,IAAAE,uBAAc,EAAE5D,mBAAmB,EAAE,UAAW,CAAC;AAAC,IAAA6D,QAAA,GAAAF,OAAA,CAAAL,OAAA,GAE3DI,QAAQ","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.DropdownMenu = void 0;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _icons = require("@wordpress/icons");
11
11
  var _context = require("../context");
12
12
  var _button = _interopRequireDefault(require("../button"));
@@ -30,7 +30,7 @@ function mergeProps(defaultProps = {}, props = {}) {
30
30
  ...props
31
31
  };
32
32
  if (props.className && defaultProps.className) {
33
- mergedProps.className = (0, _classnames.default)(props.className, defaultProps.className);
33
+ mergedProps.className = (0, _clsx.default)(props.className, defaultProps.className);
34
34
  }
35
35
  return mergedProps;
36
36
  }
@@ -98,7 +98,7 @@ function UnconnectedDropdownMenu(dropdownMenuProps) {
98
98
  ...restToggleProps
99
99
  } = toggleProps !== null && toggleProps !== void 0 ? toggleProps : {};
100
100
  const mergedToggleProps = mergeProps({
101
- className: (0, _classnames.default)('components-dropdown-menu__toggle', {
101
+ className: (0, _clsx.default)('components-dropdown-menu__toggle', {
102
102
  'is-opened': isOpen
103
103
  })
104
104
  }, restToggleProps);
@@ -127,7 +127,7 @@ function UnconnectedDropdownMenu(dropdownMenuProps) {
127
127
  renderContent: props => {
128
128
  const mergedMenuProps = mergeProps({
129
129
  'aria-label': label,
130
- className: (0, _classnames.default)('components-dropdown-menu__menu', {
130
+ className: (0, _clsx.default)('components-dropdown-menu__menu', {
131
131
  'no-icons': noIcons
132
132
  })
133
133
  }, menuProps);
@@ -143,7 +143,7 @@ function UnconnectedDropdownMenu(dropdownMenuProps) {
143
143
  control.onClick();
144
144
  }
145
145
  },
146
- className: (0, _classnames.default)('components-dropdown-menu__menu-item', {
146
+ className: (0, _clsx.default)('components-dropdown-menu__menu-item', {
147
147
  'has-separator': indexOfSet > 0 && indexOfControl === 0,
148
148
  'is-active': control.isActive,
149
149
  'is-icon-only': !control.title
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_icons","_context","_button","_dropdown","_navigableContainer","mergeProps","defaultProps","props","mergedProps","className","classnames","isFunction","maybeFunc","UnconnectedDropdownMenu","dropdownMenuProps","children","controls","icon","menu","label","popoverProps","toggleProps","menuProps","disableOpenOnArrowDown","text","noIcons","open","defaultOpen","onToggle","onToggleProp","variant","useContextSystem","length","controlSets","Array","isArray","mergedPopoverProps","_react","createElement","default","renderToggle","isOpen","_toggleProps$showTool","openOnArrowDown","event","code","preventDefault","as","Toggle","Button","restToggleProps","mergedToggleProps","onClick","onKeyDown","showTooltip","renderContent","mergedMenuProps","NavigableMenu","role","flatMap","controlSet","indexOfSet","map","control","indexOfControl","key","join","stopPropagation","onClose","isActive","title","undefined","disabled","isDisabled","DropdownMenu","exports","contextConnectWithoutRef","_default"],"sources":["@wordpress/components/src/dropdown-menu/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { menu } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport { NavigableMenu } from '../navigable-container';\nimport type {\n\tDropdownMenuProps,\n\tDropdownOption,\n\tDropdownMenuInternalContext,\n} from './types';\n\nfunction mergeProps<\n\tT extends { className?: string; [ key: string ]: unknown },\n>( defaultProps: Partial< T > = {}, props: T = {} as T ) {\n\tconst mergedProps: T = {\n\t\t...defaultProps,\n\t\t...props,\n\t};\n\n\tif ( props.className && defaultProps.className ) {\n\t\tmergedProps.className = classnames(\n\t\t\tprops.className,\n\t\t\tdefaultProps.className\n\t\t);\n\t}\n\n\treturn mergedProps;\n}\n\nfunction isFunction( maybeFunc: unknown ): maybeFunc is () => void {\n\treturn typeof maybeFunc === 'function';\n}\n\nfunction UnconnectedDropdownMenu( dropdownMenuProps: DropdownMenuProps ) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tcontrols,\n\t\ticon = menu,\n\t\tlabel,\n\t\tpopoverProps,\n\t\ttoggleProps,\n\t\tmenuProps,\n\t\tdisableOpenOnArrowDown = false,\n\t\ttext,\n\t\tnoIcons,\n\n\t\topen,\n\t\tdefaultOpen,\n\t\tonToggle: onToggleProp,\n\n\t\t// Context\n\t\tvariant,\n\t} = useContextSystem< DropdownMenuProps & DropdownMenuInternalContext >(\n\t\tdropdownMenuProps,\n\t\t'DropdownMenu'\n\t);\n\n\tif ( ! controls?.length && ! isFunction( children ) ) {\n\t\treturn null;\n\t}\n\n\t// Normalize controls to nested array of objects (sets of controls)\n\tlet controlSets: DropdownOption[][];\n\tif ( controls?.length ) {\n\t\t// @ts-expect-error The check below is needed because `DropdownMenus`\n\t\t// rendered by `ToolBarGroup` receive controls as a nested array.\n\t\tcontrolSets = controls;\n\t\tif ( ! Array.isArray( controlSets[ 0 ] ) ) {\n\t\t\t// This is not ideal, but at this point we know that `controls` is\n\t\t\t// not a nested array, even if TypeScript doesn't.\n\t\t\tcontrolSets = [ controls as DropdownOption[] ];\n\t\t}\n\t}\n\n\tconst mergedPopoverProps = mergeProps(\n\t\t{\n\t\t\tclassName: 'components-dropdown-menu__popover',\n\t\t\tvariant,\n\t\t},\n\t\tpopoverProps\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ className }\n\t\t\tpopoverProps={ mergedPopoverProps }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst openOnArrowDown = ( event: React.KeyboardEvent ) => {\n\t\t\t\t\tif ( disableOpenOnArrowDown ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! isOpen && event.code === 'ArrowDown' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst { as: Toggle = Button, ...restToggleProps } =\n\t\t\t\t\ttoggleProps ?? {};\n\n\t\t\t\tconst mergedToggleProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t'components-dropdown-menu__toggle',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-opened': isOpen,\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\trestToggleProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Toggle\n\t\t\t\t\t\t{ ...mergedToggleProps }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t( ( event ) => {\n\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\tif ( mergedToggleProps.onClick ) {\n\t\t\t\t\t\t\t\t\tmergedToggleProps.onClick( event );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ) as React.MouseEventHandler< HTMLButtonElement >\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonKeyDown={\n\t\t\t\t\t\t\t( ( event ) => {\n\t\t\t\t\t\t\t\topenOnArrowDown( event );\n\t\t\t\t\t\t\t\tif ( mergedToggleProps.onKeyDown ) {\n\t\t\t\t\t\t\t\t\tmergedToggleProps.onKeyDown( event );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ) as React.KeyboardEventHandler< HTMLButtonElement >\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\ttext={ text }\n\t\t\t\t\t\tshowTooltip={ toggleProps?.showTooltip ?? true }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ mergedToggleProps.children }\n\t\t\t\t\t</Toggle>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ ( props ) => {\n\t\t\t\tconst mergedMenuProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\t'aria-label': label,\n\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t'components-dropdown-menu__menu',\n\t\t\t\t\t\t\t{ 'no-icons': noIcons }\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\tmenuProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<NavigableMenu { ...mergedMenuProps } role=\"menu\">\n\t\t\t\t\t\t{ isFunction( children ) ? children( props ) : null }\n\t\t\t\t\t\t{ controlSets?.flatMap( ( controlSet, indexOfSet ) =>\n\t\t\t\t\t\t\tcontrolSet.map( ( control, indexOfControl ) => (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tkey={ [\n\t\t\t\t\t\t\t\t\t\tindexOfSet,\n\t\t\t\t\t\t\t\t\t\tindexOfControl,\n\t\t\t\t\t\t\t\t\t].join() }\n\t\t\t\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\tprops.onClose();\n\t\t\t\t\t\t\t\t\t\tif ( control.onClick ) {\n\t\t\t\t\t\t\t\t\t\t\tcontrol.onClick();\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\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'components-dropdown-menu__menu-item',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'has-separator':\n\t\t\t\t\t\t\t\t\t\t\t\tindexOfSet > 0 &&\n\t\t\t\t\t\t\t\t\t\t\t\tindexOfControl === 0,\n\t\t\t\t\t\t\t\t\t\t\t'is-active': control.isActive,\n\t\t\t\t\t\t\t\t\t\t\t'is-icon-only': ! control.title,\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\ticon={ control.icon }\n\t\t\t\t\t\t\t\t\tlabel={ control.label }\n\t\t\t\t\t\t\t\t\taria-checked={\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemcheckbox' ||\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemradio'\n\t\t\t\t\t\t\t\t\t\t\t? control.isActive\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\trole={\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemcheckbox' ||\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemradio'\n\t\t\t\t\t\t\t\t\t\t\t? control.role\n\t\t\t\t\t\t\t\t\t\t\t: 'menuitem'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdisabled={ control.isDisabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ control.title }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) )\n\t\t\t\t\t\t) }\n\t\t\t\t\t</NavigableMenu>\n\t\t\t\t);\n\t\t\t} }\n\t\t\topen={ open }\n\t\t\tdefaultOpen={ defaultOpen }\n\t\t\tonToggle={ onToggleProp }\n\t\t/>\n\t);\n}\n\n/**\n *\n * The DropdownMenu displays a list of actions (each contained in a MenuItem,\n * MenuItemsChoice, or MenuGroup) in a compact way. It appears in a Popover\n * after the user has interacted with an element (a button or icon) or when\n * they perform a specific action.\n *\n * Render a Dropdown Menu with a set of controls:\n *\n * ```jsx\n * import { DropdownMenu } from '@wordpress/components';\n * import {\n * \tmore,\n * \tarrowLeft,\n * \tarrowRight,\n * \tarrowUp,\n * \tarrowDown,\n * } from '@wordpress/icons';\n *\n * const MyDropdownMenu = () => (\n * \t<DropdownMenu\n * \t\ticon={ more }\n * \t\tlabel=\"Select a direction\"\n * \t\tcontrols={ [\n * \t\t\t{\n * \t\t\t\ttitle: 'Up',\n * \t\t\t\ticon: arrowUp,\n * \t\t\t\tonClick: () => console.log( 'up' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Right',\n * \t\t\t\ticon: arrowRight,\n * \t\t\t\tonClick: () => console.log( 'right' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Down',\n * \t\t\t\ticon: arrowDown,\n * \t\t\t\tonClick: () => console.log( 'down' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Left',\n * \t\t\t\ticon: arrowLeft,\n * \t\t\t\tonClick: () => console.log( 'left' ),\n * \t\t\t},\n * \t\t] }\n * \t/>\n * );\n * ```\n *\n * Alternatively, specify a `children` function which returns elements valid for\n * use in a DropdownMenu: `MenuItem`, `MenuItemsChoice`, or `MenuGroup`.\n *\n * ```jsx\n * import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\n * import { more, arrowUp, arrowDown, trash } from '@wordpress/icons';\n *\n * const MyDropdownMenu = () => (\n * \t<DropdownMenu icon={ more } label=\"Select a direction\">\n * \t\t{ ( { onClose } ) => (\n * \t\t\t<>\n * \t\t\t\t<MenuGroup>\n * \t\t\t\t\t<MenuItem icon={ arrowUp } onClick={ onClose }>\n * \t\t\t\t\t\tMove Up\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t\t<MenuItem icon={ arrowDown } onClick={ onClose }>\n * \t\t\t\t\t\tMove Down\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t</MenuGroup>\n * \t\t\t\t<MenuGroup>\n * \t\t\t\t\t<MenuItem icon={ trash } onClick={ onClose }>\n * \t\t\t\t\t\tRemove\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t</MenuGroup>\n * \t\t\t</>\n * \t\t) }\n * \t</DropdownMenu>\n * );\n * ```\n *\n */\nexport const DropdownMenu = contextConnectWithoutRef(\n\tUnconnectedDropdownMenu,\n\t'DropdownMenu'\n);\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAWA,SAASM,UAAUA,CAEhBC,YAA0B,GAAG,CAAC,CAAC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C,IAAM;QACrBE,KAAK,EAAG4C,OAAO,CAAC5C,KAAO;QACvB,gBACC4C,OAAO,CAACL,IAAI,KAAK,kBAAkB,IACnCK,OAAO,CAACL,IAAI,KAAK,eAAe,GAC7BK,OAAO,CAACM,QAAQ,GAChBE,SACH;QACDb,IAAI,EACHK,OAAO,CAACL,IAAI,KAAK,kBAAkB,IACnCK,OAAO,CAACL,IAAI,KAAK,eAAe,GAC7BK,OAAO,CAACL,IAAI,GACZ,UACH;QACDc,QAAQ,EAAGT,OAAO,CAACU;MAAY,GAE7BV,OAAO,CAACO,KACH,CACP,CACH,CACc,CAAC;IAElB,CAAG;IACH5C,IAAI,EAAGA,IAAM;IACbC,WAAW,EAAGA,WAAa;IAC3BC,QAAQ,EAAGC;EAAc,CACzB,CAAC;AAEJ;;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM6C,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,iCAAwB,EACnD/D,uBAAuB,EACvB,cACD,CAAC;AAAC,IAAAgE,QAAA,GAAAF,OAAA,CAAApC,OAAA,GAEamC,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_icons","_context","_button","_dropdown","_navigableContainer","mergeProps","defaultProps","props","mergedProps","className","clsx","isFunction","maybeFunc","UnconnectedDropdownMenu","dropdownMenuProps","children","controls","icon","menu","label","popoverProps","toggleProps","menuProps","disableOpenOnArrowDown","text","noIcons","open","defaultOpen","onToggle","onToggleProp","variant","useContextSystem","length","controlSets","Array","isArray","mergedPopoverProps","_react","createElement","default","renderToggle","isOpen","_toggleProps$showTool","openOnArrowDown","event","code","preventDefault","as","Toggle","Button","restToggleProps","mergedToggleProps","onClick","onKeyDown","showTooltip","renderContent","mergedMenuProps","NavigableMenu","role","flatMap","controlSet","indexOfSet","map","control","indexOfControl","key","join","stopPropagation","onClose","isActive","title","undefined","disabled","isDisabled","DropdownMenu","exports","contextConnectWithoutRef","_default"],"sources":["@wordpress/components/src/dropdown-menu/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { menu } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport { NavigableMenu } from '../navigable-container';\nimport type {\n\tDropdownMenuProps,\n\tDropdownOption,\n\tDropdownMenuInternalContext,\n} from './types';\n\nfunction mergeProps<\n\tT extends { className?: string; [ key: string ]: unknown },\n>( defaultProps: Partial< T > = {}, props: T = {} as T ) {\n\tconst mergedProps: T = {\n\t\t...defaultProps,\n\t\t...props,\n\t};\n\n\tif ( props.className && defaultProps.className ) {\n\t\tmergedProps.className = clsx( props.className, defaultProps.className );\n\t}\n\n\treturn mergedProps;\n}\n\nfunction isFunction( maybeFunc: unknown ): maybeFunc is () => void {\n\treturn typeof maybeFunc === 'function';\n}\n\nfunction UnconnectedDropdownMenu( dropdownMenuProps: DropdownMenuProps ) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tcontrols,\n\t\ticon = menu,\n\t\tlabel,\n\t\tpopoverProps,\n\t\ttoggleProps,\n\t\tmenuProps,\n\t\tdisableOpenOnArrowDown = false,\n\t\ttext,\n\t\tnoIcons,\n\n\t\topen,\n\t\tdefaultOpen,\n\t\tonToggle: onToggleProp,\n\n\t\t// Context\n\t\tvariant,\n\t} = useContextSystem< DropdownMenuProps & DropdownMenuInternalContext >(\n\t\tdropdownMenuProps,\n\t\t'DropdownMenu'\n\t);\n\n\tif ( ! controls?.length && ! isFunction( children ) ) {\n\t\treturn null;\n\t}\n\n\t// Normalize controls to nested array of objects (sets of controls)\n\tlet controlSets: DropdownOption[][];\n\tif ( controls?.length ) {\n\t\t// @ts-expect-error The check below is needed because `DropdownMenus`\n\t\t// rendered by `ToolBarGroup` receive controls as a nested array.\n\t\tcontrolSets = controls;\n\t\tif ( ! Array.isArray( controlSets[ 0 ] ) ) {\n\t\t\t// This is not ideal, but at this point we know that `controls` is\n\t\t\t// not a nested array, even if TypeScript doesn't.\n\t\t\tcontrolSets = [ controls as DropdownOption[] ];\n\t\t}\n\t}\n\n\tconst mergedPopoverProps = mergeProps(\n\t\t{\n\t\t\tclassName: 'components-dropdown-menu__popover',\n\t\t\tvariant,\n\t\t},\n\t\tpopoverProps\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ className }\n\t\t\tpopoverProps={ mergedPopoverProps }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst openOnArrowDown = ( event: React.KeyboardEvent ) => {\n\t\t\t\t\tif ( disableOpenOnArrowDown ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! isOpen && event.code === 'ArrowDown' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst { as: Toggle = Button, ...restToggleProps } =\n\t\t\t\t\ttoggleProps ?? {};\n\n\t\t\t\tconst mergedToggleProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: clsx( 'components-dropdown-menu__toggle', {\n\t\t\t\t\t\t\t'is-opened': isOpen,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\trestToggleProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Toggle\n\t\t\t\t\t\t{ ...mergedToggleProps }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t( ( event ) => {\n\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\tif ( mergedToggleProps.onClick ) {\n\t\t\t\t\t\t\t\t\tmergedToggleProps.onClick( event );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ) as React.MouseEventHandler< HTMLButtonElement >\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonKeyDown={\n\t\t\t\t\t\t\t( ( event ) => {\n\t\t\t\t\t\t\t\topenOnArrowDown( event );\n\t\t\t\t\t\t\t\tif ( mergedToggleProps.onKeyDown ) {\n\t\t\t\t\t\t\t\t\tmergedToggleProps.onKeyDown( event );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ) as React.KeyboardEventHandler< HTMLButtonElement >\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\ttext={ text }\n\t\t\t\t\t\tshowTooltip={ toggleProps?.showTooltip ?? true }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ mergedToggleProps.children }\n\t\t\t\t\t</Toggle>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ ( props ) => {\n\t\t\t\tconst mergedMenuProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\t'aria-label': label,\n\t\t\t\t\t\tclassName: clsx( 'components-dropdown-menu__menu', {\n\t\t\t\t\t\t\t'no-icons': noIcons,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\tmenuProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<NavigableMenu { ...mergedMenuProps } role=\"menu\">\n\t\t\t\t\t\t{ isFunction( children ) ? children( props ) : null }\n\t\t\t\t\t\t{ controlSets?.flatMap( ( controlSet, indexOfSet ) =>\n\t\t\t\t\t\t\tcontrolSet.map( ( control, indexOfControl ) => (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tkey={ [\n\t\t\t\t\t\t\t\t\t\tindexOfSet,\n\t\t\t\t\t\t\t\t\t\tindexOfControl,\n\t\t\t\t\t\t\t\t\t].join() }\n\t\t\t\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\tprops.onClose();\n\t\t\t\t\t\t\t\t\t\tif ( control.onClick ) {\n\t\t\t\t\t\t\t\t\t\t\tcontrol.onClick();\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\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'components-dropdown-menu__menu-item',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'has-separator':\n\t\t\t\t\t\t\t\t\t\t\t\tindexOfSet > 0 &&\n\t\t\t\t\t\t\t\t\t\t\t\tindexOfControl === 0,\n\t\t\t\t\t\t\t\t\t\t\t'is-active': control.isActive,\n\t\t\t\t\t\t\t\t\t\t\t'is-icon-only': ! control.title,\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\ticon={ control.icon }\n\t\t\t\t\t\t\t\t\tlabel={ control.label }\n\t\t\t\t\t\t\t\t\taria-checked={\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemcheckbox' ||\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemradio'\n\t\t\t\t\t\t\t\t\t\t\t? control.isActive\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\trole={\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemcheckbox' ||\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemradio'\n\t\t\t\t\t\t\t\t\t\t\t? control.role\n\t\t\t\t\t\t\t\t\t\t\t: 'menuitem'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdisabled={ control.isDisabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ control.title }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) )\n\t\t\t\t\t\t) }\n\t\t\t\t\t</NavigableMenu>\n\t\t\t\t);\n\t\t\t} }\n\t\t\topen={ open }\n\t\t\tdefaultOpen={ defaultOpen }\n\t\t\tonToggle={ onToggleProp }\n\t\t/>\n\t);\n}\n\n/**\n *\n * The DropdownMenu displays a list of actions (each contained in a MenuItem,\n * MenuItemsChoice, or MenuGroup) in a compact way. It appears in a Popover\n * after the user has interacted with an element (a button or icon) or when\n * they perform a specific action.\n *\n * Render a Dropdown Menu with a set of controls:\n *\n * ```jsx\n * import { DropdownMenu } from '@wordpress/components';\n * import {\n * \tmore,\n * \tarrowLeft,\n * \tarrowRight,\n * \tarrowUp,\n * \tarrowDown,\n * } from '@wordpress/icons';\n *\n * const MyDropdownMenu = () => (\n * \t<DropdownMenu\n * \t\ticon={ more }\n * \t\tlabel=\"Select a direction\"\n * \t\tcontrols={ [\n * \t\t\t{\n * \t\t\t\ttitle: 'Up',\n * \t\t\t\ticon: arrowUp,\n * \t\t\t\tonClick: () => console.log( 'up' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Right',\n * \t\t\t\ticon: arrowRight,\n * \t\t\t\tonClick: () => console.log( 'right' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Down',\n * \t\t\t\ticon: arrowDown,\n * \t\t\t\tonClick: () => console.log( 'down' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Left',\n * \t\t\t\ticon: arrowLeft,\n * \t\t\t\tonClick: () => console.log( 'left' ),\n * \t\t\t},\n * \t\t] }\n * \t/>\n * );\n * ```\n *\n * Alternatively, specify a `children` function which returns elements valid for\n * use in a DropdownMenu: `MenuItem`, `MenuItemsChoice`, or `MenuGroup`.\n *\n * ```jsx\n * import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\n * import { more, arrowUp, arrowDown, trash } from '@wordpress/icons';\n *\n * const MyDropdownMenu = () => (\n * \t<DropdownMenu icon={ more } label=\"Select a direction\">\n * \t\t{ ( { onClose } ) => (\n * \t\t\t<>\n * \t\t\t\t<MenuGroup>\n * \t\t\t\t\t<MenuItem icon={ arrowUp } onClick={ onClose }>\n * \t\t\t\t\t\tMove Up\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t\t<MenuItem icon={ arrowDown } onClick={ onClose }>\n * \t\t\t\t\t\tMove Down\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t</MenuGroup>\n * \t\t\t\t<MenuGroup>\n * \t\t\t\t\t<MenuItem icon={ trash } onClick={ onClose }>\n * \t\t\t\t\t\tRemove\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t</MenuGroup>\n * \t\t\t</>\n * \t\t) }\n * \t</DropdownMenu>\n * );\n * ```\n *\n */\nexport const DropdownMenu = contextConnectWithoutRef(\n\tUnconnectedDropdownMenu,\n\t'DropdownMenu'\n);\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAWA,SAASM,UAAUA,CAEhBC,YAA0B,GAAG,CAAC,CAAC,EAAEC,KAAQ,GAAG,CAAC,C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AAO,CAAC5C,KAAO;QACvB,gBACC4C,OAAO,CAACL,IAAI,KAAK,kBAAkB,IACnCK,OAAO,CAACL,IAAI,KAAK,eAAe,GAC7BK,OAAO,CAACM,QAAQ,GAChBE,SACH;QACDb,IAAI,EACHK,OAAO,CAACL,IAAI,KAAK,kBAAkB,IACnCK,OAAO,CAACL,IAAI,KAAK,eAAe,GAC7BK,OAAO,CAACL,IAAI,GACZ,UACH;QACDc,QAAQ,EAAGT,OAAO,CAACU;MAAY,GAE7BV,OAAO,CAACO,KACH,CACP,CACH,CACc,CAAC;IAElB,CAAG;IACH5C,IAAI,EAAGA,IAAM;IACbC,WAAW,EAAGA,WAAa;IAC3BC,QAAQ,EAAGC;EAAc,CACzB,CAAC;AAEJ;;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM6C,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,iCAAwB,EACnD/D,uBAAuB,EACvB,cACD,CAAC;AAAC,IAAAgE,QAAA,GAAAF,OAAA,CAAApC,OAAA,GAEamC,YAAY","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _reactNative = require("react-native");
11
11
  var _components = require("@wordpress/components");
12
12
  var _compose = require("@wordpress/compose");
@@ -31,7 +31,7 @@ function mergeProps(defaultProps = {}, props = {}) {
31
31
  ...props
32
32
  };
33
33
  if (props.className && defaultProps.className) {
34
- mergedProps.className = (0, _classnames.default)(props.className, defaultProps.className);
34
+ mergedProps.className = (0, _clsx.default)(props.className, defaultProps.className);
35
35
  }
36
36
  return mergedProps;
37
37
  }
@@ -70,14 +70,14 @@ function DropdownMenu({
70
70
  className: 'components-dropdown-menu__popover'
71
71
  }, popoverProps);
72
72
  return (0, _react.createElement)(_dropdown.default, {
73
- className: (0, _classnames.default)('components-dropdown-menu', className),
73
+ className: (0, _clsx.default)('components-dropdown-menu', className),
74
74
  popoverProps: mergedPopoverProps,
75
75
  renderToggle: ({
76
76
  isOpen,
77
77
  onToggle
78
78
  }) => {
79
79
  const mergedToggleProps = mergeProps({
80
- className: (0, _classnames.default)('components-dropdown-menu__toggle', {
80
+ className: (0, _clsx.default)('components-dropdown-menu__toggle', {
81
81
  'is-opened': isOpen
82
82
  })
83
83
  }, toggleProps);
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_reactNative","_components","_compose","_icons","_button","_dropdown","mergeProps","defaultProps","props","mergedProps","className","classnames","isFunction","maybeFunc","DropdownMenu","children","controls","icon","menu","label","popoverProps","toggleProps","length","controlSets","Array","isArray","mergedPopoverProps","_react","createElement","default","renderToggle","isOpen","onToggle","mergedToggleProps","onClick","event","renderContent","onClose","BottomSheet","hideHeader","isVisible","PanelBody","title","style","paddingLeft","paddingRight","flatMap","controlSet","indexOfSet","map","control","indexOfControl","Cell","key","join","onPress","editable","leftAlign","isSelected","isActive","separatorType","Platform","OS","_default","exports","withPreferredColorScheme"],"sources":["@wordpress/components/src/dropdown-menu/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { Platform } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { BottomSheet, PanelBody } from '@wordpress/components';\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { menu } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\n\nfunction mergeProps( defaultProps = {}, props = {} ) {\n\tconst mergedProps = {\n\t\t...defaultProps,\n\t\t...props,\n\t};\n\n\tif ( props.className && defaultProps.className ) {\n\t\tmergedProps.className = classnames(\n\t\t\tprops.className,\n\t\t\tdefaultProps.className\n\t\t);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nfunction DropdownMenu( {\n\tchildren,\n\tclassName,\n\tcontrols,\n\ticon = menu,\n\tlabel,\n\tpopoverProps,\n\ttoggleProps,\n} ) {\n\tif ( ! controls?.length && ! isFunction( children ) ) {\n\t\treturn null;\n\t}\n\n\t// Normalize controls to nested array of objects (sets of controls)\n\tlet controlSets;\n\tif ( controls?.length ) {\n\t\tcontrolSets = controls;\n\t\tif ( ! Array.isArray( controlSets[ 0 ] ) ) {\n\t\t\tcontrolSets = [ controlSets ];\n\t\t}\n\t}\n\tconst mergedPopoverProps = mergeProps(\n\t\t{\n\t\t\tclassName: 'components-dropdown-menu__popover',\n\t\t},\n\t\tpopoverProps\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ classnames( 'components-dropdown-menu', className ) }\n\t\t\tpopoverProps={ mergedPopoverProps }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst mergedToggleProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t'components-dropdown-menu__toggle',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-opened': isOpen,\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\ttoggleProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t{ ...mergedToggleProps }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tonToggle( event );\n\t\t\t\t\t\t\tif ( mergedToggleProps.onClick ) {\n\t\t\t\t\t\t\t\tmergedToggleProps.onClick( event );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ mergedToggleProps.children }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ ( { isOpen, onClose, ...props } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<BottomSheet\n\t\t\t\t\t\thideHeader\n\t\t\t\t\t\tisVisible={ isOpen }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isFunction( children ) ? children( props ) : null }\n\t\t\t\t\t\t<PanelBody\n\t\t\t\t\t\t\ttitle={ label }\n\t\t\t\t\t\t\tstyle={ { paddingLeft: 0, paddingRight: 0 } }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ controlSets?.flatMap(\n\t\t\t\t\t\t\t\t( controlSet, indexOfSet ) =>\n\t\t\t\t\t\t\t\t\tcontrolSet.map(\n\t\t\t\t\t\t\t\t\t\t( control, indexOfControl ) => (\n\t\t\t\t\t\t\t\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ [\n\t\t\t\t\t\t\t\t\t\t\t\t\tindexOfSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindexOfControl,\n\t\t\t\t\t\t\t\t\t\t\t\t].join() }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ control.title }\n\t\t\t\t\t\t\t\t\t\t\t\tonPress={ () => {\n\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\tif ( control.onClick ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrol.onClick();\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\teditable={ false }\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ control.icon }\n\t\t\t\t\t\t\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\t\t\t\t\t\t\tisSelected={ control.isActive }\n\t\t\t\t\t\t\t\t\t\t\t\tseparatorType={\n\t\t\t\t\t\t\t\t\t\t\t\t\tPlatform.OS === 'android'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'none'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'leftMargin'\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) }\n\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t</BottomSheet>\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default withPreferredColorScheme( DropdownMenu );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAIA,SAASO,UAAUA,CAAEC,YAAY,GAAG,CAAC,CAAC,EAAEC,KAAK,GAAG,CAAC,CAAC,EAAG;EACpD,MAAM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ACvBa,OAAO,EAAGA,CAAA,KAAM;UACflB,OAAO,CAAC,CAAC;UACT,IAAKa,OAAO,CAAChB,OAAO,EAAG;YACtBgB,OAAO,CAAChB,OAAO,CAAC,CAAC;UAClB;QACD,CAAG;QACHsB,QAAQ,EAAG,KAAO;QAClBvC,IAAI,EAAGiC,OAAO,CAACjC,IAAM;QACrBwC,SAAS;QACTC,UAAU,EAAGR,OAAO,CAACS,QAAU;QAC/BC,aAAa,EACZC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GACtB,MAAM,GACN;MACH,CACD,CAEH,CACF,CACU,CACC,CAAC;IAEhB;EAAG,CACH,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnC,OAAA,GAEc,IAAAoC,iCAAwB,EAAEnD,YAAa,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_reactNative","_components","_compose","_icons","_button","_dropdown","mergeProps","defaultProps","props","mergedProps","className","clsx","isFunction","maybeFunc","DropdownMenu","children","controls","icon","menu","label","popoverProps","toggleProps","length","controlSets","Array","isArray","mergedPopoverProps","_react","createElement","default","renderToggle","isOpen","onToggle","mergedToggleProps","onClick","event","renderContent","onClose","BottomSheet","hideHeader","isVisible","PanelBody","title","style","paddingLeft","paddingRight","flatMap","controlSet","indexOfSet","map","control","indexOfControl","Cell","key","join","onPress","editable","leftAlign","isSelected","isActive","separatorType","Platform","OS","_default","exports","withPreferredColorScheme"],"sources":["@wordpress/components/src/dropdown-menu/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { Platform } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { BottomSheet, PanelBody } from '@wordpress/components';\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { menu } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\n\nfunction mergeProps( defaultProps = {}, props = {} ) {\n\tconst mergedProps = {\n\t\t...defaultProps,\n\t\t...props,\n\t};\n\n\tif ( props.className && defaultProps.className ) {\n\t\tmergedProps.className = clsx( props.className, defaultProps.className );\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nfunction DropdownMenu( {\n\tchildren,\n\tclassName,\n\tcontrols,\n\ticon = menu,\n\tlabel,\n\tpopoverProps,\n\ttoggleProps,\n} ) {\n\tif ( ! controls?.length && ! isFunction( children ) ) {\n\t\treturn null;\n\t}\n\n\t// Normalize controls to nested array of objects (sets of controls)\n\tlet controlSets;\n\tif ( controls?.length ) {\n\t\tcontrolSets = controls;\n\t\tif ( ! Array.isArray( controlSets[ 0 ] ) ) {\n\t\t\tcontrolSets = [ controlSets ];\n\t\t}\n\t}\n\tconst mergedPopoverProps = mergeProps(\n\t\t{\n\t\t\tclassName: 'components-dropdown-menu__popover',\n\t\t},\n\t\tpopoverProps\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ clsx( 'components-dropdown-menu', className ) }\n\t\t\tpopoverProps={ mergedPopoverProps }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst mergedToggleProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: clsx( 'components-dropdown-menu__toggle', {\n\t\t\t\t\t\t\t'is-opened': isOpen,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\ttoggleProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t{ ...mergedToggleProps }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tonToggle( event );\n\t\t\t\t\t\t\tif ( mergedToggleProps.onClick ) {\n\t\t\t\t\t\t\t\tmergedToggleProps.onClick( event );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ mergedToggleProps.children }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ ( { isOpen, onClose, ...props } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<BottomSheet\n\t\t\t\t\t\thideHeader\n\t\t\t\t\t\tisVisible={ isOpen }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isFunction( children ) ? children( props ) : null }\n\t\t\t\t\t\t<PanelBody\n\t\t\t\t\t\t\ttitle={ label }\n\t\t\t\t\t\t\tstyle={ { paddingLeft: 0, paddingRight: 0 } }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ controlSets?.flatMap(\n\t\t\t\t\t\t\t\t( controlSet, indexOfSet ) =>\n\t\t\t\t\t\t\t\t\tcontrolSet.map(\n\t\t\t\t\t\t\t\t\t\t( control, indexOfControl ) => (\n\t\t\t\t\t\t\t\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ [\n\t\t\t\t\t\t\t\t\t\t\t\t\tindexOfSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindexOfControl,\n\t\t\t\t\t\t\t\t\t\t\t\t].join() }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ control.title }\n\t\t\t\t\t\t\t\t\t\t\t\tonPress={ () => {\n\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\tif ( control.onClick ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrol.onClick();\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\teditable={ false }\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ control.icon }\n\t\t\t\t\t\t\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\t\t\t\t\t\t\tisSelected={ control.isActive }\n\t\t\t\t\t\t\t\t\t\t\t\tseparatorType={\n\t\t\t\t\t\t\t\t\t\t\t\t\tPlatform.OS === 'android'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'none'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'leftMargin'\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) }\n\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t</BottomSheet>\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default withPreferredColorScheme( DropdownMenu );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAIA,SAASO,UAAUA,CAAEC,YAAY,GAAG,CAAC,CAAC,EAAEC,KAAK,GAAG,CAAC,CAAC,EAAG;EACpD,MAAMC,WAAW,GAAG;IACnB,GAAGF,YAAY;IACf,GAAGC;EACJ,CAAC;EAED,IAAKA,KAAK,CAACE,SAAS,IAAIH,YAAY,CAACG,SAAS,EAAG;IAChDD,WAAW,CAACC,SAAS,GAAG,IAAAC,aAAI,EAAEH,KAAK,CAACE,SAAS,EAAEH,YAAY,CAACG,SAAU,CAAC;EACxE;EA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,SAAS;QACTC,UAAU,EAAGR,OAAO,CAACS,QAAU;QAC/BC,aAAa,EACZC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GACtB,MAAM,GACN;MACH,CACD,CAEH,CACF,CACU,CACC,CAAC;IAEhB;EAAG,CACH,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnC,OAAA,GAEc,IAAAoC,iCAAwB,EAAEnD,YAAa,CAAC","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.ExternalLink = void 0;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _i18n = require("@wordpress/i18n");
11
11
  var _element = require("@wordpress/element");
12
12
  /**
@@ -30,7 +30,7 @@ function UnforwardedExternalLink(props, ref) {
30
30
  ...additionalProps
31
31
  } = props;
32
32
  const optimizedRel = [...new Set([...rel.split(' '), 'external', 'noreferrer', 'noopener'].filter(Boolean))].join(' ');
33
- const classes = (0, _classnames.default)('components-external-link', className);
33
+ const classes = (0, _clsx.default)('components-external-link', className);
34
34
  /* Anchor links are perceived as external links.
35
35
  This constant helps check for on page anchor links,
36
36
  to prevent them from being opened in the editor. */
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_element","UnforwardedExternalLink","props","ref","href","children","className","rel","additionalProps","optimizedRel","Set","split","filter","Boolean","join","classes","classnames","isInternalAnchor","startsWith","onClickHandler","event","preventDefault","onClick","_react","createElement","target","__","ExternalLink","exports","forwardRef","_default","default"],"sources":["@wordpress/components/src/external-link/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ExternalLinkProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedExternalLink(\n\tprops: Omit<\n\t\tWordPressComponentProps< ExternalLinkProps, 'a', false >,\n\t\t'target'\n\t>,\n\tref: ForwardedRef< HTMLAnchorElement >\n) {\n\tconst { href, children, className, rel = '', ...additionalProps } = props;\n\tconst optimizedRel = [\n\t\t...new Set(\n\t\t\t[\n\t\t\t\t...rel.split( ' ' ),\n\t\t\t\t'external',\n\t\t\t\t'noreferrer',\n\t\t\t\t'noopener',\n\t\t\t].filter( Boolean )\n\t\t),\n\t].join( ' ' );\n\tconst classes = classnames( 'components-external-link', className );\n\t/* Anchor links are perceived as external links.\n\tThis constant helps check for on page anchor links,\n\tto prevent them from being opened in the editor. */\n\tconst isInternalAnchor = !! href?.startsWith( '#' );\n\n\tconst onClickHandler = (\n\t\tevent: React.MouseEvent< HTMLAnchorElement, MouseEvent >\n\t) => {\n\t\tif ( isInternalAnchor ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tif ( props.onClick ) {\n\t\t\tprops.onClick( event );\n\t\t}\n\t};\n\n\treturn (\n\t\t/* eslint-disable react/jsx-no-target-blank */\n\t\t<a\n\t\t\t{ ...additionalProps }\n\t\t\tclassName={ classes }\n\t\t\thref={ href }\n\t\t\tonClick={ onClickHandler }\n\t\t\ttarget=\"_blank\"\n\t\t\trel={ optimizedRel }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<span className=\"components-external-link__contents\">\n\t\t\t\t{ children }\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tclassName=\"components-external-link__icon\"\n\t\t\t\taria-label={\n\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t&#8599;\n\t\t\t</span>\n\t\t</a>\n\t\t/* eslint-enable react/jsx-no-target-blank */\n\t);\n}\n\n/**\n * Link to an external resource.\n *\n * ```jsx\n * import { ExternalLink } from '@wordpress/components';\n *\n * const MyExternalLink = () => (\n * <ExternalLink href=\"https://wordpress.org\">WordPress.org</ExternalLink>\n * );\n * ```\n */\nexport const ExternalLink = forwardRef( UnforwardedExternalLink );\n\nexport default ExternalLink;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASG,uBAAuBA,CAC/BC,KAGC,EACDC,GAAsC,EACrC;EACD,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,SAAS;IAAEC,GAAG,GAAG,EAAE;IAAE,GAAGC;EAAgB,CAAC,GAAGN,KAAK;EACzE,MAAMO,YAAY,GAAG,CACpB,GAAG,IAAIC,GAAG,CACT,CACC,GAAGH,GAAG,CAACI,KAAK,CAAE,GAAI,CAAC,EACnB,UAAU,EACV,YAAY,EACZ,UAAU,CACV,CAACC,MAAM,CAAEC,OAAQ,CACnB,CAAC,CACD,CAACC,IAAI,CAAE,GAAI,CAAC;EACb,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EAAE,0BAA0B,EAAEV,SAAU,CAAC;EACnE;AACD;AACA;EACC,MAAMW,gBAAgB,GAAG,CAAC,CAAEb,IAAI,EAAEc,UAAU,CAAE,GAAI,CAAC;EAEnD,MAAMC,cAAc,GACnBC,KAAwD,IACpD;IACJ,IAAKH,gBAAgB,EAAG;MACvBG,KAAK,CAACC,cAAc,CAAC,CAAC;IACvB;IAEA,IAAKnB,KAAK,CAACoB,OAAO,EAAG;MACpBpB,KAAK,CAACoB,OAAO,CAAEF,KAAM,CAAC;IACvB;EACD,CAAC;EAED,OACC;IACA,IAAAG,MAAA,CAAAC,aAAA;MAAA,GACMhB,eAAe;MACpBF,SAAS,EAAGS,OAAS;MACrBX,IAAI,EAAGA,IAAM;MACbkB,OAAO,EAAGH,cAAgB;MAC1BM,MAAM,EAAC,QAAQ;MACflB,GAAG,EAAGE,YAAc;MACpBN,GAAG,EAAGA;IAAK,GAEX,IAAAoB,MAAA,CAAAC,aAAA;MAAMlB,SAAS,EAAC;IAAoC,GACjDD,QACG,CAAC,EACP,IAAAkB,MAAA,CAAAC,aAAA;MACClB,SAAS,EAAC,gCAAgC;MAC1C,cACC;MACA,IAAAoB,QAAE,EAAE,sBAAuB;IAC3B,GACD,QAEK,CACJ;IACH;EAAA;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAAE5B,uBAAwB,CAAC;AAAC,IAAA6B,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEnDJ,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","UnforwardedExternalLink","props","ref","href","children","className","rel","additionalProps","optimizedRel","Set","split","filter","Boolean","join","classes","clsx","isInternalAnchor","startsWith","onClickHandler","event","preventDefault","onClick","_react","createElement","target","__","ExternalLink","exports","forwardRef","_default","default"],"sources":["@wordpress/components/src/external-link/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ExternalLinkProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedExternalLink(\n\tprops: Omit<\n\t\tWordPressComponentProps< ExternalLinkProps, 'a', false >,\n\t\t'target'\n\t>,\n\tref: ForwardedRef< HTMLAnchorElement >\n) {\n\tconst { href, children, className, rel = '', ...additionalProps } = props;\n\tconst optimizedRel = [\n\t\t...new Set(\n\t\t\t[\n\t\t\t\t...rel.split( ' ' ),\n\t\t\t\t'external',\n\t\t\t\t'noreferrer',\n\t\t\t\t'noopener',\n\t\t\t].filter( Boolean )\n\t\t),\n\t].join( ' ' );\n\tconst classes = clsx( 'components-external-link', className );\n\t/* Anchor links are perceived as external links.\n\tThis constant helps check for on page anchor links,\n\tto prevent them from being opened in the editor. */\n\tconst isInternalAnchor = !! href?.startsWith( '#' );\n\n\tconst onClickHandler = (\n\t\tevent: React.MouseEvent< HTMLAnchorElement, MouseEvent >\n\t) => {\n\t\tif ( isInternalAnchor ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tif ( props.onClick ) {\n\t\t\tprops.onClick( event );\n\t\t}\n\t};\n\n\treturn (\n\t\t/* eslint-disable react/jsx-no-target-blank */\n\t\t<a\n\t\t\t{ ...additionalProps }\n\t\t\tclassName={ classes }\n\t\t\thref={ href }\n\t\t\tonClick={ onClickHandler }\n\t\t\ttarget=\"_blank\"\n\t\t\trel={ optimizedRel }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<span className=\"components-external-link__contents\">\n\t\t\t\t{ children }\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tclassName=\"components-external-link__icon\"\n\t\t\t\taria-label={\n\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t&#8599;\n\t\t\t</span>\n\t\t</a>\n\t\t/* eslint-enable react/jsx-no-target-blank */\n\t);\n}\n\n/**\n * Link to an external resource.\n *\n * ```jsx\n * import { ExternalLink } from '@wordpress/components';\n *\n * const MyExternalLink = () => (\n * <ExternalLink href=\"https://wordpress.org\">WordPress.org</ExternalLink>\n * );\n * ```\n */\nexport const ExternalLink = forwardRef( UnforwardedExternalLink );\n\nexport default ExternalLink;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASG,uBAA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;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAAE5B,uBAAwB,CAAC;AAAC,IAAA6B,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEnDJ,YAAY","ignoreList":[]}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = FocalPoint;
8
8
  var _react = require("react");
9
9
  var _focalPointStyle = require("./styles/focal-point-style");
10
- var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
@@ -21,7 +21,7 @@ function FocalPoint({
21
21
  top = '50%',
22
22
  ...props
23
23
  }) {
24
- const classes = (0, _classnames.default)('components-focal-point-picker__icon_container');
24
+ const classes = (0, _clsx.default)('components-focal-point-picker__icon_container');
25
25
  const style = {
26
26
  left,
27
27
  top
@@ -1 +1 @@
1
- {"version":3,"names":["_focalPointStyle","require","_classnames","_interopRequireDefault","FocalPoint","left","top","props","classes","classnames","style","_react","createElement","PointerCircle","className"],"sources":["@wordpress/components/src/focal-point-picker/focal-point.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { PointerCircle } from './styles/focal-point-style';\n\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { FocalPointProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport default function FocalPoint( {\n\tleft = '50%',\n\ttop = '50%',\n\t...props\n}: WordPressComponentProps< FocalPointProps, 'div' > ) {\n\tconst classes = classnames(\n\t\t'components-focal-point-picker__icon_container'\n\t);\n\n\tconst style = { left, top };\n\n\treturn <PointerCircle { ...props } className={ classes } style={ style } />;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,gBAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAKe,SAASG,UAAUA,CAAE;EACnCC,IAAI,GAAG,KAAK;EACZC,GAAG,GAAG,KAAK;EACX,GAAGC;AAC+C,CAAC,EAAG;EACtD,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EACzB,+CACD,CAAC;EAED,MAAMC,KAAK,GAAG;IAAEL,IAAI;IAAEC;EAAI,CAAC;EAE3B,OAAO,IAAAK,MAAA,CAAAC,aAAA,EAACZ,gBAAA,CAAAa,aAAa;IAAA,GAAMN,KAAK;IAAGO,SAAS,EAAGN,OAAS;IAACE,KAAK,EAAGA;EAAO,CAAE,CAAC;AAC5E","ignoreList":[]}
1
+ {"version":3,"names":["_focalPointStyle","require","_clsx","_interopRequireDefault","FocalPoint","left","top","props","classes","clsx","style","_react","createElement","PointerCircle","className"],"sources":["@wordpress/components/src/focal-point-picker/focal-point.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { PointerCircle } from './styles/focal-point-style';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { FocalPointProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport default function FocalPoint( {\n\tleft = '50%',\n\ttop = '50%',\n\t...props\n}: WordPressComponentProps< FocalPointProps, 'div' > ) {\n\tconst classes = clsx( 'components-focal-point-picker__icon_container' );\n\n\tconst style = { left, top };\n\n\treturn <PointerCircle { ...props } className={ classes } style={ style } />;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,gBAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAKe,SAASG,UAAUA,CAAE;EACnCC,IAAI,GAAG,KAAK;EACZC,GAAG,GAAG,KAAK;EACX,GAAGC;AAC+C,CAAC,EAAG;EACtD,MAAMC,OAAO,GAAG,IAAAC,aAAI,EAAE,+CAAgD,CAAC;EAEvE,MAAMC,KAAK,GAAG;IAAEL,IAAI;IAAEC;EAAI,CAAC;EAE3B,OAAO,IAAAK,MAAA,CAAAC,aAAA,EAACZ,gBAAA,CAAAa,aAAa;IAAA,GAAMN,KAAK;IAAGO,SAAS,EAAGN,OAAS;IAACE,KAAK,EAAGA;EAAO,CAAE,CAAC;AAC5E","ignoreList":[]}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.FocalPointPicker = FocalPointPicker;
8
8
  exports.default = void 0;
9
9
  var _react = require("react");
10
- var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
11
  var _i18n = require("@wordpress/i18n");
12
12
  var _element = require("@wordpress/element");
13
13
  var _compose = require("@wordpress/compose");
@@ -232,7 +232,7 @@ function FocalPointPicker({
232
232
  left: x !== undefined ? x * bounds.width : 0.5 * bounds.width,
233
233
  top: y !== undefined ? y * bounds.height : 0.5 * bounds.height
234
234
  };
235
- const classes = (0, _classnames.default)('components-focal-point-picker-control', className);
235
+ const classes = (0, _clsx.default)('components-focal-point-picker-control', className);
236
236
  const instanceId = (0, _compose.useInstanceId)(FocalPointPicker);
237
237
  const id = `inspector-focal-point-picker-control-${instanceId}`;
238
238
  (0, _hooks.useUpdateEffect)(() => {
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_element","_compose","_baseControl","_controls","_focalPoint","_grid","_media","_focalPointPickerStyle","_utils","_hooks","GRID_OVERLAY_TIMEOUT","FocalPointPicker","__nextHasNoMarginBottom","__next40pxDefaultSize","autoPlay","className","help","label","onChange","onDrag","onDragEnd","onDragStart","resolvePoint","url","value","valueProp","x","y","restProps","point","setPoint","useState","showGridOverlay","setShowGridOverlay","startDrag","endDrag","isDragging","useDragging","event","dragAreaRef","current","focus","getValueWithinDragArea","onDragMove","preventDefault","useRef","bounds","setBounds","INITIAL_BOUNDS","refUpdateBounds","clientWidth","width","clientHeight","height","useEffect","updateBounds","defaultView","ownerDocument","addEventListener","removeEventListener","useIsomorphicLayoutEffect","clientX","clientY","shiftKey","top","left","getBoundingClientRect","nextX","nextY","Math","round","getFinalValue","_resolvePoint","resolvedValue","max","min","roundToTwoDecimalPlaces","n","arrowKeyStep","code","includes","step","delta","axis","focalPointPosition","undefined","classes","classnames","instanceId","useInstanceId","id","useUpdateEffect","timeout","window","setTimeout","clearTimeout","_react","createElement","default","MediaWrapper","MediaContainer","onKeyDown","onMouseDown","onBlur","ref","role","tabIndex","showOverlay","alt","__","onLoad","src","hasHelpText","_default","exports"],"sources":["@wordpress/components/src/focal-point-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport {\n\t__experimentalUseDragging as useDragging,\n\tuseInstanceId,\n\tuseIsomorphicLayoutEffect,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport Controls from './controls';\nimport FocalPoint from './focal-point';\nimport Grid from './grid';\nimport Media from './media';\nimport {\n\tMediaWrapper,\n\tMediaContainer,\n} from './styles/focal-point-picker-style';\nimport { INITIAL_BOUNDS } from './utils';\nimport { useUpdateEffect } from '../utils/hooks';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type {\n\tFocalPoint as FocalPointType,\n\tFocalPointPickerProps,\n} from './types';\nimport type { KeyboardEventHandler } from 'react';\n\nconst GRID_OVERLAY_TIMEOUT = 600;\n\n/**\n * Focal Point Picker is a component which creates a UI for identifying the most important visual point of an image.\n *\n * This component addresses a specific problem: with large background images it is common to see undesirable crops,\n * especially when viewing on smaller viewports such as mobile phones. This component allows the selection of\n * the point with the most important visual information and returns it as a pair of numbers between 0 and 1.\n * This value can be easily converted into the CSS `background-position` attribute, and will ensure that the\n * focal point is never cropped out, regardless of viewport.\n *\n * - Example focal point picker value: `{ x: 0.5, y: 0.1 }`\n * - Corresponding CSS: `background-position: 50% 10%;`\n *\n * ```jsx\n * import { FocalPointPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ focalPoint, setFocalPoint ] = useState( {\n * \t\tx: 0.5,\n * \t\ty: 0.5,\n * \t} );\n *\n * \tconst url = '/path/to/image';\n *\n * \t// Example function to render the CSS styles based on Focal Point Picker value\n * \tconst style = {\n * \t\tbackgroundImage: `url(${ url })`,\n * \t\tbackgroundPosition: `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%`,\n * \t};\n *\n * \treturn (\n * \t\t<>\n * \t\t\t<FocalPointPicker\n * \t\t\t\turl={ url }\n * \t\t\t\tvalue={ focalPoint }\n * \t\t\t\tonDragStart={ setFocalPoint }\n * \t\t\t\tonDrag={ setFocalPoint }\n * \t\t\t\tonChange={ setFocalPoint }\n * \t\t\t/>\n * \t\t\t<div style={ style } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nexport function FocalPointPicker( {\n\t__nextHasNoMarginBottom,\n\t__next40pxDefaultSize = false,\n\tautoPlay = true,\n\tclassName,\n\thelp,\n\tlabel,\n\tonChange,\n\tonDrag,\n\tonDragEnd,\n\tonDragStart,\n\tresolvePoint,\n\turl,\n\tvalue: valueProp = {\n\t\tx: 0.5,\n\t\ty: 0.5,\n\t},\n\t...restProps\n}: WordPressComponentProps< FocalPointPickerProps, 'div', false > ) {\n\tconst [ point, setPoint ] = useState( valueProp );\n\tconst [ showGridOverlay, setShowGridOverlay ] = useState( false );\n\n\tconst { startDrag, endDrag, isDragging } = useDragging( {\n\t\tonDragStart: ( event ) => {\n\t\t\tdragAreaRef.current?.focus();\n\t\t\tconst value = getValueWithinDragArea( event );\n\n\t\t\t// `value` can technically be undefined if getValueWithinDragArea() is\n\t\t\t// called before dragAreaRef is set, but this shouldn't happen in reality.\n\t\t\tif ( ! value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonDragStart?.( value, event );\n\t\t\tsetPoint( value );\n\t\t},\n\t\tonDragMove: ( event ) => {\n\t\t\t// Prevents text-selection when dragging.\n\t\t\tevent.preventDefault();\n\t\t\tconst value = getValueWithinDragArea( event );\n\t\t\tif ( ! value ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonDrag?.( value, event );\n\t\t\tsetPoint( value );\n\t\t},\n\t\tonDragEnd: () => {\n\t\t\tonDragEnd?.();\n\t\t\tonChange?.( point );\n\t\t},\n\t} );\n\n\t// Uses the internal point while dragging or else the value from props.\n\tconst { x, y } = isDragging ? point : valueProp;\n\n\tconst dragAreaRef = useRef< HTMLDivElement >( null );\n\tconst [ bounds, setBounds ] = useState( INITIAL_BOUNDS );\n\tconst refUpdateBounds = useRef( () => {\n\t\tif ( ! dragAreaRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { clientWidth: width, clientHeight: height } =\n\t\t\tdragAreaRef.current;\n\t\t// Falls back to initial bounds if the ref has no size. Since styles\n\t\t// give the drag area dimensions even when the media has not loaded\n\t\t// this should only happen in unit tests (jsdom).\n\t\tsetBounds(\n\t\t\twidth > 0 && height > 0 ? { width, height } : { ...INITIAL_BOUNDS }\n\t\t);\n\t} );\n\n\tuseEffect( () => {\n\t\tconst updateBounds = refUpdateBounds.current;\n\t\tif ( ! dragAreaRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { defaultView } = dragAreaRef.current.ownerDocument;\n\t\tdefaultView?.addEventListener( 'resize', updateBounds );\n\t\treturn () => defaultView?.removeEventListener( 'resize', updateBounds );\n\t}, [] );\n\n\t// Updates the bounds to cover cases of unspecified media or load failures.\n\tuseIsomorphicLayoutEffect( () => void refUpdateBounds.current(), [] );\n\n\t// TODO: Consider refactoring getValueWithinDragArea() into a pure function.\n\t// https://github.com/WordPress/gutenberg/pull/43872#discussion_r963455173\n\tconst getValueWithinDragArea = ( {\n\t\tclientX,\n\t\tclientY,\n\t\tshiftKey,\n\t}: {\n\t\tclientX: number;\n\t\tclientY: number;\n\t\tshiftKey: boolean;\n\t} ) => {\n\t\tif ( ! dragAreaRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { top, left } = dragAreaRef.current.getBoundingClientRect();\n\t\tlet nextX = ( clientX - left ) / bounds.width;\n\t\tlet nextY = ( clientY - top ) / bounds.height;\n\t\t// Enables holding shift to jump values by 10%.\n\t\tif ( shiftKey ) {\n\t\t\tnextX = Math.round( nextX / 0.1 ) * 0.1;\n\t\t\tnextY = Math.round( nextY / 0.1 ) * 0.1;\n\t\t}\n\t\treturn getFinalValue( { x: nextX, y: nextY } );\n\t};\n\n\tconst getFinalValue = ( value: FocalPointType ): FocalPointType => {\n\t\tconst resolvedValue = resolvePoint?.( value ) ?? value;\n\t\tresolvedValue.x = Math.max( 0, Math.min( resolvedValue.x, 1 ) );\n\t\tresolvedValue.y = Math.max( 0, Math.min( resolvedValue.y, 1 ) );\n\t\tconst roundToTwoDecimalPlaces = ( n: number ) =>\n\t\t\tMath.round( n * 1e2 ) / 1e2;\n\n\t\treturn {\n\t\t\tx: roundToTwoDecimalPlaces( resolvedValue.x ),\n\t\t\ty: roundToTwoDecimalPlaces( resolvedValue.y ),\n\t\t};\n\t};\n\n\tconst arrowKeyStep: KeyboardEventHandler< HTMLDivElement > = ( event ) => {\n\t\tconst { code, shiftKey } = event;\n\t\tif (\n\t\t\t! [ 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight' ].includes(\n\t\t\t\tcode\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tconst value = { x, y };\n\t\tconst step = shiftKey ? 0.1 : 0.01;\n\t\tconst delta =\n\t\t\tcode === 'ArrowUp' || code === 'ArrowLeft' ? -1 * step : step;\n\t\tconst axis = code === 'ArrowUp' || code === 'ArrowDown' ? 'y' : 'x';\n\t\tvalue[ axis ] = value[ axis ] + delta;\n\t\tonChange?.( getFinalValue( value ) );\n\t};\n\n\tconst focalPointPosition = {\n\t\tleft: x !== undefined ? x * bounds.width : 0.5 * bounds.width,\n\t\ttop: y !== undefined ? y * bounds.height : 0.5 * bounds.height,\n\t};\n\n\tconst classes = classnames(\n\t\t'components-focal-point-picker-control',\n\t\tclassName\n\t);\n\n\tconst instanceId = useInstanceId( FocalPointPicker );\n\tconst id = `inspector-focal-point-picker-control-${ instanceId }`;\n\n\tuseUpdateEffect( () => {\n\t\tsetShowGridOverlay( true );\n\t\tconst timeout = window.setTimeout( () => {\n\t\t\tsetShowGridOverlay( false );\n\t\t}, GRID_OVERLAY_TIMEOUT );\n\n\t\treturn () => window.clearTimeout( timeout );\n\t}, [ x, y ] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t{ ...restProps }\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ label }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ classes }\n\t\t>\n\t\t\t<MediaWrapper className=\"components-focal-point-picker-wrapper\">\n\t\t\t\t<MediaContainer\n\t\t\t\t\tclassName=\"components-focal-point-picker\"\n\t\t\t\t\tonKeyDown={ arrowKeyStep }\n\t\t\t\t\tonMouseDown={ startDrag }\n\t\t\t\t\tonBlur={ () => {\n\t\t\t\t\t\tif ( isDragging ) {\n\t\t\t\t\t\t\tendDrag();\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tref={ dragAreaRef }\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t>\n\t\t\t\t\t<Grid bounds={ bounds } showOverlay={ showGridOverlay } />\n\t\t\t\t\t<Media\n\t\t\t\t\t\talt={ __( 'Media preview' ) }\n\t\t\t\t\t\tautoPlay={ autoPlay }\n\t\t\t\t\t\tonLoad={ refUpdateBounds.current }\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t/>\n\t\t\t\t\t<FocalPoint\n\t\t\t\t\t\t{ ...focalPointPosition }\n\t\t\t\t\t\tisDragging={ isDragging }\n\t\t\t\t\t/>\n\t\t\t\t</MediaContainer>\n\t\t\t</MediaWrapper>\n\t\t\t<Controls\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\thasHelpText={ !! help }\n\t\t\t\tpoint={ { x, y } }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tonChange?.( getFinalValue( value ) );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\nexport default FocalPointPicker;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AASA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,KAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,MAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AAIA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AA7BA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAmBA,MAAMY,oBAAoB,GAAG,GAAG;;AAEhC;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;AACO,SAASC,gBAAgBA,CAAE;EACjCC,uBAAuB;EACvBC,qBAAqB,GAAG,KAAK;EAC7BC,QAAQ,GAAG,IAAI;EACfC,SAAS;EACTC,IAAI;EACJC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNC,SAAS;EACTC,WAAW;EACXC,YAAY;EAC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IAAA,GACLd,kBAAkB;IACvBhD,UAAU,EAAGA;EAAY,CACzB,CACc,CACH,CAAC,EACf,IAAA4D,MAAA,CAAAC,aAAA,EAAC9F,SAAA,CAAA+F,OAAQ;IACRtF,uBAAuB,EAAGA,uBAAyB;IACnDC,qBAAqB,EAAGA,qBAAuB;IAC/CmG,WAAW,EAAG,CAAC,CAAEhG,IAAM;IACvBa,KAAK,EAAG;MAAEH,CAAC;MAAEC;IAAE,CAAG;IAClBT,QAAQ,EAAKM,KAAK,IAAM;MACvBN,QAAQ,GAAIqD,aAAa,CAAE/C,KAAM,CAAE,CAAC;IACrC;EAAG,CACH,CACW,CAAC;AAEhB;AAAC,IAAAyF,QAAA,GAAAC,OAAA,CAAAhB,OAAA,GAEcvF,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_compose","_baseControl","_controls","_focalPoint","_grid","_media","_focalPointPickerStyle","_utils","_hooks","GRID_OVERLAY_TIMEOUT","FocalPointPicker","__nextHasNoMarginBottom","__next40pxDefaultSize","autoPlay","className","help","label","onChange","onDrag","onDragEnd","onDragStart","resolvePoint","url","value","valueProp","x","y","restProps","point","setPoint","useState","showGridOverlay","setShowGridOverlay","startDrag","endDrag","isDragging","useDragging","event","dragAreaRef","current","focus","getValueWithinDragArea","onDragMove","preventDefault","useRef","bounds","setBounds","INITIAL_BOUNDS","refUpdateBounds","clientWidth","width","clientHeight","height","useEffect","updateBounds","defaultView","ownerDocument","addEventListener","removeEventListener","useIsomorphicLayoutEffect","clientX","clientY","shiftKey","top","left","getBoundingClientRect","nextX","nextY","Math","round","getFinalValue","_resolvePoint","resolvedValue","max","min","roundToTwoDecimalPlaces","n","arrowKeyStep","code","includes","step","delta","axis","focalPointPosition","undefined","classes","clsx","instanceId","useInstanceId","id","useUpdateEffect","timeout","window","setTimeout","clearTimeout","_react","createElement","default","MediaWrapper","MediaContainer","onKeyDown","onMouseDown","onBlur","ref","role","tabIndex","showOverlay","alt","__","onLoad","src","hasHelpText","_default","exports"],"sources":["@wordpress/components/src/focal-point-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport {\n\t__experimentalUseDragging as useDragging,\n\tuseInstanceId,\n\tuseIsomorphicLayoutEffect,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport Controls from './controls';\nimport FocalPoint from './focal-point';\nimport Grid from './grid';\nimport Media from './media';\nimport {\n\tMediaWrapper,\n\tMediaContainer,\n} from './styles/focal-point-picker-style';\nimport { INITIAL_BOUNDS } from './utils';\nimport { useUpdateEffect } from '../utils/hooks';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type {\n\tFocalPoint as FocalPointType,\n\tFocalPointPickerProps,\n} from './types';\nimport type { KeyboardEventHandler } from 'react';\n\nconst GRID_OVERLAY_TIMEOUT = 600;\n\n/**\n * Focal Point Picker is a component which creates a UI for identifying the most important visual point of an image.\n *\n * This component addresses a specific problem: with large background images it is common to see undesirable crops,\n * especially when viewing on smaller viewports such as mobile phones. This component allows the selection of\n * the point with the most important visual information and returns it as a pair of numbers between 0 and 1.\n * This value can be easily converted into the CSS `background-position` attribute, and will ensure that the\n * focal point is never cropped out, regardless of viewport.\n *\n * - Example focal point picker value: `{ x: 0.5, y: 0.1 }`\n * - Corresponding CSS: `background-position: 50% 10%;`\n *\n * ```jsx\n * import { FocalPointPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ focalPoint, setFocalPoint ] = useState( {\n * \t\tx: 0.5,\n * \t\ty: 0.5,\n * \t} );\n *\n * \tconst url = '/path/to/image';\n *\n * \t// Example function to render the CSS styles based on Focal Point Picker value\n * \tconst style = {\n * \t\tbackgroundImage: `url(${ url })`,\n * \t\tbackgroundPosition: `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%`,\n * \t};\n *\n * \treturn (\n * \t\t<>\n * \t\t\t<FocalPointPicker\n * \t\t\t\turl={ url }\n * \t\t\t\tvalue={ focalPoint }\n * \t\t\t\tonDragStart={ setFocalPoint }\n * \t\t\t\tonDrag={ setFocalPoint }\n * \t\t\t\tonChange={ setFocalPoint }\n * \t\t\t/>\n * \t\t\t<div style={ style } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nexport function FocalPointPicker( {\n\t__nextHasNoMarginBottom,\n\t__next40pxDefaultSize = false,\n\tautoPlay = true,\n\tclassName,\n\thelp,\n\tlabel,\n\tonChange,\n\tonDrag,\n\tonDragEnd,\n\tonDragStart,\n\tresolvePoint,\n\turl,\n\tvalue: valueProp = {\n\t\tx: 0.5,\n\t\ty: 0.5,\n\t},\n\t...restProps\n}: WordPressComponentProps< FocalPointPickerProps, 'div', false > ) {\n\tconst [ point, setPoint ] = useState( valueProp );\n\tconst [ showGridOverlay, setShowGridOverlay ] = useState( false );\n\n\tconst { startDrag, endDrag, isDragging } = useDragging( {\n\t\tonDragStart: ( event ) => {\n\t\t\tdragAreaRef.current?.focus();\n\t\t\tconst value = getValueWithinDragArea( event );\n\n\t\t\t// `value` can technically be undefined if getValueWithinDragArea() is\n\t\t\t// called before dragAreaRef is set, but this shouldn't happen in reality.\n\t\t\tif ( ! value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonDragStart?.( value, event );\n\t\t\tsetPoint( value );\n\t\t},\n\t\tonDragMove: ( event ) => {\n\t\t\t// Prevents text-selection when dragging.\n\t\t\tevent.preventDefault();\n\t\t\tconst value = getValueWithinDragArea( event );\n\t\t\tif ( ! value ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonDrag?.( value, event );\n\t\t\tsetPoint( value );\n\t\t},\n\t\tonDragEnd: () => {\n\t\t\tonDragEnd?.();\n\t\t\tonChange?.( point );\n\t\t},\n\t} );\n\n\t// Uses the internal point while dragging or else the value from props.\n\tconst { x, y } = isDragging ? point : valueProp;\n\n\tconst dragAreaRef = useRef< HTMLDivElement >( null );\n\tconst [ bounds, setBounds ] = useState( INITIAL_BOUNDS );\n\tconst refUpdateBounds = useRef( () => {\n\t\tif ( ! dragAreaRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { clientWidth: width, clientHeight: height } =\n\t\t\tdragAreaRef.current;\n\t\t// Falls back to initial bounds if the ref has no size. Since styles\n\t\t// give the drag area dimensions even when the media has not loaded\n\t\t// this should only happen in unit tests (jsdom).\n\t\tsetBounds(\n\t\t\twidth > 0 && height > 0 ? { width, height } : { ...INITIAL_BOUNDS }\n\t\t);\n\t} );\n\n\tuseEffect( () => {\n\t\tconst updateBounds = refUpdateBounds.current;\n\t\tif ( ! dragAreaRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { defaultView } = dragAreaRef.current.ownerDocument;\n\t\tdefaultView?.addEventListener( 'resize', updateBounds );\n\t\treturn () => defaultView?.removeEventListener( 'resize', updateBounds );\n\t}, [] );\n\n\t// Updates the bounds to cover cases of unspecified media or load failures.\n\tuseIsomorphicLayoutEffect( () => void refUpdateBounds.current(), [] );\n\n\t// TODO: Consider refactoring getValueWithinDragArea() into a pure function.\n\t// https://github.com/WordPress/gutenberg/pull/43872#discussion_r963455173\n\tconst getValueWithinDragArea = ( {\n\t\tclientX,\n\t\tclientY,\n\t\tshiftKey,\n\t}: {\n\t\tclientX: number;\n\t\tclientY: number;\n\t\tshiftKey: boolean;\n\t} ) => {\n\t\tif ( ! dragAreaRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { top, left } = dragAreaRef.current.getBoundingClientRect();\n\t\tlet nextX = ( clientX - left ) / bounds.width;\n\t\tlet nextY = ( clientY - top ) / bounds.height;\n\t\t// Enables holding shift to jump values by 10%.\n\t\tif ( shiftKey ) {\n\t\t\tnextX = Math.round( nextX / 0.1 ) * 0.1;\n\t\t\tnextY = Math.round( nextY / 0.1 ) * 0.1;\n\t\t}\n\t\treturn getFinalValue( { x: nextX, y: nextY } );\n\t};\n\n\tconst getFinalValue = ( value: FocalPointType ): FocalPointType => {\n\t\tconst resolvedValue = resolvePoint?.( value ) ?? value;\n\t\tresolvedValue.x = Math.max( 0, Math.min( resolvedValue.x, 1 ) );\n\t\tresolvedValue.y = Math.max( 0, Math.min( resolvedValue.y, 1 ) );\n\t\tconst roundToTwoDecimalPlaces = ( n: number ) =>\n\t\t\tMath.round( n * 1e2 ) / 1e2;\n\n\t\treturn {\n\t\t\tx: roundToTwoDecimalPlaces( resolvedValue.x ),\n\t\t\ty: roundToTwoDecimalPlaces( resolvedValue.y ),\n\t\t};\n\t};\n\n\tconst arrowKeyStep: KeyboardEventHandler< HTMLDivElement > = ( event ) => {\n\t\tconst { code, shiftKey } = event;\n\t\tif (\n\t\t\t! [ 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight' ].includes(\n\t\t\t\tcode\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tconst value = { x, y };\n\t\tconst step = shiftKey ? 0.1 : 0.01;\n\t\tconst delta =\n\t\t\tcode === 'ArrowUp' || code === 'ArrowLeft' ? -1 * step : step;\n\t\tconst axis = code === 'ArrowUp' || code === 'ArrowDown' ? 'y' : 'x';\n\t\tvalue[ axis ] = value[ axis ] + delta;\n\t\tonChange?.( getFinalValue( value ) );\n\t};\n\n\tconst focalPointPosition = {\n\t\tleft: x !== undefined ? x * bounds.width : 0.5 * bounds.width,\n\t\ttop: y !== undefined ? y * bounds.height : 0.5 * bounds.height,\n\t};\n\n\tconst classes = clsx( 'components-focal-point-picker-control', className );\n\n\tconst instanceId = useInstanceId( FocalPointPicker );\n\tconst id = `inspector-focal-point-picker-control-${ instanceId }`;\n\n\tuseUpdateEffect( () => {\n\t\tsetShowGridOverlay( true );\n\t\tconst timeout = window.setTimeout( () => {\n\t\t\tsetShowGridOverlay( false );\n\t\t}, GRID_OVERLAY_TIMEOUT );\n\n\t\treturn () => window.clearTimeout( timeout );\n\t}, [ x, y ] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t{ ...restProps }\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ label }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ classes }\n\t\t>\n\t\t\t<MediaWrapper className=\"components-focal-point-picker-wrapper\">\n\t\t\t\t<MediaContainer\n\t\t\t\t\tclassName=\"components-focal-point-picker\"\n\t\t\t\t\tonKeyDown={ arrowKeyStep }\n\t\t\t\t\tonMouseDown={ startDrag }\n\t\t\t\t\tonBlur={ () => {\n\t\t\t\t\t\tif ( isDragging ) {\n\t\t\t\t\t\t\tendDrag();\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tref={ dragAreaRef }\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t>\n\t\t\t\t\t<Grid bounds={ bounds } showOverlay={ showGridOverlay } />\n\t\t\t\t\t<Media\n\t\t\t\t\t\talt={ __( 'Media preview' ) }\n\t\t\t\t\t\tautoPlay={ autoPlay }\n\t\t\t\t\t\tonLoad={ refUpdateBounds.current }\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t/>\n\t\t\t\t\t<FocalPoint\n\t\t\t\t\t\t{ ...focalPointPosition }\n\t\t\t\t\t\tisDragging={ isDragging }\n\t\t\t\t\t/>\n\t\t\t\t</MediaContainer>\n\t\t\t</MediaWrapper>\n\t\t\t<Controls\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\thasHelpText={ !! help }\n\t\t\t\tpoint={ { x, y } }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tonChange?.( getFinalValue( value ) );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\nexport default FocalPointPicker;\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vBa,KAAK,EAAG;MAAEH,CAAC;MAAEC;IAAE,CAAG;IAClBT,QAAQ,EAAKM,KAAK,IAAM;MACvBN,QAAQ,GAAIqD,aAAa,CAAE/C,KAAM,CAAE,CAAC;IACrC;EAAG,CACH,CACW,CAAC;AAEhB;AAAC,IAAAyF,QAAA,GAAAC,OAAA,CAAAhB,OAAA,GAEcvF,gBAAgB","ignoreList":[]}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.FormToggle = FormToggle;
8
8
  exports.noop = exports.default = void 0;
9
9
  var _react = require("react");
10
- var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
11
  var _element = require("@wordpress/element");
12
12
  /**
13
13
  * External dependencies
@@ -52,7 +52,7 @@ function FormToggle(props, ref) {
52
52
  onChange = noop,
53
53
  ...additionalProps
54
54
  } = props;
55
- const wrapperClasses = (0, _classnames.default)('components-form-toggle', className, {
55
+ const wrapperClasses = (0, _clsx.default)('components-form-toggle', className, {
56
56
  'is-checked': checked,
57
57
  'is-disabled': disabled
58
58
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","noop","exports","FormToggle","props","ref","className","checked","id","disabled","onChange","additionalProps","wrapperClasses","classnames","_react","createElement","type","_default","default","forwardRef"],"sources":["@wordpress/components/src/form-toggle/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 { FormToggleProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport const noop = () => {};\n\n/**\n * FormToggle switches a single setting on or off.\n *\n * ```jsx\n * import { FormToggle } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyFormToggle = () => {\n * const [ isChecked, setChecked ] = useState( true );\n *\n * return (\n * <FormToggle\n * checked={ isChecked }\n * onChange={ () => setChecked( ( state ) => ! state ) }\n * />\n * );\n * };\n * ```\n */\nexport function FormToggle(\n\tprops: WordPressComponentProps< FormToggleProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\tclassName,\n\t\tchecked,\n\t\tid,\n\t\tdisabled,\n\t\tonChange = noop,\n\t\t...additionalProps\n\t} = props;\n\tconst wrapperClasses = classnames( 'components-form-toggle', className, {\n\t\t'is-checked': checked,\n\t\t'is-disabled': disabled,\n\t} );\n\n\treturn (\n\t\t<span className={ wrapperClasses }>\n\t\t\t<input\n\t\t\t\tclassName=\"components-form-toggle__input\"\n\t\t\t\tid={ id }\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tchecked={ checked }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\t{ ...additionalProps }\n\t\t\t\tref={ ref }\n\t\t\t/>\n\t\t\t<span className=\"components-form-toggle__track\"></span>\n\t\t\t<span className=\"components-form-toggle__thumb\"></span>\n\t\t</span>\n\t);\n}\n\nexport default forwardRef( FormToggle );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;;AAIO,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAlBAC,OAAA,CAAAD,IAAA,GAAAA,IAAA;AAmBO,SAASE,UAAUA,CACzBC,KAAiE,EACjEC,GAAqC,EACpC;EACD,MAAM;IACLC,SAAS;IACTC,OAAO;IACPC,EAAE;IACFC,QAAQ;IACRC,QAAQ,GAAGT,IAAI;IACf,GAAGU;EACJ,CAAC,GAAGP,KAAK;EACT,MAAMQ,cAAc,GAAG,IAAAC,mBAAU,EAAE,wBAAwB,EAAEP,SAAS,EAAE;IACvE,YAAY,EAAEC,OAAO;IACrB,aAAa,EAAEE;EAChB,CAAE,CAAC;EAEH,OACC,IAAAK,MAAA,CAAAC,aAAA;IAAMT,SAAS,EAAGM;EAAgB,GACjC,IAAAE,MAAA,CAAAC,aAAA;IACCT,SAAS,EAAC,+BAA+B;IACzCE,EAAE,EAAGA,EAAI;IACTQ,IAAI,EAAC,UAAU;IACfT,OAAO,EAAGA,OAAS;IACnBG,QAAQ,EAAGA,QAAU;IACrBD,QAAQ,EAAGA,QAAU;IAAA,GAChBE,eAAe;IACpBN,GAAG,EAAGA;EAAK,CACX,CAAC,EACF,IAAAS,MAAA,CAAAC,aAAA;IAAMT,SAAS,EAAC;EAA+B,CAAO,CAAC,EACvD,IAAAQ,MAAA,CAAAC,aAAA;IAAMT,SAAS,EAAC;EAA+B,CAAO,CACjD,CAAC;AAET;AAAC,IAAAW,QAAA,GAAAf,OAAA,CAAAgB,OAAA,GAEc,IAAAC,mBAAU,EAAEhB,UAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","noop","exports","FormToggle","props","ref","className","checked","id","disabled","onChange","additionalProps","wrapperClasses","clsx","_react","createElement","type","_default","default","forwardRef"],"sources":["@wordpress/components/src/form-toggle/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 { FormToggleProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport const noop = () => {};\n\n/**\n * FormToggle switches a single setting on or off.\n *\n * ```jsx\n * import { FormToggle } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyFormToggle = () => {\n * const [ isChecked, setChecked ] = useState( true );\n *\n * return (\n * <FormToggle\n * checked={ isChecked }\n * onChange={ () => setChecked( ( state ) => ! state ) }\n * />\n * );\n * };\n * ```\n */\nexport function FormToggle(\n\tprops: WordPressComponentProps< FormToggleProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\tclassName,\n\t\tchecked,\n\t\tid,\n\t\tdisabled,\n\t\tonChange = noop,\n\t\t...additionalProps\n\t} = props;\n\tconst wrapperClasses = clsx( 'components-form-toggle', className, {\n\t\t'is-checked': checked,\n\t\t'is-disabled': disabled,\n\t} );\n\n\treturn (\n\t\t<span className={ wrapperClasses }>\n\t\t\t<input\n\t\t\t\tclassName=\"components-form-toggle__input\"\n\t\t\t\tid={ id }\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tchecked={ checked }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\t{ ...additionalProps }\n\t\t\t\tref={ ref }\n\t\t\t/>\n\t\t\t<span className=\"components-form-toggle__track\"></span>\n\t\t\t<span className=\"components-form-toggle__thumb\"></span>\n\t\t</span>\n\t);\n}\n\nexport default forwardRef( FormToggle );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;;AAIO,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAlBAC,OAAA,CAAAD,IAAA,GAAAA,IAAA;AAmBO,SAASE,UAAUA,CACzBC,KAAiE,EACjEC,GAAqC,EACpC;EACD,MAAM;IACLC,SAAS;IACTC,OAAO;IACPC,EAAE;IACFC,QAAQ;IACRC,QAAQ,GAAGT,IAAI;IACf,GAAGU;EACJ,CAAC,GAAGP,KAAK;EACT,MAAMQ,cAAc,GAAG,IAAAC,aAAI,EAAE,wBAAwB,EAAEP,SAAS,EAAE;IACjE,YAAY,EAAEC,OAAO;IACrB,aAAa,EAAEE;EAChB,CAAE,CAAC;EAEH,OACC,IAAAK,MAAA,CAAAC,aAAA;IAAMT,SAAS,EAAGM;EAAgB,GACjC,IAAAE,MAAA,CAAAC,aAAA;IACCT,SAAS,EAAC,+BAA+B;IACzCE,EAAE,EAAGA,EAAI;IACTQ,IAAI,EAAC,UAAU;IACfT,OAAO,EAAGA,OAAS;IACnBG,QAAQ,EAAGA,QAAU;IACrBD,QAAQ,EAAGA,QAAU;IAAA,GAChBE,eAAe;IACpBN,GAAG,EAAGA;EAAK,CACX,CAAC,EACF,IAAAS,MAAA,CAAAC,aAAA;IAAMT,SAAS,EAAC;EAA+B,CAAO,CAAC,EACvD,IAAAQ,MAAA,CAAAC,aAAA;IAAMT,SAAS,EAAC;EAA+B,CAAO,CACjD,CAAC;AAET;AAAC,IAAAW,QAAA,GAAAf,OAAA,CAAAgB,OAAA,GAEc,IAAAC,mBAAU,EAAEhB,UAAW,CAAC","ignoreList":[]}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.FormTokenField = FormTokenField;
8
8
  exports.default = void 0;
9
9
  var _react = require("react");
10
- var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
11
  var _element = require("@wordpress/element");
12
12
  var _i18n = require("@wordpress/i18n");
13
13
  var _compose = require("@wordpress/compose");
@@ -499,7 +499,7 @@ function FormTokenField(props) {
499
499
  ref: input
500
500
  });
501
501
  }
502
- const classes = (0, _classnames.default)(className, 'components-form-token-field__input-container', {
502
+ const classes = (0, _clsx.default)(className, 'components-form-token-field__input-container', {
503
503
  'is-active': isActive,
504
504
  'is-disabled': disabled
505
505
  });
@@ -522,7 +522,7 @@ function FormTokenField(props) {
522
522
  /* eslint-disable jsx-a11y/no-static-element-interactions */
523
523
  return (0, _react.createElement)("div", {
524
524
  ...tokenFieldProps
525
- }, (0, _react.createElement)(_baseControlStyles.StyledLabel, {
525
+ }, label && (0, _react.createElement)(_baseControlStyles.StyledLabel, {
526
526
  htmlFor: `components-form-token-input-${instanceId}`,
527
527
  className: "components-form-token-field__label"
528
528
  }, label), (0, _react.createElement)("div", {