@wordpress/components 25.1.0 → 25.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (993) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/README.md +1 -1
  3. package/build/alignment-matrix-control/cell.js +4 -5
  4. package/build/alignment-matrix-control/cell.js.map +1 -1
  5. package/build/alignment-matrix-control/icon.js +2 -4
  6. package/build/alignment-matrix-control/icon.js.map +1 -1
  7. package/build/alignment-matrix-control/index.js +6 -7
  8. package/build/alignment-matrix-control/index.js.map +1 -1
  9. package/build/angle-picker-control/angle-circle.js +4 -7
  10. package/build/angle-picker-control/angle-circle.js.map +1 -1
  11. package/build/angle-picker-control/index.js +2 -4
  12. package/build/angle-picker-control/index.js.map +1 -1
  13. package/build/autocomplete/autocompleter-ui.js +28 -1
  14. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  15. package/build/autocomplete/index.js +0 -20
  16. package/build/autocomplete/index.js.map +1 -1
  17. package/build/base-control/index.js +2 -4
  18. package/build/base-control/index.js.map +1 -1
  19. package/build/border-box-control/border-box-control/component.js +4 -6
  20. package/build/border-box-control/border-box-control/component.js.map +1 -1
  21. package/build/border-box-control/border-box-control-linked-button/component.js +2 -4
  22. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  23. package/build/border-box-control/border-box-control-split-controls/component.js +15 -13
  24. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  25. package/build/border-box-control/border-box-control-visualizer/component.js +2 -6
  26. package/build/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  27. package/build/border-control/border-control/component.js +4 -6
  28. package/build/border-control/border-control/component.js.map +1 -1
  29. package/build/border-control/border-control-dropdown/component.js +4 -6
  30. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  31. package/build/border-control/border-control-style-picker/component.js +2 -4
  32. package/build/border-control/border-control-style-picker/component.js.map +1 -1
  33. package/build/box-control/all-input-control.js +2 -4
  34. package/build/box-control/all-input-control.js.map +1 -1
  35. package/build/box-control/axial-input-controls.js +2 -4
  36. package/build/box-control/axial-input-controls.js.map +1 -1
  37. package/build/box-control/icon.js +4 -7
  38. package/build/box-control/icon.js.map +1 -1
  39. package/build/box-control/index.js +7 -6
  40. package/build/box-control/index.js.map +1 -1
  41. package/build/box-control/input-controls.js +2 -4
  42. package/build/box-control/input-controls.js.map +1 -1
  43. package/build/box-control/linked-button.js +2 -4
  44. package/build/box-control/linked-button.js.map +1 -1
  45. package/build/box-control/unit-control.js +6 -6
  46. package/build/box-control/unit-control.js.map +1 -1
  47. package/build/button/deprecated.js +2 -4
  48. package/build/button/deprecated.js.map +1 -1
  49. package/build/button/index.js +7 -3
  50. package/build/button/index.js.map +1 -1
  51. package/build/button-group/index.js +4 -5
  52. package/build/button-group/index.js.map +1 -1
  53. package/build/card/card/component.js +2 -4
  54. package/build/card/card/component.js.map +1 -1
  55. package/build/card/card-body/component.js +4 -8
  56. package/build/card/card-body/component.js.map +1 -1
  57. package/build/card/card-divider/component.js +2 -6
  58. package/build/card/card-divider/component.js.map +1 -1
  59. package/build/card/card-footer/component.js +2 -6
  60. package/build/card/card-footer/component.js.map +1 -1
  61. package/build/card/card-header/component.js +2 -6
  62. package/build/card/card-header/component.js.map +1 -1
  63. package/build/card/card-media/component.js +2 -6
  64. package/build/card/card-media/component.js.map +1 -1
  65. package/build/checkbox-control/index.js +4 -5
  66. package/build/checkbox-control/index.js.map +1 -1
  67. package/build/circular-option-picker/index.js +19 -16
  68. package/build/circular-option-picker/index.js.map +1 -1
  69. package/build/clipboard-button/index.js +9 -20
  70. package/build/clipboard-button/index.js.map +1 -1
  71. package/build/clipboard-button/types.js +6 -0
  72. package/build/clipboard-button/types.js.map +1 -0
  73. package/build/color-control/index.native.js +4 -5
  74. package/build/color-control/index.native.js.map +1 -1
  75. package/build/color-indicator/index.js +4 -5
  76. package/build/color-indicator/index.js.map +1 -1
  77. package/build/color-palette/index.js +11 -11
  78. package/build/color-palette/index.js.map +1 -1
  79. package/build/color-picker/color-input.js +6 -3
  80. package/build/color-picker/color-input.js.map +1 -1
  81. package/build/color-picker/component.js +4 -5
  82. package/build/color-picker/component.js.map +1 -1
  83. package/build/color-picker/legacy-adapter.js +2 -1
  84. package/build/color-picker/legacy-adapter.js.map +1 -1
  85. package/build/confirm-dialog/component.js +4 -5
  86. package/build/confirm-dialog/component.js.map +1 -1
  87. package/build/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  88. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  89. package/build/custom-select-control/index.js +34 -32
  90. package/build/custom-select-control/index.js.map +1 -1
  91. package/build/dashicon/index.js +4 -7
  92. package/build/dashicon/index.js.map +1 -1
  93. package/build/dashicon/index.native.js +4 -7
  94. package/build/dashicon/index.native.js.map +1 -1
  95. package/build/disabled/index.js +4 -7
  96. package/build/disabled/index.js.map +1 -1
  97. package/build/divider/component.js +4 -8
  98. package/build/divider/component.js.map +1 -1
  99. package/build/drop-zone/index.js +2 -4
  100. package/build/drop-zone/index.js.map +1 -1
  101. package/build/dropdown/dropdown-content-wrapper.js +2 -6
  102. package/build/dropdown/dropdown-content-wrapper.js.map +1 -1
  103. package/build/dropdown/index.js +29 -24
  104. package/build/dropdown/index.js.map +1 -1
  105. package/build/dropdown-menu/index.js +98 -93
  106. package/build/dropdown-menu/index.js.map +1 -1
  107. package/build/dropdown-menu/index.native.js +2 -4
  108. package/build/dropdown-menu/index.native.js.map +1 -1
  109. package/build/dropdown-menu-v2/index.js +14 -12
  110. package/build/dropdown-menu-v2/index.js.map +1 -1
  111. package/build/dropdown-menu-v2/styles.js +16 -16
  112. package/build/dropdown-menu-v2/styles.js.map +1 -1
  113. package/build/elevation/component.js +2 -6
  114. package/build/elevation/component.js.map +1 -1
  115. package/build/external-link/index.js +2 -4
  116. package/build/external-link/index.js.map +1 -1
  117. package/build/flex/flex/component.js +2 -6
  118. package/build/flex/flex/component.js.map +1 -1
  119. package/build/flex/flex-block/component.js +2 -6
  120. package/build/flex/flex-block/component.js.map +1 -1
  121. package/build/flex/flex-item/component.js +2 -6
  122. package/build/flex/flex-item/component.js.map +1 -1
  123. package/build/focal-point-picker/controls.js +4 -7
  124. package/build/focal-point-picker/controls.js.map +1 -1
  125. package/build/focal-point-picker/focal-point.js +2 -4
  126. package/build/focal-point-picker/focal-point.js.map +1 -1
  127. package/build/focal-point-picker/grid.js +2 -6
  128. package/build/focal-point-picker/grid.js.map +1 -1
  129. package/build/focal-point-picker/index.js +4 -6
  130. package/build/focal-point-picker/index.js.map +1 -1
  131. package/build/focal-point-picker/index.native.js +2 -4
  132. package/build/focal-point-picker/index.native.js.map +1 -1
  133. package/build/focal-point-picker/media.js +7 -10
  134. package/build/focal-point-picker/media.js.map +1 -1
  135. package/build/focal-point-picker/tooltip/index.native.js +2 -4
  136. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  137. package/build/focusable-iframe/index.js +4 -5
  138. package/build/focusable-iframe/index.js.map +1 -1
  139. package/build/footer-message-control/index.native.js +2 -1
  140. package/build/footer-message-control/index.native.js.map +1 -1
  141. package/build/form-file-upload/index.js +4 -5
  142. package/build/form-file-upload/index.js.map +1 -1
  143. package/build/form-toggle/index.js +4 -5
  144. package/build/form-toggle/index.js.map +1 -1
  145. package/build/form-token-field/index.js +4 -5
  146. package/build/form-token-field/index.js.map +1 -1
  147. package/build/form-token-field/token-input.js +4 -6
  148. package/build/form-token-field/token-input.js.map +1 -1
  149. package/build/gradient-picker/index.js +14 -12
  150. package/build/gradient-picker/index.js.map +1 -1
  151. package/build/grid/component.js +2 -4
  152. package/build/grid/component.js.map +1 -1
  153. package/build/guide/page.js +2 -1
  154. package/build/guide/page.js.map +1 -1
  155. package/build/h-stack/component.js +2 -6
  156. package/build/h-stack/component.js.map +1 -1
  157. package/build/h-stack/hook.js +4 -7
  158. package/build/h-stack/hook.js.map +1 -1
  159. package/build/heading/component.js +2 -6
  160. package/build/heading/component.js.map +1 -1
  161. package/build/higher-order/navigate-regions/index.js +3 -1
  162. package/build/higher-order/navigate-regions/index.js.map +1 -1
  163. package/build/higher-order/with-constrained-tabbing/index.js +2 -1
  164. package/build/higher-order/with-constrained-tabbing/index.js.map +1 -1
  165. package/build/higher-order/with-fallback-styles/index.js +3 -3
  166. package/build/higher-order/with-fallback-styles/index.js.map +1 -1
  167. package/build/higher-order/with-filters/index.js +2 -1
  168. package/build/higher-order/with-filters/index.js.map +1 -1
  169. package/build/higher-order/with-focus-outside/index.js +5 -7
  170. package/build/higher-order/with-focus-outside/index.js.map +1 -1
  171. package/build/higher-order/with-focus-outside/index.native.js +5 -7
  172. package/build/higher-order/with-focus-outside/index.native.js.map +1 -1
  173. package/build/higher-order/with-focus-return/index.js +2 -1
  174. package/build/higher-order/with-focus-return/index.js.map +1 -1
  175. package/build/higher-order/with-notices/index.js +3 -4
  176. package/build/higher-order/with-notices/index.js.map +1 -1
  177. package/build/higher-order/with-spoken-messages/index.js +2 -6
  178. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  179. package/build/icon/index.js +6 -6
  180. package/build/icon/index.js.map +1 -1
  181. package/build/input-control/index.js +5 -5
  182. package/build/input-control/index.js.map +1 -1
  183. package/build/input-control/input-base.js +3 -4
  184. package/build/input-control/input-base.js.map +1 -1
  185. package/build/input-control/input-field.js +3 -6
  186. package/build/input-control/input-field.js.map +1 -1
  187. package/build/input-control/input-prefix-wrapper.js +4 -8
  188. package/build/input-control/input-prefix-wrapper.js.map +1 -1
  189. package/build/input-control/input-suffix-wrapper.js +4 -8
  190. package/build/input-control/input-suffix-wrapper.js.map +1 -1
  191. package/build/input-control/label.js +4 -7
  192. package/build/input-control/label.js.map +1 -1
  193. package/build/input-control/styles/input-control-styles.js +2 -4
  194. package/build/input-control/styles/input-control-styles.js.map +1 -1
  195. package/build/isolated-event-container/index.js +2 -4
  196. package/build/isolated-event-container/index.js.map +1 -1
  197. package/build/item-group/item/component.js +2 -6
  198. package/build/item-group/item/component.js.map +1 -1
  199. package/build/item-group/item-group/component.js +2 -6
  200. package/build/item-group/item-group/component.js.map +1 -1
  201. package/build/item-group/styles.js +10 -10
  202. package/build/item-group/styles.js.map +1 -1
  203. package/build/menu-item/index.js +4 -5
  204. package/build/menu-item/index.js.map +1 -1
  205. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +4 -6
  206. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  207. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +2 -1
  208. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  209. package/build/mobile/bottom-sheet/cell.native.js +5 -6
  210. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  211. package/build/mobile/bottom-sheet/color-cell.native.js +2 -4
  212. package/build/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  213. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js +4 -5
  214. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  215. package/build/mobile/bottom-sheet/footer-message-cell.native.js +2 -4
  216. package/build/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
  217. package/build/mobile/bottom-sheet/index.native.js +8 -8
  218. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  219. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +4 -7
  220. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  221. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +2 -4
  222. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  223. package/build/mobile/bottom-sheet/picker-cell.native.js +4 -5
  224. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  225. package/build/mobile/bottom-sheet/radio-cell.native.js +2 -4
  226. package/build/mobile/bottom-sheet/radio-cell.native.js.map +1 -1
  227. package/build/mobile/bottom-sheet/range-cell.native.js +2 -4
  228. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  229. package/build/mobile/bottom-sheet/ripple.native.js +4 -6
  230. package/build/mobile/bottom-sheet/ripple.native.js.map +1 -1
  231. package/build/mobile/bottom-sheet/switch-cell.native.js +2 -4
  232. package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  233. package/build/mobile/color-settings/index.native.js +5 -5
  234. package/build/mobile/color-settings/index.native.js.map +1 -1
  235. package/build/mobile/cycle-select-control/index.native.js +4 -5
  236. package/build/mobile/cycle-select-control/index.native.js.map +1 -1
  237. package/build/mobile/focal-point-settings-panel/index.native.js +5 -5
  238. package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  239. package/build/mobile/global-styles-context/index.native.js +2 -6
  240. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  241. package/build/mobile/gradient/index.native.js +4 -5
  242. package/build/mobile/gradient/index.native.js.map +1 -1
  243. package/build/mobile/image/image-editing-button.native.js +4 -5
  244. package/build/mobile/image/image-editing-button.native.js.map +1 -1
  245. package/build/mobile/image/index.native.js +15 -15
  246. package/build/mobile/image/index.native.js.map +1 -1
  247. package/build/mobile/keyboard-avoiding-view/index.ios.js +2 -4
  248. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  249. package/build/mobile/keyboard-aware-flat-list/index.android.js +4 -5
  250. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  251. package/build/mobile/keyboard-aware-flat-list/index.ios.js +2 -1
  252. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  253. package/build/mobile/link-picker/link-picker-results.native.js +4 -6
  254. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  255. package/build/mobile/link-settings/link-settings-navigation.native.js +4 -5
  256. package/build/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  257. package/build/mobile/link-settings/link-settings-screen.native.js +2 -4
  258. package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  259. package/build/mobile/picker/index.ios.js +4 -6
  260. package/build/mobile/picker/index.ios.js.map +1 -1
  261. package/build/mobile/segmented-control/index.native.js +4 -5
  262. package/build/mobile/segmented-control/index.native.js.map +1 -1
  263. package/build/modal/index.js +4 -6
  264. package/build/modal/index.js.map +1 -1
  265. package/build/navigable-container/container.js +6 -9
  266. package/build/navigable-container/container.js.map +1 -1
  267. package/build/navigable-container/menu.js +4 -5
  268. package/build/navigable-container/menu.js.map +1 -1
  269. package/build/navigable-container/tabbable.js +4 -5
  270. package/build/navigable-container/tabbable.js.map +1 -1
  271. package/build/navigation/item/base.js +4 -5
  272. package/build/navigation/item/base.js.map +1 -1
  273. package/build/navigation/item/index.js +3 -4
  274. package/build/navigation/item/index.js.map +1 -1
  275. package/build/navigator/navigator-back-button/component.js +4 -7
  276. package/build/navigator/navigator-back-button/component.js.map +1 -1
  277. package/build/navigator/navigator-button/component.js +4 -7
  278. package/build/navigator/navigator-button/component.js.map +1 -1
  279. package/build/navigator/navigator-provider/component.js +4 -5
  280. package/build/navigator/navigator-provider/component.js.map +1 -1
  281. package/build/navigator/navigator-screen/component.js +9 -10
  282. package/build/navigator/navigator-screen/component.js.map +1 -1
  283. package/build/navigator/navigator-to-parent-button/component.js +4 -7
  284. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  285. package/build/notice/list.js +2 -4
  286. package/build/notice/list.js.map +1 -1
  287. package/build/notice/list.native.js +2 -4
  288. package/build/notice/list.native.js.map +1 -1
  289. package/build/number-control/index.js +4 -6
  290. package/build/number-control/index.js.map +1 -1
  291. package/build/palette-edit/index.js +11 -12
  292. package/build/palette-edit/index.js.map +1 -1
  293. package/build/panel/body.js +8 -8
  294. package/build/panel/body.js.map +1 -1
  295. package/build/placeholder/index.js +2 -4
  296. package/build/placeholder/index.js.map +1 -1
  297. package/build/popover/index.js +11 -12
  298. package/build/popover/index.js.map +1 -1
  299. package/build/popover/utils.js +15 -1
  300. package/build/popover/utils.js.map +1 -1
  301. package/build/query-controls/category-select.js +4 -6
  302. package/build/query-controls/category-select.js.map +1 -1
  303. package/build/radio-control/index.js +4 -5
  304. package/build/radio-control/index.js.map +1 -1
  305. package/build/radio-control/index.native.js +4 -5
  306. package/build/radio-control/index.native.js.map +1 -1
  307. package/build/radio-group/index.js +5 -5
  308. package/build/radio-group/index.js.map +1 -1
  309. package/build/radio-group/radio/index.js +5 -5
  310. package/build/radio-group/radio/index.js.map +1 -1
  311. package/build/range-control/index.js +2 -4
  312. package/build/range-control/index.js.map +1 -1
  313. package/build/range-control/index.native.js +4 -5
  314. package/build/range-control/index.native.js.map +1 -1
  315. package/build/range-control/input-range.js +2 -6
  316. package/build/range-control/input-range.js.map +1 -1
  317. package/build/range-control/mark.js +2 -4
  318. package/build/range-control/mark.js.map +1 -1
  319. package/build/range-control/rail.js +6 -7
  320. package/build/range-control/rail.js.map +1 -1
  321. package/build/range-control/tooltip.js +2 -4
  322. package/build/range-control/tooltip.js.map +1 -1
  323. package/build/resizable-box/index.js +5 -5
  324. package/build/resizable-box/index.js.map +1 -1
  325. package/build/resizable-box/resize-tooltip/index.js +4 -5
  326. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  327. package/build/resizable-box/resize-tooltip/label.js +4 -7
  328. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  329. package/build/scrollable/component.js +2 -6
  330. package/build/scrollable/component.js.map +1 -1
  331. package/build/search-control/index.js +2 -4
  332. package/build/search-control/index.js.map +1 -1
  333. package/build/select-control/index.js +2 -4
  334. package/build/select-control/index.js.map +1 -1
  335. package/build/select-control/index.native.js +4 -5
  336. package/build/select-control/index.native.js.map +1 -1
  337. package/build/slot-fill/bubbles-virtually/slot.js +4 -5
  338. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  339. package/build/slot-fill/index.js +17 -13
  340. package/build/slot-fill/index.js.map +1 -1
  341. package/build/slot-fill/index.native.js +10 -9
  342. package/build/slot-fill/index.native.js.map +1 -1
  343. package/build/slot-fill/slot.js +2 -4
  344. package/build/slot-fill/slot.js.map +1 -1
  345. package/build/snackbar/list.js +2 -4
  346. package/build/snackbar/list.js.map +1 -1
  347. package/build/spacer/component.js +2 -6
  348. package/build/spacer/component.js.map +1 -1
  349. package/build/spinner/index.js +4 -6
  350. package/build/spinner/index.js.map +1 -1
  351. package/build/surface/component.js +2 -6
  352. package/build/surface/component.js.map +1 -1
  353. package/build/tab-panel/index.js +4 -5
  354. package/build/tab-panel/index.js.map +1 -1
  355. package/build/text/component.js +4 -6
  356. package/build/text/component.js.map +1 -1
  357. package/build/text-control/index.js +4 -5
  358. package/build/text-control/index.js.map +1 -1
  359. package/build/text-control/index.native.js +4 -5
  360. package/build/text-control/index.native.js.map +1 -1
  361. package/build/textarea-control/index.js +4 -5
  362. package/build/textarea-control/index.js.map +1 -1
  363. package/build/theme/index.js +4 -7
  364. package/build/theme/index.js.map +1 -1
  365. package/build/toggle-control/index.native.js +4 -5
  366. package/build/toggle-control/index.native.js.map +1 -1
  367. package/build/toggle-group-control/toggle-group-control/as-button-group.js +4 -6
  368. package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  369. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +4 -6
  370. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  371. package/build/toggle-group-control/toggle-group-control/component.js +2 -4
  372. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  373. package/build/toggle-group-control/toggle-group-control-option/component.js +2 -6
  374. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  375. package/build/toggle-group-control/toggle-group-control-option-base/component.js +6 -7
  376. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  377. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +2 -4
  378. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  379. package/build/toolbar/toolbar/index.js +9 -13
  380. package/build/toolbar/toolbar/index.js.map +1 -1
  381. package/build/toolbar/toolbar/toolbar-container.js +9 -13
  382. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  383. package/build/toolbar/toolbar-button/index.js +13 -11
  384. package/build/toolbar/toolbar-button/index.js.map +1 -1
  385. package/build/toolbar/toolbar-context/index.js.map +1 -1
  386. package/build/toolbar/toolbar-dropdown-menu/index.js +8 -10
  387. package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  388. package/build/toolbar/toolbar-group/index.js +11 -10
  389. package/build/toolbar/toolbar-group/index.js.map +1 -1
  390. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +6 -6
  391. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  392. package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js +4 -5
  393. package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
  394. package/build/toolbar/toolbar-group/toolbar-group-container.js +4 -7
  395. package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  396. package/build/toolbar/toolbar-item/index.js +13 -11
  397. package/build/toolbar/toolbar-item/index.js.map +1 -1
  398. package/build/toolbar/toolbar-item/types.js +6 -0
  399. package/build/toolbar/toolbar-item/types.js.map +1 -0
  400. package/build/tools-panel/tools-panel/component.js +2 -4
  401. package/build/tools-panel/tools-panel/component.js.map +1 -1
  402. package/build/tools-panel/tools-panel-header/component.js +2 -4
  403. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  404. package/build/tools-panel/tools-panel-item/component.js +4 -8
  405. package/build/tools-panel/tools-panel-item/component.js.map +1 -1
  406. package/build/tooltip/index.js +4 -5
  407. package/build/tooltip/index.js.map +1 -1
  408. package/build/tooltip/index.native.js +2 -1
  409. package/build/tooltip/index.native.js.map +1 -1
  410. package/build/tree-grid/cell.js +2 -4
  411. package/build/tree-grid/cell.js.map +1 -1
  412. package/build/tree-grid/index.js +2 -4
  413. package/build/tree-grid/index.js.map +1 -1
  414. package/build/tree-grid/item.js +4 -5
  415. package/build/tree-grid/item.js.map +1 -1
  416. package/build/tree-grid/roving-tab-index-item.js +2 -1
  417. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  418. package/build/tree-grid/row.js +2 -6
  419. package/build/tree-grid/row.js.map +1 -1
  420. package/build/tree-select/index.js +4 -7
  421. package/build/tree-select/index.js.map +1 -1
  422. package/build/truncate/component.js +4 -6
  423. package/build/truncate/component.js.map +1 -1
  424. package/build/ui/control-group/component.js +8 -12
  425. package/build/ui/control-group/component.js.map +1 -1
  426. package/build/ui/control-label/component.js +4 -8
  427. package/build/ui/control-label/component.js.map +1 -1
  428. package/build/ui/form-group/form-group-content.js +4 -5
  429. package/build/ui/form-group/form-group-content.js.map +1 -1
  430. package/build/ui/form-group/form-group-label.js +2 -1
  431. package/build/ui/form-group/form-group-label.js.map +1 -1
  432. package/build/ui/form-group/form-group.js +8 -8
  433. package/build/ui/form-group/form-group.js.map +1 -1
  434. package/build/ui/shortcut/component.js +4 -7
  435. package/build/ui/shortcut/component.js.map +1 -1
  436. package/build/ui/spinner/component.js +2 -6
  437. package/build/ui/spinner/component.js.map +1 -1
  438. package/build/ui/tooltip/component.js +3 -4
  439. package/build/ui/tooltip/component.js.map +1 -1
  440. package/build/ui/tooltip/content.js +5 -8
  441. package/build/ui/tooltip/content.js.map +1 -1
  442. package/build/unit-control/index.js +31 -94
  443. package/build/unit-control/index.js.map +1 -1
  444. package/build/unit-control/index.native.js +7 -7
  445. package/build/unit-control/index.native.js.map +1 -1
  446. package/build/unit-control/unit-select-control.js +15 -7
  447. package/build/unit-control/unit-select-control.js.map +1 -1
  448. package/build/v-stack/component.js +2 -6
  449. package/build/v-stack/component.js.map +1 -1
  450. package/build/visually-hidden/component.js +4 -8
  451. package/build/visually-hidden/component.js.map +1 -1
  452. package/build/z-stack/component.js +2 -6
  453. package/build/z-stack/component.js.map +1 -1
  454. package/build-module/alignment-matrix-control/cell.js +4 -4
  455. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  456. package/build-module/alignment-matrix-control/icon.js +2 -3
  457. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  458. package/build-module/alignment-matrix-control/index.js +6 -6
  459. package/build-module/alignment-matrix-control/index.js.map +1 -1
  460. package/build-module/angle-picker-control/angle-circle.js +4 -4
  461. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  462. package/build-module/angle-picker-control/index.js +2 -3
  463. package/build-module/angle-picker-control/index.js.map +1 -1
  464. package/build-module/autocomplete/autocompleter-ui.js +27 -2
  465. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  466. package/build-module/autocomplete/index.js +1 -19
  467. package/build-module/autocomplete/index.js.map +1 -1
  468. package/build-module/base-control/index.js +2 -3
  469. package/build-module/base-control/index.js.map +1 -1
  470. package/build-module/border-box-control/border-box-control/component.js +4 -5
  471. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  472. package/build-module/border-box-control/border-box-control-linked-button/component.js +2 -3
  473. package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  474. package/build-module/border-box-control/border-box-control-split-controls/component.js +15 -12
  475. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  476. package/build-module/border-box-control/border-box-control-visualizer/component.js +2 -3
  477. package/build-module/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  478. package/build-module/border-control/border-control/component.js +4 -5
  479. package/build-module/border-control/border-control/component.js.map +1 -1
  480. package/build-module/border-control/border-control-dropdown/component.js +4 -5
  481. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  482. package/build-module/border-control/border-control-style-picker/component.js +2 -3
  483. package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
  484. package/build-module/box-control/all-input-control.js +2 -3
  485. package/build-module/box-control/all-input-control.js.map +1 -1
  486. package/build-module/box-control/axial-input-controls.js +2 -3
  487. package/build-module/box-control/axial-input-controls.js.map +1 -1
  488. package/build-module/box-control/icon.js +4 -4
  489. package/build-module/box-control/icon.js.map +1 -1
  490. package/build-module/box-control/index.js +7 -5
  491. package/build-module/box-control/index.js.map +1 -1
  492. package/build-module/box-control/input-controls.js +2 -3
  493. package/build-module/box-control/input-controls.js.map +1 -1
  494. package/build-module/box-control/linked-button.js +2 -3
  495. package/build-module/box-control/linked-button.js.map +1 -1
  496. package/build-module/box-control/unit-control.js +6 -5
  497. package/build-module/box-control/unit-control.js.map +1 -1
  498. package/build-module/button/deprecated.js +2 -3
  499. package/build-module/button/deprecated.js.map +1 -1
  500. package/build-module/button/index.js +7 -2
  501. package/build-module/button/index.js.map +1 -1
  502. package/build-module/button-group/index.js +4 -4
  503. package/build-module/button-group/index.js.map +1 -1
  504. package/build-module/card/card/component.js +2 -3
  505. package/build-module/card/card/component.js.map +1 -1
  506. package/build-module/card/card-body/component.js +4 -5
  507. package/build-module/card/card-body/component.js.map +1 -1
  508. package/build-module/card/card-divider/component.js +2 -3
  509. package/build-module/card/card-divider/component.js.map +1 -1
  510. package/build-module/card/card-footer/component.js +2 -3
  511. package/build-module/card/card-footer/component.js.map +1 -1
  512. package/build-module/card/card-header/component.js +2 -3
  513. package/build-module/card/card-header/component.js.map +1 -1
  514. package/build-module/card/card-media/component.js +2 -3
  515. package/build-module/card/card-media/component.js.map +1 -1
  516. package/build-module/checkbox-control/index.js +4 -4
  517. package/build-module/checkbox-control/index.js.map +1 -1
  518. package/build-module/circular-option-picker/index.js +19 -15
  519. package/build-module/circular-option-picker/index.js.map +1 -1
  520. package/build-module/clipboard-button/index.js +9 -20
  521. package/build-module/clipboard-button/index.js.map +1 -1
  522. package/build-module/clipboard-button/types.js +2 -0
  523. package/build-module/clipboard-button/types.js.map +1 -0
  524. package/build-module/color-control/index.native.js +4 -4
  525. package/build-module/color-control/index.native.js.map +1 -1
  526. package/build-module/color-indicator/index.js +4 -4
  527. package/build-module/color-indicator/index.js.map +1 -1
  528. package/build-module/color-palette/index.js +11 -10
  529. package/build-module/color-palette/index.js.map +1 -1
  530. package/build-module/color-picker/color-input.js +6 -3
  531. package/build-module/color-picker/color-input.js.map +1 -1
  532. package/build-module/color-picker/component.js +4 -4
  533. package/build-module/color-picker/component.js.map +1 -1
  534. package/build-module/color-picker/legacy-adapter.js +2 -1
  535. package/build-module/color-picker/legacy-adapter.js.map +1 -1
  536. package/build-module/confirm-dialog/component.js +4 -4
  537. package/build-module/confirm-dialog/component.js.map +1 -1
  538. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -7
  539. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  540. package/build-module/custom-select-control/index.js +34 -31
  541. package/build-module/custom-select-control/index.js.map +1 -1
  542. package/build-module/dashicon/index.js +4 -4
  543. package/build-module/dashicon/index.js.map +1 -1
  544. package/build-module/dashicon/index.native.js +4 -4
  545. package/build-module/dashicon/index.native.js.map +1 -1
  546. package/build-module/disabled/index.js +4 -4
  547. package/build-module/disabled/index.js.map +1 -1
  548. package/build-module/divider/component.js +4 -5
  549. package/build-module/divider/component.js.map +1 -1
  550. package/build-module/drop-zone/index.js +2 -3
  551. package/build-module/drop-zone/index.js.map +1 -1
  552. package/build-module/dropdown/dropdown-content-wrapper.js +2 -3
  553. package/build-module/dropdown/dropdown-content-wrapper.js.map +1 -1
  554. package/build-module/dropdown/index.js +29 -24
  555. package/build-module/dropdown/index.js.map +1 -1
  556. package/build-module/dropdown-menu/index.js +95 -91
  557. package/build-module/dropdown-menu/index.js.map +1 -1
  558. package/build-module/dropdown-menu/index.native.js +2 -3
  559. package/build-module/dropdown-menu/index.native.js.map +1 -1
  560. package/build-module/dropdown-menu-v2/index.js +14 -11
  561. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  562. package/build-module/dropdown-menu-v2/styles.js +16 -16
  563. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  564. package/build-module/elevation/component.js +2 -3
  565. package/build-module/elevation/component.js.map +1 -1
  566. package/build-module/external-link/index.js +2 -3
  567. package/build-module/external-link/index.js.map +1 -1
  568. package/build-module/flex/flex/component.js +2 -3
  569. package/build-module/flex/flex/component.js.map +1 -1
  570. package/build-module/flex/flex-block/component.js +2 -3
  571. package/build-module/flex/flex-block/component.js.map +1 -1
  572. package/build-module/flex/flex-item/component.js +2 -3
  573. package/build-module/flex/flex-item/component.js.map +1 -1
  574. package/build-module/focal-point-picker/controls.js +4 -4
  575. package/build-module/focal-point-picker/controls.js.map +1 -1
  576. package/build-module/focal-point-picker/focal-point.js +2 -3
  577. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  578. package/build-module/focal-point-picker/grid.js +2 -3
  579. package/build-module/focal-point-picker/grid.js.map +1 -1
  580. package/build-module/focal-point-picker/index.js +4 -5
  581. package/build-module/focal-point-picker/index.js.map +1 -1
  582. package/build-module/focal-point-picker/index.native.js +2 -3
  583. package/build-module/focal-point-picker/index.native.js.map +1 -1
  584. package/build-module/focal-point-picker/media.js +7 -7
  585. package/build-module/focal-point-picker/media.js.map +1 -1
  586. package/build-module/focal-point-picker/tooltip/index.native.js +2 -3
  587. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  588. package/build-module/focusable-iframe/index.js +4 -4
  589. package/build-module/focusable-iframe/index.js.map +1 -1
  590. package/build-module/footer-message-control/index.native.js +2 -1
  591. package/build-module/footer-message-control/index.native.js.map +1 -1
  592. package/build-module/form-file-upload/index.js +4 -4
  593. package/build-module/form-file-upload/index.js.map +1 -1
  594. package/build-module/form-toggle/index.js +4 -4
  595. package/build-module/form-toggle/index.js.map +1 -1
  596. package/build-module/form-token-field/index.js +4 -4
  597. package/build-module/form-token-field/index.js.map +1 -1
  598. package/build-module/form-token-field/token-input.js +4 -5
  599. package/build-module/form-token-field/token-input.js.map +1 -1
  600. package/build-module/gradient-picker/index.js +14 -11
  601. package/build-module/gradient-picker/index.js.map +1 -1
  602. package/build-module/grid/component.js +2 -3
  603. package/build-module/grid/component.js.map +1 -1
  604. package/build-module/guide/page.js +2 -1
  605. package/build-module/guide/page.js.map +1 -1
  606. package/build-module/h-stack/component.js +2 -3
  607. package/build-module/h-stack/component.js.map +1 -1
  608. package/build-module/h-stack/hook.js +4 -4
  609. package/build-module/h-stack/hook.js.map +1 -1
  610. package/build-module/heading/component.js +2 -3
  611. package/build-module/heading/component.js.map +1 -1
  612. package/build-module/higher-order/navigate-regions/index.js +3 -1
  613. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  614. package/build-module/higher-order/with-constrained-tabbing/index.js +2 -1
  615. package/build-module/higher-order/with-constrained-tabbing/index.js.map +1 -1
  616. package/build-module/higher-order/with-fallback-styles/index.js +3 -2
  617. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  618. package/build-module/higher-order/with-filters/index.js +2 -1
  619. package/build-module/higher-order/with-filters/index.js.map +1 -1
  620. package/build-module/higher-order/with-focus-outside/index.js +5 -4
  621. package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
  622. package/build-module/higher-order/with-focus-outside/index.native.js +5 -4
  623. package/build-module/higher-order/with-focus-outside/index.native.js.map +1 -1
  624. package/build-module/higher-order/with-focus-return/index.js +2 -1
  625. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  626. package/build-module/higher-order/with-notices/index.js +3 -3
  627. package/build-module/higher-order/with-notices/index.js.map +1 -1
  628. package/build-module/higher-order/with-spoken-messages/index.js +2 -3
  629. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  630. package/build-module/icon/index.js +6 -6
  631. package/build-module/icon/index.js.map +1 -1
  632. package/build-module/input-control/index.js +5 -4
  633. package/build-module/input-control/index.js.map +1 -1
  634. package/build-module/input-control/input-base.js +3 -3
  635. package/build-module/input-control/input-base.js.map +1 -1
  636. package/build-module/input-control/input-field.js +3 -3
  637. package/build-module/input-control/input-field.js.map +1 -1
  638. package/build-module/input-control/input-prefix-wrapper.js +4 -5
  639. package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
  640. package/build-module/input-control/input-suffix-wrapper.js +4 -5
  641. package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
  642. package/build-module/input-control/label.js +4 -4
  643. package/build-module/input-control/label.js.map +1 -1
  644. package/build-module/input-control/styles/input-control-styles.js +2 -3
  645. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  646. package/build-module/isolated-event-container/index.js +2 -3
  647. package/build-module/isolated-event-container/index.js.map +1 -1
  648. package/build-module/item-group/item/component.js +2 -3
  649. package/build-module/item-group/item/component.js.map +1 -1
  650. package/build-module/item-group/item-group/component.js +2 -3
  651. package/build-module/item-group/item-group/component.js.map +1 -1
  652. package/build-module/item-group/styles.js +10 -10
  653. package/build-module/item-group/styles.js.map +1 -1
  654. package/build-module/menu-item/index.js +4 -4
  655. package/build-module/menu-item/index.js.map +1 -1
  656. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +4 -5
  657. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  658. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +2 -1
  659. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  660. package/build-module/mobile/bottom-sheet/cell.native.js +5 -5
  661. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  662. package/build-module/mobile/bottom-sheet/color-cell.native.js +2 -3
  663. package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  664. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js +4 -4
  665. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  666. package/build-module/mobile/bottom-sheet/footer-message-cell.native.js +2 -3
  667. package/build-module/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
  668. package/build-module/mobile/bottom-sheet/index.native.js +8 -7
  669. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  670. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +4 -4
  671. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  672. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +2 -3
  673. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  674. package/build-module/mobile/bottom-sheet/picker-cell.native.js +4 -4
  675. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  676. package/build-module/mobile/bottom-sheet/radio-cell.native.js +2 -3
  677. package/build-module/mobile/bottom-sheet/radio-cell.native.js.map +1 -1
  678. package/build-module/mobile/bottom-sheet/range-cell.native.js +2 -3
  679. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  680. package/build-module/mobile/bottom-sheet/ripple.native.js +4 -5
  681. package/build-module/mobile/bottom-sheet/ripple.native.js.map +1 -1
  682. package/build-module/mobile/bottom-sheet/switch-cell.native.js +2 -3
  683. package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  684. package/build-module/mobile/color-settings/index.native.js +5 -4
  685. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  686. package/build-module/mobile/cycle-select-control/index.native.js +4 -4
  687. package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
  688. package/build-module/mobile/focal-point-settings-panel/index.native.js +5 -4
  689. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  690. package/build-module/mobile/global-styles-context/index.native.js +2 -3
  691. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  692. package/build-module/mobile/gradient/index.native.js +4 -4
  693. package/build-module/mobile/gradient/index.native.js.map +1 -1
  694. package/build-module/mobile/image/image-editing-button.native.js +4 -4
  695. package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
  696. package/build-module/mobile/image/index.native.js +15 -14
  697. package/build-module/mobile/image/index.native.js.map +1 -1
  698. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +2 -3
  699. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  700. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +4 -4
  701. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  702. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +2 -1
  703. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  704. package/build-module/mobile/link-picker/link-picker-results.native.js +4 -5
  705. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  706. package/build-module/mobile/link-settings/link-settings-navigation.native.js +4 -4
  707. package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  708. package/build-module/mobile/link-settings/link-settings-screen.native.js +2 -3
  709. package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  710. package/build-module/mobile/picker/index.ios.js +4 -5
  711. package/build-module/mobile/picker/index.ios.js.map +1 -1
  712. package/build-module/mobile/segmented-control/index.native.js +4 -4
  713. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  714. package/build-module/modal/index.js +4 -5
  715. package/build-module/modal/index.js.map +1 -1
  716. package/build-module/navigable-container/container.js +6 -6
  717. package/build-module/navigable-container/container.js.map +1 -1
  718. package/build-module/navigable-container/menu.js +4 -4
  719. package/build-module/navigable-container/menu.js.map +1 -1
  720. package/build-module/navigable-container/tabbable.js +4 -4
  721. package/build-module/navigable-container/tabbable.js.map +1 -1
  722. package/build-module/navigation/item/base.js +4 -4
  723. package/build-module/navigation/item/base.js.map +1 -1
  724. package/build-module/navigation/item/index.js +3 -3
  725. package/build-module/navigation/item/index.js.map +1 -1
  726. package/build-module/navigator/navigator-back-button/component.js +4 -4
  727. package/build-module/navigator/navigator-back-button/component.js.map +1 -1
  728. package/build-module/navigator/navigator-button/component.js +4 -4
  729. package/build-module/navigator/navigator-button/component.js.map +1 -1
  730. package/build-module/navigator/navigator-provider/component.js +4 -4
  731. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  732. package/build-module/navigator/navigator-screen/component.js +9 -7
  733. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  734. package/build-module/navigator/navigator-to-parent-button/component.js +4 -4
  735. package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
  736. package/build-module/notice/list.js +2 -3
  737. package/build-module/notice/list.js.map +1 -1
  738. package/build-module/notice/list.native.js +2 -3
  739. package/build-module/notice/list.native.js.map +1 -1
  740. package/build-module/number-control/index.js +4 -5
  741. package/build-module/number-control/index.js.map +1 -1
  742. package/build-module/palette-edit/index.js +11 -11
  743. package/build-module/palette-edit/index.js.map +1 -1
  744. package/build-module/panel/body.js +8 -7
  745. package/build-module/panel/body.js.map +1 -1
  746. package/build-module/placeholder/index.js +2 -3
  747. package/build-module/placeholder/index.js.map +1 -1
  748. package/build-module/popover/index.js +12 -12
  749. package/build-module/popover/index.js.map +1 -1
  750. package/build-module/popover/utils.js +11 -0
  751. package/build-module/popover/utils.js.map +1 -1
  752. package/build-module/query-controls/category-select.js +4 -5
  753. package/build-module/query-controls/category-select.js.map +1 -1
  754. package/build-module/radio-control/index.js +4 -4
  755. package/build-module/radio-control/index.js.map +1 -1
  756. package/build-module/radio-control/index.native.js +4 -4
  757. package/build-module/radio-control/index.native.js.map +1 -1
  758. package/build-module/radio-group/index.js +5 -4
  759. package/build-module/radio-group/index.js.map +1 -1
  760. package/build-module/radio-group/radio/index.js +5 -4
  761. package/build-module/radio-group/radio/index.js.map +1 -1
  762. package/build-module/range-control/index.js +2 -3
  763. package/build-module/range-control/index.js.map +1 -1
  764. package/build-module/range-control/index.native.js +4 -4
  765. package/build-module/range-control/index.native.js.map +1 -1
  766. package/build-module/range-control/input-range.js +2 -3
  767. package/build-module/range-control/input-range.js.map +1 -1
  768. package/build-module/range-control/mark.js +2 -3
  769. package/build-module/range-control/mark.js.map +1 -1
  770. package/build-module/range-control/rail.js +6 -6
  771. package/build-module/range-control/rail.js.map +1 -1
  772. package/build-module/range-control/tooltip.js +2 -3
  773. package/build-module/range-control/tooltip.js.map +1 -1
  774. package/build-module/resizable-box/index.js +5 -4
  775. package/build-module/resizable-box/index.js.map +1 -1
  776. package/build-module/resizable-box/resize-tooltip/index.js +4 -4
  777. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  778. package/build-module/resizable-box/resize-tooltip/label.js +4 -4
  779. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  780. package/build-module/scrollable/component.js +2 -3
  781. package/build-module/scrollable/component.js.map +1 -1
  782. package/build-module/search-control/index.js +2 -3
  783. package/build-module/search-control/index.js.map +1 -1
  784. package/build-module/select-control/index.js +2 -3
  785. package/build-module/select-control/index.js.map +1 -1
  786. package/build-module/select-control/index.native.js +4 -4
  787. package/build-module/select-control/index.native.js.map +1 -1
  788. package/build-module/slot-fill/bubbles-virtually/slot.js +4 -4
  789. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  790. package/build-module/slot-fill/index.js +17 -12
  791. package/build-module/slot-fill/index.js.map +1 -1
  792. package/build-module/slot-fill/index.native.js +10 -8
  793. package/build-module/slot-fill/index.native.js.map +1 -1
  794. package/build-module/slot-fill/slot.js +2 -3
  795. package/build-module/slot-fill/slot.js.map +1 -1
  796. package/build-module/snackbar/list.js +2 -3
  797. package/build-module/snackbar/list.js.map +1 -1
  798. package/build-module/spacer/component.js +2 -3
  799. package/build-module/spacer/component.js.map +1 -1
  800. package/build-module/spinner/index.js +4 -5
  801. package/build-module/spinner/index.js.map +1 -1
  802. package/build-module/surface/component.js +2 -3
  803. package/build-module/surface/component.js.map +1 -1
  804. package/build-module/tab-panel/index.js +4 -4
  805. package/build-module/tab-panel/index.js.map +1 -1
  806. package/build-module/text/component.js +4 -5
  807. package/build-module/text/component.js.map +1 -1
  808. package/build-module/text-control/index.js +4 -4
  809. package/build-module/text-control/index.js.map +1 -1
  810. package/build-module/text-control/index.native.js +4 -4
  811. package/build-module/text-control/index.native.js.map +1 -1
  812. package/build-module/textarea-control/index.js +4 -4
  813. package/build-module/textarea-control/index.js.map +1 -1
  814. package/build-module/theme/index.js +4 -4
  815. package/build-module/theme/index.js.map +1 -1
  816. package/build-module/toggle-control/index.native.js +4 -4
  817. package/build-module/toggle-control/index.native.js.map +1 -1
  818. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +4 -5
  819. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  820. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +4 -5
  821. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  822. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -3
  823. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  824. package/build-module/toggle-group-control/toggle-group-control-option/component.js +2 -3
  825. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  826. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +6 -6
  827. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  828. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +2 -3
  829. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  830. package/build-module/toolbar/toolbar/index.js +10 -13
  831. package/build-module/toolbar/toolbar/index.js.map +1 -1
  832. package/build-module/toolbar/toolbar/toolbar-container.js +9 -12
  833. package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
  834. package/build-module/toolbar/toolbar-button/index.js +13 -10
  835. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  836. package/build-module/toolbar/toolbar-context/index.js.map +1 -1
  837. package/build-module/toolbar/toolbar-dropdown-menu/index.js +8 -9
  838. package/build-module/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  839. package/build-module/toolbar/toolbar-group/index.js +11 -9
  840. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  841. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js +6 -5
  842. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  843. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js +4 -4
  844. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
  845. package/build-module/toolbar/toolbar-group/toolbar-group-container.js +4 -4
  846. package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  847. package/build-module/toolbar/toolbar-item/index.js +13 -10
  848. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  849. package/build-module/toolbar/toolbar-item/types.js +2 -0
  850. package/build-module/toolbar/toolbar-item/types.js.map +1 -0
  851. package/build-module/tools-panel/tools-panel/component.js +2 -3
  852. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  853. package/build-module/tools-panel/tools-panel-header/component.js +2 -3
  854. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  855. package/build-module/tools-panel/tools-panel-item/component.js +4 -5
  856. package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
  857. package/build-module/tooltip/index.js +4 -4
  858. package/build-module/tooltip/index.js.map +1 -1
  859. package/build-module/tooltip/index.native.js +2 -1
  860. package/build-module/tooltip/index.native.js.map +1 -1
  861. package/build-module/tree-grid/cell.js +2 -3
  862. package/build-module/tree-grid/cell.js.map +1 -1
  863. package/build-module/tree-grid/index.js +2 -3
  864. package/build-module/tree-grid/index.js.map +1 -1
  865. package/build-module/tree-grid/item.js +4 -4
  866. package/build-module/tree-grid/item.js.map +1 -1
  867. package/build-module/tree-grid/roving-tab-index-item.js +2 -1
  868. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  869. package/build-module/tree-grid/row.js +2 -3
  870. package/build-module/tree-grid/row.js.map +1 -1
  871. package/build-module/tree-select/index.js +4 -4
  872. package/build-module/tree-select/index.js.map +1 -1
  873. package/build-module/truncate/component.js +4 -5
  874. package/build-module/truncate/component.js.map +1 -1
  875. package/build-module/ui/control-group/component.js +8 -9
  876. package/build-module/ui/control-group/component.js.map +1 -1
  877. package/build-module/ui/control-label/component.js +4 -5
  878. package/build-module/ui/control-label/component.js.map +1 -1
  879. package/build-module/ui/form-group/form-group-content.js +4 -4
  880. package/build-module/ui/form-group/form-group-content.js.map +1 -1
  881. package/build-module/ui/form-group/form-group-label.js +2 -1
  882. package/build-module/ui/form-group/form-group-label.js.map +1 -1
  883. package/build-module/ui/form-group/form-group.js +8 -7
  884. package/build-module/ui/form-group/form-group.js.map +1 -1
  885. package/build-module/ui/shortcut/component.js +4 -4
  886. package/build-module/ui/shortcut/component.js.map +1 -1
  887. package/build-module/ui/spinner/component.js +2 -3
  888. package/build-module/ui/spinner/component.js.map +1 -1
  889. package/build-module/ui/tooltip/component.js +3 -3
  890. package/build-module/ui/tooltip/component.js.map +1 -1
  891. package/build-module/ui/tooltip/content.js +5 -5
  892. package/build-module/ui/tooltip/content.js.map +1 -1
  893. package/build-module/unit-control/index.js +31 -88
  894. package/build-module/unit-control/index.js.map +1 -1
  895. package/build-module/unit-control/index.native.js +7 -6
  896. package/build-module/unit-control/index.native.js.map +1 -1
  897. package/build-module/unit-control/unit-select-control.js +19 -6
  898. package/build-module/unit-control/unit-select-control.js.map +1 -1
  899. package/build-module/v-stack/component.js +2 -3
  900. package/build-module/v-stack/component.js.map +1 -1
  901. package/build-module/visually-hidden/component.js +4 -5
  902. package/build-module/visually-hidden/component.js.map +1 -1
  903. package/build-module/z-stack/component.js +2 -3
  904. package/build-module/z-stack/component.js.map +1 -1
  905. package/build-style/style-rtl.css +8 -14
  906. package/build-style/style.css +8 -14
  907. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  908. package/build-types/autocomplete/index.d.ts.map +1 -1
  909. package/build-types/button/stories/e2e/index.d.ts +1 -0
  910. package/build-types/button/stories/e2e/index.d.ts.map +1 -1
  911. package/build-types/circular-option-picker/types.d.ts +2 -2
  912. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  913. package/build-types/clipboard-button/index.d.ts +4 -15
  914. package/build-types/clipboard-button/index.d.ts.map +1 -1
  915. package/build-types/clipboard-button/types.d.ts +11 -0
  916. package/build-types/clipboard-button/types.d.ts.map +1 -0
  917. package/build-types/dropdown/index.d.ts +1 -1
  918. package/build-types/dropdown/index.d.ts.map +1 -1
  919. package/build-types/dropdown/types.d.ts +7 -0
  920. package/build-types/dropdown/types.d.ts.map +1 -1
  921. package/build-types/dropdown-menu/index.d.ts +1 -1
  922. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  923. package/build-types/dropdown-menu/stories/index.d.ts +4 -3
  924. package/build-types/dropdown-menu/stories/index.d.ts.map +1 -1
  925. package/build-types/dropdown-menu/types.d.ts +7 -0
  926. package/build-types/dropdown-menu/types.d.ts.map +1 -1
  927. package/build-types/dropdown-menu-v2/styles.d.ts +4 -4
  928. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  929. package/build-types/dropdown-menu-v2/types.d.ts +2 -2
  930. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  931. package/build-types/item-group/styles.d.ts.map +1 -1
  932. package/build-types/popover/index.d.ts.map +1 -1
  933. package/build-types/popover/stories/index.d.ts +0 -1
  934. package/build-types/popover/stories/index.d.ts.map +1 -1
  935. package/build-types/popover/utils.d.ts +10 -0
  936. package/build-types/popover/utils.d.ts.map +1 -1
  937. package/build-types/toolbar/stories/index.d.ts.map +1 -1
  938. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  939. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  940. package/build-types/toolbar/toolbar-context/index.d.ts +2 -2
  941. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
  942. package/build-types/toolbar/toolbar-item/index.d.ts +4 -6
  943. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  944. package/build-types/toolbar/toolbar-item/types.d.ts +17 -0
  945. package/build-types/toolbar/toolbar-item/types.d.ts.map +1 -0
  946. package/build-types/unit-control/index.d.ts +3 -6
  947. package/build-types/unit-control/index.d.ts.map +1 -1
  948. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  949. package/build-types/unit-control/unit-select-control.d.ts +7 -6
  950. package/build-types/unit-control/unit-select-control.d.ts.map +1 -1
  951. package/package.json +20 -19
  952. package/src/autocomplete/autocompleter-ui.tsx +44 -2
  953. package/src/autocomplete/index.tsx +2 -32
  954. package/src/box-control/test/index.tsx +28 -60
  955. package/src/button/stories/e2e/index.tsx +22 -0
  956. package/src/button/style.scss +5 -13
  957. package/src/circular-option-picker/types.ts +2 -5
  958. package/src/clipboard-button/{index.js → index.tsx} +11 -17
  959. package/src/clipboard-button/types.ts +11 -0
  960. package/src/dropdown/index.tsx +20 -10
  961. package/src/dropdown/types.ts +8 -0
  962. package/src/dropdown-menu/index.tsx +101 -85
  963. package/src/dropdown-menu/stories/index.tsx +1 -1
  964. package/src/dropdown-menu/types.ts +8 -0
  965. package/src/dropdown-menu-v2/index.tsx +2 -2
  966. package/src/dropdown-menu-v2/styles.ts +7 -5
  967. package/src/dropdown-menu-v2/types.ts +2 -2
  968. package/src/item-group/styles.ts +12 -4
  969. package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +16 -29
  970. package/src/mobile/bottom-sheet/cell.native.js +1 -1
  971. package/src/mobile/html-text-input/test/__snapshots__/index.native.js.snap +46 -0
  972. package/src/mobile/html-text-input/test/index.native.js +2 -2
  973. package/src/mobile/image/index.native.js +1 -1
  974. package/src/mobile/link-settings/test/link-settings-navigation.native.js +5 -16
  975. package/src/modal/style.scss +2 -2
  976. package/src/popover/index.tsx +3 -2
  977. package/src/popover/stories/index.tsx +0 -13
  978. package/src/popover/test/index.tsx +22 -1
  979. package/src/popover/utils.ts +12 -0
  980. package/src/search-control/README.md +7 -1
  981. package/src/toolbar/stories/index.tsx +0 -3
  982. package/src/toolbar/toolbar/index.tsx +3 -6
  983. package/src/toolbar/toolbar/toolbar-container.tsx +5 -9
  984. package/src/toolbar/toolbar-context/index.ts +2 -4
  985. package/src/toolbar/toolbar-dropdown-menu/index.js +0 -1
  986. package/src/toolbar/toolbar-item/index.tsx +13 -15
  987. package/src/toolbar/toolbar-item/types.ts +27 -0
  988. package/src/tooltip/test/index.native.js +1 -3
  989. package/src/unit-control/index.tsx +29 -95
  990. package/src/unit-control/stories/index.tsx +0 -4
  991. package/src/unit-control/test/index.tsx +151 -223
  992. package/src/unit-control/unit-select-control.tsx +20 -10
  993. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["motion","css","focus","useContext","useEffect","useMemo","useRef","useId","useReducedMotion","useMergeRefs","isRTL","escapeAttribute","contextConnect","useContextSystem","useCx","View","NavigatorContext","animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","UnconnectedNavigatorScreen","props","forwardedRef","screenId","children","className","path","otherProps","prefersReducedMotion","location","match","addScreen","removeScreen","isMatch","wrapperRef","screen","id","cx","classes","locationRef","current","isInitialLocation","isInitial","isBack","hasRestoredFocus","skipFocus","activeElement","ownerDocument","contains","elementToFocus","focusTargetSelector","querySelector","firstTabbable","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","NavigatorScreen"],"mappings":";;;;;AAAA;AACA;AACA;AAEA;AACA,SAASA,MAAT,QAAoC,eAApC;AACA,SAASC,GAAT,QAAoB,gBAApB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SACCC,UADD,EAECC,SAFD,EAGCC,OAHD,EAICC,MAJD,EAKCC,KALD,QAMO,oBANP;AAOA,SAASC,gBAAT,EAA2BC,YAA3B,QAA+C,oBAA/C;AACA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASC,eAAT,QAAgC,wBAAhC;AAEA;AACA;AACA;;AACA,SACCC,cADD,EAECC,gBAFD,QAIO,kBAJP;AAKA,SAASC,KAAT,QAAsB,0BAAtB;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,gBAAT,QAAiC,YAAjC;AAGA,MAAMC,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,0BAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,QAAQ,GAAGjB,KAAK,EAAtB;AACA,QAAM;AAAEkB,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAG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;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,OAAO,MAAM0C,eAAe,GAAGvD,cAAc,CAC5CS,0BAD4C,EAE5C,iBAF4C,CAAtC;AAKP,eAAe8C,eAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport {\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseId,\n} from '@wordpress/element';\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tExclude< keyof MotionProps, 'style' | 'children' >\n>;\n\nfunction UnconnectedNavigatorScreen(\n\tprops: Props,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst screenId = useId();\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location, match, addScreen, removeScreen } =\n\t\tuseContext( NavigatorContext );\n\tconst isMatch = match === screenId;\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tuseEffect( () => {\n\t\tconst screen = {\n\t\t\tid: screenId,\n\t\t\tpath: escapeAttribute( path ),\n\t\t};\n\t\taddScreen( screen );\n\t\treturn () => removeScreen( screen );\n\t}, [ screenId, path, addScreen, removeScreen ] );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible.\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded.\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\tconst locationRef = useRef( location );\n\n\tuseEffect( () => {\n\t\tlocationRef.current = location;\n\t}, [ location ] );\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\t// - if focus hasn't already been restored for the current location\n\t\t// - if the `skipFocus` option is not set to `true`. This is useful when we trigger the navigation outside of NavigatorScreen.\n\t\tif (\n\t\t\tisInitialLocation ||\n\t\t\t! isMatch ||\n\t\t\t! wrapperRef.current ||\n\t\t\tlocationRef.current.hasRestoredFocus ||\n\t\t\tlocation.skipFocus\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = wrapperRef.current.ownerDocument.activeElement;\n\n\t\t// If an element is already focused within the wrapper do not focus the\n\t\t// element. This prevents inputs or buttons from losing focus unnecessarily.\n\t\tif ( wrapperRef.current.contains( activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && location?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tlocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = (\n\t\t\t\tfocus.tabbable.find( wrapperRef.current ) as HTMLElement[]\n\t\t\t )[ 0 ];\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\tlocationRef.current.hasRestoredFocus = true;\n\t\telementToFocus.focus();\n\t}, [\n\t\tisInitialLocation,\n\t\tisMatch,\n\t\tlocation.isBack,\n\t\tlocation.focusTargetSelector,\n\t\tlocation.skipFocus,\n\t] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\t// Disable the initial animation if the screen is the very first screen to be\n\t// rendered within the current `NavigatorProvider`.\n\tconst initial =\n\t\tlocation.isInitial && ! location.isBack\n\t\t\t? false\n\t\t\t: {\n\t\t\t\t\topacity: 0,\n\t\t\t\t\tx:\n\t\t\t\t\t\t( isRTL() && location.isBack ) ||\n\t\t\t\t\t\t( ! isRTL() && ! location.isBack )\n\t\t\t\t\t\t\t? 50\n\t\t\t\t\t\t\t: -50,\n\t\t\t };\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorScreen = contextConnect(\n\tUnconnectedNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default NavigatorScreen;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["motion","css","focus","useContext","useEffect","useMemo","useRef","useId","useReducedMotion","useMergeRefs","isRTL","escapeAttribute","contextConnect","useContextSystem","useCx","View","NavigatorContext","animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","UnconnectedNavigatorScreen","props","forwardedRef","screenId","children","className","path","otherProps","prefersReducedMotion","location","match","addScreen","removeScreen","isMatch","wrapperRef","screen","id","cx","classes","locationRef","current","isInitialLocation","isInitial","isBack","hasRestoredFocus","skipFocus","activeElement","ownerDocument","contains","elementToFocus","focusTargetSelector","querySelector","firstTabbable","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","NavigatorScreen"],"mappings":";;;;AAAA;AACA;AACA;AAEA;AACA,SAASA,MAAT,QAAoC,eAApC;AACA,SAASC,GAAT,QAAoB,gBAApB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SACCC,UADD,EAECC,SAFD,EAGCC,OAHD,EAICC,MAJD,EAKCC,KALD,QAMO,oBANP;AAOA,SAASC,gBAAT,EAA2BC,YAA3B,QAA+C,oBAA/C;AACA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASC,eAAT,QAAgC,wBAAhC;AAEA;AACA;AACA;;AACA,SACCC,cADD,EAECC,gBAFD,QAIO,kBAJP;AAKA,SAASC,KAAT,QAAsB,0BAAtB;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,gBAAT,QAAiC,YAAjC;AAGA,MAAMC,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,0BAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,QAAQ,GAAGjB,KAAK,EAAtB;AACA,QAAM;AAAEkB,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAGC;AAAhC,MAA+Cf,gBAAgB,CACpES,KADoE,EAEpE,iBAFoE,CAArE;AA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAM0C,eAAe,GAAGvD,cAAc,CAC5CS,0BAD4C,EAE5C,iBAF4C,CAAtC;AAKP,eAAe8C,eAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport {\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseId,\n} from '@wordpress/element';\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tExclude< keyof MotionProps, 'style' | 'children' >\n>;\n\nfunction UnconnectedNavigatorScreen(\n\tprops: Props,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst screenId = useId();\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location, match, addScreen, removeScreen } =\n\t\tuseContext( NavigatorContext );\n\tconst isMatch = match === screenId;\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tuseEffect( () => {\n\t\tconst screen = {\n\t\t\tid: screenId,\n\t\t\tpath: escapeAttribute( path ),\n\t\t};\n\t\taddScreen( screen );\n\t\treturn () => removeScreen( screen );\n\t}, [ screenId, path, addScreen, removeScreen ] );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible.\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded.\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\tconst locationRef = useRef( location );\n\n\tuseEffect( () => {\n\t\tlocationRef.current = location;\n\t}, [ location ] );\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\t// - if focus hasn't already been restored for the current location\n\t\t// - if the `skipFocus` option is not set to `true`. This is useful when we trigger the navigation outside of NavigatorScreen.\n\t\tif (\n\t\t\tisInitialLocation ||\n\t\t\t! isMatch ||\n\t\t\t! wrapperRef.current ||\n\t\t\tlocationRef.current.hasRestoredFocus ||\n\t\t\tlocation.skipFocus\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = wrapperRef.current.ownerDocument.activeElement;\n\n\t\t// If an element is already focused within the wrapper do not focus the\n\t\t// element. This prevents inputs or buttons from losing focus unnecessarily.\n\t\tif ( wrapperRef.current.contains( activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && location?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tlocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = (\n\t\t\t\tfocus.tabbable.find( wrapperRef.current ) as HTMLElement[]\n\t\t\t )[ 0 ];\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\tlocationRef.current.hasRestoredFocus = true;\n\t\telementToFocus.focus();\n\t}, [\n\t\tisInitialLocation,\n\t\tisMatch,\n\t\tlocation.isBack,\n\t\tlocation.focusTargetSelector,\n\t\tlocation.skipFocus,\n\t] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\t// Disable the initial animation if the screen is the very first screen to be\n\t// rendered within the current `NavigatorProvider`.\n\tconst initial =\n\t\tlocation.isInitial && ! location.isBack\n\t\t\t? false\n\t\t\t: {\n\t\t\t\t\topacity: 0,\n\t\t\t\t\tx:\n\t\t\t\t\t\t( isRTL() && location.isBack ) ||\n\t\t\t\t\t\t( ! isRTL() && ! location.isBack )\n\t\t\t\t\t\t\t? 50\n\t\t\t\t\t\t\t: -50,\n\t\t\t };\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorScreen = contextConnect(\n\tUnconnectedNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default NavigatorScreen;\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -16,9 +15,10 @@ function UnconnectedNavigatorToParentButton(props, forwardedRef) {
16
15
  const navigatorToParentButtonProps = useNavigatorBackButton({ ...props,
17
16
  goToParent: true
18
17
  });
19
- return createElement(View, _extends({
20
- ref: forwardedRef
21
- }, navigatorToParentButtonProps));
18
+ return createElement(View, {
19
+ ref: forwardedRef,
20
+ ...navigatorToParentButtonProps
21
+ });
22
22
  }
23
23
  /*
24
24
  * The `NavigatorToParentButton` component can be used to navigate to a screen and
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigator/navigator-to-parent-button/component.tsx"],"names":["contextConnect","View","useNavigatorBackButton","UnconnectedNavigatorToParentButton","props","forwardedRef","navigatorToParentButtonProps","goToParent","NavigatorToParentButton"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,cAAT,QAAwD,kBAAxD;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,sBAAT,QAAuC,+BAAvC;;AAGA,SAASC,kCAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,4BAA4B,GAAGJ,sBAAsB,CAAE,EAC5D,GAAGE,KADyD;AAE5DG,IAAAA,UAAU,EAAE;AAFgD,GAAF,CAA3D;AAKA,SAAO,cAAC,IAAD;AAAM,IAAA,GAAG,EAAGF;AAAZ,KAAgCC,4BAAhC,EAAP;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAME,uBAAuB,GAAGR,cAAc,CACpDG,kCADoD,EAEpD,yBAFoD,CAA9C;AAKP,eAAeK,uBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { View } from '../../view';\nimport { useNavigatorBackButton } from '../navigator-back-button/hook';\nimport type { NavigatorToParentButtonProps } from '../types';\n\nfunction UnconnectedNavigatorToParentButton(\n\tprops: WordPressComponentProps< NavigatorToParentButtonProps, 'button' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst navigatorToParentButtonProps = useNavigatorBackButton( {\n\t\t...props,\n\t\tgoToParent: true,\n\t} );\n\n\treturn <View ref={ forwardedRef } { ...navigatorToParentButtonProps } />;\n}\n\n/*\n * The `NavigatorToParentButton` component can be used to navigate to a screen and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorScreen` and the `NavigatorButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorToParentButton as NavigatorToParentButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorToParentButton>\n * Go to parent\n * </NavigatorToParentButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorToParentButton = contextConnect(\n\tUnconnectedNavigatorToParentButton,\n\t'NavigatorToParentButton'\n);\n\nexport default NavigatorToParentButton;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigator/navigator-to-parent-button/component.tsx"],"names":["contextConnect","View","useNavigatorBackButton","UnconnectedNavigatorToParentButton","props","forwardedRef","navigatorToParentButtonProps","goToParent","NavigatorToParentButton"],"mappings":";;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,cAAT,QAAwD,kBAAxD;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,sBAAT,QAAuC,+BAAvC;;AAGA,SAASC,kCAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,4BAA4B,GAAGJ,sBAAsB,CAAE,EAC5D,GAAGE,KADyD;AAE5DG,IAAAA,UAAU,EAAE;AAFgD,GAAF,CAA3D;AAKA,SAAO,cAAC,IAAD;AAAM,IAAA,GAAG,EAAGF,YAAZ;AAAA,OAAgCC;AAAhC,IAAP;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAME,uBAAuB,GAAGR,cAAc,CACpDG,kCADoD,EAEpD,yBAFoD,CAA9C;AAKP,eAAeK,uBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { View } from '../../view';\nimport { useNavigatorBackButton } from '../navigator-back-button/hook';\nimport type { NavigatorToParentButtonProps } from '../types';\n\nfunction UnconnectedNavigatorToParentButton(\n\tprops: WordPressComponentProps< NavigatorToParentButtonProps, 'button' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst navigatorToParentButtonProps = useNavigatorBackButton( {\n\t\t...props,\n\t\tgoToParent: true,\n\t} );\n\n\treturn <View ref={ forwardedRef } { ...navigatorToParentButtonProps } />;\n}\n\n/*\n * The `NavigatorToParentButton` component can be used to navigate to a screen and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorScreen` and the `NavigatorButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorToParentButton as NavigatorToParentButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorToParentButton>\n * Go to parent\n * </NavigatorToParentButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorToParentButton = contextConnect(\n\tUnconnectedNavigatorToParentButton,\n\t'NavigatorToParentButton'\n);\n\nexport default NavigatorToParentButton;\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -56,10 +55,10 @@ function NoticeList({
56
55
  content,
57
56
  ...restNotice
58
57
  } = notice;
59
- return createElement(Notice, _extends({}, restNotice, {
58
+ return createElement(Notice, { ...restNotice,
60
59
  key: notice.id,
61
60
  onRemove: removeNotice(notice.id)
62
- }), notice.content);
61
+ }, notice.content);
63
62
  }));
64
63
  }
65
64
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/notice/list.tsx"],"names":["classnames","Notice","noop","NoticeList","notices","onRemove","className","children","removeNotice","id","reverse","map","notice","content","restNotice"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,GAAnB;;AAIA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;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,SAASC,UAAT,CAAqB;AACpBC,EAAAA,OADoB;AAEpBC,EAAAA,QAAQ,GAAGH,IAFS;AAGpBI,EAAAA,SAHoB;AAIpBC,EAAAA;AAJoB,CAArB,EAK8D;AAC7D,QAAMC,YAAY,GACfC,EAAF,IAA0D,MACzDJ,QAAQ,CAAEI,EAAF,CAFV;;AAIAH,EAAAA,SAAS,GAAGN,UAAU,CAAE,wBAAF,EAA4BM,SAA5B,CAAtB;AAEA,SACC;AAAK,IAAA,SAAS,EAAGA;AAAjB,KACGC,QADH,EAEG,CAAE,GAAGH,OAAL,EAAeM,OAAf,GAAyBC,GAAzB,CAAgCC,MAAF,IAAc;AAC7C,UAAM;AAAEC,MAAAA,OAAF;AAAW,SAAGC;AAAd,QAA6BF,MAAnC;AACA,WACC,cAAC,MAAD,eACME,UADN;AAEC,MAAA,GAAG,EAAGF,MAAM,CAACH,EAFd;AAGC,MAAA,QAAQ,EAAGD,YAAY,CAAEI,MAAM,CAACH,EAAT;AAHxB,QAKGG,MAAM,CAACC,OALV,CADD;AASA,GAXC,CAFH,CADD;AAiBA;;AAED,eAAeV,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport Notice from '.';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { NoticeListProps } from './types';\n\nconst noop = () => {};\n\n/**\n * `NoticeList` is a component used to render a collection of notices.\n *\n *```jsx\n * import { Notice, NoticeList } from `@wordpress/components`;\n *\n * const MyNoticeList = () => {\n *\tconst [ notices, setNotices ] = useState( [\n *\t\t{\n *\t\t\tid: 'second-notice',\n *\t\t\tcontent: 'second notice content',\n *\t\t},\n *\t\t{\n *\t\t\tid: 'fist-notice',\n *\t\t\tcontent: 'first notice content',\n *\t\t},\n *\t] );\n *\n *\tconst removeNotice = ( id ) => {\n *\t\tsetNotices( notices.filter( ( notice ) => notice.id !== id ) );\n *\t};\n *\n *\treturn <NoticeList notices={ notices } onRemove={ removeNotice } />;\n *};\n *```\n */\nfunction NoticeList( {\n\tnotices,\n\tonRemove = noop,\n\tclassName,\n\tchildren,\n}: WordPressComponentProps< NoticeListProps, 'div', false > ) {\n\tconst removeNotice =\n\t\t( id: NoticeListProps[ 'notices' ][ number ][ 'id' ] ) => () =>\n\t\t\tonRemove( id );\n\n\tclassName = classnames( 'components-notice-list', className );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ children }\n\t\t\t{ [ ...notices ].reverse().map( ( notice ) => {\n\t\t\t\tconst { content, ...restNotice } = notice;\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonRemove={ removeNotice( notice.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t</Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nexport default NoticeList;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/notice/list.tsx"],"names":["classnames","Notice","noop","NoticeList","notices","onRemove","className","children","removeNotice","id","reverse","map","notice","content","restNotice"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,GAAnB;;AAIA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;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,SAASC,UAAT,CAAqB;AACpBC,EAAAA,OADoB;AAEpBC,EAAAA,QAAQ,GAAGH,IAFS;AAGpBI,EAAAA,SAHoB;AAIpBC,EAAAA;AAJoB,CAArB,EAK8D;AAC7D,QAAMC,YAAY,GACfC,EAAF,IAA0D,MACzDJ,QAAQ,CAAEI,EAAF,CAFV;;AAIAH,EAAAA,SAAS,GAAGN,UAAU,CAAE,wBAAF,EAA4BM,SAA5B,CAAtB;AAEA,SACC;AAAK,IAAA,SAAS,EAAGA;AAAjB,KACGC,QADH,EAEG,CAAE,GAAGH,OAAL,EAAeM,OAAf,GAAyBC,GAAzB,CAAgCC,MAAF,IAAc;AAC7C,UAAM;AAAEC,MAAAA,OAAF;AAAW,SAAGC;AAAd,QAA6BF,MAAnC;AACA,WACC,cAAC,MAAD,OACME,UADN;AAEC,MAAA,GAAG,EAAGF,MAAM,CAACH,EAFd;AAGC,MAAA,QAAQ,EAAGD,YAAY,CAAEI,MAAM,CAACH,EAAT;AAHxB,OAKGG,MAAM,CAACC,OALV,CADD;AASA,GAXC,CAFH,CADD;AAiBA;;AAED,eAAeV,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport Notice from '.';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { NoticeListProps } from './types';\n\nconst noop = () => {};\n\n/**\n * `NoticeList` is a component used to render a collection of notices.\n *\n *```jsx\n * import { Notice, NoticeList } from `@wordpress/components`;\n *\n * const MyNoticeList = () => {\n *\tconst [ notices, setNotices ] = useState( [\n *\t\t{\n *\t\t\tid: 'second-notice',\n *\t\t\tcontent: 'second notice content',\n *\t\t},\n *\t\t{\n *\t\t\tid: 'fist-notice',\n *\t\t\tcontent: 'first notice content',\n *\t\t},\n *\t] );\n *\n *\tconst removeNotice = ( id ) => {\n *\t\tsetNotices( notices.filter( ( notice ) => notice.id !== id ) );\n *\t};\n *\n *\treturn <NoticeList notices={ notices } onRemove={ removeNotice } />;\n *};\n *```\n */\nfunction NoticeList( {\n\tnotices,\n\tonRemove = noop,\n\tclassName,\n\tchildren,\n}: WordPressComponentProps< NoticeListProps, 'div', false > ) {\n\tconst removeNotice =\n\t\t( id: NoticeListProps[ 'notices' ][ number ][ 'id' ] ) => () =>\n\t\t\tonRemove( id );\n\n\tclassName = classnames( 'components-notice-list', className );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ children }\n\t\t\t{ [ ...notices ].reverse().map( ( notice ) => {\n\t\t\t\tconst { content, ...restNotice } = notice;\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonRemove={ removeNotice( notice.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t</Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nexport default NoticeList;\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -44,10 +43,10 @@ function NoticeList() {
44
43
  return createElement(View, {
45
44
  style: styles.list
46
45
  }, notices.map(notice => {
47
- return createElement(Notice, _extends({}, notice, {
46
+ return createElement(Notice, { ...notice,
48
47
  key: notice.id,
49
48
  onNoticeHidden: onRemoveNotice
50
- }));
49
+ });
51
50
  }));
52
51
  }
53
52
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/notice/list.native.js"],"names":["View","useSelect","useDispatch","store","noticesStore","Notice","styles","useCallback","NoticeList","notices","select","getNotices","removeNotice","onRemoveNotice","id","length","list","map","notice"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,cAArB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,IAAnB;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,SAASC,WAAT,QAA4B,oBAA5B;;AAEA,SAASC,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAcR,SAAS,CAAIS,MAAF,IAAc;AAC5C,UAAM;AAAEC,MAAAA;AAAF,QAAiBD,MAAM,CAAEN,YAAF,CAA7B;AACA,WAAO;AACNK,MAAAA,OAAO,EAAEE,UAAU;AADb,KAAP;AAGA,GAL4B,EAK1B,EAL0B,CAA7B;AAOA,QAAM;AAAEC,IAAAA;AAAF,MAAmBV,WAAW,CAAEE,YAAF,CAApC;AAEA,QAAMS,cAAc,GAAGN,WAAW,CAC/BO,EAAF,IAAU;AACTF,IAAAA,YAAY,CAAEE,EAAF,CAAZ;AACA,GAHgC,EAIjC,CAAEF,YAAF,CAJiC,CAAlC;;AAOA,MAAK,CAAEH,OAAO,CAACM,MAAf,EAAwB;AACvB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGT,MAAM,CAACU;AAArB,KACGP,OAAO,CAACQ,GAAR,CAAeC,MAAF,IAAc;AAC5B,WACC,cAAC,MAAD,eACMA,MADN;AAEC,MAAA,GAAG,EAAGA,MAAM,CAACJ,EAFd;AAGC,MAAA,cAAc,EAAGD;AAHlB,OADD;AAOA,GARC,CADH,CADD;AAaA;;AAED,eAAeL,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport Notice from './';\nimport styles from './style.scss';\nimport { useCallback } from '@wordpress/element';\n\nfunction NoticeList() {\n\tconst { notices } = useSelect( ( select ) => {\n\t\tconst { getNotices } = select( noticesStore );\n\t\treturn {\n\t\t\tnotices: getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst { removeNotice } = useDispatch( noticesStore );\n\n\tconst onRemoveNotice = useCallback(\n\t\t( id ) => {\n\t\t\tremoveNotice( id );\n\t\t},\n\t\t[ removeNotice ]\n\t);\n\n\tif ( ! notices.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<View style={ styles.list }>\n\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...notice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonNoticeHidden={ onRemoveNotice }\n\t\t\t\t\t></Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</View>\n\t);\n}\n\nexport default NoticeList;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/notice/list.native.js"],"names":["View","useSelect","useDispatch","store","noticesStore","Notice","styles","useCallback","NoticeList","notices","select","getNotices","removeNotice","onRemoveNotice","id","length","list","map","notice"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,cAArB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,IAAnB;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,SAASC,WAAT,QAA4B,oBAA5B;;AAEA,SAASC,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAcR,SAAS,CAAIS,MAAF,IAAc;AAC5C,UAAM;AAAEC,MAAAA;AAAF,QAAiBD,MAAM,CAAEN,YAAF,CAA7B;AACA,WAAO;AACNK,MAAAA,OAAO,EAAEE,UAAU;AADb,KAAP;AAGA,GAL4B,EAK1B,EAL0B,CAA7B;AAOA,QAAM;AAAEC,IAAAA;AAAF,MAAmBV,WAAW,CAAEE,YAAF,CAApC;AAEA,QAAMS,cAAc,GAAGN,WAAW,CAC/BO,EAAF,IAAU;AACTF,IAAAA,YAAY,CAAEE,EAAF,CAAZ;AACA,GAHgC,EAIjC,CAAEF,YAAF,CAJiC,CAAlC;;AAOA,MAAK,CAAEH,OAAO,CAACM,MAAf,EAAwB;AACvB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGT,MAAM,CAACU;AAArB,KACGP,OAAO,CAACQ,GAAR,CAAeC,MAAF,IAAc;AAC5B,WACC,cAAC,MAAD,OACMA,MADN;AAEC,MAAA,GAAG,EAAGA,MAAM,CAACJ,EAFd;AAGC,MAAA,cAAc,EAAGD;AAHlB,MADD;AAOA,GARC,CADH,CADD;AAaA;;AAED,eAAeL,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport Notice from './';\nimport styles from './style.scss';\nimport { useCallback } from '@wordpress/element';\n\nfunction NoticeList() {\n\tconst { notices } = useSelect( ( select ) => {\n\t\tconst { getNotices } = select( noticesStore );\n\t\treturn {\n\t\t\tnotices: getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst { removeNotice } = useDispatch( noticesStore );\n\n\tconst onRemoveNotice = useCallback(\n\t\t( id ) => {\n\t\t\tremoveNotice( id );\n\t\t},\n\t\t[ removeNotice ]\n\t);\n\n\tif ( ! notices.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<View style={ styles.list }>\n\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...notice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonNoticeHidden={ onRemoveNotice }\n\t\t\t\t\t></Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</View>\n\t);\n}\n\nexport default NoticeList;\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement, Fragment } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -176,10 +175,10 @@ function UnforwardedNumberControl({
176
175
  }
177
176
  });
178
177
 
179
- return createElement(Input, _extends({
178
+ return createElement(Input, {
180
179
  autoComplete: autoComplete,
181
- inputMode: "numeric"
182
- }, props, {
180
+ inputMode: "numeric",
181
+ ...props,
183
182
  className: classes,
184
183
  dragDirection: dragDirection,
185
184
  hideHTMLArrows: spinControls !== 'native',
@@ -223,7 +222,7 @@ function UnforwardedNumberControl({
223
222
  size: size
224
223
  })))) : suffix,
225
224
  onChange: onChange
226
- }));
225
+ });
227
226
  }
228
227
 
229
228
  export const NumberControl = forwardRef(UnforwardedNumberControl);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/number-control/index.tsx"],"names":["classNames","useRef","forwardRef","isRTL","__","plus","plusIcon","reset","resetIcon","useMergeRefs","deprecated","Input","SpinButton","inputControlActionTypes","add","subtract","roundClamp","ensureNumber","isValueEmpty","HStack","Spacer","noop","UnforwardedNumberControl","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","type","typeProp","value","valueProp","size","suffix","onChange","props","forwardedRef","alternative","since","version","inputRef","mergedRef","isStepAny","baseStep","baseValue","constrainValue","stepOverride","Math","autoComplete","undefined","classes","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","numberControlStateReducer","state","action","nextState","payload","currentValue","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","baseState","NumberControl"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;;AAGA;AACA;AACA;AACA,SAASC,MAAT,EAAiBC,UAAjB,QAAmC,oBAAnC;AACA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,IAAI,IAAIC,QAAjB,EAA2BC,KAAK,IAAIC,SAApC,QAAqD,kBAArD;AACA,SAASC,YAAT,QAA6B,oBAA7B;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,EAAgBC,UAAhB,QAAkC,gCAAlC;AACA,OAAO,KAAKC,uBAAZ,MAAyC,kCAAzC;AACA,SAASC,GAAT,EAAcC,QAAd,EAAwBC,UAAxB,QAA0C,eAA1C;AACA,SAASC,YAAT,EAAuBC,YAAvB,QAA2C,iBAA3C;AAGA,SAASC,MAAT,QAAuB,YAAvB;AACA,SAASC,MAAT,QAA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AASC,MAAA,IAAI,EAAGhD;AATR,MADD,EAYC,cAAC,UAAD;AACC,MAAA,IAAI,EAAGlC,SADR;AAEC,MAAA,OAAO,MAFR;AAGC,qBAAY,MAHb;AAIC,oBAAaJ,EAAE,CAAE,WAAF,CAJhB;AAKC,MAAA,QAAQ,EAAG,CAAC,CALb;AAMC,MAAA,OAAO,EAAGsF,2BAA2B,CACpC,MADoC,CANtC;AASC,MAAA,IAAI,EAAGhD;AATR,MAZD,CADD,CAFD,CADD,GA+BCC,MAtDH;AAyDC,IAAA,QAAQ,EAAGC;AAzDZ,KADD;AA6DA;;AAED,OAAO,MAAMmD,aAAa,GAAG7F,UAAU,CAAEoB,wBAAF,CAAhC;AAEP,eAAeyE,aAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport type { WordPressComponentProps } from '../ui/context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\t{\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = 'native',\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t...props\n\t}: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'wp.components.NumberControl hideHTMLArrows prop ', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t\tspinControls = 'none';\n\t}\n\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst mergedRef = useMergeRefs( [ inputRef, forwardedRef ] );\n\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : ensureNumber( step );\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = (\n\t\tvalue: number | string,\n\t\tstepOverride?: number\n\t) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\treturn isStepAny\n\t\t\t? Math.min( max, Math.max( min, ensureNumber( value ) ) )\n\t\t\t: roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : undefined;\n\tconst classes = classNames( 'components-number-control', className );\n\n\tconst spinValue = (\n\t\tvalue: string | number | undefined,\n\t\tdirection: 'up' | 'down',\n\t\tevent: KeyboardEvent | MouseEvent | undefined\n\t) => {\n\t\tevent?.preventDefault();\n\t\tconst shift = event?.shiftKey && isShiftStepEnabled;\n\t\tconst delta = shift ? ensureNumber( shiftStep ) * baseStep : baseStep;\n\t\tlet nextValue = isValueEmpty( value ) ? baseValue : value;\n\t\tif ( direction === 'up' ) {\n\t\t\tnextValue = add( nextValue, delta );\n\t\t} else if ( direction === 'down' ) {\n\t\t\tnextValue = subtract( nextValue, delta );\n\t\t}\n\t\treturn constrainValue( nextValue, shift ? delta : undefined );\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer: NumberControlProps[ '__unstableStateReducer' ] =\n\t\t( state, action ) => {\n\t\t\tconst nextState = { ...state };\n\n\t\t\tconst { type, payload } = action;\n\t\t\tconst event = payload.event;\n\t\t\tconst currentValue = nextState.value;\n\n\t\t\t/**\n\t\t\t * Handles custom UP and DOWN Keyboard events\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t\t) {\n\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\tnextState.value = spinValue(\n\t\t\t\t\tcurrentValue,\n\t\t\t\t\ttype === inputControlActionTypes.PRESS_UP ? 'up' : 'down',\n\t\t\t\t\tevent as KeyboardEvent | undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles drag to update events\n\t\t\t */\n\t\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\t\tconst [ x, y ] = payload.delta;\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseStep\n\t\t\t\t\t: baseStep;\n\n\t\t\t\tlet directionModifier;\n\t\t\t\tlet delta;\n\n\t\t\t\tswitch ( dragDirection ) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( delta !== 0 ) {\n\t\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\t\tenableShift ? modifier : undefined\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles commit (ENTER key press or blur)\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t\t) {\n\t\t\t\tconst applyEmptyValue =\n\t\t\t\t\trequired === false && currentValue === '';\n\n\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\tnextState.value = applyEmptyValue\n\t\t\t\t\t? currentValue\n\t\t\t\t\t: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t constrainValue( currentValue );\n\t\t\t}\n\n\t\t\treturn nextState;\n\t\t};\n\n\tconst buildSpinButtonClickHandler =\n\t\t( direction: 'up' | 'down' ) =>\n\t\t( event: MouseEvent< HTMLButtonElement > ) =>\n\t\t\tonChange( String( spinValue( valueProp, direction, event ) ), {\n\t\t\t\t// Set event.target to the <input> so that consumers can use\n\t\t\t\t// e.g. event.target.validity.\n\t\t\t\tevent: {\n\t\t\t\t\t...event,\n\t\t\t\t\ttarget: inputRef.current!,\n\t\t\t\t},\n\t\t\t} );\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...props }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ spinControls !== 'native' }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ mergedRef }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ ( state, action ) => {\n\t\t\t\tconst baseState = numberControlStateReducer( state, action );\n\t\t\t\treturn stateReducerProp?.( baseState, action ) ?? baseState;\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t\tsuffix={\n\t\t\t\tspinControls === 'custom' ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t<Spacer marginBottom={ 0 } marginRight={ 2 }>\n\t\t\t\t\t\t\t<HStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\taria-label={ __( 'Increment' ) }\n\t\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'up'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\taria-label={ __( 'Decrement' ) }\n\t\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'down'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tsuffix\n\t\t\t\t)\n\t\t\t}\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport const NumberControl = forwardRef( UnforwardedNumberControl );\n\nexport default NumberControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/number-control/index.tsx"],"names":["classNames","useRef","forwardRef","isRTL","__","plus","plusIcon","reset","resetIcon","useMergeRefs","deprecated","Input","SpinButton","inputControlActionTypes","add","subtract","roundClamp","ensureNumber","isValueEmpty","HStack","Spacer","noop","UnforwardedNumberControl","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","type","typeProp","value","valueProp","size","suffix","onChange","props","forwardedRef","alternative","since","version","inputRef","mergedRef","isStepAny","baseStep","baseValue","constrainValue","stepOverride","Math","autoComplete","undefined","classes","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","numberControlStateReducer","state","action","nextState","payload","currentValue","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","baseState","NumberControl"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;;AAGA;AACA;AACA;AACA,SAASC,MAAT,EAAiBC,UAAjB,QAAmC,oBAAnC;AACA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,IAAI,IAAIC,QA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YAAY,KAAK,QAAjB,GACC,8BACGe,MADH,EAEC,cAAC,MAAD;AAAQ,MAAA,YAAY,EAAG,CAAvB;AAA2B,MAAA,WAAW,EAAG;AAAzC,OACC,cAAC,MAAD;AAAQ,MAAA,OAAO,EAAG;AAAlB,OACC,cAAC,UAAD;AACC,MAAA,IAAI,EAAGrC,QADR;AAEC,MAAA,OAAO,MAFR;AAGC,qBAAY,MAHb;AAIC,oBAAaF,EAAE,CAAE,WAAF,CAJhB;AAKC,MAAA,QAAQ,EAAG,CAAC,CALb;AAMC,MAAA,OAAO,EAAGsF,2BAA2B,CACpC,IADoC,CANtC;AASC,MAAA,IAAI,EAAGhD;AATR,MADD,EAYC,cAAC,UAAD;AACC,MAAA,IAAI,EAAGlC,SADR;AAEC,MAAA,OAAO,MAFR;AAGC,qBAAY,MAHb;AAIC,oBAAaJ,EAAE,CAAE,WAAF,CAJhB;AAKC,MAAA,QAAQ,EAAG,CAAC,CALb;AAMC,MAAA,OAAO,EAAGsF,2BAA2B,CACpC,MADoC,CANtC;AASC,MAAA,IAAI,EAAGhD;AATR,MAZD,CADD,CAFD,CADD,GA+BCC,MAtDH;AAyDC,IAAA,QAAQ,EAAGC;AAzDZ,IADD;AA6DA;;AAED,OAAO,MAAMmD,aAAa,GAAG7F,UAAU,CAAEoB,wBAAF,CAAhC;AAEP,eAAeyE,aAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport type { WordPressComponentProps } from '../ui/context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\t{\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = 'native',\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t...props\n\t}: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'wp.components.NumberControl hideHTMLArrows prop ', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t\tspinControls = 'none';\n\t}\n\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst mergedRef = useMergeRefs( [ inputRef, forwardedRef ] );\n\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : ensureNumber( step );\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = (\n\t\tvalue: number | string,\n\t\tstepOverride?: number\n\t) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\treturn isStepAny\n\t\t\t? Math.min( max, Math.max( min, ensureNumber( value ) ) )\n\t\t\t: roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : undefined;\n\tconst classes = classNames( 'components-number-control', className );\n\n\tconst spinValue = (\n\t\tvalue: string | number | undefined,\n\t\tdirection: 'up' | 'down',\n\t\tevent: KeyboardEvent | MouseEvent | undefined\n\t) => {\n\t\tevent?.preventDefault();\n\t\tconst shift = event?.shiftKey && isShiftStepEnabled;\n\t\tconst delta = shift ? ensureNumber( shiftStep ) * baseStep : baseStep;\n\t\tlet nextValue = isValueEmpty( value ) ? baseValue : value;\n\t\tif ( direction === 'up' ) {\n\t\t\tnextValue = add( nextValue, delta );\n\t\t} else if ( direction === 'down' ) {\n\t\t\tnextValue = subtract( nextValue, delta );\n\t\t}\n\t\treturn constrainValue( nextValue, shift ? delta : undefined );\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer: NumberControlProps[ '__unstableStateReducer' ] =\n\t\t( state, action ) => {\n\t\t\tconst nextState = { ...state };\n\n\t\t\tconst { type, payload } = action;\n\t\t\tconst event = payload.event;\n\t\t\tconst currentValue = nextState.value;\n\n\t\t\t/**\n\t\t\t * Handles custom UP and DOWN Keyboard events\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t\t) {\n\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\tnextState.value = spinValue(\n\t\t\t\t\tcurrentValue,\n\t\t\t\t\ttype === inputControlActionTypes.PRESS_UP ? 'up' : 'down',\n\t\t\t\t\tevent as KeyboardEvent | undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles drag to update events\n\t\t\t */\n\t\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\t\tconst [ x, y ] = payload.delta;\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseStep\n\t\t\t\t\t: baseStep;\n\n\t\t\t\tlet directionModifier;\n\t\t\t\tlet delta;\n\n\t\t\t\tswitch ( dragDirection ) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( delta !== 0 ) {\n\t\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\t\tenableShift ? modifier : undefined\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles commit (ENTER key press or blur)\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t\t) {\n\t\t\t\tconst applyEmptyValue =\n\t\t\t\t\trequired === false && currentValue === '';\n\n\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\tnextState.value = applyEmptyValue\n\t\t\t\t\t? currentValue\n\t\t\t\t\t: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t constrainValue( currentValue );\n\t\t\t}\n\n\t\t\treturn nextState;\n\t\t};\n\n\tconst buildSpinButtonClickHandler =\n\t\t( direction: 'up' | 'down' ) =>\n\t\t( event: MouseEvent< HTMLButtonElement > ) =>\n\t\t\tonChange( String( spinValue( valueProp, direction, event ) ), {\n\t\t\t\t// Set event.target to the <input> so that consumers can use\n\t\t\t\t// e.g. event.target.validity.\n\t\t\t\tevent: {\n\t\t\t\t\t...event,\n\t\t\t\t\ttarget: inputRef.current!,\n\t\t\t\t},\n\t\t\t} );\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...props }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ spinControls !== 'native' }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ mergedRef }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ ( state, action ) => {\n\t\t\t\tconst baseState = numberControlStateReducer( state, action );\n\t\t\t\treturn stateReducerProp?.( baseState, action ) ?? baseState;\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t\tsuffix={\n\t\t\t\tspinControls === 'custom' ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t<Spacer marginBottom={ 0 } marginRight={ 2 }>\n\t\t\t\t\t\t\t<HStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\taria-label={ __( 'Increment' ) }\n\t\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'up'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\taria-label={ __( 'Decrement' ) }\n\t\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'down'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tsuffix\n\t\t\t\t)\n\t\t\t}\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport const NumberControl = forwardRef( UnforwardedNumberControl );\n\nexport default NumberControl;\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement, Fragment } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -95,9 +94,9 @@ function ColorPickerPopover({
95
94
  ...receivedPopoverProps,
96
95
  className: classnames('components-palette-edit__popover', receivedPopoverProps?.className)
97
96
  }), [receivedPopoverProps]);
98
- return createElement(Popover, _extends({}, popoverProps, {
97
+ return createElement(Popover, { ...popoverProps,
99
98
  onClose: onClose
100
- }), !isGradient && createElement(ColorPicker, {
99
+ }, !isGradient && createElement(ColorPicker, {
101
100
  color: element.color,
102
101
  enableAlpha: true,
103
102
  onChange: newColor => {
@@ -140,17 +139,18 @@ function Option({
140
139
  // Use the custom palette color item as the popover anchor.
141
140
  anchor: popoverAnchor
142
141
  }), [popoverAnchor, receivedPopoverProps]);
143
- return createElement(PaletteItem, _extends({
142
+ return createElement(PaletteItem, {
144
143
  className: isEditing ? 'is-selected' : undefined,
145
144
  as: "div",
146
145
  onClick: onStartEditing,
147
- ref: setPopoverAnchor
148
- }, isEditing ? { ...focusOutsideProps
149
- } : {
150
- style: {
151
- cursor: 'pointer'
152
- }
153
- }), createElement(HStack, {
146
+ ref: setPopoverAnchor,
147
+ ...(isEditing ? { ...focusOutsideProps
148
+ } : {
149
+ style: {
150
+ cursor: 'pointer'
151
+ }
152
+ })
153
+ }, createElement(HStack, {
154
154
  justify: "flex-start"
155
155
  }, createElement(FlexItem, null, createElement(IndicatorStyled, {
156
156
  style: {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/palette-edit/index.tsx"],"names":["classnames","paramCase","kebabCase","useState","useRef","useEffect","useCallback","useMemo","__","sprintf","lineSolid","moreVertical","plus","__experimentalUseFocusOutside","useFocusOutside","useDebounce","Button","ColorPicker","FlexItem","HStack","ItemGroup","VStack","GradientPicker","ColorPalette","DropdownMenu","Popover","PaletteActionsContainer","PaletteEditStyles","PaletteHeading","PaletteHStackHeader","IndicatorStyled","PaletteItem","NameContainer","NameInputControl","DoneButton","RemoveButton","NavigableMenu","DEFAULT_GRADIENT","CustomGradientPicker","DEFAULT_COLOR","NameInput","value","onChange","label","getNameForPosition","elements","slugPrefix","temporaryNameRegex","RegExp","position","reduce","previousValue","currentValue","slug","matches","match","id","parseInt","ColorPickerPopover","isGradient","element","popoverProps","receivedPopoverProps","onClose","shift","offset","placement","className","color","newColor","gradient","newGradient","Option","canOnlyChangeValues","isEditing","onStartEditing","onRemove","onStopEditing","focusOutsideProps","popoverAnchor","setPopoverAnchor","anchor","undefined","style","cursor","background","name","nextName","isTemporaryElement","regex","test","PaletteEditListView","editingElement","setEditingElement","elementsReference","current","some","newElements","filter","length","debounceOnChange","map","index","newElement","currentElement","currentIndex","_currentElement","EMPTY_ARRAY","PaletteEdit","gradients","colors","paletteLabel","paletteLabelHeadingLevel","emptyMessage","canReset","setIsEditing","isAdding","elementsLength","hasElements","onSelectPaletteItem","newEditingElementIndex","selectedElement","key","tempOptionName","isSmall"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,SAAS,IAAIC,SAAtB,QAAuC,aAAvC;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,MAFD,EAGCC,SAHD,EAICC,WAJD,EAKCC,OALD,QAMO,oBANP;AAOA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,SAAT,EAAoBC,YAApB,EAAkCC,IAAlC,QAA8C,kBAA9C;AACA,SACCC,6BAA6B,IAAIC,eADlC,EAECC,WAFD,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,QAAT,QAAyB,SAAzB;AACA,SAASC,MAAT,QAAuB,YAAvB;AACA,SAASC,SAAT,QAA0B,eAA1B;AACA,SAASC,MAAT,QAAuB,YAAvB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,SACCC,uBADD,EAECC,iBAFD,EAGCC,cAHD,EAICC,mBAJD,EAKCC,eALD,EAMCC,WAND,EAOCC,aAPD,EAQCC,gBARD,EASCC,UATD,EAUCC,YAVD,QAWO,UAXP;AAYA,SAASC,aAAT,QAA8B,wBAA9B;AACA,SAASC,gBAAT,QAAiC,qCAAjC;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AAYA,MAAMC,aAAa,GAAG,MAAtB;;AAEA,SAASC,SAAT,CAAoB;AAAEC,EAAAA,KAAF;AAASC,EAAAA,QA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AAGC,iBANrB;AAOC,IAAA,UAAU,EAAG/C,UAPd;AAQC,IAAA,UAAU,EAAGa,UARd;AASC,IAAA,YAAY,EAAGE;AAThB,IAFF,EAcG,CAAEa,SAAF,IAAekB,cAAc,KAAK,IAAlC,IACD,cAAC,kBAAD;AACC,IAAA,UAAU,EAAGjC,UADd;AAEC,IAAA,OAAO,EAAG,MAAMkC,iBAAiB,CAAE,IAAF,CAFlC;AAGC,IAAA,QAAQ,EACPU,UADU,IAEN;AACJH,MAAAA,gBAAgB,EACf;AACAvD,MAAAA,QAAQ,CAACwD,GAAT,CACC,CACCG,cADD,EAECC,YAFD,KAGK;AACJ,YACCA,YAAY,KAAKb,cADlB,EAEE;AACD,iBAAOW,UAAP;AACA;;AACD,eAAOC,cAAP;AACA,OAXF,CAFe,CAAhB;AAgBA,KAtBF;AAuBC,IAAA,OAAO,EAAG3D,QAAQ,CAAE+C,cAAF,aAAEA,cAAF,cAAEA,cAAF,GAAoB,CAAC,CAArB,CAvBnB;AAwBC,IAAA,YAAY,EAAG/B;AAxBhB,IAfF,EA0CG,CAAEa,SAAF,KACCf,UAAU,GACX,cAAC,cAAD;AACC,IAAA,iBAAiB,MADlB;AAEC,IAAA,SAAS,EAAGkD,SAFb;AAGC,IAAA,QAAQ,EAAGU,mBAHZ;AAIC,IAAA,SAAS,EAAG,KAJb;AAKC,IAAA,sBAAsB,EAAG;AAL1B,IADW,GASX,cAAC,YAAD;AACC,IAAA,MAAM,EAAGT,MADV;AAEC,IAAA,QAAQ,EAAGS,mBAFZ;AAGC,IAAA,SAAS,EAAG,KAHb;AAIC,IAAA,mBAAmB,EAAG;AAJvB,IAVA,CA1CH,CA1IF,EAuMG,CAAED,WAAF,IAAiBL,YAvMpB,CADD;AA2MA;AAED,eAAeL,WAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseRef,\n\tuseEffect,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { lineSolid, moreVertical, plus } from '@wordpress/icons';\nimport {\n\t__experimentalUseFocusOutside as useFocusOutside,\n\tuseDebounce,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { ColorPicker } from '../color-picker';\nimport { FlexItem } from '../flex';\nimport { HStack } from '../h-stack';\nimport { ItemGroup } from '../item-group';\nimport { VStack } from '../v-stack';\nimport GradientPicker from '../gradient-picker';\nimport ColorPalette from '../color-palette';\nimport DropdownMenu from '../dropdown-menu';\nimport Popover from '../popover';\nimport {\n\tPaletteActionsContainer,\n\tPaletteEditStyles,\n\tPaletteHeading,\n\tPaletteHStackHeader,\n\tIndicatorStyled,\n\tPaletteItem,\n\tNameContainer,\n\tNameInputControl,\n\tDoneButton,\n\tRemoveButton,\n} from './styles';\nimport { NavigableMenu } from '../navigable-container';\nimport { DEFAULT_GRADIENT } from '../custom-gradient-picker/constants';\nimport CustomGradientPicker from '../custom-gradient-picker';\nimport type {\n\tColor,\n\tColorPickerPopoverProps,\n\tGradient,\n\tNameInputProps,\n\tOptionProps,\n\tPaletteEditListViewProps,\n\tPaletteEditProps,\n\tPaletteElement,\n} from './types';\n\nconst DEFAULT_COLOR = '#000';\n\nfunction NameInput( { value, onChange, label }: NameInputProps ) {\n\treturn (\n\t\t<NameInputControl\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\n/**\n * Returns a temporary name for a palette item in the format \"Color + id\".\n * To ensure there are no duplicate ids, this function checks all slugs for temporary names.\n * It expects slugs to be in the format: slugPrefix + color- + number.\n * It then sets the id component of the new name based on the incremented id of the highest existing slug id.\n *\n * @param elements An array of color palette items.\n * @param slugPrefix The slug prefix used to match the element slug.\n *\n * @return A unique name for a palette item.\n */\nexport function getNameForPosition(\n\telements: PaletteElement[],\n\tslugPrefix: string\n) {\n\tconst temporaryNameRegex = new RegExp( `^${ slugPrefix }color-([\\\\d]+)$` );\n\tconst position = elements.reduce( ( previousValue, currentValue ) => {\n\t\tif ( typeof currentValue?.slug === 'string' ) {\n\t\t\tconst matches = currentValue?.slug.match( temporaryNameRegex );\n\t\t\tif ( matches ) {\n\t\t\t\tconst id = parseInt( matches[ 1 ], 10 );\n\t\t\t\tif ( id >= previousValue ) {\n\t\t\t\t\treturn id + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn previousValue;\n\t}, 1 );\n\n\treturn sprintf(\n\t\t/* translators: %s: is a temporary id for a custom color */\n\t\t__( 'Color %s' ),\n\t\tposition\n\t);\n}\n\nfunction ColorPickerPopover< T extends Color | Gradient >( {\n\tisGradient,\n\telement,\n\tonChange,\n\tpopoverProps: receivedPopoverProps,\n\tonClose = () => {},\n}: ColorPickerPopoverProps< T > ) {\n\tconst popoverProps: ColorPickerPopoverProps< T >[ 'popoverProps' ] =\n\t\tuseMemo(\n\t\t\t() => ( {\n\t\t\t\tshift: true,\n\t\t\t\toffset: 20,\n\t\t\t\tplacement: 'left-start',\n\t\t\t\t...receivedPopoverProps,\n\t\t\t\tclassName: classnames(\n\t\t\t\t\t'components-palette-edit__popover',\n\t\t\t\t\treceivedPopoverProps?.className\n\t\t\t\t),\n\t\t\t} ),\n\t\t\t[ receivedPopoverProps ]\n\t\t);\n\n\treturn (\n\t\t<Popover { ...popoverProps } onClose={ onClose }>\n\t\t\t{ ! isGradient && (\n\t\t\t\t<ColorPicker\n\t\t\t\t\tcolor={ element.color }\n\t\t\t\t\tenableAlpha\n\t\t\t\t\tonChange={ ( newColor ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\tcolor: newColor,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isGradient && (\n\t\t\t\t<div className=\"components-palette-edit__popover-gradient-picker\">\n\t\t\t\t\t<CustomGradientPicker\n\t\t\t\t\t\t__nextHasNoMargin\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tvalue={ element.gradient }\n\t\t\t\t\t\tonChange={ ( newGradient ) => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\t\tgradient: newGradient,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</Popover>\n\t);\n}\n\nfunction Option< T extends Color | Gradient >( {\n\tcanOnlyChangeValues,\n\telement,\n\tonChange,\n\tisEditing,\n\tonStartEditing,\n\tonRemove,\n\tonStopEditing,\n\tpopoverProps: receivedPopoverProps,\n\tslugPrefix,\n\tisGradient,\n}: OptionProps< T > ) {\n\tconst focusOutsideProps = useFocusOutside( onStopEditing );\n\tconst value = isGradient ? element.gradient : element.color;\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 [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t...receivedPopoverProps,\n\t\t\t// Use the custom palette color item as the popover anchor.\n\t\t\tanchor: popoverAnchor,\n\t\t} ),\n\t\t[ popoverAnchor, receivedPopoverProps ]\n\t);\n\n\treturn (\n\t\t<PaletteItem\n\t\t\tclassName={ isEditing ? 'is-selected' : undefined }\n\t\t\tas=\"div\"\n\t\t\tonClick={ onStartEditing }\n\t\t\tref={ setPopoverAnchor }\n\t\t\t{ ...( isEditing\n\t\t\t\t? { ...focusOutsideProps }\n\t\t\t\t: {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t},\n\t\t\t\t } ) }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<IndicatorStyled\n\t\t\t\t\t\tstyle={ { background: value, color: 'transparent' } }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t{ isEditing && ! canOnlyChangeValues ? (\n\t\t\t\t\t\t<NameInput\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t? __( 'Gradient name' )\n\t\t\t\t\t\t\t\t\t: __( 'Color name' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ element.name }\n\t\t\t\t\t\t\tonChange={ ( nextName?: string ) =>\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\t\t\tname: nextName,\n\t\t\t\t\t\t\t\t\tslug:\n\t\t\t\t\t\t\t\t\t\tslugPrefix +\n\t\t\t\t\t\t\t\t\t\tkebabCase( nextName ?? '' ),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<NameContainer>{ element.name }</NameContainer>\n\t\t\t\t\t) }\n\t\t\t\t</FlexItem>\n\t\t\t\t{ isEditing && ! canOnlyChangeValues && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<RemoveButton\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\ticon={ lineSolid }\n\t\t\t\t\t\t\tlabel={ __( 'Remove color' ) }\n\t\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ isEditing && (\n\t\t\t\t<ColorPickerPopover\n\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\telement={ element }\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</PaletteItem>\n\t);\n}\n\nfunction isTemporaryElement(\n\tslugPrefix: string,\n\t{ slug, color, gradient }: Color | Gradient\n) {\n\tconst regex = new RegExp( `^${ slugPrefix }color-([\\\\d]+)$` );\n\treturn (\n\t\tregex.test( slug ) &&\n\t\t( ( !! color && color === DEFAULT_COLOR ) ||\n\t\t\t( !! gradient && gradient === DEFAULT_GRADIENT ) )\n\t);\n}\n\nfunction PaletteEditListView< T extends Color | Gradient >( {\n\telements,\n\tonChange,\n\teditingElement,\n\tsetEditingElement,\n\tcanOnlyChangeValues,\n\tslugPrefix,\n\tisGradient,\n\tpopoverProps,\n}: PaletteEditListViewProps< T > ) {\n\t// When unmounting the component if there are empty elements (the user did not complete the insertion) clean them.\n\tconst elementsReference = useRef< typeof elements >();\n\tuseEffect( () => {\n\t\telementsReference.current = elements;\n\t}, [ elements ] );\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif (\n\t\t\t\telementsReference.current?.some( ( element ) =>\n\t\t\t\t\tisTemporaryElement( slugPrefix, element )\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tconst newElements = elementsReference.current.filter(\n\t\t\t\t\t( element ) => ! isTemporaryElement( slugPrefix, element )\n\t\t\t\t);\n\t\t\t\tonChange( newElements.length ? newElements : undefined );\n\t\t\t}\n\t\t};\n\t\t// Disable reason: adding the missing dependency here would cause breaking changes that will require\n\t\t// a heavier refactor to avoid. See https://github.com/WordPress/gutenberg/pull/43911\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tconst debounceOnChange = useDebounce( onChange, 100 );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<ItemGroup isRounded>\n\t\t\t\t{ elements.map( ( element, index ) => (\n\t\t\t\t\t<Option\n\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\tcanOnlyChangeValues={ canOnlyChangeValues }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\telement={ element }\n\t\t\t\t\t\tonStartEditing={ () => {\n\t\t\t\t\t\t\tif ( editingElement !== index ) {\n\t\t\t\t\t\t\t\tsetEditingElement( index );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ ( newElement ) => {\n\t\t\t\t\t\t\tdebounceOnChange(\n\t\t\t\t\t\t\t\telements.map(\n\t\t\t\t\t\t\t\t\t( currentElement, currentIndex ) => {\n\t\t\t\t\t\t\t\t\t\tif ( currentIndex === index ) {\n\t\t\t\t\t\t\t\t\t\t\treturn newElement;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn currentElement;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\tsetEditingElement( null );\n\t\t\t\t\t\t\tconst newElements = elements.filter(\n\t\t\t\t\t\t\t\t( _currentElement, currentIndex ) => {\n\t\t\t\t\t\t\t\t\tif ( currentIndex === index ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\tnewElements.length ? newElements : undefined\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisEditing={ index === editingElement }\n\t\t\t\t\t\tonStopEditing={ () => {\n\t\t\t\t\t\t\tif ( index === editingElement ) {\n\t\t\t\t\t\t\t\tsetEditingElement( null );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tslugPrefix={ slugPrefix }\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</VStack>\n\t);\n}\n\nconst EMPTY_ARRAY: Color[] = [];\n\n/**\n * Allows editing a palette of colors or gradients.\n *\n * ```jsx\n * import { PaletteEdit } from '@wordpress/components';\n * const MyPaletteEdit = () => {\n * const [ controlledColors, setControlledColors ] = useState( colors );\n *\n * return (\n * <PaletteEdit\n * colors={ controlledColors }\n * onChange={ ( newColors?: Color[] ) => {\n * setControlledColors( newColors );\n * } }\n * paletteLabel=\"Here is a label\"\n * />\n * );\n * };\n * ```\n */\nexport function PaletteEdit( {\n\tgradients,\n\tcolors = EMPTY_ARRAY,\n\tonChange,\n\tpaletteLabel,\n\tpaletteLabelHeadingLevel = 2,\n\temptyMessage,\n\tcanOnlyChangeValues,\n\tcanReset,\n\tslugPrefix = '',\n\tpopoverProps,\n}: PaletteEditProps ) {\n\tconst isGradient = !! gradients;\n\tconst elements = isGradient ? gradients : colors;\n\tconst [ isEditing, setIsEditing ] = useState( false );\n\tconst [ editingElement, setEditingElement ] = useState<\n\t\tnumber | null | undefined\n\t>( null );\n\tconst isAdding =\n\t\tisEditing &&\n\t\t!! editingElement &&\n\t\telements[ editingElement ] &&\n\t\t! elements[ editingElement ].slug;\n\tconst elementsLength = elements.length;\n\tconst hasElements = elementsLength > 0;\n\tconst debounceOnChange = useDebounce( onChange, 100 );\n\tconst onSelectPaletteItem = useCallback(\n\t\t(\n\t\t\tvalue?: PaletteElement[ keyof PaletteElement ],\n\t\t\tnewEditingElementIndex?: number\n\t\t) => {\n\t\t\tconst selectedElement =\n\t\t\t\tnewEditingElementIndex === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: elements[ newEditingElementIndex ];\n\t\t\tconst key = isGradient ? 'gradient' : 'color';\n\t\t\t// Ensures that the index returned matches a known element value.\n\t\t\tif ( !! selectedElement && selectedElement[ key ] === value ) {\n\t\t\t\tsetEditingElement( newEditingElementIndex );\n\t\t\t} else {\n\t\t\t\tsetIsEditing( true );\n\t\t\t}\n\t\t},\n\t\t[ isGradient, elements ]\n\t);\n\n\treturn (\n\t\t<PaletteEditStyles>\n\t\t\t<PaletteHStackHeader>\n\t\t\t\t<PaletteHeading level={ paletteLabelHeadingLevel }>\n\t\t\t\t\t{ paletteLabel }\n\t\t\t\t</PaletteHeading>\n\t\t\t\t<PaletteActionsContainer>\n\t\t\t\t\t{ hasElements && isEditing && (\n\t\t\t\t\t\t<DoneButton\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetIsEditing( false );\n\t\t\t\t\t\t\t\tsetEditingElement( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Done' ) }\n\t\t\t\t\t\t</DoneButton>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! canOnlyChangeValues && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\tisPressed={ isAdding }\n\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t? __( 'Add gradient' )\n\t\t\t\t\t\t\t\t\t: __( 'Add color' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tconst tempOptionName = getNameForPosition(\n\t\t\t\t\t\t\t\t\telements,\n\t\t\t\t\t\t\t\t\tslugPrefix\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif ( !! gradients ) {\n\t\t\t\t\t\t\t\t\tonChange( [\n\t\t\t\t\t\t\t\t\t\t...gradients,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tgradient: DEFAULT_GRADIENT,\n\t\t\t\t\t\t\t\t\t\t\tname: tempOptionName,\n\t\t\t\t\t\t\t\t\t\t\tslug:\n\t\t\t\t\t\t\t\t\t\t\t\tslugPrefix +\n\t\t\t\t\t\t\t\t\t\t\t\tkebabCase( tempOptionName ),\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} else {\n\t\t\t\t\t\t\t\t\tonChange( [\n\t\t\t\t\t\t\t\t\t\t...colors,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcolor: DEFAULT_COLOR,\n\t\t\t\t\t\t\t\t\t\t\tname: tempOptionName,\n\t\t\t\t\t\t\t\t\t\t\tslug:\n\t\t\t\t\t\t\t\t\t\t\t\tslugPrefix +\n\t\t\t\t\t\t\t\t\t\t\t\tkebabCase( tempOptionName ),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetIsEditing( true );\n\t\t\t\t\t\t\t\tsetEditingElement( elements.length );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ hasElements &&\n\t\t\t\t\t\t( ! isEditing ||\n\t\t\t\t\t\t\t! canOnlyChangeValues ||\n\t\t\t\t\t\t\tcanReset ) && (\n\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t\t? __( 'Gradient options' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Color options' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ( { onClose }: { onClose: () => void } ) => (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<NavigableMenu role=\"menu\">\n\t\t\t\t\t\t\t\t\t\t\t{ ! isEditing && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsEditing( true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-palette-edit__menu-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Show details' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t{ ! canOnlyChangeValues && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetEditingElement(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsEditing( false );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-palette-edit__menu-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isGradient\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove all gradients'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove all colors'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t{ canReset && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetEditingElement(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isGradient\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Reset gradient' )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Reset colors' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t) }\n\t\t\t\t</PaletteActionsContainer>\n\t\t\t</PaletteHStackHeader>\n\t\t\t{ hasElements && (\n\t\t\t\t<>\n\t\t\t\t\t{ isEditing && (\n\t\t\t\t\t\t<PaletteEditListView< ( typeof elements )[ number ] >\n\t\t\t\t\t\t\tcanOnlyChangeValues={ canOnlyChangeValues }\n\t\t\t\t\t\t\telements={ elements }\n\t\t\t\t\t\t\t// @ts-expect-error TODO: Don't know how to resolve\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\teditingElement={ editingElement }\n\t\t\t\t\t\t\tsetEditingElement={ setEditingElement }\n\t\t\t\t\t\t\tslugPrefix={ slugPrefix }\n\t\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isEditing && editingElement !== null && (\n\t\t\t\t\t\t<ColorPickerPopover\n\t\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\t\tonClose={ () => setEditingElement( null ) }\n\t\t\t\t\t\t\tonChange={ (\n\t\t\t\t\t\t\t\tnewElement: ( typeof elements )[ number ]\n\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\tdebounceOnChange(\n\t\t\t\t\t\t\t\t\t// @ts-expect-error TODO: Don't know how to resolve\n\t\t\t\t\t\t\t\t\telements.map(\n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\tcurrentElement: ( typeof elements )[ number ],\n\t\t\t\t\t\t\t\t\t\t\tcurrentIndex: number\n\t\t\t\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tcurrentIndex === editingElement\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn newElement;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn currentElement;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\telement={ elements[ editingElement ?? -1 ] }\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isEditing &&\n\t\t\t\t\t\t( isGradient ? (\n\t\t\t\t\t\t\t<GradientPicker\n\t\t\t\t\t\t\t\t__nextHasNoMargin\n\t\t\t\t\t\t\t\tgradients={ gradients }\n\t\t\t\t\t\t\t\tonChange={ onSelectPaletteItem }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t\tdisableCustomGradients={ true }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\t\t\tonChange={ onSelectPaletteItem }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t\tdisableCustomColors={ true }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ ! hasElements && emptyMessage }\n\t\t</PaletteEditStyles>\n\t);\n}\n\nexport default PaletteEdit;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/palette-edit/index.tsx"],"names":["classnames","paramCase","kebabCase","useState","useRef","useEffect","useCallback","useMemo","__","sprintf","lineSolid","moreVertical","plus","__experimentalUseFocusOutside","useFocusOutside","useDebounce","Button","ColorPicker","FlexItem","HStack","ItemGroup","VStack","GradientPicker","ColorPalette","DropdownMenu","Popover","PaletteActionsContainer","PaletteEditStyles","PaletteHeading","PaletteHStackHeader","IndicatorStyled","PaletteItem","NameContainer","NameInputControl","DoneButton","RemoveButton","NavigableMenu","DEFAULT_GRADIENT","CustomGradientPicker","DEFAULT_COLOR","NameInput","value","onChange","label","getNameForPosition","elements","slugPrefix","temporaryNameRegex","RegExp","position","reduce","previousValue","currentValue","slug","matches","match","id","parseInt","ColorPickerPopover","isGradient","element","popoverProps","receivedPopoverProps","onClose","shift","offset","placement","className","color","newColor","gradient","newGradient","Option","canOnlyChangeValues","isEditing","onStartEditing","onRemove","onStopEditing","focusOutsideProps","popoverAnchor","setPopoverAnchor","anchor","undefined","style","cursor","background","name","nextName","isTemporaryElement","regex","test","PaletteEditListView","editingElement","setEditingElement","elementsReference","current","some","newElements","filter","length","debounceOnChange","map","index","newElement","currentElement","currentIndex","_currentElement","EMPTY_ARRAY","PaletteEdit","gradients","colors","paletteLabel","paletteLabelHeadingLevel","emptyMessage","canReset","setIsEditing","isAdding","elementsLength","hasElements","onSelectPaletteItem","newEditingElementIndex","selectedElement","key","tempOptionName","isSmall"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,SAAS,IAAIC,SAAtB,QAAuC,aAAvC;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,MAFD,EAGCC,SAHD,EAICC,WAJD,EAKCC,OALD,QAMO,oBANP;AAOA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,SAAT,EAAoBC,YAApB,EAAkCC,IAAlC,QAA8C,kBAA9C;AACA,SACCC,6BAA6B,IAAIC,eADlC,EAECC,WAFD,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,QAAT,QAAyB,SAAzB;AACA,SAASC,MAAT,QAAuB,YAAvB;AACA,SAASC,SAAT,QAA0B,eAA1B;AACA,SAASC,MAAT,QAAuB,YAAvB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,SACCC,uBADD,EAECC,iBAFD,EAGCC,cAHD,EAICC,mBAJD,EAKCC,eALD,EAMCC,WAND,EAOCC,aAPD,EAQCC,gBARD,EASCC,UATD,EAUCC,YAVD,QAWO,UAXP;AAYA,SAASC,aAAT,QAA8B,wBAA9B;AACA,SAASC,gBAAT,QAAiC,qCAAjC;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AAYA,MAAMC,aAAa,GAAG,MAAtB;;AAEA,SAASC,SAAT,CAAoB;AAAEC,EAAAA,KAAF;AAASC,EAAAA,QAAT;AAAmBC,EAAAA;AAAnB,CAApB,EAAiE;AAChE,SACC,cAAC,gBAAD;AACC,IAAA,KAAK,EAAGA,KADT;AAEC,IAAA,mBAAmB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;AAThB,IAFF,EAcG,CAAEa,SAAF,IAAekB,cAAc,KAAK,IAAlC,IACD,cAAC,kBAAD;AACC,IAAA,UAAU,EAAGjC,UADd;AAEC,IAAA,OAAO,EAAG,MAAMkC,iBAAiB,CAAE,IAAF,CAFlC;AAGC,IAAA,QAAQ,EACPU,UADU,IAEN;AACJH,MAAAA,gBAAgB,EACf;AACAvD,MAAAA,QAAQ,CAACwD,GAAT,CACC,CACCG,cADD,EAECC,YAFD,KAGK;AACJ,YACCA,YAAY,KAAKb,cADlB,EAEE;AACD,iBAAOW,UAAP;AACA;;AACD,eAAOC,cAAP;AACA,OAXF,CAFe,CAAhB;AAgBA,KAtBF;AAuBC,IAAA,OAAO,EAAG3D,QAAQ,CAAE+C,cAAF,aAAEA,cAAF,cAAEA,cAAF,GAAoB,CAAC,CAArB,CAvBnB;AAwBC,IAAA,YAAY,EAAG/B;AAxBhB,IAfF,EA0CG,CAAEa,SAAF,KACCf,UAAU,GACX,cAAC,cAAD;AACC,IAAA,iBAAiB,MADlB;AAEC,IAAA,SAAS,EAAGkD,SAFb;AAGC,IAAA,QAAQ,EAAGU,mBAHZ;AAIC,IAAA,SAAS,EAAG,KAJb;AAKC,IAAA,sBAAsB,EAAG;AAL1B,IADW,GASX,cAAC,YAAD;AACC,IAAA,MAAM,EAAGT,MADV;AAEC,IAAA,QAAQ,EAAGS,mBAFZ;AAGC,IAAA,SAAS,EAAG,KAHb;AAIC,IAAA,mBAAmB,EAAG;AAJvB,IAVA,CA1CH,CA1IF,EAuMG,CAAED,WAAF,IAAiBL,YAvMpB,CADD;AA2MA;AAED,eAAeL,WAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseRef,\n\tuseEffect,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { lineSolid, moreVertical, plus } from '@wordpress/icons';\nimport {\n\t__experimentalUseFocusOutside as useFocusOutside,\n\tuseDebounce,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { ColorPicker } from '../color-picker';\nimport { FlexItem } from '../flex';\nimport { HStack } from '../h-stack';\nimport { ItemGroup } from '../item-group';\nimport { VStack } from '../v-stack';\nimport GradientPicker from '../gradient-picker';\nimport ColorPalette from '../color-palette';\nimport DropdownMenu from '../dropdown-menu';\nimport Popover from '../popover';\nimport {\n\tPaletteActionsContainer,\n\tPaletteEditStyles,\n\tPaletteHeading,\n\tPaletteHStackHeader,\n\tIndicatorStyled,\n\tPaletteItem,\n\tNameContainer,\n\tNameInputControl,\n\tDoneButton,\n\tRemoveButton,\n} from './styles';\nimport { NavigableMenu } from '../navigable-container';\nimport { DEFAULT_GRADIENT } from '../custom-gradient-picker/constants';\nimport CustomGradientPicker from '../custom-gradient-picker';\nimport type {\n\tColor,\n\tColorPickerPopoverProps,\n\tGradient,\n\tNameInputProps,\n\tOptionProps,\n\tPaletteEditListViewProps,\n\tPaletteEditProps,\n\tPaletteElement,\n} from './types';\n\nconst DEFAULT_COLOR = '#000';\n\nfunction NameInput( { value, onChange, label }: NameInputProps ) {\n\treturn (\n\t\t<NameInputControl\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\n/**\n * Returns a temporary name for a palette item in the format \"Color + id\".\n * To ensure there are no duplicate ids, this function checks all slugs for temporary names.\n * It expects slugs to be in the format: slugPrefix + color- + number.\n * It then sets the id component of the new name based on the incremented id of the highest existing slug id.\n *\n * @param elements An array of color palette items.\n * @param slugPrefix The slug prefix used to match the element slug.\n *\n * @return A unique name for a palette item.\n */\nexport function getNameForPosition(\n\telements: PaletteElement[],\n\tslugPrefix: string\n) {\n\tconst temporaryNameRegex = new RegExp( `^${ slugPrefix }color-([\\\\d]+)$` );\n\tconst position = elements.reduce( ( previousValue, currentValue ) => {\n\t\tif ( typeof currentValue?.slug === 'string' ) {\n\t\t\tconst matches = currentValue?.slug.match( temporaryNameRegex );\n\t\t\tif ( matches ) {\n\t\t\t\tconst id = parseInt( matches[ 1 ], 10 );\n\t\t\t\tif ( id >= previousValue ) {\n\t\t\t\t\treturn id + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn previousValue;\n\t}, 1 );\n\n\treturn sprintf(\n\t\t/* translators: %s: is a temporary id for a custom color */\n\t\t__( 'Color %s' ),\n\t\tposition\n\t);\n}\n\nfunction ColorPickerPopover< T extends Color | Gradient >( {\n\tisGradient,\n\telement,\n\tonChange,\n\tpopoverProps: receivedPopoverProps,\n\tonClose = () => {},\n}: ColorPickerPopoverProps< T > ) {\n\tconst popoverProps: ColorPickerPopoverProps< T >[ 'popoverProps' ] =\n\t\tuseMemo(\n\t\t\t() => ( {\n\t\t\t\tshift: true,\n\t\t\t\toffset: 20,\n\t\t\t\tplacement: 'left-start',\n\t\t\t\t...receivedPopoverProps,\n\t\t\t\tclassName: classnames(\n\t\t\t\t\t'components-palette-edit__popover',\n\t\t\t\t\treceivedPopoverProps?.className\n\t\t\t\t),\n\t\t\t} ),\n\t\t\t[ receivedPopoverProps ]\n\t\t);\n\n\treturn (\n\t\t<Popover { ...popoverProps } onClose={ onClose }>\n\t\t\t{ ! isGradient && (\n\t\t\t\t<ColorPicker\n\t\t\t\t\tcolor={ element.color }\n\t\t\t\t\tenableAlpha\n\t\t\t\t\tonChange={ ( newColor ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\tcolor: newColor,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isGradient && (\n\t\t\t\t<div className=\"components-palette-edit__popover-gradient-picker\">\n\t\t\t\t\t<CustomGradientPicker\n\t\t\t\t\t\t__nextHasNoMargin\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tvalue={ element.gradient }\n\t\t\t\t\t\tonChange={ ( newGradient ) => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\t\tgradient: newGradient,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</Popover>\n\t);\n}\n\nfunction Option< T extends Color | Gradient >( {\n\tcanOnlyChangeValues,\n\telement,\n\tonChange,\n\tisEditing,\n\tonStartEditing,\n\tonRemove,\n\tonStopEditing,\n\tpopoverProps: receivedPopoverProps,\n\tslugPrefix,\n\tisGradient,\n}: OptionProps< T > ) {\n\tconst focusOutsideProps = useFocusOutside( onStopEditing );\n\tconst value = isGradient ? element.gradient : element.color;\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 [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t...receivedPopoverProps,\n\t\t\t// Use the custom palette color item as the popover anchor.\n\t\t\tanchor: popoverAnchor,\n\t\t} ),\n\t\t[ popoverAnchor, receivedPopoverProps ]\n\t);\n\n\treturn (\n\t\t<PaletteItem\n\t\t\tclassName={ isEditing ? 'is-selected' : undefined }\n\t\t\tas=\"div\"\n\t\t\tonClick={ onStartEditing }\n\t\t\tref={ setPopoverAnchor }\n\t\t\t{ ...( isEditing\n\t\t\t\t? { ...focusOutsideProps }\n\t\t\t\t: {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t},\n\t\t\t\t } ) }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<IndicatorStyled\n\t\t\t\t\t\tstyle={ { background: value, color: 'transparent' } }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t{ isEditing && ! canOnlyChangeValues ? (\n\t\t\t\t\t\t<NameInput\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t? __( 'Gradient name' )\n\t\t\t\t\t\t\t\t\t: __( 'Color name' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ element.name }\n\t\t\t\t\t\t\tonChange={ ( nextName?: string ) =>\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\t\t\tname: nextName,\n\t\t\t\t\t\t\t\t\tslug:\n\t\t\t\t\t\t\t\t\t\tslugPrefix +\n\t\t\t\t\t\t\t\t\t\tkebabCase( nextName ?? '' ),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<NameContainer>{ element.name }</NameContainer>\n\t\t\t\t\t) }\n\t\t\t\t</FlexItem>\n\t\t\t\t{ isEditing && ! canOnlyChangeValues && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<RemoveButton\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\ticon={ lineSolid }\n\t\t\t\t\t\t\tlabel={ __( 'Remove color' ) }\n\t\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ isEditing && (\n\t\t\t\t<ColorPickerPopover\n\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\telement={ element }\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</PaletteItem>\n\t);\n}\n\nfunction isTemporaryElement(\n\tslugPrefix: string,\n\t{ slug, color, gradient }: Color | Gradient\n) {\n\tconst regex = new RegExp( `^${ slugPrefix }color-([\\\\d]+)$` );\n\treturn (\n\t\tregex.test( slug ) &&\n\t\t( ( !! color && color === DEFAULT_COLOR ) ||\n\t\t\t( !! gradient && gradient === DEFAULT_GRADIENT ) )\n\t);\n}\n\nfunction PaletteEditListView< T extends Color | Gradient >( {\n\telements,\n\tonChange,\n\teditingElement,\n\tsetEditingElement,\n\tcanOnlyChangeValues,\n\tslugPrefix,\n\tisGradient,\n\tpopoverProps,\n}: PaletteEditListViewProps< T > ) {\n\t// When unmounting the component if there are empty elements (the user did not complete the insertion) clean them.\n\tconst elementsReference = useRef< typeof elements >();\n\tuseEffect( () => {\n\t\telementsReference.current = elements;\n\t}, [ elements ] );\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif (\n\t\t\t\telementsReference.current?.some( ( element ) =>\n\t\t\t\t\tisTemporaryElement( slugPrefix, element )\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tconst newElements = elementsReference.current.filter(\n\t\t\t\t\t( element ) => ! isTemporaryElement( slugPrefix, element )\n\t\t\t\t);\n\t\t\t\tonChange( newElements.length ? newElements : undefined );\n\t\t\t}\n\t\t};\n\t\t// Disable reason: adding the missing dependency here would cause breaking changes that will require\n\t\t// a heavier refactor to avoid. See https://github.com/WordPress/gutenberg/pull/43911\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tconst debounceOnChange = useDebounce( onChange, 100 );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<ItemGroup isRounded>\n\t\t\t\t{ elements.map( ( element, index ) => (\n\t\t\t\t\t<Option\n\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\tcanOnlyChangeValues={ canOnlyChangeValues }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\telement={ element }\n\t\t\t\t\t\tonStartEditing={ () => {\n\t\t\t\t\t\t\tif ( editingElement !== index ) {\n\t\t\t\t\t\t\t\tsetEditingElement( index );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ ( newElement ) => {\n\t\t\t\t\t\t\tdebounceOnChange(\n\t\t\t\t\t\t\t\telements.map(\n\t\t\t\t\t\t\t\t\t( currentElement, currentIndex ) => {\n\t\t\t\t\t\t\t\t\t\tif ( currentIndex === index ) {\n\t\t\t\t\t\t\t\t\t\t\treturn newElement;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn currentElement;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\tsetEditingElement( null );\n\t\t\t\t\t\t\tconst newElements = elements.filter(\n\t\t\t\t\t\t\t\t( _currentElement, currentIndex ) => {\n\t\t\t\t\t\t\t\t\tif ( currentIndex === index ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\tnewElements.length ? newElements : undefined\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisEditing={ index === editingElement }\n\t\t\t\t\t\tonStopEditing={ () => {\n\t\t\t\t\t\t\tif ( index === editingElement ) {\n\t\t\t\t\t\t\t\tsetEditingElement( null );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tslugPrefix={ slugPrefix }\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</VStack>\n\t);\n}\n\nconst EMPTY_ARRAY: Color[] = [];\n\n/**\n * Allows editing a palette of colors or gradients.\n *\n * ```jsx\n * import { PaletteEdit } from '@wordpress/components';\n * const MyPaletteEdit = () => {\n * const [ controlledColors, setControlledColors ] = useState( colors );\n *\n * return (\n * <PaletteEdit\n * colors={ controlledColors }\n * onChange={ ( newColors?: Color[] ) => {\n * setControlledColors( newColors );\n * } }\n * paletteLabel=\"Here is a label\"\n * />\n * );\n * };\n * ```\n */\nexport function PaletteEdit( {\n\tgradients,\n\tcolors = EMPTY_ARRAY,\n\tonChange,\n\tpaletteLabel,\n\tpaletteLabelHeadingLevel = 2,\n\temptyMessage,\n\tcanOnlyChangeValues,\n\tcanReset,\n\tslugPrefix = '',\n\tpopoverProps,\n}: PaletteEditProps ) {\n\tconst isGradient = !! gradients;\n\tconst elements = isGradient ? gradients : colors;\n\tconst [ isEditing, setIsEditing ] = useState( false );\n\tconst [ editingElement, setEditingElement ] = useState<\n\t\tnumber | null | undefined\n\t>( null );\n\tconst isAdding =\n\t\tisEditing &&\n\t\t!! editingElement &&\n\t\telements[ editingElement ] &&\n\t\t! elements[ editingElement ].slug;\n\tconst elementsLength = elements.length;\n\tconst hasElements = elementsLength > 0;\n\tconst debounceOnChange = useDebounce( onChange, 100 );\n\tconst onSelectPaletteItem = useCallback(\n\t\t(\n\t\t\tvalue?: PaletteElement[ keyof PaletteElement ],\n\t\t\tnewEditingElementIndex?: number\n\t\t) => {\n\t\t\tconst selectedElement =\n\t\t\t\tnewEditingElementIndex === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: elements[ newEditingElementIndex ];\n\t\t\tconst key = isGradient ? 'gradient' : 'color';\n\t\t\t// Ensures that the index returned matches a known element value.\n\t\t\tif ( !! selectedElement && selectedElement[ key ] === value ) {\n\t\t\t\tsetEditingElement( newEditingElementIndex );\n\t\t\t} else {\n\t\t\t\tsetIsEditing( true );\n\t\t\t}\n\t\t},\n\t\t[ isGradient, elements ]\n\t);\n\n\treturn (\n\t\t<PaletteEditStyles>\n\t\t\t<PaletteHStackHeader>\n\t\t\t\t<PaletteHeading level={ paletteLabelHeadingLevel }>\n\t\t\t\t\t{ paletteLabel }\n\t\t\t\t</PaletteHeading>\n\t\t\t\t<PaletteActionsContainer>\n\t\t\t\t\t{ hasElements && isEditing && (\n\t\t\t\t\t\t<DoneButton\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetIsEditing( false );\n\t\t\t\t\t\t\t\tsetEditingElement( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Done' ) }\n\t\t\t\t\t\t</DoneButton>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! canOnlyChangeValues && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\tisPressed={ isAdding }\n\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t? __( 'Add gradient' )\n\t\t\t\t\t\t\t\t\t: __( 'Add color' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tconst tempOptionName = getNameForPosition(\n\t\t\t\t\t\t\t\t\telements,\n\t\t\t\t\t\t\t\t\tslugPrefix\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif ( !! gradients ) {\n\t\t\t\t\t\t\t\t\tonChange( [\n\t\t\t\t\t\t\t\t\t\t...gradients,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tgradient: DEFAULT_GRADIENT,\n\t\t\t\t\t\t\t\t\t\t\tname: tempOptionName,\n\t\t\t\t\t\t\t\t\t\t\tslug:\n\t\t\t\t\t\t\t\t\t\t\t\tslugPrefix +\n\t\t\t\t\t\t\t\t\t\t\t\tkebabCase( tempOptionName ),\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} else {\n\t\t\t\t\t\t\t\t\tonChange( [\n\t\t\t\t\t\t\t\t\t\t...colors,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcolor: DEFAULT_COLOR,\n\t\t\t\t\t\t\t\t\t\t\tname: tempOptionName,\n\t\t\t\t\t\t\t\t\t\t\tslug:\n\t\t\t\t\t\t\t\t\t\t\t\tslugPrefix +\n\t\t\t\t\t\t\t\t\t\t\t\tkebabCase( tempOptionName ),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetIsEditing( true );\n\t\t\t\t\t\t\t\tsetEditingElement( elements.length );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ hasElements &&\n\t\t\t\t\t\t( ! isEditing ||\n\t\t\t\t\t\t\t! canOnlyChangeValues ||\n\t\t\t\t\t\t\tcanReset ) && (\n\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t\t? __( 'Gradient options' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Color options' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ( { onClose }: { onClose: () => void } ) => (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<NavigableMenu role=\"menu\">\n\t\t\t\t\t\t\t\t\t\t\t{ ! isEditing && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsEditing( true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-palette-edit__menu-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Show details' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t{ ! canOnlyChangeValues && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetEditingElement(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsEditing( false );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-palette-edit__menu-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isGradient\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove all gradients'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove all colors'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t{ canReset && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetEditingElement(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isGradient\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Reset gradient' )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Reset colors' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t) }\n\t\t\t\t</PaletteActionsContainer>\n\t\t\t</PaletteHStackHeader>\n\t\t\t{ hasElements && (\n\t\t\t\t<>\n\t\t\t\t\t{ isEditing && (\n\t\t\t\t\t\t<PaletteEditListView< ( typeof elements )[ number ] >\n\t\t\t\t\t\t\tcanOnlyChangeValues={ canOnlyChangeValues }\n\t\t\t\t\t\t\telements={ elements }\n\t\t\t\t\t\t\t// @ts-expect-error TODO: Don't know how to resolve\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\teditingElement={ editingElement }\n\t\t\t\t\t\t\tsetEditingElement={ setEditingElement }\n\t\t\t\t\t\t\tslugPrefix={ slugPrefix }\n\t\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isEditing && editingElement !== null && (\n\t\t\t\t\t\t<ColorPickerPopover\n\t\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\t\tonClose={ () => setEditingElement( null ) }\n\t\t\t\t\t\t\tonChange={ (\n\t\t\t\t\t\t\t\tnewElement: ( typeof elements )[ number ]\n\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\tdebounceOnChange(\n\t\t\t\t\t\t\t\t\t// @ts-expect-error TODO: Don't know how to resolve\n\t\t\t\t\t\t\t\t\telements.map(\n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\tcurrentElement: ( typeof elements )[ number ],\n\t\t\t\t\t\t\t\t\t\t\tcurrentIndex: number\n\t\t\t\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tcurrentIndex === editingElement\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn newElement;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn currentElement;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\telement={ elements[ editingElement ?? -1 ] }\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isEditing &&\n\t\t\t\t\t\t( isGradient ? (\n\t\t\t\t\t\t\t<GradientPicker\n\t\t\t\t\t\t\t\t__nextHasNoMargin\n\t\t\t\t\t\t\t\tgradients={ gradients }\n\t\t\t\t\t\t\t\tonChange={ onSelectPaletteItem }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t\tdisableCustomGradients={ true }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\t\t\tonChange={ onSelectPaletteItem }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t\tdisableCustomColors={ true }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ ! hasElements && emptyMessage }\n\t\t</PaletteEditStyles>\n\t);\n}\n\nexport default PaletteEdit;\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -74,12 +73,13 @@ export function UnforwardedPanelBody(props, ref) {
74
73
  return createElement("div", {
75
74
  className: classes,
76
75
  ref: useMergeRefs([nodeRef, ref])
77
- }, createElement(PanelBodyTitle, _extends({
76
+ }, createElement(PanelBodyTitle, {
78
77
  icon: icon,
79
78
  isOpened: Boolean(isOpened),
80
79
  onClick: handleOnToggle,
81
- title: title
82
- }, buttonProps)), typeof children === 'function' ? children({
80
+ title: title,
81
+ ...buttonProps
82
+ }), typeof children === 'function' ? children({
83
83
  opened: Boolean(isOpened)
84
84
  }) : isOpened && children);
85
85
  }
@@ -92,11 +92,12 @@ const PanelBodyTitle = forwardRef(({
92
92
  if (!title) return null;
93
93
  return createElement("h2", {
94
94
  className: "components-panel__body-title"
95
- }, createElement(Button, _extends({
95
+ }, createElement(Button, {
96
96
  className: "components-panel__body-toggle",
97
97
  "aria-expanded": isOpened,
98
- ref: ref
99
- }, props), createElement("span", {
98
+ ref: ref,
99
+ ...props
100
+ }, createElement("span", {
100
101
  "aria-hidden": "true"
101
102
  }, createElement(Icon, {
102
103
  className: "components-panel__arrow",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/panel/body.tsx"],"names":["classnames","useReducedMotion","useMergeRefs","forwardRef","useRef","chevronUp","chevronDown","Button","Icon","useControlledState","useUpdateEffect","noop","UnforwardedPanelBody","props","ref","buttonProps","children","className","icon","initialOpen","onToggle","opened","title","scrollAfterOpen","isOpened","setIsOpened","initial","undefined","fallback","nodeRef","scrollBehavior","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","scrollIntoView","inline","block","behavior","classes","Boolean","PanelBodyTitle","PanelBody"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,EAA2BC,YAA3B,QAA+C,oBAA/C;AACA,SAASC,UAAT,EAAqBC,MAArB,QAAmC,oBAAnC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,kBAAvC;AAEA;AACA;AACA;;AAGA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,SAASC,kBAAT,EAA6BC,eAA7B,QAAoD,UAApD;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,OAAO,SAASC,oBAAT,CACNC,KADM,EAENC,GAFM,EAGL;AACD,QAAM;AACLC,IAAAA,WAAW,GAAG,EADT;AAELC,IAAAA,QAFK;AAGLC,IAAAA,SAHK;AAILC,IAAAA,IAJK;AAKLC,IAAAA,WALK;AAMLC,IAAAA,QAAQ,GAAGT,IANN;AAOLU,IAAAA,MAPK;AAQLC,IAAAA,KARK;AASLC,IAAAA,eAAe,GAAG;AATb,MAUFV,KAVJ;AAWA,QAAM,CAAEW,QAAF,EAAYC,WAAZ,IAA4BhB,kBAAkB,CACnDY,MADmD,EAEnD;AACCK,IAAAA,OAAO,EAAEP,WAAW,KAAKQ,SAAhB,GAA4B,IAA5B,GAAmCR,WAD7C;AAECS,IAAAA,QAAQ,EAAE;AAFX,GAFmD,CAApD;AAOA,QAAMC,OAAO,GAAGzB,MAAM,CAAiB,IAAjB,CAAtB,CAnBC,CAqBD;AACA;;AACA,QAAM0B,cAAc,GAAG7B,gBAAgB,KAAK,MAAL,GAAc,QAArD;;AAEA,QAAM8B,cA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,IAAIR,QAVhB,CADD;AAcA;AAED,MAAM2B,cAAc,GAAGxC,UAAU,CAChC,CACC;AACCqB,EAAAA,QADD;AAECN,EAAAA,IAFD;AAGCI,EAAAA,KAHD;AAIC,KAAGT;AAJJ,CADD,EAOCC,GAPD,KAQK;AACJ,MAAK,CAAEQ,KAAP,EAAe,OAAO,IAAP;AAEf,SACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,+BADX;AAEC,qBAAgBE,QAFjB;AAGC,IAAA,GAAG,EAAGV;AAHP,KAIMD,KAJN,GAUC;AAAM,mBAAY;AAAlB,KACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,IAAI,EAAGW,QAAQ,GAAGnB,SAAH,GAAeC;AAF/B,IADD,CAVD,EAgBGgB,KAhBH,EAiBGJ,IAAI,IACL,cAAC,IAAD;AACC,IAAA,IAAI,EAAGA,IADR;AAEC,IAAA,SAAS,EAAC,wBAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAlBF,CADD,CADD;AA6BA,CAzC+B,CAAjC;AA4CA,OAAO,MAAM0B,SAAS,GAAGzC,UAAU,CAAES,oBAAF,CAA5B;AAEP,eAAegC,SAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { PanelBodyProps, PanelBodyTitleProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nconst noop = () => {};\n\nexport function UnforwardedPanelBody(\n\tprops: PanelBodyProps,\n\tref: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst {\n\t\tbuttonProps = {},\n\t\tchildren,\n\t\tclassName,\n\t\ticon,\n\t\tinitialOpen,\n\t\tonToggle = noop,\n\t\topened,\n\t\ttitle,\n\t\tscrollAfterOpen = true,\n\t} = props;\n\tconst [ isOpened, setIsOpened ] = useControlledState< boolean | undefined >(\n\t\topened,\n\t\t{\n\t\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t\t\tfallback: false,\n\t\t}\n\t);\n\tconst nodeRef = useRef< HTMLElement >( null );\n\n\t// Defaults to 'smooth' scrolling\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n\tconst scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n\n\tconst handleOnToggle = ( event: React.MouseEvent ) => {\n\t\tevent.preventDefault();\n\t\tconst next = ! isOpened;\n\t\tsetIsOpened( next );\n\t\tonToggle( next );\n\t};\n\n\t// Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.\n\tconst scrollAfterOpenRef = useRef< boolean | undefined >();\n\tscrollAfterOpenRef.current = scrollAfterOpen;\n\t// Runs after initial render.\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\tisOpened &&\n\t\t\tscrollAfterOpenRef.current &&\n\t\t\tnodeRef.current?.scrollIntoView\n\t\t) {\n\t\t\t/*\n\t\t\t * Scrolls the content into view when visible.\n\t\t\t * This improves the UX when there are multiple stacking <PanelBody />\n\t\t\t * components in a scrollable container.\n\t\t\t */\n\t\t\tnodeRef.current.scrollIntoView( {\n\t\t\t\tinline: 'nearest',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tbehavior: scrollBehavior,\n\t\t\t} );\n\t\t}\n\t}, [ isOpened, scrollBehavior ] );\n\n\tconst classes = classnames( 'components-panel__body', className, {\n\t\t'is-opened': isOpened,\n\t} );\n\n\treturn (\n\t\t<div className={ classes } ref={ useMergeRefs( [ nodeRef, ref ] ) }>\n\t\t\t<PanelBodyTitle\n\t\t\t\ticon={ icon }\n\t\t\t\tisOpened={ Boolean( isOpened ) }\n\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\ttitle={ title }\n\t\t\t\t{ ...buttonProps }\n\t\t\t/>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( { opened: Boolean( isOpened ) } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t(\n\t\t{\n\t\t\tisOpened,\n\t\t\ticon,\n\t\t\ttitle,\n\t\t\t...props\n\t\t}: WordPressComponentProps< PanelBodyTitleProps, 'button' >,\n\t\tref: React.ForwardedRef< any >\n\t) => {\n\t\tif ( ! title ) return null;\n\n\t\treturn (\n\t\t\t<h2 className=\"components-panel__body-title\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"components-panel__body-toggle\"\n\t\t\t\t\taria-expanded={ isOpened }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\tFirefox + NVDA don't announce aria-expanded because the browser\n\t\t\t\t\trepaints the whole element, so this wrapping span hides that.\n\t\t\t\t*/ }\n\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-panel__arrow\"\n\t\t\t\t\t\t\ticon={ isOpened ? chevronUp : chevronDown }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ title }\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tclassName=\"components-panel__icon\"\n\t\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Button>\n\t\t\t</h2>\n\t\t);\n\t}\n);\n\nexport const PanelBody = forwardRef( UnforwardedPanelBody );\n\nexport default PanelBody;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/panel/body.tsx"],"names":["classnames","useReducedMotion","useMergeRefs","forwardRef","useRef","chevronUp","chevronDown","Button","Icon","useControlledState","useUpdateEffect","noop","UnforwardedPanelBody","props","ref","buttonProps","children","className","icon","initialOpen","onToggle","opened","title","scrollAfterOpen","isOpened","setIsOpened","initial","undefined","fallback","nodeRef","scrollBehavior","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","scrollIntoView","inline","block","behavior","classes","Boolean","PanelBodyTitle","PanelBody"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,EAA2BC,YAA3B,QAA+C,oBAA/C;AACA,SAASC,UAAT,EAAqBC,MAArB,QAAmC,oBAAnC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,kBAAvC;AAEA;AACA;AACA;;AAGA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,SAASC,kBAAT,EAA6BC,eAA7B,QAAoD,UAApD;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,OAAO,SAASC,oBAAT,CACNC,KADM,EAENC,GAFM,EAGL;AACD,QAAM;AACLC,IAAAA,WAAW,GAAG,EADT;AAELC,IAAAA,QAFK;AAGLC,IAAAA,SAHK;AAILC,IAAAA,IAJK;AAKLC,IAAAA,WALK;AAMLC,IAAAA,QAAQ,GAAGT,IANN;AAOLU,IAAAA,MAPK;AAQLC,IAAAA,KARK;AASLC,IAAAA,eAAe,GAAG;AATb,MAUFV,KAVJ;AAWA,QAAM,CAAEW,QAAF,EAAYC,WAAZ,IAA4BhB,kBAAkB,CACnDY,MADmD,EAEnD;AACCK,IAAAA,OAAO,EAAEP,WAAW,KAAKQ,SAAhB,GAA4B,IAA5B,GAAmCR,WAD7C;AAECS,IAAAA,QAAQ,EAAE;AAFX,GAFmD,CAApD;AAOA,QAAMC,OAAO,GAAGzB,MAAM,CAAiB,IAAjB,CAAtB,CAnBC,CAqBD;AACA;;AACA,QAAM0B,cAAc,GAAG7B,gBAAgB,KAAK,MAAL,GAAc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;AAAjB,GAAF,CADT,GAECA,QAAQ,IAAIR,QAVhB,CADD;AAcA;AAED,MAAM2B,cAAc,GAAGxC,UAAU,CAChC,CACC;AACCqB,EAAAA,QADD;AAECN,EAAAA,IAFD;AAGCI,EAAAA,KAHD;AAIC,KAAGT;AAJJ,CADD,EAOCC,GAPD,KAQK;AACJ,MAAK,CAAEQ,KAAP,EAAe,OAAO,IAAP;AAEf,SACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,+BADX;AAEC,qBAAgBE,QAFjB;AAGC,IAAA,GAAG,EAAGV,GAHP;AAAA,OAIMD;AAJN,KAUC;AAAM,mBAAY;AAAlB,KACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,IAAI,EAAGW,QAAQ,GAAGnB,SAAH,GAAeC;AAF/B,IADD,CAVD,EAgBGgB,KAhBH,EAiBGJ,IAAI,IACL,cAAC,IAAD;AACC,IAAA,IAAI,EAAGA,IADR;AAEC,IAAA,SAAS,EAAC,wBAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAlBF,CADD,CADD;AA6BA,CAzC+B,CAAjC;AA4CA,OAAO,MAAM0B,SAAS,GAAGzC,UAAU,CAAES,oBAAF,CAA5B;AAEP,eAAegC,SAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { PanelBodyProps, PanelBodyTitleProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nconst noop = () => {};\n\nexport function UnforwardedPanelBody(\n\tprops: PanelBodyProps,\n\tref: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst {\n\t\tbuttonProps = {},\n\t\tchildren,\n\t\tclassName,\n\t\ticon,\n\t\tinitialOpen,\n\t\tonToggle = noop,\n\t\topened,\n\t\ttitle,\n\t\tscrollAfterOpen = true,\n\t} = props;\n\tconst [ isOpened, setIsOpened ] = useControlledState< boolean | undefined >(\n\t\topened,\n\t\t{\n\t\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t\t\tfallback: false,\n\t\t}\n\t);\n\tconst nodeRef = useRef< HTMLElement >( null );\n\n\t// Defaults to 'smooth' scrolling\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n\tconst scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n\n\tconst handleOnToggle = ( event: React.MouseEvent ) => {\n\t\tevent.preventDefault();\n\t\tconst next = ! isOpened;\n\t\tsetIsOpened( next );\n\t\tonToggle( next );\n\t};\n\n\t// Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.\n\tconst scrollAfterOpenRef = useRef< boolean | undefined >();\n\tscrollAfterOpenRef.current = scrollAfterOpen;\n\t// Runs after initial render.\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\tisOpened &&\n\t\t\tscrollAfterOpenRef.current &&\n\t\t\tnodeRef.current?.scrollIntoView\n\t\t) {\n\t\t\t/*\n\t\t\t * Scrolls the content into view when visible.\n\t\t\t * This improves the UX when there are multiple stacking <PanelBody />\n\t\t\t * components in a scrollable container.\n\t\t\t */\n\t\t\tnodeRef.current.scrollIntoView( {\n\t\t\t\tinline: 'nearest',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tbehavior: scrollBehavior,\n\t\t\t} );\n\t\t}\n\t}, [ isOpened, scrollBehavior ] );\n\n\tconst classes = classnames( 'components-panel__body', className, {\n\t\t'is-opened': isOpened,\n\t} );\n\n\treturn (\n\t\t<div className={ classes } ref={ useMergeRefs( [ nodeRef, ref ] ) }>\n\t\t\t<PanelBodyTitle\n\t\t\t\ticon={ icon }\n\t\t\t\tisOpened={ Boolean( isOpened ) }\n\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\ttitle={ title }\n\t\t\t\t{ ...buttonProps }\n\t\t\t/>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( { opened: Boolean( isOpened ) } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t(\n\t\t{\n\t\t\tisOpened,\n\t\t\ticon,\n\t\t\ttitle,\n\t\t\t...props\n\t\t}: WordPressComponentProps< PanelBodyTitleProps, 'button' >,\n\t\tref: React.ForwardedRef< any >\n\t) => {\n\t\tif ( ! title ) return null;\n\n\t\treturn (\n\t\t\t<h2 className=\"components-panel__body-title\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"components-panel__body-toggle\"\n\t\t\t\t\taria-expanded={ isOpened }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\tFirefox + NVDA don't announce aria-expanded because the browser\n\t\t\t\t\trepaints the whole element, so this wrapping span hides that.\n\t\t\t\t*/ }\n\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-panel__arrow\"\n\t\t\t\t\t\t\ticon={ isOpened ? chevronUp : chevronDown }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ title }\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tclassName=\"components-panel__icon\"\n\t\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Button>\n\t\t\t</h2>\n\t\t);\n\t}\n);\n\nexport const PanelBody = forwardRef( UnforwardedPanelBody );\n\nexport default PanelBody;\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -69,9 +68,9 @@ export function Placeholder(props) {
69
68
  const fieldsetClasses = classnames('components-placeholder__fieldset', {
70
69
  'is-column-layout': isColumnLayout
71
70
  });
72
- return createElement("div", _extends({}, additionalProps, {
71
+ return createElement("div", { ...additionalProps,
73
72
  className: classes
74
- }), withIllustration ? PlaceholderIllustration : null, resizeListener, notices, preview && createElement("div", {
73
+ }, withIllustration ? PlaceholderIllustration : null, resizeListener, notices, preview && createElement("div", {
75
74
  className: "components-placeholder__preview"
76
75
  }, preview), createElement("div", {
77
76
  className: "components-placeholder__label"