@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/mobile/picker/index.ios.js"],"names":["Picker","Component","presentPicker","options","onChange","title","destructiveButtonIndex","disabledButtonIndices","getAnchor","isBottomSheetOpened","closeBottomSheet","onHandleClosingBottomSheet","colorScheme","props","labels","map","label","fullOptions","concat","buttonTitleColor","styles","color","ActionSheetIOS","showActionSheetWithOptions","cancelButtonIndex","anchor","tintColor","buttonIndex","selected","requiresModal","value","render","PickerComponent","ref","select","isEditorSidebarOpened","closeGeneralSidebar","BottomSheetContext"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAGA,MAAMA,MAAN,SAAqBC,kBAArB,CAA+B;AAC9BC,EAAAA,aAAa,GAAG;AACf,UAAM;AACLC,MAAAA,OADK;AAELC,MAAAA,QAFK;AAGLC,MAAAA,KAHK;AAILC,MAAAA,sBAJK;AAKLC,MAAAA,qBALK;AAMLC,MAAAA,SANK;AAOLC,MAAAA,mBAPK;AAQLC,MAAAA,gBARK;AASLC,MAAAA,0BATK;AAULC,MAAAA;AAVK,QAWF,KAAKC,KAXT;AAYA,UAAMC,MAAM,GAAGX,OAAO,CAACY,GAAR,CAAa,CAAE;AAAEC,MAAAA;AAAF,KAAF,KAAiBA,KAA9B,CAAf;AACA,UAAMC,WAAW,GAAG,CAAE,cAAI,QAAJ,CAAF,EAAmBC,MAAnB,CAA2BJ,MAA3B,CAApB;AAEA,UAAMK,gBAAgB,GACrBP,WAAW,KAAK,OAAhB,GACGQ,gBAAQ,iCAAR,EAA4CC,KAD/C,GAEGD,gBAAQ,uCAAR,EAAkDC,KAHtD;;AAKAC,gCAAeC,0BAAf,CACC;AACClB,MAAAA,KADD;AAECF,MAAAA,OAAO,EAAEc,WAFV;AAGCO,MAAAA,iBAAiB,EAAE,CAHpB;AAIClB,MAAAA,sBAJD;AAKCC,MAAAA,qBALD;AAMCkB,MAAAA,MAAM,EAAEjB,SAAS,IAAIA,SAAS,EAN/B;AAOCkB,MAAAA,SAAS,EAAEP;AAPZ,KADD,EAUGQ,WAAF,IAAmB;AAClB,UAAKA,WAAW,KAAK,CAArB,EAAyB;AACxB;AACA;;AACD,YAAMC,QAAQ,GAAGzB,OAAO,CAAEwB,WAAW,GAAG,CAAhB,CAAxB;;AAEA,UAAKC,QAAQ,CAACC,aAAT,IAA0BpB,mBAA/B,EAAqD;AACpDE,QAAAA,0BAA0B,CAAE,MAAM;AACjCP,UAAAA,QAAQ,CAAEwB,QAAQ,CAACE,KAAX,CAAR;AACA,SAFyB,CAA1B;AAGApB,QAAAA,gBAAgB;AAChB,OALD,MAKO;AACNN,QAAAA,QAAQ,CAAEwB,QAAQ,CAACE,KAAX,CAAR;AACA;AACD,KAxBF;AA0BA;;AAEDC,EAAAA,MAAM,GAAG;AACR,WAAO,IAAP;AACA;;AApD6B;;AAuD/B,MAAMC,eAAe,GAAG,yBAAY,CAAEnB,KAAF,EAASoB,GAAT,KAAkB;AACrD,QAAMxB,mBAAmB,GAAG,qBAAayB,MAAF,IACtCA,MAAM,CAAE,gBAAF,CAAN,CAA2BC,qBAA3B,EAD2B,CAA5B;AAGA,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAa,gBAAb,CAAhC;AACA,QAAM;AAAEzB,IAAAA;AAAF,MAAiC,yBAAY0B,8BAAZ,CAAvC;AAEA,QAAMzB,WAAW,GAAG,uCAApB;AAEA,SACC,4BAAC,MAAD;AACC,IAAA,GAAG,EAAGqB;AADP,KAEMpB,KAFN;AAGC,IAAA,mBAAmB,EAAGJ,mBAHvB;AAIC,IAAA,gBAAgB,EAAG2B,mBAJpB;AAKC,IAAA,0BAA0B,EAAGzB,0BAL9B;AAMC,IAAA,WAAW,EAAGC;AANf,KADD;AAUA,CAnBuB,CAAxB;eAqBeoB,e","sourcesContent":["/**\n * External dependencies\n */\nimport { ActionSheetIOS } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component, forwardRef, useContext } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { BottomSheetContext } from '@wordpress/components';\nimport { usePreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\nclass Picker extends Component {\n\tpresentPicker() {\n\t\tconst {\n\t\t\toptions,\n\t\t\tonChange,\n\t\t\ttitle,\n\t\t\tdestructiveButtonIndex,\n\t\t\tdisabledButtonIndices,\n\t\t\tgetAnchor,\n\t\t\tisBottomSheetOpened,\n\t\t\tcloseBottomSheet,\n\t\t\tonHandleClosingBottomSheet,\n\t\t\tcolorScheme,\n\t\t} = this.props;\n\t\tconst labels = options.map( ( { label } ) => label );\n\t\tconst fullOptions = [ __( 'Cancel' ) ].concat( labels );\n\n\t\tconst buttonTitleColor =\n\t\t\tcolorScheme === 'light'\n\t\t\t\t? styles[ 'components-picker__button-title' ].color\n\t\t\t\t: styles[ 'components-picker__button-title--dark' ].color;\n\n\t\tActionSheetIOS.showActionSheetWithOptions(\n\t\t\t{\n\t\t\t\ttitle,\n\t\t\t\toptions: fullOptions,\n\t\t\t\tcancelButtonIndex: 0,\n\t\t\t\tdestructiveButtonIndex,\n\t\t\t\tdisabledButtonIndices,\n\t\t\t\tanchor: getAnchor && getAnchor(),\n\t\t\t\ttintColor: buttonTitleColor,\n\t\t\t},\n\t\t\t( buttonIndex ) => {\n\t\t\t\tif ( buttonIndex === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst selected = options[ buttonIndex - 1 ];\n\n\t\t\t\tif ( selected.requiresModal && isBottomSheetOpened ) {\n\t\t\t\t\tonHandleClosingBottomSheet( () => {\n\t\t\t\t\t\tonChange( selected.value );\n\t\t\t\t\t} );\n\t\t\t\t\tcloseBottomSheet();\n\t\t\t\t} else {\n\t\t\t\t\tonChange( selected.value );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nconst PickerComponent = forwardRef( ( props, ref ) => {\n\tconst isBottomSheetOpened = useSelect( ( select ) =>\n\t\tselect( 'core/edit-post' ).isEditorSidebarOpened()\n\t);\n\tconst { closeGeneralSidebar } = useDispatch( 'core/edit-post' );\n\tconst { onHandleClosingBottomSheet } = useContext( BottomSheetContext );\n\n\tconst colorScheme = usePreferredColorScheme();\n\n\treturn (\n\t\t<Picker\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tisBottomSheetOpened={ isBottomSheetOpened }\n\t\t\tcloseBottomSheet={ closeGeneralSidebar }\n\t\t\tonHandleClosingBottomSheet={ onHandleClosingBottomSheet }\n\t\t\tcolorScheme={ colorScheme }\n\t\t/>\n\t);\n} );\n\nexport default PickerComponent;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/picker/index.ios.js"],"names":["Picker","Component","presentPicker","options","onChange","title","destructiveButtonIndex","disabledButtonIndices","getAnchor","isBottomSheetOpened","closeBottomSheet","onHandleClosingBottomSheet","colorScheme","props","labels","map","label","fullOptions","concat","buttonTitleColor","styles","color","ActionSheetIOS","showActionSheetWithOptions","cancelButtonIndex","anchor","tintColor","buttonIndex","selected","requiresModal","value","render","PickerComponent","ref","select","isEditorSidebarOpened","closeGeneralSidebar","BottomSheetContext"],"mappings":";;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAGA,MAAMA,MAAN,SAAqBC,kBAArB,CAA+B;AAC9BC,EAAAA,aAAa,GAAG;AACf,UAAM;AACLC,MAAAA,OADK;AAELC,MAAAA,QAFK;AAGLC,MAAAA,KAHK;AAILC,MAAAA,sBAJK;AAKLC,MAAAA,qBALK;AAMLC,MAAAA,SANK;AAOLC,MAAAA,mBAPK;AAQLC,MAAAA,gBARK;AASLC,MAAAA,0BATK;AAULC,MAAAA;AAVK,QAWF,KAAKC,KAXT;AAYA,UAAMC,MAAM,GAAGX,OAAO,CAACY,GAAR,CAAa,CAAE;AAAEC,MAAAA;AAAF,KA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EzB,IAAAA;AAAF,MAAiC,yBAAY0B,8BAAZ,CAAvC;AAEA,QAAMzB,WAAW,GAAG,uCAApB;AAEA,SACC,4BAAC,MAAD;AACC,IAAA,GAAG,EAAGqB,GADP;AAAA,OAEMpB,KAFN;AAGC,IAAA,mBAAmB,EAAGJ,mBAHvB;AAIC,IAAA,gBAAgB,EAAG2B,mBAJpB;AAKC,IAAA,0BAA0B,EAAGzB,0BAL9B;AAMC,IAAA,WAAW,EAAGC;AANf,IADD;AAUA,CAnBuB,CAAxB;eAqBeoB,e","sourcesContent":["/**\n * External dependencies\n */\nimport { ActionSheetIOS } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component, forwardRef, useContext } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { BottomSheetContext } from '@wordpress/components';\nimport { usePreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\nclass Picker extends Component {\n\tpresentPicker() {\n\t\tconst {\n\t\t\toptions,\n\t\t\tonChange,\n\t\t\ttitle,\n\t\t\tdestructiveButtonIndex,\n\t\t\tdisabledButtonIndices,\n\t\t\tgetAnchor,\n\t\t\tisBottomSheetOpened,\n\t\t\tcloseBottomSheet,\n\t\t\tonHandleClosingBottomSheet,\n\t\t\tcolorScheme,\n\t\t} = this.props;\n\t\tconst labels = options.map( ( { label } ) => label );\n\t\tconst fullOptions = [ __( 'Cancel' ) ].concat( labels );\n\n\t\tconst buttonTitleColor =\n\t\t\tcolorScheme === 'light'\n\t\t\t\t? styles[ 'components-picker__button-title' ].color\n\t\t\t\t: styles[ 'components-picker__button-title--dark' ].color;\n\n\t\tActionSheetIOS.showActionSheetWithOptions(\n\t\t\t{\n\t\t\t\ttitle,\n\t\t\t\toptions: fullOptions,\n\t\t\t\tcancelButtonIndex: 0,\n\t\t\t\tdestructiveButtonIndex,\n\t\t\t\tdisabledButtonIndices,\n\t\t\t\tanchor: getAnchor && getAnchor(),\n\t\t\t\ttintColor: buttonTitleColor,\n\t\t\t},\n\t\t\t( buttonIndex ) => {\n\t\t\t\tif ( buttonIndex === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst selected = options[ buttonIndex - 1 ];\n\n\t\t\t\tif ( selected.requiresModal && isBottomSheetOpened ) {\n\t\t\t\t\tonHandleClosingBottomSheet( () => {\n\t\t\t\t\t\tonChange( selected.value );\n\t\t\t\t\t} );\n\t\t\t\t\tcloseBottomSheet();\n\t\t\t\t} else {\n\t\t\t\t\tonChange( selected.value );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nconst PickerComponent = forwardRef( ( props, ref ) => {\n\tconst isBottomSheetOpened = useSelect( ( select ) =>\n\t\tselect( 'core/edit-post' ).isEditorSidebarOpened()\n\t);\n\tconst { closeGeneralSidebar } = useDispatch( 'core/edit-post' );\n\tconst { onHandleClosingBottomSheet } = useContext( BottomSheetContext );\n\n\tconst colorScheme = usePreferredColorScheme();\n\n\treturn (\n\t\t<Picker\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tisBottomSheetOpened={ isBottomSheetOpened }\n\t\t\tcloseBottomSheet={ closeGeneralSidebar }\n\t\t\tonHandleClosingBottomSheet={ onHandleClosingBottomSheet }\n\t\t\tcolorScheme={ colorScheme }\n\t\t/>\n\t);\n} );\n\nexport default PickerComponent;\n"]}
@@ -9,8 +9,6 @@ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _reactNative = require("react-native");
15
13
 
16
14
  var _compose = require("@wordpress/compose");
@@ -49,10 +47,11 @@ const Segment = ({
49
47
  style: isSelectedIOS && shadowStyle
50
48
  }, (0, _element.createElement)(_reactNative.TouchableWithoutFeedback, {
51
49
  onPress: onPress
52
- }, (0, _element.createElement)(_reactNative.View, (0, _extends2.default)({
50
+ }, (0, _element.createElement)(_reactNative.View, {
53
51
  style: segmentStyle,
54
- onLayout: onLayout
55
- }, props), (0, _element.createElement)(_reactNative.Text, {
52
+ onLayout: onLayout,
53
+ ...props
54
+ }, (0, _element.createElement)(_reactNative.Text, {
56
55
  style: [textStyle, isSelected && selectedTextStyle],
57
56
  maxFontSizeMultiplier: 2
58
57
  }, title))));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/segmented-control/index.native.js"],"names":["ANIMATION_DURATION","isIOS","Platform","OS","Segment","isSelected","title","onPress","onLayout","props","isSelectedIOS","segmentStyle","styles","segment","segmentIOS","textStyle","buttonTextDefault","buttonTextDefaultDark","selectedTextStyle","buttonTextSelected","buttonTextSelectedDark","shadowStyle","shadowIOS","SegmentedControls","segments","segmentHandler","selectedIndex","addonLeft","addonRight","selectedSegmentIndex","activeSegmentIndex","setActiveSegmentIndex","segmentsDimensions","setSegmentsDimensions","width","height","positionAnimationValue","Animated","Value","setValue","calculateEndValue","containerStyle","container","containerDark","performSwatchAnimation","index","timing","toValue","duration","easing","Easing","ease","useNativeDriver","start","paddingLeft","offset","containerIOS","widths","Object","values","map","dimension","widthsDistance","slice","widthsDistanceSum","reduce","sum","n","endValue","onHandlePress","segmentOnLayout","event","nativeEvent","layout","selectedStyle","selected","selectedDark","outlineStyle","outline","outlineIOS","row","flex","length","left"],"mappings":";;;;;;;;;AAcA;;;;AAXA;;AAYA;;AAKA;;AACA;;AArBA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AAIA,MAAMA,kBAAkB,GAAG,GAA3B;AAEA,MAAMC,KAAK,GAAGC,sBAASC,EAAT,KAAgB,KAA9B;;AAEA,MAAMC,OAAO,GAAG,CAAE;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,KAAd;AAAqBC,EAAAA,OAArB;AAA8BC,EAAAA,QAA9B;AAAwC,KAAGC;AAA3C,CAAF,KAA0D;AACzE,QAAMC,aA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X,KAAsB;AACrC,WACC,4BAAC,OAAD;AACC,MAAA,KAAK,EAAGhC,OADT;AAEC,MAAA,OAAO,EAAG,MAAMwD,aAAa,CAAExD,OAAF,EAAWgC,KAAX,CAF9B;AAGC,MAAA,UAAU,EAAGf,kBAAkB,KAAKe,KAHrC;AAIC,MAAA,GAAG,EAAGA,KAJP;AAKC,MAAA,QAAQ,EAAK0B,KAAF,IACVD,eAAe,CAAEC,KAAF,EAAS1B,KAAT,CANjB;AAQC,MAAA,kBAAkB,EAAG;AACpB8B,QAAAA,QAAQ,EAAE7C,kBAAkB,KAAKe;AADb,OARtB;AAWC,MAAA,iBAAiB,EAAG,QAXrB;AAYC,MAAA,kBAAkB,EAAGhC,OAZtB;AAaC,MAAA,iBAAiB,EAAI,GAAGgC,KAAK,GAAG,CAAG,OAClCrB,QAAQ,CAAC0D,MACT;AAfF,MADD;AAmBA,GApBC,CADH,EAsBC,4BAAC,qBAAD,CAAU,IAAV;AACC,IAAA,KAAK,EAAG,CACP;AACChD,MAAAA,KADD;AAECiD,MAAAA,IAAI,EAAE/C,sBAFP;AAGCD,MAAAA;AAHD,KADO,EAMPuC,aANO,EAOPG,YAPO;AADT,IAtBD,CAFD,EAoCC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGjE,eAAOqE;AAArB,KAA8BrD,UAA9B,CApCD,CADD;AAwCA,CAjID;;eAmIeL,iB","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tView,\n\tTouchableWithoutFeedback,\n\tText,\n\tPlatform,\n\tAnimated,\n\tEasing,\n} from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { performLayoutAnimation } from '../layout-animation';\nimport styles from './style.scss';\n\nconst ANIMATION_DURATION = 200;\n\nconst isIOS = Platform.OS === 'ios';\n\nconst Segment = ( { isSelected, title, onPress, onLayout, ...props } ) => {\n\tconst isSelectedIOS = isIOS && isSelected;\n\n\tconst segmentStyle = [ styles.segment, isIOS && styles.segmentIOS ];\n\n\tconst textStyle = usePreferredColorSchemeStyle(\n\t\tstyles.buttonTextDefault,\n\t\tstyles.buttonTextDefaultDark\n\t);\n\tconst selectedTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.buttonTextSelected,\n\t\tstyles.buttonTextSelectedDark\n\t);\n\tconst shadowStyle = usePreferredColorSchemeStyle( styles.shadowIOS, {} );\n\n\treturn (\n\t\t<View style={ isSelectedIOS && shadowStyle }>\n\t\t\t<TouchableWithoutFeedback onPress={ onPress }>\n\t\t\t\t<View style={ segmentStyle } onLayout={ onLayout } { ...props }>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={ [ textStyle, isSelected && selectedTextStyle ] }\n\t\t\t\t\t\tmaxFontSizeMultiplier={ 2 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</View>\n\t);\n};\n\nconst SegmentedControls = ( {\n\tsegments,\n\tsegmentHandler,\n\tselectedIndex,\n\taddonLeft,\n\taddonRight,\n} ) => {\n\tconst selectedSegmentIndex = selectedIndex || 0;\n\tconst [ activeSegmentIndex, setActiveSegmentIndex ] =\n\t\tuseState( selectedSegmentIndex );\n\tconst [ segmentsDimensions, setSegmentsDimensions ] = useState( {\n\t\t[ activeSegmentIndex ]: { width: 0, height: 0 },\n\t} );\n\tconst [ positionAnimationValue ] = useState( new Animated.Value( 0 ) );\n\n\tuseEffect( () => {\n\t\tsetActiveSegmentIndex( selectedSegmentIndex );\n\t\tsegmentHandler( segments[ selectedSegmentIndex ] );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tpositionAnimationValue.setValue(\n\t\t\tcalculateEndValue( activeSegmentIndex )\n\t\t);\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ segmentsDimensions ] );\n\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.container,\n\t\tstyles.containerDark\n\t);\n\n\tfunction performSwatchAnimation( index ) {\n\t\tAnimated.timing( positionAnimationValue, {\n\t\t\ttoValue: calculateEndValue( index ),\n\t\t\tduration: ANIMATION_DURATION,\n\t\t\teasing: Easing.ease,\n\t\t\tuseNativeDriver: false,\n\t\t} ).start();\n\t}\n\n\tfunction calculateEndValue( index ) {\n\t\tconst { paddingLeft: offset } = isIOS\n\t\t\t? styles.containerIOS\n\t\t\t: styles.container;\n\t\tconst widths = Object.values( segmentsDimensions ).map(\n\t\t\t( dimension ) => dimension.width\n\t\t);\n\t\tconst widthsDistance = widths.slice( 0, index );\n\t\tconst widthsDistanceSum = widthsDistance.reduce(\n\t\t\t( sum, n ) => sum + n,\n\t\t\t0\n\t\t);\n\n\t\tconst endValue = index === 0 ? 0 : widthsDistanceSum;\n\t\treturn endValue + offset;\n\t}\n\n\tfunction onHandlePress( segment, index ) {\n\t\tperformLayoutAnimation( ANIMATION_DURATION );\n\t\tsetActiveSegmentIndex( index );\n\t\tsegmentHandler( segment );\n\t\tperformSwatchAnimation( index );\n\t}\n\n\tfunction segmentOnLayout( event, index ) {\n\t\tconst { width, height } = event.nativeEvent.layout;\n\n\t\tsetSegmentsDimensions( {\n\t\t\t...segmentsDimensions,\n\t\t\t[ index ]: { width, height },\n\t\t} );\n\t}\n\n\tconst selectedStyle = usePreferredColorSchemeStyle(\n\t\tstyles.selected,\n\t\tstyles.selectedDark\n\t);\n\n\tconst width = segmentsDimensions[ activeSegmentIndex ]?.width;\n\tconst height = segmentsDimensions[ activeSegmentIndex ]?.height;\n\n\tconst outlineStyle = [ styles.outline, isIOS && styles.outlineIOS ];\n\n\treturn (\n\t\t<View style={ styles.row }>\n\t\t\t<View style={ styles.flex }>{ addonLeft }</View>\n\t\t\t<View style={ [ containerStyle, isIOS && styles.containerIOS ] }>\n\t\t\t\t{ segments.map( ( segment, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Segment\n\t\t\t\t\t\t\ttitle={ segment }\n\t\t\t\t\t\t\tonPress={ () => onHandlePress( segment, index ) }\n\t\t\t\t\t\t\tisSelected={ activeSegmentIndex === index }\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tonLayout={ ( event ) =>\n\t\t\t\t\t\t\t\tsegmentOnLayout( event, index )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taccessibilityState={ {\n\t\t\t\t\t\t\t\tselected: activeSegmentIndex === index,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\taccessibilityLabel={ segment }\n\t\t\t\t\t\t\taccessibilityHint={ `${ index + 1 } on ${\n\t\t\t\t\t\t\t\tsegments.length\n\t\t\t\t\t\t\t}` }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t<Animated.View\n\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\tleft: positionAnimationValue,\n\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectedStyle,\n\t\t\t\t\t\toutlineStyle,\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t\t<View style={ styles.flex }>{ addonRight }</View>\n\t\t</View>\n\t);\n};\n\nexport default SegmentedControls;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/segmented-control/index.native.js"],"names":["ANIMATION_DURATION","isIOS","Platform","OS","Segment","isSelected","title","onPress","onLayout","props","isSelectedIOS","segmentStyle","styles","segment","segmentIOS","textStyle","buttonTextDefault","buttonTextDefaultDark","selectedTextStyle","buttonTextSelected","buttonTextSelectedDark","shadowStyle","shadowIOS","SegmentedControls","segments","segmentHandler","selectedIndex","addonLeft","addonRight","selectedSegmentIndex","activeSegmentIndex","setActiveSegmentIndex","segmentsDimensions","setSegmentsDimensions","width","height","positionAnimationValue","Animated","Value","setValue","calculateEndValue","containerStyle","container","containerDark","performSwatchAnimation","index","timing","toValue","duration","easing","Easing","ease","useNativeDriver","start","paddingLeft","offset","containerIOS","widths","Object","values","map","dimension","widthsDistance","slice","widthsDistanceSum","reduce","sum","n","endValue","onHandlePress","segmentOnLayout","event","nativeEvent","layout","selectedStyle","selected","selectedDark","outlineStyle","outline","outlineIOS","row","flex","length","left"],"mappings":";;;;;;;;;AAcA;;AAXA;;AAYA;;AAKA;;AACA;;AArBA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AAIA,MAAMA,kBAAkB,GAAG,GAA3B;AAEA,MAAMC,KAAK,GAAGC,sBAASC,EAAT,KAAgB,KAA9B;;AAEA,MAAMC,OAAO,GAAG,CAAE;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,KAAd;AAAqBC,EAAAA,OAArB;AAA8BC,EAAAA,QAA9B;AAAwC,KAAGC;AAA3C,CAAF,KAA0D;AACzE,QAAMC,aAAa,GAAGT,KAAK,IAAII,UAA/B;AAEA,QAAMM,YAAY,GAAG,CAAEC,eAAOC,OAAT,EAAkBZ,KAAK,IAAIW,eAAOE,UAAlC,CAArB;AAEA,QAAMC,SAAS,GAAG,2CACjBH,eAAOI,iBADU,EAEjBJ,eAAOK,qBAFU,CAAlB;AAIA,QAAMC,iBAAiB,GAAG,2CACzBN,eAAOO,kBADkB,EAEzBP,eAAOQ,sBAFkB,CAA1B;AAIA,QAAMC,WAAW,GAAG,2CAA8BT,eAAOU,SAArC,EAAgD,EAAhD,CAApB;AAEA,SACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGZ,aAAa,IAAIW;AAA/B,KACC,4BAAC,qCAAD;AAA0B,IAAA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tB;AAaC,MAAA,iBAAiB,EAAI,GAAGgC,KAAK,GAAG,CAAG,OAClCrB,QAAQ,CAAC0D,MACT;AAfF,MADD;AAmBA,GApBC,CADH,EAsBC,4BAAC,qBAAD,CAAU,IAAV;AACC,IAAA,KAAK,EAAG,CACP;AACChD,MAAAA,KADD;AAECiD,MAAAA,IAAI,EAAE/C,sBAFP;AAGCD,MAAAA;AAHD,KADO,EAMPuC,aANO,EAOPG,YAPO;AADT,IAtBD,CAFD,EAoCC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGjE,eAAOqE;AAArB,KAA8BrD,UAA9B,CApCD,CADD;AAwCA,CAjID;;eAmIeL,iB","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tView,\n\tTouchableWithoutFeedback,\n\tText,\n\tPlatform,\n\tAnimated,\n\tEasing,\n} from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { performLayoutAnimation } from '../layout-animation';\nimport styles from './style.scss';\n\nconst ANIMATION_DURATION = 200;\n\nconst isIOS = Platform.OS === 'ios';\n\nconst Segment = ( { isSelected, title, onPress, onLayout, ...props } ) => {\n\tconst isSelectedIOS = isIOS && isSelected;\n\n\tconst segmentStyle = [ styles.segment, isIOS && styles.segmentIOS ];\n\n\tconst textStyle = usePreferredColorSchemeStyle(\n\t\tstyles.buttonTextDefault,\n\t\tstyles.buttonTextDefaultDark\n\t);\n\tconst selectedTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.buttonTextSelected,\n\t\tstyles.buttonTextSelectedDark\n\t);\n\tconst shadowStyle = usePreferredColorSchemeStyle( styles.shadowIOS, {} );\n\n\treturn (\n\t\t<View style={ isSelectedIOS && shadowStyle }>\n\t\t\t<TouchableWithoutFeedback onPress={ onPress }>\n\t\t\t\t<View style={ segmentStyle } onLayout={ onLayout } { ...props }>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={ [ textStyle, isSelected && selectedTextStyle ] }\n\t\t\t\t\t\tmaxFontSizeMultiplier={ 2 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</View>\n\t);\n};\n\nconst SegmentedControls = ( {\n\tsegments,\n\tsegmentHandler,\n\tselectedIndex,\n\taddonLeft,\n\taddonRight,\n} ) => {\n\tconst selectedSegmentIndex = selectedIndex || 0;\n\tconst [ activeSegmentIndex, setActiveSegmentIndex ] =\n\t\tuseState( selectedSegmentIndex );\n\tconst [ segmentsDimensions, setSegmentsDimensions ] = useState( {\n\t\t[ activeSegmentIndex ]: { width: 0, height: 0 },\n\t} );\n\tconst [ positionAnimationValue ] = useState( new Animated.Value( 0 ) );\n\n\tuseEffect( () => {\n\t\tsetActiveSegmentIndex( selectedSegmentIndex );\n\t\tsegmentHandler( segments[ selectedSegmentIndex ] );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tpositionAnimationValue.setValue(\n\t\t\tcalculateEndValue( activeSegmentIndex )\n\t\t);\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ segmentsDimensions ] );\n\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.container,\n\t\tstyles.containerDark\n\t);\n\n\tfunction performSwatchAnimation( index ) {\n\t\tAnimated.timing( positionAnimationValue, {\n\t\t\ttoValue: calculateEndValue( index ),\n\t\t\tduration: ANIMATION_DURATION,\n\t\t\teasing: Easing.ease,\n\t\t\tuseNativeDriver: false,\n\t\t} ).start();\n\t}\n\n\tfunction calculateEndValue( index ) {\n\t\tconst { paddingLeft: offset } = isIOS\n\t\t\t? styles.containerIOS\n\t\t\t: styles.container;\n\t\tconst widths = Object.values( segmentsDimensions ).map(\n\t\t\t( dimension ) => dimension.width\n\t\t);\n\t\tconst widthsDistance = widths.slice( 0, index );\n\t\tconst widthsDistanceSum = widthsDistance.reduce(\n\t\t\t( sum, n ) => sum + n,\n\t\t\t0\n\t\t);\n\n\t\tconst endValue = index === 0 ? 0 : widthsDistanceSum;\n\t\treturn endValue + offset;\n\t}\n\n\tfunction onHandlePress( segment, index ) {\n\t\tperformLayoutAnimation( ANIMATION_DURATION );\n\t\tsetActiveSegmentIndex( index );\n\t\tsegmentHandler( segment );\n\t\tperformSwatchAnimation( index );\n\t}\n\n\tfunction segmentOnLayout( event, index ) {\n\t\tconst { width, height } = event.nativeEvent.layout;\n\n\t\tsetSegmentsDimensions( {\n\t\t\t...segmentsDimensions,\n\t\t\t[ index ]: { width, height },\n\t\t} );\n\t}\n\n\tconst selectedStyle = usePreferredColorSchemeStyle(\n\t\tstyles.selected,\n\t\tstyles.selectedDark\n\t);\n\n\tconst width = segmentsDimensions[ activeSegmentIndex ]?.width;\n\tconst height = segmentsDimensions[ activeSegmentIndex ]?.height;\n\n\tconst outlineStyle = [ styles.outline, isIOS && styles.outlineIOS ];\n\n\treturn (\n\t\t<View style={ styles.row }>\n\t\t\t<View style={ styles.flex }>{ addonLeft }</View>\n\t\t\t<View style={ [ containerStyle, isIOS && styles.containerIOS ] }>\n\t\t\t\t{ segments.map( ( segment, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Segment\n\t\t\t\t\t\t\ttitle={ segment }\n\t\t\t\t\t\t\tonPress={ () => onHandlePress( segment, index ) }\n\t\t\t\t\t\t\tisSelected={ activeSegmentIndex === index }\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tonLayout={ ( event ) =>\n\t\t\t\t\t\t\t\tsegmentOnLayout( event, index )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taccessibilityState={ {\n\t\t\t\t\t\t\t\tselected: activeSegmentIndex === index,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\taccessibilityLabel={ segment }\n\t\t\t\t\t\t\taccessibilityHint={ `${ index + 1 } on ${\n\t\t\t\t\t\t\t\tsegments.length\n\t\t\t\t\t\t\t}` }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t<Animated.View\n\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\tleft: positionAnimationValue,\n\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectedStyle,\n\t\t\t\t\t\toutlineStyle,\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t\t<View style={ styles.flex }>{ addonRight }</View>\n\t\t</View>\n\t);\n};\n\nexport default SegmentedControls;\n"]}
@@ -9,8 +9,6 @@ exports.default = exports.Modal = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _classnames = _interopRequireDefault(require("classnames"));
15
13
 
16
14
  var _compose = require("@wordpress/compose");
@@ -164,7 +162,7 @@ function UnforwardedModal(props, forwardedRef) {
164
162
  onKeyDown: handleEscapeKeyDown
165
163
  }, (0, _element.createElement)(_styleProvider.default, {
166
164
  document: document
167
- }, (0, _element.createElement)("div", (0, _extends2.default)({
165
+ }, (0, _element.createElement)("div", {
168
166
  className: (0, _classnames.default)('components-modal__frame', className, {
169
167
  'is-full-screen': isFullScreen
170
168
  }),
@@ -174,10 +172,10 @@ function UnforwardedModal(props, forwardedRef) {
174
172
  "aria-label": contentLabel,
175
173
  "aria-labelledby": contentLabel ? undefined : headingId,
176
174
  "aria-describedby": aria.describedby,
177
- tabIndex: -1
178
- }, shouldCloseOnClickOutside ? focusOutsideProps : {}, {
175
+ tabIndex: -1,
176
+ ...(shouldCloseOnClickOutside ? focusOutsideProps : {}),
179
177
  onKeyDown: onKeyDown
180
- }), (0, _element.createElement)("div", {
178
+ }, (0, _element.createElement)("div", {
181
179
  className: (0, _classnames.default)('components-modal__content', {
182
180
  'hide-header': __experimentalHideHeader,
183
181
  'is-scrollable': hasScrollableContent,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/modal/index.tsx"],"names":["openModalCount","UnforwardedModal","props","forwardedRef","bodyOpenClassName","role","title","focusOnMount","shouldCloseOnEsc","shouldCloseOnClickOutside","isDismissible","aria","labelledby","undefined","describedby","onRequestClose","icon","closeButtonLabel","children","style","overlayClassName","className","contentLabel","onKeyDown","isFullScreen","__experimentalHideHeader","ref","instanceId","Modal","headingId","focusOnMountRef","constrainedTabbingRef","focusReturnRef","focusOutsideProps","contentRef","childrenContainerRef","hasScrolledContent","setHasScrolledContent","hasScrollableContent","setHasScrollableContent","isContentScrollable","current","closestScrollContainer","ariaHelper","hideApp","document","body","classList","add","remove","showApp","window","ResizeObserver","resizeObserver","observe","disconnect","handleEscapeKeyDown","event","nativeEvent","isComposing","keyCode","code","defaultPrevented","preventDefault","onContentContainerScroll","e","scrollY","currentTarget","scrollTop","close"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAeA;;AAQA;;AACA;;AACA;;AAKA;;AACA;;AACA;;;;;;AAnCA;AACA;AACA;;AAIA;AACA;AACA;;AAsBA;AACA;AACA;AAMA;AACA,IAAIA,cAAc,GAAG,CAArB;;AAEA,SAASC,gBAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AACLC,IAAAA,iBAAiB,GAAG,YADf;AAELC,IAAAA,IAAI,GAAG,QAFF;AAGLC,IAAAA,KAAK,GAAG,IAHH;AAILC,IAAAA,YAAY,GAAG,IAJV;AAKLC,IAAAA,gBAAgB,GAAG,IALd;AAMLC,IAAAA,yBAAyB,GAAG,IANvB;AAOLC,IAAAA,aAAa,GAAG,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AD6B,GAE7B,EArBJ;AAsBC,IAAA,SAAS,EAAGV;AAtBb,MAwBC;AACC,IAAA,SAAS,EAAG,yBAAY,2BAAZ,EAAyC;AACpD,qBAAeE,wBADqC;AAEpD,uBAAiBa,oBAFmC;AAGpD,8BAAwBF;AAH4B,KAAzC,CADb;AAMC,IAAA,IAAI,EAAC,UANN;AAOC,IAAA,QAAQ,EAAG4B,wBAPZ;AAQC,IAAA,GAAG,EAAG9B,UARP;AASC,kBACCI,oBAAoB,GACjB,cAAI,oBAAJ,CADiB,GAEjBzB,SAZL;AAcC,IAAA,QAAQ,EAAGyB,oBAAoB,GAAG,CAAH,GAAOzB;AAdvC,KAgBG,CAAEY,wBAAF,IACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGT,IAAI,IACL;AACC,IAAA,SAAS,EAAC,kCADX;AAEC;AAFD,KAIGA,IAJH,CAFF,EASGV,KAAK,IACN;AACC,IAAA,EAAE,EAAGuB,SADN;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGvB,KAJH,CAVF,CADD,EAmBGI,aAAa,IACd,4BAAC,eAAD;AACC,IAAA,OAAO,EAAGK,cADX;AAEC,IAAA,IAAI,EAAGsD,YAFR;AAGC,IAAA,KAAK,EACJpD,gBAAgB,IAAI,cAAI,OAAJ;AAJtB,IApBF,CAjBF,EA+CC;AAAK,IAAA,GAAG,EAAGkB;AAAX,KAAoCjB,QAApC,CA/CD,CAxBD,CADD,CARD,CAFM,EAuFN2B,QAAQ,CAACC,IAvFH,CAAP;AAyFA;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;;;AACO,MAAMlB,KAAK,GAAG,yBAAY3B,gBAAZ,CAAd;;eAEQ2B,K","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef, KeyboardEvent, UIEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreatePortal,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\tforwardRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport {\n\tuseInstanceId,\n\tuseFocusReturn,\n\tuseFocusOnMount,\n\t__experimentalUseFocusOutside as useFocusOutside,\n\tuseConstrainedTabbing,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { close } from '@wordpress/icons';\nimport { getScrollContainer } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport * as ariaHelper from './aria-helper';\nimport Button from '../button';\nimport StyleProvider from '../style-provider';\nimport type { ModalProps } from './types';\n\n// Used to count the number of open modals.\nlet openModalCount = 0;\n\nfunction UnforwardedModal(\n\tprops: ModalProps,\n\tforwardedRef: ForwardedRef< HTMLDivElement >\n) {\n\tconst {\n\t\tbodyOpenClassName = 'modal-open',\n\t\trole = 'dialog',\n\t\ttitle = null,\n\t\tfocusOnMount = true,\n\t\tshouldCloseOnEsc = true,\n\t\tshouldCloseOnClickOutside = true,\n\t\tisDismissible = true,\n\t\t/* Accessibility. */\n\t\taria = {\n\t\t\tlabelledby: undefined,\n\t\t\tdescribedby: undefined,\n\t\t},\n\t\tonRequestClose,\n\t\ticon,\n\t\tcloseButtonLabel,\n\t\tchildren,\n\t\tstyle,\n\t\toverlayClassName,\n\t\tclassName,\n\t\tcontentLabel,\n\t\tonKeyDown,\n\t\tisFullScreen = false,\n\t\t__experimentalHideHeader = false,\n\t} = props;\n\n\tconst ref = useRef< HTMLDivElement >();\n\tconst instanceId = useInstanceId( Modal );\n\tconst headingId = title\n\t\t? `components-modal-header-${ instanceId }`\n\t\t: aria.labelledby;\n\tconst focusOnMountRef = useFocusOnMount( focusOnMount );\n\tconst constrainedTabbingRef = useConstrainedTabbing();\n\tconst focusReturnRef = useFocusReturn();\n\tconst focusOutsideProps = useFocusOutside( onRequestClose );\n\tconst contentRef = useRef< HTMLDivElement >( null );\n\tconst childrenContainerRef = useRef< HTMLDivElement >( null );\n\n\tconst [ hasScrolledContent, setHasScrolledContent ] = useState( false );\n\tconst [ hasScrollableContent, setHasScrollableContent ] = useState( false );\n\n\t// Determines whether the Modal content is scrollable and updates the state.\n\tconst isContentScrollable = useCallback( () => {\n\t\tif ( ! contentRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst closestScrollContainer = getScrollContainer( contentRef.current );\n\n\t\tif ( contentRef.current === closestScrollContainer ) {\n\t\t\tsetHasScrollableContent( true );\n\t\t} else {\n\t\t\tsetHasScrollableContent( false );\n\t\t}\n\t}, [ contentRef ] );\n\n\tuseEffect( () => {\n\t\topenModalCount++;\n\n\t\tif ( openModalCount === 1 ) {\n\t\t\tariaHelper.hideApp( ref.current );\n\t\t\tdocument.body.classList.add( bodyOpenClassName );\n\t\t}\n\n\t\treturn () => {\n\t\t\topenModalCount--;\n\n\t\t\tif ( openModalCount === 0 ) {\n\t\t\t\tdocument.body.classList.remove( bodyOpenClassName );\n\t\t\t\tariaHelper.showApp();\n\t\t\t}\n\t\t};\n\t}, [ bodyOpenClassName ] );\n\n\t// Calls the isContentScrollable callback when the Modal children container resizes.\n\tuseLayoutEffect( () => {\n\t\tif ( ! window.ResizeObserver || ! childrenContainerRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst resizeObserver = new ResizeObserver( isContentScrollable );\n\t\tresizeObserver.observe( childrenContainerRef.current );\n\n\t\tisContentScrollable();\n\n\t\treturn () => {\n\t\t\tresizeObserver.disconnect();\n\t\t};\n\t}, [ isContentScrollable, childrenContainerRef ] );\n\n\tfunction handleEscapeKeyDown( event: KeyboardEvent< HTMLDivElement > ) {\n\t\tif (\n\t\t\t// Ignore keydowns from IMEs\n\t\t\tevent.nativeEvent.isComposing ||\n\t\t\t// Workaround for Mac Safari where the final Enter/Backspace of an IME composition\n\t\t\t// is `isComposing=false`, even though it's technically still part of the composition.\n\t\t\t// These can only be detected by keyCode.\n\t\t\tevent.keyCode === 229\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tshouldCloseOnEsc &&\n\t\t\tevent.code === 'Escape' &&\n\t\t\t! event.defaultPrevented\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\tif ( onRequestClose ) {\n\t\t\t\tonRequestClose( event );\n\t\t\t}\n\t\t}\n\t}\n\n\tconst onContentContainerScroll = useCallback(\n\t\t( e: UIEvent< HTMLDivElement > ) => {\n\t\t\tconst scrollY = e?.currentTarget?.scrollTop ?? -1;\n\n\t\t\tif ( ! hasScrolledContent && scrollY > 0 ) {\n\t\t\t\tsetHasScrolledContent( true );\n\t\t\t} else if ( hasScrolledContent && scrollY <= 0 ) {\n\t\t\t\tsetHasScrolledContent( false );\n\t\t\t}\n\t\t},\n\t\t[ hasScrolledContent ]\n\t);\n\n\treturn createPortal(\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tref={ useMergeRefs( [ ref, forwardedRef ] ) }\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-modal__screen-overlay',\n\t\t\t\toverlayClassName\n\t\t\t) }\n\t\t\tonKeyDown={ handleEscapeKeyDown }\n\t\t>\n\t\t\t<StyleProvider document={ document }>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'components-modal__frame',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-full-screen': isFullScreen,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ style }\n\t\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t\tconstrainedTabbingRef,\n\t\t\t\t\t\tfocusReturnRef,\n\t\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t\t] ) }\n\t\t\t\t\trole={ role }\n\t\t\t\t\taria-label={ contentLabel }\n\t\t\t\t\taria-labelledby={ contentLabel ? undefined : headingId }\n\t\t\t\t\taria-describedby={ aria.describedby }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t{ ...( shouldCloseOnClickOutside\n\t\t\t\t\t\t? focusOutsideProps\n\t\t\t\t\t\t: {} ) }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames( 'components-modal__content', {\n\t\t\t\t\t\t\t'hide-header': __experimentalHideHeader,\n\t\t\t\t\t\t\t'is-scrollable': hasScrollableContent,\n\t\t\t\t\t\t\t'has-scrolled-content': hasScrolledContent,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\trole=\"document\"\n\t\t\t\t\t\tonScroll={ onContentContainerScroll }\n\t\t\t\t\t\tref={ contentRef }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\thasScrollableContent\n\t\t\t\t\t\t\t\t? __( 'Scrollable section' )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttabIndex={ hasScrollableContent ? 0 : undefined }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! __experimentalHideHeader && (\n\t\t\t\t\t\t\t<div className=\"components-modal__header\">\n\t\t\t\t\t\t\t\t<div className=\"components-modal__header-heading-container\">\n\t\t\t\t\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-modal__icon-container\"\n\t\t\t\t\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ icon }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ title && (\n\t\t\t\t\t\t\t\t\t\t<h1\n\t\t\t\t\t\t\t\t\t\t\tid={ headingId }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-modal__header-heading\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{ isDismissible && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tonClick={ onRequestClose }\n\t\t\t\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\tcloseButtonLabel || __( 'Close' )\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</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<div ref={ childrenContainerRef }>{ children }</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</StyleProvider>\n\t\t</div>,\n\t\tdocument.body\n\t);\n}\n\n/**\n * Modals give users information and choices related to a task they’re trying to\n * accomplish. They can contain critical information, require decisions, or\n * involve multiple tasks.\n *\n * ```jsx\n * import { Button, Modal } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyModal = () => {\n * const [ isOpen, setOpen ] = useState( false );\n * const openModal = () => setOpen( true );\n * const closeModal = () => setOpen( false );\n *\n * return (\n * <>\n * <Button variant=\"secondary\" onClick={ openModal }>\n * Open Modal\n * </Button>\n * { isOpen && (\n * <Modal title=\"This is my modal\" onRequestClose={ closeModal }>\n * <Button variant=\"secondary\" onClick={ closeModal }>\n * My custom close button\n * </Button>\n * </Modal>\n * ) }\n * </>\n * );\n * };\n * ```\n */\nexport const Modal = forwardRef( UnforwardedModal );\n\nexport default Modal;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/modal/index.tsx"],"names":["openModalCount","UnforwardedModal","props","forwardedRef","bodyOpenClassName","role","title","focusOnMount","shouldCloseOnEsc","shouldCloseOnClickOutside","isDismissible","aria","labelledby","undefined","describedby","onRequestClose","icon","closeButtonLabel","children","style","overlayClassName","className","contentLabel","onKeyDown","isFullScreen","__experimentalHideHeader","ref","instanceId","Modal","headingId","focusOnMountRef","constrainedTabbingRef","focusReturnRef","focusOutsideProps","contentRef","childrenContainerRef","hasScrolledContent","setHasScrolledContent","hasScrollableContent","setHasScrollableContent","isContentScrollable","current","closestScrollContainer","ariaHelper","hideApp","document","body","classList","add","remove","showApp","window","ResizeObserver","resizeObserver","observe","disconnect","handleEscapeKeyDown","event","nativeEvent","isComposing","keyCode","code","defaultPrevented","preventDefault","onContentContainerScroll","e","scrollY","currentTarget","scrollTop","close"],"mappings":";;;;;;;;;AASA;;AANA;;AAeA;;AAQA;;AACA;;AACA;;AAKA;;AACA;;AACA;;;;;;AAnCA;AACA;AACA;;AAIA;AACA;AACA;;AAsBA;AACA;AACA;AAMA;AACA,IAAIA,cAAc,GAAG,CAArB;;AAEA,SAASC,gBAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AACLC,IAAAA,iBAAiB,GAAG,YADf;AAELC,IAAAA,IAAI,GAAG,QAFF;AAGLC,IAAAA,KAAK,GAAG,IAHH;AAILC,IAAAA,YAAY,GAAG,IAJV;AAKLC,IAAAA,gBAAgB,GAAG,IALd;AAMLC,IAAAA,yBAAyB,GAAG,IANvB;AAOLC,IAAAA,aAAa,GAAG,IAPX;;AAQL;AACAC,IAAAA,IAAI,GAAG;AACNC,MAAAA,UAAU,EAAEC,SADN;AAENC,MAAAA,WAAW,EAAED;AAFP,KATF;AAaLE,IAAAA,cAbK;AAcLC,IAAAA,IAdK;AAeLC,IAAAA,gBAfK;AAgBLC,IAAAA,QAhBK;AAiBLC,IAAAA,KAjBK;AAkBLC,IAAAA,gBAlBK;AAmBLC,IAAAA,SAnBK;AAoBLC,IAAAA,YApBK;AAqBLC,IAAAA,SArBK;AAsBLC,IAAAA,YAAY,GAAG,KAtBV;AAuBLC,IAAAA,wBAAwB,GAAG;AAvBtB,MAwB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oBAAoB,GAAG,CAAH,GAAOzB;AAdvC,KAgBG,CAAEY,wBAAF,IACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGT,IAAI,IACL;AACC,IAAA,SAAS,EAAC,kCADX;AAEC;AAFD,KAIGA,IAJH,CAFF,EASGV,KAAK,IACN;AACC,IAAA,EAAE,EAAGuB,SADN;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGvB,KAJH,CAVF,CADD,EAmBGI,aAAa,IACd,4BAAC,eAAD;AACC,IAAA,OAAO,EAAGK,cADX;AAEC,IAAA,IAAI,EAAGsD,YAFR;AAGC,IAAA,KAAK,EACJpD,gBAAgB,IAAI,cAAI,OAAJ;AAJtB,IApBF,CAjBF,EA+CC;AAAK,IAAA,GAAG,EAAGkB;AAAX,KAAoCjB,QAApC,CA/CD,CAxBD,CADD,CARD,CAFM,EAuFN2B,QAAQ,CAACC,IAvFH,CAAP;AAyFA;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;;;AACO,MAAMlB,KAAK,GAAG,yBAAY3B,gBAAZ,CAAd;;eAEQ2B,K","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef, KeyboardEvent, UIEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreatePortal,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\tforwardRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport {\n\tuseInstanceId,\n\tuseFocusReturn,\n\tuseFocusOnMount,\n\t__experimentalUseFocusOutside as useFocusOutside,\n\tuseConstrainedTabbing,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { close } from '@wordpress/icons';\nimport { getScrollContainer } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport * as ariaHelper from './aria-helper';\nimport Button from '../button';\nimport StyleProvider from '../style-provider';\nimport type { ModalProps } from './types';\n\n// Used to count the number of open modals.\nlet openModalCount = 0;\n\nfunction UnforwardedModal(\n\tprops: ModalProps,\n\tforwardedRef: ForwardedRef< HTMLDivElement >\n) {\n\tconst {\n\t\tbodyOpenClassName = 'modal-open',\n\t\trole = 'dialog',\n\t\ttitle = null,\n\t\tfocusOnMount = true,\n\t\tshouldCloseOnEsc = true,\n\t\tshouldCloseOnClickOutside = true,\n\t\tisDismissible = true,\n\t\t/* Accessibility. */\n\t\taria = {\n\t\t\tlabelledby: undefined,\n\t\t\tdescribedby: undefined,\n\t\t},\n\t\tonRequestClose,\n\t\ticon,\n\t\tcloseButtonLabel,\n\t\tchildren,\n\t\tstyle,\n\t\toverlayClassName,\n\t\tclassName,\n\t\tcontentLabel,\n\t\tonKeyDown,\n\t\tisFullScreen = false,\n\t\t__experimentalHideHeader = false,\n\t} = props;\n\n\tconst ref = useRef< HTMLDivElement >();\n\tconst instanceId = useInstanceId( Modal );\n\tconst headingId = title\n\t\t? `components-modal-header-${ instanceId }`\n\t\t: aria.labelledby;\n\tconst focusOnMountRef = useFocusOnMount( focusOnMount );\n\tconst constrainedTabbingRef = useConstrainedTabbing();\n\tconst focusReturnRef = useFocusReturn();\n\tconst focusOutsideProps = useFocusOutside( onRequestClose );\n\tconst contentRef = useRef< HTMLDivElement >( null );\n\tconst childrenContainerRef = useRef< HTMLDivElement >( null );\n\n\tconst [ hasScrolledContent, setHasScrolledContent ] = useState( false );\n\tconst [ hasScrollableContent, setHasScrollableContent ] = useState( false );\n\n\t// Determines whether the Modal content is scrollable and updates the state.\n\tconst isContentScrollable = useCallback( () => {\n\t\tif ( ! contentRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst closestScrollContainer = getScrollContainer( contentRef.current );\n\n\t\tif ( contentRef.current === closestScrollContainer ) {\n\t\t\tsetHasScrollableContent( true );\n\t\t} else {\n\t\t\tsetHasScrollableContent( false );\n\t\t}\n\t}, [ contentRef ] );\n\n\tuseEffect( () => {\n\t\topenModalCount++;\n\n\t\tif ( openModalCount === 1 ) {\n\t\t\tariaHelper.hideApp( ref.current );\n\t\t\tdocument.body.classList.add( bodyOpenClassName );\n\t\t}\n\n\t\treturn () => {\n\t\t\topenModalCount--;\n\n\t\t\tif ( openModalCount === 0 ) {\n\t\t\t\tdocument.body.classList.remove( bodyOpenClassName );\n\t\t\t\tariaHelper.showApp();\n\t\t\t}\n\t\t};\n\t}, [ bodyOpenClassName ] );\n\n\t// Calls the isContentScrollable callback when the Modal children container resizes.\n\tuseLayoutEffect( () => {\n\t\tif ( ! window.ResizeObserver || ! childrenContainerRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst resizeObserver = new ResizeObserver( isContentScrollable );\n\t\tresizeObserver.observe( childrenContainerRef.current );\n\n\t\tisContentScrollable();\n\n\t\treturn () => {\n\t\t\tresizeObserver.disconnect();\n\t\t};\n\t}, [ isContentScrollable, childrenContainerRef ] );\n\n\tfunction handleEscapeKeyDown( event: KeyboardEvent< HTMLDivElement > ) {\n\t\tif (\n\t\t\t// Ignore keydowns from IMEs\n\t\t\tevent.nativeEvent.isComposing ||\n\t\t\t// Workaround for Mac Safari where the final Enter/Backspace of an IME composition\n\t\t\t// is `isComposing=false`, even though it's technically still part of the composition.\n\t\t\t// These can only be detected by keyCode.\n\t\t\tevent.keyCode === 229\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tshouldCloseOnEsc &&\n\t\t\tevent.code === 'Escape' &&\n\t\t\t! event.defaultPrevented\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\tif ( onRequestClose ) {\n\t\t\t\tonRequestClose( event );\n\t\t\t}\n\t\t}\n\t}\n\n\tconst onContentContainerScroll = useCallback(\n\t\t( e: UIEvent< HTMLDivElement > ) => {\n\t\t\tconst scrollY = e?.currentTarget?.scrollTop ?? -1;\n\n\t\t\tif ( ! hasScrolledContent && scrollY > 0 ) {\n\t\t\t\tsetHasScrolledContent( true );\n\t\t\t} else if ( hasScrolledContent && scrollY <= 0 ) {\n\t\t\t\tsetHasScrolledContent( false );\n\t\t\t}\n\t\t},\n\t\t[ hasScrolledContent ]\n\t);\n\n\treturn createPortal(\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tref={ useMergeRefs( [ ref, forwardedRef ] ) }\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-modal__screen-overlay',\n\t\t\t\toverlayClassName\n\t\t\t) }\n\t\t\tonKeyDown={ handleEscapeKeyDown }\n\t\t>\n\t\t\t<StyleProvider document={ document }>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'components-modal__frame',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-full-screen': isFullScreen,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ style }\n\t\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t\tconstrainedTabbingRef,\n\t\t\t\t\t\tfocusReturnRef,\n\t\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t\t] ) }\n\t\t\t\t\trole={ role }\n\t\t\t\t\taria-label={ contentLabel }\n\t\t\t\t\taria-labelledby={ contentLabel ? undefined : headingId }\n\t\t\t\t\taria-describedby={ aria.describedby }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t{ ...( shouldCloseOnClickOutside\n\t\t\t\t\t\t? focusOutsideProps\n\t\t\t\t\t\t: {} ) }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames( 'components-modal__content', {\n\t\t\t\t\t\t\t'hide-header': __experimentalHideHeader,\n\t\t\t\t\t\t\t'is-scrollable': hasScrollableContent,\n\t\t\t\t\t\t\t'has-scrolled-content': hasScrolledContent,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\trole=\"document\"\n\t\t\t\t\t\tonScroll={ onContentContainerScroll }\n\t\t\t\t\t\tref={ contentRef }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\thasScrollableContent\n\t\t\t\t\t\t\t\t? __( 'Scrollable section' )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttabIndex={ hasScrollableContent ? 0 : undefined }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! __experimentalHideHeader && (\n\t\t\t\t\t\t\t<div className=\"components-modal__header\">\n\t\t\t\t\t\t\t\t<div className=\"components-modal__header-heading-container\">\n\t\t\t\t\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-modal__icon-container\"\n\t\t\t\t\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ icon }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ title && (\n\t\t\t\t\t\t\t\t\t\t<h1\n\t\t\t\t\t\t\t\t\t\t\tid={ headingId }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-modal__header-heading\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{ isDismissible && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tonClick={ onRequestClose }\n\t\t\t\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\tcloseButtonLabel || __( 'Close' )\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</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<div ref={ childrenContainerRef }>{ children }</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</StyleProvider>\n\t\t</div>,\n\t\tdocument.body\n\t);\n}\n\n/**\n * Modals give users information and choices related to a task they’re trying to\n * accomplish. They can contain critical information, require decisions, or\n * involve multiple tasks.\n *\n * ```jsx\n * import { Button, Modal } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyModal = () => {\n * const [ isOpen, setOpen ] = useState( false );\n * const openModal = () => setOpen( true );\n * const closeModal = () => setOpen( false );\n *\n * return (\n * <>\n * <Button variant=\"secondary\" onClick={ openModal }>\n * Open Modal\n * </Button>\n * { isOpen && (\n * <Modal title=\"This is my modal\" onRequestClose={ closeModal }>\n * <Button variant=\"secondary\" onClick={ closeModal }>\n * My custom close button\n * </Button>\n * </Modal>\n * ) }\n * </>\n * );\n * };\n * ```\n */\nexport const Modal = forwardRef( UnforwardedModal );\n\nexport default Modal;\n"]}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -9,8 +7,6 @@ exports.default = void 0;
9
7
 
10
8
  var _element = require("@wordpress/element");
11
9
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
10
  var _dom = require("@wordpress/dom");
15
11
 
16
12
  /**
@@ -182,17 +178,18 @@ class NavigableContainer extends _element.Component {
182
178
  forwardedRef,
183
179
  ...restProps
184
180
  } = this.props;
185
- return (0, _element.createElement)("div", (0, _extends2.default)({
186
- ref: this.bindContainer
187
- }, restProps), children);
181
+ return (0, _element.createElement)("div", {
182
+ ref: this.bindContainer,
183
+ ...restProps
184
+ }, children);
188
185
  }
189
186
 
190
187
  }
191
188
 
192
189
  const forwardedNavigableContainer = (props, ref) => {
193
- return (0, _element.createElement)(NavigableContainer, (0, _extends2.default)({}, props, {
190
+ return (0, _element.createElement)(NavigableContainer, { ...props,
194
191
  forwardedRef: ref
195
- }));
192
+ });
196
193
  };
197
194
 
198
195
  forwardedNavigableContainer.displayName = 'NavigableContainer';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigable-container/container.tsx"],"names":["noop","MENU_ITEM_ROLES","cycleValue","value","total","offset","nextValue","NavigableContainer","Component","constructor","args","onKeyDown","bind","bindContainer","getFocusableContext","getFocusableIndex","componentDidMount","container","addEventListener","componentWillUnmount","removeEventListener","ref","forwardedRef","props","current","target","onlyBrowserTabstops","finder","focus","tabbable","focusable","focusables","find","index","indexOf","event","cycle","eventToOffset","onNavigate","stopNavigationEvents","undefined","stopImmediatePropagation","targetRole","getAttribute","targetHasMenuItemRole","includes","preventDefault","activeElement","ownerDocument","context","nextIndex","length","code","render","children","restProps","forwardedNavigableContainer","displayName"],"mappings":";;;;;;;;;AAQA;;;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AASA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AACA,MAAMC,eAAe,GAAG,CAAE,UAAF,EAAc,eAAd,EAA+B,kBAA/B,CAAxB;;AAEA,SAASC,UAAT,CAAqBC,KAArB,EAAoCC,KAApC,EAAmDC,MAAnD,EAAoE;AACnE,QAAMC,SAAS,GAAGH,KAAK,GAAGE,MAA1B;;AACA,MAAKC,SAAS,GAAG,CAAjB,EAAqB;AACpB,WAAOF,KAAK,GAAGE,SAAf;AACA,GAFD,MAEO,IAAKA,SAAS,IAAIF,KAAlB,EAA0B;AAChC,WAAOE,SAAS,GAAGF,KAAnB;AACA;;AAED,SAAOE,SAAP;AACA;;AAED,MAAMC,kBAAN,SAAiCC,kBAAjC,CAAsE;AAGrEC,EAAAA,WAAW,CAAEC,IAAF,EAAkC;AAC5C,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AzB;AAAiC,IAAA,YAAY,EAAGF;AAAhD,KAAP;AACA,CALD;;AAMAmC,2BAA2B,CAACC,WAA5B,GAA0C,oBAA1C;;eAEe,yBAAYD,2BAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Component, forwardRef } from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport type { NavigableContainerProps } from './types';\n\nconst noop = () => {};\nconst MENU_ITEM_ROLES = [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ];\n\nfunction cycleValue( value: number, total: number, offset: number ) {\n\tconst nextValue = value + offset;\n\tif ( nextValue < 0 ) {\n\t\treturn total + nextValue;\n\t} else if ( nextValue >= total ) {\n\t\treturn nextValue - total;\n\t}\n\n\treturn nextValue;\n}\n\nclass NavigableContainer extends Component< NavigableContainerProps > {\n\tcontainer?: HTMLDivElement;\n\n\tconstructor( args: NavigableContainerProps ) {\n\t\tsuper( args );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.bindContainer = this.bindContainer.bind( this );\n\n\t\tthis.getFocusableContext = this.getFocusableContext.bind( this );\n\t\tthis.getFocusableIndex = this.getFocusableIndex.bind( this );\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( ! this.container ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We use DOM event listeners instead of React event listeners\n\t\t// because we want to catch events from the underlying DOM tree\n\t\t// The React Tree can be different from the DOM tree when using\n\t\t// portals. Block Toolbars for instance are rendered in a separate\n\t\t// React Trees.\n\t\tthis.container.addEventListener( 'keydown', this.onKeyDown );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( ! this.container ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.container.removeEventListener( 'keydown', this.onKeyDown );\n\t}\n\n\tbindContainer( ref: HTMLDivElement ) {\n\t\tconst { forwardedRef } = this.props;\n\t\tthis.container = ref;\n\n\t\tif ( typeof forwardedRef === 'function' ) {\n\t\t\tforwardedRef( ref );\n\t\t} else if ( forwardedRef && 'current' in forwardedRef ) {\n\t\t\tforwardedRef.current = ref;\n\t\t}\n\t}\n\n\tgetFocusableContext( target: Element ) {\n\t\tif ( ! this.container ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { onlyBrowserTabstops } = this.props;\n\t\tconst finder = onlyBrowserTabstops ? focus.tabbable : focus.focusable;\n\t\tconst focusables = finder.find( this.container ) as HTMLElement[];\n\n\t\tconst index = this.getFocusableIndex( focusables, target );\n\t\tif ( index > -1 && target ) {\n\t\t\treturn { index, target, focusables };\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetFocusableIndex( focusables: Element[], target: Element ) {\n\t\treturn focusables.indexOf( target );\n\t}\n\n\tonKeyDown( event: KeyboardEvent ) {\n\t\tif ( this.props.onKeyDown ) {\n\t\t\tthis.props.onKeyDown( event );\n\t\t}\n\n\t\tconst { getFocusableContext } = this;\n\t\tconst {\n\t\t\tcycle = true,\n\t\t\teventToOffset,\n\t\t\tonNavigate = noop,\n\t\t\tstopNavigationEvents,\n\t\t} = this.props;\n\n\t\tconst offset = eventToOffset( event );\n\n\t\t// eventToOffset returns undefined if the event is not handled by the component.\n\t\tif ( offset !== undefined && stopNavigationEvents ) {\n\t\t\t// Prevents arrow key handlers bound to the document directly interfering.\n\t\t\tevent.stopImmediatePropagation();\n\n\t\t\t// When navigating a collection of items, prevent scroll containers\n\t\t\t// from scrolling. The preventDefault also prevents Voiceover from\n\t\t\t// 'handling' the event, as voiceover will try to use arrow keys\n\t\t\t// for highlighting text.\n\t\t\tconst targetRole = (\n\t\t\t\tevent.target as HTMLDivElement | null\n\t\t\t )?.getAttribute( 'role' );\n\t\t\tconst targetHasMenuItemRole =\n\t\t\t\t!! targetRole && MENU_ITEM_ROLES.includes( targetRole );\n\n\t\t\tif ( targetHasMenuItemRole ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tif ( ! offset ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = ( event.target as HTMLElement | null )\n\t\t\t?.ownerDocument?.activeElement;\n\t\tif ( ! activeElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst context = getFocusableContext( activeElement );\n\t\tif ( ! context ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { index, focusables } = context;\n\t\tconst nextIndex = cycle\n\t\t\t? cycleValue( index, focusables.length, offset )\n\t\t\t: index + offset;\n\n\t\tif ( nextIndex >= 0 && nextIndex < focusables.length ) {\n\t\t\tfocusables[ nextIndex ].focus();\n\t\t\tonNavigate( nextIndex, focusables[ nextIndex ] );\n\n\t\t\t// `preventDefault()` on tab to avoid having the browser move the focus\n\t\t\t// after this component has already moved it.\n\t\t\tif ( event.code === 'Tab' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tstopNavigationEvents,\n\t\t\teventToOffset,\n\t\t\tonNavigate,\n\t\t\tonKeyDown,\n\t\t\tcycle,\n\t\t\tonlyBrowserTabstops,\n\t\t\tforwardedRef,\n\t\t\t...restProps\n\t\t} = this.props;\n\t\treturn (\n\t\t\t<div ref={ this.bindContainer } { ...restProps }>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nconst forwardedNavigableContainer = (\n\tprops: NavigableContainerProps,\n\tref: ForwardedRef< HTMLDivElement >\n) => {\n\treturn <NavigableContainer { ...props } forwardedRef={ ref } />;\n};\nforwardedNavigableContainer.displayName = 'NavigableContainer';\n\nexport default forwardRef( forwardedNavigableContainer );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigable-container/container.tsx"],"names":["noop","MENU_ITEM_ROLES","cycleValue","value","total","offset","nextValue","NavigableContainer","Component","constructor","args","onKeyDown","bind","bindContainer","getFocusableContext","getFocusableIndex","componentDidMount","container","addEventListener","componentWillUnmount","removeEventListener","ref","forwardedRef","props","current","target","onlyBrowserTabstops","finder","focus","tabbable","focusable","focusables","find","index","indexOf","event","cycle","eventToOffset","onNavigate","stopNavigationEvents","undefined","stopImmediatePropagation","targetRole","getAttribute","targetHasMenuItemRole","includes","preventDefault","activeElement","ownerDocument","context","nextIndex","length","code","render","children","restProps","forwardedNavigableContainer","displayName"],"mappings":";;;;;;;AAQA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AASA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AACA,MAAMC,eAAe,GAAG,CAAE,UAAF,EAAc,eAAd,EAA+B,kBAA/B,CAAxB;;AAEA,SAASC,UAAT,CAAqBC,KAArB,EAAoCC,KAApC,EAAmDC,MAAnD,EAAoE;AACnE,QAAMC,SAAS,GAAGH,KAAK,GAAGE,MAA1B;;AACA,MAAKC,SAAS,GAAG,CAAjB,EAAqB;AACpB,WAAOF,KAAK,GAAGE,SAAf;AACA,GAFD,MAEO,IAAKA,SAAS,IAAIF,KAAlB,EAA0B;AAChC,WAAOE,SAAS,GAAGF,KAAnB;AACA;;AAED,SAAOE,SAAP;AACA;;AAED,MAAMC,kBAAN,SAAiCC,kBAAjC,CAAsE;AAGrEC,EAAAA,WAAW,CAAEC,IAAF,EAAkC;AAC5C,UAAOA,IAAP;AACA,SAAKC,SAAL,GAAiB,KAAKA,SAAL,CAAeC,IAAf,CAAqB,IAArB,CAAjB;AACA,SAAKC,aAAL,GAAqB,KAAKA,aAAL,CAAmBD,IAAnB,CAAyB,IAAzB,CAArB;AAEA,SAAKE,mBAAL,GAA2B,KAAKA,mBAAL,CAAyBF,IAAzB,CAA+B,IAA/B,CAA3B;AACA,SAAKG,iBAAL,GAAyB,KAAKA,iBAAL,CAAuBH,IAAvB,CAA6B,IAA7B,CAAzB;AACA;;AAEDI,EAAAA,iBAAiB,GAAG;AACnB,QAAK,CAAE,KAAKC,SAAZ,EAAwB;AACvB;AACA,KAHkB,CAKnB;AACA;AACA;AACA;AACA;;;AACA,SAAKA,SAA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X;;AAIA,QAAK6C,SAAS,IAAI,CAAb,IAAkBA,SAAS,GAAGnB,UAAU,CAACoB,MAA9C,EAAuD;AACtDpB,MAAAA,UAAU,CAAEmB,SAAF,CAAV,CAAwBtB,KAAxB;AACAU,MAAAA,UAAU,CAAEY,SAAF,EAAanB,UAAU,CAAEmB,SAAF,CAAvB,CAAV,CAFsD,CAItD;AACA;;AACA,UAAKf,KAAK,CAACiB,IAAN,KAAe,KAApB,EAA4B;AAC3BjB,QAAAA,KAAK,CAACW,cAAN;AACA;AACD;AACD;;AAEDO,EAAAA,MAAM,GAAG;AACR,UAAM;AACLC,MAAAA,QADK;AAELf,MAAAA,oBAFK;AAGLF,MAAAA,aAHK;AAILC,MAAAA,UAJK;AAKL3B,MAAAA,SALK;AAMLyB,MAAAA,KANK;AAOLV,MAAAA,mBAPK;AAQLJ,MAAAA,YARK;AASL,SAAGiC;AATE,QAUF,KAAKhC,KAVT;AAWA,WACC;AAAK,MAAA,GAAG,EAAG,KAAKV,aAAhB;AAAA,SAAqC0C;AAArC,OACGD,QADH,CADD;AAKA;;AApJoE;;AAuJtE,MAAME,2BAA2B,GAAG,CACnCjC,KADmC,EAEnCF,GAFmC,KAG/B;AACJ,SAAO,4BAAC,kBAAD,OAAyBE,KAAzB;AAAiC,IAAA,YAAY,EAAGF;AAAhD,IAAP;AACA,CALD;;AAMAmC,2BAA2B,CAACC,WAA5B,GAA0C,oBAA1C;;eAEe,yBAAYD,2BAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Component, forwardRef } from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport type { NavigableContainerProps } from './types';\n\nconst noop = () => {};\nconst MENU_ITEM_ROLES = [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ];\n\nfunction cycleValue( value: number, total: number, offset: number ) {\n\tconst nextValue = value + offset;\n\tif ( nextValue < 0 ) {\n\t\treturn total + nextValue;\n\t} else if ( nextValue >= total ) {\n\t\treturn nextValue - total;\n\t}\n\n\treturn nextValue;\n}\n\nclass NavigableContainer extends Component< NavigableContainerProps > {\n\tcontainer?: HTMLDivElement;\n\n\tconstructor( args: NavigableContainerProps ) {\n\t\tsuper( args );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.bindContainer = this.bindContainer.bind( this );\n\n\t\tthis.getFocusableContext = this.getFocusableContext.bind( this );\n\t\tthis.getFocusableIndex = this.getFocusableIndex.bind( this );\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( ! this.container ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We use DOM event listeners instead of React event listeners\n\t\t// because we want to catch events from the underlying DOM tree\n\t\t// The React Tree can be different from the DOM tree when using\n\t\t// portals. Block Toolbars for instance are rendered in a separate\n\t\t// React Trees.\n\t\tthis.container.addEventListener( 'keydown', this.onKeyDown );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( ! this.container ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.container.removeEventListener( 'keydown', this.onKeyDown );\n\t}\n\n\tbindContainer( ref: HTMLDivElement ) {\n\t\tconst { forwardedRef } = this.props;\n\t\tthis.container = ref;\n\n\t\tif ( typeof forwardedRef === 'function' ) {\n\t\t\tforwardedRef( ref );\n\t\t} else if ( forwardedRef && 'current' in forwardedRef ) {\n\t\t\tforwardedRef.current = ref;\n\t\t}\n\t}\n\n\tgetFocusableContext( target: Element ) {\n\t\tif ( ! this.container ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { onlyBrowserTabstops } = this.props;\n\t\tconst finder = onlyBrowserTabstops ? focus.tabbable : focus.focusable;\n\t\tconst focusables = finder.find( this.container ) as HTMLElement[];\n\n\t\tconst index = this.getFocusableIndex( focusables, target );\n\t\tif ( index > -1 && target ) {\n\t\t\treturn { index, target, focusables };\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetFocusableIndex( focusables: Element[], target: Element ) {\n\t\treturn focusables.indexOf( target );\n\t}\n\n\tonKeyDown( event: KeyboardEvent ) {\n\t\tif ( this.props.onKeyDown ) {\n\t\t\tthis.props.onKeyDown( event );\n\t\t}\n\n\t\tconst { getFocusableContext } = this;\n\t\tconst {\n\t\t\tcycle = true,\n\t\t\teventToOffset,\n\t\t\tonNavigate = noop,\n\t\t\tstopNavigationEvents,\n\t\t} = this.props;\n\n\t\tconst offset = eventToOffset( event );\n\n\t\t// eventToOffset returns undefined if the event is not handled by the component.\n\t\tif ( offset !== undefined && stopNavigationEvents ) {\n\t\t\t// Prevents arrow key handlers bound to the document directly interfering.\n\t\t\tevent.stopImmediatePropagation();\n\n\t\t\t// When navigating a collection of items, prevent scroll containers\n\t\t\t// from scrolling. The preventDefault also prevents Voiceover from\n\t\t\t// 'handling' the event, as voiceover will try to use arrow keys\n\t\t\t// for highlighting text.\n\t\t\tconst targetRole = (\n\t\t\t\tevent.target as HTMLDivElement | null\n\t\t\t )?.getAttribute( 'role' );\n\t\t\tconst targetHasMenuItemRole =\n\t\t\t\t!! targetRole && MENU_ITEM_ROLES.includes( targetRole );\n\n\t\t\tif ( targetHasMenuItemRole ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tif ( ! offset ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = ( event.target as HTMLElement | null )\n\t\t\t?.ownerDocument?.activeElement;\n\t\tif ( ! activeElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst context = getFocusableContext( activeElement );\n\t\tif ( ! context ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { index, focusables } = context;\n\t\tconst nextIndex = cycle\n\t\t\t? cycleValue( index, focusables.length, offset )\n\t\t\t: index + offset;\n\n\t\tif ( nextIndex >= 0 && nextIndex < focusables.length ) {\n\t\t\tfocusables[ nextIndex ].focus();\n\t\t\tonNavigate( nextIndex, focusables[ nextIndex ] );\n\n\t\t\t// `preventDefault()` on tab to avoid having the browser move the focus\n\t\t\t// after this component has already moved it.\n\t\t\tif ( event.code === 'Tab' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tstopNavigationEvents,\n\t\t\teventToOffset,\n\t\t\tonNavigate,\n\t\t\tonKeyDown,\n\t\t\tcycle,\n\t\t\tonlyBrowserTabstops,\n\t\t\tforwardedRef,\n\t\t\t...restProps\n\t\t} = this.props;\n\t\treturn (\n\t\t\t<div ref={ this.bindContainer } { ...restProps }>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nconst forwardedNavigableContainer = (\n\tprops: NavigableContainerProps,\n\tref: ForwardedRef< HTMLDivElement >\n) => {\n\treturn <NavigableContainer { ...props } forwardedRef={ ref } />;\n};\nforwardedNavigableContainer.displayName = 'NavigableContainer';\n\nexport default forwardRef( forwardedNavigableContainer );\n"]}
@@ -11,8 +11,6 @@ exports.default = void 0;
11
11
 
12
12
  var _element = require("@wordpress/element");
13
13
 
14
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
-
16
14
  var _container = _interopRequireDefault(require("./container"));
17
15
 
18
16
  /**
@@ -62,14 +60,15 @@ function UnforwardedNavigableMenu({
62
60
  return undefined;
63
61
  };
64
62
 
65
- return (0, _element.createElement)(_container.default, (0, _extends2.default)({
63
+ return (0, _element.createElement)(_container.default, {
66
64
  ref: ref,
67
65
  stopNavigationEvents: true,
68
66
  onlyBrowserTabstops: false,
69
67
  role: role,
70
68
  "aria-orientation": role !== 'presentation' && (orientation === 'vertical' || orientation === 'horizontal') ? orientation : undefined,
71
- eventToOffset: eventToOffset
72
- }, rest));
69
+ eventToOffset: eventToOffset,
70
+ ...rest
71
+ });
73
72
  }
74
73
  /**
75
74
  * A container for a navigable menu.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigable-container/menu.tsx"],"names":["UnforwardedNavigableMenu","role","orientation","rest","ref","e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C,wBACCA,IAAI,KAAK,cAAT,KACEC,WAAW,KAAK,UAAhB,IAA8BA,WAAW,KAAK,YADhD,IAEGA,WAFH,GAGGS,SATL;AAWC,IAAA,aAAa,EAAGN;AAXjB,KAYMF,IAZN,EADD;AAgBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMS,aAAa,GAAG,yBAAYZ,wBAAZ,CAAtB;;eAEQY,a","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\nimport type { NavigableMenuProps } from './types';\n\nexport function UnforwardedNavigableMenu(\n\t{ role = 'menu', orientation = 'vertical', ...rest }: NavigableMenuProps,\n\tref: ForwardedRef< any >\n) {\n\tconst eventToOffset = ( evt: KeyboardEvent ) => {\n\t\tconst { code } = evt;\n\n\t\tlet next = [ 'ArrowDown' ];\n\t\tlet previous = [ 'ArrowUp' ];\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tnext = [ 'ArrowRight' ];\n\t\t\tprevious = [ 'ArrowLeft' ];\n\t\t}\n\n\t\tif ( orientation === 'both' ) {\n\t\t\tnext = [ 'ArrowRight', 'ArrowDown' ];\n\t\t\tprevious = [ 'ArrowLeft', 'ArrowUp' ];\n\t\t}\n\n\t\tif ( next.includes( code ) ) {\n\t\t\treturn 1;\n\t\t} else if ( previous.includes( code ) ) {\n\t\t\treturn -1;\n\t\t} else if (\n\t\t\t[ 'ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight' ].includes(\n\t\t\t\tcode\n\t\t\t)\n\t\t) {\n\t\t\t// Key press should be handled, e.g. have event propagation and\n\t\t\t// default behavior handled by NavigableContainer but not result\n\t\t\t// in an offset.\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\treturn (\n\t\t<NavigableContainer\n\t\t\tref={ ref }\n\t\t\tstopNavigationEvents\n\t\t\tonlyBrowserTabstops={ false }\n\t\t\trole={ role }\n\t\t\taria-orientation={\n\t\t\t\trole !== 'presentation' &&\n\t\t\t\t( orientation === 'vertical' || orientation === 'horizontal' )\n\t\t\t\t\t? orientation\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\teventToOffset={ eventToOffset }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n}\n\n/**\n * A container for a navigable menu.\n *\n * ```jsx\n * import {\n * NavigableMenu,\n * Button,\n * } from '@wordpress/components';\n *\n * function onNavigate( index, target ) {\n * console.log( `Navigates to ${ index }`, target );\n * }\n *\n * const MyNavigableContainer = () => (\n * <div>\n * <span>Navigable Menu:</span>\n * <NavigableMenu onNavigate={ onNavigate } orientation=\"horizontal\">\n * <Button variant=\"secondary\">Item 1</Button>\n * <Button variant=\"secondary\">Item 2</Button>\n * <Button variant=\"secondary\">Item 3</Button>\n * </NavigableMenu>\n * </div>\n * );\n * ```\n */\nexport const NavigableMenu = forwardRef( UnforwardedNavigableMenu );\n\nexport default NavigableMenu;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigable-container/menu.tsx"],"names":["UnforwardedNavigableMenu","role","orientation","rest","ref","eventToOffset","evt","code","next","previous","includes","undefined","NavigableMenu"],"mappings":";;;;;;;;;;;AAQA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAIO,SAASA,wBAAT,CACN;AAAEC,EAAAA,IAAI,GAAG,MAAT;AAAiBC,EAAAA,WAAW,GAAG,UAA/B;AAA2C,KAAGC;AAA9C,CADM,EAENC,GAFM,EAGL;AACD,QAAMC,aAAa,GAAKC,GAAF,IAA0B;AAC/C,UAAM;AAAEC,MAAAA;AAAF,QAAWD,GAAjB;AAEA,QAAIE,IAAI,GAAG,CAAE,WAAF,CAAX;AACA,QAAIC,QAAQ,GAAG,CAAE,SAAF,CAAf;;AAEA,QAAKP,WAAW,KAAK,YAArB,EAAoC;AACnCM,MAAAA,IAAI,GAAG,CAAE,YAAF,CAAP;AACAC,MAAAA,QAAQ,GAAG,CAAE,WAAF,CAAX;AACA;;AAED,QAAKP,WAAW,KAAK,MAArB,EAA8B;AAC7BM,MAAAA,IAAI,GAAG,CAAE,YAAF,EAAgB,WAAhB,CAAP;AACAC,MAAAA,QAAQ,GAAG,CAAE,WAAF,EAAe,SAAf,CAAX;AACA;;AAED,QAAKD,IAAI,CAACE,QAAL,CAAeH,IAAf,CAAL,EAA6B;AAC5B,aAAO,CAAP;AACA,KAFD,MAEO,IAAKE,QAAQ,CAACC,QAAT,CAAmBH,IAAnB,CAAL,EAAiC;AACvC,aAAO,CAAC,CAAR;AACA,KAFM,MAEA,IACN,CAAE,WAAF,EAAe,SAAf,EAA0B,WAA1B,EAAuC,YAAvC,EAAsDG,QAAtD,CACCH,IADD,CADM,EAIL;AACD;AACA;AACA;AACA,aAAO,CAAP;AACA;;AAED,WAAOI,SAAP;AACA,GAhCD;;AAkCA,SACC,4BAAC,kBAAD;AACC,IAAA,GAAG,EAAGP,GADP;AAEC,IAAA,oBAAoB,MAFrB;AAGC,IAAA,mBAAmB,EAAG,KAHvB;AAIC,IAAA,IAAI,EAAGH,IAJR;AAKC,wBACCA,IAAI,KAAK,cAAT,KACEC,WAAW,KAAK,UAAhB,IAA8BA,WAAW,KAAK,YADhD,IAEGA,WAFH,GAGGS,SATL;AAWC,IAAA,aAAa,EAAGN,aAXjB;AAAA,OAYMF;AAZN,IADD;AAgBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMS,aAAa,GAAG,yBAAYZ,wBAAZ,CAAtB;;eAEQY,a","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\nimport type { NavigableMenuProps } from './types';\n\nexport function UnforwardedNavigableMenu(\n\t{ role = 'menu', orientation = 'vertical', ...rest }: NavigableMenuProps,\n\tref: ForwardedRef< any >\n) {\n\tconst eventToOffset = ( evt: KeyboardEvent ) => {\n\t\tconst { code } = evt;\n\n\t\tlet next = [ 'ArrowDown' ];\n\t\tlet previous = [ 'ArrowUp' ];\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tnext = [ 'ArrowRight' ];\n\t\t\tprevious = [ 'ArrowLeft' ];\n\t\t}\n\n\t\tif ( orientation === 'both' ) {\n\t\t\tnext = [ 'ArrowRight', 'ArrowDown' ];\n\t\t\tprevious = [ 'ArrowLeft', 'ArrowUp' ];\n\t\t}\n\n\t\tif ( next.includes( code ) ) {\n\t\t\treturn 1;\n\t\t} else if ( previous.includes( code ) ) {\n\t\t\treturn -1;\n\t\t} else if (\n\t\t\t[ 'ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight' ].includes(\n\t\t\t\tcode\n\t\t\t)\n\t\t) {\n\t\t\t// Key press should be handled, e.g. have event propagation and\n\t\t\t// default behavior handled by NavigableContainer but not result\n\t\t\t// in an offset.\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\treturn (\n\t\t<NavigableContainer\n\t\t\tref={ ref }\n\t\t\tstopNavigationEvents\n\t\t\tonlyBrowserTabstops={ false }\n\t\t\trole={ role }\n\t\t\taria-orientation={\n\t\t\t\trole !== 'presentation' &&\n\t\t\t\t( orientation === 'vertical' || orientation === 'horizontal' )\n\t\t\t\t\t? orientation\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\teventToOffset={ eventToOffset }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n}\n\n/**\n * A container for a navigable menu.\n *\n * ```jsx\n * import {\n * NavigableMenu,\n * Button,\n * } from '@wordpress/components';\n *\n * function onNavigate( index, target ) {\n * console.log( `Navigates to ${ index }`, target );\n * }\n *\n * const MyNavigableContainer = () => (\n * <div>\n * <span>Navigable Menu:</span>\n * <NavigableMenu onNavigate={ onNavigate } orientation=\"horizontal\">\n * <Button variant=\"secondary\">Item 1</Button>\n * <Button variant=\"secondary\">Item 2</Button>\n * <Button variant=\"secondary\">Item 3</Button>\n * </NavigableMenu>\n * </div>\n * );\n * ```\n */\nexport const NavigableMenu = forwardRef( UnforwardedNavigableMenu );\n\nexport default NavigableMenu;\n"]}
@@ -11,8 +11,6 @@ exports.default = void 0;
11
11
 
12
12
  var _element = require("@wordpress/element");
13
13
 
14
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
-
16
14
  var _container = _interopRequireDefault(require("./container"));
17
15
 
18
16
  /**
@@ -58,12 +56,13 @@ function UnforwardedTabbableContainer({
58
56
  return undefined;
59
57
  };
60
58
 
61
- return (0, _element.createElement)(_container.default, (0, _extends2.default)({
59
+ return (0, _element.createElement)(_container.default, {
62
60
  ref: ref,
63
61
  stopNavigationEvents: true,
64
62
  onlyBrowserTabstops: true,
65
- eventToOffset: innerEventToOffset
66
- }, props));
63
+ eventToOffset: innerEventToOffset,
64
+ ...props
65
+ });
67
66
  }
68
67
  /**
69
68
  * A container for tabbable elements.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigable-container/tabbable.tsx"],"names":["UnforwardedTabbableContainer","eventToOffset","props","ref","innerEventToOffset","evt","code","shiftKey","undefined","TabbableContainer"],"mappings":";;;;;;;;;;;AAQA;;;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAIO,SAASA,4BAAT,CACN;AAAEC,EAAAA,aAAF;AAAiB,KAAGC;AAApB,CADM,EAENC,GAFM,EAGL;AACD,QAAMC,kBAAkB,GAAKC,GAAF,IAA0B;AACpD,UAAM;AAAEC,MAAAA,IAAF;AAAQC,MAAAA;AAAR,QAAqBF,GAA3B;;AACA,QAAK,UAAUC,IAAf,EAAsB;AACrB,aAAOC,QAAQ,GAAG,CAAC,CAAJ,GAAQ,CAAvB;AACA,KAJmD,CAMpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,QAAKN,aAAL,EAAqB;AACpB,aAAOA,aAAa,CAAEI,GAAF,CAApB;AACA;;AAED,WAAOG,SAAP;AACA,GAtBD;;AAwBA,SACC,4BAAC,kBAAD;AACC,IAAA,GAAG,EAAGL,GADP;AAEC,IAAA,oBAAoB,MAFrB;AAGC,IAAA,mBAAmB,MAHpB;AAIC,IAAA,aAAa,EAAGC;AAJjB,KAKMF,KALN,EADD;AASA;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;;;AACO,MAAMO,iBAAiB,GAAG,yBAAYT,4BAAZ,CAA1B;;eAEQS,iB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\nimport type { TabbableContainerProps } from './types';\n\nexport function UnforwardedTabbableContainer(\n\t{ eventToOffset, ...props }: TabbableContainerProps,\n\tref: ForwardedRef< any >\n) {\n\tconst innerEventToOffset = ( evt: KeyboardEvent ) => {\n\t\tconst { code, shiftKey } = evt;\n\t\tif ( 'Tab' === code ) {\n\t\t\treturn shiftKey ? -1 : 1;\n\t\t}\n\n\t\t// Allow custom handling of keys besides Tab.\n\t\t//\n\t\t// By default, TabbableContainer will move focus forward on Tab and\n\t\t// backward on Shift+Tab. The handler below will be used for all other\n\t\t// events. The semantics for `eventToOffset`'s return\n\t\t// values are the following:\n\t\t//\n\t\t// - +1: move focus forward\n\t\t// - -1: move focus backward\n\t\t// - 0: don't move focus, but acknowledge event and thus stop it\n\t\t// - undefined: do nothing, let the event propagate.\n\t\tif ( eventToOffset ) {\n\t\t\treturn eventToOffset( evt );\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\treturn (\n\t\t<NavigableContainer\n\t\t\tref={ ref }\n\t\t\tstopNavigationEvents\n\t\t\tonlyBrowserTabstops\n\t\t\teventToOffset={ innerEventToOffset }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\n/**\n * A container for tabbable elements.\n *\n * ```jsx\n * import {\n * TabbableContainer,\n * Button,\n * } from '@wordpress/components';\n *\n * function onNavigate( index, target ) {\n * console.log( `Navigates to ${ index }`, target );\n * }\n *\n * const MyTabbableContainer = () => (\n * <div>\n * <span>Tabbable Container:</span>\n * <TabbableContainer onNavigate={ onNavigate }>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 1\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 2\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 3\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 4\n * </Button>\n * </TabbableContainer>\n * </div>\n * );\n * ```\n */\nexport const TabbableContainer = forwardRef( UnforwardedTabbableContainer );\n\nexport default TabbableContainer;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigable-container/tabbable.tsx"],"names":["UnforwardedTabbableContainer","eventToOffset","props","ref","innerEventToOffset","evt","code","shiftKey","undefined","TabbableContainer"],"mappings":";;;;;;;;;;;AAQA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAIO,SAASA,4BAAT,CACN;AAAEC,EAAAA,aAAF;AAAiB,KAAGC;AAApB,CADM,EAENC,GAFM,EAGL;AACD,QAAMC,kBAAkB,GAAKC,GAAF,IAA0B;AACpD,UAAM;AAAEC,MAAAA,IAAF;AAAQC,MAAAA;AAAR,QAAqBF,GAA3B;;AACA,QAAK,UAAUC,IAAf,EAAsB;AACrB,aAAOC,QAAQ,GAAG,CAAC,CAAJ,GAAQ,CAAvB;AACA,KAJmD,CAMpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,QAAKN,aAAL,EAAqB;AACpB,aAAOA,aAAa,CAAEI,GAAF,CAApB;AACA;;AAED,WAAOG,SAAP;AACA,GAtBD;;AAwBA,SACC,4BAAC,kBAAD;AACC,IAAA,GAAG,EAAGL,GADP;AAEC,IAAA,oBAAoB,MAFrB;AAGC,IAAA,mBAAmB,MAHpB;AAIC,IAAA,aAAa,EAAGC,kBAJjB;AAAA,OAKMF;AALN,IADD;AASA;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;;;AACO,MAAMO,iBAAiB,GAAG,yBAAYT,4BAAZ,CAA1B;;eAEQS,iB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\nimport type { TabbableContainerProps } from './types';\n\nexport function UnforwardedTabbableContainer(\n\t{ eventToOffset, ...props }: TabbableContainerProps,\n\tref: ForwardedRef< any >\n) {\n\tconst innerEventToOffset = ( evt: KeyboardEvent ) => {\n\t\tconst { code, shiftKey } = evt;\n\t\tif ( 'Tab' === code ) {\n\t\t\treturn shiftKey ? -1 : 1;\n\t\t}\n\n\t\t// Allow custom handling of keys besides Tab.\n\t\t//\n\t\t// By default, TabbableContainer will move focus forward on Tab and\n\t\t// backward on Shift+Tab. The handler below will be used for all other\n\t\t// events. The semantics for `eventToOffset`'s return\n\t\t// values are the following:\n\t\t//\n\t\t// - +1: move focus forward\n\t\t// - -1: move focus backward\n\t\t// - 0: don't move focus, but acknowledge event and thus stop it\n\t\t// - undefined: do nothing, let the event propagate.\n\t\tif ( eventToOffset ) {\n\t\t\treturn eventToOffset( evt );\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\treturn (\n\t\t<NavigableContainer\n\t\t\tref={ ref }\n\t\t\tstopNavigationEvents\n\t\t\tonlyBrowserTabstops\n\t\t\teventToOffset={ innerEventToOffset }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\n/**\n * A container for tabbable elements.\n *\n * ```jsx\n * import {\n * TabbableContainer,\n * Button,\n * } from '@wordpress/components';\n *\n * function onNavigate( index, target ) {\n * console.log( `Navigates to ${ index }`, target );\n * }\n *\n * const MyTabbableContainer = () => (\n * <div>\n * <span>Tabbable Container:</span>\n * <TabbableContainer onNavigate={ onNavigate }>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 1\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 2\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 3\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 4\n * </Button>\n * </TabbableContainer>\n * </div>\n * );\n * ```\n */\nexport const TabbableContainer = forwardRef( UnforwardedTabbableContainer );\n\nexport default TabbableContainer;\n"]}
@@ -9,8 +9,6 @@ exports.default = NavigationItemBase;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _classnames = _interopRequireDefault(require("classnames"));
15
13
 
16
14
  var _context = require("../context");
@@ -52,8 +50,9 @@ function NavigationItemBase(props) {
52
50
  }
53
51
 
54
52
  const classes = (0, _classnames.default)('components-navigation__item', className);
55
- return (0, _element.createElement)(_navigationStyles.ItemBaseUI, (0, _extends2.default)({
56
- className: classes
57
- }, restProps), children);
53
+ return (0, _element.createElement)(_navigationStyles.ItemBaseUI, {
54
+ className: classes,
55
+ ...restProps
56
+ }, children);
58
57
  }
59
58
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigation/item/base.tsx"],"names":["uniqueId","NavigationItemBase","props","children","className","title","href","restProps","itemId","navigationTree","getItem","_isVisible","classes"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAUA;;AACA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAOA,IAAIA,QAAQ,GAAG,CAAf;;AAEe,SAASC,kBAAT,CAA6BC,KAA7B,EAA8D;AAC5E;AACA,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,KAAvB;AAA8BC,IAAAA,IAA9B;AAAoC,OAAGC;AAAvC,MAAqDL,KAA3D;AAEA,QAAM,CAAEM,MAAF,IAAa,uBAAW,QAAQ,EAAER,QAAU,EAA/B,CAAnB;AAEA,oDAAuBQ,MAAvB,EAA+BN,KAA/B;AACA,QAAM;AAAEO,IAAAA;AAAF,MAAqB,oCAA3B;;AAEA,MAAK,CAAEA,cAAc,CAACC,OAAf,CAAwBF,MAAxB,GAAkCG,UAAzC,EAAsD;AACrD,WAAO,IAAP;AACA;;AAED,QAAMC,OAAO,GAAG,yBAAY,6BAAZ,EAA2CR,SAA3C,CAAhB;AAEA,SACC,4BAAC,4BAAD;AAAY,IAAA,SAAS,EAAGQ;AAAxB,KAAuCL,SAAvC,GACGJ,QADH,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { useNavigationTreeItem } from './use-navigation-tree-item';\nimport { ItemBaseUI } from '../styles/navigation-styles';\n\nimport type { NavigationItemBaseProps } from '../types';\n\nlet uniqueId = 0;\n\nexport default function NavigationItemBase( props: NavigationItemBaseProps ) {\n\t// Also avoid to pass the `title` and `href` props to the ItemBaseUI styled component.\n\tconst { children, className, title, href, ...restProps } = props;\n\n\tconst [ itemId ] = useState( `item-${ ++uniqueId }` );\n\n\tuseNavigationTreeItem( itemId, props );\n\tconst { navigationTree } = useNavigationContext();\n\n\tif ( ! navigationTree.getItem( itemId )?._isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst classes = classnames( 'components-navigation__item', className );\n\n\treturn (\n\t\t<ItemBaseUI className={ classes } { ...restProps }>\n\t\t\t{ children }\n\t\t</ItemBaseUI>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigation/item/base.tsx"],"names":["uniqueId","NavigationItemBase","props","children","className","title","href","restProps","itemId","navigationTree","getItem","_isVisible","classes"],"mappings":";;;;;;;;;AAQA;;AALA;;AAUA;;AACA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAOA,IAAIA,QAAQ,GAAG,CAAf;;AAEe,SAASC,kBAAT,CAA6BC,KAA7B,EAA8D;AAC5E;AACA,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,KAAvB;AAA8BC,IAAAA,IAA9B;AAAoC,OAAGC;AAAvC,MAAqDL,KAA3D;AAEA,QAAM,CAAEM,MAAF,IAAa,uBAAW,QAAQ,EAAER,QAAU,EAA/B,CAAnB;AAEA,oDAAuBQ,MAAvB,EAA+BN,KAA/B;AACA,QAAM;AAAEO,IAAAA;AAAF,MAAqB,oCAA3B;;AAEA,MAAK,CAAEA,cAAc,CAACC,OAAf,CAAwBF,MAAxB,GAAkCG,UAAzC,EAAsD;AACrD,WAAO,IAAP;AACA;;AAED,QAAMC,OAAO,GAAG,yBAAY,6BAAZ,EAA2CR,SAA3C,CAAhB;AAEA,SACC,4BAAC,4BAAD;AAAY,IAAA,SAAS,EAAGQ,OAAxB;AAAA,OAAuCL;AAAvC,KACGJ,QADH,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { useNavigationTreeItem } from './use-navigation-tree-item';\nimport { ItemBaseUI } from '../styles/navigation-styles';\n\nimport type { NavigationItemBaseProps } from '../types';\n\nlet uniqueId = 0;\n\nexport default function NavigationItemBase( props: NavigationItemBaseProps ) {\n\t// Also avoid to pass the `title` and `href` props to the ItemBaseUI styled component.\n\tconst { children, className, title, href, ...restProps } = props;\n\n\tconst [ itemId ] = useState( `item-${ ++uniqueId }` );\n\n\tuseNavigationTreeItem( itemId, props );\n\tconst { navigationTree } = useNavigationContext();\n\n\tif ( ! navigationTree.getItem( itemId )?._isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst classes = classnames( 'components-navigation__item', className );\n\n\treturn (\n\t\t<ItemBaseUI className={ classes } { ...restProps }>\n\t\t\t{ children }\n\t\t</ItemBaseUI>\n\t);\n}\n"]}
@@ -10,8 +10,6 @@ exports.default = void 0;
10
10
 
11
11
  var _element = require("@wordpress/element");
12
12
 
13
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
-
15
13
  var _classnames = _interopRequireDefault(require("classnames"));
16
14
 
17
15
  var _icons = require("@wordpress/icons");
@@ -94,9 +92,10 @@ function NavigationItem(props) {
94
92
  'aria-current': isActive ? 'page' : undefined,
95
93
  ...restProps
96
94
  };
97
- return (0, _element.createElement)(_base.default, (0, _extends2.default)({}, baseProps, {
95
+ return (0, _element.createElement)(_base.default, { ...baseProps,
98
96
  className: classes
99
- }), children || (0, _element.createElement)(_navigationStyles.ItemUI, itemProps, icon && (0, _element.createElement)(_navigationStyles.ItemIconUI, null, (0, _element.createElement)(_icons.Icon, {
97
+ }, children || (0, _element.createElement)(_navigationStyles.ItemUI, { ...itemProps
98
+ }, icon && (0, _element.createElement)(_navigationStyles.ItemIconUI, null, (0, _element.createElement)(_icons.Icon, {
100
99
  icon: icon
101
100
  })), (0, _element.createElement)(_baseContent.default, {
102
101
  title: title,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigation/item/index.tsx"],"names":["noop","NavigationItem","props","badge","children","className","href","item","navigateToMenu","onClick","title","icon","hideIfTargetMenuEmpty","isText","restProps","activeItem","setActiveMenu","navigationTree","isMenuEmpty","isActive","classes","onItemClick","event","navigationIcon","chevronLeft","chevronRight","baseProps","undefined","itemProps","as","Button"],"mappings":";;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AASA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEO,SAASC,cAAT,CAAyBC,KAAzB,EAAsD;AAC5D,QAAM;AACLC,IAAAA,KADK;AAELC,IAAAA,QAFK;AAGLC,IAAAA,SAHK;AAILC,IAAAA,IAJK;AAKLC,IAAAA,IALK;AAMLC,IAAAA,cANK;AAOLC,IAAAA,OAAO,GAAGT,IAPL;AAQLU,IAAAA,KARK;AASLC,IAAAA,IATK;AAULC,IAAAA,qBAVK;AAWLC,IAAAA,MAXK;AAYL,OAAGC;AAZE,MAaFZ,KAbJ;AAeA,QAAM;AACLa,IAAAA,UADK;AAELC,IAAAA,aAFK;AAGLC,IAAAA,cAAc,EAAE;AAAEC,MAAAA;AAAF;AAHX,MAIF,oCAJJ,CAhB4D,CAsB5D;AACA;AACA;;AACA,MACCN,qBAAqB,IACrBJ,cADA,IAEAU,WAAW,CAAEV,cAAF,CAHZ,EAIE;AACD,WAAO,IAAP;AACA;;AAED,QAAMW,QAAQ,GAAGZ,IAAI,IAAIQ,UAAU,KAAKR,IAAxC;AAEA,QAAMa,OAAO,GAAG,yBAAYf,SAAZ,EAAuB;AACtC,iBAAac;AADyB,GAAvB,CAAhB;;AAIA,QAAME,WAEL,GAAKC,KAAF,IAAa;AAChB,QAAKd,cAAL,EAAsB;AACrBQ,MAAAA,aAAa,CAAER,cAAF,CAAb;AACA;;AAEDC,IAAAA,OAAO,CAAEa,KAAF,CAAP;AACA,GARD;;AASA,QAAMC,cAAc,GAAG,qBAAUC,kBAAV,GAAwBC,mBAA/C;AACA,QAAMC,SAAS,GAAGtB,QAAQ,GAAGF,KAAH,GAAW,EAAE,GAAGA,KAAL;AAAYO,IAAAA,OAAO,EAAEkB;AAArB,GAArC;AACA,QAAMC,SAAS,GAAGf,MAAM,GACrBC,SADqB,GAErB;AACAe,IAAAA,EAAE,EAAEC,eADJ;AAEAxB,IAAAA,IAFA;AAGAG,IAAAA,OAAO,EAAEY,WAHT;AAIA,oBAAgBF,QAAQ,GAAG,MAAH,GAAYQ,SAJpC;AAKA,OAAGb;AALH,GAFH;AAUA,SACC,4BAAC,aAAD,6BAAyBY,SAAzB;AAAqC,IAAA,SAAS,EAAGN;AAAjD,MACGhB,QAAQ,IACT,4BAAC,wBAAD,EAAawB,SAAb,EACGjB,IAAI,IACL,4BAAC,4BAAD,QACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGA;AAAb,IADD,CAFF,EAOC,4BAAC,oBAAD;AACC,IAAA,KAAK,EAAGD,KADT;AAEC,IAAA,KAAK,EAAGP;AAFT,IAPD,EAYGK,cAAc,IAAI,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGe;AAAb,IAZrB,CAFF,CADD;AAoBA;;eAEctB,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport { useNavigationContext } from '../context';\nimport { ItemUI, ItemIconUI } from '../styles/navigation-styles';\nimport NavigationItemBaseContent from './base-content';\nimport NavigationItemBase from './base';\n\nimport type { NavigationItemProps } from '../types';\n\nconst noop = () => {};\n\nexport function NavigationItem( props: NavigationItemProps ) {\n\tconst {\n\t\tbadge,\n\t\tchildren,\n\t\tclassName,\n\t\thref,\n\t\titem,\n\t\tnavigateToMenu,\n\t\tonClick = noop,\n\t\ttitle,\n\t\ticon,\n\t\thideIfTargetMenuEmpty,\n\t\tisText,\n\t\t...restProps\n\t} = props;\n\n\tconst {\n\t\tactiveItem,\n\t\tsetActiveMenu,\n\t\tnavigationTree: { isMenuEmpty },\n\t} = useNavigationContext();\n\n\t// If hideIfTargetMenuEmpty prop is true\n\t// And the menu we are supposed to navigate to\n\t// Is marked as empty, then we skip rendering the item.\n\tif (\n\t\thideIfTargetMenuEmpty &&\n\t\tnavigateToMenu &&\n\t\tisMenuEmpty( navigateToMenu )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst isActive = item && activeItem === item;\n\n\tconst classes = classnames( className, {\n\t\t'is-active': isActive,\n\t} );\n\n\tconst onItemClick: React.MouseEventHandler<\n\t\tHTMLButtonElement | HTMLAnchorElement\n\t> = ( event ) => {\n\t\tif ( navigateToMenu ) {\n\t\t\tsetActiveMenu( navigateToMenu );\n\t\t}\n\n\t\tonClick( event );\n\t};\n\tconst navigationIcon = isRTL() ? chevronLeft : chevronRight;\n\tconst baseProps = children ? props : { ...props, onClick: undefined };\n\tconst itemProps = isText\n\t\t? restProps\n\t\t: {\n\t\t\t\tas: Button,\n\t\t\t\thref,\n\t\t\t\tonClick: onItemClick,\n\t\t\t\t'aria-current': isActive ? 'page' : undefined,\n\t\t\t\t...restProps,\n\t\t };\n\n\treturn (\n\t\t<NavigationItemBase { ...baseProps } className={ classes }>\n\t\t\t{ children || (\n\t\t\t\t<ItemUI { ...itemProps }>\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<ItemIconUI>\n\t\t\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t\t\t</ItemIconUI>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<NavigationItemBaseContent\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\tbadge={ badge }\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ navigateToMenu && <Icon icon={ navigationIcon } /> }\n\t\t\t\t</ItemUI>\n\t\t\t) }\n\t\t</NavigationItemBase>\n\t);\n}\n\nexport default NavigationItem;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigation/item/index.tsx"],"names":["noop","NavigationItem","props","badge","children","className","href","item","navigateToMenu","onClick","title","icon","hideIfTargetMenuEmpty","isText","restProps","activeItem","setActiveMenu","navigationTree","isMenuEmpty","isActive","classes","onItemClick","event","navigationIcon","chevronLeft","chevronRight","baseProps","undefined","itemProps","as","Button"],"mappings":";;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AASA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEO,SAASC,cAAT,CAAyBC,KAAzB,EAAsD;AAC5D,QAAM;AACLC,IAAAA,KADK;AAELC,IAAAA,QAFK;AAGLC,IAAAA,SAHK;AAILC,IAAAA,IAJK;AAKLC,IAAAA,IALK;AAMLC,IAAAA,cANK;AAOLC,IAAAA,OAAO,GAAGT,IAPL;AAQLU,IAAAA,KARK;AASLC,IAAAA,IATK;AAULC,IAAAA,qBAVK;AAWLC,IAAAA,MAXK;AAYL,OAAGC;AAZE,MAaFZ,KAbJ;AAeA,QAAM;AACLa,IAAAA,UADK;AAELC,IAAAA,aAFK;AAGLC,IAAAA,cAAc,EAAE;AAAEC,MAAAA;AAAF;AAHX,MAIF,oCAJJ,CAhB4D,CAsB5D;AACA;AACA;;AACA,MACCN,qBAAqB,IACrBJ,cADA,IAEAU,WAAW,CAAEV,cAAF,CAHZ,EAIE;AACD,WAAO,IAAP;AACA;;AAED,QAAMW,QAAQ,GAAGZ,IAAI,IAAIQ,UAAU,KAAKR,IAAxC;AAEA,QAAMa,OAAO,GAAG,yBAAYf,SAAZ,EAAuB;AACtC,iBAAac;AADyB,GAAvB,CAAhB;;AAIA,QAAME,WAEL,GAAKC,KAAF,IAAa;AAChB,QAAKd,cAAL,EAAsB;AACrBQ,MAAAA,aAAa,CAAER,cAAF,CAAb;AACA;;AAEDC,IAAAA,OAAO,CAAEa,KAAF,CAAP;AACA,GARD;;AASA,QAAMC,cAAc,GAAG,qBAAUC,kBAAV,GAAwBC,mBAA/C;AACA,QAAMC,SAAS,GAAGtB,QAAQ,GAAGF,KAAH,GAAW,EAAE,GAAGA,KAAL;AAAYO,IAAAA,OAAO,EAAEkB;AAArB,GAArC;AACA,QAAMC,SAAS,GAAGf,MAAM,GACrBC,SADqB,GAErB;AACAe,IAAAA,EAAE,EAAEC,eADJ;AAEAxB,IAAAA,IAFA;AAGAG,IAAAA,OAAO,EAAEY,WAHT;AAIA,oBAAgBF,QAAQ,GAAG,MAAH,GAAYQ,SAJpC;AAKA,OAAGb;AALH,GAFH;AAUA,SACC,4BAAC,aAAD,OAAyBY,SAAzB;AAAqC,IAAA,SAAS,EAAGN;AAAjD,KACGhB,QAAQ,IACT,4BAAC,wBAAD,OAAawB;AAAb,KACGjB,IAAI,IACL,4BAAC,4BAAD,QACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGA;AAAb,IADD,CAFF,EAOC,4BAAC,oBAAD;AACC,IAAA,KAAK,EAAGD,KADT;AAEC,IAAA,KAAK,EAAGP;AAFT,IAPD,EAYGK,cAAc,IAAI,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGe;AAAb,IAZrB,CAFF,CADD;AAoBA;;eAEctB,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport { useNavigationContext } from '../context';\nimport { ItemUI, ItemIconUI } from '../styles/navigation-styles';\nimport NavigationItemBaseContent from './base-content';\nimport NavigationItemBase from './base';\n\nimport type { NavigationItemProps } from '../types';\n\nconst noop = () => {};\n\nexport function NavigationItem( props: NavigationItemProps ) {\n\tconst {\n\t\tbadge,\n\t\tchildren,\n\t\tclassName,\n\t\thref,\n\t\titem,\n\t\tnavigateToMenu,\n\t\tonClick = noop,\n\t\ttitle,\n\t\ticon,\n\t\thideIfTargetMenuEmpty,\n\t\tisText,\n\t\t...restProps\n\t} = props;\n\n\tconst {\n\t\tactiveItem,\n\t\tsetActiveMenu,\n\t\tnavigationTree: { isMenuEmpty },\n\t} = useNavigationContext();\n\n\t// If hideIfTargetMenuEmpty prop is true\n\t// And the menu we are supposed to navigate to\n\t// Is marked as empty, then we skip rendering the item.\n\tif (\n\t\thideIfTargetMenuEmpty &&\n\t\tnavigateToMenu &&\n\t\tisMenuEmpty( navigateToMenu )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst isActive = item && activeItem === item;\n\n\tconst classes = classnames( className, {\n\t\t'is-active': isActive,\n\t} );\n\n\tconst onItemClick: React.MouseEventHandler<\n\t\tHTMLButtonElement | HTMLAnchorElement\n\t> = ( event ) => {\n\t\tif ( navigateToMenu ) {\n\t\t\tsetActiveMenu( navigateToMenu );\n\t\t}\n\n\t\tonClick( event );\n\t};\n\tconst navigationIcon = isRTL() ? chevronLeft : chevronRight;\n\tconst baseProps = children ? props : { ...props, onClick: undefined };\n\tconst itemProps = isText\n\t\t? restProps\n\t\t: {\n\t\t\t\tas: Button,\n\t\t\t\thref,\n\t\t\t\tonClick: onItemClick,\n\t\t\t\t'aria-current': isActive ? 'page' : undefined,\n\t\t\t\t...restProps,\n\t\t };\n\n\treturn (\n\t\t<NavigationItemBase { ...baseProps } className={ classes }>\n\t\t\t{ children || (\n\t\t\t\t<ItemUI { ...itemProps }>\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<ItemIconUI>\n\t\t\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t\t\t</ItemIconUI>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<NavigationItemBaseContent\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\tbadge={ badge }\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ navigateToMenu && <Icon icon={ navigationIcon } /> }\n\t\t\t\t</ItemUI>\n\t\t\t) }\n\t\t</NavigationItemBase>\n\t);\n}\n\nexport default NavigationItem;\n"]}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -9,8 +7,6 @@ exports.default = exports.NavigatorBackButton = void 0;
9
7
 
10
8
  var _element = require("@wordpress/element");
11
9
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
10
  var _context = require("../../ui/context");
15
11
 
16
12
  var _view = require("../../view");
@@ -26,9 +22,10 @@ var _hook = require("./hook");
26
22
  */
27
23
  function UnconnectedNavigatorBackButton(props, forwardedRef) {
28
24
  const navigatorBackButtonProps = (0, _hook.useNavigatorBackButton)(props);
29
- return (0, _element.createElement)(_view.View, (0, _extends2.default)({
30
- ref: forwardedRef
31
- }, navigatorBackButtonProps));
25
+ return (0, _element.createElement)(_view.View, {
26
+ ref: forwardedRef,
27
+ ...navigatorBackButtonProps
28
+ });
32
29
  }
33
30
  /**
34
31
  * The `NavigatorBackButton` component can be used to navigate to a screen and
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigator/navigator-back-button/component.tsx"],"names":["UnconnectedNavigatorBackButton","props","forwardedRef","navigatorBackButtonProps","NavigatorBackButton"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,8BAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,wBAAwB,GAAG,kCAAwBF,KAAxB,CAAjC;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,GAAG,EAAGC;AAAZ,KAAgCC,wBAAhC,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;;;AACO,MAAMC,mBAAmB,GAAG,6BAClCJ,8BADkC,EAElC,qBAFkC,CAA5B;;eAKQI,mB","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 './hook';\nimport type { NavigatorBackButtonProps } from '../types';\n\nfunction UnconnectedNavigatorBackButton(\n\tprops: WordPressComponentProps< NavigatorBackButtonProps, 'button' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst navigatorBackButtonProps = useNavigatorBackButton( props );\n\n\treturn <View ref={ forwardedRef } { ...navigatorBackButtonProps } />;\n}\n\n/**\n * The `NavigatorBackButton` 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 * __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 NavigatorBackButton = contextConnect(\n\tUnconnectedNavigatorBackButton,\n\t'NavigatorBackButton'\n);\n\nexport default NavigatorBackButton;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigator/navigator-back-button/component.tsx"],"names":["UnconnectedNavigatorBackButton","props","forwardedRef","navigatorBackButtonProps","NavigatorBackButton"],"mappings":";;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,8BAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,wBAAwB,GAAG,kCAAwBF,KAAxB,CAAjC;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,GAAG,EAAGC,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;;;AACO,MAAMC,mBAAmB,GAAG,6BAClCJ,8BADkC,EAElC,qBAFkC,CAA5B;;eAKQI,mB","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 './hook';\nimport type { NavigatorBackButtonProps } from '../types';\n\nfunction UnconnectedNavigatorBackButton(\n\tprops: WordPressComponentProps< NavigatorBackButtonProps, 'button' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst navigatorBackButtonProps = useNavigatorBackButton( props );\n\n\treturn <View ref={ forwardedRef } { ...navigatorBackButtonProps } />;\n}\n\n/**\n * The `NavigatorBackButton` 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 * __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 NavigatorBackButton = contextConnect(\n\tUnconnectedNavigatorBackButton,\n\t'NavigatorBackButton'\n);\n\nexport default NavigatorBackButton;\n"]}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -9,8 +7,6 @@ exports.default = exports.NavigatorButton = void 0;
9
7
 
10
8
  var _element = require("@wordpress/element");
11
9
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
10
  var _context = require("../../ui/context");
15
11
 
16
12
  var _view = require("../../view");
@@ -26,9 +22,10 @@ var _hook = require("./hook");
26
22
  */
27
23
  function UnconnectedNavigatorButton(props, forwardedRef) {
28
24
  const navigatorButtonProps = (0, _hook.useNavigatorButton)(props);
29
- return (0, _element.createElement)(_view.View, (0, _extends2.default)({
30
- ref: forwardedRef
31
- }, navigatorButtonProps));
25
+ return (0, _element.createElement)(_view.View, {
26
+ ref: forwardedRef,
27
+ ...navigatorButtonProps
28
+ });
32
29
  }
33
30
  /**
34
31
  * The `NavigatorButton` component can be used to navigate to a screen and should
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigator/navigator-button/component.tsx"],"names":["UnconnectedNavigatorButton","props","forwardedRef","navigatorButtonProps","NavigatorButton"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,0BAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,oBAAoB,GAAG,8BAAoBF,KAApB,CAA7B;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,GAAG,EAAGC;AAAZ,KAAgCC,oBAAhC,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;;;AACO,MAAMC,eAAe,GAAG,6BAC9BJ,0BAD8B,EAE9B,iBAF8B,CAAxB;;eAKQI,e","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 { useNavigatorButton } from './hook';\nimport type { NavigatorButtonProps } from '../types';\n\nfunction UnconnectedNavigatorButton(\n\tprops: WordPressComponentProps< NavigatorButtonProps, 'button' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst navigatorButtonProps = useNavigatorButton( props );\n\n\treturn <View ref={ forwardedRef } { ...navigatorButtonProps } />;\n}\n\n/**\n * The `NavigatorButton` component can be used to navigate to a screen and should\n * be used in combination with the `NavigatorProvider`, the `NavigatorScreen`\n * and the `NavigatorBackButton` components (or the `useNavigator` 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 NavigatorButton = contextConnect(\n\tUnconnectedNavigatorButton,\n\t'NavigatorButton'\n);\n\nexport default NavigatorButton;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigator/navigator-button/component.tsx"],"names":["UnconnectedNavigatorButton","props","forwardedRef","navigatorButtonProps","NavigatorButton"],"mappings":";;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,0BAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,oBAAoB,GAAG,8BAAoBF,KAApB,CAA7B;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,GAAG,EAAGC,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;;;AACO,MAAMC,eAAe,GAAG,6BAC9BJ,0BAD8B,EAE9B,iBAF8B,CAAxB;;eAKQI,e","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 { useNavigatorButton } from './hook';\nimport type { NavigatorButtonProps } from '../types';\n\nfunction UnconnectedNavigatorButton(\n\tprops: WordPressComponentProps< NavigatorButtonProps, 'button' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst navigatorButtonProps = useNavigatorButton( props );\n\n\treturn <View ref={ forwardedRef } { ...navigatorButtonProps } />;\n}\n\n/**\n * The `NavigatorButton` component can be used to navigate to a screen and should\n * be used in combination with the `NavigatorProvider`, the `NavigatorScreen`\n * and the `NavigatorBackButton` components (or the `useNavigator` 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 NavigatorButton = contextConnect(\n\tUnconnectedNavigatorButton,\n\t'NavigatorButton'\n);\n\nexport default NavigatorButton;\n"]}