@wordpress/components 33.1.1-next.v.202605131006.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,34 +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/constants.tsx
21
- var constants_exports = {};
22
- __export(constants_exports, {
23
- ROOT_MENU: () => ROOT_MENU,
24
- SEARCH_FOCUS_DELAY: () => SEARCH_FOCUS_DELAY
25
- });
26
- module.exports = __toCommonJS(constants_exports);
27
- var ROOT_MENU = "root";
28
- var SEARCH_FOCUS_DELAY = 100;
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- ROOT_MENU,
32
- SEARCH_FOCUS_DELAY
33
- });
34
- //# sourceMappingURL=constants.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/navigation/constants.tsx"],
4
- "sourcesContent": ["export const ROOT_MENU = 'root';\nexport const SEARCH_FOCUS_DELAY = 100;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,YAAY;AAClB,IAAM,qBAAqB;",
6
- "names": []
7
- }
@@ -1,58 +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/context.tsx
21
- var context_exports = {};
22
- __export(context_exports, {
23
- NavigationContext: () => NavigationContext,
24
- useNavigationContext: () => useNavigationContext
25
- });
26
- module.exports = __toCommonJS(context_exports);
27
- var import_element = require("@wordpress/element");
28
- var import_constants = require("./constants.cjs");
29
- var noop = () => {
30
- };
31
- var defaultIsEmpty = () => false;
32
- var defaultGetter = () => void 0;
33
- var NavigationContext = (0, import_element.createContext)({
34
- activeItem: void 0,
35
- activeMenu: import_constants.ROOT_MENU,
36
- setActiveMenu: noop,
37
- navigationTree: {
38
- items: {},
39
- getItem: defaultGetter,
40
- addItem: noop,
41
- removeItem: noop,
42
- menus: {},
43
- getMenu: defaultGetter,
44
- addMenu: noop,
45
- removeMenu: noop,
46
- childMenu: {},
47
- traverseMenu: noop,
48
- isMenuEmpty: defaultIsEmpty
49
- }
50
- });
51
- NavigationContext.displayName = "NavigationContext";
52
- var useNavigationContext = () => (0, import_element.useContext)(NavigationContext);
53
- // Annotate the CommonJS export names for ESM import in node:
54
- 0 && (module.exports = {
55
- NavigationContext,
56
- useNavigationContext
57
- });
58
- //# sourceMappingURL=context.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/navigation/context.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ROOT_MENU } from './constants';\nconst noop = () => {};\nconst defaultIsEmpty = () => false;\nconst defaultGetter = () => undefined;\nexport const NavigationContext = createContext({\n activeItem: undefined,\n activeMenu: ROOT_MENU,\n setActiveMenu: noop,\n navigationTree: {\n items: {},\n getItem: defaultGetter,\n addItem: noop,\n removeItem: noop,\n menus: {},\n getMenu: defaultGetter,\n addMenu: noop,\n removeMenu: noop,\n childMenu: {},\n traverseMenu: noop,\n isMenuEmpty: defaultIsEmpty\n }\n});\nNavigationContext.displayName = 'NavigationContext';\nexport const useNavigationContext = () => useContext(NavigationContext);"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0C;AAK1C,uBAA0B;AAC1B,IAAM,OAAO,MAAM;AAAC;AACpB,IAAM,iBAAiB,MAAM;AAC7B,IAAM,gBAAgB,MAAM;AACrB,IAAM,wBAAoB,8BAAc;AAAA,EAC7C,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,gBAAgB;AAAA,IACd,OAAO,CAAC;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,OAAO,CAAC;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,CAAC;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AACF,CAAC;AACD,kBAAkB,cAAc;AACzB,IAAM,uBAAuB,UAAM,2BAAW,iBAAiB;",
6
- "names": []
7
- }
@@ -1,38 +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/group/context.tsx
21
- var context_exports = {};
22
- __export(context_exports, {
23
- NavigationGroupContext: () => NavigationGroupContext,
24
- useNavigationGroupContext: () => useNavigationGroupContext
25
- });
26
- module.exports = __toCommonJS(context_exports);
27
- var import_element = require("@wordpress/element");
28
- var NavigationGroupContext = (0, import_element.createContext)({
29
- group: void 0
30
- });
31
- NavigationGroupContext.displayName = "NavigationGroupContext";
32
- var useNavigationGroupContext = () => (0, import_element.useContext)(NavigationGroupContext);
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- NavigationGroupContext,
36
- useNavigationGroupContext
37
- });
38
- //# sourceMappingURL=context.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/group/context.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nexport const NavigationGroupContext = createContext({\n group: undefined\n});\nNavigationGroupContext.displayName = 'NavigationGroupContext';\nexport const useNavigationGroupContext = () => useContext(NavigationGroupContext);"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0C;AAMnC,IAAM,6BAAyB,8BAAc;AAAA,EAClD,OAAO;AACT,CAAC;AACD,uBAAuB,cAAc;AAC9B,IAAM,4BAA4B,UAAM,2BAAW,sBAAsB;",
6
- "names": []
7
- }
@@ -1,88 +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/group/index.tsx
31
- var group_exports = {};
32
- __export(group_exports, {
33
- NavigationGroup: () => NavigationGroup,
34
- default: () => group_default
35
- });
36
- module.exports = __toCommonJS(group_exports);
37
- var import_clsx = __toESM(require("clsx"));
38
- var import_element = require("@wordpress/element");
39
- var import_context = require("./context.cjs");
40
- var import_navigation_styles = require("../styles/navigation-styles.cjs");
41
- var import_context2 = require("../context.cjs");
42
- var import_jsx_runtime = require("react/jsx-runtime");
43
- var uniqueId = 0;
44
- function NavigationGroup({
45
- children,
46
- className,
47
- title
48
- }) {
49
- const [groupId] = (0, import_element.useState)(`group-${++uniqueId}`);
50
- const {
51
- navigationTree: {
52
- items
53
- }
54
- } = (0, import_context2.useNavigationContext)();
55
- const context = {
56
- group: groupId
57
- };
58
- if (!Object.values(items).some((item) => item.group === groupId && item._isVisible)) {
59
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.NavigationGroupContext.Provider, {
60
- value: context,
61
- children
62
- });
63
- }
64
- const groupTitleId = `components-navigation__group-title-${groupId}`;
65
- const classes = (0, import_clsx.default)("components-navigation__group", className);
66
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.NavigationGroupContext.Provider, {
67
- value: context,
68
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
69
- className: classes,
70
- children: [title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.GroupTitleUI, {
71
- className: "components-navigation__group-title",
72
- id: groupTitleId,
73
- level: 3,
74
- children: title
75
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", {
76
- "aria-labelledby": groupTitleId,
77
- role: "group",
78
- children
79
- })]
80
- })
81
- });
82
- }
83
- var group_default = NavigationGroup;
84
- // Annotate the CommonJS export names for ESM import in node:
85
- 0 && (module.exports = {
86
- NavigationGroup
87
- });
88
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/group/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 { NavigationGroupContext } from './context';\nimport { GroupTitleUI } from '../styles/navigation-styles';\nimport { useNavigationContext } from '../context';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nlet uniqueId = 0;\n\n/**\n * @deprecated Use `Navigator` instead.\n */\nexport function NavigationGroup({\n children,\n className,\n title\n}) {\n const [groupId] = useState(`group-${++uniqueId}`);\n const {\n navigationTree: {\n items\n }\n } = useNavigationContext();\n const context = {\n group: groupId\n };\n\n // Keep the children rendered to make sure invisible items are included in the navigation tree.\n if (!Object.values(items).some(item => item.group === groupId && item._isVisible)) {\n return /*#__PURE__*/_jsx(NavigationGroupContext.Provider, {\n value: context,\n children: children\n });\n }\n const groupTitleId = `components-navigation__group-title-${groupId}`;\n const classes = clsx('components-navigation__group', className);\n return /*#__PURE__*/_jsx(NavigationGroupContext.Provider, {\n value: context,\n children: /*#__PURE__*/_jsxs(\"li\", {\n className: classes,\n children: [title && /*#__PURE__*/_jsx(GroupTitleUI, {\n className: \"components-navigation__group-title\",\n id: groupTitleId,\n level: 3,\n children: title\n }), /*#__PURE__*/_jsx(\"ul\", {\n \"aria-labelledby\": groupTitleId,\n role: \"group\",\n children: children\n })]\n })\n });\n}\nexport default NavigationGroup;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAAyB;AAKzB,qBAAuC;AACvC,+BAA6B;AAC7B,IAAAA,kBAAqC;AACrC,yBAA2C;AAC3C,IAAI,WAAW;AAKR,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,CAAC,OAAO,QAAI,yBAAS,SAAS,EAAE,QAAQ,EAAE;AAChD,QAAM;AAAA,IACJ,gBAAgB;AAAA,MACd;AAAA,IACF;AAAA,EACF,QAAI,sCAAqB;AACzB,QAAM,UAAU;AAAA,IACd,OAAO;AAAA,EACT;AAGA,MAAI,CAAC,OAAO,OAAO,KAAK,EAAE,KAAK,UAAQ,KAAK,UAAU,WAAW,KAAK,UAAU,GAAG;AACjF,WAAoB,uCAAAC,KAAK,sCAAuB,UAAU;AAAA,MACxD,OAAO;AAAA,MACP;AAAA,IACF,CAAC;AAAA,EACH;AACA,QAAM,eAAe,sCAAsC,OAAO;AAClE,QAAM,cAAU,YAAAC,SAAK,gCAAgC,SAAS;AAC9D,SAAoB,uCAAAD,KAAK,sCAAuB,UAAU;AAAA,IACxD,OAAO;AAAA,IACP,UAAuB,uCAAAE,MAAM,MAAM;AAAA,MACjC,WAAW;AAAA,MACX,UAAU,CAAC,SAAsB,uCAAAF,KAAK,uCAAc;AAAA,QAClD,WAAW;AAAA,QACX,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,UAAU;AAAA,MACZ,CAAC,GAAgB,uCAAAA,KAAK,MAAM;AAAA,QAC1B,mBAAmB;AAAA,QACnB,MAAM;AAAA,QACN;AAAA,MACF,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA,EACH,CAAC;AACH;AACA,IAAO,gBAAQ;",
6
- "names": ["import_context", "_jsx", "clsx", "_jsxs"]
7
- }
@@ -1,113 +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/index.tsx
31
- var navigation_exports = {};
32
- __export(navigation_exports, {
33
- Navigation: () => Navigation,
34
- default: () => navigation_default
35
- });
36
- module.exports = __toCommonJS(navigation_exports);
37
- var import_clsx = __toESM(require("clsx"));
38
- var import_deprecated = __toESM(require("@wordpress/deprecated"));
39
- var import_element = require("@wordpress/element");
40
- var import_i18n = require("@wordpress/i18n");
41
- var import_animate = require("../animate/index.cjs");
42
- var import_constants = require("./constants.cjs");
43
- var import_context = require("./context.cjs");
44
- var import_navigation_styles = require("./styles/navigation-styles.cjs");
45
- var import_use_create_navigation_tree = require("./use-create-navigation-tree.cjs");
46
- var import_jsx_runtime = require("react/jsx-runtime");
47
- var noop = () => {
48
- };
49
- function Navigation({
50
- activeItem,
51
- activeMenu = import_constants.ROOT_MENU,
52
- children,
53
- className,
54
- onActivateMenu = noop
55
- }) {
56
- const [menu, setMenu] = (0, import_element.useState)(activeMenu);
57
- const [slideOrigin, setSlideOrigin] = (0, import_element.useState)();
58
- const navigationTree = (0, import_use_create_navigation_tree.useCreateNavigationTree)();
59
- const defaultSlideOrigin = (0, import_i18n.isRTL)() ? "right" : "left";
60
- (0, import_deprecated.default)("wp.components.Navigation (and all subcomponents)", {
61
- since: "6.8",
62
- version: "7.1",
63
- alternative: "wp.components.Navigator"
64
- });
65
- const setActiveMenu = (menuId, slideInOrigin = defaultSlideOrigin) => {
66
- if (!navigationTree.getMenu(menuId)) {
67
- return;
68
- }
69
- setSlideOrigin(slideInOrigin);
70
- setMenu(menuId);
71
- onActivateMenu(menuId);
72
- };
73
- const isMountedRef = (0, import_element.useRef)(false);
74
- (0, import_element.useEffect)(() => {
75
- if (!isMountedRef.current) {
76
- isMountedRef.current = true;
77
- }
78
- }, []);
79
- (0, import_element.useEffect)(() => {
80
- if (activeMenu !== menu) {
81
- setActiveMenu(activeMenu);
82
- }
83
- }, [activeMenu]);
84
- const context = {
85
- activeItem,
86
- activeMenu: menu,
87
- setActiveMenu,
88
- navigationTree
89
- };
90
- const classes = (0, import_clsx.default)("components-navigation", className);
91
- const animateClassName = (0, import_animate.getAnimateClassName)({
92
- type: "slide-in",
93
- origin: slideOrigin
94
- });
95
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.NavigationUI, {
96
- className: classes,
97
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
98
- className: animateClassName ? (0, import_clsx.default)({
99
- [animateClassName]: isMountedRef.current && slideOrigin
100
- }) : void 0,
101
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.NavigationContext.Provider, {
102
- value: context,
103
- children
104
- })
105
- }, menu)
106
- });
107
- }
108
- var navigation_default = Navigation;
109
- // Annotate the CommonJS export names for ESM import in node:
110
- 0 && (module.exports = {
111
- Navigation
112
- });
113
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/navigation/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getAnimateClassName } from '../animate';\nimport { ROOT_MENU } from './constants';\nimport { NavigationContext } from './context';\nimport { NavigationUI } from './styles/navigation-styles';\nimport { useCreateNavigationTree } from './use-create-navigation-tree';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst noop = () => {};\n\n/**\n * Render a navigation list with optional groupings and hierarchy.\n *\n * @deprecated Use `Navigator` instead.\n *\n * ```jsx\n * import {\n * __experimentalNavigation as Navigation,\n * __experimentalNavigationGroup as NavigationGroup,\n * __experimentalNavigationItem as NavigationItem,\n * __experimentalNavigationMenu as NavigationMenu,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <Navigation>\n * <NavigationMenu title=\"Home\">\n * <NavigationGroup title=\"Group 1\">\n * <NavigationItem item=\"item-1\" title=\"Item 1\" />\n * <NavigationItem item=\"item-2\" title=\"Item 2\" />\n * </NavigationGroup>\n * <NavigationGroup title=\"Group 2\">\n * <NavigationItem\n * item=\"item-3\"\n * navigateToMenu=\"category\"\n * title=\"Category\"\n * />\n * </NavigationGroup>\n * </NavigationMenu>\n *\n * <NavigationMenu\n * backButtonLabel=\"Home\"\n * menu=\"category\"\n * parentMenu=\"root\"\n * title=\"Category\"\n * >\n * <NavigationItem badge=\"1\" item=\"child-1\" title=\"Child 1\" />\n * <NavigationItem item=\"child-2\" title=\"Child 2\" />\n * </NavigationMenu>\n * </Navigation>\n * );\n * ```\n */\nexport function Navigation({\n activeItem,\n activeMenu = ROOT_MENU,\n children,\n className,\n onActivateMenu = noop\n}) {\n const [menu, setMenu] = useState(activeMenu);\n const [slideOrigin, setSlideOrigin] = useState();\n const navigationTree = useCreateNavigationTree();\n const defaultSlideOrigin = isRTL() ? 'right' : 'left';\n deprecated('wp.components.Navigation (and all subcomponents)', {\n since: '6.8',\n version: '7.1',\n alternative: 'wp.components.Navigator'\n });\n const setActiveMenu = (menuId, slideInOrigin = defaultSlideOrigin) => {\n if (!navigationTree.getMenu(menuId)) {\n return;\n }\n setSlideOrigin(slideInOrigin);\n setMenu(menuId);\n onActivateMenu(menuId);\n };\n\n // Used to prevent the sliding animation on mount\n const isMountedRef = useRef(false);\n useEffect(() => {\n if (!isMountedRef.current) {\n isMountedRef.current = true;\n }\n }, []);\n useEffect(() => {\n if (activeMenu !== menu) {\n setActiveMenu(activeMenu);\n }\n // Not adding deps for now, as it would require either a larger refactor or some questionable workarounds.\n // See https://github.com/WordPress/gutenberg/pull/41612 for context.\n }, [activeMenu]);\n const context = {\n activeItem,\n activeMenu: menu,\n setActiveMenu,\n navigationTree\n };\n const classes = clsx('components-navigation', className);\n const animateClassName = getAnimateClassName({\n type: 'slide-in',\n origin: slideOrigin\n });\n return /*#__PURE__*/_jsx(NavigationUI, {\n className: classes,\n children: /*#__PURE__*/_jsx(\"div\", {\n className: animateClassName ? clsx({\n [animateClassName]: isMountedRef.current && slideOrigin\n }) : undefined,\n children: /*#__PURE__*/_jsx(NavigationContext.Provider, {\n value: context,\n children: children\n })\n }, menu)\n });\n}\nexport default Navigation;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,wBAAuB;AACvB,qBAA4C;AAC5C,kBAAsB;AAKtB,qBAAoC;AACpC,uBAA0B;AAC1B,qBAAkC;AAClC,+BAA6B;AAC7B,wCAAwC;AACxC,yBAA4B;AAC5B,IAAM,OAAO,MAAM;AAAC;AA4Cb,SAAS,WAAW;AAAA,EACzB;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,iBAAiB;AACnB,GAAG;AACD,QAAM,CAAC,MAAM,OAAO,QAAI,yBAAS,UAAU;AAC3C,QAAM,CAAC,aAAa,cAAc,QAAI,yBAAS;AAC/C,QAAM,qBAAiB,2DAAwB;AAC/C,QAAM,yBAAqB,mBAAM,IAAI,UAAU;AAC/C,wBAAAA,SAAW,oDAAoD;AAAA,IAC7D,OAAO;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,EACf,CAAC;AACD,QAAM,gBAAgB,CAAC,QAAQ,gBAAgB,uBAAuB;AACpE,QAAI,CAAC,eAAe,QAAQ,MAAM,GAAG;AACnC;AAAA,IACF;AACA,mBAAe,aAAa;AAC5B,YAAQ,MAAM;AACd,mBAAe,MAAM;AAAA,EACvB;AAGA,QAAM,mBAAe,uBAAO,KAAK;AACjC,gCAAU,MAAM;AACd,QAAI,CAAC,aAAa,SAAS;AACzB,mBAAa,UAAU;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,CAAC;AACL,gCAAU,MAAM;AACd,QAAI,eAAe,MAAM;AACvB,oBAAc,UAAU;AAAA,IAC1B;AAAA,EAGF,GAAG,CAAC,UAAU,CAAC;AACf,QAAM,UAAU;AAAA,IACd;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,EACF;AACA,QAAM,cAAU,YAAAC,SAAK,yBAAyB,SAAS;AACvD,QAAM,uBAAmB,oCAAoB;AAAA,IAC3C,MAAM;AAAA,IACN,QAAQ;AAAA,EACV,CAAC;AACD,SAAoB,uCAAAC,KAAK,uCAAc;AAAA,IACrC,WAAW;AAAA,IACX,UAAuB,uCAAAA,KAAK,OAAO;AAAA,MACjC,WAAW,uBAAmB,YAAAD,SAAK;AAAA,QACjC,CAAC,gBAAgB,GAAG,aAAa,WAAW;AAAA,MAC9C,CAAC,IAAI;AAAA,MACL,UAAuB,uCAAAC,KAAK,iCAAkB,UAAU;AAAA,QACtD,OAAO;AAAA,QACP;AAAA,MACF,CAAC;AAAA,IACH,GAAG,IAAI;AAAA,EACT,CAAC;AACH;AACA,IAAO,qBAAQ;",
6
- "names": ["deprecated", "clsx", "_jsx"]
7
- }
@@ -1,44 +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/base-content.tsx
21
- var base_content_exports = {};
22
- __export(base_content_exports, {
23
- default: () => NavigationItemBaseContent
24
- });
25
- module.exports = __toCommonJS(base_content_exports);
26
- var import_navigation_styles = require("../styles/navigation-styles.cjs");
27
- var import_jsx_runtime = require("react/jsx-runtime");
28
- function NavigationItemBaseContent(props) {
29
- const {
30
- badge,
31
- title
32
- } = props;
33
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
34
- children: [title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.ItemTitleUI, {
35
- className: "components-navigation__item-title",
36
- as: "span",
37
- children: title
38
- }), badge && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.ItemBadgeUI, {
39
- className: "components-navigation__item-badge",
40
- children: badge
41
- })]
42
- });
43
- }
44
- //# sourceMappingURL=base-content.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/item/base-content.tsx"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { ItemBadgeUI, ItemTitleUI } from '../styles/navigation-styles';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default function NavigationItemBaseContent(props) {\n const {\n badge,\n title\n } = props;\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [title && /*#__PURE__*/_jsx(ItemTitleUI, {\n className: \"components-navigation__item-title\",\n as: \"span\",\n children: title\n }), badge && /*#__PURE__*/_jsx(ItemBadgeUI, {\n className: \"components-navigation__item-badge\",\n children: badge\n })]\n });\n}"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,+BAAyC;AACzC,yBAAkE;AACnD,SAAR,0BAA2C,OAAO;AACvD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,IAAI;AACJ,SAAoB,uCAAAA,MAAM,mBAAAC,UAAW;AAAA,IACnC,UAAU,CAAC,SAAsB,uCAAAC,KAAK,sCAAa;AAAA,MACjD,WAAW;AAAA,MACX,IAAI;AAAA,MACJ,UAAU;AAAA,IACZ,CAAC,GAAG,SAAsB,uCAAAA,KAAK,sCAAa;AAAA,MAC1C,WAAW;AAAA,MACX,UAAU;AAAA,IACZ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;",
6
- "names": ["_jsxs", "_Fragment", "_jsx"]
7
- }
@@ -1,66 +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/item/base.tsx
31
- var base_exports = {};
32
- __export(base_exports, {
33
- default: () => NavigationItemBase
34
- });
35
- module.exports = __toCommonJS(base_exports);
36
- var import_clsx = __toESM(require("clsx"));
37
- var import_element = require("@wordpress/element");
38
- var import_context = require("../context.cjs");
39
- var import_use_navigation_tree_item = require("./use-navigation-tree-item.cjs");
40
- var import_navigation_styles = require("../styles/navigation-styles.cjs");
41
- var import_jsx_runtime = require("react/jsx-runtime");
42
- var uniqueId = 0;
43
- function NavigationItemBase(props) {
44
- const {
45
- children,
46
- className,
47
- title,
48
- href,
49
- ...restProps
50
- } = props;
51
- const [itemId] = (0, import_element.useState)(`item-${++uniqueId}`);
52
- (0, import_use_navigation_tree_item.useNavigationTreeItem)(itemId, props);
53
- const {
54
- navigationTree
55
- } = (0, import_context.useNavigationContext)();
56
- if (!navigationTree.getItem(itemId)?._isVisible) {
57
- return null;
58
- }
59
- const classes = (0, import_clsx.default)("components-navigation__item", className);
60
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.ItemBaseUI, {
61
- className: classes,
62
- ...restProps,
63
- children
64
- });
65
- }
66
- //# sourceMappingURL=base.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/item/base.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 { useNavigationContext } from '../context';\nimport { useNavigationTreeItem } from './use-navigation-tree-item';\nimport { ItemBaseUI } from '../styles/navigation-styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nlet uniqueId = 0;\nexport default function NavigationItemBase(props) {\n // Also avoid to pass the `title` and `href` props to the ItemBaseUI styled component.\n const {\n children,\n className,\n title,\n href,\n ...restProps\n } = props;\n const [itemId] = useState(`item-${++uniqueId}`);\n useNavigationTreeItem(itemId, props);\n const {\n navigationTree\n } = useNavigationContext();\n if (!navigationTree.getItem(itemId)?._isVisible) {\n return null;\n }\n const classes = clsx('components-navigation__item', className);\n return /*#__PURE__*/_jsx(ItemBaseUI, {\n className: classes,\n ...restProps,\n children: children\n });\n}"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAAyB;AAKzB,qBAAqC;AACrC,sCAAsC;AACtC,+BAA2B;AAC3B,yBAA4B;AAC5B,IAAI,WAAW;AACA,SAAR,mBAAoC,OAAO;AAEhD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,CAAC,MAAM,QAAI,yBAAS,QAAQ,EAAE,QAAQ,EAAE;AAC9C,6DAAsB,QAAQ,KAAK;AACnC,QAAM;AAAA,IACJ;AAAA,EACF,QAAI,qCAAqB;AACzB,MAAI,CAAC,eAAe,QAAQ,MAAM,GAAG,YAAY;AAC/C,WAAO;AAAA,EACT;AACA,QAAM,cAAU,YAAAA,SAAK,+BAA+B,SAAS;AAC7D,SAAoB,uCAAAC,KAAK,qCAAY;AAAA,IACnC,WAAW;AAAA,IACX,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;",
6
- "names": ["clsx", "_jsx"]
7
- }
@@ -1,119 +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/item/index.tsx
31
- var item_exports = {};
32
- __export(item_exports, {
33
- NavigationItem: () => NavigationItem,
34
- default: () => item_default
35
- });
36
- module.exports = __toCommonJS(item_exports);
37
- var import_clsx = __toESM(require("clsx"));
38
- var import_icons = require("@wordpress/icons");
39
- var import_i18n = require("@wordpress/i18n");
40
- var import_button = __toESM(require("../../button/index.cjs"));
41
- var import_context = require("../context.cjs");
42
- var import_navigation_styles = require("../styles/navigation-styles.cjs");
43
- var import_base_content = __toESM(require("./base-content.cjs"));
44
- var import_base = __toESM(require("./base.cjs"));
45
- var import_jsx_runtime = require("react/jsx-runtime");
46
- var noop = () => {
47
- };
48
- function NavigationItem(props) {
49
- const {
50
- badge,
51
- children,
52
- className,
53
- href,
54
- item,
55
- navigateToMenu,
56
- onClick = noop,
57
- title,
58
- icon,
59
- hideIfTargetMenuEmpty,
60
- isText,
61
- ...restProps
62
- } = props;
63
- const {
64
- activeItem,
65
- setActiveMenu,
66
- navigationTree: {
67
- isMenuEmpty
68
- }
69
- } = (0, import_context.useNavigationContext)();
70
- if (hideIfTargetMenuEmpty && navigateToMenu && isMenuEmpty(navigateToMenu)) {
71
- return null;
72
- }
73
- const isActive = item && activeItem === item;
74
- const classes = (0, import_clsx.default)(className, {
75
- "is-active": isActive
76
- });
77
- const onItemClick = (event) => {
78
- if (navigateToMenu) {
79
- setActiveMenu(navigateToMenu);
80
- }
81
- onClick(event);
82
- };
83
- const navigationIcon = (0, import_i18n.isRTL)() ? import_icons.chevronLeft : import_icons.chevronRight;
84
- const baseProps = children ? props : {
85
- ...props,
86
- onClick: void 0
87
- };
88
- const itemProps = isText ? restProps : {
89
- as: import_button.default,
90
- __next40pxDefaultSize: "as" in restProps ? restProps.as === void 0 : true,
91
- href,
92
- onClick: onItemClick,
93
- "aria-current": isActive ? "page" : void 0,
94
- ...restProps
95
- };
96
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_base.default, {
97
- ...baseProps,
98
- className: classes,
99
- children: children || /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_navigation_styles.ItemUI, {
100
- ...itemProps,
101
- children: [icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.ItemIconUI, {
102
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, {
103
- icon
104
- })
105
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_base_content.default, {
106
- title,
107
- badge
108
- }), navigateToMenu && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, {
109
- icon: navigationIcon
110
- })]
111
- })
112
- });
113
- }
114
- var item_default = NavigationItem;
115
- // Annotate the CommonJS export names for ESM import in node:
116
- 0 && (module.exports = {
117
- NavigationItem
118
- });
119
- //# sourceMappingURL=index.cjs.map