@wordpress/components 33.1.1-next.v.202605131032.0 → 34.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/build/autocomplete/index.cjs +5 -4
  3. package/build/autocomplete/index.cjs.map +3 -3
  4. package/build/border-control/border-control-dropdown/component.cjs +33 -33
  5. package/build/border-control/border-control-dropdown/component.cjs.map +3 -3
  6. package/build/box-control/index.cjs +0 -6
  7. package/build/box-control/index.cjs.map +2 -2
  8. package/build/box-control/utils.cjs +0 -38
  9. package/build/box-control/utils.cjs.map +3 -3
  10. package/build/custom-gradient-picker/gradient-bar/index.cjs.map +2 -2
  11. package/build/disabled/index.cjs +1 -1
  12. package/build/disabled/index.cjs.map +2 -2
  13. package/build/draggable/index.cjs +101 -7
  14. package/build/draggable/index.cjs.map +3 -3
  15. package/build/form-token-field/index.cjs +41 -7
  16. package/build/form-token-field/index.cjs.map +2 -2
  17. package/build/higher-order/with-notices/index.cjs +3 -15
  18. package/build/higher-order/with-notices/index.cjs.map +2 -2
  19. package/build/index.cjs +0 -17
  20. package/build/index.cjs.map +2 -2
  21. package/build/input-control/input-base.cjs +31 -34
  22. package/build/input-control/input-base.cjs.map +2 -2
  23. package/build/notice/index.cjs +33 -35
  24. package/build/notice/index.cjs.map +2 -2
  25. package/build/popover/index.cjs +12 -0
  26. package/build/popover/index.cjs.map +2 -2
  27. package/build/responsive-wrapper/index.cjs +4 -3
  28. package/build/responsive-wrapper/index.cjs.map +2 -2
  29. package/build/tabs/styles.cjs +5 -5
  30. package/build/tabs/styles.cjs.map +2 -2
  31. package/build/tooltip/index.cjs +2 -1
  32. package/build/tooltip/index.cjs.map +2 -2
  33. package/build-module/autocomplete/index.mjs +6 -5
  34. package/build-module/autocomplete/index.mjs.map +2 -2
  35. package/build-module/border-control/border-control-dropdown/component.mjs +34 -34
  36. package/build-module/border-control/border-control-dropdown/component.mjs.map +2 -2
  37. package/build-module/box-control/index.mjs +0 -2
  38. package/build-module/box-control/index.mjs.map +2 -2
  39. package/build-module/box-control/utils.mjs +0 -27
  40. package/build-module/box-control/utils.mjs.map +2 -2
  41. package/build-module/custom-gradient-picker/gradient-bar/index.mjs.map +2 -2
  42. package/build-module/disabled/index.mjs +1 -1
  43. package/build-module/disabled/index.mjs.map +2 -2
  44. package/build-module/draggable/index.mjs +101 -7
  45. package/build-module/draggable/index.mjs.map +3 -3
  46. package/build-module/form-token-field/index.mjs +41 -7
  47. package/build-module/form-token-field/index.mjs.map +2 -2
  48. package/build-module/higher-order/with-notices/index.mjs +4 -16
  49. package/build-module/higher-order/with-notices/index.mjs.map +2 -2
  50. package/build-module/index.mjs +87 -99
  51. package/build-module/index.mjs.map +2 -2
  52. package/build-module/input-control/input-base.mjs +31 -34
  53. package/build-module/input-control/input-base.mjs.map +2 -2
  54. package/build-module/notice/index.mjs +34 -36
  55. package/build-module/notice/index.mjs.map +2 -2
  56. package/build-module/popover/index.mjs +12 -0
  57. package/build-module/popover/index.mjs.map +2 -2
  58. package/build-module/responsive-wrapper/index.mjs +4 -3
  59. package/build-module/responsive-wrapper/index.mjs.map +2 -2
  60. package/build-module/tabs/styles.mjs +5 -5
  61. package/build-module/tabs/styles.mjs.map +2 -2
  62. package/build-module/tooltip/index.mjs +2 -1
  63. package/build-module/tooltip/index.mjs.map +2 -2
  64. package/build-style/style-rtl.css +64 -66
  65. package/build-style/style.css +64 -66
  66. package/build-types/autocomplete/index.d.ts.map +1 -1
  67. package/build-types/badge/stories/e2e/index.story.d.ts +7 -0
  68. package/build-types/badge/stories/e2e/index.story.d.ts.map +1 -0
  69. package/build-types/border-box-control/border-box-control/hook.d.ts +24 -10
  70. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  71. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +26 -12
  72. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  73. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +24 -10
  74. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  75. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +25 -11
  76. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  77. package/build-types/border-control/border-control/hook.d.ts +24 -10
  78. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  79. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  80. package/build-types/border-control/border-control-dropdown/hook.d.ts +23 -9
  81. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  82. package/build-types/box-control/index.d.ts +0 -1
  83. package/build-types/box-control/index.d.ts.map +1 -1
  84. package/build-types/box-control/styles/box-control-styles.d.ts +3 -4
  85. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  86. package/build-types/box-control/utils.d.ts +0 -13
  87. package/build-types/box-control/utils.d.ts.map +1 -1
  88. package/build-types/button/stories/e2e/index.story.d.ts +1 -0
  89. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  90. package/build-types/card/card/hook.d.ts +25 -11
  91. package/build-types/card/card/hook.d.ts.map +1 -1
  92. package/build-types/card/card-body/hook.d.ts +25 -11
  93. package/build-types/card/card-body/hook.d.ts.map +1 -1
  94. package/build-types/card/card-divider/hook.d.ts +26 -12
  95. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  96. package/build-types/card/card-footer/hook.d.ts +25 -11
  97. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  98. package/build-types/card/card-header/hook.d.ts +25 -11
  99. package/build-types/card/card-header/hook.d.ts.map +1 -1
  100. package/build-types/card/card-media/hook.d.ts +25 -11
  101. package/build-types/card/card-media/hook.d.ts.map +1 -1
  102. package/build-types/color-picker/styles.d.ts +3 -4
  103. package/build-types/color-picker/styles.d.ts.map +1 -1
  104. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  105. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  106. package/build-types/custom-select-control-v2/styles.d.ts +4 -12
  107. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  108. package/build-types/date-time/time-picker/styles.d.ts +4 -4
  109. package/build-types/draggable/index.d.ts.map +1 -1
  110. package/build-types/draggable/stories/index.story.d.ts +4 -5
  111. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  112. package/build-types/draggable/types.d.ts +4 -0
  113. package/build-types/draggable/types.d.ts.map +1 -1
  114. package/build-types/elevation/hook.d.ts +25 -11
  115. package/build-types/elevation/hook.d.ts.map +1 -1
  116. package/build-types/flex/flex/hook.d.ts +25 -11
  117. package/build-types/flex/flex/hook.d.ts.map +1 -1
  118. package/build-types/flex/flex-block/hook.d.ts +25 -11
  119. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  120. package/build-types/flex/flex-item/hook.d.ts +25 -11
  121. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  122. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  123. package/build-types/form-token-field/index.d.ts.map +1 -1
  124. package/build-types/grid/hook.d.ts +25 -11
  125. package/build-types/grid/hook.d.ts.map +1 -1
  126. package/build-types/h-stack/hook.d.ts +25 -11
  127. package/build-types/h-stack/hook.d.ts.map +1 -1
  128. package/build-types/heading/hook.d.ts +25 -11
  129. package/build-types/heading/hook.d.ts.map +1 -1
  130. package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -3
  131. package/build-types/higher-order/with-filters/index.d.ts +1 -6
  132. package/build-types/higher-order/with-filters/index.d.ts.map +1 -1
  133. package/build-types/higher-order/with-notices/index.d.ts +2 -4
  134. package/build-types/higher-order/with-notices/index.d.ts.map +1 -1
  135. package/build-types/icon/stories/index.story.d.ts +0 -6
  136. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  137. package/build-types/index.d.ts +1 -6
  138. package/build-types/index.d.ts.map +1 -1
  139. package/build-types/input-control/reducer/reducer.d.ts +1 -1
  140. package/build-types/item-group/item/hook.d.ts +25 -11
  141. package/build-types/item-group/item/hook.d.ts.map +1 -1
  142. package/build-types/item-group/item-group/hook.d.ts +25 -11
  143. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  144. package/build-types/menu/stories/index.story.d.ts.map +1 -1
  145. package/build-types/menu/styles.d.ts +7 -21
  146. package/build-types/menu/styles.d.ts.map +1 -1
  147. package/build-types/modal/use-modal-exit-animation.d.ts +1 -1
  148. package/build-types/navigator/navigator-back-button/hook.d.ts +26 -12
  149. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  150. package/build-types/navigator/navigator-button/hook.d.ts +26 -12
  151. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  152. package/build-types/notice/index.d.ts.map +1 -1
  153. package/build-types/notice/types.d.ts +1 -2
  154. package/build-types/notice/types.d.ts.map +1 -1
  155. package/build-types/number-control/index.d.ts +1 -1
  156. package/build-types/number-control/index.d.ts.map +1 -1
  157. package/build-types/number-control/stories/index.story.d.ts +1 -1
  158. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  159. package/build-types/popover/index.d.ts.map +1 -1
  160. package/build-types/popover/types.d.ts +2 -2
  161. package/build-types/popover/types.d.ts.map +1 -1
  162. package/build-types/range-control/index.d.ts +2 -3
  163. package/build-types/range-control/index.d.ts.map +1 -1
  164. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  165. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  166. package/build-types/range-control/types.d.ts +1 -5
  167. package/build-types/range-control/types.d.ts.map +1 -1
  168. package/build-types/responsive-wrapper/index.d.ts.map +1 -1
  169. package/build-types/scrollable/hook.d.ts +25 -11
  170. package/build-types/scrollable/hook.d.ts.map +1 -1
  171. package/build-types/snackbar/index.d.ts +2 -2
  172. package/build-types/snackbar/types.d.ts +2 -2
  173. package/build-types/snackbar/types.d.ts.map +1 -1
  174. package/build-types/spacer/hook.d.ts +25 -11
  175. package/build-types/spacer/hook.d.ts.map +1 -1
  176. package/build-types/surface/hook.d.ts +25 -11
  177. package/build-types/surface/hook.d.ts.map +1 -1
  178. package/build-types/tab-panel/stories/index.story.d.ts +0 -6
  179. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  180. package/build-types/tabs/stories/index.story.d.ts +0 -6
  181. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  182. package/build-types/tabs/styles.d.ts +3 -9
  183. package/build-types/tabs/styles.d.ts.map +1 -1
  184. package/build-types/text/hook.d.ts +25 -11
  185. package/build-types/text/hook.d.ts.map +1 -1
  186. package/build-types/tools-panel/tools-panel/hook.d.ts +25 -11
  187. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  188. package/build-types/tools-panel/tools-panel-header/hook.d.ts +25 -11
  189. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  190. package/build-types/tools-panel/tools-panel-item/hook.d.ts +25 -11
  191. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  192. package/build-types/tooltip/index.d.ts.map +1 -1
  193. package/build-types/truncate/hook.d.ts +25 -11
  194. package/build-types/truncate/hook.d.ts.map +1 -1
  195. package/build-types/unit-control/index.d.ts +1 -1
  196. package/build-types/unit-control/index.d.ts.map +1 -1
  197. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  198. package/build-types/utils/get-node-text.d.ts.map +1 -1
  199. package/build-types/v-stack/hook.d.ts +25 -11
  200. package/build-types/v-stack/hook.d.ts.map +1 -1
  201. package/build-types/validated-form-controls/components/number-control.d.ts +1 -1
  202. package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -1
  203. package/build-types/validated-form-controls/components/range-control.d.ts +2 -3
  204. package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
  205. package/build-types/validated-form-controls/control-with-error.d.ts +4 -1
  206. package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
  207. package/package.json +27 -25
  208. package/src/autocomplete/README.md +1 -1
  209. package/src/autocomplete/index.tsx +25 -7
  210. package/src/badge/stories/e2e/index.story.tsx +21 -0
  211. package/src/border-control/border-control-dropdown/component.tsx +36 -37
  212. package/src/box-control/index.tsx +0 -1
  213. package/src/box-control/utils.ts +0 -43
  214. package/src/button/stories/e2e/index.story.tsx +11 -0
  215. package/src/composite/stories/index.story.tsx +0 -1
  216. package/src/custom-gradient-picker/gradient-bar/index.tsx +1 -1
  217. package/src/disabled/index.tsx +1 -1
  218. package/src/draggable/index.tsx +32 -10
  219. package/src/draggable/stories/index.story.tsx +11 -6
  220. package/src/draggable/style.module.scss +29 -0
  221. package/src/draggable/types.ts +4 -0
  222. package/src/form-file-upload/README.md +1 -1
  223. package/src/form-token-field/index.tsx +84 -8
  224. package/src/form-token-field/test/index.tsx +189 -0
  225. package/src/h-stack/hook.tsx +1 -1
  226. package/src/higher-order/with-notices/index.tsx +4 -21
  227. package/src/higher-order/with-notices/test/index.tsx +0 -18
  228. package/src/icon/stories/index.story.tsx +2 -14
  229. package/src/index.ts +0 -6
  230. package/src/input-control/input-base.tsx +2 -2
  231. package/src/menu/README.md +7 -7
  232. package/src/menu/stories/index.story.tsx +0 -1
  233. package/src/menu/test/index.tsx +9 -4
  234. package/src/modal/style.scss +2 -1
  235. package/src/notice/README.md +1 -2
  236. package/src/notice/index.tsx +57 -64
  237. package/src/notice/style.scss +49 -41
  238. package/src/notice/test/__snapshots__/index.tsx.snap +23 -23
  239. package/src/notice/test/index.tsx +5 -5
  240. package/src/notice/types.ts +1 -2
  241. package/src/popover/index.tsx +29 -1
  242. package/src/popover/test/index.tsx +138 -1
  243. package/src/popover/types.ts +2 -4
  244. package/src/range-control/stories/index.story.tsx +0 -1
  245. package/src/range-control/types.ts +1 -5
  246. package/src/responsive-wrapper/index.tsx +7 -3
  247. package/src/snackbar/README.md +1 -1
  248. package/src/snackbar/types.ts +2 -2
  249. package/src/style.scss +0 -1
  250. package/src/tab-panel/stories/index.story.tsx +2 -13
  251. package/src/tab-panel/style.scss +36 -14
  252. package/src/tabs/README.md +1 -1
  253. package/src/tabs/stories/index.story.tsx +2 -14
  254. package/src/tabs/styles.ts +3 -8
  255. package/src/tabs/tablist.tsx +1 -1
  256. package/src/tooltip/index.tsx +7 -1
  257. package/src/tree-grid/test/cell.tsx +0 -1
  258. package/src/tree-grid/test/roving-tab-index-item.tsx +0 -1
  259. package/src/tree-select/README.md +1 -1
  260. package/src/utils/get-node-text.ts +7 -1
  261. package/src/validated-form-controls/control-with-error.tsx +6 -1
  262. package/build/navigation/back-button/index.cjs +0 -86
  263. package/build/navigation/back-button/index.cjs.map +0 -7
  264. package/build/navigation/constants.cjs +0 -34
  265. package/build/navigation/constants.cjs.map +0 -7
  266. package/build/navigation/context.cjs +0 -58
  267. package/build/navigation/context.cjs.map +0 -7
  268. package/build/navigation/group/context.cjs +0 -38
  269. package/build/navigation/group/context.cjs.map +0 -7
  270. package/build/navigation/group/index.cjs +0 -88
  271. package/build/navigation/group/index.cjs.map +0 -7
  272. package/build/navigation/index.cjs +0 -113
  273. package/build/navigation/index.cjs.map +0 -7
  274. package/build/navigation/item/base-content.cjs +0 -44
  275. package/build/navigation/item/base-content.cjs.map +0 -7
  276. package/build/navigation/item/base.cjs +0 -66
  277. package/build/navigation/item/base.cjs.map +0 -7
  278. package/build/navigation/item/index.cjs +0 -119
  279. package/build/navigation/item/index.cjs.map +0 -7
  280. package/build/navigation/item/use-navigation-tree-item.cjs +0 -64
  281. package/build/navigation/item/use-navigation-tree-item.cjs.map +0 -7
  282. package/build/navigation/menu/context.cjs +0 -39
  283. package/build/navigation/menu/context.cjs.map +0 -7
  284. package/build/navigation/menu/index.cjs +0 -114
  285. package/build/navigation/menu/index.cjs.map +0 -7
  286. package/build/navigation/menu/menu-title-search.cjs +0 -111
  287. package/build/navigation/menu/menu-title-search.cjs.map +0 -7
  288. package/build/navigation/menu/menu-title.cjs +0 -104
  289. package/build/navigation/menu/menu-title.cjs.map +0 -7
  290. package/build/navigation/menu/search-no-results-found.cjs +0 -48
  291. package/build/navigation/menu/search-no-results-found.cjs.map +0 -7
  292. package/build/navigation/menu/use-navigation-tree-menu.cjs +0 -51
  293. package/build/navigation/menu/use-navigation-tree-menu.cjs.map +0 -7
  294. package/build/navigation/styles/navigation-styles.cjs +0 -170
  295. package/build/navigation/styles/navigation-styles.cjs.map +0 -7
  296. package/build/navigation/types.cjs +0 -19
  297. package/build/navigation/types.cjs.map +0 -7
  298. package/build/navigation/use-create-navigation-tree.cjs +0 -103
  299. package/build/navigation/use-create-navigation-tree.cjs.map +0 -7
  300. package/build/navigation/use-navigation-tree-nodes.cjs +0 -60
  301. package/build/navigation/use-navigation-tree-nodes.cjs.map +0 -7
  302. package/build/navigation/utils.cjs +0 -45
  303. package/build/navigation/utils.cjs.map +0 -7
  304. package/build-module/navigation/back-button/index.mjs +0 -51
  305. package/build-module/navigation/back-button/index.mjs.map +0 -7
  306. package/build-module/navigation/constants.mjs +0 -8
  307. package/build-module/navigation/constants.mjs.map +0 -7
  308. package/build-module/navigation/context.mjs +0 -32
  309. package/build-module/navigation/context.mjs.map +0 -7
  310. package/build-module/navigation/group/context.mjs +0 -12
  311. package/build-module/navigation/group/context.mjs.map +0 -7
  312. package/build-module/navigation/group/index.mjs +0 -53
  313. package/build-module/navigation/group/index.mjs.map +0 -7
  314. package/build-module/navigation/index.mjs +0 -78
  315. package/build-module/navigation/index.mjs.map +0 -7
  316. package/build-module/navigation/item/base-content.mjs +0 -23
  317. package/build-module/navigation/item/base-content.mjs.map +0 -7
  318. package/build-module/navigation/item/base.mjs +0 -35
  319. package/build-module/navigation/item/base.mjs.map +0 -7
  320. package/build-module/navigation/item/index.mjs +0 -84
  321. package/build-module/navigation/item/index.mjs.map +0 -7
  322. package/build-module/navigation/item/use-navigation-tree-item.mjs +0 -39
  323. package/build-module/navigation/item/use-navigation-tree-item.mjs.map +0 -7
  324. package/build-module/navigation/menu/context.mjs +0 -13
  325. package/build-module/navigation/menu/context.mjs.map +0 -7
  326. package/build-module/navigation/menu/index.mjs +0 -79
  327. package/build-module/navigation/menu/index.mjs.map +0 -7
  328. package/build-module/navigation/menu/menu-title-search.mjs +0 -80
  329. package/build-module/navigation/menu/menu-title-search.mjs.map +0 -7
  330. package/build-module/navigation/menu/menu-title.mjs +0 -73
  331. package/build-module/navigation/menu/menu-title.mjs.map +0 -7
  332. package/build-module/navigation/menu/search-no-results-found.mjs +0 -27
  333. package/build-module/navigation/menu/search-no-results-found.mjs.map +0 -7
  334. package/build-module/navigation/menu/use-navigation-tree-menu.mjs +0 -26
  335. package/build-module/navigation/menu/use-navigation-tree-menu.mjs.map +0 -7
  336. package/build-module/navigation/styles/navigation-styles.mjs +0 -124
  337. package/build-module/navigation/styles/navigation-styles.mjs.map +0 -7
  338. package/build-module/navigation/types.mjs +0 -1
  339. package/build-module/navigation/types.mjs.map +0 -7
  340. package/build-module/navigation/use-create-navigation-tree.mjs +0 -78
  341. package/build-module/navigation/use-create-navigation-tree.mjs.map +0 -7
  342. package/build-module/navigation/use-navigation-tree-nodes.mjs +0 -35
  343. package/build-module/navigation/use-navigation-tree-nodes.mjs.map +0 -7
  344. package/build-module/navigation/utils.mjs +0 -9
  345. package/build-module/navigation/utils.mjs.map +0 -7
  346. package/build-types/navigation/back-button/index.d.ts +0 -7
  347. package/build-types/navigation/back-button/index.d.ts.map +0 -1
  348. package/build-types/navigation/constants.d.ts +0 -3
  349. package/build-types/navigation/constants.d.ts.map +0 -1
  350. package/build-types/navigation/context.d.ts +0 -4
  351. package/build-types/navigation/context.d.ts.map +0 -1
  352. package/build-types/navigation/group/context.d.ts +0 -7
  353. package/build-types/navigation/group/context.d.ts.map +0 -1
  354. package/build-types/navigation/group/index.d.ts +0 -7
  355. package/build-types/navigation/group/index.d.ts.map +0 -1
  356. package/build-types/navigation/index.d.ts +0 -46
  357. package/build-types/navigation/index.d.ts.map +0 -1
  358. package/build-types/navigation/item/base-content.d.ts +0 -3
  359. package/build-types/navigation/item/base-content.d.ts.map +0 -1
  360. package/build-types/navigation/item/base.d.ts +0 -3
  361. package/build-types/navigation/item/base.d.ts.map +0 -1
  362. package/build-types/navigation/item/index.d.ts +0 -7
  363. package/build-types/navigation/item/index.d.ts.map +0 -1
  364. package/build-types/navigation/item/use-navigation-tree-item.d.ts +0 -3
  365. package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +0 -1
  366. package/build-types/navigation/menu/context.d.ts +0 -7
  367. package/build-types/navigation/menu/context.d.ts.map +0 -1
  368. package/build-types/navigation/menu/index.d.ts +0 -7
  369. package/build-types/navigation/menu/index.d.ts.map +0 -1
  370. package/build-types/navigation/menu/menu-title-search.d.ts +0 -3
  371. package/build-types/navigation/menu/menu-title-search.d.ts.map +0 -1
  372. package/build-types/navigation/menu/menu-title.d.ts +0 -3
  373. package/build-types/navigation/menu/menu-title.d.ts.map +0 -1
  374. package/build-types/navigation/menu/search-no-results-found.d.ts +0 -3
  375. package/build-types/navigation/menu/search-no-results-found.d.ts.map +0 -1
  376. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +0 -3
  377. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +0 -1
  378. package/build-types/navigation/stories/index.story.d.ts +0 -23
  379. package/build-types/navigation/stories/index.story.d.ts.map +0 -1
  380. package/build-types/navigation/stories/utils/controlled-state.d.ts +0 -7
  381. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +0 -1
  382. package/build-types/navigation/stories/utils/default.d.ts +0 -10
  383. package/build-types/navigation/stories/utils/default.d.ts.map +0 -1
  384. package/build-types/navigation/stories/utils/group.d.ts +0 -10
  385. package/build-types/navigation/stories/utils/group.d.ts.map +0 -1
  386. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +0 -10
  387. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +0 -1
  388. package/build-types/navigation/stories/utils/more-examples.d.ts +0 -10
  389. package/build-types/navigation/stories/utils/more-examples.d.ts.map +0 -1
  390. package/build-types/navigation/stories/utils/search.d.ts +0 -10
  391. package/build-types/navigation/stories/utils/search.d.ts.map +0 -1
  392. package/build-types/navigation/styles/navigation-styles.d.ts +0 -55
  393. package/build-types/navigation/styles/navigation-styles.d.ts.map +0 -1
  394. package/build-types/navigation/test/index.d.ts +0 -2
  395. package/build-types/navigation/test/index.d.ts.map +0 -1
  396. package/build-types/navigation/types.d.ts +0 -266
  397. package/build-types/navigation/types.d.ts.map +0 -1
  398. package/build-types/navigation/use-create-navigation-tree.d.ts +0 -15
  399. package/build-types/navigation/use-create-navigation-tree.d.ts.map +0 -1
  400. package/build-types/navigation/use-navigation-tree-nodes.d.ts +0 -10
  401. package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +0 -1
  402. package/build-types/navigation/utils.d.ts +0 -3
  403. package/build-types/navigation/utils.d.ts.map +0 -1
  404. package/src/draggable/style.scss +0 -21
  405. package/src/navigation/README.md +0 -267
  406. package/src/navigation/back-button/index.tsx +0 -73
  407. package/src/navigation/constants.tsx +0 -2
  408. package/src/navigation/context.tsx +0 -40
  409. package/src/navigation/group/context.tsx +0 -16
  410. package/src/navigation/group/index.tsx +0 -73
  411. package/src/navigation/index.tsx +0 -152
  412. package/src/navigation/item/base-content.tsx +0 -31
  413. package/src/navigation/item/base.tsx +0 -42
  414. package/src/navigation/item/index.tsx +0 -112
  415. package/src/navigation/item/use-navigation-tree-item.tsx +0 -47
  416. package/src/navigation/menu/context.tsx +0 -20
  417. package/src/navigation/menu/index.tsx +0 -105
  418. package/src/navigation/menu/menu-title-search.tsx +0 -99
  419. package/src/navigation/menu/menu-title.tsx +0 -100
  420. package/src/navigation/menu/search-no-results-found.tsx +0 -34
  421. package/src/navigation/menu/use-navigation-tree-menu.tsx +0 -29
  422. package/src/navigation/stories/index.story.tsx +0 -62
  423. package/src/navigation/stories/style.css +0 -25
  424. package/src/navigation/stories/utils/controlled-state.tsx +0 -149
  425. package/src/navigation/stories/utils/default.tsx +0 -92
  426. package/src/navigation/stories/utils/group.tsx +0 -61
  427. package/src/navigation/stories/utils/hide-if-empty.tsx +0 -66
  428. package/src/navigation/stories/utils/more-examples.tsx +0 -162
  429. package/src/navigation/stories/utils/search.tsx +0 -91
  430. package/src/navigation/styles/navigation-styles.tsx +0 -197
  431. package/src/navigation/test/index.tsx +0 -347
  432. package/src/navigation/types.ts +0 -325
  433. package/src/navigation/use-create-navigation-tree.tsx +0 -110
  434. package/src/navigation/use-navigation-tree-nodes.tsx +0 -31
  435. package/src/navigation/utils.tsx +0 -11
@@ -1,84 +0,0 @@
1
- // packages/components/src/navigation/item/index.tsx
2
- import clsx from "clsx";
3
- import { Icon, chevronLeft, chevronRight } from "@wordpress/icons";
4
- import { isRTL } from "@wordpress/i18n";
5
- import Button from "../../button/index.mjs";
6
- import { useNavigationContext } from "../context.mjs";
7
- import { ItemUI, ItemIconUI } from "../styles/navigation-styles.mjs";
8
- import NavigationItemBaseContent from "./base-content.mjs";
9
- import NavigationItemBase from "./base.mjs";
10
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
- var noop = () => {
12
- };
13
- function NavigationItem(props) {
14
- const {
15
- badge,
16
- children,
17
- className,
18
- href,
19
- item,
20
- navigateToMenu,
21
- onClick = noop,
22
- title,
23
- icon,
24
- hideIfTargetMenuEmpty,
25
- isText,
26
- ...restProps
27
- } = props;
28
- const {
29
- activeItem,
30
- setActiveMenu,
31
- navigationTree: {
32
- isMenuEmpty
33
- }
34
- } = useNavigationContext();
35
- if (hideIfTargetMenuEmpty && navigateToMenu && isMenuEmpty(navigateToMenu)) {
36
- return null;
37
- }
38
- const isActive = item && activeItem === item;
39
- const classes = clsx(className, {
40
- "is-active": isActive
41
- });
42
- const onItemClick = (event) => {
43
- if (navigateToMenu) {
44
- setActiveMenu(navigateToMenu);
45
- }
46
- onClick(event);
47
- };
48
- const navigationIcon = isRTL() ? chevronLeft : chevronRight;
49
- const baseProps = children ? props : {
50
- ...props,
51
- onClick: void 0
52
- };
53
- const itemProps = isText ? restProps : {
54
- as: Button,
55
- __next40pxDefaultSize: "as" in restProps ? restProps.as === void 0 : true,
56
- href,
57
- onClick: onItemClick,
58
- "aria-current": isActive ? "page" : void 0,
59
- ...restProps
60
- };
61
- return /* @__PURE__ */ _jsx(NavigationItemBase, {
62
- ...baseProps,
63
- className: classes,
64
- children: children || /* @__PURE__ */ _jsxs(ItemUI, {
65
- ...itemProps,
66
- children: [icon && /* @__PURE__ */ _jsx(ItemIconUI, {
67
- children: /* @__PURE__ */ _jsx(Icon, {
68
- icon
69
- })
70
- }), /* @__PURE__ */ _jsx(NavigationItemBaseContent, {
71
- title,
72
- badge
73
- }), navigateToMenu && /* @__PURE__ */ _jsx(Icon, {
74
- icon: navigationIcon
75
- })]
76
- })
77
- });
78
- }
79
- var item_default = NavigationItem;
80
- export {
81
- NavigationItem,
82
- item_default as default
83
- };
84
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/item/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst noop = () => {};\n\n/**\n * @deprecated Use `Navigator` instead.\n */\nexport function NavigationItem(props) {\n const {\n badge,\n children,\n className,\n href,\n item,\n navigateToMenu,\n onClick = noop,\n title,\n icon,\n hideIfTargetMenuEmpty,\n isText,\n ...restProps\n } = props;\n const {\n activeItem,\n setActiveMenu,\n navigationTree: {\n isMenuEmpty\n }\n } = useNavigationContext();\n\n // If hideIfTargetMenuEmpty prop is true\n // And the menu we are supposed to navigate to\n // Is marked as empty, then we skip rendering the item.\n if (hideIfTargetMenuEmpty && navigateToMenu && isMenuEmpty(navigateToMenu)) {\n return null;\n }\n const isActive = item && activeItem === item;\n const classes = clsx(className, {\n 'is-active': isActive\n });\n const onItemClick = event => {\n if (navigateToMenu) {\n setActiveMenu(navigateToMenu);\n }\n onClick(event);\n };\n const navigationIcon = isRTL() ? chevronLeft : chevronRight;\n const baseProps = children ? props : {\n ...props,\n onClick: undefined\n };\n const itemProps = isText ? restProps : {\n as: Button,\n __next40pxDefaultSize: 'as' in restProps ? restProps.as === undefined : true,\n href,\n onClick: onItemClick,\n 'aria-current': isActive ? 'page' : undefined,\n ...restProps\n };\n return /*#__PURE__*/_jsx(NavigationItemBase, {\n ...baseProps,\n className: classes,\n children: children || /*#__PURE__*/_jsxs(ItemUI, {\n ...itemProps,\n children: [icon && /*#__PURE__*/_jsx(ItemIconUI, {\n children: /*#__PURE__*/_jsx(Icon, {\n icon: icon\n })\n }), /*#__PURE__*/_jsx(NavigationItemBaseContent, {\n title: title,\n badge: badge\n }), navigateToMenu && /*#__PURE__*/_jsx(Icon, {\n icon: navigationIcon\n })]\n })\n });\n}\nexport default NavigationItem;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,MAAM,aAAa,oBAAoB;AAChD,SAAS,aAAa;AAKtB,OAAO,YAAY;AACnB,SAAS,4BAA4B;AACrC,SAAS,QAAQ,kBAAkB;AACnC,OAAO,+BAA+B;AACtC,OAAO,wBAAwB;AAC/B,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,IAAM,OAAO,MAAM;AAAC;AAKb,SAAS,eAAe,OAAO;AACpC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,MACd;AAAA,IACF;AAAA,EACF,IAAI,qBAAqB;AAKzB,MAAI,yBAAyB,kBAAkB,YAAY,cAAc,GAAG;AAC1E,WAAO;AAAA,EACT;AACA,QAAM,WAAW,QAAQ,eAAe;AACxC,QAAM,UAAU,KAAK,WAAW;AAAA,IAC9B,aAAa;AAAA,EACf,CAAC;AACD,QAAM,cAAc,WAAS;AAC3B,QAAI,gBAAgB;AAClB,oBAAc,cAAc;AAAA,IAC9B;AACA,YAAQ,KAAK;AAAA,EACf;AACA,QAAM,iBAAiB,MAAM,IAAI,cAAc;AAC/C,QAAM,YAAY,WAAW,QAAQ;AAAA,IACnC,GAAG;AAAA,IACH,SAAS;AAAA,EACX;AACA,QAAM,YAAY,SAAS,YAAY;AAAA,IACrC,IAAI;AAAA,IACJ,uBAAuB,QAAQ,YAAY,UAAU,OAAO,SAAY;AAAA,IACxE;AAAA,IACA,SAAS;AAAA,IACT,gBAAgB,WAAW,SAAS;AAAA,IACpC,GAAG;AAAA,EACL;AACA,SAAoB,qBAAK,oBAAoB;AAAA,IAC3C,GAAG;AAAA,IACH,WAAW;AAAA,IACX,UAAU,YAAyB,sBAAM,QAAQ;AAAA,MAC/C,GAAG;AAAA,MACH,UAAU,CAAC,QAAqB,qBAAK,YAAY;AAAA,QAC/C,UAAuB,qBAAK,MAAM;AAAA,UAChC;AAAA,QACF,CAAC;AAAA,MACH,CAAC,GAAgB,qBAAK,2BAA2B;AAAA,QAC/C;AAAA,QACA;AAAA,MACF,CAAC,GAAG,kBAA+B,qBAAK,MAAM;AAAA,QAC5C,MAAM;AAAA,MACR,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA,EACH,CAAC;AACH;AACA,IAAO,eAAQ;",
6
- "names": []
7
- }
@@ -1,39 +0,0 @@
1
- // packages/components/src/navigation/item/use-navigation-tree-item.tsx
2
- import { useEffect } from "@wordpress/element";
3
- import { useNavigationContext } from "../context.mjs";
4
- import { useNavigationGroupContext } from "../group/context.mjs";
5
- import { useNavigationMenuContext } from "../menu/context.mjs";
6
- import { normalizedSearch } from "../utils.mjs";
7
- var useNavigationTreeItem = (itemId, props) => {
8
- const {
9
- activeMenu,
10
- navigationTree: {
11
- addItem,
12
- removeItem
13
- }
14
- } = useNavigationContext();
15
- const {
16
- group
17
- } = useNavigationGroupContext();
18
- const {
19
- menu,
20
- search
21
- } = useNavigationMenuContext();
22
- useEffect(() => {
23
- const isMenuActive = activeMenu === menu;
24
- const isItemVisible = !search || props.title !== void 0 && normalizedSearch(props.title, search);
25
- addItem(itemId, {
26
- ...props,
27
- group,
28
- menu,
29
- _isVisible: isMenuActive && isItemVisible
30
- });
31
- return () => {
32
- removeItem(itemId);
33
- };
34
- }, [activeMenu, search]);
35
- };
36
- export {
37
- useNavigationTreeItem
38
- };
39
- //# sourceMappingURL=use-navigation-tree-item.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/item/use-navigation-tree-item.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { useNavigationGroupContext } from '../group/context';\nimport { useNavigationMenuContext } from '../menu/context';\nimport { normalizedSearch } from '../utils';\nexport const useNavigationTreeItem = (itemId, props) => {\n const {\n activeMenu,\n navigationTree: {\n addItem,\n removeItem\n }\n } = useNavigationContext();\n const {\n group\n } = useNavigationGroupContext();\n const {\n menu,\n search\n } = useNavigationMenuContext();\n useEffect(() => {\n const isMenuActive = activeMenu === menu;\n const isItemVisible = !search || props.title !== undefined && normalizedSearch(props.title, search);\n addItem(itemId, {\n ...props,\n group,\n menu,\n _isVisible: isMenuActive && isItemVisible\n });\n return () => {\n removeItem(itemId);\n };\n // Not adding deps for now, as it would require either a larger refactor.\n // See https://github.com/WordPress/gutenberg/pull/41639\n }, [activeMenu, search]);\n};"],
5
- "mappings": ";AAGA,SAAS,iBAAiB;AAK1B,SAAS,4BAA4B;AACrC,SAAS,iCAAiC;AAC1C,SAAS,gCAAgC;AACzC,SAAS,wBAAwB;AAC1B,IAAM,wBAAwB,CAAC,QAAQ,UAAU;AACtD,QAAM;AAAA,IACJ;AAAA,IACA,gBAAgB;AAAA,MACd;AAAA,MACA;AAAA,IACF;AAAA,EACF,IAAI,qBAAqB;AACzB,QAAM;AAAA,IACJ;AAAA,EACF,IAAI,0BAA0B;AAC9B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,IAAI,yBAAyB;AAC7B,YAAU,MAAM;AACd,UAAM,eAAe,eAAe;AACpC,UAAM,gBAAgB,CAAC,UAAU,MAAM,UAAU,UAAa,iBAAiB,MAAM,OAAO,MAAM;AAClG,YAAQ,QAAQ;AAAA,MACd,GAAG;AAAA,MACH;AAAA,MACA;AAAA,MACA,YAAY,gBAAgB;AAAA,IAC9B,CAAC;AACD,WAAO,MAAM;AACX,iBAAW,MAAM;AAAA,IACnB;AAAA,EAGF,GAAG,CAAC,YAAY,MAAM,CAAC;AACzB;",
6
- "names": []
7
- }
@@ -1,13 +0,0 @@
1
- // packages/components/src/navigation/menu/context.tsx
2
- import { createContext, useContext } from "@wordpress/element";
3
- var NavigationMenuContext = createContext({
4
- menu: void 0,
5
- search: ""
6
- });
7
- NavigationMenuContext.displayName = "NavigationMenuContext";
8
- var useNavigationMenuContext = () => useContext(NavigationMenuContext);
9
- export {
10
- NavigationMenuContext,
11
- useNavigationMenuContext
12
- };
13
- //# sourceMappingURL=context.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/menu/context.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nexport const NavigationMenuContext = createContext({\n menu: undefined,\n search: ''\n});\nNavigationMenuContext.displayName = 'NavigationMenuContext';\nexport const useNavigationMenuContext = () => useContext(NavigationMenuContext);"],
5
- "mappings": ";AAGA,SAAS,eAAe,kBAAkB;AAMnC,IAAM,wBAAwB,cAAc;AAAA,EACjD,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;AACD,sBAAsB,cAAc;AAC7B,IAAM,2BAA2B,MAAM,WAAW,qBAAqB;",
6
- "names": []
7
- }
@@ -1,79 +0,0 @@
1
- // packages/components/src/navigation/menu/index.tsx
2
- import clsx from "clsx";
3
- import { useState } from "@wordpress/element";
4
- import { ROOT_MENU } from "../constants.mjs";
5
- import { NavigationMenuContext } from "./context.mjs";
6
- import { useNavigationContext } from "../context.mjs";
7
- import { useNavigationTreeMenu } from "./use-navigation-tree-menu.mjs";
8
- import NavigationBackButton from "../back-button/index.mjs";
9
- import NavigationMenuTitle from "./menu-title.mjs";
10
- import NavigationSearchNoResultsFound from "./search-no-results-found.mjs";
11
- import { NavigableMenu } from "../../navigable-container/index.mjs";
12
- import { MenuUI } from "../styles/navigation-styles.mjs";
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- function NavigationMenu(props) {
15
- const {
16
- backButtonLabel,
17
- children,
18
- className,
19
- hasSearch,
20
- menu = ROOT_MENU,
21
- onBackButtonClick,
22
- onSearch: setControlledSearch,
23
- parentMenu,
24
- search: controlledSearch,
25
- isSearchDebouncing,
26
- title,
27
- titleAction
28
- } = props;
29
- const [uncontrolledSearch, setUncontrolledSearch] = useState("");
30
- useNavigationTreeMenu(props);
31
- const {
32
- activeMenu
33
- } = useNavigationContext();
34
- const context = {
35
- menu,
36
- search: uncontrolledSearch
37
- };
38
- if (activeMenu !== menu) {
39
- return /* @__PURE__ */ _jsx(NavigationMenuContext.Provider, {
40
- value: context,
41
- children
42
- });
43
- }
44
- const isControlledSearch = !!setControlledSearch;
45
- const search = isControlledSearch ? controlledSearch : uncontrolledSearch;
46
- const onSearch = isControlledSearch ? setControlledSearch : setUncontrolledSearch;
47
- const menuTitleId = `components-navigation__menu-title-${menu}`;
48
- const classes = clsx("components-navigation__menu", className);
49
- return /* @__PURE__ */ _jsx(NavigationMenuContext.Provider, {
50
- value: context,
51
- children: /* @__PURE__ */ _jsxs(MenuUI, {
52
- className: classes,
53
- children: [(parentMenu || onBackButtonClick) && /* @__PURE__ */ _jsx(NavigationBackButton, {
54
- backButtonLabel,
55
- parentMenu,
56
- onClick: onBackButtonClick
57
- }), title && /* @__PURE__ */ _jsx(NavigationMenuTitle, {
58
- hasSearch,
59
- onSearch,
60
- search,
61
- title,
62
- titleAction
63
- }), /* @__PURE__ */ _jsx(NavigableMenu, {
64
- children: /* @__PURE__ */ _jsxs("ul", {
65
- "aria-labelledby": menuTitleId,
66
- children: [children, search && !isSearchDebouncing && /* @__PURE__ */ _jsx(NavigationSearchNoResultsFound, {
67
- search
68
- })]
69
- })
70
- })]
71
- })
72
- });
73
- }
74
- var menu_default = NavigationMenu;
75
- export {
76
- NavigationMenu,
77
- menu_default as default
78
- };
79
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/menu/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ROOT_MENU } from '../constants';\nimport { NavigationMenuContext } from './context';\nimport { useNavigationContext } from '../context';\nimport { useNavigationTreeMenu } from './use-navigation-tree-menu';\nimport NavigationBackButton from '../back-button';\nimport NavigationMenuTitle from './menu-title';\nimport NavigationSearchNoResultsFound from './search-no-results-found';\nimport { NavigableMenu } from '../../navigable-container';\nimport { MenuUI } from '../styles/navigation-styles';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * @deprecated Use `Navigator` instead.\n */\nexport function NavigationMenu(props) {\n const {\n backButtonLabel,\n children,\n className,\n hasSearch,\n menu = ROOT_MENU,\n onBackButtonClick,\n onSearch: setControlledSearch,\n parentMenu,\n search: controlledSearch,\n isSearchDebouncing,\n title,\n titleAction\n } = props;\n const [uncontrolledSearch, setUncontrolledSearch] = useState('');\n useNavigationTreeMenu(props);\n const {\n activeMenu\n } = useNavigationContext();\n const context = {\n menu,\n search: uncontrolledSearch\n };\n\n // Keep the children rendered to make sure invisible items are included in the navigation tree.\n if (activeMenu !== menu) {\n return /*#__PURE__*/_jsx(NavigationMenuContext.Provider, {\n value: context,\n children: children\n });\n }\n const isControlledSearch = !!setControlledSearch;\n const search = isControlledSearch ? controlledSearch : uncontrolledSearch;\n const onSearch = isControlledSearch ? setControlledSearch : setUncontrolledSearch;\n const menuTitleId = `components-navigation__menu-title-${menu}`;\n const classes = clsx('components-navigation__menu', className);\n return /*#__PURE__*/_jsx(NavigationMenuContext.Provider, {\n value: context,\n children: /*#__PURE__*/_jsxs(MenuUI, {\n className: classes,\n children: [(parentMenu || onBackButtonClick) && /*#__PURE__*/_jsx(NavigationBackButton, {\n backButtonLabel: backButtonLabel,\n parentMenu: parentMenu,\n onClick: onBackButtonClick\n }), title && /*#__PURE__*/_jsx(NavigationMenuTitle, {\n hasSearch: hasSearch,\n onSearch: onSearch,\n search: search,\n title: title,\n titleAction: titleAction\n }), /*#__PURE__*/_jsx(NavigableMenu, {\n children: /*#__PURE__*/_jsxs(\"ul\", {\n \"aria-labelledby\": menuTitleId,\n children: [children, search && !isSearchDebouncing && /*#__PURE__*/_jsx(NavigationSearchNoResultsFound, {\n search: search\n })]\n })\n })]\n })\n });\n}\nexport default NavigationMenu;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,gBAAgB;AAKzB,SAAS,iBAAiB;AAC1B,SAAS,6BAA6B;AACtC,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,OAAO,0BAA0B;AACjC,OAAO,yBAAyB;AAChC,OAAO,oCAAoC;AAC3C,SAAS,qBAAqB;AAC9B,SAAS,cAAc;AACvB,SAAS,OAAO,MAAM,QAAQ,aAAa;AAIpC,SAAS,eAAe,OAAO;AACpC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAAS,EAAE;AAC/D,wBAAsB,KAAK;AAC3B,QAAM;AAAA,IACJ;AAAA,EACF,IAAI,qBAAqB;AACzB,QAAM,UAAU;AAAA,IACd;AAAA,IACA,QAAQ;AAAA,EACV;AAGA,MAAI,eAAe,MAAM;AACvB,WAAoB,qBAAK,sBAAsB,UAAU;AAAA,MACvD,OAAO;AAAA,MACP;AAAA,IACF,CAAC;AAAA,EACH;AACA,QAAM,qBAAqB,CAAC,CAAC;AAC7B,QAAM,SAAS,qBAAqB,mBAAmB;AACvD,QAAM,WAAW,qBAAqB,sBAAsB;AAC5D,QAAM,cAAc,qCAAqC,IAAI;AAC7D,QAAM,UAAU,KAAK,+BAA+B,SAAS;AAC7D,SAAoB,qBAAK,sBAAsB,UAAU;AAAA,IACvD,OAAO;AAAA,IACP,UAAuB,sBAAM,QAAQ;AAAA,MACnC,WAAW;AAAA,MACX,UAAU,EAAE,cAAc,sBAAmC,qBAAK,sBAAsB;AAAA,QACtF;AAAA,QACA;AAAA,QACA,SAAS;AAAA,MACX,CAAC,GAAG,SAAsB,qBAAK,qBAAqB;AAAA,QAClD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC,GAAgB,qBAAK,eAAe;AAAA,QACnC,UAAuB,sBAAM,MAAM;AAAA,UACjC,mBAAmB;AAAA,UACnB,UAAU,CAAC,UAAU,UAAU,CAAC,sBAAmC,qBAAK,gCAAgC;AAAA,YACtG;AAAA,UACF,CAAC,CAAC;AAAA,QACJ,CAAC;AAAA,MACH,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA,EACH,CAAC;AACH;AACA,IAAO,eAAQ;",
6
- "names": []
7
- }
@@ -1,80 +0,0 @@
1
- // packages/components/src/navigation/menu/menu-title-search.tsx
2
- import { useEffect, useRef } from "@wordpress/element";
3
- import { __, _n, sprintf } from "@wordpress/i18n";
4
- import withSpokenMessages from "../../higher-order/with-spoken-messages/index.mjs";
5
- import { useNavigationMenuContext } from "./context.mjs";
6
- import { useNavigationContext } from "../context.mjs";
7
- import { SEARCH_FOCUS_DELAY } from "../constants.mjs";
8
- import SearchControl from "../../search-control/index.mjs";
9
- import { MenuTitleSearchControlWrapper } from "../styles/navigation-styles.mjs";
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
- function MenuTitleSearch({
12
- debouncedSpeak,
13
- onCloseSearch,
14
- onSearch,
15
- search,
16
- title
17
- }) {
18
- const {
19
- navigationTree: {
20
- items
21
- }
22
- } = useNavigationContext();
23
- const {
24
- menu
25
- } = useNavigationMenuContext();
26
- const inputRef = useRef(null);
27
- useEffect(() => {
28
- const delayedFocus = setTimeout(() => {
29
- inputRef.current?.focus();
30
- }, SEARCH_FOCUS_DELAY);
31
- return () => {
32
- clearTimeout(delayedFocus);
33
- };
34
- }, []);
35
- useEffect(() => {
36
- if (!search) {
37
- return;
38
- }
39
- const count = Object.values(items).filter((item) => item._isVisible).length;
40
- const resultsFoundMessage = sprintf(
41
- /* translators: %d: number of results. */
42
- _n("%d result found.", "%d results found.", count),
43
- count
44
- );
45
- debouncedSpeak(resultsFoundMessage);
46
- }, [items, search]);
47
- const onClose = () => {
48
- onSearch?.("");
49
- onCloseSearch();
50
- };
51
- const onKeyDown = (event) => {
52
- if (event.code === "Escape" && !event.defaultPrevented) {
53
- event.preventDefault();
54
- onClose();
55
- }
56
- };
57
- const inputId = `components-navigation__menu-title-search-${menu}`;
58
- const placeholder = sprintf(
59
- /* translators: placeholder for menu search box. %s: menu title */
60
- __("Search %s"),
61
- title?.toLowerCase() || ""
62
- ).trim();
63
- return /* @__PURE__ */ _jsx(MenuTitleSearchControlWrapper, {
64
- children: /* @__PURE__ */ _jsx(SearchControl, {
65
- className: "components-navigation__menu-search-input",
66
- id: inputId,
67
- onChange: (value) => onSearch?.(value),
68
- onKeyDown,
69
- placeholder,
70
- onClose,
71
- ref: inputRef,
72
- value: search
73
- })
74
- });
75
- }
76
- var menu_title_search_default = withSpokenMessages(MenuTitleSearch);
77
- export {
78
- menu_title_search_default as default
79
- };
80
- //# sourceMappingURL=menu-title-search.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/menu/menu-title-search.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport withSpokenMessages from '../../higher-order/with-spoken-messages';\nimport { useNavigationMenuContext } from './context';\nimport { useNavigationContext } from '../context';\nimport { SEARCH_FOCUS_DELAY } from '../constants';\nimport SearchControl from '../../search-control';\nimport { MenuTitleSearchControlWrapper } from '../styles/navigation-styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction MenuTitleSearch({\n debouncedSpeak,\n onCloseSearch,\n onSearch,\n search,\n title\n}) {\n const {\n navigationTree: {\n items\n }\n } = useNavigationContext();\n const {\n menu\n } = useNavigationMenuContext();\n const inputRef = useRef(null);\n\n // Wait for the slide-in animation to complete before autofocusing the input.\n // This prevents scrolling to the input during the animation.\n useEffect(() => {\n const delayedFocus = setTimeout(() => {\n inputRef.current?.focus();\n }, SEARCH_FOCUS_DELAY);\n return () => {\n clearTimeout(delayedFocus);\n };\n }, []);\n useEffect(() => {\n if (!search) {\n return;\n }\n const count = Object.values(items).filter(item => item._isVisible).length;\n const resultsFoundMessage = sprintf(/* translators: %d: number of results. */\n _n('%d result found.', '%d results found.', count), count);\n debouncedSpeak(resultsFoundMessage);\n // Not adding deps for now, as it would require either a larger refactor.\n // See https://github.com/WordPress/gutenberg/pull/44090\n }, [items, search]);\n const onClose = () => {\n onSearch?.('');\n onCloseSearch();\n };\n const onKeyDown = event => {\n if (event.code === 'Escape' && !event.defaultPrevented) {\n event.preventDefault();\n onClose();\n }\n };\n const inputId = `components-navigation__menu-title-search-${menu}`;\n const placeholder = sprintf(/* translators: placeholder for menu search box. %s: menu title */\n __('Search %s'), title?.toLowerCase() || '').trim();\n return /*#__PURE__*/_jsx(MenuTitleSearchControlWrapper, {\n children: /*#__PURE__*/_jsx(SearchControl, {\n className: \"components-navigation__menu-search-input\",\n id: inputId,\n onChange: value => onSearch?.(value),\n onKeyDown: onKeyDown,\n placeholder: placeholder,\n onClose: onClose,\n ref: inputRef,\n value: search\n })\n });\n}\nexport default withSpokenMessages(MenuTitleSearch);"],
5
- "mappings": ";AAGA,SAAS,WAAW,cAAc;AAClC,SAAS,IAAI,IAAI,eAAe;AAKhC,OAAO,wBAAwB;AAC/B,SAAS,gCAAgC;AACzC,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC,OAAO,mBAAmB;AAC1B,SAAS,qCAAqC;AAC9C,SAAS,OAAO,YAAY;AAC5B,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM;AAAA,IACJ,gBAAgB;AAAA,MACd;AAAA,IACF;AAAA,EACF,IAAI,qBAAqB;AACzB,QAAM;AAAA,IACJ;AAAA,EACF,IAAI,yBAAyB;AAC7B,QAAM,WAAW,OAAO,IAAI;AAI5B,YAAU,MAAM;AACd,UAAM,eAAe,WAAW,MAAM;AACpC,eAAS,SAAS,MAAM;AAAA,IAC1B,GAAG,kBAAkB;AACrB,WAAO,MAAM;AACX,mBAAa,YAAY;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,CAAC;AACL,YAAU,MAAM;AACd,QAAI,CAAC,QAAQ;AACX;AAAA,IACF;AACA,UAAM,QAAQ,OAAO,OAAO,KAAK,EAAE,OAAO,UAAQ,KAAK,UAAU,EAAE;AACnE,UAAM,sBAAsB;AAAA;AAAA,MAC5B,GAAG,oBAAoB,qBAAqB,KAAK;AAAA,MAAG;AAAA,IAAK;AACzD,mBAAe,mBAAmB;AAAA,EAGpC,GAAG,CAAC,OAAO,MAAM,CAAC;AAClB,QAAM,UAAU,MAAM;AACpB,eAAW,EAAE;AACb,kBAAc;AAAA,EAChB;AACA,QAAM,YAAY,WAAS;AACzB,QAAI,MAAM,SAAS,YAAY,CAAC,MAAM,kBAAkB;AACtD,YAAM,eAAe;AACrB,cAAQ;AAAA,IACV;AAAA,EACF;AACA,QAAM,UAAU,4CAA4C,IAAI;AAChE,QAAM,cAAc;AAAA;AAAA,IACpB,GAAG,WAAW;AAAA,IAAG,OAAO,YAAY,KAAK;AAAA,EAAE,EAAE,KAAK;AAClD,SAAoB,qBAAK,+BAA+B;AAAA,IACtD,UAAuB,qBAAK,eAAe;AAAA,MACzC,WAAW;AAAA,MACX,IAAI;AAAA,MACJ,UAAU,WAAS,WAAW,KAAK;AAAA,MACnC;AAAA,MACA;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL,OAAO;AAAA,IACT,CAAC;AAAA,EACH,CAAC;AACH;AACA,IAAO,4BAAQ,mBAAmB,eAAe;",
6
- "names": []
7
- }
@@ -1,73 +0,0 @@
1
- // packages/components/src/navigation/menu/menu-title.tsx
2
- import { useRef, useState } from "@wordpress/element";
3
- import { __, sprintf } from "@wordpress/i18n";
4
- import { Icon, search as searchIcon } from "@wordpress/icons";
5
- import { getAnimateClassName } from "../../animate/index.mjs";
6
- import Button from "../../button/index.mjs";
7
- import MenuTitleSearch from "./menu-title-search.mjs";
8
- import { GroupTitleUI, MenuTitleActionsUI, MenuTitleUI } from "../styles/navigation-styles.mjs";
9
- import { useNavigationMenuContext } from "./context.mjs";
10
- import { SEARCH_FOCUS_DELAY } from "../constants.mjs";
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- function NavigationMenuTitle({
13
- hasSearch,
14
- onSearch,
15
- search,
16
- title,
17
- titleAction
18
- }) {
19
- const [isSearching, setIsSearching] = useState(false);
20
- const {
21
- menu
22
- } = useNavigationMenuContext();
23
- const searchButtonRef = useRef(null);
24
- if (!title) {
25
- return null;
26
- }
27
- const onCloseSearch = () => {
28
- setIsSearching(false);
29
- setTimeout(() => {
30
- searchButtonRef.current?.focus();
31
- }, SEARCH_FOCUS_DELAY);
32
- };
33
- const menuTitleId = `components-navigation__menu-title-${menu}`;
34
- const searchButtonLabel = sprintf(__("Search in %s"), title);
35
- return /* @__PURE__ */ _jsxs(MenuTitleUI, {
36
- className: "components-navigation__menu-title",
37
- children: [!isSearching && /* @__PURE__ */ _jsxs(GroupTitleUI, {
38
- as: "h2",
39
- className: "components-navigation__menu-title-heading",
40
- level: 3,
41
- children: [/* @__PURE__ */ _jsx("span", {
42
- id: menuTitleId,
43
- children: title
44
- }), (hasSearch || titleAction) && /* @__PURE__ */ _jsxs(MenuTitleActionsUI, {
45
- children: [titleAction, hasSearch && /* @__PURE__ */ _jsx(Button, {
46
- size: "small",
47
- variant: "tertiary",
48
- label: searchButtonLabel,
49
- onClick: () => setIsSearching(true),
50
- ref: searchButtonRef,
51
- children: /* @__PURE__ */ _jsx(Icon, {
52
- icon: searchIcon
53
- })
54
- })]
55
- })]
56
- }), isSearching && /* @__PURE__ */ _jsx("div", {
57
- className: getAnimateClassName({
58
- type: "slide-in",
59
- origin: "left"
60
- }),
61
- children: /* @__PURE__ */ _jsx(MenuTitleSearch, {
62
- onCloseSearch,
63
- onSearch,
64
- search,
65
- title
66
- })
67
- })]
68
- });
69
- }
70
- export {
71
- NavigationMenuTitle as default
72
- };
73
- //# sourceMappingURL=menu-title.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/menu/menu-title.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useRef, useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, search as searchIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getAnimateClassName } from '../../animate';\nimport Button from '../../button';\nimport MenuTitleSearch from './menu-title-search';\nimport { GroupTitleUI, MenuTitleActionsUI, MenuTitleUI } from '../styles/navigation-styles';\nimport { useNavigationMenuContext } from './context';\nimport { SEARCH_FOCUS_DELAY } from '../constants';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default function NavigationMenuTitle({\n hasSearch,\n onSearch,\n search,\n title,\n titleAction\n}) {\n const [isSearching, setIsSearching] = useState(false);\n const {\n menu\n } = useNavigationMenuContext();\n const searchButtonRef = useRef(null);\n if (!title) {\n return null;\n }\n const onCloseSearch = () => {\n setIsSearching(false);\n\n // Wait for the slide-in animation to complete before focusing the search button.\n // eslint-disable-next-line @wordpress/react-no-unsafe-timeout\n setTimeout(() => {\n searchButtonRef.current?.focus();\n }, SEARCH_FOCUS_DELAY);\n };\n const menuTitleId = `components-navigation__menu-title-${menu}`;\n /* translators: search button label for menu search box. %s: menu title */\n const searchButtonLabel = sprintf(__('Search in %s'), title);\n return /*#__PURE__*/_jsxs(MenuTitleUI, {\n className: \"components-navigation__menu-title\",\n children: [!isSearching && /*#__PURE__*/_jsxs(GroupTitleUI, {\n as: \"h2\",\n className: \"components-navigation__menu-title-heading\",\n level: 3,\n children: [/*#__PURE__*/_jsx(\"span\", {\n id: menuTitleId,\n children: title\n }), (hasSearch || titleAction) && /*#__PURE__*/_jsxs(MenuTitleActionsUI, {\n children: [titleAction, hasSearch && /*#__PURE__*/_jsx(Button, {\n size: \"small\",\n variant: \"tertiary\",\n label: searchButtonLabel,\n onClick: () => setIsSearching(true),\n ref: searchButtonRef,\n children: /*#__PURE__*/_jsx(Icon, {\n icon: searchIcon\n })\n })]\n })]\n }), isSearching && /*#__PURE__*/_jsx(\"div\", {\n className: getAnimateClassName({\n type: 'slide-in',\n origin: 'left'\n }),\n children: /*#__PURE__*/_jsx(MenuTitleSearch, {\n onCloseSearch: onCloseSearch,\n onSearch: onSearch,\n search: search,\n title: title\n })\n })]\n });\n}"],
5
- "mappings": ";AAGA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,IAAI,eAAe;AAC5B,SAAS,MAAM,UAAU,kBAAkB;AAK3C,SAAS,2BAA2B;AACpC,OAAO,YAAY;AACnB,OAAO,qBAAqB;AAC5B,SAAS,cAAc,oBAAoB,mBAAmB;AAC9D,SAAS,gCAAgC;AACzC,SAAS,0BAA0B;AACnC,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC5B,SAAR,oBAAqC;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,QAAM;AAAA,IACJ;AAAA,EACF,IAAI,yBAAyB;AAC7B,QAAM,kBAAkB,OAAO,IAAI;AACnC,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AACA,QAAM,gBAAgB,MAAM;AAC1B,mBAAe,KAAK;AAIpB,eAAW,MAAM;AACf,sBAAgB,SAAS,MAAM;AAAA,IACjC,GAAG,kBAAkB;AAAA,EACvB;AACA,QAAM,cAAc,qCAAqC,IAAI;AAE7D,QAAM,oBAAoB,QAAQ,GAAG,cAAc,GAAG,KAAK;AAC3D,SAAoB,sBAAM,aAAa;AAAA,IACrC,WAAW;AAAA,IACX,UAAU,CAAC,CAAC,eAA4B,sBAAM,cAAc;AAAA,MAC1D,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU,CAAc,qBAAK,QAAQ;AAAA,QACnC,IAAI;AAAA,QACJ,UAAU;AAAA,MACZ,CAAC,IAAI,aAAa,gBAA6B,sBAAM,oBAAoB;AAAA,QACvE,UAAU,CAAC,aAAa,aAA0B,qBAAK,QAAQ;AAAA,UAC7D,MAAM;AAAA,UACN,SAAS;AAAA,UACT,OAAO;AAAA,UACP,SAAS,MAAM,eAAe,IAAI;AAAA,UAClC,KAAK;AAAA,UACL,UAAuB,qBAAK,MAAM;AAAA,YAChC,MAAM;AAAA,UACR,CAAC;AAAA,QACH,CAAC,CAAC;AAAA,MACJ,CAAC,CAAC;AAAA,IACJ,CAAC,GAAG,eAA4B,qBAAK,OAAO;AAAA,MAC1C,WAAW,oBAAoB;AAAA,QAC7B,MAAM;AAAA,QACN,QAAQ;AAAA,MACV,CAAC;AAAA,MACD,UAAuB,qBAAK,iBAAiB;AAAA,QAC3C;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;",
6
- "names": []
7
- }
@@ -1,27 +0,0 @@
1
- // packages/components/src/navigation/menu/search-no-results-found.tsx
2
- import { __ } from "@wordpress/i18n";
3
- import { useNavigationContext } from "../context.mjs";
4
- import { ItemBaseUI, ItemUI } from "../styles/navigation-styles.mjs";
5
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
6
- function NavigationSearchNoResultsFound({
7
- search
8
- }) {
9
- const {
10
- navigationTree: {
11
- items
12
- }
13
- } = useNavigationContext();
14
- const resultsCount = Object.values(items).filter((item) => item._isVisible).length;
15
- if (!search || !!resultsCount) {
16
- return null;
17
- }
18
- return /* @__PURE__ */ _jsx(ItemBaseUI, {
19
- children: /* @__PURE__ */ _jsxs(ItemUI, {
20
- children: [__("No results found."), " "]
21
- })
22
- });
23
- }
24
- export {
25
- NavigationSearchNoResultsFound as default
26
- };
27
- //# sourceMappingURL=search-no-results-found.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/menu/search-no-results-found.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { ItemBaseUI, ItemUI } from '../styles/navigation-styles';\nimport { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nexport default function NavigationSearchNoResultsFound({\n search\n}) {\n const {\n navigationTree: {\n items\n }\n } = useNavigationContext();\n const resultsCount = Object.values(items).filter(item => item._isVisible).length;\n if (!search || !!resultsCount) {\n return null;\n }\n return /*#__PURE__*/_jsx(ItemBaseUI, {\n children: /*#__PURE__*/_jsxs(ItemUI, {\n children: [__('No results found.'), \" \"]\n })\n });\n}"],
5
- "mappings": ";AAGA,SAAS,UAAU;AAKnB,SAAS,4BAA4B;AACrC,SAAS,YAAY,cAAc;AACnC,SAAS,QAAQ,OAAO,OAAO,YAAY;AAC5B,SAAR,+BAAgD;AAAA,EACrD;AACF,GAAG;AACD,QAAM;AAAA,IACJ,gBAAgB;AAAA,MACd;AAAA,IACF;AAAA,EACF,IAAI,qBAAqB;AACzB,QAAM,eAAe,OAAO,OAAO,KAAK,EAAE,OAAO,UAAQ,KAAK,UAAU,EAAE;AAC1E,MAAI,CAAC,UAAU,CAAC,CAAC,cAAc;AAC7B,WAAO;AAAA,EACT;AACA,SAAoB,qBAAK,YAAY;AAAA,IACnC,UAAuB,sBAAM,QAAQ;AAAA,MACnC,UAAU,CAAC,GAAG,mBAAmB,GAAG,GAAG;AAAA,IACzC,CAAC;AAAA,EACH,CAAC;AACH;",
6
- "names": []
7
- }
@@ -1,26 +0,0 @@
1
- // packages/components/src/navigation/menu/use-navigation-tree-menu.tsx
2
- import { useEffect } from "@wordpress/element";
3
- import { useNavigationContext } from "../context.mjs";
4
- import { ROOT_MENU } from "../constants.mjs";
5
- var useNavigationTreeMenu = (props) => {
6
- const {
7
- navigationTree: {
8
- addMenu,
9
- removeMenu
10
- }
11
- } = useNavigationContext();
12
- const key = props.menu || ROOT_MENU;
13
- useEffect(() => {
14
- addMenu(key, {
15
- ...props,
16
- menu: key
17
- });
18
- return () => {
19
- removeMenu(key);
20
- };
21
- }, []);
22
- };
23
- export {
24
- useNavigationTreeMenu
25
- };
26
- //# sourceMappingURL=use-navigation-tree-menu.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/menu/use-navigation-tree-menu.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { ROOT_MENU } from '../constants';\nexport const useNavigationTreeMenu = props => {\n const {\n navigationTree: {\n addMenu,\n removeMenu\n }\n } = useNavigationContext();\n const key = props.menu || ROOT_MENU;\n useEffect(() => {\n addMenu(key, {\n ...props,\n menu: key\n });\n return () => {\n removeMenu(key);\n };\n // Not adding deps for now, as it would require either a larger refactor\n // See https://github.com/WordPress/gutenberg/pull/44090\n }, []);\n};"],
5
- "mappings": ";AAGA,SAAS,iBAAiB;AAK1B,SAAS,4BAA4B;AACrC,SAAS,iBAAiB;AACnB,IAAM,wBAAwB,WAAS;AAC5C,QAAM;AAAA,IACJ,gBAAgB;AAAA,MACd;AAAA,MACA;AAAA,IACF;AAAA,EACF,IAAI,qBAAqB;AACzB,QAAM,MAAM,MAAM,QAAQ;AAC1B,YAAU,MAAM;AACd,YAAQ,KAAK;AAAA,MACX,GAAG;AAAA,MACH,MAAM;AAAA,IACR,CAAC;AACD,WAAO,MAAM;AACX,iBAAW,GAAG;AAAA,IAChB;AAAA,EAGF,GAAG,CAAC,CAAC;AACP;",
6
- "names": []
7
- }