@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,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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,mBAAgD;AAChD,kBAAsB;AAKtB,oBAAmB;AACnB,qBAAqC;AACrC,+BAAmC;AACnC,0BAAsC;AACtC,kBAA+B;AAC/B,yBAA2C;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,QAAI,qCAAqB;AAKzB,MAAI,yBAAyB,kBAAkB,YAAY,cAAc,GAAG;AAC1E,WAAO;AAAA,EACT;AACA,QAAM,WAAW,QAAQ,eAAe;AACxC,QAAM,cAAU,YAAAA,SAAK,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,qBAAiB,mBAAM,IAAI,2BAAc;AAC/C,QAAM,YAAY,WAAW,QAAQ;AAAA,IACnC,GAAG;AAAA,IACH,SAAS;AAAA,EACX;AACA,QAAM,YAAY,SAAS,YAAY;AAAA,IACrC,IAAI,cAAAC;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,uCAAAC,KAAK,YAAAC,SAAoB;AAAA,IAC3C,GAAG;AAAA,IACH,WAAW;AAAA,IACX,UAAU,YAAyB,uCAAAC,MAAM,iCAAQ;AAAA,MAC/C,GAAG;AAAA,MACH,UAAU,CAAC,QAAqB,uCAAAF,KAAK,qCAAY;AAAA,QAC/C,UAAuB,uCAAAA,KAAK,mBAAM;AAAA,UAChC;AAAA,QACF,CAAC;AAAA,MACH,CAAC,GAAgB,uCAAAA,KAAK,oBAAAG,SAA2B;AAAA,QAC/C;AAAA,QACA;AAAA,MACF,CAAC,GAAG,kBAA+B,uCAAAH,KAAK,mBAAM;AAAA,QAC5C,MAAM;AAAA,MACR,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA,EACH,CAAC;AACH;AACA,IAAO,eAAQ;",
6
- "names": ["clsx", "Button", "_jsx", "NavigationItemBase", "_jsxs", "NavigationItemBaseContent"]
7
- }
@@ -1,64 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/components/src/navigation/item/use-navigation-tree-item.tsx
21
- var use_navigation_tree_item_exports = {};
22
- __export(use_navigation_tree_item_exports, {
23
- useNavigationTreeItem: () => useNavigationTreeItem
24
- });
25
- module.exports = __toCommonJS(use_navigation_tree_item_exports);
26
- var import_element = require("@wordpress/element");
27
- var import_context = require("../context.cjs");
28
- var import_context2 = require("../group/context.cjs");
29
- var import_context3 = require("../menu/context.cjs");
30
- var import_utils = require("../utils.cjs");
31
- var useNavigationTreeItem = (itemId, props) => {
32
- const {
33
- activeMenu,
34
- navigationTree: {
35
- addItem,
36
- removeItem
37
- }
38
- } = (0, import_context.useNavigationContext)();
39
- const {
40
- group
41
- } = (0, import_context2.useNavigationGroupContext)();
42
- const {
43
- menu,
44
- search
45
- } = (0, import_context3.useNavigationMenuContext)();
46
- (0, import_element.useEffect)(() => {
47
- const isMenuActive = activeMenu === menu;
48
- const isItemVisible = !search || props.title !== void 0 && (0, import_utils.normalizedSearch)(props.title, search);
49
- addItem(itemId, {
50
- ...props,
51
- group,
52
- menu,
53
- _isVisible: isMenuActive && isItemVisible
54
- });
55
- return () => {
56
- removeItem(itemId);
57
- };
58
- }, [activeMenu, search]);
59
- };
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- useNavigationTreeItem
63
- });
64
- //# sourceMappingURL=use-navigation-tree-item.cjs.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": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0B;AAK1B,qBAAqC;AACrC,IAAAA,kBAA0C;AAC1C,IAAAA,kBAAyC;AACzC,mBAAiC;AAC1B,IAAM,wBAAwB,CAAC,QAAQ,UAAU;AACtD,QAAM;AAAA,IACJ;AAAA,IACA,gBAAgB;AAAA,MACd;AAAA,MACA;AAAA,IACF;AAAA,EACF,QAAI,qCAAqB;AACzB,QAAM;AAAA,IACJ;AAAA,EACF,QAAI,2CAA0B;AAC9B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,QAAI,0CAAyB;AAC7B,gCAAU,MAAM;AACd,UAAM,eAAe,eAAe;AACpC,UAAM,gBAAgB,CAAC,UAAU,MAAM,UAAU,cAAa,+BAAiB,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": ["import_context"]
7
- }
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/components/src/navigation/menu/context.tsx
21
- var context_exports = {};
22
- __export(context_exports, {
23
- NavigationMenuContext: () => NavigationMenuContext,
24
- useNavigationMenuContext: () => useNavigationMenuContext
25
- });
26
- module.exports = __toCommonJS(context_exports);
27
- var import_element = require("@wordpress/element");
28
- var NavigationMenuContext = (0, import_element.createContext)({
29
- menu: void 0,
30
- search: ""
31
- });
32
- NavigationMenuContext.displayName = "NavigationMenuContext";
33
- var useNavigationMenuContext = () => (0, import_element.useContext)(NavigationMenuContext);
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- NavigationMenuContext,
37
- useNavigationMenuContext
38
- });
39
- //# sourceMappingURL=context.cjs.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": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0C;AAMnC,IAAM,4BAAwB,8BAAc;AAAA,EACjD,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;AACD,sBAAsB,cAAc;AAC7B,IAAM,2BAA2B,UAAM,2BAAW,qBAAqB;",
6
- "names": []
7
- }
@@ -1,114 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // packages/components/src/navigation/menu/index.tsx
31
- var menu_exports = {};
32
- __export(menu_exports, {
33
- NavigationMenu: () => NavigationMenu,
34
- default: () => menu_default
35
- });
36
- module.exports = __toCommonJS(menu_exports);
37
- var import_clsx = __toESM(require("clsx"));
38
- var import_element = require("@wordpress/element");
39
- var import_constants = require("../constants.cjs");
40
- var import_context = require("./context.cjs");
41
- var import_context2 = require("../context.cjs");
42
- var import_use_navigation_tree_menu = require("./use-navigation-tree-menu.cjs");
43
- var import_back_button = __toESM(require("../back-button/index.cjs"));
44
- var import_menu_title = __toESM(require("./menu-title.cjs"));
45
- var import_search_no_results_found = __toESM(require("./search-no-results-found.cjs"));
46
- var import_navigable_container = require("../../navigable-container/index.cjs");
47
- var import_navigation_styles = require("../styles/navigation-styles.cjs");
48
- var import_jsx_runtime = require("react/jsx-runtime");
49
- function NavigationMenu(props) {
50
- const {
51
- backButtonLabel,
52
- children,
53
- className,
54
- hasSearch,
55
- menu = import_constants.ROOT_MENU,
56
- onBackButtonClick,
57
- onSearch: setControlledSearch,
58
- parentMenu,
59
- search: controlledSearch,
60
- isSearchDebouncing,
61
- title,
62
- titleAction
63
- } = props;
64
- const [uncontrolledSearch, setUncontrolledSearch] = (0, import_element.useState)("");
65
- (0, import_use_navigation_tree_menu.useNavigationTreeMenu)(props);
66
- const {
67
- activeMenu
68
- } = (0, import_context2.useNavigationContext)();
69
- const context = {
70
- menu,
71
- search: uncontrolledSearch
72
- };
73
- if (activeMenu !== menu) {
74
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.NavigationMenuContext.Provider, {
75
- value: context,
76
- children
77
- });
78
- }
79
- const isControlledSearch = !!setControlledSearch;
80
- const search = isControlledSearch ? controlledSearch : uncontrolledSearch;
81
- const onSearch = isControlledSearch ? setControlledSearch : setUncontrolledSearch;
82
- const menuTitleId = `components-navigation__menu-title-${menu}`;
83
- const classes = (0, import_clsx.default)("components-navigation__menu", className);
84
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.NavigationMenuContext.Provider, {
85
- value: context,
86
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_navigation_styles.MenuUI, {
87
- className: classes,
88
- children: [(parentMenu || onBackButtonClick) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_back_button.default, {
89
- backButtonLabel,
90
- parentMenu,
91
- onClick: onBackButtonClick
92
- }), title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_menu_title.default, {
93
- hasSearch,
94
- onSearch,
95
- search,
96
- title,
97
- titleAction
98
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigable_container.NavigableMenu, {
99
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", {
100
- "aria-labelledby": menuTitleId,
101
- children: [children, search && !isSearchDebouncing && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_search_no_results_found.default, {
102
- search
103
- })]
104
- })
105
- })]
106
- })
107
- });
108
- }
109
- var menu_default = NavigationMenu;
110
- // Annotate the CommonJS export names for ESM import in node:
111
- 0 && (module.exports = {
112
- NavigationMenu
113
- });
114
- //# sourceMappingURL=index.cjs.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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAAyB;AAKzB,uBAA0B;AAC1B,qBAAsC;AACtC,IAAAA,kBAAqC;AACrC,sCAAsC;AACtC,yBAAiC;AACjC,wBAAgC;AAChC,qCAA2C;AAC3C,iCAA8B;AAC9B,+BAAuB;AACvB,yBAA2C;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,QAAI,yBAAS,EAAE;AAC/D,6DAAsB,KAAK;AAC3B,QAAM;AAAA,IACJ;AAAA,EACF,QAAI,sCAAqB;AACzB,QAAM,UAAU;AAAA,IACd;AAAA,IACA,QAAQ;AAAA,EACV;AAGA,MAAI,eAAe,MAAM;AACvB,WAAoB,uCAAAC,KAAK,qCAAsB,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,cAAU,YAAAC,SAAK,+BAA+B,SAAS;AAC7D,SAAoB,uCAAAD,KAAK,qCAAsB,UAAU;AAAA,IACvD,OAAO;AAAA,IACP,UAAuB,uCAAAE,MAAM,iCAAQ;AAAA,MACnC,WAAW;AAAA,MACX,UAAU,EAAE,cAAc,sBAAmC,uCAAAF,KAAK,mBAAAG,SAAsB;AAAA,QACtF;AAAA,QACA;AAAA,QACA,SAAS;AAAA,MACX,CAAC,GAAG,SAAsB,uCAAAH,KAAK,kBAAAI,SAAqB;AAAA,QAClD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC,GAAgB,uCAAAJ,KAAK,0CAAe;AAAA,QACnC,UAAuB,uCAAAE,MAAM,MAAM;AAAA,UACjC,mBAAmB;AAAA,UACnB,UAAU,CAAC,UAAU,UAAU,CAAC,sBAAmC,uCAAAF,KAAK,+BAAAK,SAAgC;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": ["import_context", "_jsx", "clsx", "_jsxs", "NavigationBackButton", "NavigationMenuTitle", "NavigationSearchNoResultsFound"]
7
- }
@@ -1,111 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // packages/components/src/navigation/menu/menu-title-search.tsx
31
- var menu_title_search_exports = {};
32
- __export(menu_title_search_exports, {
33
- default: () => menu_title_search_default
34
- });
35
- module.exports = __toCommonJS(menu_title_search_exports);
36
- var import_element = require("@wordpress/element");
37
- var import_i18n = require("@wordpress/i18n");
38
- var import_with_spoken_messages = __toESM(require("../../higher-order/with-spoken-messages/index.cjs"));
39
- var import_context = require("./context.cjs");
40
- var import_context2 = require("../context.cjs");
41
- var import_constants = require("../constants.cjs");
42
- var import_search_control = __toESM(require("../../search-control/index.cjs"));
43
- var import_navigation_styles = require("../styles/navigation-styles.cjs");
44
- var import_jsx_runtime = require("react/jsx-runtime");
45
- function MenuTitleSearch({
46
- debouncedSpeak,
47
- onCloseSearch,
48
- onSearch,
49
- search,
50
- title
51
- }) {
52
- const {
53
- navigationTree: {
54
- items
55
- }
56
- } = (0, import_context2.useNavigationContext)();
57
- const {
58
- menu
59
- } = (0, import_context.useNavigationMenuContext)();
60
- const inputRef = (0, import_element.useRef)(null);
61
- (0, import_element.useEffect)(() => {
62
- const delayedFocus = setTimeout(() => {
63
- inputRef.current?.focus();
64
- }, import_constants.SEARCH_FOCUS_DELAY);
65
- return () => {
66
- clearTimeout(delayedFocus);
67
- };
68
- }, []);
69
- (0, import_element.useEffect)(() => {
70
- if (!search) {
71
- return;
72
- }
73
- const count = Object.values(items).filter((item) => item._isVisible).length;
74
- const resultsFoundMessage = (0, import_i18n.sprintf)(
75
- /* translators: %d: number of results. */
76
- (0, import_i18n._n)("%d result found.", "%d results found.", count),
77
- count
78
- );
79
- debouncedSpeak(resultsFoundMessage);
80
- }, [items, search]);
81
- const onClose = () => {
82
- onSearch?.("");
83
- onCloseSearch();
84
- };
85
- const onKeyDown = (event) => {
86
- if (event.code === "Escape" && !event.defaultPrevented) {
87
- event.preventDefault();
88
- onClose();
89
- }
90
- };
91
- const inputId = `components-navigation__menu-title-search-${menu}`;
92
- const placeholder = (0, import_i18n.sprintf)(
93
- /* translators: placeholder for menu search box. %s: menu title */
94
- (0, import_i18n.__)("Search %s"),
95
- title?.toLowerCase() || ""
96
- ).trim();
97
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.MenuTitleSearchControlWrapper, {
98
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_search_control.default, {
99
- className: "components-navigation__menu-search-input",
100
- id: inputId,
101
- onChange: (value) => onSearch?.(value),
102
- onKeyDown,
103
- placeholder,
104
- onClose,
105
- ref: inputRef,
106
- value: search
107
- })
108
- });
109
- }
110
- var menu_title_search_default = (0, import_with_spoken_messages.default)(MenuTitleSearch);
111
- //# sourceMappingURL=menu-title-search.cjs.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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAkC;AAClC,kBAAgC;AAKhC,kCAA+B;AAC/B,qBAAyC;AACzC,IAAAA,kBAAqC;AACrC,uBAAmC;AACnC,4BAA0B;AAC1B,+BAA8C;AAC9C,yBAA4B;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,QAAI,sCAAqB;AACzB,QAAM;AAAA,IACJ;AAAA,EACF,QAAI,yCAAyB;AAC7B,QAAM,eAAW,uBAAO,IAAI;AAI5B,gCAAU,MAAM;AACd,UAAM,eAAe,WAAW,MAAM;AACpC,eAAS,SAAS,MAAM;AAAA,IAC1B,GAAG,mCAAkB;AACrB,WAAO,MAAM;AACX,mBAAa,YAAY;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,CAAC;AACL,gCAAU,MAAM;AACd,QAAI,CAAC,QAAQ;AACX;AAAA,IACF;AACA,UAAM,QAAQ,OAAO,OAAO,KAAK,EAAE,OAAO,UAAQ,KAAK,UAAU,EAAE;AACnE,UAAM,0BAAsB;AAAA;AAAA,UAC5B,gBAAG,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,kBAAc;AAAA;AAAA,QACpB,gBAAG,WAAW;AAAA,IAAG,OAAO,YAAY,KAAK;AAAA,EAAE,EAAE,KAAK;AAClD,SAAoB,uCAAAC,KAAK,wDAA+B;AAAA,IACtD,UAAuB,uCAAAA,KAAK,sBAAAC,SAAe;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,gCAAQ,4BAAAC,SAAmB,eAAe;",
6
- "names": ["import_context", "_jsx", "SearchControl", "withSpokenMessages"]
7
- }
@@ -1,104 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // packages/components/src/navigation/menu/menu-title.tsx
31
- var menu_title_exports = {};
32
- __export(menu_title_exports, {
33
- default: () => NavigationMenuTitle
34
- });
35
- module.exports = __toCommonJS(menu_title_exports);
36
- var import_element = require("@wordpress/element");
37
- var import_i18n = require("@wordpress/i18n");
38
- var import_icons = require("@wordpress/icons");
39
- var import_animate = require("../../animate/index.cjs");
40
- var import_button = __toESM(require("../../button/index.cjs"));
41
- var import_menu_title_search = __toESM(require("./menu-title-search.cjs"));
42
- var import_navigation_styles = require("../styles/navigation-styles.cjs");
43
- var import_context = require("./context.cjs");
44
- var import_constants = require("../constants.cjs");
45
- var import_jsx_runtime = require("react/jsx-runtime");
46
- function NavigationMenuTitle({
47
- hasSearch,
48
- onSearch,
49
- search,
50
- title,
51
- titleAction
52
- }) {
53
- const [isSearching, setIsSearching] = (0, import_element.useState)(false);
54
- const {
55
- menu
56
- } = (0, import_context.useNavigationMenuContext)();
57
- const searchButtonRef = (0, import_element.useRef)(null);
58
- if (!title) {
59
- return null;
60
- }
61
- const onCloseSearch = () => {
62
- setIsSearching(false);
63
- setTimeout(() => {
64
- searchButtonRef.current?.focus();
65
- }, import_constants.SEARCH_FOCUS_DELAY);
66
- };
67
- const menuTitleId = `components-navigation__menu-title-${menu}`;
68
- const searchButtonLabel = (0, import_i18n.sprintf)((0, import_i18n.__)("Search in %s"), title);
69
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_navigation_styles.MenuTitleUI, {
70
- className: "components-navigation__menu-title",
71
- children: [!isSearching && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_navigation_styles.GroupTitleUI, {
72
- as: "h2",
73
- className: "components-navigation__menu-title-heading",
74
- level: 3,
75
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
76
- id: menuTitleId,
77
- children: title
78
- }), (hasSearch || titleAction) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_navigation_styles.MenuTitleActionsUI, {
79
- children: [titleAction, hasSearch && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.default, {
80
- size: "small",
81
- variant: "tertiary",
82
- label: searchButtonLabel,
83
- onClick: () => setIsSearching(true),
84
- ref: searchButtonRef,
85
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, {
86
- icon: import_icons.search
87
- })
88
- })]
89
- })]
90
- }), isSearching && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
91
- className: (0, import_animate.getAnimateClassName)({
92
- type: "slide-in",
93
- origin: "left"
94
- }),
95
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_menu_title_search.default, {
96
- onCloseSearch,
97
- onSearch,
98
- search,
99
- title
100
- })
101
- })]
102
- });
103
- }
104
- //# sourceMappingURL=menu-title.cjs.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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAiC;AACjC,kBAA4B;AAC5B,mBAA2C;AAK3C,qBAAoC;AACpC,oBAAmB;AACnB,+BAA4B;AAC5B,+BAA8D;AAC9D,qBAAyC;AACzC,uBAAmC;AACnC,yBAA2C;AAC5B,SAAR,oBAAqC;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,CAAC,aAAa,cAAc,QAAI,yBAAS,KAAK;AACpD,QAAM;AAAA,IACJ;AAAA,EACF,QAAI,yCAAyB;AAC7B,QAAM,sBAAkB,uBAAO,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,mCAAkB;AAAA,EACvB;AACA,QAAM,cAAc,qCAAqC,IAAI;AAE7D,QAAM,wBAAoB,yBAAQ,gBAAG,cAAc,GAAG,KAAK;AAC3D,SAAoB,uCAAAA,MAAM,sCAAa;AAAA,IACrC,WAAW;AAAA,IACX,UAAU,CAAC,CAAC,eAA4B,uCAAAA,MAAM,uCAAc;AAAA,MAC1D,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU,CAAc,uCAAAC,KAAK,QAAQ;AAAA,QACnC,IAAI;AAAA,QACJ,UAAU;AAAA,MACZ,CAAC,IAAI,aAAa,gBAA6B,uCAAAD,MAAM,6CAAoB;AAAA,QACvE,UAAU,CAAC,aAAa,aAA0B,uCAAAC,KAAK,cAAAC,SAAQ;AAAA,UAC7D,MAAM;AAAA,UACN,SAAS;AAAA,UACT,OAAO;AAAA,UACP,SAAS,MAAM,eAAe,IAAI;AAAA,UAClC,KAAK;AAAA,UACL,UAAuB,uCAAAD,KAAK,mBAAM;AAAA,YAChC,MAAM,aAAAE;AAAA,UACR,CAAC;AAAA,QACH,CAAC,CAAC;AAAA,MACJ,CAAC,CAAC;AAAA,IACJ,CAAC,GAAG,eAA4B,uCAAAF,KAAK,OAAO;AAAA,MAC1C,eAAW,oCAAoB;AAAA,QAC7B,MAAM;AAAA,QACN,QAAQ;AAAA,MACV,CAAC;AAAA,MACD,UAAuB,uCAAAA,KAAK,yBAAAG,SAAiB;AAAA,QAC3C;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;",
6
- "names": ["_jsxs", "_jsx", "Button", "searchIcon", "MenuTitleSearch"]
7
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/components/src/navigation/menu/search-no-results-found.tsx
21
- var search_no_results_found_exports = {};
22
- __export(search_no_results_found_exports, {
23
- default: () => NavigationSearchNoResultsFound
24
- });
25
- module.exports = __toCommonJS(search_no_results_found_exports);
26
- var import_i18n = require("@wordpress/i18n");
27
- var import_context = require("../context.cjs");
28
- var import_navigation_styles = require("../styles/navigation-styles.cjs");
29
- var import_jsx_runtime = require("react/jsx-runtime");
30
- function NavigationSearchNoResultsFound({
31
- search
32
- }) {
33
- const {
34
- navigationTree: {
35
- items
36
- }
37
- } = (0, import_context.useNavigationContext)();
38
- const resultsCount = Object.values(items).filter((item) => item._isVisible).length;
39
- if (!search || !!resultsCount) {
40
- return null;
41
- }
42
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.ItemBaseUI, {
43
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_navigation_styles.ItemUI, {
44
- children: [(0, import_i18n.__)("No results found."), " "]
45
- })
46
- });
47
- }
48
- //# sourceMappingURL=search-no-results-found.cjs.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": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AAKnB,qBAAqC;AACrC,+BAAmC;AACnC,yBAA2C;AAC5B,SAAR,+BAAgD;AAAA,EACrD;AACF,GAAG;AACD,QAAM;AAAA,IACJ,gBAAgB;AAAA,MACd;AAAA,IACF;AAAA,EACF,QAAI,qCAAqB;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,uCAAAA,KAAK,qCAAY;AAAA,IACnC,UAAuB,uCAAAC,MAAM,iCAAQ;AAAA,MACnC,UAAU,KAAC,gBAAG,mBAAmB,GAAG,GAAG;AAAA,IACzC,CAAC;AAAA,EACH,CAAC;AACH;",
6
- "names": ["_jsx", "_jsxs"]
7
- }
@@ -1,51 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/components/src/navigation/menu/use-navigation-tree-menu.tsx
21
- var use_navigation_tree_menu_exports = {};
22
- __export(use_navigation_tree_menu_exports, {
23
- useNavigationTreeMenu: () => useNavigationTreeMenu
24
- });
25
- module.exports = __toCommonJS(use_navigation_tree_menu_exports);
26
- var import_element = require("@wordpress/element");
27
- var import_context = require("../context.cjs");
28
- var import_constants = require("../constants.cjs");
29
- var useNavigationTreeMenu = (props) => {
30
- const {
31
- navigationTree: {
32
- addMenu,
33
- removeMenu
34
- }
35
- } = (0, import_context.useNavigationContext)();
36
- const key = props.menu || import_constants.ROOT_MENU;
37
- (0, import_element.useEffect)(() => {
38
- addMenu(key, {
39
- ...props,
40
- menu: key
41
- });
42
- return () => {
43
- removeMenu(key);
44
- };
45
- }, []);
46
- };
47
- // Annotate the CommonJS export names for ESM import in node:
48
- 0 && (module.exports = {
49
- useNavigationTreeMenu
50
- });
51
- //# sourceMappingURL=use-navigation-tree-menu.cjs.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": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0B;AAK1B,qBAAqC;AACrC,uBAA0B;AACnB,IAAM,wBAAwB,WAAS;AAC5C,QAAM;AAAA,IACJ,gBAAgB;AAAA,MACd;AAAA,MACA;AAAA,IACF;AAAA,EACF,QAAI,qCAAqB;AACzB,QAAM,MAAM,MAAM,QAAQ;AAC1B,gCAAU,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
- }